Skip to content

Commit

Permalink
Update to 1.20.5
Browse files Browse the repository at this point in the history
  • Loading branch information
Binero committed Apr 23, 2024
1 parent b970a10 commit 9a1a6b2
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 15 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id 'fabric-loom' version '1.4.+'
id 'fabric-loom' version '1.6.+'
id 'maven-publish'
}

Expand Down
8 changes: 4 additions & 4 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
org.gradle.jvmargs=-Xmx1G
# Fabric Properties
# check these on https://fabricmc.net/develop/
minecraft_version=1.20.4
yarn_mappings=1.20.4+build.3
loader_version=0.15.2
minecraft_version=1.20.5
yarn_mappings=1.20.5+build.1
loader_version=0.15.10
# Mod Properties
mod_version=1.4.14
maven_group=us.potatoboy
archives_base_name=InvView
# Dependencies
# check this on https://fabricmc.net/develop/
fabric_version=0.91.2+1.20.4
fabric_version=0.97.5+1.20.5
trinkets_version=3.8.0
apoli_version=2.10.3
sgui_version=1.3.0+1.20.2
20 changes: 12 additions & 8 deletions src/main/java/us/potatoboy/invview/ViewCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@

import java.util.List;
import java.util.Map;
import java.util.Optional;

public class ViewCommand {
private static final MinecraftServer minecraftServer = InvView.getMinecraftServer();
Expand Down Expand Up @@ -169,14 +170,17 @@ private static ServerPlayerEntity getRequestedPlayer(CommandContext<ServerComman

if (requestedPlayer == null) {
requestedPlayer = minecraftServer.getPlayerManager().createPlayer(requestedProfile, SyncedClientOptions.createDefault());
NbtCompound compound = minecraftServer.getPlayerManager().loadPlayerData(requestedPlayer);
if (compound != null) {
ServerWorld world = minecraftServer.getWorld(
DimensionType.worldFromDimensionNbt(new Dynamic<>(NbtOps.INSTANCE, compound.get("Dimension")))
.result().get());

if (world != null) {
((EntityAccessor) requestedPlayer).callSetWorld(world);
Optional<NbtCompound> compoundOpt = minecraftServer.getPlayerManager().loadPlayerData(requestedPlayer);
if (compoundOpt.isPresent()) {
NbtCompound compound = compoundOpt.get();
if (compound.contains("Dimension")) {
ServerWorld world = minecraftServer.getWorld(
DimensionType.worldFromDimensionNbt(new Dynamic<>(NbtOps.INSTANCE, compound.get("Dimension")))
.result().get());

if (world != null) {
((EntityAccessor) requestedPlayer).callSetWorld(world);
}
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
"invview.mixins.json"
],
"depends": {
"fabricloader": ">=0.7.2",
"fabricloader": ">=0.15.10",
"fabric": "*",
"minecraft": ">=1.20.4"
"minecraft": ">=1.20.5"
}
}

0 comments on commit 9a1a6b2

Please sign in to comment.