ocelotType = Ocelot.Type.valueOf(parameters.getString("ocelot_type").toUpperCase());
public void convertOcelot(Ocelot ocelot, TagCompound properties) { properties.getCompoundData().put("CatType", new TagInt(ocelot.getCatType().getId())); properties.getCompoundData().put("Sitting", new TagByte(ocelot.isSitting())); }
Ocelot.Type catType; try { catType = Ocelot.Type.valueOf(specialType.toUpperCase()); } catch (IllegalArgumentException e) { throw new CommandException("Unknown cat type '" + specialType + "'. Allowed values are: "
((Ocelot) entity).setCatType(Ocelot.Type.values()[1 + Misc.getRandom().nextInt(3)]); break;
if (variantName != null) { try { variant = Ocelot.Type.valueOf(variantName.toUpperCase()); } catch (Exception ignored) {
Ocelot ocelot = (Ocelot) entity; if (EnumUtil.isValidEnum(Ocelot.Type.class, ocelotType.toUpperCase())) { ocelot.setCatType(Ocelot.Type.valueOf(ocelotType.toUpperCase()));
public Type getType() { return Ocelot.Type.getType(getData(MetaIndex.OCELOT_TYPE)); }
@Override public MCOcelotType getCatType() { return MCOcelotType.valueOf(o.getCatType().name()); }
@Override public void setCatType(MCOcelotType type) { o.setCatType(Ocelot.Type.valueOf(type.name())); }
public void setType(Type newType) { setData(MetaIndex.OCELOT_TYPE, newType.getId()); sendData(MetaIndex.OCELOT_TYPE); } }
@Override public void updateVisuals() { if (getMyPet().isBaby()) { this.datawatcher.watch(12, Integer.MIN_VALUE); } else { this.datawatcher.watch(12, 0); } this.datawatcher.watch(18, (byte) getMyPet().getCatType().ordinal()); }
private Type getCatType(Inventory i) { ItemStack is = i.getItem(48); ItemMeta im = is.getItemMeta(); try { return Type.valueOf(im.getLore().get(0)); } catch (IllegalArgumentException e) { return Type.WILD_OCELOT; } }
@Override public void setCatType(Type type) { catType = type; metadata.set(MetadataIndex.OCELOT_TYPE, type.getId()); }
@Override public void save(GlowOcelot entity, CompoundTag tag) { super.save(entity, tag); tag.putInt("CatType", entity.getCatType().getId()); }