From 6efbd6e1587740965c10afacaca8ed4066d173bd Mon Sep 17 00:00:00 2001 From: Nedelosk Date: Fri, 6 Apr 2018 00:45:53 +0200 Subject: [PATCH] Add missing Side Only Annotations Fix #2076 --- src/main/java/forestry/api/book/BookContent.java | 4 ++++ src/main/java/forestry/api/book/BookManager.java | 4 ++++ src/main/java/forestry/api/book/IBookCategory.java | 4 ++++ src/main/java/forestry/api/book/IBookContent.java | 4 ++++ src/main/java/forestry/api/book/IBookEntry.java | 4 ++++ src/main/java/forestry/api/book/IBookEntryBuilder.java | 4 ++++ src/main/java/forestry/api/book/IBookLoader.java | 4 ++++ src/main/java/forestry/api/book/IBookPageFactory.java | 4 ++++ src/main/java/forestry/api/book/IForesterBook.java | 4 ++++ src/main/java/forestry/book/BookCategory.java | 4 ++++ src/main/java/forestry/book/BookEntry.java | 4 ++++ src/main/java/forestry/book/BookEntryBuilder.java | 4 ++++ src/main/java/forestry/book/BookLoader.java | 4 ++++ src/main/java/forestry/book/ForesterBook.java | 4 ++++ src/main/java/forestry/book/ModuleBook.java | 3 +-- src/main/java/forestry/book/data/CraftingData.java | 4 ++++ src/main/java/forestry/book/data/EntryData.java | 4 ++++ src/main/java/forestry/book/data/IndexData.java | 4 ++++ src/main/java/forestry/book/data/IndexEntry.java | 4 ++++ .../java/forestry/book/data/content/CarpenterContent.java | 4 ++++ .../java/forestry/book/data/content/CraftingContent.java | 3 +++ .../java/forestry/book/data/content/FabricatorContent.java | 4 ++++ src/main/java/forestry/book/data/content/ImageContent.java | 4 ++++ src/main/java/forestry/book/data/content/IndexContent.java | 7 ++++--- .../java/forestry/book/data/content/MutationContent.java | 4 ++++ .../java/forestry/book/data/content/StructureContent.java | 4 ++++ src/main/java/forestry/book/data/content/TextContent.java | 4 ++++ .../book/data/deserializer/BookCategoryDeserializer.java | 4 ++++ .../book/data/deserializer/BookContentDeserializer.java | 4 ++++ src/main/java/forestry/book/data/structure/BlockData.java | 4 ++++ .../forestry/book/data/structure/StructureBlockAccess.java | 4 ++++ .../java/forestry/book/data/structure/StructureData.java | 4 ++++ .../java/forestry/book/data/structure/StructureInfo.java | 4 ++++ src/main/java/forestry/book/gui/GuiForesterBook.java | 3 +++ .../java/forestry/book/gui/GuiForestryBookCategories.java | 4 ++++ .../java/forestry/book/gui/GuiForestryBookEntries.java | 4 ++++ src/main/java/forestry/book/gui/GuiForestryBookPages.java | 4 ++++ src/main/java/forestry/book/gui/buttons/GuiButtonBack.java | 4 ++++ .../forestry/book/gui/buttons/GuiButtonBookCategory.java | 4 ++++ .../java/forestry/book/gui/buttons/GuiButtonEntry.java | 4 ++++ src/main/java/forestry/book/gui/buttons/GuiButtonPage.java | 4 ++++ .../java/forestry/book/gui/buttons/GuiButtonSubEntry.java | 4 ++++ .../java/forestry/book/gui/elements/CarpenterElement.java | 4 ++++ .../java/forestry/book/gui/elements/CraftingElement.java | 4 ++++ .../java/forestry/book/gui/elements/FabricatorElement.java | 4 ++++ src/main/java/forestry/book/gui/elements/IndexElement.java | 4 ++++ .../java/forestry/book/gui/elements/MultiblockElement.java | 4 ++++ .../java/forestry/book/gui/elements/MutationElement.java | 4 ++++ .../java/forestry/book/gui/elements/SelectionElement.java | 4 ++++ .../java/forestry/book/gui/elements/TextDataElement.java | 4 ++++ src/main/java/forestry/book/items/ItemForesterBook.java | 4 ++++ src/main/java/forestry/book/pages/JsonPageFactory.java | 4 ++++ src/main/java/forestry/book/proxy/ProxyBook.java | 2 ++ src/main/java/forestry/book/proxy/ProxyBookClient.java | 6 ++++++ 54 files changed, 211 insertions(+), 5 deletions(-) diff --git a/src/main/java/forestry/api/book/BookContent.java b/src/main/java/forestry/api/book/BookContent.java index cf0dd91fb..e6f6d5cbf 100644 --- a/src/main/java/forestry/api/book/BookContent.java +++ b/src/main/java/forestry/api/book/BookContent.java @@ -7,6 +7,9 @@ package forestry.api.book; import javax.annotation.Nullable; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; + import forestry.api.gui.IElementGroup; import forestry.api.gui.IGuiElement; import forestry.api.gui.IGuiElementFactory; @@ -14,6 +17,7 @@ import forestry.api.gui.IGuiElementFactory; /** * The deserialized content data of a book page. It creates a gui element at the moment the entry gets opened. */ +@SideOnly(Side.CLIENT) public abstract class BookContent { public String type; diff --git a/src/main/java/forestry/api/book/BookManager.java b/src/main/java/forestry/api/book/BookManager.java index 608fc680d..7c26adcb3 100644 --- a/src/main/java/forestry/api/book/BookManager.java +++ b/src/main/java/forestry/api/book/BookManager.java @@ -5,6 +5,10 @@ ******************************************************************************/ package forestry.api.book; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; + public class BookManager { + @SideOnly(Side.CLIENT) public static IBookLoader loader; } diff --git a/src/main/java/forestry/api/book/IBookCategory.java b/src/main/java/forestry/api/book/IBookCategory.java index 2f44cdef8..eb885dce1 100644 --- a/src/main/java/forestry/api/book/IBookCategory.java +++ b/src/main/java/forestry/api/book/IBookCategory.java @@ -10,6 +10,10 @@ import java.util.Collection; import net.minecraft.item.ItemStack; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; + +@SideOnly(Side.CLIENT) public interface IBookCategory { /** * @return the {@link ItemStack} that represents this category at the front page. diff --git a/src/main/java/forestry/api/book/IBookContent.java b/src/main/java/forestry/api/book/IBookContent.java index 449aa74f2..c1f45fc94 100644 --- a/src/main/java/forestry/api/book/IBookContent.java +++ b/src/main/java/forestry/api/book/IBookContent.java @@ -2,10 +2,14 @@ package forestry.api.book; import javax.annotation.Nullable; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; + import forestry.api.gui.IElementGroup; import forestry.api.gui.IGuiElement; import forestry.api.gui.IGuiElementFactory; +@SideOnly(Side.CLIENT) public interface IBookContent { /** * Called after the deserialization. diff --git a/src/main/java/forestry/api/book/IBookEntry.java b/src/main/java/forestry/api/book/IBookEntry.java index 97f8aa382..39613e235 100644 --- a/src/main/java/forestry/api/book/IBookEntry.java +++ b/src/main/java/forestry/api/book/IBookEntry.java @@ -9,12 +9,16 @@ import javax.annotation.Nullable; import net.minecraft.item.ItemStack; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; + /** * A entry in the {@link IForesterBook}. *

