From 3cf875cc7c9ce1ed845252bb8025c3bd330047a0 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Thu, 29 Nov 2018 13:54:32 +0100 Subject: [PATCH] finished the animal generator --- .../blocks/BlockAnimalGenerator.java | 19 +++++++---- .../blockstates/animal_generator.json | 20 +++++++++++ .../assets/naturesaura/lang/en_US.lang | 1 + .../entries/creating/animal_generator.json | 21 ++++++++++++ .../naturesaura/recipes/animal_generator.json | 32 ++++++++++++++++++ .../textures/blocks/animal_generator.png | Bin 0 -> 587 bytes .../blocks/animal_generator_bottom.png | Bin 0 -> 455 bytes .../textures/blocks/animal_generator_top.png | Bin 0 -> 440 bytes 8 files changed, 86 insertions(+), 7 deletions(-) create mode 100644 src/main/resources/assets/naturesaura/blockstates/animal_generator.json create mode 100644 src/main/resources/assets/naturesaura/patchouli_books/book/en_us/entries/creating/animal_generator.json create mode 100644 src/main/resources/assets/naturesaura/recipes/animal_generator.json create mode 100644 src/main/resources/assets/naturesaura/textures/blocks/animal_generator.png create mode 100644 src/main/resources/assets/naturesaura/textures/blocks/animal_generator_bottom.png create mode 100644 src/main/resources/assets/naturesaura/textures/blocks/animal_generator_top.png diff --git a/src/main/java/de/ellpeck/naturesaura/blocks/BlockAnimalGenerator.java b/src/main/java/de/ellpeck/naturesaura/blocks/BlockAnimalGenerator.java index ca3b8c53..0d8c1414 100644 --- a/src/main/java/de/ellpeck/naturesaura/blocks/BlockAnimalGenerator.java +++ b/src/main/java/de/ellpeck/naturesaura/blocks/BlockAnimalGenerator.java @@ -15,13 +15,14 @@ import net.minecraft.util.math.BlockPos; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.entity.living.LivingDeathEvent; import net.minecraftforge.event.entity.living.LivingDropsEvent; +import net.minecraftforge.event.entity.living.LivingExperienceDropEvent; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; public class BlockAnimalGenerator extends BlockContainerImpl { public BlockAnimalGenerator() { super(Material.ROCK, "animal_generator", TileEntityAnimalGenerator.class, "animal_generator"); - this.setSoundType(SoundType.WOOD); - this.setHardness(2F); + this.setSoundType(SoundType.STONE); + this.setHardness(3F); MinecraftForge.EVENT_BUS.register(this); } @@ -43,7 +44,7 @@ public class BlockAnimalGenerator extends BlockContainerImpl { boolean child = entity.isChild(); int time = child ? 60 : 120; - int amount = child ? 45 : 70; + int amount = child ? 40 : 60; gen.setGenerationValues(time, amount); BlockPos genPos = gen.getPos(); @@ -59,10 +60,14 @@ public class BlockAnimalGenerator extends BlockContainerImpl { @SubscribeEvent public void onEntityDrops(LivingDropsEvent event) { EntityLivingBase entity = event.getEntityLiving(); - if (entity.world.isRemote) - return; - if (entity.getEntityData().getBoolean(NaturesAura.MOD_ID + ":no_drops")) { + if (entity.getEntityData().getBoolean(NaturesAura.MOD_ID + ":no_drops")) + event.setCanceled(true); + } + + @SubscribeEvent + public void onEntityExp(LivingExperienceDropEvent event) { + EntityLivingBase entity = event.getEntityLiving(); + if (entity.getEntityData().getBoolean(NaturesAura.MOD_ID + ":no_drops")) event.setCanceled(true); - } } } \ No newline at end of file diff --git a/src/main/resources/assets/naturesaura/blockstates/animal_generator.json b/src/main/resources/assets/naturesaura/blockstates/animal_generator.json new file mode 100644 index 00000000..17d00d0a --- /dev/null +++ b/src/main/resources/assets/naturesaura/blockstates/animal_generator.json @@ -0,0 +1,20 @@ +{ + "forge_marker": 1, + "defaults": { + "model": "minecraft:cube", + "textures": { + "particle": "naturesaura:blocks/animal_generator", + "up": "naturesaura:blocks/animal_generator_top", + "down": "naturesaura:blocks/animal_generator_bottom", + "north": "#particle", + "east": "#particle", + "south": "#particle", + "west": "#particle" + }, + "transform": "forge:default-block" + }, + "variants": { + "normal": [{}], + "inventory": [{}] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/naturesaura/lang/en_US.lang b/src/main/resources/assets/naturesaura/lang/en_US.lang index dcc245fa..0dea0dc0 100644 --- a/src/main/resources/assets/naturesaura/lang/en_US.lang +++ b/src/main/resources/assets/naturesaura/lang/en_US.lang @@ -34,6 +34,7 @@ tile.naturesaura.infused_iron_block.name=Infused Iron Block tile.naturesaura.offering_table.name=Offering Table tile.naturesaura.pickup_stopper.name=Item Grounder tile.naturesaura.spawn_lamp.name=Lamp of Sanctuary +tile.naturesaura.animal_generator.name=Disentangler of Mortals item.naturesaura.eye.name=Environmental Eye item.naturesaura.gold_fiber.name=Brilliant Fiber diff --git a/src/main/resources/assets/naturesaura/patchouli_books/book/en_us/entries/creating/animal_generator.json b/src/main/resources/assets/naturesaura/patchouli_books/book/en_us/entries/creating/animal_generator.json new file mode 100644 index 00000000..ae900664 --- /dev/null +++ b/src/main/resources/assets/naturesaura/patchouli_books/book/en_us/entries/creating/animal_generator.json @@ -0,0 +1,21 @@ +{ + "name": "Disentangler of Mortals", + "icon": "naturesaura:animal_generator", + "category": "creating", + "advancement": "naturesaura:sky_ingot", + "pages": [ + { + "type": "text", + "text": "Creating $(aura) through natural substances can be a double-edged sword. Creating $(aura) using the $(item)Disentangler of Mortals$() is especially so: Killing any passive animal close to it will cause the animal's soul to be freed and spread into the environment in the form of a rather big amount of $(aura). For this, baby animals' souls are less fulfilled, causing less $(aura) to be dispersed." + }, + { + "type": "text", + "text": "It should be noted, also, that the animals whose souls are absorbed will not be lootable for their usual drops. Additionally, supplying the $(item)Disentangler of Mortals$() with a death while it is already in the process of converting a soul will cause both the animal's soul not to be freed and its remains not to be dropped." + }, + { + "type": "crafting", + "recipe": "naturesaura:animal_generator", + "text": "Creating the $(item)Disentangler of Mortals$()" + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/naturesaura/recipes/animal_generator.json b/src/main/resources/assets/naturesaura/recipes/animal_generator.json new file mode 100644 index 00000000..ec864783 --- /dev/null +++ b/src/main/resources/assets/naturesaura/recipes/animal_generator.json @@ -0,0 +1,32 @@ +{ + "type": "forge:ore_shaped", + "pattern": [ + "BSB", + "IAI", + "BWB" + ], + "key": { + "B": { + "item": "minecraft:nether_brick" + }, + "I": { + "item": "minecraft:iron_bars" + }, + "S": { + "item": "naturesaura:sky_ingot" + }, + "A": { + "item": "minecraft:soul_sand" + }, + "W": { + "type": "minecraft:item_nbt", + "item": "naturesaura:aura_bottle", + "nbt": { + "stored_type": "naturesaura:overworld" + } + } + }, + "result": { + "item": "naturesaura:animal_generator" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/naturesaura/textures/blocks/animal_generator.png b/src/main/resources/assets/naturesaura/textures/blocks/animal_generator.png new file mode 100644 index 0000000000000000000000000000000000000000..74c81ad45d4d799f2f50725620ab5c9a349af499 GIT binary patch literal 587 zcmV-R0<`^!P)N2bZe?^J zG%hhNG!sB*!~g&R$w@>(R5(v%liN-rK@f(^1idi|YUAjRHUuL$n?(>7iKDw7HcN~e zV`#ZNj@RbL$;N>k8a0NUNfd_Ko?It5t^>UN7_yV%4> z?Gh)_pSL%K1VE?bzKzG~v^o2?N*8CK$9pGA643cMsMQJpQ{Dibo;o#~DBX=< z*2`H1>`VQglU5*^hQk1`wu*S?n*(rVF_&yiH3JO#pxaTd1(`vv0=vD2#BPFmoPqm~ zx2mvFu7ZODHy4ScA^(UtiwD$d5q`95SQ$Toex-<`9ayuP0gku@A4h-xfG#gVdwW?0 zoGod^u1r=O@AJ3y0Fbx0kp@c}1pqrd+&PDZJzs&m)fQ$T%HILQw7eD}LsHw)>5Gy^q|gGOa0g5>mCXQHj~_^>qg5_cbexI0K)u z?z{ax0G7IKEZzKG+<{Qu-}Mg^0LRCm*HN2bZe?^J zG%hhNG!sB*!~g&RMM*?KR5(wilFe$uP!NTuV8!QfA-I#a8i-o8r4nqBYNVpwg%8XoxfO7A{9vEfwim$6<^eezRIXQ*-7W}V#Kt>7z}of# z|7Xu^Mj8SxhhQ7pKP0TD^ZTQ6Ix#@iwK?p7p=jBBK@NBBUY-f#H1Tp#S*?NqR%e35 xnQZeq0nXl7V^OfEAz*?8E4&pzSEx%<{R5)H^YNINN2bZe?^J zG%hhNG!sB*!~g&RHc3Q5R5(wilTS*+P!PsPsNy-gD0Ek-!#yP~@PGvri23V~b5+Abl>jw2bsJBoQ6eR{` iNbuwQHb7O-g`hv+V)_gK0000