Work on a seeecret project
This commit is contained in:
parent
97b90eaf63
commit
6e4de4f6e9
58 changed files with 3504 additions and 42 deletions
|
@ -69,6 +69,7 @@ import WayofTime.alchemicalWizardry.common.items.ItemSpellEnhancementBlock;
|
|||
import WayofTime.alchemicalWizardry.common.items.ItemSpellModifierBlock;
|
||||
import WayofTime.alchemicalWizardry.common.items.ItemSpellParadigmBlock;
|
||||
import WayofTime.alchemicalWizardry.common.items.LifeBucket;
|
||||
import WayofTime.alchemicalWizardry.common.items.books.ItemBloodArchives;
|
||||
import WayofTime.alchemicalWizardry.common.items.sigil.SigilOfHolding;
|
||||
import WayofTime.alchemicalWizardry.common.items.thaumcraft.ItemSanguineArmour;
|
||||
import WayofTime.alchemicalWizardry.common.rituals.RitualEffectAnimalGrowth;
|
||||
|
@ -179,6 +180,8 @@ public class AlchemicalWizardry
|
|||
public static boolean isThaumcraftLoaded;
|
||||
public static boolean isForestryLoaded;
|
||||
public static boolean isGCLoaded;
|
||||
|
||||
public static boolean wimpySettings;
|
||||
|
||||
public static CreativeTabs tabBloodMagic = new CreativeTabs("tabBloodMagic")
|
||||
{
|
||||
|
@ -310,6 +313,7 @@ public class AlchemicalWizardry
|
|||
public static int baseComponentsItemID;
|
||||
public static int baseAlchemyComponentsItemID;
|
||||
public static int itemSigilOfSupressionItemID;
|
||||
public static int itemBloodBookItemID;
|
||||
|
||||
public static int testingBlockBlockID;
|
||||
public static int lifeEssenceFlowingBlockID;
|
||||
|
@ -622,7 +626,16 @@ public class AlchemicalWizardry
|
|||
//LanguageRegistry.addName(bloodiedShard, "Bloodied Shard");
|
||||
LanguageRegistry.addName(ModItems.blankSlate, "Blank Slate");
|
||||
LanguageRegistry.addName(ModItems.reinforcedSlate, "Reinforced Slate");
|
||||
LanguageRegistry.addName(ModItems.sacrificialDagger, "Sacrificial Knife");
|
||||
|
||||
if(this.wimpySettings)
|
||||
{
|
||||
LanguageRegistry.addName(ModItems.sacrificialDagger, "Sacrificial Orb");
|
||||
}else
|
||||
{
|
||||
LanguageRegistry.addName(ModItems.sacrificialDagger, "Sacrificial Knife");
|
||||
}
|
||||
|
||||
|
||||
LanguageRegistry.addName(ModItems.daggerOfSacrifice, "Dagger of Sacrifice");
|
||||
LanguageRegistry.addName(ModItems.airSigil, "Air Sigil");
|
||||
LanguageRegistry.addName(ModItems.sigilOfTheFastMiner, "Sigil of the Fast Miner");
|
||||
|
@ -849,6 +862,7 @@ public class AlchemicalWizardry
|
|||
this.initAltarRecipes();
|
||||
this.initRituals();
|
||||
this.initBindingRecipes();
|
||||
ItemBloodArchives.initBooks();
|
||||
|
||||
|
||||
MinecraftForge.setToolClass(ModItems.boundPickaxe, "pickaxe", 5);
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
package WayofTime.alchemicalWizardry;
|
||||
|
||||
import WayofTime.alchemicalWizardry.common.summoning.meteor.MeteorParadigm;
|
||||
import cpw.mods.fml.common.FMLLog;
|
||||
import net.minecraftforge.common.Configuration;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.logging.Level;
|
||||
|
||||
import net.minecraftforge.common.Configuration;
|
||||
import WayofTime.alchemicalWizardry.common.summoning.meteor.MeteorParadigm;
|
||||
import cpw.mods.fml.common.FMLLog;
|
||||
|
||||
/**
|
||||
* Created with IntelliJ IDEA.
|
||||
* User: Pokefenn
|
||||
|
@ -185,6 +185,9 @@ public class BloodMagicConfiguration
|
|||
AlchemicalWizardry.baseComponentsItemID = config.getItem("BaseComponents", 17083).getInt();
|
||||
AlchemicalWizardry.baseAlchemyComponentsItemID = config.getItem("BaseAlchemyComponents", 17084).getInt();
|
||||
AlchemicalWizardry.itemSigilOfSupressionItemID = config.getItem("ItemSigilOfSupression", 17085).getInt();
|
||||
AlchemicalWizardry.itemBloodBookItemID = config.getItem("BloodBooks", 17086).getInt();
|
||||
|
||||
AlchemicalWizardry.wimpySettings = config.get("WimpySettings","IDontLikeFun",false).getBoolean(false);
|
||||
|
||||
} catch (Exception e)
|
||||
{
|
||||
|
|
|
@ -36,6 +36,7 @@ import WayofTime.alchemicalWizardry.common.items.ReinforcedTelepositionFocus;
|
|||
import WayofTime.alchemicalWizardry.common.items.SacrificialDagger;
|
||||
import WayofTime.alchemicalWizardry.common.items.TelepositionFocus;
|
||||
import WayofTime.alchemicalWizardry.common.items.WaterScribeTool;
|
||||
import WayofTime.alchemicalWizardry.common.items.books.ItemBloodArchives;
|
||||
import WayofTime.alchemicalWizardry.common.items.potion.AlchemyFlask;
|
||||
import WayofTime.alchemicalWizardry.common.items.potion.AlchemyReagent;
|
||||
import WayofTime.alchemicalWizardry.common.items.potion.AverageLengtheningCatalyst;
|
||||
|
@ -74,8 +75,6 @@ import WayofTime.alchemicalWizardry.common.items.sigil.WaterSigil;
|
|||
*/
|
||||
public class ModItems
|
||||
{
|
||||
|
||||
|
||||
public static Item orbOfTesting;
|
||||
public static Item weakBloodOrb;
|
||||
public static Item apprenticeBloodOrb;
|
||||
|
@ -170,6 +169,7 @@ public class ModItems
|
|||
public static Item itemComplexSpellCrystal;
|
||||
public static Item itemBloodFrame;
|
||||
public static Item itemSigilOfSupression;
|
||||
public static Item itemBloodBook;
|
||||
|
||||
public static void init()
|
||||
{
|
||||
|
@ -253,5 +253,6 @@ public class ModItems
|
|||
baseItems = new ItemComponents(AlchemicalWizardry.baseComponentsItemID).setUnlocalizedName("baseItems");
|
||||
baseAlchemyItems = new ItemAlchemyBase(AlchemicalWizardry.baseAlchemyComponentsItemID).setUnlocalizedName("baseAlchemyItems");
|
||||
itemSigilOfSupression = new ItemSigilOfSupression(AlchemicalWizardry.itemSigilOfSupressionItemID).setUnlocalizedName("itemSigilOfSupression");
|
||||
itemBloodBook = new ItemBloodArchives(AlchemicalWizardry.itemBloodBookItemID).setUnlocalizedName("bloodanomicon");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -20,7 +20,7 @@ public interface IMasterRitualStone
|
|||
|
||||
public int getDirection();
|
||||
|
||||
public World getWorldObj();
|
||||
public World getWorld();
|
||||
|
||||
public int getXCoord();
|
||||
|
||||
|
|
189
BM_src/WayofTime/alchemicalWizardry/client/BMClientRegistry.java
Normal file
189
BM_src/WayofTime/alchemicalWizardry/client/BMClientRegistry.java
Normal file
|
@ -0,0 +1,189 @@
|
|||
package WayofTime.alchemicalWizardry.client;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
|
||||
public class BMClientRegistry
|
||||
{
|
||||
//public static ArrayList<ToolGuiElement> toolButtons = new ArrayList<ToolGuiElement>(20);
|
||||
//public static ArrayList<ToolGuiElement> tierTwoButtons = new ArrayList<ToolGuiElement>();
|
||||
public static Map<String, ItemStack> manualIcons = new HashMap<String, ItemStack>();
|
||||
public static Map<String, ItemStack[]> recipeIcons = new HashMap<String, ItemStack[]>();
|
||||
public static ItemStack defaultStack = new ItemStack(Item.ingotIron);
|
||||
|
||||
|
||||
// public static void addMaterialRenderMapping (int materialID, String domain, String renderName, boolean useDefaultFolder)
|
||||
// {
|
||||
// for (ToolCore tool : TConstructRegistry.getToolMapping())
|
||||
// {
|
||||
// String[] toolIcons = new String[tool.getPartAmount() + 1];
|
||||
// for (int i = 0; i < tool.getPartAmount() + 1; i++)
|
||||
// {
|
||||
// String icon = domain + ":";
|
||||
// if (useDefaultFolder)
|
||||
// icon += tool.getDefaultFolder() + "/";
|
||||
// icon += renderName + tool.getIconSuffix(i);
|
||||
// toolIcons[i] = icon;
|
||||
// }
|
||||
// tool.registerPartPaths(materialID, toolIcons);
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
// public static void addAlternateMaterialRenderMapping (ToolCore tool, int materialID, String domain, String renderName, boolean useDefaultFolder)
|
||||
// {
|
||||
// String[] toolIcons = new String[tool.getPartAmount() + 1];
|
||||
// for (int i = 0; i < tool.getPartAmount() + 1; i++)
|
||||
// {
|
||||
// String icon = domain + ":";
|
||||
// if (useDefaultFolder)
|
||||
// icon += tool.getDefaultFolder() + "/";
|
||||
// icon += renderName + tool.getIconSuffix(i);
|
||||
// toolIcons[i] = icon;
|
||||
// }
|
||||
// tool.registerAlternatePartPaths(materialID, toolIcons);
|
||||
// }
|
||||
|
||||
|
||||
// public static void addEffectRenderMapping (ToolCore tool, int materialID, String domain, String renderName, boolean useDefaultFolder)
|
||||
// {
|
||||
// String icon = domain + ":";
|
||||
// if (useDefaultFolder)
|
||||
// icon += tool.getDefaultFolder() + "/";
|
||||
// icon += renderName + tool.getEffectSuffix();
|
||||
// tool.registerEffectPath(materialID, icon);
|
||||
// }
|
||||
|
||||
|
||||
// public static void addEffectRenderMapping (int materialID, String domain, String renderName, boolean useDefaultFolder)
|
||||
// {
|
||||
// for (ToolCore tool : TConstructRegistry.getToolMapping())
|
||||
// {
|
||||
// String icon = domain + ":";
|
||||
// if (useDefaultFolder)
|
||||
// icon += tool.getDefaultFolder() + "/";
|
||||
// icon += renderName + tool.getEffectSuffix();
|
||||
// tool.registerEffectPath(materialID, icon);
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
// public static void addSingleEffectRenderMapping (ToolCore tool, int materialID, String domain, String renderName, boolean useDefaultFolder)
|
||||
// {
|
||||
// String icon = domain + ":";
|
||||
// if (useDefaultFolder)
|
||||
// icon += tool.getDefaultFolder() + "/";
|
||||
// icon += renderName + tool.getEffectSuffix();
|
||||
// tool.registerEffectPath(materialID, icon);
|
||||
// }
|
||||
|
||||
|
||||
public static void registerManualIcon (String name, ItemStack stack)
|
||||
{
|
||||
manualIcons.put(name, stack);
|
||||
}
|
||||
|
||||
|
||||
public static ItemStack getManualIcon (String textContent)
|
||||
{
|
||||
ItemStack stack = manualIcons.get(textContent);
|
||||
if (stack != null)
|
||||
return stack;
|
||||
return defaultStack;
|
||||
}
|
||||
|
||||
|
||||
public static void registerManualSmallRecipe (String name, ItemStack output, ItemStack... stacks)
|
||||
{
|
||||
ItemStack[] recipe = new ItemStack[5];
|
||||
recipe[0] = output;
|
||||
System.arraycopy(stacks, 0, recipe, 1, 4);
|
||||
recipeIcons.put(name, recipe);
|
||||
}
|
||||
|
||||
|
||||
public static void registerManualLargeRecipe (String name, ItemStack output, ItemStack... stacks)
|
||||
{
|
||||
ItemStack[] recipe = new ItemStack[10];
|
||||
recipe[0] = output;
|
||||
System.arraycopy(stacks, 0, recipe, 1, 9);
|
||||
recipeIcons.put(name, recipe);
|
||||
}
|
||||
|
||||
|
||||
public static void registerManualFurnaceRecipe (String name, ItemStack output, ItemStack input)
|
||||
{
|
||||
ItemStack[] recipe = new ItemStack[2];
|
||||
recipe[0] = output;
|
||||
recipe[1] = input;
|
||||
recipeIcons.put(name, recipe);
|
||||
}
|
||||
|
||||
|
||||
// public static void registerManualModifier (String name, ItemStack output, ItemStack topinput)
|
||||
// {
|
||||
// registerManualModifier(name, output, topinput, null);
|
||||
// }
|
||||
|
||||
|
||||
// public static void registerManualModifier (String name, ItemStack output, ItemStack topinput, ItemStack bottominput)
|
||||
// {
|
||||
// ItemStack[] recipe = new ItemStack[3];
|
||||
// recipe[0] = ToolBuilder.instance.buildTool(output, topinput, bottominput, "");
|
||||
// recipe[1] = topinput;
|
||||
// recipe[2] = bottominput;
|
||||
// recipeIcons.put(name, recipe);
|
||||
// }
|
||||
|
||||
|
||||
public static void registerManualSmeltery (String name, ItemStack output, ItemStack liquid, ItemStack cast)
|
||||
{
|
||||
ItemStack[] recipe = new ItemStack[3];
|
||||
recipe[0] = output;
|
||||
recipe[1] = liquid;
|
||||
recipe[2] = cast;
|
||||
recipeIcons.put(name, recipe);
|
||||
}
|
||||
|
||||
|
||||
public static ItemStack[] getRecipeIcons (String recipeName)
|
||||
{
|
||||
return recipeIcons.get(recipeName);
|
||||
}
|
||||
|
||||
|
||||
//Gui
|
||||
// public static void addToolButton (ToolGuiElement element)
|
||||
// {
|
||||
// toolButtons.add(element);
|
||||
// }
|
||||
//
|
||||
//
|
||||
// public static void addToolButton (int slotType, int xButton, int yButton, int[] xIcons, int[] yIcons, String title, String body, String domain, String texture)
|
||||
// {
|
||||
// toolButtons.add(new ToolGuiElement(slotType, xButton, yButton, xIcons, yIcons, title, body, domain, texture));
|
||||
// }
|
||||
//
|
||||
//
|
||||
// public static void addTierTwoButton (ToolGuiElement element)
|
||||
// {
|
||||
// tierTwoButtons.add(element);
|
||||
// }
|
||||
//
|
||||
//
|
||||
// public static void addTierTwoButton (int slotType, int xButton, int yButton, int[] xIcons, int[] yIcons, String title, String body, String domain, String texture)
|
||||
// {
|
||||
// tierTwoButtons.add(new ToolGuiElement(slotType, xButton, yButton, xIcons, yIcons, title, body, domain, texture));
|
||||
// }
|
||||
//
|
||||
//
|
||||
// public static ArrayList<ToolGuiElement> getToolButtons ()
|
||||
// {
|
||||
// return toolButtons;
|
||||
// }
|
||||
}
|
|
@ -1,9 +1,35 @@
|
|||
package WayofTime.alchemicalWizardry.client;
|
||||
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import java.io.InputStream;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.xml.parsers.DocumentBuilder;
|
||||
import javax.xml.parsers.DocumentBuilderFactory;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.client.MinecraftForgeClient;
|
||||
|
||||
import org.w3c.dom.Document;
|
||||
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.ModBlocks;
|
||||
import WayofTime.alchemicalWizardry.ModItems;
|
||||
import WayofTime.alchemicalWizardry.client.book.pages.BlankPage;
|
||||
import WayofTime.alchemicalWizardry.client.book.pages.BookPage;
|
||||
import WayofTime.alchemicalWizardry.client.book.pages.ContentsTablePage;
|
||||
import WayofTime.alchemicalWizardry.client.book.pages.CraftingPage;
|
||||
import WayofTime.alchemicalWizardry.client.book.pages.FurnacePage;
|
||||
import WayofTime.alchemicalWizardry.client.book.pages.PicturePage;
|
||||
import WayofTime.alchemicalWizardry.client.book.pages.SectionPage;
|
||||
import WayofTime.alchemicalWizardry.client.book.pages.SidebarPage;
|
||||
import WayofTime.alchemicalWizardry.client.book.pages.TextPage;
|
||||
import WayofTime.alchemicalWizardry.client.book.pages.TitlePage;
|
||||
import WayofTime.alchemicalWizardry.common.CommonProxy;
|
||||
import WayofTime.alchemicalWizardry.common.EntityAirElemental;
|
||||
import WayofTime.alchemicalWizardry.common.entity.mob.EntityBileDemon;
|
||||
|
@ -74,12 +100,17 @@ import cpw.mods.fml.client.registry.RenderingRegistry;
|
|||
|
||||
public class ClientProxy extends CommonProxy
|
||||
{
|
||||
public static SmallFontRenderer smallFontRenderer;
|
||||
public static Minecraft mc;
|
||||
public static int renderPass;
|
||||
public static int altarRenderType;
|
||||
|
||||
@Override
|
||||
public void registerRenderers()
|
||||
{
|
||||
Minecraft mc = Minecraft.getMinecraft();
|
||||
smallFontRenderer = new SmallFontRenderer(mc.gameSettings, new ResourceLocation("textures/font/ascii.png"), mc.renderEngine, false);
|
||||
readManuals();
|
||||
//altarRenderType = RenderingRegistry.getNextAvailableRenderId();
|
||||
RenderingRegistry.registerEntityRenderingHandler(EnergyBlastProjectile.class, new RenderEnergyBlastProjectile());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityEnergyBazookaMainProjectile.class, new RenderEnergyBazookaMainProjectile());
|
||||
|
@ -144,4 +175,326 @@ public class ClientProxy extends CommonProxy
|
|||
MinecraftForgeClient.registerItemRenderer(ModBlocks.blockAltar.blockID, new TEAltarItemRenderer());
|
||||
//MinecraftForgeClient.registerItemRenderer(AlchemicalWizardry.blockWritingTable.blockID, new TEWritingTableItemRenderer());
|
||||
}
|
||||
|
||||
public static Map<String, Class<? extends BookPage>> pageClasses = new HashMap<String, Class<? extends BookPage>>();
|
||||
|
||||
public static void registerManualPage (String type, Class<? extends BookPage> clazz)
|
||||
{
|
||||
pageClasses.put(type, clazz);
|
||||
}
|
||||
|
||||
public static Class<? extends BookPage> getPageClass (String type)
|
||||
{
|
||||
return pageClasses.get(type);
|
||||
}
|
||||
|
||||
void initManualPages ()
|
||||
{
|
||||
ClientProxy.registerManualPage("crafting", CraftingPage.class);
|
||||
ClientProxy.registerManualPage("picture", PicturePage.class);
|
||||
ClientProxy.registerManualPage("text", TextPage.class);
|
||||
ClientProxy.registerManualPage("intro", TextPage.class);
|
||||
ClientProxy.registerManualPage("sectionpage", SectionPage.class);
|
||||
ClientProxy.registerManualPage("intro", TitlePage.class);
|
||||
ClientProxy.registerManualPage("contents", ContentsTablePage.class);
|
||||
ClientProxy.registerManualPage("furnace", FurnacePage.class);
|
||||
ClientProxy.registerManualPage("sidebar", SidebarPage.class);
|
||||
// ClientProxy.registerManualPage("materialstats", MaterialPage.class);
|
||||
// ClientProxy.registerManualPage("toolpage", ToolPage.class);
|
||||
// ClientProxy.registerManualPage("modifier", ModifierPage.class);
|
||||
// ClientProxy.registerManualPage("blockcast", BlockCastPage.class);
|
||||
|
||||
|
||||
ClientProxy.registerManualPage("blank", BlankPage.class);
|
||||
}
|
||||
|
||||
public static Document diary;
|
||||
public static Document volume1;
|
||||
public static Document volume2;
|
||||
public static Document smelter;
|
||||
|
||||
|
||||
public void readManuals ()
|
||||
{
|
||||
DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();
|
||||
diary = readManual("/assets/alchemicalwizardry/books/architect.xml", dbFactory);
|
||||
// volume1 = readManual("/assets/tinker/manuals/firstday.xml", dbFactory);
|
||||
// volume2 = readManual("/assets/tinker/manuals/materials.xml", dbFactory);
|
||||
// smelter = readManual("/assets/tinker/manuals/smeltery.xml", dbFactory);
|
||||
initManualIcons();
|
||||
initManualRecipes();
|
||||
initManualPages();
|
||||
}
|
||||
|
||||
public void initManualIcons ()
|
||||
{
|
||||
|
||||
BMClientRegistry.registerManualIcon("torch", new ItemStack(Block.torchWood));
|
||||
BMClientRegistry.registerManualIcon("sapling", new ItemStack(Block.sapling));
|
||||
BMClientRegistry.registerManualIcon("workbench", new ItemStack(Block.workbench));
|
||||
BMClientRegistry.registerManualIcon("coal", new ItemStack(Item.coal));
|
||||
|
||||
|
||||
// BMClientRegistry.registerManualIcon("obsidianingot", new ItemStack(TContent.materials, 1, 18));
|
||||
// BMClientRegistry.registerManualIcon("lavacrystal", new ItemStack(TContent.materials, 1, 7));
|
||||
|
||||
|
||||
// Tool Materials
|
||||
// BMClientRegistry.registerManualIcon("woodplanks", new ItemStack(Block.planks));
|
||||
// BMClientRegistry.registerManualIcon("stoneblock", new ItemStack(Block.stone));
|
||||
// BMClientRegistry.registerManualIcon("ironingot", new ItemStack(Item.ingotIron));
|
||||
// BMClientRegistry.registerManualIcon("flint", new ItemStack(Item.flint));
|
||||
// BMClientRegistry.registerManualIcon("cactus", new ItemStack(Block.cactus));
|
||||
// BMClientRegistry.registerManualIcon("bone", new ItemStack(Item.bone));
|
||||
// BMClientRegistry.registerManualIcon("obsidian", new ItemStack(Block.obsidian));
|
||||
// BMClientRegistry.registerManualIcon("netherrack", new ItemStack(Block.netherrack));
|
||||
// BMClientRegistry.registerManualIcon("blueslimecrystal", new ItemStack(TContent.materials, 1, 17));
|
||||
// BMClientRegistry.registerManualIcon("slimecrystal", new ItemStack(TContent.materials, 1, 1));
|
||||
// BMClientRegistry.registerManualIcon("paperstack", new ItemStack(TContent.materials, 1, 0));
|
||||
// BMClientRegistry.registerManualIcon("cobaltingot", new ItemStack(TContent.materials, 1, 3));
|
||||
// BMClientRegistry.registerManualIcon("arditeingot", new ItemStack(TContent.materials, 1, 4));
|
||||
// BMClientRegistry.registerManualIcon("copperingot", new ItemStack(TContent.materials, 1, 9));
|
||||
// BMClientRegistry.registerManualIcon("steelingot", new ItemStack(TContent.materials, 1, 16));
|
||||
// BMClientRegistry.registerManualIcon("pigironingot", new ItemStack(TContent.materials, 1, 34));
|
||||
|
||||
|
||||
// Tool parts
|
||||
// BMClientRegistry.registerManualIcon("pickhead", new ItemStack(TContent.pickaxeHead, 1, 2));
|
||||
// BMClientRegistry.registerManualIcon("shovelhead", new ItemStack(TContent.shovelHead, 1, 2));
|
||||
// BMClientRegistry.registerManualIcon("axehead", new ItemStack(TContent.hatchetHead, 1, 2));
|
||||
// BMClientRegistry.registerManualIcon("swordblade", new ItemStack(TContent.swordBlade, 1, 2));
|
||||
// BMClientRegistry.registerManualIcon("pan", new ItemStack(TContent.frypanHead, 1, 2));
|
||||
// BMClientRegistry.registerManualIcon("board", new ItemStack(TContent.signHead, 1, 2));
|
||||
// BMClientRegistry.registerManualIcon("knifeblade", new ItemStack(TContent.knifeBlade, 1, 2));
|
||||
// BMClientRegistry.registerManualIcon("chiselhead", new ItemStack(TContent.chiselHead, 1, 2));
|
||||
//
|
||||
//
|
||||
// BMClientRegistry.registerManualIcon("hammerhead", new ItemStack(TContent.hammerHead, 1, 2));
|
||||
// BMClientRegistry.registerManualIcon("excavatorhead", new ItemStack(TContent.excavatorHead, 1, 2));
|
||||
// BMClientRegistry.registerManualIcon("scythehead", new ItemStack(TContent.scytheBlade, 1, 2));
|
||||
// BMClientRegistry.registerManualIcon("broadaxehead", new ItemStack(TContent.broadAxeHead, 1, 2));
|
||||
// BMClientRegistry.registerManualIcon("largeswordblade", new ItemStack(TContent.largeSwordBlade, 1, 2));
|
||||
//
|
||||
//
|
||||
// BMClientRegistry.registerManualIcon("toolrod", new ItemStack(Item.stick));
|
||||
//
|
||||
//
|
||||
// BMClientRegistry.registerManualIcon("binding", new ItemStack(TContent.binding, 1, 4));
|
||||
// BMClientRegistry.registerManualIcon("wideguard", new ItemStack(TContent.wideGuard, 1, 4));
|
||||
// BMClientRegistry.registerManualIcon("handguard", new ItemStack(TContent.handGuard, 1, 4));
|
||||
// BMClientRegistry.registerManualIcon("crossbar", new ItemStack(TContent.crossbar, 1, 4));
|
||||
//
|
||||
//
|
||||
// BMClientRegistry.registerManualIcon("toughrod", new ItemStack(TContent.toughRod, 1, 0));
|
||||
// BMClientRegistry.registerManualIcon("toughbinding", new ItemStack(TContent.toughBinding, 1, 17));
|
||||
// BMClientRegistry.registerManualIcon("largeplate", new ItemStack(TContent.largePlate, 1, 17));
|
||||
//
|
||||
//
|
||||
// BMClientRegistry.registerManualIcon("bowstring", new ItemStack(TContent.bowstring, 1, 0));
|
||||
// BMClientRegistry.registerManualIcon("arrowhead", new ItemStack(TContent.arrowhead, 1, 2));
|
||||
// BMClientRegistry.registerManualIcon("fletching", new ItemStack(TContent.fletching, 1, 0));
|
||||
//
|
||||
// BMClientRegistry.registerManualIcon("bloodbucket", new ItemStack(TContent.buckets, 1, 16));
|
||||
// BMClientRegistry.registerManualIcon("emeraldbucket", new ItemStack(TContent.buckets, 1, 15));
|
||||
// BMClientRegistry.registerManualIcon("gluebucket", new ItemStack(TContent.buckets, 1, 25));
|
||||
// BMClientRegistry.registerManualIcon("slimebucket", new ItemStack(TContent.buckets, 1, 24));
|
||||
// BMClientRegistry.registerManualIcon("enderbucket", new ItemStack(TContent.buckets, 1, 23));
|
||||
|
||||
|
||||
// ToolIcons
|
||||
// BMClientRegistry.registerManualIcon("pickicon",
|
||||
// ToolBuilder.instance.buildTool(new ItemStack(TContent.pickaxeHead, 1, 10), new ItemStack(TContent.toolRod, 1, 11), new ItemStack(TContent.binding, 1, 12), ""));
|
||||
// BMClientRegistry.registerManualIcon("shovelicon", ToolBuilder.instance.buildTool(new ItemStack(TContent.shovelHead, 1, 10), new ItemStack(TContent.toolRod, 1, 11), null, ""));
|
||||
// BMClientRegistry.registerManualIcon("axeicon", ToolBuilder.instance.buildTool(new ItemStack(TContent.hatchetHead, 1, 10), new ItemStack(TContent.toolRod, 1, 11), null, ""));
|
||||
// BMClientRegistry.registerManualIcon("mattockicon",
|
||||
// ToolBuilder.instance.buildTool(new ItemStack(TContent.hatchetHead, 1, 10), new ItemStack(TContent.toolRod, 1, 11), new ItemStack(TContent.shovelHead, 1, 12), ""));
|
||||
// BMClientRegistry.registerManualIcon("swordicon",
|
||||
// ToolBuilder.instance.buildTool(new ItemStack(TContent.swordBlade, 1, 10), new ItemStack(TContent.toolRod, 1, 11), new ItemStack(TContent.wideGuard, 1, 12), ""));
|
||||
// BMClientRegistry.registerManualIcon("longswordicon",
|
||||
// ToolBuilder.instance.buildTool(new ItemStack(TContent.swordBlade, 1, 10), new ItemStack(TContent.toolRod, 1, 11), new ItemStack(TContent.handGuard, 1, 12), ""));
|
||||
// BMClientRegistry.registerManualIcon("rapiericon",
|
||||
// ToolBuilder.instance.buildTool(new ItemStack(TContent.swordBlade, 1, 10), new ItemStack(TContent.toolRod, 1, 11), new ItemStack(TContent.crossbar, 1, 12), ""));
|
||||
// BMClientRegistry.registerManualIcon("daggerIcon",
|
||||
// ToolBuilder.instance.buildTool(new ItemStack(TContent.knifeBlade, 1, 10), new ItemStack(TContent.toolRod, 1, 11), new ItemStack(TContent.crossbar, 1, 12), ""));
|
||||
// BMClientRegistry.registerManualIcon("frypanicon", ToolBuilder.instance.buildTool(new ItemStack(TContent.frypanHead, 1, 10), new ItemStack(TContent.toolRod, 1, 11), null, ""));
|
||||
// BMClientRegistry.registerManualIcon("battlesignicon", ToolBuilder.instance.buildTool(new ItemStack(TContent.signHead, 1, 10), new ItemStack(TContent.toolRod, 1, 11), null, ""));
|
||||
// BMClientRegistry.registerManualIcon("chiselicon", ToolBuilder.instance.buildTool(new ItemStack(TContent.chiselHead, 1, 10), new ItemStack(TContent.toolRod, 1, 11), null, ""));
|
||||
// BMClientRegistry.registerManualIcon("shortbowIcon",
|
||||
// ToolBuilder.instance.buildTool(new ItemStack(TContent.toolRod, 1, 10), new ItemStack(TContent.bowstring, 1, 0), new ItemStack(TContent.toolRod, 1, 12), ""));
|
||||
// BMClientRegistry.registerManualIcon("arrowIcon",
|
||||
// ToolBuilder.instance.buildTool(new ItemStack(TContent.arrowhead, 1, 10), new ItemStack(TContent.toolRod, 1, 11), new ItemStack(TContent.fletching, 1, 0), ""));
|
||||
|
||||
|
||||
// BMClientRegistry.registerManualIcon("hammericon", ToolBuilder.instance.buildTool(new ItemStack(TContent.hammerHead, 1, 10), new ItemStack(TContent.toughRod, 1, 11), new ItemStack(
|
||||
// TContent.largePlate, 1, 12), new ItemStack(TContent.largePlate, 8), ""));
|
||||
// BMClientRegistry.registerManualIcon("lumbericon", ToolBuilder.instance.buildTool(new ItemStack(TContent.broadAxeHead, 1, 10), new ItemStack(TContent.toughRod, 1, 11), new ItemStack(
|
||||
// TContent.largePlate, 1, 12), new ItemStack(TContent.toughBinding, 8), ""));
|
||||
// BMClientRegistry.registerManualIcon("excavatoricon", ToolBuilder.instance.buildTool(new ItemStack(TContent.excavatorHead, 1, 10), new ItemStack(TContent.toughRod, 1, 11),
|
||||
// new ItemStack(TContent.largePlate, 1, 12), new ItemStack(TContent.toughBinding, 8), ""));
|
||||
// BMClientRegistry.registerManualIcon("scytheicon", ToolBuilder.instance.buildTool(new ItemStack(TContent.scytheBlade, 1, 10), new ItemStack(TContent.toughRod, 1, 11), new ItemStack(
|
||||
// TContent.toughBinding, 1, 12), new ItemStack(TContent.toughRod, 8), ""));
|
||||
// BMClientRegistry.registerManualIcon("cleavericon", ToolBuilder.instance.buildTool(new ItemStack(TContent.largeSwordBlade, 1, 10), new ItemStack(TContent.toughRod, 1, 11),
|
||||
// new ItemStack(TContent.largePlate, 1, 12), new ItemStack(TContent.toughRod, 8), ""));
|
||||
// BMClientRegistry.registerManualIcon("battleaxeicon", ToolBuilder.instance.buildTool(new ItemStack(TContent.broadAxeHead, 1, 10), new ItemStack(TContent.toughRod, 1, 11),
|
||||
// new ItemStack(TContent.broadAxeHead, 1, 12), new ItemStack(TContent.toughBinding, 8), ""));
|
||||
}
|
||||
|
||||
public void initManualRecipes ()
|
||||
{
|
||||
ItemStack goldIngot = new ItemStack(Item.ingotGold);
|
||||
ItemStack ironIngot = new ItemStack(Item.ingotIron);
|
||||
ItemStack diamond = new ItemStack(Item.diamond);
|
||||
ItemStack glassBlock = new ItemStack(Block.glass);
|
||||
ItemStack smoothStone = new ItemStack(Block.stone);
|
||||
ItemStack furnace = new ItemStack(Block.furnaceIdle);
|
||||
|
||||
ItemStack weakBloodOrb = new ItemStack(ModItems.weakBloodOrb);
|
||||
|
||||
ItemStack blankSlate = new ItemStack(ModItems.blankSlate);
|
||||
|
||||
|
||||
// TConstruct recipes
|
||||
BMClientRegistry.registerManualLargeRecipe("sacrificialKnife", new ItemStack(ModItems.sacrificialDagger), glassBlock, glassBlock, glassBlock, null, ironIngot, glassBlock, goldIngot, null, glassBlock);
|
||||
BMClientRegistry.registerManualLargeRecipe("bloodAltar", new ItemStack(ModBlocks.blockAltar), smoothStone,null,smoothStone,smoothStone,furnace,smoothStone,goldIngot, diamond,goldIngot);
|
||||
BMClientRegistry.registerManualLargeRecipe("divinationSigil", new ItemStack(ModItems.divinationSigil), glassBlock,glassBlock,glassBlock,glassBlock,blankSlate,glassBlock,glassBlock,weakBloodOrb,glassBlock);
|
||||
|
||||
|
||||
// BMClientRegistry.registerManualLargeRecipe("slimymud", slimyMud, null, slimeball, slimeball, null, slimeball, slimeball, null, dirt, sand);
|
||||
// BMClientRegistry.registerManualFurnaceRecipe("slimecrystal", new ItemStack(TContent.materials, 1, 1), slimyMud);
|
||||
// BMClientRegistry.registerManualSmallRecipe("paperstack", new ItemStack(TContent.materials, 1, 0), paper, paper, paper, paper);
|
||||
// BMClientRegistry.registerManualLargeRecipe("mossball", new ItemStack(TContent.materials, 1, 6), mossycobble, mossycobble, mossycobble, mossycobble, mossycobble, mossycobble,
|
||||
// mossycobble, mossycobble, mossycobble);
|
||||
// BMClientRegistry.registerManualLargeRecipe("lavacrystal", new ItemStack(TContent.materials, 1, 7), blazerod, firecharge, blazerod, firecharge, new ItemStack(Item.bucketLava),
|
||||
// firecharge, blazerod, firecharge, blazerod);
|
||||
// BMClientRegistry.registerManualLargeRecipe("silkycloth", silkyCloth, string, string, string, string, new ItemStack(TContent.materials, 1, 24), string, string, string, string);
|
||||
// BMClientRegistry.registerManualLargeRecipe("silkyjewel", new ItemStack(TContent.materials, 1, 26), null, silkyCloth, null, silkyCloth, new ItemStack(Item.emerald), silkyCloth, null,
|
||||
// silkyCloth, null);
|
||||
//
|
||||
//
|
||||
// BMClientRegistry.registerManualSmallRecipe("graveyardsoil", graveyardsoil, new ItemStack(Block.dirt), new ItemStack(Item.rottenFlesh), new ItemStack(Item.dyePowder, 1, 15), null);
|
||||
// BMClientRegistry.registerManualFurnaceRecipe("consecratedsoil", consecratedsoil, graveyardsoil);
|
||||
//
|
||||
//
|
||||
// BMClientRegistry.registerManualSmallRecipe("grout", grout, sand, gravel, null, clay);
|
||||
// BMClientRegistry.registerManualFurnaceRecipe("searedbrick", searedbrick, grout);
|
||||
// BMClientRegistry.registerManualSmallRecipe("searedbricks", new ItemStack(TContent.smeltery, 1, 2), searedbrick, searedbrick, searedbrick, searedbrick);
|
||||
// BMClientRegistry.registerManualLargeRecipe("smelterycontroller", new ItemStack(TContent.smeltery, 1, 0), searedbrick, searedbrick, searedbrick, searedbrick, null, searedbrick,
|
||||
// searedbrick, searedbrick, searedbrick);
|
||||
// BMClientRegistry.registerManualLargeRecipe("dryingrack", new ItemStack(TContent.dryingRack, 1, 0), null, null, null, plankSlab, plankSlab, plankSlab, null, null,
|
||||
// null);
|
||||
// BMClientRegistry.registerManualLargeRecipe("smelterydrain", new ItemStack(TContent.smeltery, 1, 1), searedbrick, null, searedbrick, searedbrick, null, searedbrick, searedbrick, null,
|
||||
// searedbrick);
|
||||
//
|
||||
//
|
||||
// BMClientRegistry.registerManualLargeRecipe("smelterytank1", new ItemStack(TContent.lavaTank, 1, 0), searedbrick, searedbrick, searedbrick, searedbrick, glass, searedbrick,
|
||||
// searedbrick, searedbrick, searedbrick);
|
||||
// BMClientRegistry.registerManualLargeRecipe("smelterytank2", new ItemStack(TContent.lavaTank, 1, 1), searedbrick, glass, searedbrick, glass, glass, glass, searedbrick, glass,
|
||||
// searedbrick);
|
||||
// BMClientRegistry.registerManualLargeRecipe("smelterytank3", new ItemStack(TContent.lavaTank, 1, 2), searedbrick, glass, searedbrick, searedbrick, glass, searedbrick, searedbrick,
|
||||
// glass, searedbrick);
|
||||
//
|
||||
//
|
||||
// BMClientRegistry.registerManualLargeRecipe("smelterytable", new ItemStack(TContent.searedBlock, 1, 0), searedbrick, searedbrick, searedbrick, searedbrick, null, searedbrick,
|
||||
// searedbrick, null, searedbrick);
|
||||
// BMClientRegistry.registerManualLargeRecipe("smelteryfaucet", new ItemStack(TContent.searedBlock, 1, 1), searedbrick, null, searedbrick, null, searedbrick, null, null, null, null);
|
||||
// BMClientRegistry.registerManualLargeRecipe("castingchannel", new ItemStack(TContent.castingChannel), null, null, null, searedbrick, null, searedbrick, searedbrick, searedbrick,
|
||||
// searedbrick);
|
||||
// BMClientRegistry.registerManualLargeRecipe("smelterybasin", new ItemStack(TContent.searedBlock, 1, 2), searedbrick, null, searedbrick, searedbrick, null, searedbrick, searedbrick,
|
||||
// searedbrick, searedbrick);
|
||||
//
|
||||
//
|
||||
// //Traps
|
||||
// ItemStack reed = new ItemStack(Item.reed);
|
||||
// BMClientRegistry.registerManualLargeRecipe("punji", new ItemStack(TContent.punji), reed, null, reed, null, reed, null, reed, null, reed);
|
||||
// BMClientRegistry.registerManualSmallRecipe("barricade", new ItemStack(TContent.barricadeOak), null, log, null, log);
|
||||
//
|
||||
//
|
||||
// //Machines
|
||||
// ItemStack alubrassIngot = new ItemStack(TContent.materials, 1, 14);
|
||||
// ItemStack bronzeIngot = new ItemStack(TContent.materials, 1, 13);
|
||||
// ItemStack blankCast = new ItemStack(TContent.blankPattern, 1, 1);
|
||||
// ItemStack redstone = new ItemStack(Item.redstone);
|
||||
//
|
||||
//
|
||||
// // Modifier recipes
|
||||
// ItemStack ironpick = ToolBuilder.instance.buildTool(new ItemStack(TContent.pickaxeHead, 1, 6), new ItemStack(TContent.toolRod, 1, 2), new ItemStack(TContent.binding, 1, 6), "");
|
||||
// BMClientRegistry.registerManualIcon("ironpick", ironpick);
|
||||
// ItemStack ironlongsword = ToolBuilder.instance.buildTool(new ItemStack(TContent.swordBlade, 1, 6), new ItemStack(TContent.toolRod, 1, 2), new ItemStack(TContent.handGuard, 1, 10), "");
|
||||
// BMClientRegistry.registerManualIcon("ironlongsword", ironlongsword);
|
||||
//
|
||||
|
||||
// BMClientRegistry.registerManualModifier("diamondmod", ironpick.copy(), new ItemStack(Item.diamond));
|
||||
// BMClientRegistry.registerManualModifier("emeraldmod", ironpick.copy(), new ItemStack(Item.emerald));
|
||||
// BMClientRegistry.registerManualModifier("redstonemod", ironpick.copy(), new ItemStack(Item.redstone), new ItemStack(Block.blockRedstone));
|
||||
// BMClientRegistry.registerManualModifier("lavacrystalmod", ironpick.copy(), new ItemStack(TContent.materials, 1, 7));
|
||||
// BMClientRegistry.registerManualModifier("lapismod", ironpick.copy(), new ItemStack(Item.dyePowder, 1, 4), new ItemStack(Block.blockLapis));
|
||||
// BMClientRegistry.registerManualModifier("mossmod", ironpick.copy(), new ItemStack(TContent.materials, 1, 6));
|
||||
// BMClientRegistry.registerManualModifier("quartzmod", ironlongsword.copy(), new ItemStack(Item.netherQuartz), new ItemStack(Block.blockNetherQuartz));
|
||||
// BMClientRegistry.registerManualModifier("blazemod", ironlongsword.copy(), new ItemStack(Item.blazePowder));
|
||||
// BMClientRegistry.registerManualModifier("necroticmod", ironlongsword.copy(), new ItemStack(TContent.materials, 1, 8));
|
||||
// BMClientRegistry.registerManualModifier("silkymod", ironpick.copy(), new ItemStack(TContent.materials, 1, 26));
|
||||
// BMClientRegistry.registerManualModifier("reinforcedmod", ironpick.copy(), new ItemStack(TContent.largePlate, 1, 6));
|
||||
//
|
||||
//
|
||||
// BMClientRegistry.registerManualModifier("pistonmod", ironlongsword.copy(), new ItemStack(Block.pistonBase));
|
||||
// BMClientRegistry.registerManualModifier("beheadingmod", ironlongsword.copy(), new ItemStack(Item.enderPearl), new ItemStack(Block.obsidian));
|
||||
// BMClientRegistry.registerManualModifier("spidermod", ironlongsword.copy(), new ItemStack(Item.fermentedSpiderEye));
|
||||
// BMClientRegistry.registerManualModifier("smitemod", ironlongsword.copy(), new ItemStack(TContent.craftedSoil, 1, 4));
|
||||
//
|
||||
//
|
||||
// BMClientRegistry.registerManualModifier("electricmod", ironpick.copy(), new ItemStack(Block.dirt), new ItemStack(Block.dirt));
|
||||
// BMClientRegistry.registerManualModifier("fluxmod", ironpick.copy(), new ItemStack(Block.dirt));
|
||||
// BMClientRegistry.registerManualModifier("fluxmod2", ironpick.copy(), new ItemStack(Block.dirt));
|
||||
//
|
||||
//
|
||||
// BMClientRegistry.registerManualModifier("tier1free", ironpick.copy(), new ItemStack(Item.diamond), new ItemStack(Block.blockGold));
|
||||
// BMClientRegistry.registerManualModifier("tier1.5free", ironpick.copy(), new ItemStack(Item.appleGold, 1, 1), new ItemStack(Block.blockDiamond));
|
||||
// BMClientRegistry.registerManualModifier("tier2free", ironpick.copy(), new ItemStack(Item.netherStar));
|
||||
// BMClientRegistry.registerManualModifier("creativefree", ironpick.copy(), new ItemStack(TContent.creativeModifier));
|
||||
//
|
||||
//
|
||||
// BMClientRegistry.registerManualSmeltery("brownstone", new ItemStack(TContent.speedBlock), new ItemStack(TContent.moltenTin, 1), new ItemStack(Block.gravel));
|
||||
// BMClientRegistry.registerManualSmeltery("clearglass", new ItemStack(TContent.clearGlass), new ItemStack(TContent.moltenGlass, 1), null);
|
||||
// BMClientRegistry.registerManualSmeltery("searedstone", new ItemStack(TContent.smeltery, 1, 4), new ItemStack(TContent.moltenStone, 1), null);
|
||||
// BMClientRegistry.registerManualSmeltery("endstone", new ItemStack(Block.whiteStone), new ItemStack(TContent.moltenEnder, 1), new ItemStack(Block.obsidian));
|
||||
// BMClientRegistry.registerManualSmeltery("glueball", new ItemStack(TContent.materials, 1, 36), new ItemStack(TContent.glueFluidBlock, 1), null);
|
||||
|
||||
|
||||
}
|
||||
|
||||
Document readManual (String location, DocumentBuilderFactory dbFactory)
|
||||
{
|
||||
try
|
||||
{
|
||||
InputStream stream = AlchemicalWizardry.class.getResourceAsStream(location);
|
||||
DocumentBuilder dBuilder = dbFactory.newDocumentBuilder();
|
||||
Document doc = dBuilder.parse(stream);
|
||||
doc.getDocumentElement().normalize();
|
||||
return doc;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static Document getManualFromStack (ItemStack stack)
|
||||
{
|
||||
switch (stack.getItemDamage())
|
||||
{
|
||||
case 0:
|
||||
return diary;
|
||||
// case 1:
|
||||
// return volume2;
|
||||
// case 2:
|
||||
// return smelter;
|
||||
// case 3:
|
||||
// return diary;
|
||||
}
|
||||
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
250
BM_src/WayofTime/alchemicalWizardry/client/GuiManual.java
Normal file
250
BM_src/WayofTime/alchemicalWizardry/client/GuiManual.java
Normal file
|
@ -0,0 +1,250 @@
|
|||
package WayofTime.alchemicalWizardry.client;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.Element;
|
||||
import org.w3c.dom.Node;
|
||||
import org.w3c.dom.NodeList;
|
||||
|
||||
import WayofTime.alchemicalWizardry.client.book.pages.BookPage;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class GuiManual extends GuiScreen
|
||||
{
|
||||
ItemStack itemstackBook;
|
||||
Document manual;
|
||||
public RenderItemCopy renderitem = new RenderItemCopy();
|
||||
int bookImageWidth = 206;
|
||||
int bookImageHeight = 200;
|
||||
int bookTotalPages = 1000;
|
||||
int currentPage;
|
||||
int maxPages;
|
||||
|
||||
|
||||
private TurnPageButton buttonNextPage;
|
||||
private TurnPageButton buttonPreviousPage;
|
||||
|
||||
|
||||
BookPage pageLeft;
|
||||
BookPage pageRight;
|
||||
|
||||
|
||||
public SmallFontRenderer fonts = ClientProxy.smallFontRenderer;
|
||||
|
||||
|
||||
public GuiManual(ItemStack stack, Document doc)
|
||||
{
|
||||
this.mc = Minecraft.getMinecraft();
|
||||
this.itemstackBook = stack;
|
||||
currentPage = this.getItemPage(stack);
|
||||
System.out.println("" + currentPage);
|
||||
manual = doc;
|
||||
|
||||
if(doc == null)
|
||||
{
|
||||
System.out.println("Something is wrong~! The doc is null!");
|
||||
}
|
||||
|
||||
|
||||
//renderitem.renderInFrame = true;
|
||||
}
|
||||
|
||||
|
||||
/*@Override
|
||||
public void setWorldAndResolution (Minecraft minecraft, int w, int h)
|
||||
{
|
||||
this.guiParticles = new GuiParticle(minecraft);
|
||||
this.mc = minecraft;
|
||||
this.width = w;
|
||||
this.height = h;
|
||||
this.buttonList.clear();
|
||||
this.initGui();
|
||||
}*/
|
||||
|
||||
|
||||
public void initGui ()
|
||||
{
|
||||
maxPages = manual.getElementsByTagName("page").getLength();
|
||||
updateText();
|
||||
int xPos = (this.width) / 2;
|
||||
this.buttonList.add(this.buttonNextPage = new TurnPageButton(1, xPos + bookImageWidth - 50, 180, true));
|
||||
this.buttonList.add(this.buttonPreviousPage = new TurnPageButton(2, xPos - bookImageWidth + 24, 180, false));
|
||||
}
|
||||
|
||||
|
||||
protected void actionPerformed (GuiButton button)
|
||||
{
|
||||
if (button.enabled)
|
||||
{
|
||||
if (button.id == 1)
|
||||
currentPage += 2;
|
||||
if (button.id == 2)
|
||||
currentPage -= 2;
|
||||
|
||||
this.setItemPage(itemstackBook, currentPage);
|
||||
|
||||
updateText();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void updateText ()
|
||||
{
|
||||
if (maxPages % 2 == 1)
|
||||
{
|
||||
if (currentPage > maxPages)
|
||||
currentPage = maxPages;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (currentPage >= maxPages)
|
||||
currentPage = maxPages - 2;
|
||||
}
|
||||
if (currentPage % 2 == 1)
|
||||
currentPage--;
|
||||
if (currentPage < 0)
|
||||
currentPage = 0;
|
||||
|
||||
|
||||
NodeList nList = manual.getElementsByTagName("page");
|
||||
|
||||
|
||||
|
||||
//System.out.println("" + currentPage);
|
||||
|
||||
Node node = nList.item(currentPage);
|
||||
if (node.getNodeType() == Node.ELEMENT_NODE)
|
||||
{
|
||||
Element element = (Element) node;
|
||||
Class clazz = ClientProxy.getPageClass(element.getAttribute("type"));
|
||||
if (clazz != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
pageLeft = (BookPage) clazz.newInstance();
|
||||
pageLeft.init(this, 0);
|
||||
pageLeft.readPageFromXML(element);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
pageLeft = null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
node = nList.item(currentPage + 1);
|
||||
if (node != null && node.getNodeType() == Node.ELEMENT_NODE)
|
||||
{
|
||||
Element element = (Element) node;
|
||||
Class clazz = ClientProxy.getPageClass(element.getAttribute("type"));
|
||||
if (clazz != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
pageRight = (BookPage) clazz.newInstance();
|
||||
pageRight.init(this, 1);
|
||||
pageRight.readPageFromXML(element);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
pageLeft = null;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
pageRight = null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private static final ResourceLocation bookRight = new ResourceLocation("alchemicalwizardry", "textures/gui/bookright.png");
|
||||
private static final ResourceLocation bookLeft = new ResourceLocation("alchemicalwizardry", "textures/gui/bookleft.png");
|
||||
|
||||
|
||||
public void drawScreen (int par1, int par2, float par3)
|
||||
{
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
this.mc.getTextureManager().bindTexture(bookRight);
|
||||
int localWidth = (this.width) / 2;
|
||||
byte localHeight = 8;
|
||||
this.drawTexturedModalRect(localWidth, localHeight, 0, 0, this.bookImageWidth, this.bookImageHeight);
|
||||
|
||||
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
this.mc.getTextureManager().bindTexture(bookLeft);
|
||||
localWidth = localWidth - this.bookImageWidth;
|
||||
this.drawTexturedModalRect(localWidth, localHeight, 256 - this.bookImageWidth, 0, this.bookImageWidth, this.bookImageHeight);
|
||||
|
||||
|
||||
super.drawScreen(par1, par2, par3); //16, 12, 220, 12
|
||||
|
||||
|
||||
if (pageLeft != null)
|
||||
pageLeft.renderBackgroundLayer(localWidth + 16, localHeight + 12);
|
||||
if (pageRight != null)
|
||||
pageRight.renderBackgroundLayer(localWidth + 220, localHeight + 12);
|
||||
|
||||
|
||||
if (pageLeft != null)
|
||||
pageLeft.renderContentLayer(localWidth + 16, localHeight + 12);
|
||||
if (pageRight != null)
|
||||
pageRight.renderContentLayer(localWidth + 220, localHeight + 12);
|
||||
}
|
||||
|
||||
|
||||
public Minecraft getMC ()
|
||||
{
|
||||
return mc;
|
||||
}
|
||||
|
||||
|
||||
public boolean doesGuiPauseGame ()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public void setItemPage(ItemStack book, int page)
|
||||
{
|
||||
NBTTagCompound tag = book.getTagCompound();
|
||||
|
||||
if(tag==null)
|
||||
{
|
||||
System.out.println("Setted Tag is null");
|
||||
book.setTagCompound(new NBTTagCompound());
|
||||
}
|
||||
|
||||
tag.setInteger("pageNumber", page);
|
||||
}
|
||||
|
||||
public int getItemPage(ItemStack book)
|
||||
{
|
||||
NBTTagCompound tag = book.getTagCompound();
|
||||
|
||||
if(tag==null)
|
||||
{
|
||||
System.out.println("Getted Tag is null");
|
||||
book.setTagCompound(new NBTTagCompound());
|
||||
tag=book.getTagCompound();
|
||||
}
|
||||
|
||||
return tag.getInteger("pageNumber");
|
||||
}
|
||||
}
|
742
BM_src/WayofTime/alchemicalWizardry/client/RenderItemCopy.java
Normal file
742
BM_src/WayofTime/alchemicalWizardry/client/RenderItemCopy.java
Normal file
|
@ -0,0 +1,742 @@
|
|||
package WayofTime.alchemicalWizardry.client;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.ItemRenderer;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.entity.Render;
|
||||
import net.minecraft.client.renderer.texture.TextureManager;
|
||||
import net.minecraft.client.renderer.texture.TextureMap;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.Icon;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.client.ForgeHooksClient;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import org.lwjgl.opengl.GL12;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class RenderItemCopy extends Render
|
||||
{
|
||||
private static final ResourceLocation field_110798_h = new ResourceLocation("textures/misc/enchanted_item_glint.png");
|
||||
private RenderBlocks itemRenderBlocks = new RenderBlocks();
|
||||
|
||||
|
||||
/** The RNG used in RenderItem (for bobbing itemstacks on the ground) */
|
||||
private Random random = new Random();
|
||||
public boolean renderWithColor = true;
|
||||
|
||||
|
||||
/** Defines the zLevel of rendering of item on GUI. */
|
||||
public float zLevel;
|
||||
public static boolean renderInFrame;
|
||||
|
||||
|
||||
public RenderItemCopy()
|
||||
{
|
||||
this.shadowSize = 0.15F;
|
||||
this.shadowOpaque = 0.75F;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Renders the item
|
||||
*/
|
||||
public void doRenderItem (EntityItem par1EntityItem, double par2, double par4, double par6, float par8, float par9)
|
||||
{
|
||||
this.bindEntityTexture(par1EntityItem);
|
||||
this.random.setSeed(187L);
|
||||
ItemStack itemstack = par1EntityItem.getEntityItem();
|
||||
|
||||
|
||||
if (itemstack.getItem() != null)
|
||||
{
|
||||
GL11.glPushMatrix();
|
||||
float f2 = shouldBob() ? MathHelper.sin(((float) par1EntityItem.age + par9) / 10.0F + par1EntityItem.hoverStart) * 0.1F + 0.1F : 0F;
|
||||
float f3 = (((float) par1EntityItem.age + par9) / 20.0F + par1EntityItem.hoverStart) * (180F / (float) Math.PI);
|
||||
byte b0 = getMiniBlockCount(itemstack);
|
||||
|
||||
|
||||
GL11.glTranslatef((float) par2, (float) par4 + f2, (float) par6);
|
||||
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
|
||||
float f4;
|
||||
float f5;
|
||||
float f6;
|
||||
int i;
|
||||
|
||||
|
||||
Block block = null;
|
||||
if (itemstack.itemID < Block.blocksList.length)
|
||||
{
|
||||
block = Block.blocksList[itemstack.itemID];
|
||||
}
|
||||
|
||||
|
||||
if (ForgeHooksClient.renderEntityItem(par1EntityItem, itemstack, f2, f3, random, renderManager.renderEngine, renderBlocks))
|
||||
{
|
||||
;
|
||||
}
|
||||
else if (itemstack.getItemSpriteNumber() == 0 && block != null && RenderBlocks.renderItemIn3d(Block.blocksList[itemstack.itemID].getRenderType()))
|
||||
{
|
||||
GL11.glRotatef(f3, 0.0F, 1.0F, 0.0F);
|
||||
|
||||
|
||||
if (renderInFrame)
|
||||
{
|
||||
GL11.glScalef(1.25F, 1.25F, 1.25F);
|
||||
GL11.glTranslatef(0.0F, 0.05F, 0.0F);
|
||||
GL11.glRotatef(-90.0F, 0.0F, 1.0F, 0.0F);
|
||||
}
|
||||
|
||||
|
||||
float f7 = 0.25F;
|
||||
int j = block.getRenderType();
|
||||
|
||||
|
||||
if (j == 1 || j == 19 || j == 12 || j == 2)
|
||||
{
|
||||
f7 = 0.5F;
|
||||
}
|
||||
|
||||
|
||||
GL11.glScalef(f7, f7, f7);
|
||||
|
||||
|
||||
for (i = 0; i < b0; ++i)
|
||||
{
|
||||
GL11.glPushMatrix();
|
||||
|
||||
|
||||
if (i > 0)
|
||||
{
|
||||
f5 = (this.random.nextFloat() * 2.0F - 1.0F) * 0.2F / f7;
|
||||
f4 = (this.random.nextFloat() * 2.0F - 1.0F) * 0.2F / f7;
|
||||
f6 = (this.random.nextFloat() * 2.0F - 1.0F) * 0.2F / f7;
|
||||
GL11.glTranslatef(f5, f4, f6);
|
||||
}
|
||||
|
||||
|
||||
f5 = 1.0F;
|
||||
this.itemRenderBlocks.renderBlockAsItem(block, itemstack.getItemDamage(), f5);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
float f8;
|
||||
|
||||
|
||||
if (itemstack.getItemSpriteNumber() == 1 && itemstack.getItem().requiresMultipleRenderPasses())
|
||||
{
|
||||
if (renderInFrame)
|
||||
{
|
||||
GL11.glScalef(0.5128205F, 0.5128205F, 0.5128205F);
|
||||
GL11.glTranslatef(0.0F, -0.05F, 0.0F);
|
||||
}
|
||||
else
|
||||
{
|
||||
GL11.glScalef(0.5F, 0.5F, 0.5F);
|
||||
}
|
||||
|
||||
|
||||
for (int k = 0; k < itemstack.getItem().getRenderPasses(itemstack.getItemDamage()); ++k)
|
||||
{
|
||||
this.random.setSeed(187L);
|
||||
Icon icon = itemstack.getItem().getIcon(itemstack, k);
|
||||
f8 = 1.0F;
|
||||
|
||||
|
||||
if (this.renderWithColor)
|
||||
{
|
||||
i = Item.itemsList[itemstack.itemID].getColorFromItemStack(itemstack, k);
|
||||
f5 = (float) (i >> 16 & 255) / 255.0F;
|
||||
f4 = (float) (i >> 8 & 255) / 255.0F;
|
||||
f6 = (float) (i & 255) / 255.0F;
|
||||
GL11.glColor4f(f5 * f8, f4 * f8, f6 * f8, 1.0F);
|
||||
this.renderDroppedItem(par1EntityItem, icon, b0, par9, f5 * f8, f4 * f8, f6 * f8, k);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.renderDroppedItem(par1EntityItem, icon, b0, par9, 1.0F, 1.0F, 1.0F, k);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (renderInFrame)
|
||||
{
|
||||
GL11.glScalef(0.5128205F, 0.5128205F, 0.5128205F);
|
||||
GL11.glTranslatef(0.0F, -0.05F, 0.0F);
|
||||
}
|
||||
else
|
||||
{
|
||||
GL11.glScalef(0.5F, 0.5F, 0.5F);
|
||||
}
|
||||
|
||||
|
||||
Icon icon1 = itemstack.getIconIndex();
|
||||
|
||||
|
||||
if (this.renderWithColor)
|
||||
{
|
||||
int l = Item.itemsList[itemstack.itemID].getColorFromItemStack(itemstack, 0);
|
||||
f8 = (float) (l >> 16 & 255) / 255.0F;
|
||||
float f9 = (float) (l >> 8 & 255) / 255.0F;
|
||||
f5 = (float) (l & 255) / 255.0F;
|
||||
f4 = 1.0F;
|
||||
this.renderDroppedItem(par1EntityItem, icon1, b0, par9, f8 * f4, f9 * f4, f5 * f4);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.renderDroppedItem(par1EntityItem, icon1, b0, par9, 1.0F, 1.0F, 1.0F);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
GL11.glDisable(GL12.GL_RESCALE_NORMAL);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
protected ResourceLocation func_110796_a (EntityItem par1EntityItem)
|
||||
{
|
||||
return this.renderManager.renderEngine.getResourceLocation(par1EntityItem.getEntityItem().getItemSpriteNumber());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Renders a dropped item
|
||||
*/
|
||||
private void renderDroppedItem (EntityItem par1EntityItem, Icon par2Icon, int par3, float par4, float par5, float par6, float par7)
|
||||
{
|
||||
renderDroppedItem(par1EntityItem, par2Icon, par3, par4, par5, par6, par7, 0);
|
||||
}
|
||||
|
||||
|
||||
private void renderDroppedItem (EntityItem par1EntityItem, Icon par2Icon, int par3, float par4, float par5, float par6, float par7, int pass)
|
||||
{
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
|
||||
|
||||
if (par2Icon == null)
|
||||
{
|
||||
TextureManager texturemanager = Minecraft.getMinecraft().getTextureManager();
|
||||
ResourceLocation resourcelocation = texturemanager.getResourceLocation(par1EntityItem.getEntityItem().getItemSpriteNumber());
|
||||
par2Icon = ((TextureMap) texturemanager.getTexture(resourcelocation)).getAtlasSprite("missingno");
|
||||
}
|
||||
|
||||
|
||||
float f4 = ((Icon) par2Icon).getMinU();
|
||||
float f5 = ((Icon) par2Icon).getMaxU();
|
||||
float f6 = ((Icon) par2Icon).getMinV();
|
||||
float f7 = ((Icon) par2Icon).getMaxV();
|
||||
float f8 = 1.0F;
|
||||
float f9 = 0.5F;
|
||||
float f10 = 0.25F;
|
||||
float f11;
|
||||
|
||||
|
||||
if (this.renderManager.options.fancyGraphics)
|
||||
{
|
||||
GL11.glPushMatrix();
|
||||
|
||||
|
||||
if (renderInFrame)
|
||||
{
|
||||
GL11.glRotatef(180.0F, 0.0F, 1.0F, 0.0F);
|
||||
}
|
||||
else
|
||||
{
|
||||
GL11.glRotatef((((float) par1EntityItem.age + par4) / 20.0F + par1EntityItem.hoverStart) * (180F / (float) Math.PI), 0.0F, 1.0F, 0.0F);
|
||||
}
|
||||
|
||||
|
||||
float f12 = 0.0625F;
|
||||
f11 = 0.021875F;
|
||||
ItemStack itemstack = par1EntityItem.getEntityItem();
|
||||
int j = itemstack.stackSize;
|
||||
byte b0 = getMiniItemCount(itemstack);
|
||||
|
||||
|
||||
GL11.glTranslatef(-f9, -f10, -((f12 + f11) * (float) b0 / 2.0F));
|
||||
|
||||
|
||||
for (int k = 0; k < b0; ++k)
|
||||
{
|
||||
// Makes items offset when in 3D, like when in 2D, looks much better. Considered a vanilla bug...
|
||||
if (k > 0 && shouldSpreadItems())
|
||||
{
|
||||
float x = (random.nextFloat() * 2.0F - 1.0F) * 0.3F / 0.5F;
|
||||
float y = (random.nextFloat() * 2.0F - 1.0F) * 0.3F / 0.5F;
|
||||
float z = (random.nextFloat() * 2.0F - 1.0F) * 0.3F / 0.5F;
|
||||
GL11.glTranslatef(x, y, f12 + f11);
|
||||
}
|
||||
else
|
||||
{
|
||||
GL11.glTranslatef(0f, 0f, f12 + f11);
|
||||
}
|
||||
|
||||
|
||||
if (itemstack.getItemSpriteNumber() == 0)
|
||||
{
|
||||
this.bindTexture(TextureMap.locationBlocksTexture);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.bindTexture(TextureMap.locationItemsTexture);
|
||||
}
|
||||
|
||||
|
||||
GL11.glColor4f(par5, par6, par7, 1.0F);
|
||||
ItemRenderer.renderItemIn2D(tessellator, f5, f6, f4, f7, ((Icon) par2Icon).getIconWidth(), ((Icon) par2Icon).getIconHeight(), f12);
|
||||
|
||||
|
||||
if (itemstack.hasEffect(pass))
|
||||
{
|
||||
GL11.glDepthFunc(GL11.GL_EQUAL);
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
this.renderManager.renderEngine.bindTexture(field_110798_h);
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_COLOR, GL11.GL_ONE);
|
||||
float f13 = 0.76F;
|
||||
GL11.glColor4f(0.5F * f13, 0.25F * f13, 0.8F * f13, 1.0F);
|
||||
GL11.glMatrixMode(GL11.GL_TEXTURE);
|
||||
GL11.glPushMatrix();
|
||||
float f14 = 0.125F;
|
||||
GL11.glScalef(f14, f14, f14);
|
||||
float f15 = (float) (Minecraft.getSystemTime() % 3000L) / 3000.0F * 8.0F;
|
||||
GL11.glTranslatef(f15, 0.0F, 0.0F);
|
||||
GL11.glRotatef(-50.0F, 0.0F, 0.0F, 1.0F);
|
||||
ItemRenderer.renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 255, 255, f12);
|
||||
GL11.glPopMatrix();
|
||||
GL11.glPushMatrix();
|
||||
GL11.glScalef(f14, f14, f14);
|
||||
f15 = (float) (Minecraft.getSystemTime() % 4873L) / 4873.0F * 8.0F;
|
||||
GL11.glTranslatef(-f15, 0.0F, 0.0F);
|
||||
GL11.glRotatef(10.0F, 0.0F, 0.0F, 1.0F);
|
||||
ItemRenderer.renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 255, 255, f12);
|
||||
GL11.glPopMatrix();
|
||||
GL11.glMatrixMode(GL11.GL_MODELVIEW);
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
GL11.glDepthFunc(GL11.GL_LEQUAL);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
else
|
||||
{
|
||||
for (int l = 0; l < par3; ++l)
|
||||
{
|
||||
GL11.glPushMatrix();
|
||||
|
||||
|
||||
if (l > 0)
|
||||
{
|
||||
f11 = (this.random.nextFloat() * 2.0F - 1.0F) * 0.3F;
|
||||
float f16 = (this.random.nextFloat() * 2.0F - 1.0F) * 0.3F;
|
||||
float f17 = (this.random.nextFloat() * 2.0F - 1.0F) * 0.3F;
|
||||
GL11.glTranslatef(f11, f16, f17);
|
||||
}
|
||||
|
||||
|
||||
if (!renderInFrame)
|
||||
{
|
||||
GL11.glRotatef(180.0F - this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F);
|
||||
}
|
||||
|
||||
|
||||
GL11.glColor4f(par5, par6, par7, 1.0F);
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setNormal(0.0F, 1.0F, 0.0F);
|
||||
tessellator.addVertexWithUV((double) (0.0F - f9), (double) (0.0F - f10), 0.0D, (double) f4, (double) f7);
|
||||
tessellator.addVertexWithUV((double) (f8 - f9), (double) (0.0F - f10), 0.0D, (double) f5, (double) f7);
|
||||
tessellator.addVertexWithUV((double) (f8 - f9), (double) (1.0F - f10), 0.0D, (double) f5, (double) f6);
|
||||
tessellator.addVertexWithUV((double) (0.0F - f9), (double) (1.0F - f10), 0.0D, (double) f4, (double) f6);
|
||||
tessellator.draw();
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Renders the item's icon or block into the UI at the specified position.
|
||||
*/
|
||||
public void renderItemIntoGUI (SmallFontRenderer par1FontRenderer, TextureManager par2TextureManager, ItemStack par3ItemStack, int par4, int par5)
|
||||
{
|
||||
renderItemIntoGUI(par1FontRenderer, par2TextureManager, par3ItemStack, par4, par5, false);
|
||||
}
|
||||
|
||||
|
||||
public void renderItemIntoGUI (SmallFontRenderer par1FontRenderer, TextureManager par2TextureManager, ItemStack par3ItemStack, int par4, int par5, boolean renderEffect)
|
||||
{
|
||||
int k = par3ItemStack.itemID;
|
||||
int l = par3ItemStack.getItemDamage();
|
||||
Object object = par3ItemStack.getItem() == null ? null : par3ItemStack.getIconIndex();
|
||||
float f;
|
||||
int i1;
|
||||
float f1;
|
||||
float f2;
|
||||
|
||||
|
||||
Block block = (k < Block.blocksList.length ? Block.blocksList[k] : null);
|
||||
if (block != null && par3ItemStack.getItemSpriteNumber() == 0 && RenderBlocks.renderItemIn3d(Block.blocksList[k].getRenderType()))
|
||||
{
|
||||
par2TextureManager.bindTexture(TextureMap.locationBlocksTexture);
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef((float) (par4 - 2), (float) (par5 + 3), -3.0F + this.zLevel);
|
||||
GL11.glScalef(10.0F, 10.0F, 10.0F);
|
||||
GL11.glTranslatef(1.0F, 0.5F, 1.0F);
|
||||
GL11.glScalef(1.0F, 1.0F, -1.0F);
|
||||
GL11.glRotatef(210.0F, 1.0F, 0.0F, 0.0F);
|
||||
GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F);
|
||||
i1 = Item.itemsList[k].getColorFromItemStack(par3ItemStack, 0);
|
||||
f = (float) (i1 >> 16 & 255) / 255.0F;
|
||||
f1 = (float) (i1 >> 8 & 255) / 255.0F;
|
||||
f2 = (float) (i1 & 255) / 255.0F;
|
||||
|
||||
|
||||
if (this.renderWithColor)
|
||||
{
|
||||
GL11.glColor4f(f, f1, f2, 1.0F);
|
||||
}
|
||||
|
||||
|
||||
GL11.glRotatef(-90.0F, 0.0F, 1.0F, 0.0F);
|
||||
this.itemRenderBlocks.useInventoryTint = this.renderWithColor;
|
||||
this.itemRenderBlocks.renderBlockAsItem(block, l, 1.0F);
|
||||
this.itemRenderBlocks.useInventoryTint = true;
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
else if (Item.itemsList[k] != null && Item.itemsList[k].requiresMultipleRenderPasses())
|
||||
{
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
|
||||
|
||||
for (int j1 = 0; j1 < Item.itemsList[k].getRenderPasses(l); ++j1)
|
||||
{
|
||||
par2TextureManager.bindTexture(par3ItemStack.getItemSpriteNumber() == 0 ? TextureMap.locationBlocksTexture : TextureMap.locationItemsTexture);
|
||||
Icon icon = Item.itemsList[k].getIcon(par3ItemStack, j1);
|
||||
int k1 = Item.itemsList[k].getColorFromItemStack(par3ItemStack, j1);
|
||||
f1 = (float) (k1 >> 16 & 255) / 255.0F;
|
||||
f2 = (float) (k1 >> 8 & 255) / 255.0F;
|
||||
float f3 = (float) (k1 & 255) / 255.0F;
|
||||
|
||||
|
||||
if (this.renderWithColor)
|
||||
{
|
||||
GL11.glColor4f(f1, f2, f3, 1.0F);
|
||||
}
|
||||
|
||||
|
||||
this.renderIcon(par4, par5, icon, 16, 16);
|
||||
|
||||
|
||||
if (par3ItemStack.hasEffect(j1))
|
||||
{
|
||||
renderEffect(par2TextureManager, par4, par5);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
}
|
||||
else
|
||||
{
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
ResourceLocation resourcelocation = par2TextureManager.getResourceLocation(par3ItemStack.getItemSpriteNumber());
|
||||
par2TextureManager.bindTexture(resourcelocation);
|
||||
|
||||
|
||||
if (object == null)
|
||||
{
|
||||
object = ((TextureMap) Minecraft.getMinecraft().getTextureManager().getTexture(resourcelocation)).getAtlasSprite("missingno");
|
||||
}
|
||||
|
||||
|
||||
i1 = Item.itemsList[k].getColorFromItemStack(par3ItemStack, 0);
|
||||
f = (float) (i1 >> 16 & 255) / 255.0F;
|
||||
f1 = (float) (i1 >> 8 & 255) / 255.0F;
|
||||
f2 = (float) (i1 & 255) / 255.0F;
|
||||
|
||||
|
||||
if (this.renderWithColor)
|
||||
{
|
||||
GL11.glColor4f(f, f1, f2, 1.0F);
|
||||
}
|
||||
|
||||
|
||||
this.renderIcon(par4, par5, (Icon) object, 16, 16);
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
|
||||
|
||||
if (par3ItemStack.hasEffect(0))
|
||||
{
|
||||
renderEffect(par2TextureManager, par4, par5);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
GL11.glEnable(GL11.GL_CULL_FACE);
|
||||
}
|
||||
|
||||
|
||||
private void renderEffect (TextureManager manager, int x, int y)
|
||||
{
|
||||
GL11.glDepthFunc(GL11.GL_GREATER);
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
GL11.glDepthMask(false);
|
||||
manager.bindTexture(field_110798_h);
|
||||
this.zLevel -= 50.0F;
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glBlendFunc(GL11.GL_DST_COLOR, GL11.GL_DST_COLOR);
|
||||
GL11.glColor4f(0.5F, 0.25F, 0.8F, 1.0F);
|
||||
this.renderGlint(x * 431278612 + y * 32178161, x - 2, y - 2, 20, 20);
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
GL11.glDepthMask(true);
|
||||
this.zLevel += 50.0F;
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
GL11.glDepthFunc(GL11.GL_LEQUAL);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Render the item's icon or block into the GUI, including the glint effect.
|
||||
*/
|
||||
public void renderItemAndEffectIntoGUI (SmallFontRenderer par1FontRenderer, TextureManager par2TextureManager, ItemStack par3ItemStack, int par4, int par5)
|
||||
{
|
||||
if (par3ItemStack != null)
|
||||
{
|
||||
if (!ForgeHooksClient.renderInventoryItem(renderBlocks, par2TextureManager, par3ItemStack, renderWithColor, zLevel, (float) par4, (float) par5))
|
||||
{
|
||||
this.renderItemIntoGUI(par1FontRenderer, par2TextureManager, par3ItemStack, par4, par5, true);
|
||||
}
|
||||
|
||||
|
||||
/* Modders must handle this themselves if they use custom renderers!
|
||||
if (par3ItemStack.hasEffect())
|
||||
{
|
||||
GL11.glDepthFunc(GL11.GL_GREATER);
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
GL11.glDepthMask(false);
|
||||
par2TextureManager.bindTexture(field_110798_h);
|
||||
this.zLevel -= 50.0F;
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glBlendFunc(GL11.GL_DST_COLOR, GL11.GL_DST_COLOR);
|
||||
GL11.glColor4f(0.5F, 0.25F, 0.8F, 1.0F);
|
||||
this.renderGlint(par4 * 431278612 + par5 * 32178161, par4 - 2, par5 - 2, 20, 20);
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
GL11.glDepthMask(true);
|
||||
this.zLevel += 50.0F;
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
GL11.glDepthFunc(GL11.GL_LEQUAL);
|
||||
}
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void renderGlint (int par1, int par2, int par3, int par4, int par5)
|
||||
{
|
||||
for (int j1 = 0; j1 < 2; ++j1)
|
||||
{
|
||||
if (j1 == 0)
|
||||
{
|
||||
GL11.glBlendFunc(GL11.GL_SRC_COLOR, GL11.GL_ONE);
|
||||
}
|
||||
|
||||
|
||||
if (j1 == 1)
|
||||
{
|
||||
GL11.glBlendFunc(GL11.GL_SRC_COLOR, GL11.GL_ONE);
|
||||
}
|
||||
|
||||
|
||||
float f = 0.00390625F;
|
||||
float f1 = 0.00390625F;
|
||||
float f2 = (float) (Minecraft.getSystemTime() % (long) (3000 + j1 * 1873)) / (3000.0F + (float) (j1 * 1873)) * 256.0F;
|
||||
float f3 = 0.0F;
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
float f4 = 4.0F;
|
||||
|
||||
|
||||
if (j1 == 1)
|
||||
{
|
||||
f4 = -1.0F;
|
||||
}
|
||||
|
||||
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.addVertexWithUV((double) (par2 + 0), (double) (par3 + par5), (double) this.zLevel, (double) ((f2 + (float) par5 * f4) * f), (double) ((f3 + (float) par5) * f1));
|
||||
tessellator.addVertexWithUV((double) (par2 + par4), (double) (par3 + par5), (double) this.zLevel, (double) ((f2 + (float) par4 + (float) par5 * f4) * f),
|
||||
(double) ((f3 + (float) par5) * f1));
|
||||
tessellator.addVertexWithUV((double) (par2 + par4), (double) (par3 + 0), (double) this.zLevel, (double) ((f2 + (float) par4) * f), (double) ((f3 + 0.0F) * f1));
|
||||
tessellator.addVertexWithUV((double) (par2 + 0), (double) (par3 + 0), (double) this.zLevel, (double) ((f2 + 0.0F) * f), (double) ((f3 + 0.0F) * f1));
|
||||
tessellator.draw();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Renders the item's overlay information. Examples being stack count or damage on top of the item's image at the
|
||||
* specified position.
|
||||
*/
|
||||
public void renderItemOverlayIntoGUI (SmallFontRenderer par1FontRenderer, TextureManager par2TextureManager, ItemStack par3ItemStack, int par4, int par5)
|
||||
{
|
||||
this.renderItemOverlayIntoGUI(par1FontRenderer, par2TextureManager, par3ItemStack, par4, par5, (String) null);
|
||||
}
|
||||
|
||||
|
||||
public void renderItemOverlayIntoGUI (SmallFontRenderer par1FontRenderer, TextureManager par2TextureManager, ItemStack par3ItemStack, int par4, int par5, String par6Str)
|
||||
{
|
||||
if (par3ItemStack != null)
|
||||
{
|
||||
if (par3ItemStack.stackSize > 1 || par6Str != null)
|
||||
{
|
||||
String s1 = par6Str == null ? String.valueOf(par3ItemStack.stackSize) : par6Str;
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
GL11.glDisable(GL11.GL_DEPTH_TEST);
|
||||
par1FontRenderer.drawStringWithShadow(s1, par4 + 19 - 2 - par1FontRenderer.getStringWidth(s1), par5 + 6 + 3, 16777215);
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
GL11.glEnable(GL11.GL_DEPTH_TEST);
|
||||
}
|
||||
|
||||
|
||||
if (par3ItemStack.isItemDamaged())
|
||||
{
|
||||
int k = (int) Math.round(13.0D - (double) par3ItemStack.getItemDamageForDisplay() * 13.0D / (double) par3ItemStack.getMaxDamage());
|
||||
int l = (int) Math.round(255.0D - (double) par3ItemStack.getItemDamageForDisplay() * 255.0D / (double) par3ItemStack.getMaxDamage());
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
GL11.glDisable(GL11.GL_DEPTH_TEST);
|
||||
GL11.glDisable(GL11.GL_TEXTURE_2D);
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
int i1 = 255 - l << 16 | l << 8;
|
||||
int j1 = (255 - l) / 4 << 16 | 16128;
|
||||
this.renderQuad(tessellator, par4 + 2, par5 + 13, 13, 2, 0);
|
||||
this.renderQuad(tessellator, par4 + 2, par5 + 13, 12, 1, j1);
|
||||
this.renderQuad(tessellator, par4 + 2, par5 + 13, k, 1, i1);
|
||||
GL11.glEnable(GL11.GL_TEXTURE_2D);
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
GL11.glEnable(GL11.GL_DEPTH_TEST);
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Adds a quad to the tesselator at the specified position with the set width and height and color. Args:
|
||||
* tessellator, x, y, width, height, color
|
||||
*/
|
||||
private void renderQuad (Tessellator par1Tessellator, int par2, int par3, int par4, int par5, int par6)
|
||||
{
|
||||
par1Tessellator.startDrawingQuads();
|
||||
par1Tessellator.setColorOpaque_I(par6);
|
||||
par1Tessellator.addVertex((double) (par2 + 0), (double) (par3 + 0), 0.0D);
|
||||
par1Tessellator.addVertex((double) (par2 + 0), (double) (par3 + par5), 0.0D);
|
||||
par1Tessellator.addVertex((double) (par2 + par4), (double) (par3 + par5), 0.0D);
|
||||
par1Tessellator.addVertex((double) (par2 + par4), (double) (par3 + 0), 0.0D);
|
||||
par1Tessellator.draw();
|
||||
}
|
||||
|
||||
|
||||
public void renderIcon (int par1, int par2, Icon par3Icon, int par4, int par5)
|
||||
{
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.addVertexWithUV((double) (par1 + 0), (double) (par2 + par5), (double) this.zLevel, (double) par3Icon.getMinU(), (double) par3Icon.getMaxV());
|
||||
tessellator.addVertexWithUV((double) (par1 + par4), (double) (par2 + par5), (double) this.zLevel, (double) par3Icon.getMaxU(), (double) par3Icon.getMaxV());
|
||||
tessellator.addVertexWithUV((double) (par1 + par4), (double) (par2 + 0), (double) this.zLevel, (double) par3Icon.getMaxU(), (double) par3Icon.getMinV());
|
||||
tessellator.addVertexWithUV((double) (par1 + 0), (double) (par2 + 0), (double) this.zLevel, (double) par3Icon.getMinU(), (double) par3Icon.getMinV());
|
||||
tessellator.draw();
|
||||
}
|
||||
|
||||
|
||||
protected ResourceLocation getEntityTexture (Entity par1Entity)
|
||||
{
|
||||
return this.func_110796_a((EntityItem) par1Entity);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then
|
||||
* handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic
|
||||
* (Render<T extends Entity) and this method has signature public void doRender(T entity, double d, double d1,
|
||||
* double d2, float f, float f1). But JAD is pre 1.5 so doesn't do that.
|
||||
*/
|
||||
public void doRender (Entity par1Entity, double par2, double par4, double par6, float par8, float par9)
|
||||
{
|
||||
this.doRenderItem((EntityItem) par1Entity, par2, par4, par6, par8, par9);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Items should spread out when rendered in 3d?
|
||||
* @return
|
||||
*/
|
||||
public boolean shouldSpreadItems ()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Items should have a bob effect
|
||||
* @return
|
||||
*/
|
||||
public boolean shouldBob ()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
public byte getMiniBlockCount (ItemStack stack)
|
||||
{
|
||||
byte ret = 1;
|
||||
if (stack.stackSize > 1)
|
||||
ret = 2;
|
||||
if (stack.stackSize > 5)
|
||||
ret = 3;
|
||||
if (stack.stackSize > 20)
|
||||
ret = 4;
|
||||
if (stack.stackSize > 40)
|
||||
ret = 5;
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Allows for a subclass to override how many rendered items appear in a
|
||||
* "mini item 3d stack"
|
||||
* @param stack
|
||||
* @return
|
||||
*/
|
||||
public byte getMiniItemCount (ItemStack stack)
|
||||
{
|
||||
byte ret = 1;
|
||||
if (stack.stackSize > 1)
|
||||
ret = 2;
|
||||
if (stack.stackSize > 15)
|
||||
ret = 3;
|
||||
if (stack.stackSize > 31)
|
||||
ret = 4;
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
1189
BM_src/WayofTime/alchemicalWizardry/client/SmallFontRenderer.java
Normal file
1189
BM_src/WayofTime/alchemicalWizardry/client/SmallFontRenderer.java
Normal file
File diff suppressed because it is too large
Load diff
|
@ -0,0 +1,65 @@
|
|||
package WayofTime.alchemicalWizardry.client;
|
||||
|
||||
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class TurnPageButton extends GuiButton
|
||||
{
|
||||
/**
|
||||
* True for pointing right (next page), false for pointing left (previous page).
|
||||
*/
|
||||
private final boolean nextPage;
|
||||
|
||||
|
||||
public TurnPageButton(int par1, int par2, int par3, boolean par4)
|
||||
{
|
||||
super(par1, par2, par3, 23, 13, "");
|
||||
this.nextPage = par4;
|
||||
}
|
||||
|
||||
|
||||
private static final ResourceLocation background = new ResourceLocation("alchemicalwizardry", "textures/gui/bookleft.png");
|
||||
|
||||
|
||||
/**
|
||||
* Draws this button to the screen.
|
||||
*/
|
||||
public void drawButton (Minecraft par1Minecraft, int par2, int par3)
|
||||
{
|
||||
if (this.drawButton)
|
||||
{
|
||||
boolean var4 = par2 >= this.xPosition && par3 >= this.yPosition && par2 < this.xPosition + this.width && par3 < this.yPosition + this.height;
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
par1Minecraft.getTextureManager().bindTexture(background);
|
||||
int var5 = 0;
|
||||
int var6 = 192;
|
||||
|
||||
|
||||
if (var4)
|
||||
{
|
||||
var5 += 23;
|
||||
}
|
||||
|
||||
|
||||
if (!this.nextPage)
|
||||
{
|
||||
var6 += 13;
|
||||
}
|
||||
|
||||
|
||||
this.drawTexturedModalRect(this.xPosition, this.yPosition, var5, var6, 23, 13);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,18 @@
|
|||
package WayofTime.alchemicalWizardry.client.book.pages;
|
||||
|
||||
import org.w3c.dom.Element;
|
||||
|
||||
public class BlankPage extends BookPage
|
||||
{
|
||||
|
||||
@Override
|
||||
public void readPageFromXML (Element element)
|
||||
{
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderContentLayer (int localwidth, int localheight)
|
||||
{
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
package WayofTime.alchemicalWizardry.client.book.pages;
|
||||
|
||||
import org.w3c.dom.Element;
|
||||
|
||||
import WayofTime.alchemicalWizardry.client.GuiManual;
|
||||
|
||||
|
||||
public abstract class BookPage
|
||||
{
|
||||
protected GuiManual manual;
|
||||
protected int side;
|
||||
|
||||
|
||||
public void init (GuiManual manual, int side)
|
||||
{
|
||||
this.manual = manual;
|
||||
this.side = side;
|
||||
}
|
||||
|
||||
|
||||
public abstract void readPageFromXML (Element element);
|
||||
|
||||
|
||||
public void renderBackgroundLayer (int localwidth, int localheight)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
public abstract void renderContentLayer (int localwidth, int localheight);
|
||||
}
|
|
@ -0,0 +1,57 @@
|
|||
package WayofTime.alchemicalWizardry.client.book.pages;
|
||||
|
||||
import net.minecraft.client.renderer.RenderHelper;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import org.lwjgl.opengl.GL12;
|
||||
import org.w3c.dom.Element;
|
||||
import org.w3c.dom.NodeList;
|
||||
|
||||
import WayofTime.alchemicalWizardry.client.BMClientRegistry;
|
||||
|
||||
public class ContentsTablePage extends BookPage
|
||||
{
|
||||
String text;
|
||||
String[] iconText;
|
||||
ItemStack[] icons;
|
||||
|
||||
@Override
|
||||
public void readPageFromXML (Element element)
|
||||
{
|
||||
NodeList nodes = element.getElementsByTagName("text");
|
||||
if (nodes != null)
|
||||
text = nodes.item(0).getTextContent();
|
||||
|
||||
nodes = element.getElementsByTagName("link");
|
||||
iconText = new String[nodes.getLength()];
|
||||
icons = new ItemStack[nodes.getLength()];
|
||||
for (int i = 0; i < nodes.getLength(); i++)
|
||||
{
|
||||
NodeList children = nodes.item(i).getChildNodes();
|
||||
iconText[i] = children.item(1).getTextContent();
|
||||
icons[i] = BMClientRegistry.getManualIcon(children.item(3).getTextContent());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderContentLayer (int localWidth, int localHeight)
|
||||
{
|
||||
if (text != null)
|
||||
manual.fonts.drawString("\u00a7n" + text, localWidth + 25 + manual.fonts.getStringWidth(text) / 2, localHeight + 4, 0);
|
||||
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
|
||||
RenderHelper.enableGUIStandardItemLighting();
|
||||
manual.renderitem.zLevel = 100;
|
||||
for (int i = 0; i < icons.length; i++)
|
||||
{
|
||||
manual.renderitem.renderItemIntoGUI(manual.fonts, manual.getMC().renderEngine, icons[i], localWidth + 16, localHeight + 18 * i + 18);
|
||||
int yOffset = 18;
|
||||
if (iconText[i].length() > 40)
|
||||
yOffset = 13;
|
||||
manual.fonts.drawString(iconText[i], localWidth + 38, localHeight + 18 * i + yOffset, 0);
|
||||
}
|
||||
manual.renderitem.zLevel = 0;
|
||||
RenderHelper.disableStandardItemLighting();
|
||||
GL11.glDisable(GL12.GL_RESCALE_NORMAL);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,105 @@
|
|||
package WayofTime.alchemicalWizardry.client.book.pages;
|
||||
|
||||
import net.minecraft.client.renderer.RenderHelper;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import org.lwjgl.opengl.GL12;
|
||||
import org.w3c.dom.Element;
|
||||
import org.w3c.dom.NodeList;
|
||||
|
||||
import WayofTime.alchemicalWizardry.client.BMClientRegistry;
|
||||
|
||||
public class CraftingPage extends BookPage
|
||||
{
|
||||
String text;
|
||||
String size;
|
||||
ItemStack[] icons;
|
||||
|
||||
@Override
|
||||
public void readPageFromXML (Element element)
|
||||
{
|
||||
NodeList nodes = element.getElementsByTagName("text");
|
||||
if (nodes != null)
|
||||
text = nodes.item(0).getTextContent();
|
||||
|
||||
nodes = element.getElementsByTagName("name");
|
||||
if (nodes != null)
|
||||
icons = BMClientRegistry.getRecipeIcons(nodes.item(0).getTextContent());
|
||||
|
||||
nodes = element.getElementsByTagName("size");
|
||||
if (nodes != null)
|
||||
size = nodes.item(0).getTextContent();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderContentLayer (int localWidth, int localHeight)
|
||||
{
|
||||
if (size.equals("two"))
|
||||
drawCraftingPage(text, icons, 2, localWidth, localHeight + 12);
|
||||
if (size.equals("three"))
|
||||
drawCraftingPage(text, icons, 3, localWidth + (side != 1 ? 6 : 0), localHeight + 12);
|
||||
}
|
||||
|
||||
public void drawCraftingPage (String info, ItemStack[] icons, int recipeSize, int localWidth, int localHeight)
|
||||
{
|
||||
if (info != null)
|
||||
manual.fonts.drawString("\u00a7n" + info, localWidth + 50, localHeight + 4, 0);
|
||||
|
||||
GL11.glScalef(2f, 2f, 2f);
|
||||
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
|
||||
RenderHelper.enableGUIStandardItemLighting();
|
||||
manual.renderitem.zLevel = 100;
|
||||
|
||||
if (recipeSize == 2)
|
||||
{
|
||||
manual.renderitem.renderItemAndEffectIntoGUI(manual.fonts, manual.getMC().renderEngine, icons[0], (localWidth + 126) / 2, (localHeight + 68) / 2);
|
||||
if (icons[0].stackSize > 1)
|
||||
manual.renderitem.renderItemOverlayIntoGUI(manual.fonts, manual.getMC().renderEngine, icons[0], (localWidth + 126) / 2, (localHeight + 68) / 2, String.valueOf(icons[0].stackSize));
|
||||
for (int i = 0; i < icons.length - 1; i++)
|
||||
{
|
||||
if (icons[i + 1] != null)
|
||||
manual.renderitem.renderItemAndEffectIntoGUI(manual.fonts, manual.getMC().renderEngine, icons[i + 1], (localWidth + 14 + 36 * (i % 2)) / 2, (localHeight + 36 * (i / 2) + 52) / 2);
|
||||
}
|
||||
}
|
||||
|
||||
if (recipeSize == 3)
|
||||
{
|
||||
manual.renderitem.renderItemAndEffectIntoGUI(manual.fonts, manual.getMC().renderEngine, icons[0], (localWidth + 138) / 2, (localHeight + 70) / 2);
|
||||
if (icons[0].stackSize > 1)
|
||||
manual.renderitem.renderItemOverlayIntoGUI(manual.fonts, manual.getMC().renderEngine, icons[0], (localWidth + 126) / 2, (localHeight + 68) / 2, String.valueOf(icons[0].stackSize));
|
||||
for (int i = 0; i < icons.length - 1; i++)
|
||||
{
|
||||
if (icons[i + 1] != null)
|
||||
manual.renderitem.renderItemAndEffectIntoGUI(manual.fonts, manual.getMC().renderEngine, icons[i + 1], (localWidth - 2 + 36 * (i % 3)) / 2, (localHeight + 36 * (i / 3) + 34) / 2);
|
||||
}
|
||||
}
|
||||
|
||||
manual.renderitem.zLevel = 0;
|
||||
GL11.glScalef(0.5F, 0.5F, 0.5F);
|
||||
RenderHelper.disableStandardItemLighting();
|
||||
GL11.glDisable(GL12.GL_RESCALE_NORMAL);
|
||||
}
|
||||
|
||||
public void renderBackgroundLayer (int localwidth, int localheight)
|
||||
{
|
||||
if (size.equals("two"))
|
||||
drawBackground(2, localwidth, localheight + 12);
|
||||
|
||||
if (size.equals("three"))
|
||||
drawBackground(3, localwidth + (side != 1 ? 6 : 0), localheight + 12);
|
||||
}
|
||||
|
||||
private static final ResourceLocation background = new ResourceLocation("alchemicalwizardry", "textures/gui/bookcrafting.png");
|
||||
|
||||
public void drawBackground (int size, int localWidth, int localHeight)
|
||||
{
|
||||
manual.getMC().getTextureManager().bindTexture(background);
|
||||
if (size == 2)
|
||||
manual.drawTexturedModalRect(localWidth + 8, localHeight + 46, 0, 116, 154, 78);
|
||||
if (size == 3)
|
||||
manual.drawTexturedModalRect(localWidth - 8, localHeight + 28, 0, 0, 183, 114);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,62 @@
|
|||
package WayofTime.alchemicalWizardry.client.book.pages;
|
||||
|
||||
import net.minecraft.client.renderer.RenderHelper;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import org.lwjgl.opengl.GL12;
|
||||
import org.w3c.dom.Element;
|
||||
import org.w3c.dom.NodeList;
|
||||
|
||||
import WayofTime.alchemicalWizardry.client.BMClientRegistry;
|
||||
|
||||
public class FurnacePage extends BookPage
|
||||
{
|
||||
String text;
|
||||
ItemStack[] icons;
|
||||
|
||||
@Override
|
||||
public void readPageFromXML (Element element)
|
||||
{
|
||||
NodeList nodes = element.getElementsByTagName("text");
|
||||
if (nodes != null)
|
||||
text = nodes.item(0).getTextContent();
|
||||
|
||||
nodes = element.getElementsByTagName("recipe");
|
||||
if (nodes != null)
|
||||
icons = BMClientRegistry.getRecipeIcons(nodes.item(0).getTextContent());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderContentLayer (int localWidth, int localHeight)
|
||||
{
|
||||
if (text != null)
|
||||
manual.fonts.drawString("\u00a7n" + text, localWidth + 50, localHeight + 4, 0);
|
||||
|
||||
GL11.glScalef(2f, 2f, 2f);
|
||||
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
|
||||
RenderHelper.enableGUIStandardItemLighting();
|
||||
manual.renderitem.zLevel = 100;
|
||||
|
||||
manual.renderitem.renderItemAndEffectIntoGUI(manual.fonts, manual.getMC().renderEngine, BMClientRegistry.getManualIcon("coal"), (localWidth + 38) / 2, (localHeight + 110) / 2);
|
||||
manual.renderitem.renderItemAndEffectIntoGUI(manual.fonts, manual.getMC().renderEngine, icons[0], (localWidth + 106) / 2, (localHeight + 74) / 2);
|
||||
manual.renderitem.renderItemAndEffectIntoGUI(manual.fonts, manual.getMC().renderEngine, icons[1], (localWidth + 38) / 2, (localHeight + 38) / 2);
|
||||
|
||||
if (icons[0].stackSize > 1)
|
||||
manual.renderitem.renderItemOverlayIntoGUI(manual.fonts, manual.getMC().renderEngine, icons[0], (localWidth + 106) / 2, (localHeight + 74) / 2, String.valueOf(icons[0].stackSize));
|
||||
|
||||
manual.renderitem.zLevel = 0;
|
||||
GL11.glScalef(0.5F, 0.5F, 0.5F);
|
||||
RenderHelper.disableStandardItemLighting();
|
||||
GL11.glDisable(GL12.GL_RESCALE_NORMAL);
|
||||
}
|
||||
|
||||
private static final ResourceLocation background = new ResourceLocation("alchemicalWizardry", "textures/gui/bookfurnace.png");
|
||||
|
||||
public void renderBackgroundLayer (int localWidth, int localHeight)
|
||||
{
|
||||
manual.getMC().getTextureManager().bindTexture(background);
|
||||
manual.drawTexturedModalRect(localWidth + 32, localHeight + 32, 0, 0, 111, 114);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,41 @@
|
|||
package WayofTime.alchemicalWizardry.client.book.pages;
|
||||
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import org.w3c.dom.Element;
|
||||
import org.w3c.dom.NodeList;
|
||||
|
||||
public class PicturePage extends BookPage
|
||||
{
|
||||
String text;
|
||||
String location;
|
||||
|
||||
@Override
|
||||
public void readPageFromXML (Element element)
|
||||
{
|
||||
NodeList nodes = element.getElementsByTagName("text");
|
||||
if (nodes != null)
|
||||
text = nodes.item(0).getTextContent();
|
||||
|
||||
nodes = element.getElementsByTagName("location");
|
||||
if (nodes != null)
|
||||
location = nodes.item(0).getTextContent();
|
||||
|
||||
background = new ResourceLocation(location);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderContentLayer (int localWidth, int localHeight)
|
||||
{
|
||||
manual.fonts.drawSplitString(text, localWidth + 8, localHeight, 178, 0);
|
||||
}
|
||||
|
||||
ResourceLocation background;
|
||||
|
||||
public void renderBackgroundLayer (int localWidth, int localHeight)
|
||||
{
|
||||
manual.getMC().getTextureManager().bindTexture(background);
|
||||
//manual.getMC().renderEngine.bindTexture(location);
|
||||
manual.drawTexturedModalRect(localWidth, localHeight + 12, 0, 0, 170, 144);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,29 @@
|
|||
package WayofTime.alchemicalWizardry.client.book.pages;
|
||||
|
||||
import org.w3c.dom.Element;
|
||||
import org.w3c.dom.NodeList;
|
||||
|
||||
public class SectionPage extends BookPage
|
||||
{
|
||||
String title;
|
||||
String body;
|
||||
|
||||
@Override
|
||||
public void readPageFromXML (Element element)
|
||||
{
|
||||
NodeList nodes = element.getElementsByTagName("title");
|
||||
if (nodes != null)
|
||||
title = nodes.item(0).getTextContent();
|
||||
|
||||
nodes = element.getElementsByTagName("text");
|
||||
if (nodes != null)
|
||||
body = nodes.item(0).getTextContent();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderContentLayer (int localWidth, int localHeight)
|
||||
{
|
||||
manual.fonts.drawSplitString("\u00a7n" + title, localWidth + 70, localHeight + 4, 178, 0);
|
||||
manual.fonts.drawSplitString(body, localWidth, localHeight + 16, 190, 0);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,57 @@
|
|||
package WayofTime.alchemicalWizardry.client.book.pages;
|
||||
|
||||
import net.minecraft.client.renderer.RenderHelper;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import org.lwjgl.opengl.GL12;
|
||||
import org.w3c.dom.Element;
|
||||
import org.w3c.dom.NodeList;
|
||||
|
||||
import WayofTime.alchemicalWizardry.client.BMClientRegistry;
|
||||
|
||||
public class SidebarPage extends BookPage
|
||||
{
|
||||
String text;
|
||||
String[] iconText;
|
||||
ItemStack[] icons;
|
||||
|
||||
@Override
|
||||
public void readPageFromXML (Element element)
|
||||
{
|
||||
NodeList nodes = element.getElementsByTagName("text");
|
||||
if (nodes != null)
|
||||
text = nodes.item(0).getTextContent();
|
||||
|
||||
nodes = element.getElementsByTagName("item");
|
||||
iconText = new String[nodes.getLength()];
|
||||
icons = new ItemStack[nodes.getLength()];
|
||||
for (int i = 0; i < nodes.getLength(); i++)
|
||||
{
|
||||
NodeList children = nodes.item(i).getChildNodes();
|
||||
iconText[i] = children.item(1).getTextContent();
|
||||
icons[i] = BMClientRegistry.getManualIcon(children.item(3).getTextContent());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderContentLayer (int localWidth, int localHeight)
|
||||
{
|
||||
manual.fonts.drawSplitString(text, localWidth, localHeight, 178, 0);
|
||||
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
|
||||
RenderHelper.enableGUIStandardItemLighting();
|
||||
manual.renderitem.zLevel = 100;
|
||||
int offset = text.length() / 4 + 10;
|
||||
for (int i = 0; i < icons.length; i++)
|
||||
{
|
||||
manual.renderitem.renderItemIntoGUI(manual.fonts, manual.getMC().renderEngine, icons[i], localWidth + 8, localHeight + 18 * i + offset);
|
||||
int yOffset = 39;
|
||||
if (iconText[i].length() > 40)
|
||||
yOffset = 34;
|
||||
manual.fonts.drawSplitString(iconText[i], localWidth + 30, localHeight + 18 * i + offset, 140, 0);
|
||||
}
|
||||
manual.renderitem.zLevel = 0;
|
||||
RenderHelper.disableStandardItemLighting();
|
||||
GL11.glDisable(GL12.GL_RESCALE_NORMAL);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
package WayofTime.alchemicalWizardry.client.book.pages;
|
||||
|
||||
import org.w3c.dom.Element;
|
||||
import org.w3c.dom.NodeList;
|
||||
|
||||
public class TextPage extends BookPage
|
||||
{
|
||||
String text;
|
||||
|
||||
@Override
|
||||
public void readPageFromXML (Element element)
|
||||
{
|
||||
NodeList nodes = element.getElementsByTagName("text");
|
||||
if (nodes != null)
|
||||
text = nodes.item(0).getTextContent();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderContentLayer (int localWidth, int localHeight)
|
||||
{
|
||||
manual.fonts.drawSplitString(text, localWidth, localHeight, 178, 0);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
package WayofTime.alchemicalWizardry.client.book.pages;
|
||||
|
||||
import org.w3c.dom.Element;
|
||||
import org.w3c.dom.NodeList;
|
||||
|
||||
public class TitlePage extends BookPage
|
||||
{
|
||||
String text;
|
||||
|
||||
@Override
|
||||
public void readPageFromXML (Element element)
|
||||
{
|
||||
NodeList nodes = element.getElementsByTagName("text");
|
||||
if (nodes != null)
|
||||
text = nodes.item(0).getTextContent();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderContentLayer (int localWidth, int localHeight)
|
||||
{
|
||||
manual.fonts.drawSplitString(text, localWidth, localHeight, 178, 0);
|
||||
}
|
||||
}
|
|
@ -26,6 +26,7 @@ public class CommonProxy
|
|||
{
|
||||
public static String ITEMS_PNG = "/WayofTime/alchemicalWizardry/items.png";
|
||||
public static String BLOCK_PNG = "/WayofTime/alchemicalWizardry/block.png";
|
||||
public static int manualGuiID = -1;
|
||||
|
||||
// Client stuff
|
||||
public void registerRenderers()
|
||||
|
|
|
@ -103,9 +103,7 @@ public class EnergyItems extends Item implements IBindable
|
|||
|
||||
public static boolean syphonWhileInContainer(ItemStack ist, int damageToBeDone)
|
||||
{
|
||||
SoulNetworkHandler.syphonFromNetwork(ist, damageToBeDone);
|
||||
|
||||
return true;
|
||||
return SoulNetworkHandler.syphonFromNetwork(ist, damageToBeDone)!=0;
|
||||
}
|
||||
|
||||
public static boolean canSyphonInContainer(ItemStack ist, int damageToBeDone)
|
||||
|
|
|
@ -31,13 +31,25 @@ public class SacrificialDagger extends Item
|
|||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IconRegister iconRegister)
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:SacrificialDagger");
|
||||
if(AlchemicalWizardry.wimpySettings)
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:SheathedItem");
|
||||
}else
|
||||
{
|
||||
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:SacrificialDagger");
|
||||
}
|
||||
}
|
||||
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
|
||||
{
|
||||
par3List.add("Just a prick of the");
|
||||
par3List.add("finger will suffice...");
|
||||
if(AlchemicalWizardry.wimpySettings)
|
||||
{
|
||||
par3List.add(">:(");
|
||||
}else
|
||||
{
|
||||
par3List.add("Just a prick of the");
|
||||
par3List.add("finger will suffice...");
|
||||
}
|
||||
}
|
||||
|
||||
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
|
||||
|
|
|
@ -0,0 +1,71 @@
|
|||
package WayofTime.alchemicalWizardry.common.items.books;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemEditableBook;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.nbt.NBTTagString;
|
||||
import net.minecraft.world.World;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.client.GuiManual;
|
||||
import cpw.mods.fml.client.FMLClientHandler;
|
||||
|
||||
public class ItemBloodArchives extends ItemEditableBook
|
||||
{
|
||||
public static ItemStack book1Stack;
|
||||
|
||||
public ItemBloodArchives(int par1)
|
||||
{
|
||||
super(par1);
|
||||
setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
}
|
||||
|
||||
public static void initBooks()
|
||||
{
|
||||
ItemStack tomeStack = new ItemStack(Item.writableBook);
|
||||
NBTTagList bookPages = new NBTTagList("pages");
|
||||
bookPages.appendTag(new NBTTagString("1", "Insert text here."));
|
||||
bookPages.appendTag(new NBTTagString("2", "Insert moar text here."));
|
||||
tomeStack.setTagInfo("pages", bookPages);
|
||||
tomeStack.setTagInfo("author", new NBTTagString("author", "WayofTime"));
|
||||
tomeStack.setTagInfo("title", new NBTTagString("title", "Blood Book"));
|
||||
tomeStack.itemID = Item.writtenBook.itemID;
|
||||
|
||||
book1Stack = tomeStack.copy();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick (ItemStack stack, World world, EntityPlayer player)
|
||||
{
|
||||
player.openGui(AlchemicalWizardry.instance, 2, world, 0, 0, 0);
|
||||
//FMLClientHandler.instance().displayGuiScreen(player, new GuiManual(stack, getData(stack)));
|
||||
/*Side side = FMLCommonHandler.instance().getEffectiveSide();
|
||||
if (side.isClient())
|
||||
FMLClientHandler.instance().displayGuiScreen(player, new GuiManual(player.getCurrentEquippedItem(), getManualFromStack(stack)));*/
|
||||
return stack;
|
||||
}
|
||||
|
||||
// @Override
|
||||
// @SideOnly(Side.CLIENT)
|
||||
// public void getSubItems(int id, CreativeTabs creativeTab, List list)
|
||||
// {
|
||||
// list.add(book1Stack);
|
||||
// }
|
||||
|
||||
// private BookData getData (ItemStack stack)
|
||||
// {
|
||||
// switch (stack.getItemDamage())
|
||||
// {
|
||||
// case 0:
|
||||
// return TProxyClient.manualData.beginner;
|
||||
// case 1:
|
||||
// return TProxyClient.manualData.toolStation;
|
||||
// case 2:
|
||||
// return TProxyClient.manualData.smeltery;
|
||||
// default:
|
||||
// return TProxyClient.manualData.diary;
|
||||
// }
|
||||
// }
|
||||
|
||||
}
|
|
@ -38,7 +38,7 @@ public class RitualEffectAnimalGrowth extends RitualEffect
|
|||
}
|
||||
|
||||
int currentEssence = data.currentEssence;
|
||||
World world = ritualStone.getWorldObj();
|
||||
World world = ritualStone.getWorld();
|
||||
int x = ritualStone.getXCoord();
|
||||
int y = ritualStone.getYCoord();
|
||||
int z = ritualStone.getZCoord();
|
||||
|
|
|
@ -33,7 +33,7 @@ public class RitualEffectApiaryOverclock extends RitualEffect
|
|||
}
|
||||
|
||||
int currentEssence = data.currentEssence;
|
||||
World world = ritualStone.getWorldObj();
|
||||
World world = ritualStone.getWorld();
|
||||
int x = ritualStone.getXCoord();
|
||||
int y = ritualStone.getYCoord();
|
||||
int z = ritualStone.getZCoord();
|
||||
|
|
|
@ -35,7 +35,7 @@ public class RitualEffectAutoAlchemy extends RitualEffect
|
|||
}
|
||||
|
||||
int currentEssence = data.currentEssence;
|
||||
World world = ritualStone.getWorldObj();
|
||||
World world = ritualStone.getWorld();
|
||||
int x = ritualStone.getXCoord();
|
||||
int y = ritualStone.getYCoord();
|
||||
int z = ritualStone.getZCoord();
|
||||
|
|
|
@ -37,7 +37,7 @@ public class RitualEffectBiomeChanger extends RitualEffect
|
|||
data = new LifeEssenceNetwork(owner);
|
||||
worldSave.setItemData(owner, data);
|
||||
}
|
||||
World world = ritualStone.getWorldObj();
|
||||
World world = ritualStone.getWorld();
|
||||
int cooldown = ritualStone.getCooldown();
|
||||
int x = ritualStone.getXCoord();
|
||||
int y = ritualStone.getYCoord();
|
||||
|
|
|
@ -34,7 +34,7 @@ public class RitualEffectContainment extends RitualEffect
|
|||
}
|
||||
|
||||
int currentEssence = data.currentEssence;
|
||||
World world = ritualStone.getWorldObj();
|
||||
World world = ritualStone.getWorld();
|
||||
int x = ritualStone.getXCoord();
|
||||
int y = ritualStone.getYCoord();
|
||||
int z = ritualStone.getZCoord();
|
||||
|
|
|
@ -35,7 +35,7 @@ public class RitualEffectCrushing extends RitualEffect
|
|||
}
|
||||
|
||||
int currentEssence = data.currentEssence;
|
||||
World world = ritualStone.getWorldObj();
|
||||
World world = ritualStone.getWorld();
|
||||
|
||||
if (world.getWorldTime() % 40 != 0)
|
||||
{
|
||||
|
|
|
@ -32,7 +32,7 @@ public class RitualEffectEnhancedAlchemy extends RitualEffect
|
|||
}
|
||||
|
||||
int currentEssence = data.currentEssence;
|
||||
World world = ritualStone.getWorldObj();
|
||||
World world = ritualStone.getWorld();
|
||||
int x = ritualStone.getXCoord();
|
||||
int y = ritualStone.getYCoord();
|
||||
int z = ritualStone.getZCoord();
|
||||
|
|
|
@ -41,7 +41,7 @@ public class RitualEffectExpulsion extends RitualEffect
|
|||
}
|
||||
|
||||
int currentEssence = data.currentEssence;
|
||||
World world = ritualStone.getWorldObj();
|
||||
World world = ritualStone.getWorld();
|
||||
int x = ritualStone.getXCoord();
|
||||
int y = ritualStone.getYCoord();
|
||||
int z = ritualStone.getZCoord();
|
||||
|
|
|
@ -32,7 +32,7 @@ public class RitualEffectFeatheredEarth extends RitualEffect //Nullifies all fal
|
|||
}
|
||||
|
||||
int currentEssence = data.currentEssence;
|
||||
World world = ritualStone.getWorldObj();
|
||||
World world = ritualStone.getWorld();
|
||||
int x = ritualStone.getXCoord();
|
||||
int y = ritualStone.getYCoord();
|
||||
int z = ritualStone.getZCoord();
|
||||
|
|
|
@ -36,7 +36,7 @@ public class RitualEffectFeatheredKnife extends RitualEffect
|
|||
}
|
||||
|
||||
int currentEssence = data.currentEssence;
|
||||
World world = ritualStone.getWorldObj();
|
||||
World world = ritualStone.getWorld();
|
||||
int x = ritualStone.getXCoord();
|
||||
int y = ritualStone.getYCoord();
|
||||
int z = ritualStone.getZCoord();
|
||||
|
|
|
@ -31,7 +31,7 @@ public class RitualEffectFlight extends RitualEffect
|
|||
}
|
||||
|
||||
int currentEssence = data.currentEssence;
|
||||
World world = ritualStone.getWorldObj();
|
||||
World world = ritualStone.getWorld();
|
||||
int x = ritualStone.getXCoord();
|
||||
int y = ritualStone.getYCoord();
|
||||
int z = ritualStone.getZCoord();
|
||||
|
|
|
@ -33,7 +33,7 @@ public class RitualEffectGrowth extends RitualEffect
|
|||
}
|
||||
|
||||
int currentEssence = data.currentEssence;
|
||||
World world = ritualStone.getWorldObj();
|
||||
World world = ritualStone.getWorld();
|
||||
int x = ritualStone.getXCoord();
|
||||
int y = ritualStone.getYCoord();
|
||||
int z = ritualStone.getZCoord();
|
||||
|
|
|
@ -35,7 +35,7 @@ public class RitualEffectHealing extends RitualEffect
|
|||
}
|
||||
|
||||
int currentEssence = data.currentEssence;
|
||||
World world = ritualStone.getWorldObj();
|
||||
World world = ritualStone.getWorld();
|
||||
int x = ritualStone.getXCoord();
|
||||
int y = ritualStone.getYCoord();
|
||||
int z = ritualStone.getZCoord();
|
||||
|
|
|
@ -32,7 +32,7 @@ public class RitualEffectInterdiction extends RitualEffect
|
|||
}
|
||||
|
||||
int currentEssence = data.currentEssence;
|
||||
World world = ritualStone.getWorldObj();
|
||||
World world = ritualStone.getWorld();
|
||||
int x = ritualStone.getXCoord();
|
||||
int y = ritualStone.getYCoord();
|
||||
int z = ritualStone.getZCoord();
|
||||
|
|
|
@ -35,7 +35,7 @@ public class RitualEffectJumping extends RitualEffect
|
|||
}
|
||||
|
||||
int currentEssence = data.currentEssence;
|
||||
World world = ritualStone.getWorldObj();
|
||||
World world = ritualStone.getWorld();
|
||||
int x = ritualStone.getXCoord();
|
||||
int y = ritualStone.getYCoord();
|
||||
int z = ritualStone.getZCoord();
|
||||
|
|
|
@ -32,7 +32,7 @@ public class RitualEffectLava extends RitualEffect
|
|||
}
|
||||
|
||||
int currentEssence = data.currentEssence;
|
||||
World world = ritualStone.getWorldObj();
|
||||
World world = ritualStone.getWorld();
|
||||
int x = ritualStone.getXCoord();
|
||||
int y = ritualStone.getYCoord();
|
||||
int z = ritualStone.getZCoord();
|
||||
|
|
|
@ -35,7 +35,7 @@ public class RitualEffectLeap extends RitualEffect
|
|||
}
|
||||
|
||||
int currentEssence = data.currentEssence;
|
||||
World world = ritualStone.getWorldObj();
|
||||
World world = ritualStone.getWorld();
|
||||
int x = ritualStone.getXCoord();
|
||||
int y = ritualStone.getYCoord();
|
||||
int z = ritualStone.getZCoord();
|
||||
|
|
|
@ -33,7 +33,7 @@ public class RitualEffectMagnetic extends RitualEffect
|
|||
}
|
||||
|
||||
int currentEssence = data.currentEssence;
|
||||
World world = ritualStone.getWorldObj();
|
||||
World world = ritualStone.getWorld();
|
||||
int x = ritualStone.getXCoord();
|
||||
int y = ritualStone.getYCoord();
|
||||
int z = ritualStone.getZCoord();
|
||||
|
|
|
@ -41,7 +41,7 @@ public class RitualEffectSoulBound extends RitualEffect
|
|||
}
|
||||
|
||||
int currentEssence = data.currentEssence;
|
||||
World world = ritualStone.getWorldObj();
|
||||
World world = ritualStone.getWorld();
|
||||
int x = ritualStone.getXCoord();
|
||||
int y = ritualStone.getYCoord();
|
||||
int z = ritualStone.getZCoord();
|
||||
|
|
|
@ -33,7 +33,7 @@ public class RitualEffectSummonMeteor extends RitualEffect
|
|||
}
|
||||
|
||||
int currentEssence = data.currentEssence;
|
||||
World world = ritualStone.getWorldObj();
|
||||
World world = ritualStone.getWorld();
|
||||
int x = ritualStone.getXCoord();
|
||||
int y = ritualStone.getYCoord();
|
||||
int z = ritualStone.getZCoord();
|
||||
|
|
|
@ -33,7 +33,7 @@ public class RitualEffectSupression extends RitualEffect
|
|||
}
|
||||
|
||||
int currentEssence = data.currentEssence;
|
||||
World world = ritualStone.getWorldObj();
|
||||
World world = ritualStone.getWorld();
|
||||
int x = ritualStone.getXCoord();
|
||||
int y = ritualStone.getYCoord();
|
||||
int z = ritualStone.getZCoord();
|
||||
|
|
|
@ -42,7 +42,7 @@ public class RitualEffectUnbinding extends RitualEffect
|
|||
}
|
||||
|
||||
int currentEssence = data.currentEssence;
|
||||
World world = ritualStone.getWorldObj();
|
||||
World world = ritualStone.getWorld();
|
||||
int x = ritualStone.getXCoord();
|
||||
int y = ritualStone.getYCoord();
|
||||
int z = ritualStone.getZCoord();
|
||||
|
|
|
@ -31,7 +31,7 @@ public class RitualEffectWater extends RitualEffect
|
|||
}
|
||||
|
||||
int currentEssence = data.currentEssence;
|
||||
World world = ritualStone.getWorldObj();
|
||||
World world = ritualStone.getWorld();
|
||||
int x = ritualStone.getXCoord();
|
||||
int y = ritualStone.getYCoord();
|
||||
int z = ritualStone.getZCoord();
|
||||
|
|
|
@ -37,7 +37,7 @@ public class RitualEffectWellOfSuffering extends RitualEffect
|
|||
}
|
||||
|
||||
int currentEssence = data.currentEssence;
|
||||
World world = ritualStone.getWorldObj();
|
||||
World world = ritualStone.getWorld();
|
||||
int x = ritualStone.getXCoord();
|
||||
int y = ritualStone.getYCoord();
|
||||
int z = ritualStone.getZCoord();
|
||||
|
|
|
@ -209,4 +209,10 @@ public class TEMasterStone extends TileEntity implements IMasterRitualStone
|
|||
{
|
||||
return this.zCoord;
|
||||
}
|
||||
|
||||
@Override
|
||||
public World getWorld()
|
||||
{
|
||||
return this.getWorldObj();
|
||||
}
|
||||
}
|
|
@ -733,6 +733,7 @@ public class TEWritingTable extends TileEntity implements ISidedInventory
|
|||
|
||||
if (getStackInSlot(6) == null)
|
||||
{
|
||||
|
||||
if (worldTime % 4 == 0)
|
||||
{
|
||||
PacketDispatcher.sendPacketToAllAround(xCoord, yCoord, zCoord, 20, worldObj.provider.dimensionId, getParticlePacket(xCoord, yCoord, zCoord, (short) 1));
|
||||
|
|
|
@ -1,13 +1,16 @@
|
|||
package WayofTime.alchemicalWizardry.common.tileEntity.gui;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import WayofTime.alchemicalWizardry.client.ClientProxy;
|
||||
import WayofTime.alchemicalWizardry.client.GuiManual;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TETeleposer;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TEWritingTable;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.container.ContainerTeleposer;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.container.ContainerWritingTable;
|
||||
import cpw.mods.fml.common.network.IGuiHandler;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class GuiHandler implements IGuiHandler
|
||||
{
|
||||
|
@ -34,6 +37,13 @@ public class GuiHandler implements IGuiHandler
|
|||
{
|
||||
return new ContainerTeleposer(player.inventory, (TETeleposer) tileEntity);
|
||||
}
|
||||
|
||||
// case 2:
|
||||
// {
|
||||
// ItemStack stack = player.getCurrentEquippedItem();
|
||||
// return new GuiManual(stack, ClientProxy.getManualFromStack(stack));
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
return null;
|
||||
|
@ -66,6 +76,12 @@ public class GuiHandler implements IGuiHandler
|
|||
}
|
||||
|
||||
break;
|
||||
|
||||
case 2:
|
||||
{
|
||||
ItemStack stack = player.getCurrentEquippedItem();
|
||||
return new GuiManual(stack, ClientProxy.getManualFromStack(stack));
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue