Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed compatibility with Hydrogen #81

Merged
merged 3 commits into from
Feb 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package io.github.foundationgames.sandwichable.blocks;

import io.github.foundationgames.sandwichable.blocks.DesalinatorBlock.FluidType;
import net.minecraft.state.property.BooleanProperty;
import net.minecraft.state.property.EnumProperty;
import net.minecraft.state.property.IntProperty;

public class BlockProperties {
public static final BooleanProperty ON = BooleanProperty.of("on");
public static final BooleanProperty SNIPPED = BooleanProperty.of("snipped");

public static final IntProperty AGE = IntProperty.of("age", 0, 4);
public static final IntProperty STAGE = IntProperty.of("stage", 0, 4);

public static final EnumProperty<FluidType> FLUID = EnumProperty.of("fluid", FluidType.class);
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
public class BottleCrateBlock extends BlockWithEntity {
public static final DirectionProperty FACING = Properties.FACING;
public static final BooleanProperty OPEN = Properties.OPEN;
public static final IntProperty STAGE = IntProperty.of("stage", 0, 4);
public static final IntProperty STAGE = BlockProperties.STAGE;

protected BottleCrateBlock(Settings settings) {
super(settings);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public VoxelShape getOutlineShape(BlockState state, BlockView view, BlockPos pos
}

static {
AGE = IntProperty.of("age", 0, 4);
AGE = BlockProperties.AGE;
AGE_TO_SHAPE = new VoxelShape[]{Block.createCuboidShape(0.0D, 0.0D, 0.0D, 16.0D, 2.0D, 16.0D), Block.createCuboidShape(0.0D, 0.0D, 0.0D, 16.0D, 6.0D, 16.0D), Block.createCuboidShape(0.0D, 0.0D, 0.0D, 16.0D, 12.0D, 16.0D), Block.createCuboidShape(0.0D, 0.0D, 0.0D, 16.0D, 14.0D, 16.0D), Block.createCuboidShape(0.0D, 0.0D, 0.0D, 16.0D, 16.0D, 16.0D)};
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public class DesalinatorBlock extends BlockWithEntity implements Waterloggable,

public static final VoxelShape SHAPE;
public static final BooleanProperty ON;
public static final EnumProperty<FluidType> FLUID = EnumProperty.of("fluid", FluidType.class);
public static final EnumProperty<FluidType> FLUID = BlockProperties.FLUID;

public DesalinatorBlock(Settings settings) {
super(settings);
Expand Down Expand Up @@ -146,7 +146,7 @@ public int getComparatorOutput(BlockState state, World world, BlockPos pos) {

static {
SHAPE = createCuboidShape(1, 0, 1, 15, 16, 15);
ON = BooleanProperty.of("on");
ON = BlockProperties.ON;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public VoxelShape getOutlineShape(BlockState state, BlockView view, BlockPos pos
}

static {
AGE = IntProperty.of("age", 0, 4);
AGE = BlockProperties.AGE;
AGE_TO_SHAPE = new VoxelShape[]{Block.createCuboidShape(5.0D, 0.0D, 5.0D, 11.0D, 2.0D, 11.0D), Block.createCuboidShape(4.0D, 0.0D, 4.0D, 12.0D, 3.0D, 12.0D), Block.createCuboidShape(3.0D, 0.0D, 3.0D, 13.0D, 4.0D, 13.0D), Block.createCuboidShape(2.0D, 0.0D, 2.0D, 14.0D, 5.0D, 14.0D), Block.createCuboidShape(1.0D, 0.0D, 1.0D, 15.0D, 8.0D, 15.0D)};
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,6 @@ protected void appendProperties(StateManager.Builder<Block, BlockState> builder)
}

static {
SNIPPED = BooleanProperty.of("snipped");
SNIPPED = BlockProperties.SNIPPED;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,6 @@ protected void appendProperties(StateManager.Builder<Block, BlockState> builder)
}

static {
SNIPPED = BooleanProperty.of("snipped");
SNIPPED = BlockProperties.SNIPPED;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ public BlockState getPlacementState(ItemPlacementContext ctx) {
Block.createCuboidShape(2, 1, 4, 14, 10, 12)
);

ON = BooleanProperty.of("on");
ON = BlockProperties.ON;
WATERLOGGED = Properties.WATERLOGGED;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public VoxelShape getOutlineShape(BlockState state, BlockView view, BlockPos pos
}

static {
AGE = IntProperty.of("age", 0, 4);
AGE = BlockProperties.AGE;
AGE_TO_SHAPE = new VoxelShape[]{Block.createCuboidShape(0.0D, 0.0D, 0.0D, 16.0D, 2.0D, 16.0D), Block.createCuboidShape(0.0D, 0.0D, 0.0D, 16.0D, 6.0D, 16.0D), Block.createCuboidShape(0.0D, 0.0D, 0.0D, 16.0D, 12.0D, 16.0D), Block.createCuboidShape(0.0D, 0.0D, 0.0D, 16.0D, 14.0D, 16.0D), Block.createCuboidShape(0.0D, 0.0D, 0.0D, 16.0D, 16.0D, 16.0D)};
}
}