summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormd_5 <git@md-5.net>2018-07-18 16:59:41 +1000
committermd_5 <git@md-5.net>2018-07-18 16:59:41 +1000
commit9c9800285698938340e79704430715f81e15cf77 (patch)
treeeadd1cc61197e9d9a19b3d9b574a75fad8a2d61f
parentd48ecdeb4556e22991d03625ba3f3be23e6101ec (diff)
downloadcraftbukkit-9c9800285698938340e79704430715f81e15cf77.tar
craftbukkit-9c9800285698938340e79704430715f81e15cf77.tar.gz
craftbukkit-9c9800285698938340e79704430715f81e15cf77.tar.lz
craftbukkit-9c9800285698938340e79704430715f81e15cf77.tar.xz
craftbukkit-9c9800285698938340e79704430715f81e15cf77.zip
Fix Block.setType alone being treated as legacy
-rw-r--r--src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java
index 3001cb44..bbf7b508 100644
--- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java
+++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java
@@ -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);
}
}