Skip to content

Instantly share code, notes, and snippets.

@DavidDudson
Created December 20, 2013 06:07
Show Gist options
  • Save DavidDudson/8051016 to your computer and use it in GitHub Desktop.
Save DavidDudson/8051016 to your computer and use it in GitHub Desktop.
loadNBTData method for Enchant Insanity players.
@Override
public void loadNBTData(NBTTagCompound compound) {
if (compound.hasKey("EISkillData")) {
this.EISkillData = compound.getCompoundTag("EISkillData");
} else {
this.EISkillData = generateSkillData();
}
if (compound.hasKey("EIEnchantmentData")) {
this.EIEnchantmentData = compound.getCompoundTag("EIEnchantmentData");
} else {
this.EIEnchantmentData = generateEnchantmentData();
}
if (compound.hasKey("EIAbilityData")) {
this.EIAbilityData = compound.getCompoundTag("EIAbilityData");
} else {
this.EIAbilityData = generateAbilityData();
}
if (compound.hasKey("EIOwnershipData")) {
this.EIOwnershipData = compound.getCompoundTag("EIOwnershipData");
} else {
this.EIOwnershipData = generateOwnershipData();
}
if (compound.hasKey("EIMiscData")) {
this.EIMiscData = compound.getCompoundTag("EIMiscData");
} else {
this.EIMiscData = generateMiscData();
}
EIDebugHandler.sendDebugInfoToConsole(new DebugMessage("NBT's Initialised for: " + player.getEntityName() + "... Class: " + player.getClass(), DebugType.NBT));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment