From 1462ad301de637d434d8e10d5ef78188054648d8 Mon Sep 17 00:00:00 2001 From: Kino Date: Thu, 6 Jul 2017 02:48:23 -0400 Subject: [PATCH] #142 - Healing Stones fixed --- .../aether/common/items/ItemsAether.java | 3 +- .../common/items/food/ItemHealingStone.java | 31 +++++++++++++++++++ 2 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 src/main/java/com/legacy/aether/common/items/food/ItemHealingStone.java diff --git a/src/main/java/com/legacy/aether/common/items/ItemsAether.java b/src/main/java/com/legacy/aether/common/items/ItemsAether.java index e4d3a01..601a645 100644 --- a/src/main/java/com/legacy/aether/common/items/ItemsAether.java +++ b/src/main/java/com/legacy/aether/common/items/ItemsAether.java @@ -16,6 +16,7 @@ import com.legacy.aether.common.items.dungeon.ItemDungeonKey; import com.legacy.aether.common.items.food.ItemAetherFood; import com.legacy.aether.common.items.food.ItemAmbrosiumShard; import com.legacy.aether.common.items.food.ItemGummySwet; +import com.legacy.aether.common.items.food.ItemHealingStone; import com.legacy.aether.common.items.food.ItemLifeShard; import com.legacy.aether.common.items.food.ItemWhiteApple; import com.legacy.aether.common.items.staffs.ItemCloudStaff; @@ -166,7 +167,7 @@ public class ItemsAether enchanted_blueberry = register("enchanted_blueberry", new ItemAetherFood(8)); white_apple = register("white_apple", new ItemWhiteApple()); gummy_swet = register("gummy_swet", new ItemGummySwet()); - healing_stone = register("healing_stone", new ItemAetherFood(0).setPotionEffect(new PotionEffect(MobEffects.REGENERATION, 30, 0), 1.0F).setAlwaysEdible()); + healing_stone = register("healing_stone", new ItemHealingStone()); candy_cane = register("candy_cane", new ItemAetherFood(2)); ginger_bread_man = register("ginger_bread_man", new ItemAetherFood(2)); diff --git a/src/main/java/com/legacy/aether/common/items/food/ItemHealingStone.java b/src/main/java/com/legacy/aether/common/items/food/ItemHealingStone.java new file mode 100644 index 0000000..3da6035 --- /dev/null +++ b/src/main/java/com/legacy/aether/common/items/food/ItemHealingStone.java @@ -0,0 +1,31 @@ +package com.legacy.aether.common.items.food; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.MobEffects; +import net.minecraft.item.ItemStack; +import net.minecraft.potion.PotionEffect; +import net.minecraft.world.World; + +public class ItemHealingStone extends ItemAetherFood +{ + + public ItemHealingStone() + { + super(0); + + this.setAlwaysEdible(); + } + + @Override + public boolean hasEffect(ItemStack stack) + { + return true; + } + + @Override + protected void onFoodEaten(ItemStack stack, World worldIn, EntityPlayer player) + { + player.addPotionEffect(new PotionEffect(MobEffects.REGENERATION, 610, 0)); + } + +} \ No newline at end of file