From 37c904553d70eb83b0ef526c87ce407e7bfb9df3 Mon Sep 17 00:00:00 2001 From: CraftBukkit/Spigot Date: Sun, 16 Aug 2020 17:55:55 +1000 Subject: [PATCH] Cleanup sendBlockChange By: md_5 --- .../java/org/bukkit/craftbukkit/entity/CraftPlayer.java | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java index e9d4b763c8..28613b3995 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -511,9 +511,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { public void sendBlockChange(Location loc, Material material, byte data) { if (getHandle().playerConnection == null) return; - PacketPlayOutBlockChange packet = new PacketPlayOutBlockChange(((CraftWorld) loc.getWorld()).getHandle(), new BlockPosition(loc.getBlockX(), loc.getBlockY(), loc.getBlockZ())); - - packet.block = CraftMagicNumbers.getBlock(material, data); + PacketPlayOutBlockChange packet = new PacketPlayOutBlockChange(new BlockPosition(loc.getBlockX(), loc.getBlockY(), loc.getBlockZ()), CraftMagicNumbers.getBlock(material, data)); getHandle().playerConnection.sendPacket(packet); } @@ -521,9 +519,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { public void sendBlockChange(Location loc, BlockData block) { if (getHandle().playerConnection == null) return; - PacketPlayOutBlockChange packet = new PacketPlayOutBlockChange(((CraftWorld) loc.getWorld()).getHandle(), new BlockPosition(loc.getBlockX(), loc.getBlockY(), loc.getBlockZ())); - - packet.block = ((CraftBlockData) block).getState(); + PacketPlayOutBlockChange packet = new PacketPlayOutBlockChange(new BlockPosition(loc.getBlockX(), loc.getBlockY(), loc.getBlockZ()), ((CraftBlockData) block).getState()); getHandle().playerConnection.sendPacket(packet); }