Fix properties being recreated for several blocks (#2238)

This commit is contained in:
Virtuoel 2020-10-02 14:57:12 +03:00 committed by GitHub
parent 7ba962196b
commit a4bceb32a8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 8 additions and 14 deletions

View file

@ -54,8 +54,8 @@ import java.util.function.ToIntFunction;
public class LampBlock extends BaseBlockEntityProvider {
public static DirectionProperty FACING = Properties.FACING;
public static BooleanProperty ACTIVE;
public static final DirectionProperty FACING = Properties.FACING;
public static final BooleanProperty ACTIVE = BooleanProperty.of("active");
protected final VoxelShape[] shape;
private final int cost;
@ -116,7 +116,6 @@ public class LampBlock extends BaseBlockEntityProvider {
// Block
@Override
protected void appendProperties(StateManager.Builder<Block, BlockState> builder) {
ACTIVE = BooleanProperty.of("active");
builder.add(FACING, ACTIVE);
}

View file

@ -56,7 +56,7 @@ import techreborn.utils.MessageIDs;
public class PlayerDetectorBlock extends BlockMachineBase {
public static EnumProperty<PlayerDetectorType> TYPE;
public static final EnumProperty<PlayerDetectorType> TYPE = EnumProperty.of("type", PlayerDetectorType.class);
public PlayerDetectorBlock() {
super(Block.Settings.of(Material.METAL).strength(2f, 2f), true);
@ -143,7 +143,6 @@ public class PlayerDetectorBlock extends BlockMachineBase {
@Override
protected void appendProperties(StateManager.Builder<Block, BlockState> builder) {
TYPE = EnumProperty.of("type", PlayerDetectorType.class);
builder.add(TYPE);
}

View file

@ -26,9 +26,9 @@ import java.util.function.Supplier;
public class ResinBasinBlock extends BaseBlockEntityProvider {
public static DirectionProperty FACING = Properties.HORIZONTAL_FACING;
public static BooleanProperty POURING = BooleanProperty.of("pouring");
public static BooleanProperty FULL = BooleanProperty.of("full");
public static final DirectionProperty FACING = Properties.HORIZONTAL_FACING;
public static final BooleanProperty POURING = BooleanProperty.of("pouring");
public static final BooleanProperty FULL = BooleanProperty.of("full");
Supplier<BlockEntity> blockEntityClass;
public ResinBasinBlock(Supplier<BlockEntity> blockEntityClass) {
@ -51,9 +51,6 @@ public class ResinBasinBlock extends BaseBlockEntityProvider {
// Block
@Override
protected void appendProperties(StateManager.Builder<Block, BlockState> builder) {
FACING = DirectionProperty.of("facing", Direction.Type.HORIZONTAL);
POURING = BooleanProperty.of("pouring");
FULL = BooleanProperty.of("full");
builder.add(FACING, POURING, FULL);
}

View file

@ -55,8 +55,8 @@ import org.jetbrains.annotations.Nullable;
import java.util.List;
public class BlockAlarm extends BaseBlockEntityProvider {
public static DirectionProperty FACING = Properties.FACING;
public static BooleanProperty ACTIVE;
public static final DirectionProperty FACING = Properties.FACING;
public static final BooleanProperty ACTIVE = BooleanProperty.of("active");
protected final VoxelShape[] shape;
public BlockAlarm() {
@ -107,7 +107,6 @@ public class BlockAlarm extends BaseBlockEntityProvider {
// Block
@Override
protected void appendProperties(StateManager.Builder<Block, BlockState> builder) {
ACTIVE = BooleanProperty.of("active");
builder.add(FACING, ACTIVE);
}