ProtocolLib

3M Downloads

Not all information in WrappedBlockData is cloned

fvoichick opened this issue ยท 3 comments

commented

Follow this template except for feature requests. Use pastebin when providing /protocol dump and any relevant errors.

Make sure you've done the following:

  • You're using the latest build for your server version
  • This isn't an issue caused by another plugin
  • You've checked for duplicate issues
  • You didn't use /reload

Debug paste link: https://pastebin.com/BJpqXneX

Description and relevant errors:

I ran only this code in a plugin:

String dataString = "minecraft:redstone_wire[north=side,south=side]";
BlockData data = getServer().createBlockData(dataString);
WrappedBlockData wrapped = WrappedBlockData.createData(data);
Logger logger = getLogger();
logger.info("Original: " + wrapped.toString());
logger.info("Cloned: " + wrapped.deepClone().toString());

The output is the following:

Original: WrappedBlockData[handle=Block{minecraft:redstone_wire}[east=none,north=side,power=0,south=side,west=none]]
Cloned: WrappedBlockData[handle=Block{minecraft:redstone_wire}[east=none,north=none,power=0,south=none,west=none]]

Thus, the "clone" is not really a clone.

commented

Interesting. I'll look into a better cloning strategy (best guess right now would be to use to/from string)

commented

#662 might be the fix, but I'm not sure why it's failing the checks

commented

Travis is having a weird issue. The builds on the CI server are running fine