wings don't boost if you sneak

This commit is contained in:
KiloJoel committed 2020-12-08 10:44:45 +00:00
1 parent b4c34554c2
commit 6c5443c859
1 file changed
+15 -10
@@ -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);
}