@Override
  public void loadNBTData(NBTTagCompound playerNbt) {
    NBTTagCompound nbt = playerNbt.getCompoundTag(IDENTIFIER);

    karma = nbt.getFloat("karma");
    flyTime = nbt.getShort("flyTime");
    invisibilityCooldown = nbt.getShort("invisCooldown");

    NBTTagList eventList = nbt.getTagList("events");
    for (int i = 0; i < eventList.tagCount(); i++) {
      NBTTagCompound evtInfo = (NBTTagCompound) eventList.tagAt(i);
      byte eventId = evtInfo.getByte("id");
      if (eventId >= 0 && eventId < eventAmounts.length) {
        eventAmounts[eventId] = evtInfo.getByte("value");
      }
    }

    enderbookRecipes = nbt.getByteArray("enderBook");
    activeQuests = Quest.readQuests(nbt.getTagList("quests"), player);
  }
  @Override
  public void saveNBTData(NBTTagCompound nbtPlayer) {
    NBTTagCompound nbt = new NBTTagCompound();

    nbt.setFloat("karma", karma);
    nbt.setShort("flyTime", (short) flyTime);
    nbt.setShort("invisCooldown", (short) invisibilityCooldown);

    NBTTagList eventList = new NBTTagList();
    for (int i = 0; i < eventAmounts.length; i++) {
      NBTTagCompound evtInfo = new NBTTagCompound();
      evtInfo.setByte("id", (byte) i);
      evtInfo.setByte("value", eventAmounts[i]);
      eventList.appendTag(evtInfo);
    }
    nbt.setTag("events", eventList);

    nbt.setByteArray("enderBook", enderbookRecipes);

    nbt.setTag("quests", Quest.writeQuests(activeQuests));

    nbtPlayer.setCompoundTag(IDENTIFIER, nbt);
  }
 public void setQuests(List<Quest> quests) {
   for (Quest quest : quests) {
     quest.setPlayer(player);
   }
   activeQuests = quests;
 }