mirror of
https://github.com/dmulloy2/ProtocolLib.git
synced 2025-01-08 09:27:34 +01:00
parent
553e4b6813
commit
f381f0a2f7
@ -82,6 +82,7 @@ public class BukkitCloner implements Cloner {
|
||||
fromWrapper(MinecraftReflection::getNBTBaseClass, NbtFactory::fromNMS);
|
||||
fromWrapper(MinecraftReflection::getIChatBaseComponentClass, WrappedChatComponent::fromHandle);
|
||||
fromWrapper(WrappedVillagerData::getNmsClass, WrappedVillagerData::fromHandle);
|
||||
fromConverter(MinecraftReflection::getSectionPositionClass, BukkitConverters.getSectionPositionConverter());
|
||||
|
||||
try {
|
||||
fromManual(ComponentConverter::getBaseComponentArrayClass, source ->
|
||||
|
@ -1872,6 +1872,10 @@ public class MinecraftReflection {
|
||||
return getCraftBukkitClass("CraftSound");
|
||||
}
|
||||
|
||||
public static Class<?> getSectionPositionClass() {
|
||||
return getMinecraftClass("SectionPosition");
|
||||
}
|
||||
|
||||
// ---- ItemStack conversions
|
||||
private static Object itemStackAir = null;
|
||||
private static Method asNMSCopy = null;
|
||||
|
@ -560,6 +560,9 @@ public class PacketContainerTest {
|
||||
|
||||
packet.getSectionPositions().writeSafely(0, new BlockPosition(42, 43, 44));
|
||||
assertEquals(new BlockPosition(42, 43, 44), packet.getSectionPositions().readSafely(0));
|
||||
|
||||
PacketContainer clone = packet.deepClone();
|
||||
assertNotSame(clone, packet);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user