From be96feb704db0084bba3f3a2d8cfd26826a44496 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Wed, 26 Feb 2020 10:55:19 +0100 Subject: [PATCH] nether version of the catalysts --- .../blockstates/conversion_catalyst.json | 7 ---- .../blockstates/crushing_catalyst.json | 7 ---- .../block/conversion_catalyst_nether.json | 6 +++ .../block/crushing_catalyst_nether.json | 6 +++ .../naturesaura/blocks/BlockCatalyst.java | 38 ++++++++++++++++++ .../ellpeck/naturesaura/reg/ModRegistry.java | 4 +- .../blockstates/conversion_catalyst.json | 10 +++++ .../blockstates/crushing_catalyst.json | 10 +++++ .../block/conversion_catalyst_nether.png | Bin 0 -> 692 bytes .../block/crushing_catalyst_nether.png | Bin 0 -> 779 bytes 10 files changed, 72 insertions(+), 16 deletions(-) delete mode 100644 src/generated/resources/assets/naturesaura/blockstates/conversion_catalyst.json delete mode 100644 src/generated/resources/assets/naturesaura/blockstates/crushing_catalyst.json create mode 100644 src/generated/resources/assets/naturesaura/models/block/conversion_catalyst_nether.json create mode 100644 src/generated/resources/assets/naturesaura/models/block/crushing_catalyst_nether.json create mode 100644 src/main/java/de/ellpeck/naturesaura/blocks/BlockCatalyst.java create mode 100644 src/main/resources/assets/naturesaura/blockstates/conversion_catalyst.json create mode 100644 src/main/resources/assets/naturesaura/blockstates/crushing_catalyst.json create mode 100644 src/main/resources/assets/naturesaura/textures/block/conversion_catalyst_nether.png create mode 100644 src/main/resources/assets/naturesaura/textures/block/crushing_catalyst_nether.png diff --git a/src/generated/resources/assets/naturesaura/blockstates/conversion_catalyst.json b/src/generated/resources/assets/naturesaura/blockstates/conversion_catalyst.json deleted file mode 100644 index afc2b40f..00000000 --- a/src/generated/resources/assets/naturesaura/blockstates/conversion_catalyst.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "variants": { - "": { - "model": "naturesaura:block/conversion_catalyst" - } - } -} \ No newline at end of file diff --git a/src/generated/resources/assets/naturesaura/blockstates/crushing_catalyst.json b/src/generated/resources/assets/naturesaura/blockstates/crushing_catalyst.json deleted file mode 100644 index 0fec8c24..00000000 --- a/src/generated/resources/assets/naturesaura/blockstates/crushing_catalyst.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "variants": { - "": { - "model": "naturesaura:block/crushing_catalyst" - } - } -} \ No newline at end of file diff --git a/src/generated/resources/assets/naturesaura/models/block/conversion_catalyst_nether.json b/src/generated/resources/assets/naturesaura/models/block/conversion_catalyst_nether.json new file mode 100644 index 00000000..7e2060fd --- /dev/null +++ b/src/generated/resources/assets/naturesaura/models/block/conversion_catalyst_nether.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "naturesaura:block/conversion_catalyst_nether" + } +} \ No newline at end of file diff --git a/src/generated/resources/assets/naturesaura/models/block/crushing_catalyst_nether.json b/src/generated/resources/assets/naturesaura/models/block/crushing_catalyst_nether.json new file mode 100644 index 00000000..dcca3588 --- /dev/null +++ b/src/generated/resources/assets/naturesaura/models/block/crushing_catalyst_nether.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "naturesaura:block/crushing_catalyst_nether" + } +} \ No newline at end of file diff --git a/src/main/java/de/ellpeck/naturesaura/blocks/BlockCatalyst.java b/src/main/java/de/ellpeck/naturesaura/blocks/BlockCatalyst.java new file mode 100644 index 00000000..33861159 --- /dev/null +++ b/src/main/java/de/ellpeck/naturesaura/blocks/BlockCatalyst.java @@ -0,0 +1,38 @@ +package de.ellpeck.naturesaura.blocks; + +import de.ellpeck.naturesaura.api.NaturesAuraAPI; +import de.ellpeck.naturesaura.api.aura.type.IAuraType; +import de.ellpeck.naturesaura.data.BlockStateGenerator; +import de.ellpeck.naturesaura.reg.ICustomBlockState; +import net.minecraft.block.Block; +import net.minecraft.block.BlockState; +import net.minecraft.item.BlockItemUseContext; +import net.minecraft.state.BooleanProperty; +import net.minecraft.state.StateContainer; + +public class BlockCatalyst extends BlockImpl implements ICustomBlockState { + public static final BooleanProperty NETHER = BlockNatureAltar.NETHER; + + public BlockCatalyst(String baseName, Properties properties) { + super(baseName, properties); + this.setDefaultState(this.getDefaultState().with(NETHER, false)); + } + + @Override + public BlockState getStateForPlacement(BlockItemUseContext context) { + boolean nether = IAuraType.forWorld(context.getWorld()).isSimilar(NaturesAuraAPI.TYPE_NETHER); + return super.getStateForPlacement(context).with(NETHER, nether); + } + + @Override + protected void fillStateContainer(StateContainer.Builder builder) { + super.fillStateContainer(builder); + builder.add(NETHER); + } + + @Override + public void generateCustomBlockState(BlockStateGenerator generator) { + generator.models().cubeAll(this.getBaseName(), generator.modLoc("block/" + this.getBaseName())); + generator.models().cubeAll(this.getBaseName() + "_nether", generator.modLoc("block/" + this.getBaseName() + "_nether")); + } +} diff --git a/src/main/java/de/ellpeck/naturesaura/reg/ModRegistry.java b/src/main/java/de/ellpeck/naturesaura/reg/ModRegistry.java index f74b71b5..f392100b 100644 --- a/src/main/java/de/ellpeck/naturesaura/reg/ModRegistry.java +++ b/src/main/java/de/ellpeck/naturesaura/reg/ModRegistry.java @@ -93,8 +93,8 @@ public final class ModRegistry { new BlockFurnaceHeater(), new BlockPotionGenerator(), new BlockAuraDetector(), - new BlockImpl("conversion_catalyst", ModBlocks.prop(Material.ROCK).sound(SoundType.STONE).hardnessAndResistance(2.5F)), - new BlockImpl("crushing_catalyst", ModBlocks.prop(Material.ROCK).sound(SoundType.STONE).hardnessAndResistance(2.5F)), + new BlockCatalyst("conversion_catalyst", ModBlocks.prop(Material.ROCK).sound(SoundType.STONE).hardnessAndResistance(2.5F)), + new BlockCatalyst("crushing_catalyst", ModBlocks.prop(Material.ROCK).sound(SoundType.STONE).hardnessAndResistance(2.5F)), new BlockFlowerGenerator(), new BlockPlacer(), new BlockHopperUpgrade(), diff --git a/src/main/resources/assets/naturesaura/blockstates/conversion_catalyst.json b/src/main/resources/assets/naturesaura/blockstates/conversion_catalyst.json new file mode 100644 index 00000000..8356d277 --- /dev/null +++ b/src/main/resources/assets/naturesaura/blockstates/conversion_catalyst.json @@ -0,0 +1,10 @@ +{ + "variants": { + "nether=false": { + "model": "naturesaura:block/conversion_catalyst" + }, + "nether=true": { + "model": "naturesaura:block/conversion_catalyst_nether" + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/naturesaura/blockstates/crushing_catalyst.json b/src/main/resources/assets/naturesaura/blockstates/crushing_catalyst.json new file mode 100644 index 00000000..fcf01ebf --- /dev/null +++ b/src/main/resources/assets/naturesaura/blockstates/crushing_catalyst.json @@ -0,0 +1,10 @@ +{ + "variants": { + "nether=false": { + "model": "naturesaura:block/crushing_catalyst" + }, + "nether=true": { + "model": "naturesaura:block/crushing_catalyst_nether" + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/naturesaura/textures/block/conversion_catalyst_nether.png b/src/main/resources/assets/naturesaura/textures/block/conversion_catalyst_nether.png new file mode 100644 index 0000000000000000000000000000000000000000..49c34902593b561f9b0d07bcb72bd461722329f9 GIT binary patch literal 692 zcmV;l0!#ggP)99~M3K9wlp`)TO z@q^BU1W8ORj3#P~0i(@TwnQ6aVJ8I|3!?@ld}si33Zfiv!Y+5a&tlyTC{FX{$Yn0arJS51a5-vq$2w*ath3r*9x zb!P-?ZIxuB&1O*$iG4){h=(drRRuR~Fg$dN^^KnZ^mTX9*WE=tR*h|23|<`JP+Kdd z$|}O)7+NHTSpHQ6!2Mw`c;QL__D_I?rFkw53;>{M&$xZ}DvQ%zT-Al3v%^42Njz3f zJXTGAZ_mEN1JJcFisI=_kr=`%mwEnjg><$m=y^1kBN5*V9L?nbFpVu7*V~STi_nF@ z)WWDjVB6Nd)qVN^kH#OP{-Ka;BKF3=!8Nc0A5dRBTOyKnmrM&I(#;mu=V(C7uV@;{fBN?sXa}^wR()l0dY1bSZ+O#f z$e?TCU7#dQ4H--$$-S{_%)k49E(8EdvMM2UA!t9m!{m%g^Rc6xKQ{zGVSOz~VA~dB z53aNDaTfpnn@^P}9d(T|8jUiwoagMRTAoa-($IPYQ4zv*T+~nqDZM|jI6a3h1eqEG zfMT(Ta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