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