mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-05 18:27:17 +01:00
SPIGOT-6754: Temporarily restore previous behaviour for tile entities with removed blocks
By: md_5 <git@md-5.net>
This commit is contained in:
parent
188d3b23d0
commit
e9ecd12983
2 changed files with 6 additions and 1 deletions
|
@ -6,7 +6,7 @@ import org.bukkit.World;
|
|||
import org.bukkit.block.TileState;
|
||||
import org.bukkit.persistence.PersistentDataContainer;
|
||||
|
||||
public abstract class CraftBlockEntityState<T extends TileEntity> extends CraftBlockState implements TileState {
|
||||
public class CraftBlockEntityState<T extends TileEntity> extends CraftBlockState implements TileState {
|
||||
|
||||
private final T tileEntity;
|
||||
private final T snapshot;
|
||||
|
|
|
@ -106,6 +106,11 @@ public final class CraftBlockStates {
|
|||
private static final BlockStateFactory<?> DEFAULT_FACTORY = new BlockStateFactory<CraftBlockState>(CraftBlockState.class) {
|
||||
@Override
|
||||
public CraftBlockState createBlockState(World world, BlockPosition blockPosition, IBlockData blockData, TileEntity tileEntity) {
|
||||
// SPIGOT-6754: Temporarily restore previous behaviour for tile entities with removed blocks
|
||||
if (tileEntity != null) {
|
||||
// block with unhandled TileEntity:
|
||||
return new CraftBlockEntityState<>(world, tileEntity);
|
||||
}
|
||||
Preconditions.checkState(tileEntity == null, "Unexpected BlockState for %s", CraftMagicNumbers.getMaterial(blockData.getBlock()));
|
||||
return new CraftBlockState(world, blockPosition, blockData);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue