Tweaks relating to Phoenix Armor
- Takes 5 times as long to break from water damage. - Carries over enchantments when becoming Obsidian Armor.
This commit is contained in:
parent
a833e7e07c
commit
03166df4f4
|
@ -5,6 +5,8 @@ import com.gildedgames.the_aether.api.player.IPlayerAether;
|
|||
import com.gildedgames.the_aether.api.player.util.IAetherAbility;
|
||||
import com.gildedgames.the_aether.items.ItemsAether;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.enchantment.EnchantmentHelper;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.potion.Potion;
|
||||
|
@ -94,11 +96,21 @@ public class AbilityAccessories implements IAetherAbility {
|
|||
}
|
||||
}
|
||||
|
||||
if (this.player.getAccessoryInventory().wearingAccessory(new ItemStack(ItemsAether.phoenix_gloves)) && this.player.getEntity().isWet()) {
|
||||
this.player.getAccessoryInventory().damageWornStack(1, new ItemStack(ItemsAether.phoenix_gloves));
|
||||
if (this.player.getAccessoryInventory().wearingAccessory(new ItemStack(ItemsAether.phoenix_gloves)) && this.player.getEntity().isWet())
|
||||
{
|
||||
if (this.player.getEntity().worldObj.getTotalWorldTime() % 5 == 0)
|
||||
{
|
||||
ItemStack stack = this.player.getAccessoryInventory().getStackInSlot(AccessoryType.GLOVES);
|
||||
|
||||
if (this.player.getAccessoryInventory().getStackInSlot(AccessoryType.GLOVES) == null) {
|
||||
this.player.getAccessoryInventory().setAccessorySlot(AccessoryType.GLOVES, new ItemStack(ItemsAether.obsidian_gloves));
|
||||
this.player.getAccessoryInventory().damageWornStack(1, stack);
|
||||
|
||||
if (this.player.getAccessoryInventory().getStackInSlot(AccessoryType.GLOVES) == null)
|
||||
{
|
||||
ItemStack outcomeStack = new ItemStack(ItemsAether.obsidian_gloves);
|
||||
EnchantmentHelper.setEnchantments(EnchantmentHelper.getEnchantments(stack), outcomeStack);
|
||||
|
||||
this.player.getAccessoryInventory().setAccessorySlot(AccessoryType.GLOVES, outcomeStack);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -6,6 +6,7 @@ import com.gildedgames.the_aether.api.player.IPlayerAether;
|
|||
import com.gildedgames.the_aether.api.player.util.IAetherAbility;
|
||||
import com.gildedgames.the_aether.items.ItemsAether;
|
||||
import com.gildedgames.the_aether.player.movement.AetherLiquidMovement;
|
||||
import net.minecraft.enchantment.EnchantmentHelper;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.item.Item;
|
||||
|
@ -79,14 +80,23 @@ public class AbilityArmor implements IAetherAbility {
|
|||
}
|
||||
|
||||
public void damagePhoenixArmor(Entity entity, Item outcome, int slot) {
|
||||
if (entity instanceof EntityLivingBase) {
|
||||
EntityLivingBase entityLiving = (EntityLivingBase) entity;
|
||||
ItemStack stack = entityLiving.getEquipmentInSlot(slot + 1);
|
||||
if (entity instanceof EntityLivingBase)
|
||||
{
|
||||
if (this.player.getEntity().worldObj.getTotalWorldTime() % 5 == 0)
|
||||
{
|
||||
EntityLivingBase entityLiving = (EntityLivingBase) entity;
|
||||
ItemStack stack = entityLiving.getEquipmentInSlot(slot + 1);
|
||||
|
||||
stack.damageItem(1, entityLiving);
|
||||
stack.damageItem(1, entityLiving);
|
||||
|
||||
if (stack.stackSize <= 0) {
|
||||
entityLiving.setCurrentItemOrArmor(slot + 1, new ItemStack(outcome));
|
||||
if (stack.stackSize <= 0)
|
||||
{
|
||||
ItemStack outcomeStack = new ItemStack(outcome);
|
||||
|
||||
EnchantmentHelper.setEnchantments(EnchantmentHelper.getEnchantments(stack), outcomeStack);
|
||||
|
||||
entityLiving.setCurrentItemOrArmor(slot + 1, outcomeStack);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue