From 48b38d92851585472b602c9d48696fed76f76de8 Mon Sep 17 00:00:00 2001 From: s809 <11816467-s809@users.noreply.gitlab.com> Date: Sun, 28 Jul 2024 19:58:35 +0500 Subject: [PATCH] Fix compilation --- .../common/wrappers/misc/ServerPlayerWrapper.java | 13 +++++++------ .../distanthorizons/fabric/FabricClientProxy.java | 2 ++ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/misc/ServerPlayerWrapper.java b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/misc/ServerPlayerWrapper.java index 2c14b8fdf..be725eed5 100644 --- a/common/src/main/java/com/seibel/distanthorizons/common/wrappers/misc/ServerPlayerWrapper.java +++ b/common/src/main/java/com/seibel/distanthorizons/common/wrappers/misc/ServerPlayerWrapper.java @@ -7,7 +7,7 @@ import com.seibel.distanthorizons.core.wrapperInterfaces.misc.IServerPlayerWrapp import com.seibel.distanthorizons.core.wrapperInterfaces.world.IServerLevelWrapper; import com.seibel.distanthorizons.core.util.math.Vec3d; import net.minecraft.server.level.ServerPlayer; -import net.minecraft.server.network.ServerPlayerConnection; +import net.minecraft.server.network.ServerGamePacketListenerImpl; import net.minecraft.world.phys.Vec3; import java.net.SocketAddress; @@ -19,12 +19,12 @@ import java.util.concurrent.ConcurrentMap; */ public class ServerPlayerWrapper implements IServerPlayerWrapper { - private static final ConcurrentMap serverPlayerWrapperMap = new MapMaker().weakKeys().weakValues().makeMap(); + private static final ConcurrentMap serverPlayerWrapperMap = new MapMaker().weakKeys().weakValues().makeMap(); - private final ServerPlayerConnection connection; + private final ServerGamePacketListenerImpl connection; private ServerPlayer serverPlayer() { - return this.connection.getPlayer(); + return this.connection.player; } public static ServerPlayerWrapper getWrapper(ServerPlayer serverPlayer) @@ -32,7 +32,7 @@ public class ServerPlayerWrapper implements IServerPlayerWrapper return serverPlayerWrapperMap.computeIfAbsent(serverPlayer.connection, ignored -> new ServerPlayerWrapper(serverPlayer.connection)); } - private ServerPlayerWrapper(ServerPlayerConnection connection) + private ServerPlayerWrapper(ServerGamePacketListenerImpl connection) { this.connection = connection; } @@ -96,10 +96,11 @@ public class ServerPlayerWrapper implements IServerPlayerWrapper { return true; } - if (!(o instanceof ServerPlayerWrapper that)) + if (!(o instanceof ServerPlayerWrapper)) { return false; } + ServerPlayerWrapper that = (ServerPlayerWrapper) o; return Objects.equal(this.connection, that.connection); } diff --git a/fabric/src/main/java/com/seibel/distanthorizons/fabric/FabricClientProxy.java b/fabric/src/main/java/com/seibel/distanthorizons/fabric/FabricClientProxy.java index 0e29b817b..0cbfe8560 100644 --- a/fabric/src/main/java/com/seibel/distanthorizons/fabric/FabricClientProxy.java +++ b/fabric/src/main/java/com/seibel/distanthorizons/fabric/FabricClientProxy.java @@ -51,6 +51,8 @@ import net.minecraft.client.gui.screens.TitleScreen; #if MC_VER >= MC_1_20_6 import com.seibel.distanthorizons.common.CommonPacketPayload; import net.fabricmc.fabric.api.networking.v1.PayloadTypeRegistry; +#else +import com.seibel.distanthorizons.core.network.messages.NetworkMessage; #endif #if MC_VER < MC_1_19_4