diff --git a/build.gradle b/build.gradle index fa88ae1be..c9086caf5 100644 --- a/build.gradle +++ b/build.gradle @@ -32,6 +32,7 @@ buildscript { } maven { // GTNH ForgeGradle and ASM Fork + name = "GTNH Maven" url = "http://jenkins.usrv.eu:8081/nexus/content/groups/public/" } @@ -46,6 +47,7 @@ buildscript { } dependencies { //Overwrite the current ASM version to fix shading newer than java 8 applicatations. + classpath 'org.ow2.asm:asm-debug-all-custom:5.0.3' classpath 'net.minecraftforge.gradle:ForgeGradle:1.2.13' } diff --git a/src/main/java/witchinggadgets/common/items/armor/ItemPrimordialArmor.java b/src/main/java/witchinggadgets/common/items/armor/ItemPrimordialArmor.java index 3c74030fc..234b0da3b 100644 --- a/src/main/java/witchinggadgets/common/items/armor/ItemPrimordialArmor.java +++ b/src/main/java/witchinggadgets/common/items/armor/ItemPrimordialArmor.java @@ -44,14 +44,22 @@ import witchinggadgets.common.WGContent; import witchinggadgets.common.items.tools.IPrimordialGear; +enum FlightStatus { + ON, + OFF +} + public class ItemPrimordialArmor extends ItemShadowFortressArmor implements IActiveAbility, IPrimordialCrafting, IEventGear, IPrimordialGear, IRunicArmor { IIcon rune; byte tickcounter = 0; + private FlightStatus flightStatus; + public ItemPrimordialArmor(ArmorMaterial mat, int idx, int type) { super(mat, idx, type); this.setCreativeTab(WitchingGadgets.tabWG); + flightStatus = FlightStatus.OFF; } @Override @@ -109,9 +117,6 @@ public void onLivingUpdateEvent(LivingUpdateEvent event) { for (int i : modes) if (i == 1) ++modescounter; - if (amorcounter >= 2 && modescounter >= 2) player.capabilities.allowFlying = true; - else player.capabilities.allowFlying = false; - /*if(leggings && getAbility(player.getCurrentArmor(2))==3) player.capabilities.setPlayerWalkSpeed(0.75F); else @@ -186,8 +191,15 @@ public void onArmorTick(World world, EntityPlayer player, ItemStack stack) { player.addPotionEffect(new PotionEffect(Potion.fireResistance.id, 202, 0, true)); } - if (amorcounter >= 2 && modescounter[0] >= 2) player.capabilities.allowFlying = true; - else player.capabilities.allowFlying = false; + // turn flight off or on + if ((amorcounter >= 2 && modescounter[0] >= 2)) { + flightStatus = FlightStatus.ON; + player.capabilities.allowFlying = true; + } else if (flightStatus == FlightStatus.ON) { + flightStatus = FlightStatus.OFF; + player.capabilities.allowFlying = false; + player.capabilities.isFlying = false; + } /*if (modes[2]==3) { player.capabilities.setPlayerWalkSpeed(0.75F);