mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-09 03:43:40 +01:00
Cleanup sendBlockChange
By: md_5 <git@md-5.net>
This commit is contained in:
parent
56d055fb45
commit
37c904553d
1 changed files with 2 additions and 6 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue