mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-12-26 21:09:23 +01:00
Fixed booklet showing achievements about a million times if the item is wildcard
This commit is contained in:
parent
2590e4b4b3
commit
dc82f09583
2 changed files with 23 additions and 8 deletions
|
@ -134,7 +134,7 @@ public final class BookletUtils{
|
|||
return;
|
||||
}
|
||||
|
||||
ArrayList<String> infoList = null;
|
||||
List<TheAchievements> 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<String>();
|
||||
infoList.add(TextFormatting.GOLD+"Achievements related to this chapter:");
|
||||
if(achievements == null){
|
||||
achievements = new ArrayList<TheAchievements>();
|
||||
}
|
||||
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<String> infoList = null;
|
||||
for(TheAchievements achievement : achievements){
|
||||
if(infoList == null){
|
||||
infoList = new ArrayList<String>();
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in a new issue