diff --git a/README.md b/README.md index fad6277..44b1497 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ ![](/src/main/resources/logo.png?raw=true) -#Electro-Magic Tools +# Electro-Magic Tools Electro-Magic Tools is a Minecraft mod which integrates Thaumcraft 4 with IndustrialCraft 2 by adding cross-mod tools and items, such as magic solar panels, essentia generators and legendary items. @@ -19,7 +19,7 @@ Before posting to the issue tracker, make sure you meet the following criteria: - You've gone through the effort to isolate EMT from other mods that aren't related to the issue. - You've gone through the effort to find what conditions are necessary to reproduce the issue. - The issue is subtle enough and has been around long enough that you think we might have missed it. -- You speak English or Russian well enough to explain yourself without wondering whether you will be understood. +- You speak English or Russian well enough to explain yourself without wondering whether you will be understood. # Upstream @@ -27,4 +27,4 @@ Before posting to the issue tracker, make sure you meet the following criteria: # License -Electro-Magic-Tools is licensed under the GPL 3 \ No newline at end of file +Electro-Magic-Tools is licensed under the GPL 3 diff --git a/src/main/java/emt/item/armor/boots/ItemElectricBootsTraveller.java b/src/main/java/emt/item/armor/boots/ItemElectricBootsTraveller.java index 7db9edf..88a8c4a 100644 --- a/src/main/java/emt/item/armor/boots/ItemElectricBootsTraveller.java +++ b/src/main/java/emt/item/armor/boots/ItemElectricBootsTraveller.java @@ -126,22 +126,21 @@ public class ItemElectricBootsTraveller extends ItemArmor @Override public void onArmorTick(World world, EntityPlayer player, ItemStack itemStack) { - if (getIntertialState(itemStack) && player.moveForward == 0 + if (getInertiaState(itemStack) && player.moveForward == 0 && player.moveStrafing == 0 && player.capabilities.isFlying) { player.motionX *= 0.5; player.motionZ *= 0.5; } - boolean omniMode = false; if (EMT.isBootsActive) { - omniMode = isOmniEnabled(itemStack); + boolean omniMode = getOmniState(itemStack); if ((player.moveForward == 0F && player.moveStrafing == 0F && omniMode) || (player.moveForward <= 0F && !omniMode)) { return; } } if (player.moveForward != 0.0F || player.moveStrafing != 0.0F) { - if (player.worldObj.isRemote && !player.isSneaking()) { + if (player.worldObj.isRemote && !player.isSneaking() && getStepAssistState(itemStack)) { if (!Thaumcraft.instance.entityEventHandler.prevStep.containsKey(player.getEntityId())) { Thaumcraft.instance.entityEventHandler.prevStep.put(player.getEntityId(), player.stepHeight); } @@ -216,20 +215,12 @@ public class ItemElectricBootsTraveller extends ItemArmor @Override public int getItemEnchantability() { - if (EMTConfigHandler.enchanting == false) { - return 0; - } else { - return 4; - } + return EMTConfigHandler.enchanting ? 4 : 0; } @Override public boolean isBookEnchantable(ItemStack itemstack1, ItemStack itemstack2) { - if (EMTConfigHandler.enchanting == false) { - return false; - } else { - return true; - } + return EMTConfigHandler.enchanting; } public int getEnergyPerDamage() { @@ -289,13 +280,20 @@ public class ItemElectricBootsTraveller extends ItemArmor } public boolean getOmniState(ItemStack stack) { - if (stack.stackTagCompound != null) { + if (stack.stackTagCompound != null && stack.stackTagCompound.hasKey("omni")) { return stack.stackTagCompound.getBoolean("omni"); } - return false; + return true; } - public boolean getIntertialState(ItemStack stack) { + public boolean getStepAssistState(ItemStack stack) { + if (stack.stackTagCompound != null && stack.stackTagCompound.hasKey("step")) { + return stack.stackTagCompound.getBoolean("step"); + } + return true; + } + + public boolean getInertiaState(ItemStack stack) { if (stack.stackTagCompound != null) { return stack.stackTagCompound.getBoolean("inertiacanceling"); }