mirror of
https://github.com/GTNewHorizons/Electro-Magic-Tools.git
synced 2026-11-26 06:43:01 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2c76ed22b6 | ||
|
|
f769825006 | ||
|
|
facfe682c5 | ||
|
|
8dba364e25 | ||
|
|
fd8e0dff3f | ||
|
|
731f565f30 | ||
|
|
8ee6a81a08 | ||
|
|
a8b75eb35a |
@@ -24,7 +24,6 @@ import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
|||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
import emt.EMT;
|
import emt.EMT;
|
||||||
import emt.init.EMTItems;
|
|
||||||
import emt.util.EMTConfigHandler;
|
import emt.util.EMTConfigHandler;
|
||||||
import emt.util.EMTTextHelper;
|
import emt.util.EMTTextHelper;
|
||||||
import ic2.api.item.ElectricItem;
|
import ic2.api.item.ElectricItem;
|
||||||
@@ -36,6 +35,7 @@ import thaumcraft.api.aspects.Aspect;
|
|||||||
import thaumcraft.common.Thaumcraft;
|
import thaumcraft.common.Thaumcraft;
|
||||||
import thaumcraft.common.items.armor.Hover;
|
import thaumcraft.common.items.armor.Hover;
|
||||||
import thaumicboots.api.IBoots;
|
import thaumicboots.api.IBoots;
|
||||||
|
import thaumicboots.mixins.early.minecraft.EntityLivingBaseAccessor;
|
||||||
|
|
||||||
@Interface(iface = "thaumicboots.api.IBoots", modid = "thaumicboots")
|
@Interface(iface = "thaumicboots.api.IBoots", modid = "thaumicboots")
|
||||||
public class ItemElectricBootsTraveller extends ItemArmor
|
public class ItemElectricBootsTraveller extends ItemArmor
|
||||||
@@ -46,7 +46,8 @@ public class ItemElectricBootsTraveller extends ItemArmor
|
|||||||
public int visDiscount = 2;
|
public int visDiscount = 2;
|
||||||
public float speedBonus = 0.055F;
|
public float speedBonus = 0.055F;
|
||||||
// constant from Thaumcraft's EventHandlerEntity#playerJumps for basic Traveller Boots
|
// constant from Thaumcraft's EventHandlerEntity#playerJumps for basic Traveller Boots
|
||||||
public float jumpBonus = 0.2750000059604645F;
|
public static final float BASE_JUMP_BONUS = 0.2750000059604645F;
|
||||||
|
public float jumpBonus = BASE_JUMP_BONUS;
|
||||||
public double transferLimit = 100;
|
public double transferLimit = 100;
|
||||||
|
|
||||||
public ItemElectricBootsTraveller(ArmorMaterial material, int par3, int par4) {
|
public ItemElectricBootsTraveller(ArmorMaterial material, int par3, int par4) {
|
||||||
@@ -165,15 +166,9 @@ public class ItemElectricBootsTraveller extends ItemArmor
|
|||||||
} else if (Hover.getHover(player.getEntityId())) {
|
} else if (Hover.getHover(player.getEntityId())) {
|
||||||
// Base ItemBootsTraveller jumpBonus equals to jumpBonus of Electric Boots,
|
// Base ItemBootsTraveller jumpBonus equals to jumpBonus of Electric Boots,
|
||||||
// so any other boots factor can be calculated via proportion method
|
// so any other boots factor can be calculated via proportion method
|
||||||
player.jumpMovementFactor = 0.03F
|
player.jumpMovementFactor = (0.03F / BASE_JUMP_BONUS * jumpBonus - 0.02F) * speedMod + 0.02F;
|
||||||
/ ((ItemElectricBootsTraveller) EMTItems.electricBootsTraveller).jumpBonus
|
|
||||||
* jumpBonus
|
|
||||||
* speedMod;
|
|
||||||
} else {
|
} else {
|
||||||
player.jumpMovementFactor = 0.05F
|
player.jumpMovementFactor = (0.05F / BASE_JUMP_BONUS * jumpBonus - 0.02F) * speedMod + 0.02F;
|
||||||
/ ((ItemElectricBootsTraveller) EMTItems.electricBootsTraveller).jumpBonus
|
|
||||||
* jumpBonus
|
|
||||||
* speedMod;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -183,8 +178,15 @@ public class ItemElectricBootsTraveller extends ItemArmor
|
|||||||
if (player.moveForward != 0.0) {
|
if (player.moveForward != 0.0) {
|
||||||
player.moveFlying(0.0F, player.moveForward, bonus);
|
player.moveFlying(0.0F, player.moveForward, bonus);
|
||||||
}
|
}
|
||||||
if (player.moveStrafing != 0.0 && getOmniState(itemStack)) {
|
if (getOmniState(itemStack)) {
|
||||||
player.moveFlying(player.moveStrafing, 0.0F, bonus);
|
if (player.moveStrafing != 0.0) player.moveFlying(player.moveStrafing, 0.0F, bonus);
|
||||||
|
boolean jumping = ((EntityLivingBaseAccessor) player).getIsJumping();
|
||||||
|
boolean sneaking = player.isSneaking();
|
||||||
|
if (sneaking && !jumping && !player.onGround) {
|
||||||
|
player.motionY -= bonus;
|
||||||
|
} else if (jumping && !sneaking) {
|
||||||
|
player.motionY += bonus;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user