From 5327610c3511bab2c0a40a9cab5ff033d3a1330a Mon Sep 17 00:00:00 2001 From: DoctorMacc Date: Fri, 19 Jun 2020 13:42:55 -0400 Subject: [PATCH] Don't forget about Bukkit --- .../bukkit/world/GeyserBukkitWorldManager.java | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/bootstrap/bukkit/src/main/java/org/geysermc/platform/bukkit/world/GeyserBukkitWorldManager.java b/bootstrap/bukkit/src/main/java/org/geysermc/platform/bukkit/world/GeyserBukkitWorldManager.java index fbdf2a47b..55c79165e 100644 --- a/bootstrap/bukkit/src/main/java/org/geysermc/platform/bukkit/world/GeyserBukkitWorldManager.java +++ b/bootstrap/bukkit/src/main/java/org/geysermc/platform/bukkit/world/GeyserBukkitWorldManager.java @@ -26,16 +26,12 @@ package org.geysermc.platform.bukkit.world; -import com.github.steveice10.mc.protocol.data.game.world.block.BlockState; - import lombok.AllArgsConstructor; -import lombok.Getter; import org.bukkit.Bukkit; import org.bukkit.block.Block; import org.geysermc.connector.network.session.GeyserSession; import org.geysermc.connector.network.translators.world.WorldManager; import org.geysermc.connector.network.translators.world.block.BlockTranslator; -import org.geysermc.platform.bukkit.GeyserBukkitPlugin; import us.myles.ViaVersion.protocols.protocol1_13_1to1_13.Protocol1_13_1To1_13; import us.myles.ViaVersion.protocols.protocol1_15to1_14_4.data.MappingData; @@ -48,7 +44,7 @@ public class GeyserBukkitWorldManager extends WorldManager { private final boolean isViaVersion; @Override - public BlockState getBlockAt(GeyserSession session, int x, int y, int z) { + public int getBlockAt(GeyserSession session, int x, int y, int z) { if (session.getPlayerEntity() == null) { return BlockTranslator.AIR; } @@ -59,7 +55,7 @@ public class GeyserBukkitWorldManager extends WorldManager { } @SuppressWarnings("deprecation") - public static BlockState getLegacyBlock(GeyserSession session, int x, int y, int z, boolean isViaVersion) { + public static int getLegacyBlock(GeyserSession session, int x, int y, int z, boolean isViaVersion) { if (isViaVersion) { Block block = Bukkit.getPlayer(session.getPlayerEntity().getUsername()).getWorld().getBlockAt(x, y, z); // Black magic that gets the old block state ID @@ -68,7 +64,7 @@ public class GeyserBukkitWorldManager extends WorldManager { int thirteenBlockId = us.myles.ViaVersion.protocols.protocol1_13to1_12_2.data.MappingData.blockMappings.getNewId(oldBlockId); int thirteenPointOneBlockId = Protocol1_13_1To1_13.getNewBlockStateId(thirteenBlockId); int fourteenBlockId = us.myles.ViaVersion.protocols.protocol1_14to1_13_2.data.MappingData.blockStateMappings.getNewId(thirteenPointOneBlockId); - return new BlockState(MappingData.blockStateMappings.getNewId(fourteenBlockId)); + return MappingData.blockStateMappings.getNewId(fourteenBlockId); } else { return BlockTranslator.AIR; }