use of de.keyle.knbt.TagInt in project MyPet by xXKeyleXx.
the class MyTraderLlama method writeExtendedInfo.
@Override
public TagCompound writeExtendedInfo() {
TagCompound info = super.writeExtendedInfo();
info.getCompoundData().put("Variant", new TagInt(getVariant()));
info.getCompoundData().put("Baby", new TagByte(isBaby()));
if (hasChest()) {
info.getCompoundData().put("Chest", MyPetApi.getPlatformHelper().itemStackToCompund(getChest()));
}
if (hasDecor()) {
info.getCompoundData().put("Decor", MyPetApi.getPlatformHelper().itemStackToCompund(getDecor()));
}
return info;
}
use of de.keyle.knbt.TagInt in project MyPet by xXKeyleXx.
the class MyVillager method writeExtendedInfo.
@Override
public TagCompound writeExtendedInfo() {
TagCompound info = super.writeExtendedInfo();
info.getCompoundData().put("Profession", new TagInt(getProfession()));
info.getCompoundData().put("VillagerType", new TagInt(getType().ordinal()));
info.getCompoundData().put("VillagerLevel", new TagInt(getVillagerLevel()));
info.getCompoundData().put("Baby", new TagByte(isBaby()));
if (originalData != null) {
info.getCompoundData().put("OriginalData", originalData);
}
return info;
}
use of de.keyle.knbt.TagInt in project MyPet by xXKeyleXx.
the class MyTropicalFish method writeExtendedInfo.
@Override
public TagCompound writeExtendedInfo() {
TagCompound info = super.writeExtendedInfo();
info.getCompoundData().put("Variant", new TagInt(getVariant()));
return info;
}
use of de.keyle.knbt.TagInt in project MyPet by xXKeyleXx.
the class MyHorse method writeExtendedInfo.
@Override
public TagCompound writeExtendedInfo() {
TagCompound info = super.writeExtendedInfo();
info.getCompoundData().put("Type", new TagByte(getHorseType()));
info.getCompoundData().put("Variant", new TagInt(getVariant()));
if (hasArmor()) {
info.getCompoundData().put("Armor", MyPetApi.getPlatformHelper().itemStackToCompund(getArmor()));
}
info.getCompoundData().put("Age", new TagInt(getAge()));
if (hasChest()) {
info.getCompoundData().put("Chest", MyPetApi.getPlatformHelper().itemStackToCompund(getChest()));
}
if (hasSaddle()) {
info.getCompoundData().put("Saddle", MyPetApi.getPlatformHelper().itemStackToCompund(getSaddle()));
}
return info;
}
use of de.keyle.knbt.TagInt in project MyPet by xXKeyleXx.
the class RepositoryMyPetConverterService method v1_11_R1.
public void v1_11_R1(StoredMyPet pet) {
TagCompound info = pet.getInfo();
switch(pet.getPetType()) {
case Horse:
if (info.containsKey("Type")) {
byte type = info.getAs("Type", TagByte.class).getByteData();
switch(type) {
case 1:
pet.setPetType(MyPetType.Donkey);
break;
case 2:
pet.setPetType(MyPetType.Mule);
break;
case 3:
pet.setPetType(MyPetType.ZombieHorse);
break;
case 4:
pet.setPetType(MyPetType.SkeletonHorse);
break;
}
info.remove("Type");
}
break;
case Skeleton:
if (info.containsKey("Type")) {
int type = info.getAs("Type", TagInt.class).getIntData();
switch(type) {
case 1:
pet.setPetType(MyPetType.WitherSkeleton);
break;
case 2:
pet.setPetType(MyPetType.Stray);
break;
}
info.remove("Type");
}
if (info.containsKey("Wither")) {
if (info.getAs("Wither", TagByte.class).getBooleanData()) {
pet.setPetType(MyPetType.WitherSkeleton);
info.remove("Wither");
}
}
break;
case Zombie:
if (info.containsKey("Type")) {
int type = info.getAs("Type", TagInt.class).getIntData();
switch(type) {
case 6:
pet.setPetType(MyPetType.Husk);
break;
case 0:
break;
default:
if (type == 2) {
if (info.containsKey("Profession")) {
pet.setPetType(MyPetType.ZombieVillager);
info.put("Profession", new TagInt(info.getAs("Profession", TagInt.class).getIntData() - 1));
} else {
pet.setPetType(MyPetType.Husk);
}
} else {
pet.setPetType(MyPetType.ZombieVillager);
if (info.containsKey("Profession")) {
info.put("Profession", new TagInt(info.getAs("Profession", TagInt.class).getIntData() - 1));
}
}
}
info.remove("Type");
}
if (info.containsKey("Villager")) {
if (info.getAs("Villager", TagByte.class).getBooleanData()) {
pet.setPetType(MyPetType.ZombieVillager);
info.remove("Villager");
}
}
if (info.containsKey("Husk")) {
if (info.getAs("Husk", TagByte.class).getBooleanData()) {
pet.setPetType(MyPetType.Husk);
info.remove("Husk");
}
}
break;
case Guardian:
if (info.containsKey("Elder")) {
if (info.getAs("Elder", TagByte.class).getBooleanData()) {
pet.setPetType(MyPetType.ElderGuardian);
info.remove("Elder");
}
}
break;
}
}
Aggregations