mirror of
https://github.com/GTNewHorizons/ForestryMC.git
synced 2026-11-28 15:36:18 +00:00
Add missing Side Only Annotations Fix #2076
This commit is contained in:
1 parent
aa45da81ba
commit
6efbd6e158
54 files changed
+211
-5
No files matched your search
@@ -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<D> {
|
||||
public String type;
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
@@ -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.
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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}.
|
||||
* <p>
|
||||
* 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 {
|
||||
|
||||
/**
|
||||
|
||||
@@ -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 {
|
||||
|
||||
/**
|
||||
|
||||
@@ -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 {
|
||||
|
||||
/**
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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.
|
||||
* <p>
|
||||
* You can get the current instance of the guide book from {@link IBookLoader#loadBook()}.
|
||||
*/
|
||||
@SideOnly(Side.CLIENT)
|
||||
public interface IForesterBook {
|
||||
|
||||
/**
|
||||
|
||||
@@ -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<String, IBookEntry> entries = new LinkedHashMap<>();
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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())
|
||||
|
||||
@@ -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<String, IBookCategory> categoriesByName = new HashMap<>();
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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<CraftingData> {
|
||||
|
||||
@Nullable
|
||||
|
||||
@@ -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<CraftingData> {
|
||||
@Override
|
||||
public Class<CraftingData> getDataClass() {
|
||||
|
||||
@@ -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<CraftingData> {
|
||||
|
||||
@Override
|
||||
|
||||
@@ -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<Drawable> {
|
||||
//The size fo the gui element.
|
||||
private int width;
|
||||
|
||||
@@ -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<IndexData> {
|
||||
@Nullable
|
||||
@Override
|
||||
|
||||
@@ -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 = "";
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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<TextData> {
|
||||
@Override
|
||||
public Class<? extends TextData> getDataClass() {
|
||||
|
||||
@@ -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<BookCategory> {
|
||||
@Override
|
||||
public BookCategory deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) {
|
||||
|
||||
@@ -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<BookContent> {
|
||||
@Override
|
||||
public BookContent deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) {
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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];
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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, "");
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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<ICarpenterRecipe> {
|
||||
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);
|
||||
|
||||
@@ -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<IRecipe> {
|
||||
private static final Drawable CRAFTING_GRID = new Drawable(GuiForesterBook.TEXTURE, 158, 181, 98, 58);
|
||||
|
||||
|
||||
@@ -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<IFabricatorRecipe> {
|
||||
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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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<IMutation> {
|
||||
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);
|
||||
|
||||
@@ -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<R> 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);
|
||||
|
||||
@@ -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<TextData> textElements = new ArrayList<>();
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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";
|
||||
|
||||
@@ -15,4 +15,6 @@ public class ProxyBook {
|
||||
|
||||
}
|
||||
|
||||
public void setupAPI() {
|
||||
}
|
||||
}
|
||||
@@ -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();
|
||||
|
||||
Reference in new issue
Block a user