]> git.lizzy.rs Git - BoundingBoxOutlineReloaded.git/blobdiff - src/main/java/com/irtimaled/bbor/common/models/ServerPlayer.java
Setup for 1.16.3 Fabric
[BoundingBoxOutlineReloaded.git] / src / main / java / com / irtimaled / bbor / common / models / ServerPlayer.java
index 1496b16a1dc9c628809f1264d1236c676cea663c..80ce70d1bec5b91f4601ddc9ea9e42eeb3d7f68d 100644 (file)
@@ -1,21 +1,21 @@
 package com.irtimaled.bbor.common.models;
 
 import com.irtimaled.bbor.common.messages.PayloadBuilder;
-import net.minecraft.entity.player.EntityPlayerMP;
 import net.minecraft.network.Packet;
+import net.minecraft.server.network.ServerPlayerEntity;
 
 import java.util.function.Consumer;
 
 public class ServerPlayer {
-    private final int dimensionId;
+    private final DimensionId dimensionId;
     private final Consumer<Packet<?>> packetConsumer;
 
-    public ServerPlayer(EntityPlayerMP player) {
-        this.dimensionId = player.dimension.getId();
-        this.packetConsumer = player.connection::sendPacket;
+    public ServerPlayer(ServerPlayerEntity player) {
+        this.dimensionId = DimensionId.from(player.getEntityWorld().getRegistryKey());
+        this.packetConsumer = player.networkHandler::sendPacket;
     }
 
-    public int getDimensionId() {
+    public DimensionId getDimensionId() {
         return dimensionId;
     }