SPIGOT-611: Improve setBlock for tile->tile transitions
By: md_5 <git@md-5.net>
This commit is contained in:
parent
5c425bc41d
commit
f7d15d7d59
1 changed files with 4 additions and 0 deletions
|
|
@ -135,6 +135,10 @@ public class CraftBlock implements Block {
|
||||||
public boolean setTypeIdAndData(final int type, final byte data, final boolean applyPhysics) {
|
public boolean setTypeIdAndData(final int type, final byte data, final boolean applyPhysics) {
|
||||||
IBlockData blockData = getNMSBlock(type).fromLegacyData(data);
|
IBlockData blockData = getNMSBlock(type).fromLegacyData(data);
|
||||||
BlockPosition position = new BlockPosition(x, y, z);
|
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) {
|
if (applyPhysics) {
|
||||||
return chunk.getHandle().getWorld().setTypeAndData(position, blockData, 3);
|
return chunk.getHandle().getWorld().setTypeAndData(position, blockData, 3);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue