Example #1
0
  public void setVariant(RabbitType variant) {
    this.variant = variant;

    if (status == PetState.Here) {
      ((EntityMyRabbit) getCraftPet().getHandle()).setVariant(variant.getId());
    }
  }
Example #2
0
 @Override
 public TagCompound writeExtendedInfo() {
   TagCompound info = super.writeExtendedInfo();
   info.getCompoundData().put("Variant", new TagByte(variant.getId()));
   info.getCompoundData().put("Baby", new TagByte(isBaby()));
   return info;
 }
Example #3
0
 @Override
 public void readExtendedInfo(TagCompound info) {
   if (info.containsKeyAs("Variant", TagByte.class)) {
     setVariant(RabbitType.getTypeByID(info.getAs("Variant", TagByte.class).getByteData()));
   }
   if (info.getCompoundData().containsKey("Baby")) {
     setBaby(info.getAs("Baby", TagByte.class).getBooleanData());
   }
 }