mirror of
https://github.com/GTNewHorizons/Electro-Magic-Tools.git
synced 2026-11-20 12:09:41 +00:00
Added Toggle to Speed of BoT
This commit is contained in:
1 parent
42340fde1c
commit
2b38ed2f2b
1 file changed
+8
-1
+8
-1
@@ -6,6 +6,7 @@ import cpw.mods.fml.relauncher.SideOnly;
|
||||
import ic2.api.item.ElectricItem;
|
||||
import ic2.api.item.IElectricItem;
|
||||
import ic2.api.item.IMetalArmor;
|
||||
import ic2.api.util.Keys;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.Entity;
|
||||
@@ -38,6 +39,7 @@ public class ItemElectricBootsTraveller extends ItemArmor implements IElectricIt
|
||||
public float speedBonus = 0.055F;
|
||||
public float jumpBonus = 0.3F;
|
||||
public double transferLimit = 100;
|
||||
public boolean speedBoostActive = false;
|
||||
|
||||
public ItemElectricBootsTraveller(int par3, int par4) {
|
||||
super(ArmorMaterial.DIAMOND, par3, par4);
|
||||
@@ -114,6 +116,11 @@ public class ItemElectricBootsTraveller extends ItemArmor implements IElectricIt
|
||||
|
||||
@Override
|
||||
public void onArmorTick(World world, EntityPlayer player, ItemStack itemStack) {
|
||||
if (Keys.instance.isBoostKeyDown(player) && Keys.instance.isModeSwitchKeyDown(player))
|
||||
{
|
||||
speedBoostActive = !speedBoostActive;
|
||||
}
|
||||
|
||||
if ((!player.capabilities.isFlying) && (player.moveForward > 0.0F)) {
|
||||
if ((player.worldObj.isRemote) && (!player.isSneaking())) {
|
||||
if (!Thaumcraft.instance.entityEventHandler.prevStep.containsKey(Integer.valueOf(player.getEntityId()))) {
|
||||
@@ -121,7 +128,7 @@ public class ItemElectricBootsTraveller extends ItemArmor implements IElectricIt
|
||||
}
|
||||
player.stepHeight = 1.0F;
|
||||
}
|
||||
if ((player.onGround || player.capabilities.isFlying) && player.moveForward > 0F) {
|
||||
if (speedBoostActive && ((player.onGround || player.capabilities.isFlying) && player.moveForward > 0F)) {
|
||||
player.moveFlying(0F, 1F, speedBonus);
|
||||
player.jumpMovementFactor = jumpBonus;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user