From cdbbd891c43e082a36a32e49420bf87b6edd28e0 Mon Sep 17 00:00:00 2001 From: bculkin2442 Date: Wed, 4 Sep 2019 22:24:39 -0400 Subject: More affix work --- .../jewelrycraft/api/ModifierEffect.java | 26 +++++++++++++++------- 1 file changed, 18 insertions(+), 8 deletions(-) (limited to 'src/main/java/darkknight/jewelrycraft/api/ModifierEffect.java') diff --git a/src/main/java/darkknight/jewelrycraft/api/ModifierEffect.java b/src/main/java/darkknight/jewelrycraft/api/ModifierEffect.java index 8e58f72..cbd740b 100755 --- a/src/main/java/darkknight/jewelrycraft/api/ModifierEffect.java +++ b/src/main/java/darkknight/jewelrycraft/api/ModifierEffect.java @@ -3,17 +3,20 @@ package darkknight.jewelrycraft.api; import java.util.ArrayList; import java.util.Random; +import darkknight.jewelrycraft.item.ItemBaseJewelry; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.DamageSource; +import net.minecraftforge.event.entity.living.LivingAttackEvent; +import net.minecraftforge.event.entity.living.LivingDropsEvent; import net.minecraftforge.event.entity.player.PlayerEvent; public class ModifierEffect { protected ItemStack modifier; protected Random rand = new Random(); - + protected static ArrayList effects = new ArrayList<>(); /** @@ -22,7 +25,7 @@ public class ModifierEffect { */ public ModifierEffect(ItemStack modifier) { this.modifier = modifier; - + if (modifier != null) { effects.add(this); } @@ -70,12 +73,12 @@ public class ModifierEffect { * The attacked entity * @param jewelry * The actual jewelry item (aka item.getItem(), almost) - * @param amount + * @param event * The amount of damage the entity took * @return The state of the event (true to cancel it, false to not) */ public boolean onEntityAttackedCancellable(ItemStack item, EntityPlayer player, Entity target, Item jewelry, - float amount) { + LivingAttackEvent event) { return false; } @@ -113,10 +116,11 @@ public class ModifierEffect { * The attacked entity * @param jewelry * The actual jewelry item (aka item.getItem(), almost) - * @param amount + * @param event * The amount of damage the entity took */ - public void onEntityAttacked(ItemStack item, EntityPlayer player, Entity target, Item jewelry, float amount) { + public void onEntityAttacked(ItemStack item, EntityPlayer player, Entity target, Item jewelry, + LivingAttackEvent event) { // Do nothing } @@ -179,7 +183,7 @@ public class ModifierEffect { * @param jewelry * The actual jewelry item (aka item.getItem(), almost) */ - public void onJewelryEquipped(ItemStack item, Item jewelry) { + public void onJewelryEquipped(ItemStack item, Item jewelry, EntityPlayer player) { // Do nothing } @@ -191,7 +195,13 @@ public class ModifierEffect { * @param jewelry * The actual jewelry item (aka item.getItem(), almost) */ - public void onJewelryUnequipped(ItemStack item, Item jewelry) { + public void onJewelryUnequipped(ItemStack item, Item jewelry, EntityPlayer player) { // Do nothing } + + public void onLivingDropItems(ItemStack item, EntityPlayer player, LivingDropsEvent event, + ItemBaseJewelry jewelry) { + // TODO Auto-generated method stub + + } } -- cgit v1.2.3