From bdf540aa761c312dfefb0e014f3504838ecb98e7 Mon Sep 17 00:00:00 2001 From: WayofTime Date: Sat, 28 May 2016 07:27:29 -0400 Subject: [PATCH] Changed it so the Sentient Sword drops will for IMob instead of EntityMob - slimes have a 33% reduction to will drop. --- .../bloodmagic/item/soul/ItemSentientSword.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/main/java/WayofTime/bloodmagic/item/soul/ItemSentientSword.java b/src/main/java/WayofTime/bloodmagic/item/soul/ItemSentientSword.java index 99e314cb..5c760a9a 100644 --- a/src/main/java/WayofTime/bloodmagic/item/soul/ItemSentientSword.java +++ b/src/main/java/WayofTime/bloodmagic/item/soul/ItemSentientSword.java @@ -12,7 +12,8 @@ import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.SharedMonsterAttributes; import net.minecraft.entity.ai.attributes.AttributeModifier; -import net.minecraft.entity.monster.EntityMob; +import net.minecraft.entity.monster.EntitySlime; +import net.minecraft.entity.monster.IMob; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.MobEffects; import net.minecraft.inventory.EntityEquipmentSlot; @@ -332,18 +333,20 @@ public class ItemSentientSword extends ItemSword implements IDemonWillWeapon, IM { List soulList = new ArrayList(); - if (killedEntity.worldObj.getDifficulty() != EnumDifficulty.PEACEFUL && !(killedEntity instanceof EntityMob)) + if (killedEntity.worldObj.getDifficulty() != EnumDifficulty.PEACEFUL && !(killedEntity instanceof IMob)) { return soulList; } + double willModifier = killedEntity instanceof EntitySlime ? 0.67 : 1; + IDemonWill soul = ((IDemonWill) ModItems.monsterSoul); for (int i = 0; i <= looting; i++) { if (i == 0 || attackingEntity.worldObj.rand.nextDouble() < 0.4) { - ItemStack soulStack = soul.createWill(0, (this.getDropOfActivatedSword(stack) * attackingEntity.worldObj.rand.nextDouble() + this.getStaticDropOfActivatedSword(stack)) * killedEntity.getMaxHealth() / 20d); + ItemStack soulStack = soul.createWill(0, willModifier * (this.getDropOfActivatedSword(stack) * attackingEntity.worldObj.rand.nextDouble() + this.getStaticDropOfActivatedSword(stack)) * killedEntity.getMaxHealth() / 20d); soulList.add(soulStack); } }