diff --git a/src/main/java/taintedmagic/common/items/equipment/ItemVoidwalkerBoots.java b/src/main/java/taintedmagic/common/items/equipment/ItemVoidwalkerBoots.java index 5715b7d..e01e984 100644 --- a/src/main/java/taintedmagic/common/items/equipment/ItemVoidwalkerBoots.java +++ b/src/main/java/taintedmagic/common/items/equipment/ItemVoidwalkerBoots.java @@ -126,36 +126,39 @@ public class ItemVoidwalkerBoots extends ItemArmor public void onArmorTick (World world, EntityPlayer player, ItemStack stack) { super.onArmorTick(world, player, stack); + // repair if (!world.isRemote && stack.isItemDamaged() && player.ticksExisted % 20 == 0) stack.damageItem(-1, player); + // particles double motion = Math.abs(player.motionX) + Math.abs(player.motionZ) + Math.abs(0.5 * player.motionY); - if (world.isRemote && (motion > 0.1D || !player.onGround) && world.rand.nextInt(5) == 0) particles(world, player); + if (world.isRemote && (motion > 0.1D || !player.onGround) && world.rand.nextInt(3) == 0) particles(world, player); if (player.moveForward > 0.0F) { + // increased step height if (player.worldObj.isRemote && !player.isSneaking()) { - if (!Thaumcraft.instance.entityEventHandler.prevStep.containsKey(Integer.valueOf(player.getEntityId()))) + if (!Thaumcraft.instance.entityEventHandler.prevStep.containsKey(player.getEntityId())) { - Thaumcraft.instance.entityEventHandler.prevStep.put(Integer.valueOf(player.getEntityId()), - Float.valueOf(player.stepHeight)); + Thaumcraft.instance.entityEventHandler.prevStep.put(player.getEntityId(), player.stepHeight); } player.stepHeight = 1.0F; } + // speed boost if (player.onGround || player.capabilities.isFlying) { - float mul = 0.2F; + float bonus = 0.12F; ItemStack sash = PlayerHandler.getPlayerBaubles(player).getStackInSlot(3); if (sash != null && sash.getItem() instanceof ItemVoidwalkerSash && ItemVoidwalkerSash.isSpeedEnabled(sash)) - mul *= 2.0F; + bonus *= 2.0F; - player.moveFlying(0.0F, 1.0F, player.capabilities.isFlying ? (mul - 0.075F) : mul); - player.jumpMovementFactor = 0.00002F; + player.moveFlying(0.0F, 1.0F, player.capabilities.isFlying ? (bonus * 0.75F) : bonus); } else if (Hover.getHover(player.getEntityId())) player.jumpMovementFactor = 0.03F; - else player.jumpMovementFactor = 0.05F; + else player.jumpMovementFactor = player.isSprinting() ? 0.045F : 0.04F; } + // negate fall damage if (player.fallDistance > 3.0F) player.fallDistance = 1.0F; } @@ -165,16 +168,12 @@ public class ItemVoidwalkerBoots extends ItemArmor if (event.entity instanceof EntityPlayer) { EntityPlayer player = (EntityPlayer) event.entity; - - double mul = 0.0D; - ItemStack boots = player.inventory.armorItemInSlot(0); ItemStack sash = PlayerHandler.getPlayerBaubles(player).getStackInSlot(3); - if (boots != null && boots.getItem() == ItemRegistry.ItemVoidwalkerBoots) mul += 0.35D; - if (sash != null && sash.getItem() instanceof ItemVoidwalkerSash && ItemVoidwalkerSash.isSpeedEnabled(sash)) - mul += 0.15D; - player.motionY += mul; + if (boots != null && boots.getItem() == ItemRegistry.ItemVoidwalkerBoots) player.motionY *= 1.25D; + if (sash != null && sash.getItem() instanceof ItemVoidwalkerSash && ItemVoidwalkerSash.isSpeedEnabled(sash)) + player.motionY *= 1.05D; } } diff --git a/src/main/java/taintedmagic/common/items/equipment/ItemVoidwalkerSash.java b/src/main/java/taintedmagic/common/items/equipment/ItemVoidwalkerSash.java index d83e97a..da9bb9f 100644 --- a/src/main/java/taintedmagic/common/items/equipment/ItemVoidwalkerSash.java +++ b/src/main/java/taintedmagic/common/items/equipment/ItemVoidwalkerSash.java @@ -1,5 +1,7 @@ package taintedmagic.common.items.equipment; +import java.util.List; + import baubles.api.BaubleType; import baubles.api.IBauble; import cpw.mods.fml.common.FMLCommonHandler; @@ -41,6 +43,15 @@ public class ItemVoidwalkerSash extends ItemRunic implements IRunicArmor, IWarpi return EnumRarity.epic; } + @Override + public void addInformation (ItemStack stack, EntityPlayer player, List list, boolean b) + { + if (isSpeedEnabled(stack)) list.add(EnumChatFormatting.GREEN + StatCollector.translateToLocal("text.sash.speed.on")); + else list.add(EnumChatFormatting.RED + StatCollector.translateToLocal("text.sash.speed.off")); + + list.add(" "); + } + @Override public int getWarp (ItemStack stack, EntityPlayer player) { @@ -119,4 +130,5 @@ public class ItemVoidwalkerSash extends ItemRunic implements IRunicArmor, IWarpi if (stack.stackTagCompound == null) return true; else return stack.stackTagCompound.getBoolean(TAG_MODE); } + }