From 4411ddfc171461e0f8e6c163c27585f732517a1f Mon Sep 17 00:00:00 2001 From: Jeroen Bollen Date: Thu, 11 Feb 2021 03:22:43 +0100 Subject: [PATCH] Fixed compatibility with Hydrogen See CaffeineMC/hydrogen-fabric#19 for reference. --- .../sandwichable/blocks/BlockProperties.java | 8 ++++++++ .../sandwichable/blocks/DesalinatorBlock.java | 2 +- .../sandwichable/blocks/PottedShrubBlock.java | 2 +- .../foundationgames/sandwichable/blocks/ShrubBlock.java | 2 +- .../foundationgames/sandwichable/blocks/ToasterBlock.java | 2 +- 5 files changed, 12 insertions(+), 4 deletions(-) create mode 100644 src/main/java/io/github/foundationgames/sandwichable/blocks/BlockProperties.java diff --git a/src/main/java/io/github/foundationgames/sandwichable/blocks/BlockProperties.java b/src/main/java/io/github/foundationgames/sandwichable/blocks/BlockProperties.java new file mode 100644 index 0000000..ed1d7ee --- /dev/null +++ b/src/main/java/io/github/foundationgames/sandwichable/blocks/BlockProperties.java @@ -0,0 +1,8 @@ +package io.github.foundationgames.sandwichable.blocks; + +import net.minecraft.state.property.BooleanProperty; + +public class BlockProperties { + public static final BooleanProperty ON = BooleanProperty.of("on"); + public static final BooleanProperty SNIPPED = BooleanProperty.of("snipped"); +} diff --git a/src/main/java/io/github/foundationgames/sandwichable/blocks/DesalinatorBlock.java b/src/main/java/io/github/foundationgames/sandwichable/blocks/DesalinatorBlock.java index 0fde0e2..ecfa65f 100644 --- a/src/main/java/io/github/foundationgames/sandwichable/blocks/DesalinatorBlock.java +++ b/src/main/java/io/github/foundationgames/sandwichable/blocks/DesalinatorBlock.java @@ -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 diff --git a/src/main/java/io/github/foundationgames/sandwichable/blocks/PottedShrubBlock.java b/src/main/java/io/github/foundationgames/sandwichable/blocks/PottedShrubBlock.java index 8d3a380..826c9c0 100644 --- a/src/main/java/io/github/foundationgames/sandwichable/blocks/PottedShrubBlock.java +++ b/src/main/java/io/github/foundationgames/sandwichable/blocks/PottedShrubBlock.java @@ -57,6 +57,6 @@ protected void appendProperties(StateManager.Builder builder) } static { - SNIPPED = BooleanProperty.of("snipped"); + SNIPPED = BlockProperties.SNIPPED; } } diff --git a/src/main/java/io/github/foundationgames/sandwichable/blocks/ShrubBlock.java b/src/main/java/io/github/foundationgames/sandwichable/blocks/ShrubBlock.java index 1eb90e3..eeb2960 100644 --- a/src/main/java/io/github/foundationgames/sandwichable/blocks/ShrubBlock.java +++ b/src/main/java/io/github/foundationgames/sandwichable/blocks/ShrubBlock.java @@ -82,6 +82,6 @@ protected void appendProperties(StateManager.Builder builder) } static { - SNIPPED = BooleanProperty.of("snipped"); + SNIPPED = BlockProperties.SNIPPED; } } diff --git a/src/main/java/io/github/foundationgames/sandwichable/blocks/ToasterBlock.java b/src/main/java/io/github/foundationgames/sandwichable/blocks/ToasterBlock.java index c8c0513..7696919 100644 --- a/src/main/java/io/github/foundationgames/sandwichable/blocks/ToasterBlock.java +++ b/src/main/java/io/github/foundationgames/sandwichable/blocks/ToasterBlock.java @@ -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; } }