Skip to content

Commit

Permalink
Merge pull request #37 from TheMrEngMan/master
Browse files Browse the repository at this point in the history
  • Loading branch information
PotatoPresident authored Oct 9, 2023
2 parents b6997db + f41b989 commit ed57b9d
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 18 deletions.
4 changes: 1 addition & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,14 @@ dependencies {
"fabric-api-base",
"fabric-key-binding-api-v1",
"fabric-lifecycle-events-v1",
"fabric-rendering-v1", // MidnightLib
"fabric-models-v0", // MidnightLib
"fabric-resource-loader-v0" // MidnightLib
]

apiModules.forEach {
modImplementation include(fabricApi.module(it, project.fabric_version))
}

modImplementation include("maven.modrinth:midnightlib:${project.midnightlib_version}")
include "maven.modrinth:midnightlib:${project.midnightlib_version}"

modImplementation "com.terraformersmc:modmenu:${project.modmenu_version}", {
exclude module: "fabric-api"
Expand Down
12 changes: 6 additions & 6 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
org.gradle.jvmargs=-Xmx1G
# Fabric Properties
# check these on https://fabricmc.net/develop/
minecraft_version=1.19.4
yarn_mappings=1.19.4+build.1
loader_version=0.14.19
minecraft_version=1.20.2
yarn_mappings=1.20.2+build.1
loader_version=0.14.22
# Mod Properties
mod_version=1.8.5
mod_version=1.8.6
maven_group=us.potatoboy
archives_base_name=PetOwner
# Dependencies
# check this on https://fabricmc.net/develop/
fabric_version=0.76.0+1.19.4
fabric_version=0.89.1+1.20.2
modmenu_version=6.1.0-rc.4
midnightlib_version=1.2.1-fabric
midnightlib_version=1.5.0-fabric
13 changes: 9 additions & 4 deletions src/main/java/us/potatoboy/petowner/client/PetOwnerClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import net.minecraft.text.Text;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.jetbrains.annotations.NotNull;
import us.potatoboy.petowner.client.config.PetOwnerConfig;
import us.potatoboy.petowner.mixin.FoxTrustedAccessor;

Expand All @@ -36,11 +37,15 @@ public class PetOwnerClient implements ClientModInitializer {
.expireAfterWrite(6, TimeUnit.HOURS)
.build(new CacheLoader<>() {
@Override
public Optional<String> load(UUID key) {
public @NotNull Optional<String> load(@NotNull UUID key) {
CompletableFuture.runAsync(() -> {
GameProfile playerProfile = new GameProfile(key, null);
playerProfile = MinecraftClient.getInstance().getSessionService().fillProfileProperties(playerProfile, false);
usernameCache.put(key, Optional.ofNullable(playerProfile.getName()));
GameProfile playerProfile;
try {
playerProfile = Objects.requireNonNull(MinecraftClient.getInstance().getSessionService().fetchProfile(key, false)).profile();
usernameCache.put(key, Optional.ofNullable(playerProfile.getName()));
} catch (NullPointerException e) {
usernameCache.put(key, Optional.empty());
}
});

return Optional.of("Waiting...");
Expand Down
7 changes: 2 additions & 5 deletions src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,11 @@
]
},
"depends": {
"midnightlib": ">=1.1.0",
"midnightlib": ">=1.5.0",
"fabric-api-base": "*",
"fabric-key-binding-api-v1": "*",
"fabric-lifecycle-events-v1": "*",
"fabric-rendering-v1": "*",
"fabric-models-v0": "*",
"fabric-resource-loader-v0": "*",
"minecraft":">=1.19.4"
"minecraft":">=1.20.2"
},
"mixins": [
"petowner.mixins.json"
Expand Down

0 comments on commit ed57b9d

Please sign in to comment.