Advertisement
Vaerys_Dawn

could not deserialize nbt

Jan 25th, 2021
1,044
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.19 KB | None | 0 0
  1.         private CompoundNBT initNbt() {
  2.             if (nbtData != null) {
  3.                 InputStream stream = new ByteArrayInputStream(nbtData.getBytes(Charset.forName("UTF-8")));
  4.                 try {
  5.                     nbt = CompoundNBT.READER.read(new DataInputStream(stream), 255, NBTSizeTracker.INFINITE);
  6.                 } catch (IOException e) {
  7.                     nbt = new CompoundNBT();
  8.                     LOGGER.warn(String.format("could not deserialize NBT: [%s]", nbtData));
  9.                 }
  10.             } else {
  11.                 nbt = new CompoundNBT();
  12.             }
  13.             CompoundNBT test = new CompoundNBT();
  14.             test.putString("Type", "brown");
  15.             test.putInt("Age", 100);
  16.             test.putBoolean("NoAi", true);
  17.             System.out.println(nbt.toString());
  18.             System.out.println(test.toString());
  19.             return nbt;
  20.         }
  21.  
  22. [07:36:17] [Server thread/INFO] [STDOUT/]: [com.resourcefulbees.resourcefulbees.api.beedata.MutationData$MutationOutput:initNbt:337]: {}
  23. [07:36:17] [Server thread/INFO] [STDOUT/]: [com.resourcefulbees.resourcefulbees.api.beedata.MutationData$MutationOutput:initNbt:338]: {Type:"brown",NoAi:1b,Age:100}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement