Fix typo in method and typo in wrong version used for state id

This commit is contained in:
libraryaddict 2025-01-06 15:41:29 +13:00
parent c49eb5b575
commit d0948b76f5
4 changed files with 7 additions and 7 deletions

View File

@ -98,7 +98,7 @@ public class FallingBlockWatcher extends FlagWatcher {
@MethodMappedAs("getBlock") @MethodMappedAs("getBlock")
public WrappedBlockState getBlockState() { public WrappedBlockState getBlockState() {
return ReflectionManager.getWrapepdBlockStateByCombinedId(getBlockCombinedId()); return ReflectionManager.getWrappedBlockStateByCombinedId(getBlockCombinedId());
} }
@MethodMappedAs("setBlock") @MethodMappedAs("setBlock")

View File

@ -36,7 +36,7 @@ public class MinecartWatcher extends FlagWatcher {
} }
public WrappedBlockState getBlock() { public WrappedBlockState getBlock() {
return ReflectionManager.getWrapepdBlockStateByCombinedId(getData(MetaIndex.MINECART_BLOCK)); return ReflectionManager.getWrappedBlockStateByCombinedId(getData(MetaIndex.MINECART_BLOCK));
} }
public void setBlock(WrappedBlockState state) { public void setBlock(WrappedBlockState state) {

View File

@ -41,6 +41,6 @@ public class SerializerWrappedBlockData implements JsonSerializer<WrappedBlockSt
int combinedID = stateType.getId(PacketEvents.getAPI().getServerManager().getVersion().toClientVersion()) << 4 | data; int combinedID = stateType.getId(PacketEvents.getAPI().getServerManager().getVersion().toClientVersion()) << 4 | data;
return ReflectionManager.getWrapepdBlockStateByCombinedId(combinedID); return ReflectionManager.getWrappedBlockStateByCombinedId(combinedID);
} }
} }

View File

@ -1483,7 +1483,7 @@ public class ReflectionManager {
} else if (index.isItemStack()) { } else if (index.isItemStack()) {
return (T) DisguiseUtilities.toBukkitItemStack((com.github.retrooper.packetevents.protocol.item.ItemStack) value); return (T) DisguiseUtilities.toBukkitItemStack((com.github.retrooper.packetevents.protocol.item.ItemStack) value);
} else if (index.isBlock() || index.isBlockOpt()) { } else if (index.isBlock() || index.isBlockOpt()) {
return (T) ReflectionManager.getWrapepdBlockStateByCombinedId((int) value); return (T) ReflectionManager.getWrappedBlockStateByCombinedId((int) value);
/* BlockData data = getBlockDataByCombinedId((int) value); /* BlockData data = getBlockDataByCombinedId((int) value);
return (T) SpigotConversionUtil.fromBukkitBlockData(data);*/ return (T) SpigotConversionUtil.fromBukkitBlockData(data);*/
@ -1886,13 +1886,13 @@ public class ReflectionManager {
public static int getCombinedIdByWrappedBlockState(WrappedBlockState state) { public static int getCombinedIdByWrappedBlockState(WrappedBlockState state) {
if (NmsVersion.v1_13.isSupported()) { if (NmsVersion.v1_13.isSupported()) {
return state.getType().getMapped().getId(PacketEvents.getAPI().getServerManager().getVersion().toClientVersion()); return state.getGlobalId();
} }
return state.getGlobalId(); return state.getType().getMapped().getId(PacketEvents.getAPI().getServerManager().getVersion().toClientVersion());
} }
public static WrappedBlockState getWrapepdBlockStateByCombinedId(int combinedId) { public static WrappedBlockState getWrappedBlockStateByCombinedId(int combinedId) {
if (NmsVersion.v1_13.isSupported()) { if (NmsVersion.v1_13.isSupported()) {
return WrappedBlockState.getByGlobalId(combinedId); return WrappedBlockState.getByGlobalId(combinedId);
} }