* Forestry crates them with the help of json file, but you can add you own custom ones with * {@link IBookCategory#addEntry(IBookEntry)}. */ +@SideOnly(Side.CLIENT) public interface IBookEntry { /** diff --git a/src/main/java/forestry/api/book/IBookEntryBuilder.java b/src/main/java/forestry/api/book/IBookEntryBuilder.java index c53a06223..962f92144 100644 --- a/src/main/java/forestry/api/book/IBookEntryBuilder.java +++ b/src/main/java/forestry/api/book/IBookEntryBuilder.java @@ -9,6 +9,10 @@ import javax.annotation.Nullable; import net.minecraft.item.ItemStack; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; + +@SideOnly(Side.CLIENT) public interface IBookEntryBuilder { /** diff --git a/src/main/java/forestry/api/book/IBookLoader.java b/src/main/java/forestry/api/book/IBookLoader.java index 5ab5d13f6..6778919ca 100644 --- a/src/main/java/forestry/api/book/IBookLoader.java +++ b/src/main/java/forestry/api/book/IBookLoader.java @@ -5,6 +5,10 @@ ******************************************************************************/ package forestry.api.book; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; + +@SideOnly(Side.CLIENT) public interface IBookLoader { /** diff --git a/src/main/java/forestry/api/book/IBookPageFactory.java b/src/main/java/forestry/api/book/IBookPageFactory.java index bb5114112..ccbe6f0ce 100644 --- a/src/main/java/forestry/api/book/IBookPageFactory.java +++ b/src/main/java/forestry/api/book/IBookPageFactory.java @@ -7,11 +7,15 @@ package forestry.api.book; import java.util.Collection; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; + import forestry.api.gui.IGuiElement; /** * A factory that creates book pages for a book entry. */ +@SideOnly(Side.CLIENT) public interface IBookPageFactory { /** * Usually called at the moment the player opens the given entry. diff --git a/src/main/java/forestry/api/book/IForesterBook.java b/src/main/java/forestry/api/book/IForesterBook.java index cbda26a05..4a766810f 100644 --- a/src/main/java/forestry/api/book/IForesterBook.java +++ b/src/main/java/forestry/api/book/IForesterBook.java @@ -8,11 +8,15 @@ package forestry.api.book; import javax.annotation.Nullable; import java.util.Collection; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; + /** * IForesterBook is the interface that the forestry guide book class implements. *

* You can get the current instance of the guide book from {@link IBookLoader#loadBook()}. */ +@SideOnly(Side.CLIENT) public interface IForesterBook { /** diff --git a/src/main/java/forestry/book/BookCategory.java b/src/main/java/forestry/book/BookCategory.java index 6d04f0712..35338b88e 100644 --- a/src/main/java/forestry/book/BookCategory.java +++ b/src/main/java/forestry/book/BookCategory.java @@ -7,11 +7,15 @@ import java.util.Map; import net.minecraft.item.ItemStack; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; + import forestry.api.book.IBookCategory; import forestry.api.book.IBookEntry; import forestry.api.book.IBookEntryBuilder; import forestry.core.utils.Translator; +@SideOnly(Side.CLIENT) public class BookCategory implements IBookCategory { private final String name; private final transient Map entries = new LinkedHashMap<>(); diff --git a/src/main/java/forestry/book/BookEntry.java b/src/main/java/forestry/book/BookEntry.java index 00ec95a32..9715a7f58 100644 --- a/src/main/java/forestry/book/BookEntry.java +++ b/src/main/java/forestry/book/BookEntry.java @@ -5,10 +5,14 @@ import java.util.function.Function; import net.minecraft.item.ItemStack; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; + import forestry.api.book.BookContent; import forestry.api.book.IBookEntry; import forestry.api.book.IBookPageFactory; +@SideOnly(Side.CLIENT) public class BookEntry implements IBookEntry { private final String name; private final ItemStack stack; diff --git a/src/main/java/forestry/book/BookEntryBuilder.java b/src/main/java/forestry/book/BookEntryBuilder.java index b94f2ab6b..1f4a28569 100644 --- a/src/main/java/forestry/book/BookEntryBuilder.java +++ b/src/main/java/forestry/book/BookEntryBuilder.java @@ -6,6 +6,9 @@ import java.util.List; import net.minecraft.item.ItemStack; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; + import forestry.api.book.BookContent; import forestry.api.book.IBookCategory; import forestry.api.book.IBookEntry; @@ -13,6 +16,7 @@ import forestry.api.book.IBookEntryBuilder; import forestry.api.book.IBookPageFactory; import forestry.book.pages.JsonPageFactory; +@SideOnly(Side.CLIENT) public class BookEntryBuilder implements IBookEntryBuilder { private final String name; private final IBookCategory category; diff --git a/src/main/java/forestry/book/BookLoader.java b/src/main/java/forestry/book/BookLoader.java index 790c08708..21150ae5a 100644 --- a/src/main/java/forestry/book/BookLoader.java +++ b/src/main/java/forestry/book/BookLoader.java @@ -32,6 +32,9 @@ import net.minecraft.item.ItemStack; import net.minecraft.util.JsonUtils; import net.minecraft.util.ResourceLocation; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; + import forestry.api.book.BookContent; import forestry.api.book.IBookEntryBuilder; import forestry.api.book.IBookLoader; @@ -54,6 +57,7 @@ import forestry.core.utils.Log; import forestry.core.utils.ResourceUtil; import forestry.modules.ModuleHelper; +@SideOnly(Side.CLIENT) public class BookLoader implements IResourceManagerReloadListener, IBookLoader { public static final Gson GSON = new GsonBuilder() .registerTypeAdapter(BookContent.class, new BookContentDeserializer()) diff --git a/src/main/java/forestry/book/ForesterBook.java b/src/main/java/forestry/book/ForesterBook.java index 79e316cc9..b063653cd 100644 --- a/src/main/java/forestry/book/ForesterBook.java +++ b/src/main/java/forestry/book/ForesterBook.java @@ -6,10 +6,14 @@ import java.util.Collections; import java.util.HashMap; import java.util.Map; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; + import forestry.api.book.IBookCategory; import forestry.api.book.IBookEntry; import forestry.api.book.IForesterBook; +@SideOnly(Side.CLIENT) public class ForesterBook implements IForesterBook { private final Map categoriesByName = new HashMap<>(); diff --git a/src/main/java/forestry/book/ModuleBook.java b/src/main/java/forestry/book/ModuleBook.java index f6949deeb..766ba3c1c 100644 --- a/src/main/java/forestry/book/ModuleBook.java +++ b/src/main/java/forestry/book/ModuleBook.java @@ -11,7 +11,6 @@ import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.fml.common.SidedProxy; -import forestry.api.book.BookManager; import forestry.api.modules.ForestryModule; import forestry.book.items.ItemRegistryBook; import forestry.book.proxy.ProxyBook; @@ -41,7 +40,7 @@ public class ModuleBook extends BlankForestryModule { @Override public void setupAPI() { - BookManager.loader = BookLoader.INSTANCE; + proxy.setupAPI(); } @Override diff --git a/src/main/java/forestry/book/data/CraftingData.java b/src/main/java/forestry/book/data/CraftingData.java index df7ab6d8c..94aa891bf 100644 --- a/src/main/java/forestry/book/data/CraftingData.java +++ b/src/main/java/forestry/book/data/CraftingData.java @@ -3,6 +3,10 @@ package forestry.book.data; import net.minecraft.item.ItemStack; import net.minecraft.util.ResourceLocation; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; + +@SideOnly(Side.CLIENT) public class CraftingData { /** * The {@link ResourceLocation}s of the recipes of this crafting data. diff --git a/src/main/java/forestry/book/data/EntryData.java b/src/main/java/forestry/book/data/EntryData.java index 6a4434599..8d32bb27f 100644 --- a/src/main/java/forestry/book/data/EntryData.java +++ b/src/main/java/forestry/book/data/EntryData.java @@ -2,8 +2,12 @@ package forestry.book.data; import net.minecraft.item.ItemStack; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; + import forestry.api.book.BookContent; +@SideOnly(Side.CLIENT) public class EntryData { /** * The localized title of the entry. diff --git a/src/main/java/forestry/book/data/IndexData.java b/src/main/java/forestry/book/data/IndexData.java index c30d20a11..5ee78d18d 100644 --- a/src/main/java/forestry/book/data/IndexData.java +++ b/src/main/java/forestry/book/data/IndexData.java @@ -1,5 +1,9 @@ package forestry.book.data; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; + +@SideOnly(Side.CLIENT) public class IndexData { /** * All entries of this index. diff --git a/src/main/java/forestry/book/data/IndexEntry.java b/src/main/java/forestry/book/data/IndexEntry.java index 95a69b406..45d532cce 100644 --- a/src/main/java/forestry/book/data/IndexEntry.java +++ b/src/main/java/forestry/book/data/IndexEntry.java @@ -1,8 +1,12 @@ package forestry.book.data; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; + /** * A entry of an index. */ +@SideOnly(Side.CLIENT) public class IndexEntry { /** * The localized name of the entry. diff --git a/src/main/java/forestry/book/data/content/CarpenterContent.java b/src/main/java/forestry/book/data/content/CarpenterContent.java index 9227cf760..b16e41f6e 100644 --- a/src/main/java/forestry/book/data/content/CarpenterContent.java +++ b/src/main/java/forestry/book/data/content/CarpenterContent.java @@ -2,6 +2,9 @@ package forestry.book.data.content; import javax.annotation.Nullable; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; + import forestry.api.book.BookContent; import forestry.api.gui.IElementGroup; import forestry.api.gui.IGuiElement; @@ -12,6 +15,7 @@ import forestry.book.gui.elements.CarpenterElement; /** * A book content that displays a carpenter recipe. */ +@SideOnly(Side.CLIENT) public class CarpenterContent extends BookContent { @Nullable diff --git a/src/main/java/forestry/book/data/content/CraftingContent.java b/src/main/java/forestry/book/data/content/CraftingContent.java index 9a7a90f8e..89f95198e 100644 --- a/src/main/java/forestry/book/data/content/CraftingContent.java +++ b/src/main/java/forestry/book/data/content/CraftingContent.java @@ -8,6 +8,8 @@ import net.minecraft.item.crafting.IRecipe; import net.minecraft.util.ResourceLocation; import net.minecraftforge.fml.common.registry.ForgeRegistries; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; import forestry.api.book.BookContent; import forestry.api.gui.IElementGroup; @@ -19,6 +21,7 @@ import forestry.book.gui.elements.CraftingElement; /** * A book content that displays one ore more crafting recipes. */ +@SideOnly(Side.CLIENT) public class CraftingContent extends BookContent { @Override public Class getDataClass() { diff --git a/src/main/java/forestry/book/data/content/FabricatorContent.java b/src/main/java/forestry/book/data/content/FabricatorContent.java index 74f246804..50ea8dc64 100644 --- a/src/main/java/forestry/book/data/content/FabricatorContent.java +++ b/src/main/java/forestry/book/data/content/FabricatorContent.java @@ -8,6 +8,9 @@ import java.util.Map; import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; + import forestry.api.book.BookContent; import forestry.api.gui.IElementGroup; import forestry.api.gui.IGuiElement; @@ -17,6 +20,7 @@ import forestry.book.data.CraftingData; import forestry.book.gui.elements.FabricatorElement; import forestry.factory.recipes.FabricatorSmeltingRecipeManager; +@SideOnly(Side.CLIENT) public class FabricatorContent extends BookContent { @Override diff --git a/src/main/java/forestry/book/data/content/ImageContent.java b/src/main/java/forestry/book/data/content/ImageContent.java index 8283fa43f..8d1a23c59 100644 --- a/src/main/java/forestry/book/data/content/ImageContent.java +++ b/src/main/java/forestry/book/data/content/ImageContent.java @@ -2,6 +2,9 @@ package forestry.book.data.content; import javax.annotation.Nullable; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; + import forestry.api.book.BookContent; import forestry.api.gui.GuiElementAlignment; import forestry.api.gui.IElementGroup; @@ -13,6 +16,7 @@ import forestry.core.gui.elements.DrawableElement; /** * A book content that displays a image. */ +@SideOnly(Side.CLIENT) public class ImageContent extends BookContent { //The size fo the gui element. private int width; diff --git a/src/main/java/forestry/book/data/content/IndexContent.java b/src/main/java/forestry/book/data/content/IndexContent.java index eca6b3584..962d46ebf 100644 --- a/src/main/java/forestry/book/data/content/IndexContent.java +++ b/src/main/java/forestry/book/data/content/IndexContent.java @@ -2,6 +2,9 @@ package forestry.book.data.content; import javax.annotation.Nullable; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; + import forestry.api.book.BookContent; import forestry.api.gui.IElementGroup; import forestry.api.gui.IGuiElement; @@ -9,9 +12,7 @@ import forestry.api.gui.IGuiElementFactory; import forestry.book.data.IndexData; import forestry.book.gui.elements.IndexElement; -/** - * A book - */ +@SideOnly(Side.CLIENT) public class IndexContent extends BookContent { @Nullable @Override diff --git a/src/main/java/forestry/book/data/content/MutationContent.java b/src/main/java/forestry/book/data/content/MutationContent.java index f0a3561ca..d1b14274f 100644 --- a/src/main/java/forestry/book/data/content/MutationContent.java +++ b/src/main/java/forestry/book/data/content/MutationContent.java @@ -2,6 +2,9 @@ package forestry.book.data.content; import javax.annotation.Nullable; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; + import forestry.api.book.BookContent; import forestry.api.genetics.AlleleManager; import forestry.api.genetics.IAllele; @@ -16,6 +19,7 @@ import forestry.book.gui.elements.MutationElement; /** * A book content that displays one or more mutations. */ +@SideOnly(Side.CLIENT) public class MutationContent extends BookContent { public String species = ""; diff --git a/src/main/java/forestry/book/data/content/StructureContent.java b/src/main/java/forestry/book/data/content/StructureContent.java index 79f473941..bdc240f11 100644 --- a/src/main/java/forestry/book/data/content/StructureContent.java +++ b/src/main/java/forestry/book/data/content/StructureContent.java @@ -23,6 +23,9 @@ import org.apache.commons.io.IOUtils; import net.minecraft.client.resources.IResource; import net.minecraft.util.ResourceLocation; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; + import forestry.api.book.BookContent; import forestry.api.gui.IElementGroup; import forestry.api.gui.IGuiElement; @@ -37,6 +40,7 @@ import forestry.core.utils.ResourceUtil; /** * A book content that displays a multiblock structure. */ +@SideOnly(Side.CLIENT) public class StructureContent extends BookContent { @Nullable private String structureFile = null; diff --git a/src/main/java/forestry/book/data/content/TextContent.java b/src/main/java/forestry/book/data/content/TextContent.java index 916adffb9..ec6d0d9be 100644 --- a/src/main/java/forestry/book/data/content/TextContent.java +++ b/src/main/java/forestry/book/data/content/TextContent.java @@ -2,6 +2,9 @@ package forestry.book.data.content; import javax.annotation.Nullable; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; + import forestry.api.book.BookContent; import forestry.api.gui.IElementGroup; import forestry.api.gui.IGuiElement; @@ -12,6 +15,7 @@ import forestry.book.gui.elements.TextDataElement; /** * A book content that displays one or more texts. */ +@SideOnly(Side.CLIENT) public class TextContent extends BookContent { @Override public Class getDataClass() { diff --git a/src/main/java/forestry/book/data/deserializer/BookCategoryDeserializer.java b/src/main/java/forestry/book/data/deserializer/BookCategoryDeserializer.java index 1fac2ad3f..1803c41b8 100644 --- a/src/main/java/forestry/book/data/deserializer/BookCategoryDeserializer.java +++ b/src/main/java/forestry/book/data/deserializer/BookCategoryDeserializer.java @@ -10,9 +10,13 @@ import java.lang.reflect.Type; import net.minecraft.item.ItemStack; import net.minecraft.util.JsonUtils; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; + import forestry.book.BookCategory; import forestry.core.utils.JsonUtil; +@SideOnly(Side.CLIENT) public class BookCategoryDeserializer implements JsonDeserializer { @Override public BookCategory deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) { diff --git a/src/main/java/forestry/book/data/deserializer/BookContentDeserializer.java b/src/main/java/forestry/book/data/deserializer/BookContentDeserializer.java index 347c53a2e..4987f53ff 100644 --- a/src/main/java/forestry/book/data/deserializer/BookContentDeserializer.java +++ b/src/main/java/forestry/book/data/deserializer/BookContentDeserializer.java @@ -9,10 +9,14 @@ import java.lang.reflect.Type; import net.minecraft.util.JsonUtils; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; + import forestry.api.book.BookContent; import forestry.book.BookLoader; import forestry.book.data.content.TextContent; +@SideOnly(Side.CLIENT) public class BookContentDeserializer implements JsonDeserializer { @Override public BookContent deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) { diff --git a/src/main/java/forestry/book/data/structure/BlockData.java b/src/main/java/forestry/book/data/structure/BlockData.java index dadfa58e5..37db0e1a7 100644 --- a/src/main/java/forestry/book/data/structure/BlockData.java +++ b/src/main/java/forestry/book/data/structure/BlockData.java @@ -16,6 +16,10 @@ import com.google.gson.JsonObject; import java.util.Map; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; + +@SideOnly(Side.CLIENT) public class BlockData { public int[] pos; public int[] endPos; diff --git a/src/main/java/forestry/book/data/structure/StructureBlockAccess.java b/src/main/java/forestry/book/data/structure/StructureBlockAccess.java index 88d4d439a..3042a90da 100644 --- a/src/main/java/forestry/book/data/structure/StructureBlockAccess.java +++ b/src/main/java/forestry/book/data/structure/StructureBlockAccess.java @@ -23,6 +23,10 @@ import net.minecraft.world.IBlockAccess; import net.minecraft.world.WorldType; import net.minecraft.world.biome.Biome; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; + +@SideOnly(Side.CLIENT) public class StructureBlockAccess implements IBlockAccess { private final StructureInfo data; diff --git a/src/main/java/forestry/book/data/structure/StructureData.java b/src/main/java/forestry/book/data/structure/StructureData.java index 4b432f800..872b42314 100644 --- a/src/main/java/forestry/book/data/structure/StructureData.java +++ b/src/main/java/forestry/book/data/structure/StructureData.java @@ -1,5 +1,9 @@ package forestry.book.data.structure; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; + +@SideOnly(Side.CLIENT) public class StructureData { public int[] size = new int[0]; public BlockData[] structure = new BlockData[0]; diff --git a/src/main/java/forestry/book/data/structure/StructureInfo.java b/src/main/java/forestry/book/data/structure/StructureInfo.java index 80b8af976..f4241fbee 100644 --- a/src/main/java/forestry/book/data/structure/StructureInfo.java +++ b/src/main/java/forestry/book/data/structure/StructureInfo.java @@ -20,6 +20,10 @@ import net.minecraft.block.properties.IProperty; import net.minecraft.block.state.IBlockState; import net.minecraft.init.Blocks; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; + +@SideOnly(Side.CLIENT) public class StructureInfo { public IBlockState[][][] data; public int blockCount = 0; diff --git a/src/main/java/forestry/book/gui/GuiForesterBook.java b/src/main/java/forestry/book/gui/GuiForesterBook.java index 812813e99..846dcc312 100644 --- a/src/main/java/forestry/book/gui/GuiForesterBook.java +++ b/src/main/java/forestry/book/gui/GuiForesterBook.java @@ -14,6 +14,8 @@ import net.minecraft.util.ResourceLocation; import net.minecraft.util.text.TextFormatting; import net.minecraftforge.fml.client.config.GuiUtils; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; import forestry.api.book.IForesterBook; import forestry.book.gui.buttons.GuiButtonBack; @@ -23,6 +25,7 @@ import forestry.core.gui.GuiUtil; import forestry.core.gui.IGuiSizable; import forestry.core.gui.elements.ElementManager; +@SideOnly(Side.CLIENT) public abstract class GuiForesterBook extends GuiScreen implements IGuiSizable { public static final ResourceLocation TEXTURE = new ResourceLocation(Constants.MOD_ID, Constants.TEXTURE_PATH_GUI + "/almanac/almanac.png"); static final int LEFT_PAGE_START_X = 16; diff --git a/src/main/java/forestry/book/gui/GuiForestryBookCategories.java b/src/main/java/forestry/book/gui/GuiForestryBookCategories.java index 4608fb1ea..26ef6b6d6 100644 --- a/src/main/java/forestry/book/gui/GuiForestryBookCategories.java +++ b/src/main/java/forestry/book/gui/GuiForestryBookCategories.java @@ -6,6 +6,9 @@ import net.minecraft.client.gui.GuiButton; import net.minecraft.util.ResourceLocation; import net.minecraft.util.text.TextFormatting; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; + import forestry.api.book.IBookCategory; import forestry.api.book.IForesterBook; import forestry.book.gui.buttons.GuiButtonBookCategory; @@ -13,6 +16,7 @@ import forestry.core.config.Constants; import forestry.core.gui.Drawable; import forestry.core.utils.Translator; +@SideOnly(Side.CLIENT) public class GuiForestryBookCategories extends GuiForesterBook { public static final Drawable LOGO = new Drawable(new ResourceLocation(Constants.MOD_ID, "textures/gui/almanac/logo.png"), 0, 0, 256, 58, 256, 58); diff --git a/src/main/java/forestry/book/gui/GuiForestryBookEntries.java b/src/main/java/forestry/book/gui/GuiForestryBookEntries.java index 7bf6e4571..8a6619e02 100644 --- a/src/main/java/forestry/book/gui/GuiForestryBookEntries.java +++ b/src/main/java/forestry/book/gui/GuiForestryBookEntries.java @@ -6,6 +6,9 @@ import java.util.List; import net.minecraft.client.gui.GuiButton; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; + import forestry.api.book.IBookCategory; import forestry.api.book.IBookEntry; import forestry.api.book.IForesterBook; @@ -13,6 +16,7 @@ import forestry.book.gui.buttons.GuiButtonBack; import forestry.book.gui.buttons.GuiButtonEntry; import forestry.book.gui.buttons.GuiButtonPage; +@SideOnly(Side.CLIENT) public class GuiForestryBookEntries extends GuiForesterBook { private final IBookCategory category; private int entryIndex = 0; diff --git a/src/main/java/forestry/book/gui/GuiForestryBookPages.java b/src/main/java/forestry/book/gui/GuiForestryBookPages.java index ff37feb18..9206ee562 100644 --- a/src/main/java/forestry/book/gui/GuiForestryBookPages.java +++ b/src/main/java/forestry/book/gui/GuiForestryBookPages.java @@ -10,6 +10,9 @@ import java.util.List; import net.minecraft.client.gui.GuiButton; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; + import forestry.api.book.IBookCategory; import forestry.api.book.IBookEntry; import forestry.api.book.IForesterBook; @@ -20,6 +23,7 @@ import forestry.book.gui.buttons.GuiButtonPage; import forestry.book.gui.buttons.GuiButtonSubEntry; import forestry.core.gui.elements.layouts.ElementGroup; +@SideOnly(Side.CLIENT) public class GuiForestryBookPages extends GuiForesterBook { private final IBookCategory category; private final IBookEntry entry; diff --git a/src/main/java/forestry/book/gui/buttons/GuiButtonBack.java b/src/main/java/forestry/book/gui/buttons/GuiButtonBack.java index 0e7c9df49..79f189afc 100644 --- a/src/main/java/forestry/book/gui/buttons/GuiButtonBack.java +++ b/src/main/java/forestry/book/gui/buttons/GuiButtonBack.java @@ -7,10 +7,14 @@ import net.minecraft.client.gui.GuiButton; import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; + import forestry.book.gui.GuiForesterBook; import forestry.core.gui.tooltips.IToolTipProvider; import forestry.core.gui.tooltips.ToolTip; +@SideOnly(Side.CLIENT) public class GuiButtonBack extends GuiButton implements IToolTipProvider { public GuiButtonBack(int buttonId, int x, int y) { super(buttonId, x, y, 18, 9, ""); diff --git a/src/main/java/forestry/book/gui/buttons/GuiButtonBookCategory.java b/src/main/java/forestry/book/gui/buttons/GuiButtonBookCategory.java index c602ab296..756e3c669 100644 --- a/src/main/java/forestry/book/gui/buttons/GuiButtonBookCategory.java +++ b/src/main/java/forestry/book/gui/buttons/GuiButtonBookCategory.java @@ -6,11 +6,15 @@ import net.minecraft.client.gui.GuiButton; import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.RenderHelper; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; + import forestry.api.book.IBookCategory; import forestry.core.gui.GuiUtil; import forestry.core.gui.tooltips.IToolTipProvider; import forestry.core.gui.tooltips.ToolTip; +@SideOnly(Side.CLIENT) public class GuiButtonBookCategory extends GuiButton implements IToolTipProvider { public final IBookCategory category; diff --git a/src/main/java/forestry/book/gui/buttons/GuiButtonEntry.java b/src/main/java/forestry/book/gui/buttons/GuiButtonEntry.java index 1ea8ab14f..2b721c344 100644 --- a/src/main/java/forestry/book/gui/buttons/GuiButtonEntry.java +++ b/src/main/java/forestry/book/gui/buttons/GuiButtonEntry.java @@ -8,9 +8,13 @@ import net.minecraft.client.renderer.RenderHelper; import net.minecraft.item.ItemStack; import net.minecraft.util.text.TextFormatting; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; + import forestry.api.book.IBookEntry; import forestry.core.gui.GuiUtil; +@SideOnly(Side.CLIENT) public class GuiButtonEntry extends GuiButton { public final IBookEntry entry; diff --git a/src/main/java/forestry/book/gui/buttons/GuiButtonPage.java b/src/main/java/forestry/book/gui/buttons/GuiButtonPage.java index bb8d0f009..407837fb7 100644 --- a/src/main/java/forestry/book/gui/buttons/GuiButtonPage.java +++ b/src/main/java/forestry/book/gui/buttons/GuiButtonPage.java @@ -7,10 +7,14 @@ import net.minecraft.client.gui.GuiButton; import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; + import forestry.book.gui.GuiForesterBook; import forestry.core.gui.tooltips.IToolTipProvider; import forestry.core.gui.tooltips.ToolTip; +@SideOnly(Side.CLIENT) public class GuiButtonPage extends GuiButton implements IToolTipProvider { public boolean left; diff --git a/src/main/java/forestry/book/gui/buttons/GuiButtonSubEntry.java b/src/main/java/forestry/book/gui/buttons/GuiButtonSubEntry.java index f19af3603..1ececf21e 100644 --- a/src/main/java/forestry/book/gui/buttons/GuiButtonSubEntry.java +++ b/src/main/java/forestry/book/gui/buttons/GuiButtonSubEntry.java @@ -9,10 +9,14 @@ import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.RenderHelper; import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; + import forestry.api.book.IBookEntry; import forestry.book.gui.GuiForesterBook; import forestry.core.gui.GuiUtil; +@SideOnly(Side.CLIENT) public class GuiButtonSubEntry extends GuiButton { public final IBookEntry selectedEntry; public final IBookEntry subEntry; diff --git a/src/main/java/forestry/book/gui/elements/CarpenterElement.java b/src/main/java/forestry/book/gui/elements/CarpenterElement.java index 3664ecd2d..67a04be95 100644 --- a/src/main/java/forestry/book/gui/elements/CarpenterElement.java +++ b/src/main/java/forestry/book/gui/elements/CarpenterElement.java @@ -10,6 +10,9 @@ import net.minecraft.util.ResourceLocation; import net.minecraftforge.fluids.FluidTankInfo; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; + import forestry.api.recipes.ICarpenterRecipe; import forestry.api.recipes.IDescriptiveRecipe; import forestry.core.config.Constants; @@ -18,6 +21,7 @@ import forestry.core.gui.elements.IngredientElement; import forestry.core.gui.elements.TankElement; import forestry.factory.recipes.CarpenterRecipeManager; +@SideOnly(Side.CLIENT) public class CarpenterElement extends SelectionElement { private static final ResourceLocation BOOK_CRAFTING_TEXTURE = new ResourceLocation(Constants.MOD_ID, Constants.TEXTURE_PATH_GUI + "/almanac/crafting.png"); private static final Drawable CARPENTER_BACKGROUND = new Drawable(BOOK_CRAFTING_TEXTURE, 0, 0, 108, 60); diff --git a/src/main/java/forestry/book/gui/elements/CraftingElement.java b/src/main/java/forestry/book/gui/elements/CraftingElement.java index aebbb8b8b..d364c1e4e 100644 --- a/src/main/java/forestry/book/gui/elements/CraftingElement.java +++ b/src/main/java/forestry/book/gui/elements/CraftingElement.java @@ -4,11 +4,15 @@ import net.minecraft.item.crafting.IRecipe; import net.minecraft.item.crafting.Ingredient; import net.minecraft.util.NonNullList; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; + import forestry.api.gui.GuiElementAlignment; import forestry.book.gui.GuiForesterBook; import forestry.core.gui.Drawable; import forestry.core.gui.elements.IngredientElement; +@SideOnly(Side.CLIENT) public class CraftingElement extends SelectionElement { private static final Drawable CRAFTING_GRID = new Drawable(GuiForesterBook.TEXTURE, 158, 181, 98, 58); diff --git a/src/main/java/forestry/book/gui/elements/FabricatorElement.java b/src/main/java/forestry/book/gui/elements/FabricatorElement.java index 07cb08863..c7a3841a8 100644 --- a/src/main/java/forestry/book/gui/elements/FabricatorElement.java +++ b/src/main/java/forestry/book/gui/elements/FabricatorElement.java @@ -15,6 +15,9 @@ import net.minecraft.util.ResourceLocation; import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidTankInfo; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; + import forestry.api.recipes.IFabricatorRecipe; import forestry.api.recipes.IFabricatorSmeltingRecipe; import forestry.core.config.Constants; @@ -24,6 +27,7 @@ import forestry.core.gui.elements.TankElement; import forestry.factory.recipes.FabricatorRecipeManager; import forestry.factory.recipes.FabricatorSmeltingRecipeManager; +@SideOnly(Side.CLIENT) public class FabricatorElement extends SelectionElement { private static final ResourceLocation BOOK_CRAFTING_TEXTURE = new ResourceLocation(Constants.MOD_ID, Constants.TEXTURE_PATH_GUI + "/almanac/crafting.png"); private static final Drawable FABRICATOR_BACKGROUND = new Drawable(BOOK_CRAFTING_TEXTURE, 0, 60, 108, 56); diff --git a/src/main/java/forestry/book/gui/elements/IndexElement.java b/src/main/java/forestry/book/gui/elements/IndexElement.java index 1182f303d..2ea0421a9 100644 --- a/src/main/java/forestry/book/gui/elements/IndexElement.java +++ b/src/main/java/forestry/book/gui/elements/IndexElement.java @@ -2,6 +2,9 @@ package forestry.book.gui.elements; import net.minecraft.util.text.TextFormatting; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; + import forestry.api.gui.GuiElementAlignment; import forestry.book.data.IndexEntry; import forestry.book.gui.GuiForesterBook; @@ -9,6 +12,7 @@ import forestry.book.gui.GuiForestryBookPages; import forestry.core.gui.elements.TextElement; import forestry.core.gui.elements.layouts.VerticalLayout; +@SideOnly(Side.CLIENT) public class IndexElement extends VerticalLayout { public IndexElement(int xPos, int yPos, IndexEntry[] data) { super(xPos, yPos, 108); diff --git a/src/main/java/forestry/book/gui/elements/MultiblockElement.java b/src/main/java/forestry/book/gui/elements/MultiblockElement.java index 6aa130b55..67134e011 100644 --- a/src/main/java/forestry/book/gui/elements/MultiblockElement.java +++ b/src/main/java/forestry/book/gui/elements/MultiblockElement.java @@ -27,6 +27,9 @@ import net.minecraft.client.renderer.texture.TextureMap; import net.minecraft.client.renderer.vertex.DefaultVertexFormats; import net.minecraft.util.math.BlockPos; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; + import forestry.book.data.structure.BlockData; import forestry.book.data.structure.StructureBlockAccess; import forestry.book.data.structure.StructureInfo; @@ -36,6 +39,7 @@ import forestry.core.gui.elements.GuiElement; import org.lwjgl.input.Mouse; import org.lwjgl.opengl.GL11; +@SideOnly(Side.CLIENT) public class MultiblockElement extends GuiElement { private float scale = 50.0F; private float xTranslate = 0F; diff --git a/src/main/java/forestry/book/gui/elements/MutationElement.java b/src/main/java/forestry/book/gui/elements/MutationElement.java index ff7b4e3b6..ef17f0fb2 100644 --- a/src/main/java/forestry/book/gui/elements/MutationElement.java +++ b/src/main/java/forestry/book/gui/elements/MutationElement.java @@ -2,12 +2,16 @@ package forestry.book.gui.elements; import java.util.Collection; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; + import forestry.api.genetics.IMutation; import forestry.api.genetics.ISpeciesRoot; import forestry.api.gui.GuiElementAlignment; import forestry.book.gui.GuiForesterBook; import forestry.core.gui.Drawable; +@SideOnly(Side.CLIENT) public class MutationElement extends SelectionElement { private static final Drawable SLOT = new Drawable(GuiForesterBook.TEXTURE, 0, 223, 18, 18); private static final Drawable MUTATION_PLUS = new Drawable(GuiForesterBook.TEXTURE, 0, 241, 15, 15); diff --git a/src/main/java/forestry/book/gui/elements/SelectionElement.java b/src/main/java/forestry/book/gui/elements/SelectionElement.java index bffa44120..1fac92c0a 100644 --- a/src/main/java/forestry/book/gui/elements/SelectionElement.java +++ b/src/main/java/forestry/book/gui/elements/SelectionElement.java @@ -4,6 +4,9 @@ import javax.annotation.Nullable; import net.minecraft.util.text.TextFormatting; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; + import forestry.api.gui.GuiElementAlignment; import forestry.book.gui.GuiForesterBook; import forestry.core.gui.Drawable; @@ -12,6 +15,7 @@ import forestry.core.gui.elements.GuiElementFactory; import forestry.core.gui.elements.layouts.ElementGroup; import forestry.core.gui.elements.layouts.PaneLayout; +@SideOnly(Side.CLIENT) public abstract class SelectionElement extends PaneLayout { private static final Drawable CRAFTING_COUNT = new Drawable(GuiForesterBook.TEXTURE, 104, 181, 34, 14); private static final Drawable RIGHT_BUTTON = new Drawable(GuiForesterBook.TEXTURE, 138, 181, 10, 9); diff --git a/src/main/java/forestry/book/gui/elements/TextDataElement.java b/src/main/java/forestry/book/gui/elements/TextDataElement.java index ee1113ea3..4e6bca08d 100644 --- a/src/main/java/forestry/book/gui/elements/TextDataElement.java +++ b/src/main/java/forestry/book/gui/elements/TextDataElement.java @@ -7,9 +7,13 @@ import net.minecraft.client.Minecraft; import net.minecraft.client.gui.FontRenderer; import net.minecraft.util.text.TextFormatting; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; + import forestry.book.data.TextData; import forestry.core.gui.elements.GuiElement; +@SideOnly(Side.CLIENT) public class TextDataElement extends GuiElement { private final List textElements = new ArrayList<>(); diff --git a/src/main/java/forestry/book/items/ItemForesterBook.java b/src/main/java/forestry/book/items/ItemForesterBook.java index 5b28eff8a..93795209b 100644 --- a/src/main/java/forestry/book/items/ItemForesterBook.java +++ b/src/main/java/forestry/book/items/ItemForesterBook.java @@ -11,6 +11,9 @@ import net.minecraft.util.EnumActionResult; import net.minecraft.util.EnumHand; import net.minecraft.world.World; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; + import forestry.api.book.IForesterBook; import forestry.book.BookLoader; import forestry.book.gui.GuiForesterBook; @@ -30,6 +33,7 @@ public class ItemForesterBook extends ItemWithGui { return ActionResult.newResult(EnumActionResult.SUCCESS, stack); } + @SideOnly(Side.CLIENT) @Override public GuiScreen getGui(EntityPlayer player, ItemStack heldItem, int data) { IForesterBook book = BookLoader.INSTANCE.loadBook(); diff --git a/src/main/java/forestry/book/pages/JsonPageFactory.java b/src/main/java/forestry/book/pages/JsonPageFactory.java index cbf4caf42..24c171311 100644 --- a/src/main/java/forestry/book/pages/JsonPageFactory.java +++ b/src/main/java/forestry/book/pages/JsonPageFactory.java @@ -4,6 +4,9 @@ import java.util.ArrayList; import java.util.Collection; import java.util.List; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; + import forestry.api.book.BookContent; import forestry.api.book.IBookEntry; import forestry.api.book.IBookPageFactory; @@ -12,6 +15,7 @@ import forestry.book.gui.GuiForesterBook; import forestry.core.gui.elements.GuiElementFactory; import forestry.core.gui.elements.layouts.VerticalLayout; +@SideOnly(Side.CLIENT) public class JsonPageFactory implements IBookPageFactory { public static final String NAME = "json"; diff --git a/src/main/java/forestry/book/proxy/ProxyBook.java b/src/main/java/forestry/book/proxy/ProxyBook.java index 89aff4636..f8f584867 100644 --- a/src/main/java/forestry/book/proxy/ProxyBook.java +++ b/src/main/java/forestry/book/proxy/ProxyBook.java @@ -15,4 +15,6 @@ public class ProxyBook { } + public void setupAPI() { + } } diff --git a/src/main/java/forestry/book/proxy/ProxyBookClient.java b/src/main/java/forestry/book/proxy/ProxyBookClient.java index 0f273f302..b23e5d96e 100644 --- a/src/main/java/forestry/book/proxy/ProxyBookClient.java +++ b/src/main/java/forestry/book/proxy/ProxyBookClient.java @@ -17,12 +17,18 @@ import net.minecraft.client.resources.IResourceManager; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; +import forestry.api.book.BookManager; import forestry.book.BookLoader; @SuppressWarnings("unused") @SideOnly(Side.CLIENT) public class ProxyBookClient extends ProxyBook { + @Override + public void setupAPI() { + BookManager.loader = BookLoader.INSTANCE; + } + @Override public void preInit() { IResourceManager resourceManager = Minecraft.getMinecraft().getResourceManager();