mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-07-04 03:56:41 +00:00
@ -69,7 +69,7 @@ public class BaseBlock implements BlockStateHolder<BaseBlock>, TileEntityBlock {
|
||||
*/
|
||||
public BaseBlock(BlockState blockState) {
|
||||
this.blockState = blockState;
|
||||
nbtData = null;
|
||||
this.nbtData = null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -62,12 +62,12 @@ public class BlockState implements BlockStateHolder<BlockState>, Pattern {
|
||||
private final BaseBlock emptyBaseBlock;
|
||||
private CompoundInput compoundInput = CompoundInput.NULL;
|
||||
|
||||
protected BlockState(BlockType blockType, int internalId, int ordinal) {
|
||||
protected BlockState(BlockType blockType, int internalId, int ordinal, CompoundTag tile) {
|
||||
this.blockType = blockType;
|
||||
this.internalId = internalId;
|
||||
this.ordinal = ordinal;
|
||||
this.ordinalChar = (char) ordinal;
|
||||
this.emptyBaseBlock = new ImmutableBaseBlock(this);
|
||||
this.emptyBaseBlock = new ImmutableBaseBlock(this, tile);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -186,7 +186,7 @@ public interface BlockStateHolder<B extends BlockStateHolder<B>> extends TileEnt
|
||||
*/
|
||||
@Nullable
|
||||
default CompoundTag getNbtData() {
|
||||
return null;
|
||||
return getBlockType().getMaterial().isTile() ? getBlockType().getMaterial().getDefaultTile() : null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -98,7 +98,7 @@ public class BlockTypesCache {
|
||||
int ordinal = this.stateOrdinals[propId];
|
||||
if (ordinal != -1) {
|
||||
int stateId = internalId + (propId << BIT_OFFSET);
|
||||
BlockState state = new BlockState(type, stateId, ordinal);
|
||||
BlockState state = new BlockState(type, stateId, ordinal, blockMaterial.getDefaultTile());
|
||||
states.add(state);
|
||||
}
|
||||
}
|
||||
@ -106,7 +106,7 @@ public class BlockTypesCache {
|
||||
|
||||
this.defaultState = states.get(this.stateOrdinals[defaultPropId]);
|
||||
} else {
|
||||
this.defaultState = new BlockState(type, internalId, states.size());
|
||||
this.defaultState = new BlockState(type, internalId, states.size(), blockMaterial.getDefaultTile());
|
||||
states.add(this.defaultState);
|
||||
}
|
||||
}
|
||||
|
@ -48,7 +48,7 @@ public class FuzzyBlockState extends BlockState {
|
||||
}
|
||||
|
||||
private FuzzyBlockState(BlockState state, Map<Property<?>, Object> values) {
|
||||
super(state.getBlockType(), state.getInternalId(), state.getOrdinal());
|
||||
super(state.getBlockType(), state.getInternalId(), state.getOrdinal(), null);
|
||||
if (values == null || values.isEmpty()) {
|
||||
props = Collections.emptyMap();
|
||||
this.values = Collections.emptyMap();
|
||||
|
@ -13,16 +13,19 @@ public final class ImmutableBaseBlock extends BaseBlock {
|
||||
public ImmutableBaseBlock(BlockState blockState) {
|
||||
super(blockState);
|
||||
}
|
||||
public ImmutableBaseBlock(BlockState blockState, CompoundTag tile) {
|
||||
super(blockState, tile);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public CompoundTag getNbtData() {
|
||||
return null;
|
||||
return getBlockType().getMaterial().isTile() ? getBlockType().getMaterial().getDefaultTile() : null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasNbtData() {
|
||||
return false;
|
||||
return getBlockType().getMaterial().isTile();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Reference in New Issue
Block a user