diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/BookletUtils.java b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/BookletUtils.java index 8f4ade0ee..66baf74ce 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/BookletUtils.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/BookletUtils.java @@ -134,7 +134,7 @@ public final class BookletUtils{ return; } - ArrayList infoList = null; + List achievements = null; for(BookletPage page : booklet.currentEntrySet.getCurrentChapter().getPages()){ if(page != null && page.getItemStacksForPage() != null){ for(ItemStack stack : page.getItemStacksForPage()){ @@ -148,12 +148,12 @@ public final class BookletUtils{ } else{ if(mouseX >= booklet.guiLeft+booklet.xSize+1 && mouseX < booklet.guiLeft+booklet.xSize+1+22 && mouseY >= booklet.guiTop-18 && mouseY < booklet.guiTop-18+21){ - if(infoList == null){ - infoList = new ArrayList(); - infoList.add(TextFormatting.GOLD+"Achievements related to this chapter:"); + if(achievements == null){ + achievements = new ArrayList(); + } + if(!achievements.contains(achievement)){ + achievements.add(achievement); } - infoList.add("-"+StringUtil.localize(achievement.chieve.statId)); - infoList.add(TextFormatting.GRAY+"("+achievement.chieve.getDescription()+")"); } } } @@ -163,8 +163,20 @@ public final class BookletUtils{ } } - if(infoList != null){ - booklet.drawHoveringText(infoList, mouseX, mouseY); + if(achievements != null){ + List infoList = null; + for(TheAchievements achievement : achievements){ + if(infoList == null){ + infoList = new ArrayList(); + infoList.add(TextFormatting.GOLD+"Achievements related to this chapter:"); + } + infoList.add("-"+StringUtil.localize(achievement.chieve.statId)); + infoList.add(TextFormatting.GRAY+"("+achievement.chieve.getDescription()+")"); + } + + if(infoList != null){ + booklet.drawHoveringText(infoList, mouseX, mouseY); + } } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/data/WorldData.java b/src/main/java/de/ellpeck/actuallyadditions/mod/data/WorldData.java index 04c472060..594329c34 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/data/WorldData.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/data/WorldData.java @@ -64,6 +64,9 @@ public class WorldData{ public static void load(World world){ if(!world.isRemote && world instanceof WorldServer){ + //Just to be sure it actually gets cleared all the time + PLAYER_SAVE_DATA.clear(); + WorldData data = new WorldData(new WorldSpecificSaveHandler((WorldServer)world, world.getSaveHandler()), world.provider.getDimension()); WORLD_DATA.put(data.dimension, data);