public void setVariant(RabbitType variant) { this.variant = variant; if (status == PetState.Here) { ((EntityMyRabbit) getCraftPet().getHandle()).setVariant(variant.getId()); } }
@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; }
@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()); } }