Ejemplo n.º 1
0
 @Override
 public IMessage onMessage(ChocoboHunger message, MessageContext ctx) {
   EntityAnimalChocobo chocobo =
       PacketHelper.getChocoboByID(message.entityID, message.dimensionId);
   if (chocobo != null) {
     chocobo.setTimeUntilHunger(message.hungerTime);
   }
   return null;
 }
Ejemplo n.º 2
0
 @Override
 public IMessage onMessage(ChocoboHealth message, MessageContext ctx) {
   EntityAnimalChocobo chocobo =
       PacketHelper.getChocoboByID(message.entityID, message.dimensionId);
   if (chocobo != null) {
     chocobo.setHealth(message.health);
   }
   return null;
 }
Ejemplo n.º 3
0
    @Override
    public IMessage onMessage(ChocoboMount message, MessageContext ctx) {

      EntityAnimalChocobo chocobo =
          PacketHelper.getChocoboByID(message.entityID, message.dimensionId);
      if (chocobo != null && chocobo instanceof EntityChocoboRideable) {
        EntityChocoboRideable chocoboRideable = (EntityChocoboRideable) chocobo;
        if (message.playerName.isEmpty()) {
          chocoboRideable.riddenByEntity = null;
          chocoboRideable.setJumping(false);
          chocoboRideable.setStepHeight(false);
          chocoboRideable.setLandSpeedFactor(false);
          chocoboRideable.setJumpHigh(false);
        } else {
          EntityPlayer rider = PacketHelper.getPlayer(message.playerName, message.dimensionId);
          rider.setSprinting(false);
          rider.mountEntity(chocoboRideable);
          chocoboRideable.setStepHeight(true);
          chocoboRideable.setLandSpeedFactor(true);
          chocoboRideable.setJumpHigh(true);
        }
      }
      return null;
    }