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 00000000..7c02fc98 Binary files /dev/null and b/src/main/resources/assets/naturesaura/textures/block/slime_split_generator.png differ diff --git a/src/main/resources/assets/naturesaura/textures/block/slime_split_generator_bottom.png b/src/main/resources/assets/naturesaura/textures/block/slime_split_generator_bottom.png new file mode 100644 index 00000000..d3fc81f9 Binary files /dev/null and b/src/main/resources/assets/naturesaura/textures/block/slime_split_generator_bottom.png differ diff --git a/src/main/resources/assets/naturesaura/textures/block/slime_split_generator_top.png b/src/main/resources/assets/naturesaura/textures/block/slime_split_generator_top.png new file mode 100644 index 00000000..46e8d565 Binary files /dev/null and b/src/main/resources/assets/naturesaura/textures/block/slime_split_generator_top.png differ diff --git a/src/main/resources/data/naturesaura/patchouli_books/book/en_us/entries/creating/slime_split_generator.json b/src/main/resources/data/naturesaura/patchouli_books/book/en_us/entries/creating/slime_split_generator.json new file mode 100644 index 00000000..fd4e83c7 --- /dev/null +++ b/src/main/resources/data/naturesaura/patchouli_books/book/en_us/entries/creating/slime_split_generator.json @@ -0,0 +1,21 @@ +{ + "name": "Offshoot Observer", + "icon": "naturesaura:slime_split_generator", + "category": "creating", + "advancement": "naturesaura:sky_ingot", + "pages": [ + { + "type": "text", + "text": "$(thing)Slimes$() and $(thing)Magma Cubes$() are peculiar beings. Upon being hurt enough, they $(thing)split$() into smaller versions of themselves, similarly to how cells multiply in the body. This natural process can be exploited by the $(item)Offshoot Observer$(): When such a creature splits in its vicinity, the created entropy will be consumed and $(aura) will be dispersed into the environment." + }, + { + "type": "text", + "text": "Needless to say, the amount of $(aura) created is based on the $(thing)size$() and $(thing)rarity$() of the creature.$(br)It should also be noted that, while the $(item)Offshoot Observer$() is in the process of dispering $(aura), causing an additional creature to split will not cause any more $(aura) to be created." + }, + { + "type": "crafting", + "recipe": "naturesaura:slime_split_generator", + "text": "Creating the $(item)Offshoot Observer$()" + } + ] +} \ No newline at end of file diff --git a/src/main/resources/data/naturesaura/recipes/slime_split_generator.json b/src/main/resources/data/naturesaura/recipes/slime_split_generator.json new file mode 100644 index 00000000..7e30d04e --- /dev/null +++ b/src/main/resources/data/naturesaura/recipes/slime_split_generator.json @@ -0,0 +1,32 @@ +{ + "type": "minecraft:crafting_shaped", + "pattern": [ + "NJS", + "ISI", + "SWN" + ], + "key": { + "S": { + "item": "minecraft:slime_block" + }, + "J": { + "item": "naturesaura:token_joy" + }, + "W": { + "item": "naturesaura:token_grief" + }, + "N": { + "type": "forge:nbt", + "item": "naturesaura:aura_bottle", + "nbt": { + "stored_type": "naturesaura:nether" + } + }, + "I": { + "item": "naturesaura:sky_ingot" + } + }, + "result": { + "item": "naturesaura:slime_split_generator" + } +} \ No newline at end of file