mirror of
https://github.com/Ellpeck/NaturesAura.git
synced 2024-11-22 19:58:34 +01:00
finished the animal generator
This commit is contained in:
parent
2e156a8836
commit
3cf875cc7c
8 changed files with 86 additions and 7 deletions
|
@ -15,13 +15,14 @@ import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraftforge.common.MinecraftForge;
|
import net.minecraftforge.common.MinecraftForge;
|
||||||
import net.minecraftforge.event.entity.living.LivingDeathEvent;
|
import net.minecraftforge.event.entity.living.LivingDeathEvent;
|
||||||
import net.minecraftforge.event.entity.living.LivingDropsEvent;
|
import net.minecraftforge.event.entity.living.LivingDropsEvent;
|
||||||
|
import net.minecraftforge.event.entity.living.LivingExperienceDropEvent;
|
||||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||||
|
|
||||||
public class BlockAnimalGenerator extends BlockContainerImpl {
|
public class BlockAnimalGenerator extends BlockContainerImpl {
|
||||||
public BlockAnimalGenerator() {
|
public BlockAnimalGenerator() {
|
||||||
super(Material.ROCK, "animal_generator", TileEntityAnimalGenerator.class, "animal_generator");
|
super(Material.ROCK, "animal_generator", TileEntityAnimalGenerator.class, "animal_generator");
|
||||||
this.setSoundType(SoundType.WOOD);
|
this.setSoundType(SoundType.STONE);
|
||||||
this.setHardness(2F);
|
this.setHardness(3F);
|
||||||
|
|
||||||
MinecraftForge.EVENT_BUS.register(this);
|
MinecraftForge.EVENT_BUS.register(this);
|
||||||
}
|
}
|
||||||
|
@ -43,7 +44,7 @@ public class BlockAnimalGenerator extends BlockContainerImpl {
|
||||||
|
|
||||||
boolean child = entity.isChild();
|
boolean child = entity.isChild();
|
||||||
int time = child ? 60 : 120;
|
int time = child ? 60 : 120;
|
||||||
int amount = child ? 45 : 70;
|
int amount = child ? 40 : 60;
|
||||||
gen.setGenerationValues(time, amount);
|
gen.setGenerationValues(time, amount);
|
||||||
|
|
||||||
BlockPos genPos = gen.getPos();
|
BlockPos genPos = gen.getPos();
|
||||||
|
@ -59,10 +60,14 @@ public class BlockAnimalGenerator extends BlockContainerImpl {
|
||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
public void onEntityDrops(LivingDropsEvent event) {
|
public void onEntityDrops(LivingDropsEvent event) {
|
||||||
EntityLivingBase entity = event.getEntityLiving();
|
EntityLivingBase entity = event.getEntityLiving();
|
||||||
if (entity.world.isRemote)
|
if (entity.getEntityData().getBoolean(NaturesAura.MOD_ID + ":no_drops"))
|
||||||
return;
|
event.setCanceled(true);
|
||||||
if (entity.getEntityData().getBoolean(NaturesAura.MOD_ID + ":no_drops")) {
|
}
|
||||||
|
|
||||||
|
@SubscribeEvent
|
||||||
|
public void onEntityExp(LivingExperienceDropEvent event) {
|
||||||
|
EntityLivingBase entity = event.getEntityLiving();
|
||||||
|
if (entity.getEntityData().getBoolean(NaturesAura.MOD_ID + ":no_drops"))
|
||||||
event.setCanceled(true);
|
event.setCanceled(true);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -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": [{}]
|
||||||
|
}
|
||||||
|
}
|
|
@ -34,6 +34,7 @@ tile.naturesaura.infused_iron_block.name=Infused Iron Block
|
||||||
tile.naturesaura.offering_table.name=Offering Table
|
tile.naturesaura.offering_table.name=Offering Table
|
||||||
tile.naturesaura.pickup_stopper.name=Item Grounder
|
tile.naturesaura.pickup_stopper.name=Item Grounder
|
||||||
tile.naturesaura.spawn_lamp.name=Lamp of Sanctuary
|
tile.naturesaura.spawn_lamp.name=Lamp of Sanctuary
|
||||||
|
tile.naturesaura.animal_generator.name=Disentangler of Mortals
|
||||||
|
|
||||||
item.naturesaura.eye.name=Environmental Eye
|
item.naturesaura.eye.name=Environmental Eye
|
||||||
item.naturesaura.gold_fiber.name=Brilliant Fiber
|
item.naturesaura.gold_fiber.name=Brilliant Fiber
|
||||||
|
|
|
@ -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$()"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
|
@ -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"
|
||||||
|
}
|
||||||
|
}
|
Binary file not shown.
After Width: | Height: | Size: 587 B |
Binary file not shown.
After Width: | Height: | Size: 455 B |
Binary file not shown.
After Width: | Height: | Size: 440 B |
Loading…
Reference in a new issue