|
19 | 19 |
|
20 | 20 | package com.sk89q.worldedit.internal.wna; |
21 | 21 |
|
22 | | -import com.sk89q.jnbt.CompoundTag; |
| 22 | +import com.google.common.collect.ImmutableMap; |
23 | 23 | import com.sk89q.worldedit.WorldEditException; |
24 | 24 | import com.sk89q.worldedit.math.BlockVector3; |
25 | 25 | import com.sk89q.worldedit.util.SideEffect; |
26 | 26 | import com.sk89q.worldedit.util.SideEffectSet; |
| 27 | +import com.sk89q.worldedit.util.nbt.CompoundBinaryTag; |
| 28 | +import com.sk89q.worldedit.util.nbt.IntBinaryTag; |
| 29 | +import com.sk89q.worldedit.util.nbt.StringBinaryTag; |
27 | 30 | import com.sk89q.worldedit.world.block.BaseBlock; |
28 | 31 | import com.sk89q.worldedit.world.block.BlockState; |
29 | 32 | import com.sk89q.worldedit.world.block.BlockStateHolder; |
@@ -66,14 +69,15 @@ default <B extends BlockStateHolder<B>> boolean setBlock(BlockVector3 position, |
66 | 69 | if (successful || old == newState) { |
67 | 70 | if (block instanceof BaseBlock) { |
68 | 71 | BaseBlock baseBlock = (BaseBlock) block; |
69 | | - CompoundTag tag = baseBlock.getNbtData(); |
| 72 | + CompoundBinaryTag tag = baseBlock.getNbt(); |
70 | 73 | if (tag != null) { |
71 | | - tag = tag.createBuilder() |
72 | | - .putString("id", baseBlock.getNbtId()) |
73 | | - .putInt("x", position.getX()) |
74 | | - .putInt("y", position.getY()) |
75 | | - .putInt("z", position.getZ()) |
76 | | - .build(); |
| 74 | + tag = tag.put(ImmutableMap.of( |
| 75 | + "id", StringBinaryTag.of(baseBlock.getNbtId()), |
| 76 | + "x", IntBinaryTag.of(position.getX()), |
| 77 | + "y", IntBinaryTag.of(position.getY()), |
| 78 | + "z", IntBinaryTag.of(position.getZ()) |
| 79 | + )); |
| 80 | + |
77 | 81 | // update if TE changed as well |
78 | 82 | successful = updateTileEntity(pos, tag); |
79 | 83 | } |
@@ -136,7 +140,7 @@ default void setCurrentSideEffectSet(SideEffectSet sideEffectSet) { |
136 | 140 |
|
137 | 141 | void updateLightingForBlock(NP position); |
138 | 142 |
|
139 | | - boolean updateTileEntity(NP position, CompoundTag tag); |
| 143 | + boolean updateTileEntity(NP position, CompoundBinaryTag tag); |
140 | 144 |
|
141 | 145 | void notifyBlockUpdate(NP position, NBS oldState, NBS newState); |
142 | 146 |
|
|
0 commit comments