Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-11-15 12:30:06 +01:00
Cleanup sendBlockChange
Dieser Commit ist enthalten in:
Ursprung
e850144b07
Commit
5a66916c08
@ -511,9 +511,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
|||||||
public void sendBlockChange(Location loc, Material material, byte data) {
|
public void sendBlockChange(Location loc, Material material, byte data) {
|
||||||
if (getHandle().playerConnection == null) return;
|
if (getHandle().playerConnection == null) return;
|
||||||
|
|
||||||
PacketPlayOutBlockChange packet = new PacketPlayOutBlockChange(((CraftWorld) loc.getWorld()).getHandle(), new BlockPosition(loc.getBlockX(), loc.getBlockY(), loc.getBlockZ()));
|
PacketPlayOutBlockChange packet = new PacketPlayOutBlockChange(new BlockPosition(loc.getBlockX(), loc.getBlockY(), loc.getBlockZ()), CraftMagicNumbers.getBlock(material, data));
|
||||||
|
|
||||||
packet.block = CraftMagicNumbers.getBlock(material, data);
|
|
||||||
getHandle().playerConnection.sendPacket(packet);
|
getHandle().playerConnection.sendPacket(packet);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -521,9 +519,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
|||||||
public void sendBlockChange(Location loc, BlockData block) {
|
public void sendBlockChange(Location loc, BlockData block) {
|
||||||
if (getHandle().playerConnection == null) return;
|
if (getHandle().playerConnection == null) return;
|
||||||
|
|
||||||
PacketPlayOutBlockChange packet = new PacketPlayOutBlockChange(((CraftWorld) loc.getWorld()).getHandle(), new BlockPosition(loc.getBlockX(), loc.getBlockY(), loc.getBlockZ()));
|
PacketPlayOutBlockChange packet = new PacketPlayOutBlockChange(new BlockPosition(loc.getBlockX(), loc.getBlockY(), loc.getBlockZ()), ((CraftBlockData) block).getState());
|
||||||
|
|
||||||
packet.block = ((CraftBlockData) block).getState();
|
|
||||||
getHandle().playerConnection.sendPacket(packet);
|
getHandle().playerConnection.sendPacket(packet);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren