From 6c5443c859d1dd6de647834db51a1389bd89fd26 Mon Sep 17 00:00:00 2001 From: KiloJoel Date: Tue, 8 Dec 2020 10:44:45 +0000 Subject: [PATCH 1/2] wings don't boost if you sneak --- .../emt/item/armor/wings/ItemFeatherWing.java | 25 +++++++++++-------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/src/main/java/emt/item/armor/wings/ItemFeatherWing.java b/src/main/java/emt/item/armor/wings/ItemFeatherWing.java index 9089468..10e7b7b 100644 --- a/src/main/java/emt/item/armor/wings/ItemFeatherWing.java +++ b/src/main/java/emt/item/armor/wings/ItemFeatherWing.java @@ -77,21 +77,26 @@ public class ItemFeatherWing extends ItemArmor implements IRunicArmor { if (isJmuping) { byte f = nbtData.getByte("f"); nbtData.setBoolean("isHolding", true); - nbtData.setByte("f", (byte) (f + 1)); + if (IC2.keyboard.isSneakKeyDown(player)) + nbtData.setByte("f", (byte) (0)); + else + nbtData.setByte("f", (byte) (f + 1)); if (f > 7) nbtData.setByte("f", (byte) 7); } else if (isHolding) { byte f = nbtData.getByte("f"); nbtData.setBoolean("isHolding", false); - player.motionY = motionY * f; - ElectricItem.manager.use(stack, ((motionY * f) * 10) * amount, player); - if (player.motionX < 0.5 && player.motionZ < 0.5 && player.motionX > -0.5 && player.motionZ > -0.5) { - player.motionX /= motionXZ; - player.motionZ /= motionXZ; - } - world.playSoundEffect(player.posX, player.posY, player.posZ, "mob.ghast.fireball", 1, 1); - for (int i = 0; i < 4; i++) { - world.spawnParticle("cloud", player.posX - 1 + (world.rand.nextInt(100) / 50d), player.posY - 1, player.posZ - 1 + (world.rand.nextInt(100) / 50d), 0, -0.5, 0); + if (!IC2.keyboard.isSneakKeyDown(player)) { + player.motionY = motionY * f; + ElectricItem.manager.use(stack, ((motionY * f) * 10) * amount, player); + if (player.motionX < 0.5 && player.motionZ < 0.5 && player.motionX > -0.5 && player.motionZ > -0.5) { + player.motionX /= motionXZ; + player.motionZ /= motionXZ; + } + world.playSoundEffect(player.posX, player.posY, player.posZ, "mob.ghast.fireball", 1, 1); + for (int i = 0; i < 4; i++) { + world.spawnParticle("cloud", player.posX - 1 + (world.rand.nextInt(100) / 50d), player.posY - 1, player.posZ - 1 + (world.rand.nextInt(100) / 50d), 0, -0.5, 0); + } } nbtData.setByte("f", (byte) 0); } From ccfc699180f5ecb881d725669dd869842920d1e4 Mon Sep 17 00:00:00 2001 From: KiloJoel Date: Tue, 8 Dec 2020 11:07:46 +0000 Subject: [PATCH 2/2] mirrored change for infused chestplate --- .../ItemInfusedQuantumChestplate.java | 29 +++++++++++-------- 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/src/main/java/emt/item/armor/chestplate/ItemInfusedQuantumChestplate.java b/src/main/java/emt/item/armor/chestplate/ItemInfusedQuantumChestplate.java index fc0564f..b3277cc 100644 --- a/src/main/java/emt/item/armor/chestplate/ItemInfusedQuantumChestplate.java +++ b/src/main/java/emt/item/armor/chestplate/ItemInfusedQuantumChestplate.java @@ -475,7 +475,10 @@ public class ItemInfusedQuantumChestplate extends ItemArmorElectric implements I byte f = nbt.getByte("f"); nbt.setBoolean("isHolding", true); - nbt.setByte("f", (byte) (f + 1)); + if (IC2.keyboard.isSneakKeyDown(player)) + nbt.setByte("f", (byte) (0)); + else + nbt.setByte("f", (byte) (f + 1)); if (f > 7) { nbt.setByte("f", (byte) 7); @@ -483,21 +486,23 @@ public class ItemInfusedQuantumChestplate extends ItemArmorElectric implements I } else if (nbt.getBoolean("isHolding")) { byte f = nbt.getByte("f"); nbt.setBoolean("isHolding", false); - player.motionY = motionY * f; + if (!IC2.keyboard.isSneakKeyDown(player)) { + player.motionY = motionY * f; - if (isElectric) { - ElectricItem.manager.use(stack, ((motionY * f) * 10) * amount, player); - } + if (isElectric) { + ElectricItem.manager.use(stack, ((motionY * f) * 10) * amount, player); + } - if (player.motionX < 0.5 && player.motionZ < 0.5 && player.motionX > -0.5 && player.motionZ > -0.5) { - player.motionX /= motionXZ; - player.motionZ /= motionXZ; - } + if (player.motionX < 0.5 && player.motionZ < 0.5 && player.motionX > -0.5 && player.motionZ > -0.5) { + player.motionX /= motionXZ; + player.motionZ /= motionXZ; + } - world.playSoundEffect(player.posX, player.posY, player.posZ, "mob.ghast.fireball", 1, 1); + world.playSoundEffect(player.posX, player.posY, player.posZ, "mob.ghast.fireball", 1, 1); - for (int i = 0; i < 4; i++) { - world.spawnParticle("cloud", player.posX - 1 + (world.rand.nextInt(100) / 50d), player.posY - 1, player.posZ - 1 + (world.rand.nextInt(100) / 50d), 0, -0.5, 0); + for (int i = 0; i < 4; i++) { + world.spawnParticle("cloud", player.posX - 1 + (world.rand.nextInt(100) / 50d), player.posY - 1, player.posZ - 1 + (world.rand.nextInt(100) / 50d), 0, -0.5, 0); + } } nbt.setByte("f", (byte) 0);