From a4c751b47fe94f16e7f61e03104f3461bacf18b5 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Wed, 1 Jun 2016 15:22:30 +0200 Subject: [PATCH] Removed unfinished-tags in booklet and also made buttons client-side only --- .../actuallyadditions/mod/booklet/BookletUtils.java | 3 --- .../actuallyadditions/mod/booklet/InitBooklet.java | 4 ++-- .../mod/booklet/button/BookmarkButton.java | 3 +++ .../mod/booklet/button/IndexButton.java | 9 +++------ .../mod/booklet/button/TexturedButton.java | 3 +++ .../mod/booklet/chapter/BookletChapter.java | 6 ------ .../actuallyadditions/mod/inventory/gui/GuiInputter.java | 2 ++ 7 files changed, 13 insertions(+), 17 deletions(-) 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 00a8d8af2..ac2ff24be 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/BookletUtils.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/BookletUtils.java @@ -199,9 +199,6 @@ public class BookletUtils{ else if(button instanceof TexturedButton){ booklet.drawHoveringText(((TexturedButton)button).textList, mouseX, mouseY); } - else if(button instanceof IndexButton){ - ((IndexButton)button).drawHover(mouseX, mouseY); - } } } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/InitBooklet.java b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/InitBooklet.java index 80665ee9a..0c51820c4 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/InitBooklet.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/InitBooklet.java @@ -98,7 +98,7 @@ public class InitBooklet{ new BookletChapter("phantomRedstoneface", ActuallyAdditionsAPI.entryFunctionalNonRF, new ItemStack(InitBlocks.blockPhantomRedstoneface), new PageTextOnly(1), new PageCrafting(2, BlockCrafting.recipePhantomRedstoneface).setNoText()); new BookletChapter("phantomBreaker", ActuallyAdditionsAPI.entryFunctionalNonRF, new ItemStack(InitBlocks.blockPhantomBreaker), new PageTextOnly(1).addTextReplacement("", TileEntityPhantomPlacer.RANGE), new PageCrafting(2, BlockCrafting.recipePhantomPlacer).setNoText(), new PageCrafting(3, BlockCrafting.recipePhantomBreaker).setNoText()); new BookletChapter("esd", ActuallyAdditionsAPI.entryFunctionalNonRF, new ItemStack(InitBlocks.blockInputterAdvanced), new PageTextOnly(1), new PageCrafting(2, BlockCrafting.recipeESD).setNoText(), new PageCrafting(3, BlockCrafting.recipeAdvancedESD).setNoText()).setSpecial(); - new BookletChapter("xpSolidifier", ActuallyAdditionsAPI.entryFunctionalNonRF, new ItemStack(InitBlocks.blockXPSolidifier), new PageTextOnly(1).setStack(new ItemStack(InitItems.itemSolidifiedExperience)), new PageCrafting(2, BlockCrafting.recipeSolidifier).setNoText()).setSpecial().setIncomplete(); + new BookletChapter("xpSolidifier", ActuallyAdditionsAPI.entryFunctionalNonRF, new ItemStack(InitBlocks.blockXPSolidifier), new PageTextOnly(1).setStack(new ItemStack(InitItems.itemSolidifiedExperience)), new PageCrafting(2, BlockCrafting.recipeSolidifier).setNoText()).setSpecial(); new BookletChapter("greenhouseGlass", ActuallyAdditionsAPI.entryFunctionalNonRF, new ItemStack(InitBlocks.blockGreenhouseGlass), new PageTextOnly(1), new PageCrafting(2, BlockCrafting.recipeGlass)); new BookletChapter("fishingNet", ActuallyAdditionsAPI.entryFunctionalNonRF, new ItemStack(InitBlocks.blockFishingNet), new PageTextOnly(1), new PageCrafting(2, BlockCrafting.recipeFisher).setNoText()); new BookletChapter("feeder", ActuallyAdditionsAPI.entryFunctionalNonRF, new ItemStack(InitBlocks.blockFeeder), new PageTextOnly(1), new PageCrafting(2, BlockCrafting.recipeFeeder).setNoText()); @@ -135,7 +135,7 @@ public class InitBooklet{ } new BookletChapter("aiots", ActuallyAdditionsAPI.entryItemsNonRF, new ItemStack(InitItems.emeraldPaxel), aiotPages.toArray(new BookletPage[aiotPages.size()])).setImportant(); - new BookletChapter("jams", ActuallyAdditionsAPI.entryItemsNonRF, new ItemStack(InitItems.itemJams), new PageTextOnly(1).setStack(new ItemStack(InitItems.itemJams, 1, Util.WILDCARD)), new PagePicture(2, "pageJamHouse", 150), new PageTextOnly(3)).setIncomplete(); + new BookletChapter("jams", ActuallyAdditionsAPI.entryItemsNonRF, new ItemStack(InitItems.itemJams), new PageTextOnly(1).setStack(new ItemStack(InitItems.itemJams, 1, Util.WILDCARD)), new PagePicture(2, "pageJamHouse", 150), new PageTextOnly(3)); ArrayList potionRingPages = new ArrayList(); potionRingPages.add(new PageTextOnly(potionRingPages.size()+1)); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/button/BookmarkButton.java b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/button/BookmarkButton.java index 78c4d5e97..da0891eb5 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/button/BookmarkButton.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/button/BookmarkButton.java @@ -21,9 +21,12 @@ import net.minecraft.client.gui.GuiScreen; import net.minecraft.client.renderer.GlStateManager; import net.minecraft.item.ItemStack; import net.minecraft.util.text.TextFormatting; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; import java.util.ArrayList; +@SideOnly(Side.CLIENT) public class BookmarkButton extends GuiButton{ private final GuiBooklet booklet; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/button/IndexButton.java b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/button/IndexButton.java index 355f90d3b..913d47502 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/button/IndexButton.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/button/IndexButton.java @@ -20,7 +20,10 @@ import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiButton; import net.minecraft.client.renderer.GlStateManager; import net.minecraft.util.text.TextFormatting; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; +@SideOnly(Side.CLIENT) public class IndexButton extends GuiButton{ private final GuiBooklet gui; @@ -60,10 +63,4 @@ public class IndexButton extends GuiButton{ this.gui.getFontRenderer().drawString(this.displayString, this.xPosition+textOffsetX, this.yPosition+(this.height-8)/2, 0); } } - - public void drawHover(int mouseX, int mouseY){ - if(this.chap instanceof BookletChapter && ((BookletChapter)this.chap).isIncomplete){ - this.gui.drawHoveringText(this.gui.getFontRenderer().listFormattedStringToWidth(TextFormatting.RED+StringUtil.localize("booklet."+ModUtil.MOD_ID+".unavailable"), 250), mouseX, mouseY); - } - } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/button/TexturedButton.java b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/button/TexturedButton.java index 4a57984d3..85ec24e59 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/button/TexturedButton.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/button/TexturedButton.java @@ -14,10 +14,13 @@ import de.ellpeck.actuallyadditions.mod.booklet.GuiBooklet; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiButton; import net.minecraft.client.renderer.GlStateManager; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; import java.util.ArrayList; import java.util.List; +@SideOnly(Side.CLIENT) public class TexturedButton extends GuiButton{ public final List textList = new ArrayList(); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/chapter/BookletChapter.java b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/chapter/BookletChapter.java index eabe46a6a..a784e0745 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/chapter/BookletChapter.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/chapter/BookletChapter.java @@ -27,8 +27,6 @@ public class BookletChapter implements IBookletChapter{ private final String unlocalizedName; public TextFormatting color; - public boolean isIncomplete; - public BookletChapter(String unlocalizedName, IBookletEntry entry, ItemStack displayStack, BookletPage... pages){ this.pages = pages.clone(); @@ -75,10 +73,6 @@ public class BookletChapter implements IBookletChapter{ return this.displayStack; } - public void setIncomplete(){ - this.isIncomplete = true; - } - public void setImportant(){ this.color = TextFormatting.DARK_GREEN; } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiInputter.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiInputter.java index e7cff237f..5f6d2fc92 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiInputter.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiInputter.java @@ -269,6 +269,7 @@ public class GuiInputter extends GuiContainer{ } } + @SideOnly(Side.CLIENT) public static class SmallerButton extends GuiButton{ public final ResourceLocation resLoc = AssetUtil.getGuiLocation("guiInputter"); @@ -306,6 +307,7 @@ public class GuiInputter extends GuiContainer{ } } + @SideOnly(Side.CLIENT) public static class TinyButton extends GuiButton{ public final ResourceLocation resLoc = AssetUtil.getGuiLocation("guiInputter");