Fix quantum suit not sending abilities updates.

Closes https://github.com/TechReborn/TechReborn/issues/3150
This commit is contained in:
modmuss50 2023-06-25 11:17:19 +01:00
parent 8ae6f3e7e5
commit ba99161222

View file

@ -101,6 +101,8 @@ public class QuantumSuitItem extends TREnergyArmourItem implements ArmorBlockEnt
if (enableFlight) { if (enableFlight) {
if (getStoredEnergy(stack) > flyCost) { if (getStoredEnergy(stack) > flyCost) {
playerEntity.getAbilities().allowFlying = true; playerEntity.getAbilities().allowFlying = true;
playerEntity.sendAbilitiesUpdate();
if (playerEntity.getAbilities().flying) { if (playerEntity.getAbilities().flying) {
tryUseEnergy(stack, flyCost); tryUseEnergy(stack, flyCost);
} }
@ -108,6 +110,7 @@ public class QuantumSuitItem extends TREnergyArmourItem implements ArmorBlockEnt
} else { } else {
playerEntity.getAbilities().allowFlying = false; playerEntity.getAbilities().allowFlying = false;
playerEntity.getAbilities().flying = false; playerEntity.getAbilities().flying = false;
playerEntity.sendAbilitiesUpdate();
} }
} }
if (playerEntity.isOnFire() && tryUseEnergy(stack, fireExtinguishCost)) { if (playerEntity.isOnFire() && tryUseEnergy(stack, fireExtinguishCost)) {
@ -134,6 +137,7 @@ public class QuantumSuitItem extends TREnergyArmourItem implements ArmorBlockEnt
if (!playerEntity.isCreative() && !playerEntity.isSpectator()) { if (!playerEntity.isCreative() && !playerEntity.isSpectator()) {
playerEntity.getAbilities().allowFlying = false; playerEntity.getAbilities().allowFlying = false;
playerEntity.getAbilities().flying = false; playerEntity.getAbilities().flying = false;
playerEntity.sendAbilitiesUpdate();
} }
} }
} }