Everything else except sigils

This commit is contained in:
Nicholas Ignoffo 2017-01-01 22:26:42 -08:00
parent 128b3d29b0
commit 51e10eaad2
46 changed files with 289 additions and 354 deletions

View file

@ -100,7 +100,7 @@ public class ItemSentientAxe extends ItemAxe implements IDemonWillWeapon, IMeshP
@Override
public boolean getIsRepairable(ItemStack toRepair, ItemStack repair)
{
return ModItems.ITEM_DEMON_CRYSTAL == repair.getItem() ? true : super.getIsRepairable(toRepair, repair);
return ModItems.ITEM_DEMON_CRYSTAL == repair.getItem() || super.getIsRepairable(toRepair, repair);
}
public void recalculatePowers(ItemStack stack, World world, EntityPlayer player)
@ -224,7 +224,7 @@ public class ItemSentientAxe extends ItemAxe implements IDemonWillWeapon, IMeshP
if (attacker instanceof EntityPlayer)
{
EntityPlayer attackerPlayer = (EntityPlayer) attacker;
this.recalculatePowers(stack, attackerPlayer.worldObj, attackerPlayer);
this.recalculatePowers(stack, attackerPlayer.getEntityWorld(), attackerPlayer);
EnumDemonWillType type = this.getCurrentType(stack);
double will = PlayerDemonWillHandler.getTotalDemonWill(type, attackerPlayer);
int willBracket = this.getLevel(stack, will);
@ -232,7 +232,7 @@ public class ItemSentientAxe extends ItemAxe implements IDemonWillWeapon, IMeshP
applyEffectToEntity(type, willBracket, target, attackerPlayer);
ItemStack offStack = attackerPlayer.getItemStackFromSlot(EntityEquipmentSlot.OFFHAND);
if (offStack != null && offStack.getItem() instanceof ISentientSwordEffectProvider)
if (offStack.getItem() instanceof ISentientSwordEffectProvider)
{
ISentientSwordEffectProvider provider = (ISentientSwordEffectProvider) offStack.getItem();
if (provider.providesEffectForWill(type))
@ -273,11 +273,11 @@ public class ItemSentientAxe extends ItemAxe implements IDemonWillWeapon, IMeshP
}
@Override
public ActionResult<ItemStack> onItemRightClick(ItemStack stack, World world, EntityPlayer player, EnumHand hand)
public ActionResult<ItemStack> onItemRightClick(World world, EntityPlayer player, EnumHand hand)
{
recalculatePowers(stack, world, player);
recalculatePowers(player.getHeldItem(hand), world, player);
return super.onItemRightClick(stack, world, player, hand);
return super.onItemRightClick(world, player, hand);
}
@Override
@ -314,7 +314,7 @@ public class ItemSentientAxe extends ItemAxe implements IDemonWillWeapon, IMeshP
@Override
public boolean onLeftClickEntity(ItemStack stack, EntityPlayer player, Entity entity)
{
recalculatePowers(stack, player.worldObj, player);
recalculatePowers(stack, player.getEntityWorld(), player);
double drain = this.getDrainOfActivatedSword(stack);
if (drain > 0)
@ -365,7 +365,7 @@ public class ItemSentientAxe extends ItemAxe implements IDemonWillWeapon, IMeshP
{
List<ItemStack> soulList = new ArrayList<ItemStack>();
if (killedEntity.worldObj.getDifficulty() != EnumDifficulty.PEACEFUL && !(killedEntity instanceof IMob))
if (killedEntity.getEntityWorld().getDifficulty() != EnumDifficulty.PEACEFUL && !(killedEntity instanceof IMob))
{
return soulList;
}
@ -378,9 +378,9 @@ public class ItemSentientAxe extends ItemAxe implements IDemonWillWeapon, IMeshP
for (int i = 0; i <= looting; i++)
{
if (i == 0 || attackingEntity.worldObj.rand.nextDouble() < 0.4)
if (i == 0 || attackingEntity.getEntityWorld().rand.nextDouble() < 0.4)
{
ItemStack soulStack = soul.createWill(type.ordinal(), willModifier * (this.getDropOfActivatedSword(stack) * attackingEntity.worldObj.rand.nextDouble() + this.getStaticDropOfActivatedSword(stack)) * killedEntity.getMaxHealth() / 20d);
ItemStack soulStack = soul.createWill(type.ordinal(), willModifier * (this.getDropOfActivatedSword(stack) * attackingEntity.getEntityWorld().rand.nextDouble() + this.getStaticDropOfActivatedSword(stack)) * killedEntity.getMaxHealth() / 20d);
soulList.add(soulStack);
}
}
@ -395,10 +395,10 @@ public class ItemSentientAxe extends ItemAxe implements IDemonWillWeapon, IMeshP
Multimap<String, AttributeModifier> multimap = HashMultimap.<String, AttributeModifier>create();
if (slot == EntityEquipmentSlot.MAINHAND)
{
multimap.put(SharedMonsterAttributes.ATTACK_DAMAGE.getAttributeUnlocalizedName(), new AttributeModifier(ATTACK_DAMAGE_MODIFIER, "Weapon modifier", getDamageOfActivatedSword(stack), 0));
multimap.put(SharedMonsterAttributes.ATTACK_SPEED.getAttributeUnlocalizedName(), new AttributeModifier(ATTACK_SPEED_MODIFIER, "Weapon modifier", this.getAttackSpeedOfSword(stack), 0));
multimap.put(SharedMonsterAttributes.MAX_HEALTH.getAttributeUnlocalizedName(), new AttributeModifier(new UUID(0, 31818145), "Weapon modifier", this.getHealthBonusOfSword(stack), 0));
multimap.put(SharedMonsterAttributes.MOVEMENT_SPEED.getAttributeUnlocalizedName(), new AttributeModifier(new UUID(0, 4218052), "Weapon modifier", this.getSpeedOfSword(stack), 2));
multimap.put(SharedMonsterAttributes.ATTACK_DAMAGE.getName(), new AttributeModifier(ATTACK_DAMAGE_MODIFIER, "Weapon modifier", getDamageOfActivatedSword(stack), 0));
multimap.put(SharedMonsterAttributes.ATTACK_SPEED.getName(), new AttributeModifier(ATTACK_SPEED_MODIFIER, "Weapon modifier", this.getAttackSpeedOfSword(stack), 0));
multimap.put(SharedMonsterAttributes.MAX_HEALTH.getName(), new AttributeModifier(new UUID(0, 31818145), "Weapon modifier", this.getHealthBonusOfSword(stack), 0));
multimap.put(SharedMonsterAttributes.MOVEMENT_SPEED.getName(), new AttributeModifier(new UUID(0, 4218052), "Weapon modifier", this.getSpeedOfSword(stack), 2));
}
return multimap;
@ -543,7 +543,7 @@ public class ItemSentientAxe extends ItemAxe implements IDemonWillWeapon, IMeshP
@Override
public boolean spawnSentientEntityOnDrop(ItemStack droppedStack, EntityPlayer player)
{
World world = player.worldObj;
World world = player.getEntityWorld();
if (!world.isRemote)
{
this.recalculatePowers(droppedStack, world, player);
@ -559,7 +559,7 @@ public class ItemSentientAxe extends ItemAxe implements IDemonWillWeapon, IMeshP
EntitySentientSpecter specterEntity = new EntitySentientSpecter(world);
specterEntity.setPosition(player.posX, player.posY, player.posZ);
world.spawnEntityInWorld(specterEntity);
world.spawnEntity(specterEntity);
specterEntity.setItemStackToSlot(EntityEquipmentSlot.MAINHAND, droppedStack.copy());