3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-12-18 04:20:08 +01:00

SPIGOT-611: Improve setBlock for tile->tile transitions

Dieser Commit ist enthalten in:
md_5 2016-06-25 20:16:48 +10:00
Ursprung 5047354766
Commit 341da0730b

Datei anzeigen

@ -135,6 +135,10 @@ public class CraftBlock implements Block {
public boolean setTypeIdAndData(final int type, final byte data, final boolean applyPhysics) {
IBlockData blockData = getNMSBlock(type).fromLegacyData(data);
BlockPosition position = new BlockPosition(x, y, z);
// SPIGOT-611: need to do this to prevent glitchiness. Easier to handle this here (like /setblock) than to fix weirdness in tile entity cleanup
chunk.getHandle().getWorld().setTypeAndData(position, Blocks.AIR.getBlockData(), 0);
if (applyPhysics) {
return chunk.getHandle().getWorld().setTypeAndData(position, blockData, 3);
} else {