Skip to content

Commit 07d54e1

Browse files
committed
chore: update 1.21.11
1 parent 6806857 commit 07d54e1

File tree

1 file changed

+20
-0
lines changed
  • worldedit-bukkit/adapters/adapter-1_21_11/src/main/java/com/sk89q/worldedit/bukkit/adapter/ext/fawe/v1_21_11

1 file changed

+20
-0
lines changed

worldedit-bukkit/adapters/adapter-1_21_11/src/main/java/com/sk89q/worldedit/bukkit/adapter/ext/fawe/v1_21_11/PaperweightAdapter.java

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,9 +143,11 @@
143143
import org.bukkit.Location;
144144
import org.bukkit.World;
145145
import org.bukkit.World.Environment;
146+
import org.bukkit.block.TileState;
146147
import org.bukkit.block.data.BlockData;
147148
import org.bukkit.craftbukkit.CraftServer;
148149
import org.bukkit.craftbukkit.CraftWorld;
150+
import org.bukkit.craftbukkit.block.CraftBlockEntityState;
149151
import org.bukkit.craftbukkit.block.data.CraftBlockData;
150152
import org.bukkit.craftbukkit.entity.CraftEntity;
151153
import org.bukkit.craftbukkit.entity.CraftPlayer;
@@ -589,6 +591,24 @@ public void sendFakeNBT(Player player, BlockVector3 pos, LinCompoundTag nbtData)
589591
));
590592
}
591593

594+
@Override
595+
public void sendFakeNBT(Player player, BlockVector3 pos, TileState tileState, @Nullable LinCompoundTag nbtData) {
596+
CraftBlockEntityState<?> craftState = (CraftBlockEntityState<?>) tileState;
597+
598+
CompoundTag vanillaNBT;
599+
if (nbtData == null) {
600+
vanillaNBT = craftState.getSnapshotNBT();
601+
} else {
602+
vanillaNBT = (net.minecraft.nbt.CompoundTag) fromNative(nbtData);
603+
}
604+
605+
((CraftPlayer) player).getHandle().connection.send(new ClientboundBlockEntityDataPacket(
606+
new BlockPos(pos.x(), pos.y(), pos.z()),
607+
craftState.getBlockEntity().getType(),
608+
vanillaNBT
609+
));
610+
}
611+
592612
@Override
593613
public void sendFakeOP(Player player) {
594614
((CraftPlayer) player).getHandle().connection.send(new ClientboundEntityEventPacket(

0 commit comments

Comments
 (0)