mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-26 02:47:44 +01:00
Fix Block.setType alone being treated as legacy
This commit is contained in:
parent
d48ecdeb45
commit
9c98002856
@ -130,7 +130,7 @@ public class CraftBlock implements Block {
|
||||
|
||||
@Override
|
||||
public void setType(Material type, boolean applyPhysics) {
|
||||
setTypeAndData(type, (byte) 0, applyPhysics);
|
||||
setBlockData(type.createBlockData(), applyPhysics);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -143,10 +143,6 @@ public class CraftBlock implements Block {
|
||||
setTypeAndData(((CraftBlockData) data).getState(), applyPhysics);
|
||||
}
|
||||
|
||||
public boolean setTypeAndData(final Material type, final byte data, final boolean applyPhysics) {
|
||||
return setTypeAndData(CraftMagicNumbers.getBlock(type, data), applyPhysics);
|
||||
}
|
||||
|
||||
public boolean setTypeAndData(final IBlockData blockData, final boolean applyPhysics) {
|
||||
// SPIGOT-611: need to do this to prevent glitchiness. Easier to handle this here (like /setblock) than to fix weirdness in tile entity cleanup
|
||||
if (!blockData.isAir() && blockData.getBlock() instanceof BlockTileEntity && blockData.getBlock() != getNMSBlock()) {
|
||||
@ -529,7 +525,7 @@ public class CraftBlock implements Block {
|
||||
if (itemCausesDrops(item)) {
|
||||
return breakNaturally();
|
||||
} else {
|
||||
return setTypeAndData(Material.AIR, (byte) 0, true);
|
||||
return setTypeAndData(Blocks.AIR.getBlockData(), true);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user