diff --git a/src/main/java/one/oth3r/sit/utl/Events.java b/src/main/java/one/oth3r/sit/utl/Events.java index f4f2c64..71077a9 100644 --- a/src/main/java/one/oth3r/sit/utl/Events.java +++ b/src/main/java/one/oth3r/sit/utl/Events.java @@ -74,7 +74,7 @@ public class Events { // just send the sit command if (Data.isInGame()) { if (Data.isSupportedServer()) { - player.networkHandler.sendCommand("sit"); + player.networkHandler.sendChatCommand("sit"); } else { // unsupported server message if not in a Sit! server player.sendMessage(Chat.lang("sit!.chat.unsupported") diff --git a/src/main/java/one/oth3r/sit/utl/Logic.java b/src/main/java/one/oth3r/sit/utl/Logic.java index 0433259..e5d8387 100644 --- a/src/main/java/one/oth3r/sit/utl/Logic.java +++ b/src/main/java/one/oth3r/sit/utl/Logic.java @@ -37,7 +37,7 @@ public class Logic { // check if the block is in the right y level limits from the config if (!checkYLimits(player, blockPos)) return false; - ServerWorld serverWorld = player.getServerWorld(); + ServerWorld serverWorld = player.getWorld(); Double sitHeight = Utl.getSittingHeight(player,blockPos,hitResult); @@ -60,7 +60,7 @@ public class Logic { public static boolean sit(ServerPlayerEntity player, BlockPos blockPos, @Nullable BlockHitResult hitResult) { if (!canSit(player, blockPos, hitResult)) return false; // assets - ServerWorld serverWorld = player.getServerWorld(); + ServerWorld serverWorld = player.getWorld(); Double sitHeight = Utl.getSittingHeight(player,blockPos,hitResult); // shouldn't be null because we already checked, but do another check to clear IDE errors assert sitHeight != null; @@ -77,7 +77,7 @@ public class Logic { * @return true if sitting was successful */ public static boolean sitLooking(ServerPlayerEntity player) { - return sit(player, Utl.getBlockPosPlayerIsLookingAt(player.getServerWorld(),player, + return sit(player, Utl.getBlockPosPlayerIsLookingAt(player.getWorld(),player, Utl.getPlayerReach(player)),null); } @@ -151,7 +151,7 @@ public class Logic { // get the new entity DisplayEntity.TextDisplayEntity sitEntity = Data.getSpawnList().get(player); // spawn and ride the entity - player.getServerWorld().spawnEntity(sitEntity); + player.getWorld().spawnEntity(sitEntity); player.startRiding(sitEntity); // add the entity to the list Data.addSitEntity(player, sitEntity); diff --git a/src/main/java/one/oth3r/sit/utl/Utl.java b/src/main/java/one/oth3r/sit/utl/Utl.java index d6d53bb..8e766ce 100644 --- a/src/main/java/one/oth3r/sit/utl/Utl.java +++ b/src/main/java/one/oth3r/sit/utl/Utl.java @@ -120,7 +120,7 @@ public class Utl { * @return null if not a valid block */ public static Double getSittingHeight(ServerPlayerEntity player, BlockPos blockPos, @Nullable BlockHitResult hit) { - ServerWorld serverWorld = player.getServerWorld(); + ServerWorld serverWorld = player.getWorld(); ServerConfig config = FileData.getServerConfig(); BlockState blockState = serverWorld.getBlockState(blockPos); Block block = blockState.getBlock(); @@ -266,7 +266,7 @@ public class Utl { /// FYI it cant purge an entity from a disconnected player or unloaded chunks // get a list of sit entities - List list = player.getServerWorld() + List list = player.getWorld() .getEntitiesByType(TypeFilter.instanceOf(DisplayEntity.TextDisplayEntity.class), entity -> entity.getName().getString().equals(Data.ENTITY_NAME));