mirror of
https://github.com/GTNewHorizons/Electro-Magic-Tools.git
synced 2026-11-26 06:43:01 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
569bfe29b1 | ||
|
|
50d3663fbe | ||
|
|
93f048f3d6 | ||
|
|
0e1d5d969a |
No files matched your search
+2
-2
@@ -1,10 +1,10 @@
|
|||||||
// Add your dependencies here
|
// Add your dependencies here
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
compileOnly 'com.github.GTNewHorizons:GT5-Unofficial:5.09.48.09:dev'
|
compileOnly 'com.github.GTNewHorizons:GT5-Unofficial:5.09.48.12:dev'
|
||||||
api 'com.github.GTNewHorizons:Baubles:1.0.4:dev'
|
api 'com.github.GTNewHorizons:Baubles:1.0.4:dev'
|
||||||
api 'com.github.GTNewHorizons:ModularUI:1.2.0:dev'
|
api 'com.github.GTNewHorizons:ModularUI:1.2.0:dev'
|
||||||
api ('com.github.GTNewHorizons:ThaumicBoots:1.3.4:dev'){
|
api ('com.github.GTNewHorizons:ThaumicBoots:1.3.5:dev'){
|
||||||
exclude group: 'com.github.GTNewHorizons', module: 'Electro-Magic-Tools'
|
exclude group: 'com.github.GTNewHorizons', module: 'Electro-Magic-Tools'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -125,6 +125,20 @@ public class ItemElectricBootsTraveller extends ItemArmor
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onArmorTick(World world, EntityPlayer player, ItemStack itemStack) {
|
public void onArmorTick(World world, EntityPlayer player, ItemStack itemStack) {
|
||||||
|
if (getIntertialState(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);
|
||||||
|
if ((player.moveForward == 0F && player.moveStrafing == 0F && omniMode)
|
||||||
|
|| (player.moveForward <= 0F && !omniMode)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
if (player.moveForward != 0.0F || player.moveStrafing != 0.0F) {
|
if (player.moveForward != 0.0F || player.moveStrafing != 0.0F) {
|
||||||
if (player.worldObj.isRemote && !player.isSneaking()) {
|
if (player.worldObj.isRemote && !player.isSneaking()) {
|
||||||
if (!Thaumcraft.instance.entityEventHandler.prevStep.containsKey(player.getEntityId())) {
|
if (!Thaumcraft.instance.entityEventHandler.prevStep.containsKey(player.getEntityId())) {
|
||||||
@@ -145,7 +159,7 @@ public class ItemElectricBootsTraveller extends ItemArmor
|
|||||||
bonus *= speedMod;
|
bonus *= speedMod;
|
||||||
if (EMT.isBootsActive) {
|
if (EMT.isBootsActive) {
|
||||||
applyOmniState(player, bonus, itemStack);
|
applyOmniState(player, bonus, itemStack);
|
||||||
} else {
|
} else if (player.moveForward > 0.0) {
|
||||||
player.moveFlying(0.0F, player.moveForward, bonus);
|
player.moveFlying(0.0F, player.moveForward, bonus);
|
||||||
}
|
}
|
||||||
} else if (Hover.getHover(player.getEntityId())) {
|
} else if (Hover.getHover(player.getEntityId())) {
|
||||||
@@ -166,11 +180,12 @@ public class ItemElectricBootsTraveller extends ItemArmor
|
|||||||
|
|
||||||
@Optional.Method(modid = "thaumicboots")
|
@Optional.Method(modid = "thaumicboots")
|
||||||
public void applyOmniState(EntityPlayer player, float bonus, ItemStack itemStack) {
|
public void applyOmniState(EntityPlayer player, float bonus, ItemStack itemStack) {
|
||||||
if (player.moveStrafing != 0.0 && itemStack.stackTagCompound.getBoolean("omni")) {
|
if (player.moveForward != 0.0) {
|
||||||
player.moveFlying(player.moveStrafing, 0.0F, bonus);
|
|
||||||
} else 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)) {
|
||||||
|
player.moveFlying(player.moveStrafing, 0.0F, bonus);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
@@ -311,4 +326,19 @@ public class ItemElectricBootsTraveller extends ItemArmor
|
|||||||
}
|
}
|
||||||
return 1.0;
|
return 1.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean getOmniState(ItemStack stack) {
|
||||||
|
if (stack.stackTagCompound != null) {
|
||||||
|
return stack.stackTagCompound.getBoolean("omni");
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean getIntertialState(ItemStack stack) {
|
||||||
|
if (stack.stackTagCompound != null) {
|
||||||
|
return stack.stackTagCompound.getBoolean("inertiacanceling");
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user