From 0c97d2f8323053778ff51d90ba270d9855cc4b59 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Mon, 28 Sep 2020 17:18:40 +0200 Subject: [PATCH] finished the offshoot observer --- .../blockstates/slime_split_generator.json | 7 ++++ .../models/block/slime_split_generator.json | 8 +++++ .../models/item/slime_split_generator.json | 3 ++ .../blocks/slime_split_generator.json | 19 +++++++++++ .../blocks/BlockSlimeSplitGenerator.java | 30 +++++++++++++++- .../tiles/TileEntitySlimeSplitGenerator.java | 2 +- .../assets/naturesaura/lang/en_us.json | 1 + .../textures/block/slime_split_generator.png | Bin 0 -> 380 bytes .../block/slime_split_generator_bottom.png | Bin 0 -> 428 bytes .../block/slime_split_generator_top.png | Bin 0 -> 440 bytes .../creating/slime_split_generator.json | 21 ++++++++++++ .../recipes/slime_split_generator.json | 32 ++++++++++++++++++ 12 files changed, 121 insertions(+), 2 deletions(-) create mode 100644 src/generated/resources/assets/naturesaura/blockstates/slime_split_generator.json create mode 100644 src/generated/resources/assets/naturesaura/models/block/slime_split_generator.json create mode 100644 src/generated/resources/assets/naturesaura/models/item/slime_split_generator.json create mode 100644 src/generated/resources/data/naturesaura/loot_tables/blocks/slime_split_generator.json create mode 100644 src/main/resources/assets/naturesaura/textures/block/slime_split_generator.png create mode 100644 src/main/resources/assets/naturesaura/textures/block/slime_split_generator_bottom.png create mode 100644 src/main/resources/assets/naturesaura/textures/block/slime_split_generator_top.png create mode 100644 src/main/resources/data/naturesaura/patchouli_books/book/en_us/entries/creating/slime_split_generator.json create mode 100644 src/main/resources/data/naturesaura/recipes/slime_split_generator.json diff --git a/src/generated/resources/assets/naturesaura/blockstates/slime_split_generator.json b/src/generated/resources/assets/naturesaura/blockstates/slime_split_generator.json new file mode 100644 index 00000000..c9a43708 --- /dev/null +++ b/src/generated/resources/assets/naturesaura/blockstates/slime_split_generator.json @@ -0,0 +1,7 @@ +{ + "variants": { + "": { + "model": "naturesaura:block/slime_split_generator" + } + } +} \ No newline at end of file diff --git a/src/generated/resources/assets/naturesaura/models/block/slime_split_generator.json b/src/generated/resources/assets/naturesaura/models/block/slime_split_generator.json new file mode 100644 index 00000000..88a7cf4d --- /dev/null +++ b/src/generated/resources/assets/naturesaura/models/block/slime_split_generator.json @@ -0,0 +1,8 @@ +{ + "parent": "minecraft:block/cube_bottom_top", + "textures": { + "side": "naturesaura:block/slime_split_generator", + "bottom": "naturesaura:block/slime_split_generator_bottom", + "top": "naturesaura:block/slime_split_generator_top" + } +} \ No newline at end of file diff --git a/src/generated/resources/assets/naturesaura/models/item/slime_split_generator.json b/src/generated/resources/assets/naturesaura/models/item/slime_split_generator.json new file mode 100644 index 00000000..f78924b9 --- /dev/null +++ b/src/generated/resources/assets/naturesaura/models/item/slime_split_generator.json @@ -0,0 +1,3 @@ +{ + "parent": "naturesaura:block/slime_split_generator" +} \ No newline at end of file diff --git a/src/generated/resources/data/naturesaura/loot_tables/blocks/slime_split_generator.json b/src/generated/resources/data/naturesaura/loot_tables/blocks/slime_split_generator.json new file mode 100644 index 00000000..4d7b928a --- /dev/null +++ b/src/generated/resources/data/naturesaura/loot_tables/blocks/slime_split_generator.json @@ -0,0 +1,19 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:item", + "name": "naturesaura:slime_split_generator" + } + ], + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ] + } + ] +} \ No newline at end of file diff --git a/src/main/java/de/ellpeck/naturesaura/blocks/BlockSlimeSplitGenerator.java b/src/main/java/de/ellpeck/naturesaura/blocks/BlockSlimeSplitGenerator.java index c7041786..9cad4fee 100644 --- a/src/main/java/de/ellpeck/naturesaura/blocks/BlockSlimeSplitGenerator.java +++ b/src/main/java/de/ellpeck/naturesaura/blocks/BlockSlimeSplitGenerator.java @@ -1,22 +1,50 @@ package de.ellpeck.naturesaura.blocks; import de.ellpeck.naturesaura.Helper; +import de.ellpeck.naturesaura.api.render.IVisualizable; import de.ellpeck.naturesaura.blocks.tiles.TileEntitySlimeSplitGenerator; +import de.ellpeck.naturesaura.data.BlockStateGenerator; +import de.ellpeck.naturesaura.reg.ICustomBlockState; import net.minecraft.block.Blocks; import net.minecraft.entity.LivingEntity; import net.minecraft.entity.monster.SlimeEntity; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; +import net.minecraftforge.api.distmarker.Dist; +import net.minecraftforge.api.distmarker.OnlyIn; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.entity.living.LivingDamageEvent; import net.minecraftforge.event.entity.living.LivingDeathEvent; import net.minecraftforge.eventbus.api.EventPriority; import net.minecraftforge.eventbus.api.SubscribeEvent; -public class BlockSlimeSplitGenerator extends BlockContainerImpl { +public class BlockSlimeSplitGenerator extends BlockContainerImpl implements IVisualizable, ICustomBlockState { public BlockSlimeSplitGenerator() { super("slime_split_generator", TileEntitySlimeSplitGenerator::new, Properties.from(Blocks.SLIME_BLOCK).hardnessAndResistance(2)); MinecraftForge.EVENT_BUS.register(new Events()); } + @Override + public void generateCustomBlockState(BlockStateGenerator generator) { + generator.simpleBlock(this, generator.models().cubeBottomTop(this.getBaseName(), + generator.modLoc("block/" + this.getBaseName()), + generator.modLoc("block/" + this.getBaseName() + "_bottom"), + generator.modLoc("block/" + this.getBaseName() + "_top"))); + } + + @Override + @OnlyIn(Dist.CLIENT) + public AxisAlignedBB getVisualizationBounds(World world, BlockPos pos) { + return new AxisAlignedBB(pos).grow(8); + } + + @Override + @OnlyIn(Dist.CLIENT) + public int getVisualizationColor(World world, BlockPos pos) { + return 0x4da84f; + } + private static class Events { @SubscribeEvent diff --git a/src/main/java/de/ellpeck/naturesaura/blocks/tiles/TileEntitySlimeSplitGenerator.java b/src/main/java/de/ellpeck/naturesaura/blocks/tiles/TileEntitySlimeSplitGenerator.java index db9f1571..5ceef613 100644 --- a/src/main/java/de/ellpeck/naturesaura/blocks/tiles/TileEntitySlimeSplitGenerator.java +++ b/src/main/java/de/ellpeck/naturesaura/blocks/tiles/TileEntitySlimeSplitGenerator.java @@ -80,7 +80,7 @@ public class TileEntitySlimeSplitGenerator extends TileEntityImpl implements ITi if (slime instanceof MagmaCubeEntity) { return 0x942516; } else { - return 0x1ed921; + return 0x4da84f; } } diff --git a/src/main/resources/assets/naturesaura/lang/en_us.json b/src/main/resources/assets/naturesaura/lang/en_us.json index 2ff9ed90..6d315ca1 100644 --- a/src/main/resources/assets/naturesaura/lang/en_us.json +++ b/src/main/resources/assets/naturesaura/lang/en_us.json @@ -65,6 +65,7 @@ "block.naturesaura.nether_grass": "Grassy Netherrack", "block.naturesaura.chorus_generator": "Reaper of Ender Heights", "block.naturesaura.aura_timer": "Redstone Aura Vaporizer", + "block.naturesaura.slime_split_generator": "Offshoot Observer", "item.naturesaura.eye": "Environmental Eye", "item.naturesaura.eye_improved": "Environmental Ocular", "item.naturesaura.gold_fiber": "Brilliant Fiber", diff --git a/src/main/resources/assets/naturesaura/textures/block/slime_split_generator.png b/src/main/resources/assets/naturesaura/textures/block/slime_split_generator.png new file mode 100644 index 0000000000000000000000000000000000000000..7c02fc98635aab2e71f25ff090874556c039e32a GIT binary patch literal 380 zcmV-?0fYXDP)1v^U}7lrtdl2+6v*<|oJ_4Y^1U6{`z_;IXrIT;jHfa?jl2imC z<2*7f*DDU?p^o*wI|m%RehJ%E?V;k5J`IbFh~%l0M#VM(fIEK zU4>Eqi=c^pYZnFy0(Rl#<~EMHmq)5Ke$Z!Z)##?X{tqpJuPg$ z#v)H-6|j8bS9qmY8Nit2xYD;bC3Xl7c5nbwOsnMCeZOw)A0P-8 z7A7M|U)(OcF+Z1898h-37RHz)UpgAb%v8djZecbUS*uf9Z;kRiLH&=1)arMcPsi{= zHlKIb#M@Tziiw&Y@c!_cRc`gW7;PvSZ8$zTC3HVo>X=YP$gMzNf9F)EP(?_csQeAn WdE`A+Md#)K00009fZxHpXYTsxIIT81nieH%V2RO-Xi`!S#MU_smUY+0brbFLo0H!AbiC_w; zN=wHc6zkQwf=EiB!q})OaD28O%M1sG`_>~W!HJMvyR2Y5nxuw*Q|Tx@L<&E(-Iy^CcTX%L$*~rc9^$OEG(Gi!C-ZR%qvmjBgrnr5 z+Yah~Jfw1?#(TF7%^#z@^AcWUTy~z92fSTA$0wH?HLS5X)>t;Twh82fzR?6KM0^_r i>F*r*6sQnkEC64P)bc*`ZB)4c0000