use of com.lying.variousoddities.network.PacketDeadDeath in project VariousOddities by Lyinginbedmon.
the class MinecraftMixin method processKeyBinds.
@Inject(method = "processKeyBinds()V", at = @At("HEAD"), cancellable = true)
public void processKeyBinds(final CallbackInfo ci) {
PlayerEntity player = ((Minecraft) (Object) this).player;
if (player == null)
return;
PlayerData data = PlayerData.forPlayer(player);
if (data == null)
return;
Minecraft mc = Minecraft.getInstance();
if (PlayerData.isPlayerNormalFunction(player) || VOHelper.isCreativeOrSpectator(player))
return;
else
ci.cancel();
while (mc.gameSettings.keyBindInventory.isPressed()) {
switch(data.getBodyCondition()) {
case DEAD:
// Send respawn packet if delay completed
if (data.timeToRespawnable() == 0F)
PacketHandler.sendToServer(new PacketDeadDeath());
case UNCONSCIOUS:
// Send wakeup packet if no longer unconscious
if (!LivingData.forEntity(player).isUnconscious() && data.getSoulCondition() == SoulCondition.ALIVE)
PacketHandler.sendToServer(new PacketUnconsciousAwaken());
default:
;
}
}
processVitalKeys(mc);
if (this.player.isHandActive())
this.playerController.onStoppedUsingItem(this.player);
this.sendClickBlockToController(false);
}
Aggregations