geforkt von Mirrors/Paper
SPIGOT-3725, SPIGOT-6638, MC-136917: Properly clear tile entities before replacing
By: DerFrZocker <derrieple@gmail.com>
Dieser Commit ist enthalten in:
Ursprung
fd8748b4bd
Commit
1e8509d8ef
@ -19,7 +19,6 @@ import net.minecraft.world.level.GeneratorAccess;
|
||||
import net.minecraft.world.level.RayTrace;
|
||||
import net.minecraft.world.level.biome.BiomeBase;
|
||||
import net.minecraft.world.level.block.BlockRedstoneWire;
|
||||
import net.minecraft.world.level.block.BlockTileEntity;
|
||||
import net.minecraft.world.level.block.Blocks;
|
||||
import net.minecraft.world.level.block.entity.TileEntity;
|
||||
import net.minecraft.world.level.block.state.IBlockData;
|
||||
@ -74,10 +73,6 @@ public class CraftBlock implements Block {
|
||||
return new CraftBlock(world, position);
|
||||
}
|
||||
|
||||
private net.minecraft.world.level.block.Block getNMSBlock() {
|
||||
return getNMS().getBlock();
|
||||
}
|
||||
|
||||
public net.minecraft.world.level.block.state.IBlockData getNMS() {
|
||||
return world.getType(position);
|
||||
}
|
||||
@ -189,7 +184,7 @@ public class CraftBlock implements Block {
|
||||
|
||||
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()) {
|
||||
if (getNMS().isTileEntity()) { // SPIGOT-3725 always remove old tile entity
|
||||
// SPIGOT-4612: faster - just clear tile
|
||||
if (world instanceof net.minecraft.world.level.World) {
|
||||
((net.minecraft.world.level.World) world).removeTileEntity(position);
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren