no message

This commit is contained in:
Pulxes-9244 committed 2022-03-08 13:53:16 +03:00
1 parent 11256d27c2
commit 9f555a1dbb
839 files changed
+96108

No files matched your search

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 521 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 707 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 678 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 87 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 487 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

@@ -0,0 +1,5 @@
{
"animation": {
"frametime": 12
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.
Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.0 KiB

@@ -0,0 +1,121 @@
package ab.api.recipe.lexicon;
import java.util.ArrayList;
import java.util.List;
import org.lwjgl.opengl.GL11;
import ab.api.AdvancedBotanyAPI;
import ab.api.recipe.RecipeAdvancedPlate;
import ab.client.core.ClientHelper;
import ab.common.lib.register.BlockListAB;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.FontRenderer;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.client.renderer.texture.TextureManager;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.StatCollector;
import vazkii.botania.api.internal.IGuiLexiconEntry;
import vazkii.botania.api.lexicon.LexiconEntry;
import vazkii.botania.api.lexicon.LexiconRecipeMappings;
import vazkii.botania.client.core.handler.ClientTickHandler;
import vazkii.botania.client.core.handler.HUDHandler;
import vazkii.botania.common.core.handler.ConfigHandler;
import vazkii.botania.common.lexicon.page.PageRecipe;
public class AdvancedPlateCraftPage extends PageRecipe {
private static final ResourceLocation plateOverlay = new ResourceLocation("botania:textures/gui/petalOverlay.png");
private RecipeAdvancedPlate recipe;
private final ItemStack resultStack;
int ticksElapsed = 0;
public AdvancedPlateCraftPage(LexiconEntry entry, ItemStack stack) {
this(entry, stack, "");
}
public AdvancedPlateCraftPage(LexiconEntry entry, ItemStack stack, String str) {
super(".abCraft" + str);
resultStack = stack;
refreshRecipe(entry, stack);
}
public ItemStack getResult() {
return resultStack;
}
public void refreshRecipe(LexiconEntry entry, ItemStack stack) {
RecipeAdvancedPlate rec = null;
for(RecipeAdvancedPlate recipe : AdvancedBotanyAPI.advancedPlateRecipes) {
if(stack != null && recipe.getOutput() != null && recipe.getOutput().isItemEqual(stack)) {
rec = recipe;
break;
}
}
if(rec == null)
entry.pages.remove(this);
recipe = rec;
}
public void onPageAdded(LexiconEntry entry, int index) {
LexiconRecipeMappings.map(recipe.getOutput(), entry, index);
}
@SideOnly(Side.CLIENT)
public void renderRecipe(IGuiLexiconEntry gui, int mx, int my) {
TextureManager render = (Minecraft.getMinecraft()).renderEngine;
renderItemAtGridPos(gui, 3, 0, recipe.getOutput(), false);
renderItemAtGridPos(gui, 2, 1, new ItemStack(BlockListAB.blockABPlate), false);
List<ItemStack> inputs = recipe.getInputs();
int degreePerInput = (int)(360.0F / inputs.size());
float currentDegree = ConfigHandler.lexiconRotatingItems ? (GuiScreen.isShiftKeyDown() ? this.ticksElapsed : (this.ticksElapsed + ClientTickHandler.partialTicks)) : 0.0F;
for (ItemStack obj : inputs) {
ItemStack copy = obj.copy();
if (copy.getItemDamage() == 32767)
copy.setItemDamage(0);
renderItemAtAngle(gui, currentDegree, copy);
currentDegree += degreePerInput;
}
renderManaBar(gui, mx, my);
render.bindTexture(plateOverlay);
GL11.glEnable(3042);
GL11.glBlendFunc(770, 771);
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
((GuiScreen)gui).drawTexturedModalRect(gui.getLeft(), gui.getTop(), 0, 0, gui.getWidth(), gui.getHeight());
GL11.glDisable(3042);
}
@SideOnly(Side.CLIENT)
public void renderManaBar(IGuiLexiconEntry gui, int mx, int my) {
FontRenderer font = (Minecraft.getMinecraft()).fontRenderer;
GL11.glEnable(3042);
GL11.glBlendFunc(770, 771);
String manaUsage = StatCollector.translateToLocal("botaniamisc.manaUsage");
font.drawString(manaUsage, gui.getLeft() + gui.getWidth() / 2 - font.getStringWidth(manaUsage) / 2, gui.getTop() + 105, 1711276032);
int x = gui.getLeft() + gui.getWidth() / 2 - 50;
int y = gui.getTop() + 120;
String stopStr = StatCollector.translateToLocal("botaniamisc.shiftToStopSpin");
ClientHelper.renderPoolManaBar(x, y - 5, 0x239ddc, 1.0f, this.recipe.getManaUsage());
boolean unicode = font.getUnicodeFlag();
font.setUnicodeFlag(true);
font.drawString(stopStr, x + 49 - font.getStringWidth(stopStr) / 2, y + 18, -1728053248);
font.setUnicodeFlag(unicode);
GL11.glDisable(3042);
}
@SideOnly(Side.CLIENT)
public void updateScreen() {
if (GuiScreen.isShiftKeyDown())
return;
this.ticksElapsed++;
}
public List<ItemStack> getDisplayedRecipes() {
ArrayList<ItemStack> list = new ArrayList<ItemStack>();
list.add(recipe.getOutput());
return list;
}
}
@@ -0,0 +1,100 @@
package ab.common.lib.register;
import ab.common.block.BlockABSpreader;
import ab.common.block.BlockABStorage;
import ab.common.block.BlockAgglomerationPlate;
import ab.common.block.BlockAntigravitation;
import ab.common.block.BlockEngineerHopper;
import ab.common.block.BlockFreyrLiana;
import ab.common.block.BlockLebethronWood;
import ab.common.block.BlockLuminousFreyrLiana;
import ab.common.block.BlockManaCharger;
import ab.common.block.BlockManaContainer;
import ab.common.block.BlockManaCrystalCube;
import ab.common.block.BlockTerraFarmland;
import ab.common.block.tile.TileABSpreader;
import ab.common.block.tile.TileAgglomerationPlate;
import ab.common.block.tile.TileEngineerHopper;
import ab.common.block.tile.TileLebethronCore;
import ab.common.block.tile.TileManaCharger;
import ab.common.block.tile.TileManaContainer;
import ab.common.block.tile.TileManaCrystalCube;
import ab.common.item.block.ItemBlockBase;
import cpw.mods.fml.common.registry.GameRegistry;
import net.minecraft.block.Block;
public class BlockListAB {
public static Block blockABSpreader;
public static Block blockABPlate;
public static Block blockLebethron;
public static Block blockManaContainer;
public static Block blockABStorage;
public static Block blockManaCrystalCube;
public static Block blockTerraFarmland;
public static Block blockAntigravitation;
public static Block blockManaCharger;
public static Block blockEngineerHopper;
public static Block blockFreyrLiana;
public static Block blockLuminousFreyrLiana;
public static int blockABSpreaderRI;
public static int blockManaContainerRI;
public static int blockManaCrystalCubeRI;
public static int blockManaChargerRI;
public static int blockEngineerHopperRI;
public static void init() {
initializeBlocks();
registerBlocks();
registerTileEntities();
}
private static void initializeBlocks() {
BlockListAB.blockABSpreader = new BlockABSpreader();
BlockListAB.blockABPlate = new BlockAgglomerationPlate();
BlockListAB.blockLebethron = new BlockLebethronWood();
BlockListAB.blockManaContainer = new BlockManaContainer();
BlockListAB.blockABStorage = new BlockABStorage();
BlockListAB.blockManaCrystalCube = new BlockManaCrystalCube();
BlockListAB.blockTerraFarmland = new BlockTerraFarmland();
BlockListAB.blockAntigravitation = new BlockAntigravitation();
BlockListAB.blockManaCharger = new BlockManaCharger();
BlockListAB.blockEngineerHopper = new BlockEngineerHopper();
BlockListAB.blockLuminousFreyrLiana = new BlockLuminousFreyrLiana();
BlockListAB.blockFreyrLiana = new BlockFreyrLiana();
}
private static void registerBlocks() {
GameRegistry.registerBlock(BlockListAB.blockABSpreader, "blockABSpreader");
GameRegistry.registerBlock(BlockListAB.blockABPlate, "blockABPlate");
GameRegistry.registerBlock(BlockListAB.blockManaContainer, ItemBlockBase.class, "blockManaContainer");
GameRegistry.registerBlock(BlockListAB.blockLebethron, ItemBlockBase.class, "blockLebethron");
GameRegistry.registerBlock(BlockListAB.blockABStorage, ItemBlockBase.class, "blockABStorage");
GameRegistry.registerBlock(BlockListAB.blockManaCrystalCube, "blockManaCrystalCube");
GameRegistry.registerBlock(BlockListAB.blockTerraFarmland, "blockTerraFarmland");
GameRegistry.registerBlock(BlockListAB.blockAntigravitation, "blockAntigravitation");
GameRegistry.registerBlock(BlockListAB.blockManaCharger, "blockManaCharger");
GameRegistry.registerBlock(BlockListAB.blockEngineerHopper, "blockEngineerHopper");
GameRegistry.registerBlock(BlockListAB.blockFreyrLiana, "blockFreyrLiana");
GameRegistry.registerBlock(BlockListAB.blockLuminousFreyrLiana, "blockLuminousFreyrLiana");
}
private static void registerTileEntities() {
GameRegistry.registerTileEntity(TileABSpreader.class, "tileABSpreader");
GameRegistry.registerTileEntity(TileAgglomerationPlate.class, "tileAgglomerationPlate");
GameRegistry.registerTileEntity(TileLebethronCore.class, "tileLebethronCore");
GameRegistry.registerTileEntity(TileManaContainer.class, "tileManaContainer");
GameRegistry.registerTileEntity(TileManaCrystalCube.class, "tileManaCrystalCube");
GameRegistry.registerTileEntity(TileManaCharger.class, "tileManaCharger");
GameRegistry.registerTileEntity(TileEngineerHopper.class, "tileEngineerHopper");
}
static {
BlockListAB.blockABSpreaderRI = -1;
BlockListAB.blockManaContainerRI = -1;
BlockListAB.blockManaCrystalCubeRI = -1;
BlockListAB.blockManaChargerRI = -1;
BlockListAB.blockEngineerHopperRI = -1;
}
}
@@ -0,0 +1,121 @@
package ab.api.recipe.lexicon;
import java.util.ArrayList;
import java.util.List;
import org.lwjgl.opengl.GL11;
import ab.api.AdvancedBotanyAPI;
import ab.api.recipe.RecipeAdvancedPlate;
import ab.client.core.ClientHelper;
import ab.common.lib.register.BlockListAB;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.FontRenderer;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.client.renderer.texture.TextureManager;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.StatCollector;
import vazkii.botania.api.internal.IGuiLexiconEntry;
import vazkii.botania.api.lexicon.LexiconEntry;
import vazkii.botania.api.lexicon.LexiconRecipeMappings;
import vazkii.botania.client.core.handler.ClientTickHandler;
import vazkii.botania.client.core.handler.HUDHandler;
import vazkii.botania.common.core.handler.ConfigHandler;
import vazkii.botania.common.lexicon.page.PageRecipe;
public class AdvancedPlateCraftPage extends PageRecipe {
private static final ResourceLocation plateOverlay = new ResourceLocation("botania:textures/gui/petalOverlay.png");
private RecipeAdvancedPlate recipe;
private ItemStack resultStack;
int ticksElapsed = 0;
public AdvancedPlateCraftPage(LexiconEntry entry, ItemStack stack) {
this(entry, stack, "");
}
public AdvancedPlateCraftPage(LexiconEntry entry, ItemStack stack, String str) {
super(".abCraft" + str);
resultStack = stack;
refreshRecipe(entry, stack);
}
public ItemStack getResult() {
return resultStack;
}
public void refreshRecipe(LexiconEntry entry, ItemStack stack) {
RecipeAdvancedPlate rec = null;
for(RecipeAdvancedPlate recipe : AdvancedBotanyAPI.advancedPlateRecipes) {
if(stack != null && recipe.getOutput() != null && recipe.getOutput().isItemEqual(stack)) {
rec = recipe;
break;
}
}
if(rec == null)
entry.pages.remove(this);
recipe = rec;
}
public void onPageAdded(LexiconEntry entry, int index) {
LexiconRecipeMappings.map(recipe.getOutput(), entry, index);
}
@SideOnly(Side.CLIENT)
public void renderRecipe(IGuiLexiconEntry gui, int mx, int my) {
TextureManager render = (Minecraft.getMinecraft()).renderEngine;
renderItemAtGridPos(gui, 3, 0, recipe.getOutput(), false);
renderItemAtGridPos(gui, 2, 1, new ItemStack(BlockListAB.blockABPlate), false);
List<ItemStack> inputs = recipe.getInputs();
int degreePerInput = (int)(360.0F / inputs.size());
float currentDegree = ConfigHandler.lexiconRotatingItems ? (GuiScreen.isShiftKeyDown() ? this.ticksElapsed : (this.ticksElapsed + ClientTickHandler.partialTicks)) : 0.0F;
for (ItemStack obj : inputs) {
ItemStack copy = obj.copy();
if (copy.getItemDamage() == 32767)
copy.setItemDamage(0);
renderItemAtAngle(gui, currentDegree, copy);
currentDegree += degreePerInput;
}
renderManaBar(gui, mx, my);
render.bindTexture(plateOverlay);
GL11.glEnable(3042);
GL11.glBlendFunc(770, 771);
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
((GuiScreen)gui).drawTexturedModalRect(gui.getLeft(), gui.getTop(), 0, 0, gui.getWidth(), gui.getHeight());
GL11.glDisable(3042);
}
@SideOnly(Side.CLIENT)
public void renderManaBar(IGuiLexiconEntry gui, int mx, int my) {
FontRenderer font = (Minecraft.getMinecraft()).fontRenderer;
GL11.glEnable(3042);
GL11.glBlendFunc(770, 771);
String manaUsage = StatCollector.translateToLocal("botaniamisc.manaUsage");
font.drawString(manaUsage, gui.getLeft() + gui.getWidth() / 2 - font.getStringWidth(manaUsage) / 2, gui.getTop() + 105, 1711276032);
int x = gui.getLeft() + gui.getWidth() / 2 - 50;
int y = gui.getTop() + 120;
String stopStr = StatCollector.translateToLocal("botaniamisc.shiftToStopSpin");
ClientHelper.renderPoolManaBar(x, y - 5, 0x239ddc, 1.0f, this.recipe.getManaUsage());
boolean unicode = font.getUnicodeFlag();
font.setUnicodeFlag(true);
font.drawString(stopStr, x + 49 - font.getStringWidth(stopStr) / 2, y + 18, -1728053248);
font.setUnicodeFlag(unicode);
GL11.glDisable(3042);
}
@SideOnly(Side.CLIENT)
public void updateScreen() {
if (GuiScreen.isShiftKeyDown())
return;
this.ticksElapsed++;
}
public List<ItemStack> getDisplayedRecipes() {
ArrayList<ItemStack> list = new ArrayList<ItemStack>();
list.add(recipe.getOutput());
return list;
}
}
@@ -0,0 +1,79 @@
package ab.common.core;
import java.io.File;
import ab.AdvancedBotany;
import cpw.mods.fml.client.event.ConfigChangedEvent;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.common.config.Configuration;
import net.minecraftforge.common.config.Property;
public class ConfigABHandler {
public static Configuration config;
public static boolean useManaChargerAnimation = true;
public static int maxContainerMana = 64000000;
public static double protectionFactorNebula = 1.0f;
public static double damageFactorSpaceSword = 1.0f;
public static int nebulaWandCooldownTick = 18;
public static boolean hasManaCharger = true;
public static boolean hasAbPlate = true;
public static void loadConfig(File configFile) {
config = new Configuration(configFile);
config.load();
load();
FMLCommonHandler.instance().bus().register(new ChangeListener());
}
public static void load() {
String desc = "Maximum mana capacity for Mana Container (Diluted Mana Container will receive an eighth of the set value)";
maxContainerMana = loadPropInt("Mana Container capacity", desc, maxContainerMana);
desc = "Activating the charging animation for the Mana Charger";
useManaChargerAnimation = loadPropBool("Mana Charger lighting", desc, useManaChargerAnimation);
desc = "Protection factor for nebula armour";
protectionFactorNebula = loadPropDouble("Nebula Armor Protection Factor", desc, protectionFactorNebula);
desc = "Damage factor for Space Blade";
damageFactorSpaceSword = loadPropDouble("Space Sword Damage Factor", desc, damageFactorSpaceSword);
desc = "The number of ticks needed to restore 1 unit of the Rod of Nebula strength.";
nebulaWandCooldownTick = loadPropInt("Rod of Nebula Cooldown", desc, nebulaWandCooldownTick);
desc = "Switching the Mana Charger on or off in the game";
hasManaCharger = loadPropBool("Enable Mana Charger", desc, hasManaCharger);
desc = "Enables or disables Advanced Agglomeration Plate in the game. When switched off, you need to set up recipes, for resources";
hasAbPlate = loadPropBool("Enable Adv. Agg. Plate", desc, hasAbPlate);
if(config.hasChanged())
config.save();
}
public static void loadPostInit() {
if(config.hasChanged())
config.save();
}
public static boolean loadPropBool(String propName, String desc, boolean default_) {
Property prop = config.get("general", propName, default_);
prop.comment = desc;
return prop.getBoolean(default_);
}
public static int loadPropInt(String propName, String desc, int default_) {
Property prop = config.get("general", propName, default_);
prop.comment = desc;
return prop.getInt(default_);
}
public static double loadPropDouble(String propName, String desc, double default_) {
Property prop = config.get("general", propName, default_);
prop.comment = desc;
return prop.getDouble(default_);
}
public static class ChangeListener {
@SubscribeEvent
public void onConfigChanged(ConfigChangedEvent.OnConfigChangedEvent eventArgs) {
if(eventArgs.modID.equals(AdvancedBotany.modid))
ConfigABHandler.load();
}
}
}
@@ -0,0 +1,260 @@
package ab.common.lib.register;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import ab.api.AdvancedBotanyAPI;
import ab.api.recipe.RecipeAdvancedPlate;
import ab.api.recipe.RecipeAncientAlphirine;
import ab.api.recipe.lexicon.AdvancedPlateCraftPage;
import ab.api.recipe.lexicon.AlphirineCraftPage;
import ab.common.block.tile.TileAgglomerationPlate;
import ab.common.block.tile.TileLebethronCore;
import ab.common.block.tile.TileMagicCraftCrate;
import ab.common.item.ItemCraftingPattern;
import cpw.mods.fml.common.registry.GameRegistry;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.CraftingManager;
import net.minecraft.item.crafting.IRecipe;
import net.minecraft.util.EnumChatFormatting;
import net.minecraftforge.oredict.ShapedOreRecipe;
import net.minecraftforge.oredict.ShapelessOreRecipe;
import thaumcraft.common.config.ConfigBlocks;
import thaumcraft.common.config.ConfigItems;
import vazkii.botania.api.BotaniaAPI;
import vazkii.botania.api.lexicon.KnowledgeType;
import vazkii.botania.api.lexicon.LexiconCategory;
import vazkii.botania.api.lexicon.LexiconEntry;
import vazkii.botania.api.lexicon.LexiconPage;
import vazkii.botania.api.recipe.RecipePetals;
import vazkii.botania.common.Botania;
import vazkii.botania.common.block.ModBlocks;
import vazkii.botania.common.item.ModItems;
import vazkii.botania.common.item.block.ItemBlockSpecialFlower;
import vazkii.botania.common.lexicon.BLexiconCategory;
import vazkii.botania.common.lexicon.BLexiconEntry;
import vazkii.botania.common.lexicon.page.PageText;
public class RecipeListAB {
public static LexiconCategory categoryForgotten;
public static RecipeAncientAlphirine lebethroneRecipe;
public static RecipeAncientAlphirine forgottenLandRecipe;
public static RecipeAncientAlphirine advancedSparkRecipe;
public static RecipeAncientAlphirine manaFlowerRecipe;
public static RecipeAncientAlphirine slingshotRecipe;
public static RecipeAncientAlphirine hopperRecipe;
public static RecipeAdvancedPlate manaStarRecipe;
public static RecipeAdvancedPlate terrasteelRecipe;
public static RecipeAdvancedPlate mithrillRecipe;
public static RecipeAdvancedPlate nebulaRecipe;
public static RecipePetals alphirineRecipe;
public static RecipePetals dictariusRecipe;
public static RecipePetals aspecolusRecipe;
public static RecipePetals pureGladRecipe;
public static LexiconEntry advandedAgglomerationPlate;
public static LexiconEntry ancientAlphirine;
public static LexiconEntry lebethronWood;
public static LexiconEntry lebethronSpreader;
public static LexiconEntry mithrill;
public static LexiconEntry manaContainer;
public static LexiconEntry manaCrystalCube;
public static LexiconEntry terraHoe;
public static LexiconEntry manaRings;
public static LexiconEntry manaFlower;
public static LexiconEntry mithrillSword;
public static LexiconEntry nebula;
public static LexiconEntry blackHalo;
public static LexiconEntry antigravityCharm;
public static LexiconEntry nebulaBlaze;
public static LexiconEntry aspecolus;
public static LexiconEntry dictarius;
public static LexiconEntry manaCharger;
public static LexiconEntry nebulaArmor;
public static LexiconEntry freyrSlingshot;
public static LexiconEntry engineerHopper;
public static LexiconEntry nebulaRod;
public static LexiconEntry thaumAutoCraft;
public static LexiconEntry gladious;
public static KnowledgeType forgotten;
public static void init() {
BotaniaAPI.addCategory(categoryForgotten = new BLexiconCategory("forgotten", 5));
forgotten = BotaniaAPI.registerKnowledgeType("ab_forgotten", EnumChatFormatting.BLUE, false);
lebethroneRecipe = AdvancedBotanyAPI.registerAlphirineRecipe(new ItemStack(BlockListAB.blockLebethron), new ItemStack(ModBlocks.dreamwood, 1, 0), 15);
forgottenLandRecipe = AdvancedBotanyAPI.registerAlphirineRecipe(new ItemStack(ItemListAB.itemABResource, 1, 3), new ItemStack(ModItems.manaResource, 1, 15), 75);
advancedSparkRecipe = AdvancedBotanyAPI.registerAlphirineRecipe(new ItemStack(ItemListAB.itemAdvancedSpark), new ItemStack(ModItems.spark), 11);
manaFlowerRecipe = AdvancedBotanyAPI.registerAlphirineRecipe(new ItemStack(ItemListAB.itemABResource, 1, 4), new ItemStack(ModBlocks.flower, 1, 32767), 32);
slingshotRecipe = AdvancedBotanyAPI.registerAlphirineRecipe(new ItemStack(ItemListAB.itemFreyrSlingshot), new ItemStack(ModItems.slingshot), 66);
hopperRecipe = AdvancedBotanyAPI.registerAlphirineRecipe(new ItemStack(BlockListAB.blockEngineerHopper), new ItemStack(Blocks.hopper), 23);
mithrillRecipe = AdvancedBotanyAPI.registerAdvancedPlateRecipe(new ItemStack(ItemListAB.itemABResource, 1, 0), new ItemStack(ModItems.manaResource, 1, 5), new ItemStack(ModBlocks.storage, 1, 0), new ItemStack(ModItems.manaResource, 1, 18), 7500000, 0x25d6b7);
terrasteelRecipe = AdvancedBotanyAPI.registerAdvancedPlateRecipe(new ItemStack(ModItems.manaResource, 1, 4), new ItemStack(ModItems.manaResource, 1, 2), new ItemStack(ModItems.manaResource, 1, 0), new ItemStack(ModItems.manaResource, 1, 1), 500000, 0x29de20);
manaStarRecipe = AdvancedBotanyAPI.registerAdvancedPlateRecipe(new ItemStack(ItemListAB.itemABResource, 1, 2), new ItemStack(ModItems.manaResource, 1, 23), new ItemStack(ModItems.manaResource, 1, 5), new ItemStack(Items.nether_star), 250000, 0x6bc9ec);
nebulaRecipe = AdvancedBotanyAPI.registerAdvancedPlateRecipe(new ItemStack(ItemListAB.itemABResource, 1, 5), new ItemStack(ModItems.manaResource, 1, 8), new ItemStack(ModBlocks.storage, 1, 4), new ItemStack(ItemListAB.itemABResource, 1, 1), 50000000, 0x8d16e0);
ancientAlphirine = new BLexiconEntry("ancientAlphirine", categoryForgotten);
alphirineRecipe = BotaniaAPI.registerPetalRecipe(ItemBlockSpecialFlower.ofType("ancientAlphirine"), new ItemStack(ModItems.manaResource, 1, 5), new ItemStack(ModItems.manaResource, 1, 5), new ItemStack(ModItems.manaResource, 1, 5), new ItemStack(ModItems.manaResource, 1, 5), new ItemStack(ModItems.rune, 1, 8), new ItemStack(ModItems.rune, 1, 4), new ItemStack(ModItems.rune, 1, 5), new ItemStack(ModItems.rune, 1, 6), new ItemStack(ModItems.rune, 1, 7), new ItemStack(ModItems.petal, 1, 1), new ItemStack(ModItems.petal, 1, 4));
ancientAlphirine.setPriority().setKnowledgeType(BotaniaAPI.elvenKnowledge).setLexiconPages(new LexiconPage[] { new PageText("0"), new PageText("1"), BotaniaAPI.internalHandler.petalRecipePage(".petalCraft", alphirineRecipe), new AlphirineCraftPage(forgottenLandRecipe) }).setIcon(ItemBlockSpecialFlower.ofType("ancientAlphirine"));
GameRegistry.addShapedRecipe(new ItemStack(BlockListAB.blockABPlate), new Object[] { " ", "MPM", "BRB", Character.valueOf('M'), new ItemStack(ModBlocks.storage), Character.valueOf('P'), new ItemStack(ModBlocks.terraPlate), Character.valueOf('B'), new ItemStack(ItemListAB.itemABResource, 1, 3), Character.valueOf('R'), new ItemStack(ModItems.rune, 1, 3)});
advandedAgglomerationPlate = new BLexiconEntry("advancedPlate", categoryForgotten);
advandedAgglomerationPlate.setKnowledgeType(forgotten).setLexiconPages(new LexiconPage[] {new PageText("0"), BotaniaAPI.internalHandler.craftingRecipePage(".craft", getLastRecipe()), BotaniaAPI.internalHandler.multiblockPage(".structure", TileAgglomerationPlate.makeMultiblockSet()), new AdvancedPlateCraftPage(terrasteelRecipe, "0"), new AdvancedPlateCraftPage(manaStarRecipe, "1") }).setIcon(new ItemStack(BlockListAB.blockABPlate));
GameRegistry.addShapedRecipe(new ItemStack(BlockListAB.blockABSpreader), new Object[] { "WMW", "PSP", "WMW", Character.valueOf('M'), new ItemStack(ItemListAB.itemABResource, 1, 2), Character.valueOf('P'), new ItemStack(ModBlocks.pylon), Character.valueOf('S'), new ItemStack(ModBlocks.spreader, 1, 3), Character.valueOf('W'), new ItemStack(BlockListAB.blockLebethron, 1, 4)});
lebethronSpreader = new BLexiconEntry("lebethronSpreader", categoryForgotten);
lebethronSpreader.setKnowledgeType(forgotten).setLexiconPages(new LexiconPage[] { new PageText("0"), BotaniaAPI.internalHandler.craftingRecipePage(".craft", getLastRecipe()) }).setIcon(new ItemStack(BlockListAB.blockABSpreader));
addShapelessOreDictRecipe(new ItemStack(BlockListAB.blockLebethron, 4, 1), new Object[] { new ItemStack(BlockListAB.blockLebethron)});
IRecipe leb1 = getLastRecipe();
addShapelessOreDictRecipe(new ItemStack(BlockListAB.blockLebethron, 1, 2), new Object[] { new ItemStack(BlockListAB.blockLebethron, 1, 1), new ItemStack(Items.wheat_seeds)});
IRecipe leb2 = getLastRecipe();
addShapelessOreDictRecipe(new ItemStack(BlockListAB.blockLebethron, 1, 3), new Object[] { new ItemStack(BlockListAB.blockLebethron), new ItemStack(Items.glowstone_dust)});
IRecipe leb3 = getLastRecipe();
GameRegistry.addShapedRecipe(new ItemStack(BlockListAB.blockLebethron, 1, 4), new Object[] { "4W5", "WPW", "6W7", Character.valueOf('P'), new ItemStack(ModBlocks.pylon, 1, 1), Character.valueOf('W'), new ItemStack(BlockListAB.blockLebethron), Character.valueOf('4'), new ItemStack(ModItems.rune, 1, 4), Character.valueOf('5'), new ItemStack(ModItems.rune, 1, 5), Character.valueOf('6'), new ItemStack(ModItems.rune, 1, 6), Character.valueOf('7'), new ItemStack(ModItems.rune, 1, 7)});
IRecipe leb4 = getLastRecipe();
lebethronWood = new BLexiconEntry("lebethronWood", categoryForgotten);
lebethronWood.setKnowledgeType(forgotten).setLexiconPages(new LexiconPage[] { new PageText("0"), new AlphirineCraftPage(lebethroneRecipe), BotaniaAPI.internalHandler.craftingRecipePage(".craft0", leb1), BotaniaAPI.internalHandler.craftingRecipePage(".craft0", leb2), BotaniaAPI.internalHandler.craftingRecipePage(".craft0", leb3), BotaniaAPI.internalHandler.craftingRecipePage(".craft0", leb4), new PageText("1"), BotaniaAPI.internalHandler.multiblockPage(".structure", TileLebethronCore.makeMultiblockSet()) }).setIcon(new ItemStack(BlockListAB.blockLebethron));
GameRegistry.addShapedRecipe(new ItemStack(ItemListAB.itemMihrillMultiTool), new Object[] { " MB", " FM", "F ", Character.valueOf('F'), new ItemStack(ModItems.manaResource, 1, 3), Character.valueOf('B'), new ItemStack(ModBlocks.livingwood), Character.valueOf('M'), new ItemStack(ItemListAB.itemABResource)});
mithrill = new BLexiconEntry("mithrill", categoryForgotten);
mithrill.setKnowledgeType(forgotten).setLexiconPages(new LexiconPage[] { new PageText("0"), new AdvancedPlateCraftPage(mithrillRecipe), new PageText("1"), BotaniaAPI.internalHandler.craftingRecipePage(".craft", getLastRecipe()) }).setIcon(new ItemStack(ItemListAB.itemMihrillMultiTool));
GameRegistry.addShapedRecipe(new ItemStack(BlockListAB.blockManaContainer), new Object[] { "MGM", "LPL", "M3M", Character.valueOf('M'), new ItemStack(ItemListAB.itemABResource), Character.valueOf('L'), new ItemStack(ModBlocks.pool), Character.valueOf('P'), new ItemStack(ModBlocks.pylon), Character.valueOf('3'), new ItemStack(ModItems.rune, 1, 3), Character.valueOf('G'), new ItemStack(ModItems.rune, 1, 15)});
IRecipe cont1 = getLastRecipe();
GameRegistry.addShapedRecipe(new ItemStack(BlockListAB.blockManaContainer, 1, 1), new Object[] { "MGM", "LPL", "M3M", Character.valueOf('M'), new ItemStack(ItemListAB.itemABResource, 1, 1), Character.valueOf('L'), new ItemStack(ModBlocks.pool, 1, 2), Character.valueOf('P'), new ItemStack(ModBlocks.pylon), Character.valueOf('3'), new ItemStack(ModItems.rune, 1, 3), Character.valueOf('G'), new ItemStack(ModItems.rune, 1, 15)});
IRecipe cont2 = getLastRecipe();
GameRegistry.addShapedRecipe(new ItemStack(BlockListAB.blockManaContainer, 1, 2), new Object[] { "MGM", "LPL", "M3M", Character.valueOf('M'), new ItemStack(ItemListAB.itemABResource), Character.valueOf('L'), new ItemStack(ModBlocks.pool, 1, 3), Character.valueOf('P'), new ItemStack(ModBlocks.pylon), Character.valueOf('3'), new ItemStack(ModItems.rune, 1, 3), Character.valueOf('G'), new ItemStack(ModItems.rune, 1, 15)});
IRecipe cont3 = getLastRecipe();
manaContainer = new BLexiconEntry("manaContainer", categoryForgotten);
manaContainer.setKnowledgeType(forgotten).setLexiconPages(new LexiconPage[] { new PageText("0"), BotaniaAPI.internalHandler.craftingRecipePage(".craft0", cont1), BotaniaAPI.internalHandler.craftingRecipePage(".craft1", cont2), BotaniaAPI.internalHandler.craftingRecipePage(".craft2", cont3), new PageText("1"), new AlphirineCraftPage(advancedSparkRecipe) }).setIcon(new ItemStack(BlockListAB.blockManaContainer));
GameRegistry.addShapedRecipe(new ItemStack(BlockListAB.blockManaCrystalCube), new Object[] { "TST", "GWG", "DMD", Character.valueOf('D'), new ItemStack(ModBlocks.dreamwood), Character.valueOf('W'), new ItemStack(ModItems.twigWand, 1, 32767), Character.valueOf('G'), new ItemStack(ModBlocks.manaGlass), Character.valueOf('M'), new ItemStack(ModItems.manaResource), Character.valueOf('T'), new ItemStack(ModItems.manaResource, 1, 18), Character.valueOf('S'), new ItemStack(ModItems.spark)});
manaCrystalCube = new BLexiconEntry("manaCrystalCube", BotaniaAPI.categoryMana);
manaCrystalCube.setKnowledgeType(BotaniaAPI.elvenKnowledge).setLexiconPages(new LexiconPage[] { new PageText("0"), BotaniaAPI.internalHandler.craftingRecipePage(".craft", getLastRecipe()) }).setIcon(new ItemStack(BlockListAB.blockManaCrystalCube));
GameRegistry.addShapedRecipe(new ItemStack(ItemListAB.itemTerraHoe), new Object[] { "TTL", "RW ", " W ", Character.valueOf('T'), new ItemStack(ModItems.manaResource, 1, 4), Character.valueOf('L'), new ItemStack(ModItems.manaResource, 1, 18), Character.valueOf('W'), new ItemStack(ModItems.manaResource, 1, 3), Character.valueOf('R'), new ItemStack(ModItems.rune, 1, 2)});
terraHoe = new BLexiconEntry("terraHoe", BotaniaAPI.categoryTools);
terraHoe.setLexiconPages(new LexiconPage[]{ new PageText("0"), BotaniaAPI.internalHandler.craftingRecipePage(".craft", getLastRecipe()) }).setIcon(new ItemStack(ItemListAB.itemTerraHoe));
GameRegistry.addShapedRecipe(new ItemStack(ItemListAB.itemMithrillRing), new Object[] { "LML", "MRM", "LML", Character.valueOf('M'), new ItemStack(ItemListAB.itemABResource), Character.valueOf('L'), new ItemStack(ItemListAB.itemABResource, 1, 1), Character.valueOf('R'), new ItemStack(ModItems.manaRingGreater)});
IRecipe ring1 = getLastRecipe();
GameRegistry.addShapedRecipe(new ItemStack(ItemListAB.itemNebulaRing), new Object[] { "LML", "MRM", "LML", Character.valueOf('M'), new ItemStack(ItemListAB.itemABResource, 1, 6), Character.valueOf('L'), new ItemStack(ModItems.manaResource, 1, 5), Character.valueOf('R'), new ItemStack(ItemListAB.itemMithrillRing)});
IRecipe ring2 = getLastRecipe();
manaRings = new BLexiconEntry("manaRings", categoryForgotten);
manaRings.setKnowledgeType(forgotten).setLexiconPages(new LexiconPage[]{ new PageText("0"), BotaniaAPI.internalHandler.craftingRecipePage(".craft0", ring1), BotaniaAPI.internalHandler.craftingRecipePage(".craft1", ring2)}).setIcon(new ItemStack(ItemListAB.itemMithrillRing));
AdvancedBotanyAPI.registerFarmlandSeed(Blocks.nether_wart, 3);
GameRegistry.addShapedRecipe(new ItemStack(ItemListAB.itemManaFlower), new Object[] { " F ", " M ", " R ", Character.valueOf('F'), new ItemStack(ItemListAB.itemABResource, 1, 4), Character.valueOf('M'), new ItemStack(ModItems.manaBottle), Character.valueOf('R'), new ItemStack(ModItems.rune, 1, 8)});
manaFlower = new BLexiconEntry("manaFlower", categoryForgotten);
manaFlower.setKnowledgeType(forgotten).setLexiconPages(new LexiconPage[] { new PageText("0"), new AlphirineCraftPage(manaFlowerRecipe), BotaniaAPI.internalHandler.craftingRecipePage(".craft", getLastRecipe())}).setIcon(new ItemStack(ItemListAB.itemManaFlower));
GameRegistry.addShapedRecipe(new ItemStack(ItemListAB.itemMithrillSword), new Object[] { " M", "SM ", "WS ", Character.valueOf('S'), new ItemStack(ItemListAB.itemABResource, 1, 6), Character.valueOf('T'), new ItemStack(ModItems.terraSword), Character.valueOf('M'), new ItemStack(ItemListAB.itemABResource), Character.valueOf('W'), new ItemStack(ModItems.manaResource, 1, 3)});
mithrillSword = new BLexiconEntry("mithrillSword", categoryForgotten);
mithrillSword.setKnowledgeType(forgotten).setLexiconPages(new LexiconPage[] { new PageText("0"), BotaniaAPI.internalHandler.craftingRecipePage(".craft", getLastRecipe()) }).setIcon(new ItemStack(ItemListAB.itemMithrillSword));
dictariusRecipe = BotaniaAPI.registerPetalRecipe(ItemBlockSpecialFlower.ofType("dictarius"), new ItemStack(ItemListAB.itemABResource, 1, 4), new ItemStack(ModItems.manaResource, 1, 5), new ItemStack(ModItems.manaResource, 1, 5), new ItemStack(ModItems.rune, 1, 15), new ItemStack(ModItems.petal, 1, 4), new ItemStack(ModItems.petal, 1, 4), new ItemStack(ModItems.petal, 1, 1));
dictarius = new BLexiconEntry("dictarius", BotaniaAPI.categoryGenerationFlowers);
dictarius.setKnowledgeType(forgotten).setLexiconPages(new LexiconPage[] { new PageText("0"), BotaniaAPI.internalHandler.petalRecipePage(".petalCraft", dictariusRecipe)});
nebula = new BLexiconEntry("nebula", categoryForgotten);
nebula.setKnowledgeType(forgotten).setLexiconPages(new LexiconPage[] { new PageText("0"), new AdvancedPlateCraftPage(nebulaRecipe)});
GameRegistry.addShapedRecipe(new ItemStack(ItemListAB.itemBlackHalo), new Object[] { " E ", "DHD", " E ", Character.valueOf('E'), new ItemStack(ModItems.manaResource, 1, 7), Character.valueOf('H'), new ItemStack(ModItems.autocraftingHalo), Character.valueOf('D'), new ItemStack(ModItems.blackHoleTalisman)});
blackHalo = new BLexiconEntry("blackHalo", BotaniaAPI.categoryTools);
blackHalo.setKnowledgeType(BotaniaAPI.elvenKnowledge).setLexiconPages(new LexiconPage[] { new PageText("0"), BotaniaAPI.internalHandler.craftingRecipePage(".craft", getLastRecipe())});
GameRegistry.addShapedRecipe(new ItemStack(ItemListAB.itemAntigravityCharm), new Object[] { " G ", "GDG", "ERE", Character.valueOf('E'), new ItemStack(ModItems.manaResource, 1, 7), Character.valueOf('G'), new ItemStack(ModBlocks.elfGlass), Character.valueOf('D'), new ItemStack(ModBlocks.floatingFlower, 1, 32767), Character.valueOf('R'), new ItemStack(ModItems.rune, 1, 3)});
antigravityCharm = new BLexiconEntry("antigravityCharm", BotaniaAPI.categoryTools);
antigravityCharm.setKnowledgeType(BotaniaAPI.elvenKnowledge).setLexiconPages(new LexiconPage[] { new PageText("0"), BotaniaAPI.internalHandler.craftingRecipePage(".craft", getLastRecipe())}).setIcon(new ItemStack(ItemListAB.itemAntigravityCharm));
GameRegistry.addShapedRecipe(new ItemStack(ItemListAB.itemNebulaBlaze), new Object[] { " N ", "MMN", "AMN", Character.valueOf('N'), new ItemStack(ItemListAB.itemABResource, 1, 6), Character.valueOf('A'), new ItemStack(ItemListAB.itemABResource, 1, 3), Character.valueOf('M'), new ItemStack(ModBlocks.storage)});
nebulaBlaze = new BLexiconEntry("nebulaBlaze", categoryForgotten);
nebulaBlaze.setKnowledgeType(forgotten).setLexiconPages(new LexiconPage[] { new PageText("0"), BotaniaAPI.internalHandler.craftingRecipePage(".craft", getLastRecipe())});
GameRegistry.addShapedRecipe(new ItemStack(BlockListAB.blockManaCharger), new Object[] { "NLN", "MPM", " R ", Character.valueOf('N'), new ItemStack(ItemListAB.itemABResource, 1, 1), Character.valueOf('L'), new ItemStack(ModBlocks.livingrock), Character.valueOf('M'), new ItemStack(ModBlocks.bellows), Character.valueOf('P'), new ItemStack(ModBlocks.pylon), Character.valueOf('R'), new ItemStack(ModItems.rune, 1, 8)});
manaCharger = new BLexiconEntry("manaCharger", categoryForgotten);
manaCharger.setKnowledgeType(forgotten).setLexiconPages(new LexiconPage[] { new PageText("0"), BotaniaAPI.internalHandler.craftingRecipePage(".craft", getLastRecipe())});
GameRegistry.addShapedRecipe(new ItemStack(ItemListAB.itemNebulaHelm), new Object[] { "RNR", "NHN", " E ", Character.valueOf('N'), new ItemStack(ItemListAB.itemABResource, 1, 5), Character.valueOf('R'), new ItemStack(ModItems.manaResource, 1, 7), Character.valueOf('H'), new ItemStack(ModItems.terrasteelHelm), Character.valueOf('E'), new ItemStack(ModItems.manaResource, 1, 8)});
IRecipe nHelm = getLastRecipe();
GameRegistry.addShapedRecipe(new ItemStack(ItemListAB.itemNebulaChest), new Object[] { "RTR", "NHN", "ENE", Character.valueOf('N'), new ItemStack(ItemListAB.itemABResource, 1, 5), Character.valueOf('R'), new ItemStack(ModItems.manaResource, 1, 7), Character.valueOf('H'), new ItemStack(ModItems.terrasteelChest), Character.valueOf('E'), new ItemStack(ModItems.manaResource, 1, 8), Character.valueOf('T'), new ItemStack(ModItems.flightTiara, 1, 32767)});
IRecipe nChest = getLastRecipe();
GameRegistry.addShapedRecipe(new ItemStack(ItemListAB.itemNebulaLegs), new Object[] { "ENE", "RHR", "NAN", Character.valueOf('N'), new ItemStack(ItemListAB.itemABResource, 1, 5), Character.valueOf('R'), new ItemStack(ModItems.manaResource, 1, 7), Character.valueOf('H'), new ItemStack(ModItems.terrasteelLegs), Character.valueOf('E'), new ItemStack(ModItems.manaResource, 1, 8), Character.valueOf('A'), new ItemStack(ItemListAB.itemABResource, 1, 3)});
IRecipe nLegs = getLastRecipe();
GameRegistry.addShapedRecipe(new ItemStack(ItemListAB.itemNebulaBoots), new Object[] { "RBR", "NHN", " E ", Character.valueOf('N'), new ItemStack(ItemListAB.itemABResource, 1, 5), Character.valueOf('R'), new ItemStack(ModItems.manaResource, 1, 7), Character.valueOf('H'), new ItemStack(ModItems.terrasteelBoots), Character.valueOf('E'), new ItemStack(ModItems.manaResource, 1, 8), Character.valueOf('B'), new ItemStack(ModItems.speedUpBelt)});
IRecipe nBoots = getLastRecipe();
nebulaArmor = new BLexiconEntry("nebulaArmor", categoryForgotten);
nebulaArmor.setKnowledgeType(forgotten).setLexiconPages(new LexiconPage[] { new PageText("0"), new PageText("1"), BotaniaAPI.internalHandler.craftingRecipePage(".craft", nHelm), BotaniaAPI.internalHandler.craftingRecipePage(".craft", nChest), BotaniaAPI.internalHandler.craftingRecipePage(".craft", nLegs), BotaniaAPI.internalHandler.craftingRecipePage(".craft", nBoots)});
freyrSlingshot = new BLexiconEntry("freyrSlingshot", categoryForgotten);
freyrSlingshot.setKnowledgeType(forgotten).setLexiconPages(new LexiconPage[] { new PageText("0"), new AlphirineCraftPage(slingshotRecipe)});
engineerHopper = new BLexiconEntry("engineerHopper", categoryForgotten);
engineerHopper.setKnowledgeType(forgotten).setLexiconPages(new LexiconPage[] { new PageText("0"), new AlphirineCraftPage(hopperRecipe)});
GameRegistry.addShapedRecipe(new ItemStack(ItemListAB.itemNebulaRod), new Object[] { " WN", " RW", "W ", Character.valueOf('W'), new ItemStack(ModItems.manaResource, 1, 13), Character.valueOf('R'), new ItemStack(ModItems.rune, 1, 8), Character.valueOf('N'), new ItemStack(ItemListAB.itemABResource, 1, 5)});
nebulaRod = new BLexiconEntry("nebulaRod", categoryForgotten);
nebulaRod.setKnowledgeType(forgotten).setLexiconPages(new LexiconPage[] { new PageText("0"), BotaniaAPI.internalHandler.craftingRecipePage(".craft", getLastRecipe())});
if(Botania.thaumcraftLoaded)
thaumcraft();
addShapelessOreDictRecipe(new ItemStack(ItemListAB.itemABResource, 9, 1), new Object[] { new ItemStack(ItemListAB.itemABResource)});
addShapelessOreDictRecipe(new ItemStack(ItemListAB.itemABResource, 9, 0), new Object[] { new ItemStack(BlockListAB.blockABStorage)});
addShapelessOreDictRecipe(new ItemStack(ItemListAB.itemABResource, 9, 6), new Object[] { new ItemStack(ItemListAB.itemABResource, 1, 5)});
GameRegistry.addShapedRecipe(new ItemStack(BlockListAB.blockABStorage), new Object[] { "III", "III", "III", Character.valueOf('I'), new ItemStack(ItemListAB.itemABResource)});
GameRegistry.addShapedRecipe(new ItemStack(ItemListAB.itemABResource, 1, 5), new Object[] { "III", "III", "III", Character.valueOf('I'), new ItemStack(ItemListAB.itemABResource, 1, 6)});
}
public static void thaumcraft() {
aspecolus = new BLexiconEntry("aspecolus", BotaniaAPI.categoryFunctionalFlowers);
aspecolusRecipe = BotaniaAPI.registerPetalRecipe(ItemBlockSpecialFlower.ofType("aspecolus"), new ItemStack(ModItems.manaResource, 1, 6), new ItemStack(ModItems.manaResource, 1, 5), new ItemStack(ModItems.rune, 1, 1), new ItemStack(ModItems.rune), new ItemStack(ItemListAB.itemABResource, 1, 2), new ItemStack(ModItems.petal, 1, 10), new ItemStack(ModItems.petal, 1, 13));
aspecolus.setKnowledgeType(forgotten).setLexiconPages(new LexiconPage[] { new PageText("0"), BotaniaAPI.internalHandler.petalRecipePage(".petalCraft", aspecolusRecipe) }).setIcon(ItemBlockSpecialFlower.ofType("aspecolus"));
addShapelessOreDictRecipe(new ItemStack(ItemListAB.itemNebulaHelmReveal), new Object[] { new ItemStack(ItemListAB.itemNebulaHelm), new ItemStack(ConfigItems.itemGoggles)});
List<IRecipe> recipes = new ArrayList<IRecipe>();
for(int i = 1; i < 10; i++) {
boolean[][] patterns = ItemCraftingPattern.getPattern(i);
List<String> str = new ArrayList<String>();
for(int j = 0; j < patterns.length; j++) {
String str1 = "";
for(int k = 0; k < patterns[j].length; k++)
str1 += patterns[j][k] ? "T" : "H";
str.add(str1);
}
GameRegistry.addShapedRecipe(new ItemStack(ItemListAB.itemCraftingPattern, 1, i), new Object[] { str.get(0), str.get(1), str.get(2), Character.valueOf('T'), new ItemStack(ItemListAB.itemCraftingPattern), Character.valueOf('H'), new ItemStack(ConfigItems.itemNugget, 1, 6)});
recipes.add(getLastRecipe());
}
IRecipe crate = GameRegistry.addShapedRecipe(new ItemStack(BlockListAB.blockMagicCraftCrate), new Object[] { "TST", "WCW", "W W", Character.valueOf('W'), new ItemStack(ConfigBlocks.blockMagicalLog), Character.valueOf('S'), new ItemStack(ConfigItems.itemResource, 1, 14), Character.valueOf('T'), new ItemStack(ConfigItems.itemResource, 1, 7), Character.valueOf('C'), new ItemStack(ModBlocks.openCrate, 1, 1)});
addShapelessOreDictRecipe(new ItemStack(ItemListAB.itemCraftingPattern, 48), new Object[] { new ItemStack(Blocks.crafting_table), new ItemStack(ModBlocks.livingrock), new ItemStack(ConfigItems.itemResource, 1, 14)});
thaumAutoCraft = new BLexiconEntry("thaumAutoCraft", BotaniaAPI.categoryDevices);
thaumAutoCraft.setKnowledgeType(BotaniaAPI.elvenKnowledge).setLexiconPages(new LexiconPage[] { new PageText("0"), BotaniaAPI.internalHandler.craftingRecipePage(".craft", crate) , BotaniaAPI.internalHandler.craftingRecipePage(".craft0", getLastRecipe()), BotaniaAPI.internalHandler.craftingRecipesPage(".craft1", recipes)});
pureGladRecipe = BotaniaAPI.registerPetalRecipe(ItemBlockSpecialFlower.ofType("pureGladiolus"), new ItemStack(ItemListAB.itemABResource, 1, 4), new ItemStack(ModItems.rune, 1, 8), new ItemStack(ModItems.petal, 1, 8), new ItemStack(ModItems.petal, 1, 4), new ItemStack(ModItems.petal, 1, 14), new ItemStack(ModItems.petal, 1, 5), new ItemStack(ModItems.petal, 1, 13), new ItemStack(ModItems.petal, 1, 11));
gladious = new BLexiconEntry("gladious", BotaniaAPI.categoryFunctionalFlowers);
gladious.setKnowledgeType(forgotten).setLexiconPages(new LexiconPage[] { new PageText("0"), BotaniaAPI.internalHandler.petalRecipePage(".petalCraft", pureGladRecipe)});
}
private static IRecipe getLastRecipe() {
return (IRecipe)CraftingManager.getInstance().getRecipeList().get(CraftingManager.getInstance().getRecipeList().size() - 1);
}
private static void addOreDictRecipe(ItemStack output, Object... recipe) {
CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(output, recipe));
}
private static void addShapelessOreDictRecipe(ItemStack output, Object... recipe) {
CraftingManager.getInstance().getRecipeList().add(new ShapelessOreRecipe(output, recipe));
}
}
@@ -0,0 +1,133 @@
package ab.client.render.tile;
import java.util.Random;
import org.lwjgl.opengl.GL11;
import ab.common.block.BlockMagicCraftCrate;
import ab.common.block.tile.TileMagicCraftCrate;
import ab.common.lib.register.BlockListAB;
import net.minecraft.client.Minecraft;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelRenderer;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.entity.RenderItem;
import net.minecraft.client.renderer.entity.RenderManager;
import net.minecraft.client.renderer.texture.TextureMap;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.IIcon;
import net.minecraft.util.ResourceLocation;
import vazkii.botania.client.core.handler.ClientTickHandler;
public class RenderTileMagicCraftingCrate extends TileEntitySpecialRenderer {
private ModelCrateBook model = new ModelCrateBook();
public void renderTileEntityAt(TileEntity tile, double x, double y, double z, float fq) {
double time = (tile.getWorldObj() == null) ? 0.0D : (ClientTickHandler.ticksInGame + fq);
if(tile != null)
time += (new Random((tile.xCoord ^ tile.yCoord ^ tile.zCoord))).nextInt(360);
float f1 = 0.002f;
float f2 = 0.125f;
float f3 = 0.1875f;
float f4 = 0.25f;
TileMagicCraftCrate crate = (TileMagicCraftCrate) tile;
boolean[][] pattern = crate.getPattern();
GL11.glPushMatrix();
GL11.glEnable(GL11.GL_BLEND);
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationBlocksTexture);
Tessellator t = new Tessellator();
t.startDrawingQuads();
t.setColorRGBA_I(0xfc0195, 50);
IIcon icon = ((BlockMagicCraftCrate)BlockListAB.blockMagicCraftCrate).nothing;
float maxU = icon.getMaxU();
float maxV = icon.getMaxV();
float minU = icon.getMinU();
float minV = icon.getMinV();
boolean hasPattern = false;
for(int i = 0; i < 3; i++)
for(int j = 0; j < 3; j++) {
if(!pattern[i][j]) {
int i1 = 2 - i;
int j1 = 2 - j;
hasPattern = true;
t.addVertexWithUV(x + f4 + f3 * j1 + f2, y + 1 + f1, z + f4 + f3 * i1+ f2, maxU, maxV);
t.addVertexWithUV(x + f4 + f3 * j1 + f2, y + 1 + f1, z + f4 + f3 * i1, maxU, minV);
t.addVertexWithUV(x + f4 + f3 * j1, y + 1 + f1, z + f4 + f3 * i1, minU, minV);
t.addVertexWithUV(x + f4 + f3 * j1, y + 1 + f1, z + f4 + f3 * i1+ f2, minU, maxV);
float f0 = f2;
if(i == 0 && j == 1)
f0 = 0.0625f;
float minY = (float) (y + f4 + f3 * i1);
float maxY = minY + f0;
t.addVertexWithUV(x + f4 + f3 * j1, minY, z - f1, maxU, maxV);
t.addVertexWithUV(x + f4 + f3 * j1, maxY, z - f1, maxU, minV);
t.addVertexWithUV(x + f4 + f3 * j1 + f2, maxY, z - f1, minU, minV);
t.addVertexWithUV(x + f4 + f3 * j1 + f2, minY, z - f1, minU, maxV);
t.addVertexWithUV(x + 1 + f1, minY, z + f4 + f3 * j1, maxU, maxV);
t.addVertexWithUV(x + 1 + f1, maxY, z + f4 + f3 * j1, maxU, minV);
t.addVertexWithUV(x + 1 + f1, maxY, z + f4 + f3 * j1 + f2, minU, minV);
t.addVertexWithUV(x + 1 + f1, minY, z + f4 + f3 * j1 + f2, minU, maxV);
j1 = j;
t.addVertexWithUV(x - f1, minY, z + f4 + f3 * j1 + f2, maxU, maxV);
t.addVertexWithUV(x - f1, maxY, z + f4 + f3 * j1 + f2, maxU, minV);
t.addVertexWithUV(x - f1, maxY, z + f4 + f3 * j1, minU, minV);
t.addVertexWithUV(x - f1, minY, z + f4 + f3 * j1, minU, maxV);
t.addVertexWithUV(x + f4 + f3 * j1 + f2, minY, z + 1 + f1, maxU, maxV);
t.addVertexWithUV(x + f4 + f3 * j1 + f2, maxY, z + 1 + f1, maxU, minV);
t.addVertexWithUV(x + f4 + f3 * j1, maxY, z + 1 + f1, minU, minV);
t.addVertexWithUV(x + f4 + f3 * j1, minY, z + 1 + f1, minU, maxV);
}
}
t.draw();
GL11.glDisable(GL11.GL_BLEND);
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glPopMatrix();
ItemStack wand = crate.getStackInSlot(10);
if(wand != null) {
GL11.glPushMatrix();
GL11.glTranslated(x + 0.5f, y + 1.12f + (Math.sin(time / 24.0D) / 40.0D - 0.05D), z + 0.25f);
GL11.glRotated(Math.sin(time / 24.0D) * 5.0f, 0.0f, 1.0f, 0.0f);
GL11.glRotatef(90.0f, 0.0f, 0.0f, 1.0f);
EntityItem entity = new EntityItem(tile.getWorldObj(), 0, -0.125, 0, wand.copy());
entity.hoverStart = 0.0f;
RenderItem.renderInFrame = true;
RenderManager.instance.renderEntityWithPosYaw(entity, 0, -0.285, 0, 0.0f, 0.0f);
RenderItem.renderInFrame = false;
GL11.glPopMatrix();
}
ItemStack book = crate.getStackInSlot(11);
if(book != null) {
GL11.glPushMatrix();
GL11.glTranslated(x + 0.6735f, y + 0.825f + (Math.sin(-time / 24.0D) / 40.0D - 0.05D), z + 1.0f);
GL11.glRotatef(90.0f, 0.0f, 1.0f, 1.0f);
GL11.glRotated(Math.sin(-time / 24.0D) * 5.0f, 0.0f, 1.0f, 0.0f);
Minecraft.getMinecraft().renderEngine.bindTexture(model.texture);
model.render();
GL11.glPopMatrix();
}
}
public class ModelCrateBook extends ModelBase {
public final ResourceLocation texture = new ResourceLocation("thaumcraft:textures/models/fortress_armor.png");
private ModelRenderer Book;
public ModelCrateBook() {
textureWidth = 128;
textureHeight = 64;
Book = new ModelRenderer(this, 100, 8);
Book.addBox(1.0F, -0.3F, 4.0F, 5, 7, 2);
Book.setRotationPoint(0.0F, 0.0F, 0.0F);
Book.setTextureSize(128, 64);
}
public void render() {
Book.render(0.0625f);
}
}
}
@@ -0,0 +1,22 @@
package ab.common.block;
import ab.AdvancedBotany;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.world.World;
import vazkii.botania.common.block.ModBlocks;
public class BlockAlfTrapdoor extends Block {
public BlockAlfTrapdoor() {
super(Material.glass);
this.setCreativeTab(AdvancedBotany.tabAB);
this.setHardness(7.0F);
this.setBlockName("alfTrapdoor");
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.1875F, 1.0F);
}
public boolean canPlaceBlockAt(World world, int x, int y, int z) {
return world.getBlock(x, y, z) == ModBlocks.pool;
}
}
@@ -0,0 +1,260 @@
package ab.common.lib.register;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import ab.api.AdvancedBotanyAPI;
import ab.api.recipe.RecipeAdvancedPlate;
import ab.api.recipe.RecipeAncientAlphirine;
import ab.api.recipe.lexicon.AdvancedPlateCraftPage;
import ab.api.recipe.lexicon.AlphirineCraftPage;
import ab.common.block.tile.TileAgglomerationPlate;
import ab.common.block.tile.TileLebethronCore;
import ab.common.block.tile.TileMagicCraftCrate;
import ab.common.item.ItemCraftingPattern;
import cpw.mods.fml.common.registry.GameRegistry;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.CraftingManager;
import net.minecraft.item.crafting.IRecipe;
import net.minecraft.util.EnumChatFormatting;
import net.minecraftforge.oredict.ShapedOreRecipe;
import net.minecraftforge.oredict.ShapelessOreRecipe;
import thaumcraft.common.config.ConfigBlocks;
import thaumcraft.common.config.ConfigItems;
import vazkii.botania.api.BotaniaAPI;
import vazkii.botania.api.lexicon.KnowledgeType;
import vazkii.botania.api.lexicon.LexiconCategory;
import vazkii.botania.api.lexicon.LexiconEntry;
import vazkii.botania.api.lexicon.LexiconPage;
import vazkii.botania.api.recipe.RecipePetals;
import vazkii.botania.common.Botania;
import vazkii.botania.common.block.ModBlocks;
import vazkii.botania.common.item.ModItems;
import vazkii.botania.common.item.block.ItemBlockSpecialFlower;
import vazkii.botania.common.lexicon.BLexiconCategory;
import vazkii.botania.common.lexicon.BLexiconEntry;
import vazkii.botania.common.lexicon.page.PageText;
public class RecipeListAB {
public static LexiconCategory categoryForgotten;
public static RecipeAncientAlphirine lebethroneRecipe;
public static RecipeAncientAlphirine forgottenLandRecipe;
public static RecipeAncientAlphirine advancedSparkRecipe;
public static RecipeAncientAlphirine manaFlowerRecipe;
public static RecipeAncientAlphirine slingshotRecipe;
public static RecipeAncientAlphirine hopperRecipe;
public static RecipeAdvancedPlate manaStarRecipe;
public static RecipeAdvancedPlate terrasteelRecipe;
public static RecipeAdvancedPlate mithrillRecipe;
public static RecipeAdvancedPlate nebulaRecipe;
public static RecipePetals alphirineRecipe;
public static RecipePetals dictariusRecipe;
public static RecipePetals aspecolusRecipe;
public static RecipePetals pureGladRecipe;
public static LexiconEntry advandedAgglomerationPlate;
public static LexiconEntry ancientAlphirine;
public static LexiconEntry lebethronWood;
public static LexiconEntry lebethronSpreader;
public static LexiconEntry mithrill;
public static LexiconEntry manaContainer;
public static LexiconEntry manaCrystalCube;
public static LexiconEntry terraHoe;
public static LexiconEntry manaRings;
public static LexiconEntry manaFlower;
public static LexiconEntry mithrillSword;
public static LexiconEntry nebula;
public static LexiconEntry blackHalo;
public static LexiconEntry antigravityCharm;
public static LexiconEntry nebulaBlaze;
public static LexiconEntry aspecolus;
public static LexiconEntry dictarius;
public static LexiconEntry manaCharger;
public static LexiconEntry nebulaArmor;
public static LexiconEntry freyrSlingshot;
public static LexiconEntry engineerHopper;
public static LexiconEntry nebulaRod;
public static LexiconEntry thaumAutoCraft;
public static LexiconEntry gladious;
public static KnowledgeType forgotten;
public static void init() {
BotaniaAPI.addCategory(categoryForgotten = new BLexiconCategory("forgotten", 5));
forgotten = BotaniaAPI.registerKnowledgeType("ab_forgotten", EnumChatFormatting.BLUE, false);
lebethroneRecipe = AdvancedBotanyAPI.registerAlphirineRecipe(new ItemStack(BlockListAB.blockLebethron), new ItemStack(ModBlocks.dreamwood, 1, 0), 15);
forgottenLandRecipe = AdvancedBotanyAPI.registerAlphirineRecipe(new ItemStack(ItemListAB.itemABResource, 1, 3), new ItemStack(ModItems.manaResource, 1, 15), 75);
advancedSparkRecipe = AdvancedBotanyAPI.registerAlphirineRecipe(new ItemStack(ItemListAB.itemAdvancedSpark), new ItemStack(ModItems.spark), 11);
manaFlowerRecipe = AdvancedBotanyAPI.registerAlphirineRecipe(new ItemStack(ItemListAB.itemABResource, 1, 4), new ItemStack(ModBlocks.flower, 1, 32767), 32);
slingshotRecipe = AdvancedBotanyAPI.registerAlphirineRecipe(new ItemStack(ItemListAB.itemFreyrSlingshot), new ItemStack(ModItems.slingshot), 66);
hopperRecipe = AdvancedBotanyAPI.registerAlphirineRecipe(new ItemStack(BlockListAB.blockEngineerHopper), new ItemStack(Blocks.hopper), 23);
mithrillRecipe = AdvancedBotanyAPI.registerAdvancedPlateRecipe(new ItemStack(ItemListAB.itemABResource, 1, 0), new ItemStack(ModItems.manaResource, 1, 5), new ItemStack(ModBlocks.storage, 1, 0), new ItemStack(ModItems.manaResource, 1, 18), 7500000, 0x25d6b7);
terrasteelRecipe = AdvancedBotanyAPI.registerAdvancedPlateRecipe(new ItemStack(ModItems.manaResource, 1, 4), new ItemStack(ModItems.manaResource, 1, 2), new ItemStack(ModItems.manaResource, 1, 0), new ItemStack(ModItems.manaResource, 1, 1), 500000, 0x29de20);
manaStarRecipe = AdvancedBotanyAPI.registerAdvancedPlateRecipe(new ItemStack(ItemListAB.itemABResource, 1, 2), new ItemStack(ModItems.manaResource, 1, 23), new ItemStack(ModItems.manaResource, 1, 5), new ItemStack(Items.nether_star), 250000, 0x6bc9ec);
nebulaRecipe = AdvancedBotanyAPI.registerAdvancedPlateRecipe(new ItemStack(ItemListAB.itemABResource, 1, 5), new ItemStack(ModItems.manaResource, 1, 8), new ItemStack(ModBlocks.storage, 1, 4), new ItemStack(ItemListAB.itemABResource, 1, 1), 50000000, 0x8d16e0);
ancientAlphirine = new BLexiconEntry("ancientAlphirine", categoryForgotten);
alphirineRecipe = BotaniaAPI.registerPetalRecipe(ItemBlockSpecialFlower.ofType("ancientAlphirine"), new ItemStack(ModItems.manaResource, 1, 5), new ItemStack(ModItems.manaResource, 1, 5), new ItemStack(ModItems.manaResource, 1, 5), new ItemStack(ModItems.manaResource, 1, 5), new ItemStack(ModItems.rune, 1, 8), new ItemStack(ModItems.rune, 1, 4), new ItemStack(ModItems.rune, 1, 5), new ItemStack(ModItems.rune, 1, 6), new ItemStack(ModItems.rune, 1, 7), new ItemStack(ModItems.petal, 1, 1), new ItemStack(ModItems.petal, 1, 4));
ancientAlphirine.setPriority().setKnowledgeType(BotaniaAPI.elvenKnowledge).setLexiconPages(new LexiconPage[] { new PageText("0"), new PageText("1"), BotaniaAPI.internalHandler.petalRecipePage(".petalCraft", alphirineRecipe), new AlphirineCraftPage(forgottenLandRecipe) }).setIcon(ItemBlockSpecialFlower.ofType("ancientAlphirine"));
GameRegistry.addShapedRecipe(new ItemStack(BlockListAB.blockABPlate), new Object[] { " ", "MPM", "BRB", Character.valueOf('M'), new ItemStack(ModBlocks.storage), Character.valueOf('P'), new ItemStack(ModBlocks.terraPlate), Character.valueOf('B'), new ItemStack(ItemListAB.itemABResource, 1, 3), Character.valueOf('R'), new ItemStack(ModItems.rune, 1, 3)});
advandedAgglomerationPlate = new BLexiconEntry("advancedPlate", categoryForgotten);
advandedAgglomerationPlate.setKnowledgeType(forgotten).setLexiconPages(new LexiconPage[] {new PageText("0"), BotaniaAPI.internalHandler.craftingRecipePage(".craft", getLastRecipe()), BotaniaAPI.internalHandler.multiblockPage(".structure", TileAgglomerationPlate.makeMultiblockSet()), new AdvancedPlateCraftPage(terrasteelRecipe, "0"), new AdvancedPlateCraftPage(manaStarRecipe, "1") }).setIcon(new ItemStack(BlockListAB.blockABPlate));
GameRegistry.addShapedRecipe(new ItemStack(BlockListAB.blockABSpreader), new Object[] { "WMW", "PSP", "WMW", Character.valueOf('M'), new ItemStack(ItemListAB.itemABResource, 1, 2), Character.valueOf('P'), new ItemStack(ModBlocks.pylon), Character.valueOf('S'), new ItemStack(ModBlocks.spreader, 1, 3), Character.valueOf('W'), new ItemStack(BlockListAB.blockLebethron, 1, 4)});
lebethronSpreader = new BLexiconEntry("lebethronSpreader", categoryForgotten);
lebethronSpreader.setKnowledgeType(forgotten).setLexiconPages(new LexiconPage[] { new PageText("0"), BotaniaAPI.internalHandler.craftingRecipePage(".craft", getLastRecipe()) }).setIcon(new ItemStack(BlockListAB.blockABSpreader));
addShapelessOreDictRecipe(new ItemStack(BlockListAB.blockLebethron, 4, 1), new Object[] { new ItemStack(BlockListAB.blockLebethron)});
IRecipe leb1 = getLastRecipe();
addShapelessOreDictRecipe(new ItemStack(BlockListAB.blockLebethron, 1, 2), new Object[] { new ItemStack(BlockListAB.blockLebethron, 1, 1), new ItemStack(Items.wheat_seeds)});
IRecipe leb2 = getLastRecipe();
addShapelessOreDictRecipe(new ItemStack(BlockListAB.blockLebethron, 1, 3), new Object[] { new ItemStack(BlockListAB.blockLebethron), new ItemStack(Items.glowstone_dust)});
IRecipe leb3 = getLastRecipe();
GameRegistry.addShapedRecipe(new ItemStack(BlockListAB.blockLebethron, 1, 4), new Object[] { "4W5", "WPW", "6W7", Character.valueOf('P'), new ItemStack(ModBlocks.pylon, 1, 1), Character.valueOf('W'), new ItemStack(BlockListAB.blockLebethron), Character.valueOf('4'), new ItemStack(ModItems.rune, 1, 4), Character.valueOf('5'), new ItemStack(ModItems.rune, 1, 5), Character.valueOf('6'), new ItemStack(ModItems.rune, 1, 6), Character.valueOf('7'), new ItemStack(ModItems.rune, 1, 7)});
IRecipe leb4 = getLastRecipe();
lebethronWood = new BLexiconEntry("lebethronWood", categoryForgotten);
lebethronWood.setKnowledgeType(forgotten).setLexiconPages(new LexiconPage[] { new PageText("0"), new AlphirineCraftPage(lebethroneRecipe), BotaniaAPI.internalHandler.craftingRecipePage(".craft0", leb1), BotaniaAPI.internalHandler.craftingRecipePage(".craft0", leb2), BotaniaAPI.internalHandler.craftingRecipePage(".craft0", leb3), BotaniaAPI.internalHandler.craftingRecipePage(".craft0", leb4), new PageText("1"), BotaniaAPI.internalHandler.multiblockPage(".structure", TileLebethronCore.makeMultiblockSet()) }).setIcon(new ItemStack(BlockListAB.blockLebethron));
GameRegistry.addShapedRecipe(new ItemStack(ItemListAB.itemMihrillMultiTool), new Object[] { " MB", " FM", "F ", Character.valueOf('F'), new ItemStack(ModItems.manaResource, 1, 3), Character.valueOf('B'), new ItemStack(ModBlocks.livingwood), Character.valueOf('M'), new ItemStack(ItemListAB.itemABResource)});
mithrill = new BLexiconEntry("mithrill", categoryForgotten);
mithrill.setKnowledgeType(forgotten).setLexiconPages(new LexiconPage[] { new PageText("0"), new AdvancedPlateCraftPage(mithrillRecipe), new PageText("1"), BotaniaAPI.internalHandler.craftingRecipePage(".craft", getLastRecipe()) }).setIcon(new ItemStack(ItemListAB.itemMihrillMultiTool));
GameRegistry.addShapedRecipe(new ItemStack(BlockListAB.blockManaContainer), new Object[] { "MGM", "LPL", "M3M", Character.valueOf('M'), new ItemStack(ItemListAB.itemABResource), Character.valueOf('L'), new ItemStack(ModBlocks.pool), Character.valueOf('P'), new ItemStack(ModBlocks.pylon), Character.valueOf('3'), new ItemStack(ModItems.rune, 1, 3), Character.valueOf('G'), new ItemStack(ModItems.rune, 1, 15)});
IRecipe cont1 = getLastRecipe();
GameRegistry.addShapedRecipe(new ItemStack(BlockListAB.blockManaContainer, 1, 1), new Object[] { "MGM", "LPL", "M3M", Character.valueOf('M'), new ItemStack(ItemListAB.itemABResource, 1, 1), Character.valueOf('L'), new ItemStack(ModBlocks.pool, 1, 2), Character.valueOf('P'), new ItemStack(ModBlocks.pylon), Character.valueOf('3'), new ItemStack(ModItems.rune, 1, 3), Character.valueOf('G'), new ItemStack(ModItems.rune, 1, 15)});
IRecipe cont2 = getLastRecipe();
GameRegistry.addShapedRecipe(new ItemStack(BlockListAB.blockManaContainer, 1, 2), new Object[] { "MGM", "LPL", "M3M", Character.valueOf('M'), new ItemStack(ItemListAB.itemABResource), Character.valueOf('L'), new ItemStack(ModBlocks.pool, 1, 3), Character.valueOf('P'), new ItemStack(ModBlocks.pylon), Character.valueOf('3'), new ItemStack(ModItems.rune, 1, 3), Character.valueOf('G'), new ItemStack(ModItems.rune, 1, 15)});
IRecipe cont3 = getLastRecipe();
manaContainer = new BLexiconEntry("manaContainer", categoryForgotten);
manaContainer.setKnowledgeType(forgotten).setLexiconPages(new LexiconPage[] { new PageText("0"), BotaniaAPI.internalHandler.craftingRecipePage(".craft0", cont1), BotaniaAPI.internalHandler.craftingRecipePage(".craft1", cont2), BotaniaAPI.internalHandler.craftingRecipePage(".craft2", cont3), new PageText("1"), new AlphirineCraftPage(advancedSparkRecipe) }).setIcon(new ItemStack(BlockListAB.blockManaContainer));
GameRegistry.addShapedRecipe(new ItemStack(BlockListAB.blockManaCrystalCube), new Object[] { "TST", "GWG", "DMD", Character.valueOf('D'), new ItemStack(ModBlocks.dreamwood), Character.valueOf('W'), new ItemStack(ModItems.twigWand, 1, 32767), Character.valueOf('G'), new ItemStack(ModBlocks.manaGlass), Character.valueOf('M'), new ItemStack(ModItems.manaResource), Character.valueOf('T'), new ItemStack(ModItems.manaResource, 1, 18), Character.valueOf('S'), new ItemStack(ModItems.spark)});
manaCrystalCube = new BLexiconEntry("manaCrystalCube", BotaniaAPI.categoryMana);
manaCrystalCube.setKnowledgeType(BotaniaAPI.elvenKnowledge).setLexiconPages(new LexiconPage[] { new PageText("0"), BotaniaAPI.internalHandler.craftingRecipePage(".craft", getLastRecipe()) }).setIcon(new ItemStack(BlockListAB.blockManaCrystalCube));
GameRegistry.addShapedRecipe(new ItemStack(ItemListAB.itemTerraHoe), new Object[] { "TTL", "RW ", " W ", Character.valueOf('T'), new ItemStack(ModItems.manaResource, 1, 4), Character.valueOf('L'), new ItemStack(ModItems.manaResource, 1, 18), Character.valueOf('W'), new ItemStack(ModItems.manaResource, 1, 3), Character.valueOf('R'), new ItemStack(ModItems.rune, 1, 2)});
terraHoe = new BLexiconEntry("terraHoe", BotaniaAPI.categoryTools);
terraHoe.setLexiconPages(new LexiconPage[]{ new PageText("0"), BotaniaAPI.internalHandler.craftingRecipePage(".craft", getLastRecipe()) }).setIcon(new ItemStack(ItemListAB.itemTerraHoe));
GameRegistry.addShapedRecipe(new ItemStack(ItemListAB.itemMithrillRing), new Object[] { "LML", "MRM", "LML", Character.valueOf('M'), new ItemStack(ItemListAB.itemABResource), Character.valueOf('L'), new ItemStack(ItemListAB.itemABResource, 1, 1), Character.valueOf('R'), new ItemStack(ModItems.manaRingGreater)});
IRecipe ring1 = getLastRecipe();
GameRegistry.addShapedRecipe(new ItemStack(ItemListAB.itemNebulaRing), new Object[] { "LML", "MRM", "LML", Character.valueOf('M'), new ItemStack(ItemListAB.itemABResource, 1, 6), Character.valueOf('L'), new ItemStack(ModItems.manaResource, 1, 5), Character.valueOf('R'), new ItemStack(ItemListAB.itemMithrillRing)});
IRecipe ring2 = getLastRecipe();
manaRings = new BLexiconEntry("manaRings", categoryForgotten);
manaRings.setKnowledgeType(forgotten).setLexiconPages(new LexiconPage[]{ new PageText("0"), BotaniaAPI.internalHandler.craftingRecipePage(".craft0", ring1), BotaniaAPI.internalHandler.craftingRecipePage(".craft1", ring2)}).setIcon(new ItemStack(ItemListAB.itemMithrillRing));
AdvancedBotanyAPI.registerFarmlandSeed(Blocks.nether_wart, 3);
GameRegistry.addShapedRecipe(new ItemStack(ItemListAB.itemManaFlower), new Object[] { " F ", " M ", " R ", Character.valueOf('F'), new ItemStack(ItemListAB.itemABResource, 1, 4), Character.valueOf('M'), new ItemStack(ModItems.manaBottle), Character.valueOf('R'), new ItemStack(ModItems.rune, 1, 8)});
manaFlower = new BLexiconEntry("manaFlower", categoryForgotten);
manaFlower.setKnowledgeType(forgotten).setLexiconPages(new LexiconPage[] { new PageText("0"), new AlphirineCraftPage(manaFlowerRecipe), BotaniaAPI.internalHandler.craftingRecipePage(".craft", getLastRecipe())}).setIcon(new ItemStack(ItemListAB.itemManaFlower));
GameRegistry.addShapedRecipe(new ItemStack(ItemListAB.itemMithrillSword), new Object[] { " M", "SM ", "WS ", Character.valueOf('S'), new ItemStack(ItemListAB.itemABResource, 1, 6), Character.valueOf('T'), new ItemStack(ModItems.terraSword), Character.valueOf('M'), new ItemStack(ItemListAB.itemABResource), Character.valueOf('W'), new ItemStack(ModItems.manaResource, 1, 3)});
mithrillSword = new BLexiconEntry("mithrillSword", categoryForgotten);
mithrillSword.setKnowledgeType(forgotten).setLexiconPages(new LexiconPage[] { new PageText("0"), BotaniaAPI.internalHandler.craftingRecipePage(".craft", getLastRecipe()) }).setIcon(new ItemStack(ItemListAB.itemMithrillSword));
dictariusRecipe = BotaniaAPI.registerPetalRecipe(ItemBlockSpecialFlower.ofType("dictarius"), new ItemStack(ItemListAB.itemABResource, 1, 4), new ItemStack(ModItems.manaResource, 1, 5), new ItemStack(ModItems.manaResource, 1, 5), new ItemStack(ModItems.rune, 1, 15), new ItemStack(ModItems.petal, 1, 4), new ItemStack(ModItems.petal, 1, 4), new ItemStack(ModItems.petal, 1, 1));
dictarius = new BLexiconEntry("dictarius", BotaniaAPI.categoryGenerationFlowers);
dictarius.setKnowledgeType(forgotten).setLexiconPages(new LexiconPage[] { new PageText("0"), BotaniaAPI.internalHandler.petalRecipePage(".petalCraft", dictariusRecipe)});
nebula = new BLexiconEntry("nebula", categoryForgotten);
nebula.setKnowledgeType(forgotten).setLexiconPages(new LexiconPage[] { new PageText("0"), new AdvancedPlateCraftPage(nebulaRecipe)});
GameRegistry.addShapedRecipe(new ItemStack(ItemListAB.itemBlackHalo), new Object[] { " E ", "DHD", " E ", Character.valueOf('E'), new ItemStack(ModItems.manaResource, 1, 7), Character.valueOf('H'), new ItemStack(ModItems.autocraftingHalo), Character.valueOf('D'), new ItemStack(ModItems.blackHoleTalisman)});
blackHalo = new BLexiconEntry("blackHalo", BotaniaAPI.categoryTools);
blackHalo.setKnowledgeType(BotaniaAPI.elvenKnowledge).setLexiconPages(new LexiconPage[] { new PageText("0"), BotaniaAPI.internalHandler.craftingRecipePage(".craft", getLastRecipe())});
GameRegistry.addShapedRecipe(new ItemStack(ItemListAB.itemAntigravityCharm), new Object[] { " G ", "GDG", "ERE", Character.valueOf('E'), new ItemStack(ModItems.manaResource, 1, 7), Character.valueOf('G'), new ItemStack(ModBlocks.elfGlass), Character.valueOf('D'), new ItemStack(ModBlocks.floatingFlower, 1, 32767), Character.valueOf('R'), new ItemStack(ModItems.rune, 1, 3)});
antigravityCharm = new BLexiconEntry("antigravityCharm", BotaniaAPI.categoryTools);
antigravityCharm.setKnowledgeType(BotaniaAPI.elvenKnowledge).setLexiconPages(new LexiconPage[] { new PageText("0"), BotaniaAPI.internalHandler.craftingRecipePage(".craft", getLastRecipe())}).setIcon(new ItemStack(ItemListAB.itemAntigravityCharm));
GameRegistry.addShapedRecipe(new ItemStack(ItemListAB.itemNebulaBlaze), new Object[] { " N ", "MMN", "AMN", Character.valueOf('N'), new ItemStack(ItemListAB.itemABResource, 1, 6), Character.valueOf('A'), new ItemStack(ItemListAB.itemABResource, 1, 3), Character.valueOf('M'), new ItemStack(ModBlocks.storage)});
nebulaBlaze = new BLexiconEntry("nebulaBlaze", categoryForgotten);
nebulaBlaze.setKnowledgeType(forgotten).setLexiconPages(new LexiconPage[] { new PageText("0"), BotaniaAPI.internalHandler.craftingRecipePage(".craft", getLastRecipe())});
GameRegistry.addShapedRecipe(new ItemStack(BlockListAB.blockManaCharger), new Object[] { "NLN", "MPM", " R ", Character.valueOf('N'), new ItemStack(ItemListAB.itemABResource, 1, 1), Character.valueOf('L'), new ItemStack(ModBlocks.livingrock), Character.valueOf('M'), new ItemStack(ModBlocks.bellows), Character.valueOf('P'), new ItemStack(ModBlocks.pylon), Character.valueOf('R'), new ItemStack(ModItems.rune, 1, 8)});
manaCharger = new BLexiconEntry("manaCharger", categoryForgotten);
manaCharger.setKnowledgeType(forgotten).setLexiconPages(new LexiconPage[] { new PageText("0"), BotaniaAPI.internalHandler.craftingRecipePage(".craft", getLastRecipe())});
GameRegistry.addShapedRecipe(new ItemStack(ItemListAB.itemNebulaHelm), new Object[] { "RNR", "NHN", " E ", Character.valueOf('N'), new ItemStack(ItemListAB.itemABResource, 1, 5), Character.valueOf('R'), new ItemStack(ModItems.manaResource, 1, 7), Character.valueOf('H'), new ItemStack(ModItems.terrasteelHelm), Character.valueOf('E'), new ItemStack(ModItems.manaResource, 1, 8)});
IRecipe nHelm = getLastRecipe();
GameRegistry.addShapedRecipe(new ItemStack(ItemListAB.itemNebulaChest), new Object[] { "RTR", "NHN", "ENE", Character.valueOf('N'), new ItemStack(ItemListAB.itemABResource, 1, 5), Character.valueOf('R'), new ItemStack(ModItems.manaResource, 1, 7), Character.valueOf('H'), new ItemStack(ModItems.terrasteelChest), Character.valueOf('E'), new ItemStack(ModItems.manaResource, 1, 8), Character.valueOf('T'), new ItemStack(ModItems.flightTiara, 1, 32767)});
IRecipe nChest = getLastRecipe();
GameRegistry.addShapedRecipe(new ItemStack(ItemListAB.itemNebulaLegs), new Object[] { "ENE", "RHR", "NAN", Character.valueOf('N'), new ItemStack(ItemListAB.itemABResource, 1, 5), Character.valueOf('R'), new ItemStack(ModItems.manaResource, 1, 7), Character.valueOf('H'), new ItemStack(ModItems.terrasteelLegs), Character.valueOf('E'), new ItemStack(ModItems.manaResource, 1, 8), Character.valueOf('A'), new ItemStack(ItemListAB.itemABResource, 1, 3)});
IRecipe nLegs = getLastRecipe();
GameRegistry.addShapedRecipe(new ItemStack(ItemListAB.itemNebulaBoots), new Object[] { "RBR", "NHN", " E ", Character.valueOf('N'), new ItemStack(ItemListAB.itemABResource, 1, 5), Character.valueOf('R'), new ItemStack(ModItems.manaResource, 1, 7), Character.valueOf('H'), new ItemStack(ModItems.terrasteelBoots), Character.valueOf('E'), new ItemStack(ModItems.manaResource, 1, 8), Character.valueOf('B'), new ItemStack(ModItems.speedUpBelt)});
IRecipe nBoots = getLastRecipe();
nebulaArmor = new BLexiconEntry("nebulaArmor", categoryForgotten);
nebulaArmor.setKnowledgeType(forgotten).setLexiconPages(new LexiconPage[] { new PageText("0"), new PageText("1"), BotaniaAPI.internalHandler.craftingRecipePage(".craft", nHelm), BotaniaAPI.internalHandler.craftingRecipePage(".craft", nChest), BotaniaAPI.internalHandler.craftingRecipePage(".craft", nLegs), BotaniaAPI.internalHandler.craftingRecipePage(".craft", nBoots)});
freyrSlingshot = new BLexiconEntry("freyrSlingshot", categoryForgotten);
freyrSlingshot.setKnowledgeType(forgotten).setLexiconPages(new LexiconPage[] { new PageText("0"), new AlphirineCraftPage(slingshotRecipe)});
engineerHopper = new BLexiconEntry("engineerHopper", categoryForgotten);
engineerHopper.setKnowledgeType(forgotten).setLexiconPages(new LexiconPage[] { new PageText("0"), new AlphirineCraftPage(hopperRecipe)});
GameRegistry.addShapedRecipe(new ItemStack(ItemListAB.itemNebulaRod), new Object[] { " WN", " RW", "W ", Character.valueOf('W'), new ItemStack(ModItems.manaResource, 1, 13), Character.valueOf('R'), new ItemStack(ModItems.rune, 1, 8), Character.valueOf('N'), new ItemStack(ItemListAB.itemABResource, 1, 6)});
nebulaRod = new BLexiconEntry("nebulaRod", categoryForgotten);
nebulaRod.setKnowledgeType(forgotten).setLexiconPages(new LexiconPage[] { new PageText("0"), BotaniaAPI.internalHandler.craftingRecipePage(".craft", getLastRecipe())});
if(Botania.thaumcraftLoaded)
thaumcraft();
addShapelessOreDictRecipe(new ItemStack(ItemListAB.itemABResource, 9, 1), new Object[] { new ItemStack(ItemListAB.itemABResource)});
addShapelessOreDictRecipe(new ItemStack(ItemListAB.itemABResource, 9, 0), new Object[] { new ItemStack(BlockListAB.blockABStorage)});
addShapelessOreDictRecipe(new ItemStack(ItemListAB.itemABResource, 9, 6), new Object[] { new ItemStack(ItemListAB.itemABResource, 1, 5)});
GameRegistry.addShapedRecipe(new ItemStack(BlockListAB.blockABStorage), new Object[] { "III", "III", "III", Character.valueOf('I'), new ItemStack(ItemListAB.itemABResource)});
GameRegistry.addShapedRecipe(new ItemStack(ItemListAB.itemABResource, 1, 5), new Object[] { "III", "III", "III", Character.valueOf('I'), new ItemStack(ItemListAB.itemABResource, 1, 6)});
}
public static void thaumcraft() {
aspecolus = new BLexiconEntry("aspecolus", BotaniaAPI.categoryFunctionalFlowers);
aspecolusRecipe = BotaniaAPI.registerPetalRecipe(ItemBlockSpecialFlower.ofType("aspecolus"), new ItemStack(ModItems.manaResource, 1, 6), new ItemStack(ModItems.manaResource, 1, 5), new ItemStack(ModItems.rune, 1, 1), new ItemStack(ModItems.rune), new ItemStack(ItemListAB.itemABResource, 1, 2), new ItemStack(ModItems.petal, 1, 10), new ItemStack(ModItems.petal, 1, 13));
aspecolus.setKnowledgeType(forgotten).setLexiconPages(new LexiconPage[] { new PageText("0"), BotaniaAPI.internalHandler.petalRecipePage(".petalCraft", aspecolusRecipe) }).setIcon(ItemBlockSpecialFlower.ofType("aspecolus"));
addShapelessOreDictRecipe(new ItemStack(ItemListAB.itemNebulaHelmReveal), new Object[] { new ItemStack(ItemListAB.itemNebulaHelm), new ItemStack(ConfigItems.itemGoggles)});
List<IRecipe> recipes = new ArrayList<IRecipe>();
for(int i = 1; i < 10; i++) {
boolean[][] patterns = ItemCraftingPattern.getPattern(i);
List<String> str = new ArrayList<String>();
for(int j = 0; j < patterns.length; j++) {
String str1 = "";
for(int k = 0; k < patterns[j].length; k++)
str1 += patterns[j][k] ? "T" : "H";
str.add(str1);
}
GameRegistry.addShapedRecipe(new ItemStack(ItemListAB.itemCraftingPattern, 1, i), new Object[] { str.get(0), str.get(1), str.get(2), Character.valueOf('T'), new ItemStack(ItemListAB.itemCraftingPattern), Character.valueOf('H'), new ItemStack(ConfigItems.itemNugget, 1, 6)});
recipes.add(getLastRecipe());
}
IRecipe crate = GameRegistry.addShapedRecipe(new ItemStack(BlockListAB.blockMagicCraftCrate), new Object[] { "TST", "WCW", "W W", Character.valueOf('W'), new ItemStack(ConfigBlocks.blockMagicalLog), Character.valueOf('S'), new ItemStack(ConfigItems.itemResource, 1, 14), Character.valueOf('T'), new ItemStack(ConfigItems.itemResource, 1, 7), Character.valueOf('C'), new ItemStack(ModBlocks.openCrate, 1, 1)});
addShapelessOreDictRecipe(new ItemStack(ItemListAB.itemCraftingPattern, 48), new Object[] { new ItemStack(Blocks.crafting_table), new ItemStack(ModBlocks.livingrock), new ItemStack(ConfigItems.itemResource, 1, 14)});
thaumAutoCraft = new BLexiconEntry("thaumAutoCraft", BotaniaAPI.categoryDevices);
thaumAutoCraft.setKnowledgeType(BotaniaAPI.elvenKnowledge).setLexiconPages(new LexiconPage[] { new PageText("0"), BotaniaAPI.internalHandler.craftingRecipePage(".craft", crate) , BotaniaAPI.internalHandler.craftingRecipePage(".craft0", getLastRecipe()), BotaniaAPI.internalHandler.craftingRecipesPage(".craft1", recipes)});
pureGladRecipe = BotaniaAPI.registerPetalRecipe(ItemBlockSpecialFlower.ofType("pureGladiolus"), new ItemStack(ItemListAB.itemABResource, 1, 4), new ItemStack(ModItems.rune, 1, 8), new ItemStack(ModItems.petal, 1, 8), new ItemStack(ModItems.petal, 1, 4), new ItemStack(ModItems.petal, 1, 14), new ItemStack(ModItems.petal, 1, 5), new ItemStack(ModItems.petal, 1, 13), new ItemStack(ModItems.petal, 1, 11));
gladious = new BLexiconEntry("gladious", BotaniaAPI.categoryFunctionalFlowers);
gladious.setKnowledgeType(forgotten).setLexiconPages(new LexiconPage[] { new PageText("0"), BotaniaAPI.internalHandler.petalRecipePage(".petalCraft", pureGladRecipe)});
}
private static IRecipe getLastRecipe() {
return (IRecipe)CraftingManager.getInstance().getRecipeList().get(CraftingManager.getInstance().getRecipeList().size() - 1);
}
private static void addOreDictRecipe(ItemStack output, Object... recipe) {
CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(output, recipe));
}
private static void addShapelessOreDictRecipe(ItemStack output, Object... recipe) {
CraftingManager.getInstance().getRecipeList().add(new ShapelessOreRecipe(output, recipe));
}
}
@@ -0,0 +1,103 @@
package ab.common.entity;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.projectile.EntityThrowable;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
import vazkii.botania.common.Botania;
public class EntitySword extends EntityThrowable {
public EntitySword(World world) {
super(world);
}
public EntitySword(World world, EntityPlayer e, ItemStack stack) {
super(world, e);
this.setSword(stack);
}
protected void entityInit() {
super.entityInit();
this.dataWatcher.addObject(27, new ItemStack(Items.diamond_sword));
this.dataWatcher.setObjectWatched(27);
this.dataWatcher.addObject(28, Float.valueOf(0.0f));
this.dataWatcher.setObjectWatched(28);
this.dataWatcher.addObject(29, Float.valueOf(0.0f));
this.dataWatcher.setObjectWatched(29);
}
public void onUpdate() {
super.onUpdate();
if(ticksExisted < 40) {
this.motionX *= 1.05f;
this.motionY *= 1.05f;
this.motionZ *= 1.05f;
}
if(ticksExisted > 240)
setDead();
// if(this.worldObj.isRemote)
// Botania.proxy.wispFX(worldObj, posX, posY, posZ, 1, 1, 1, 0.4f, 0, 1);
}
@SideOnly(Side.CLIENT)
public void setPositionAndRotation2(double x, double y, double z, float help, float me, int please) {}
protected void onImpact(MovingObjectPosition mov) {
Block block = this.worldObj.getBlock(mov.blockX, mov.blockY, mov.blockZ);
if(block != null && (block instanceof net.minecraft.block.BlockBush || block instanceof net.minecraft.block.BlockLeaves))
return;
}
public ItemStack getSword() {
return this.dataWatcher.getWatchableObjectItemStack(27);
}
public void setSword(ItemStack stack) {
this.dataWatcher.updateObject(27, stack);
}
public float getRotation1() {
return this.dataWatcher.getWatchableObjectFloat(28);
}
public void setRotation1(float rot) {
this.dataWatcher.updateObject(28, rot);
}
public float getRotation2() {
return this.dataWatcher.getWatchableObjectFloat(29);
}
public void setRotation2(float rot) {
this.dataWatcher.updateObject(29, rot);
}
public void readEntityFromNBT(NBTTagCompound nbtt) {
super.readEntityFromNBT(nbtt);
ticksExisted = nbtt.getInteger("ticks");
NBTTagCompound stackCmp = nbtt.getCompoundTag("sword");
ItemStack stack = ItemStack.loadItemStackFromNBT(stackCmp);
setSword(stack);
}
public void writeEntityToNBT(NBTTagCompound nbtt) {
super.writeEntityToNBT(nbtt);
nbtt.setInteger("ticks", ticksExisted);
ItemStack stack = getSword();
NBTTagCompound stackNbt = new NBTTagCompound();
if(stack != null)
stack.writeToNBT(stackNbt);
nbtt.setTag("sword", stackNbt);
}
protected float getGravityVelocity() {
return 0.0F;
}
}
@@ -0,0 +1,249 @@
package ab.common.lib.register;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import ab.api.AdvancedBotanyAPI;
import ab.api.recipe.RecipeAdvancedPlate;
import ab.api.recipe.RecipeAncientAlphirine;
import ab.api.recipe.lexicon.AdvancedPlateCraftPage;
import ab.api.recipe.lexicon.AlphirineCraftPage;
import ab.common.block.tile.TileAgglomerationPlate;
import ab.common.block.tile.TileLebethronCore;
import ab.common.block.tile.TileMagicCraftCrate;
import ab.common.item.ItemCraftingPattern;
import cpw.mods.fml.common.registry.GameRegistry;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.CraftingManager;
import net.minecraft.item.crafting.IRecipe;
import net.minecraft.util.EnumChatFormatting;
import net.minecraftforge.oredict.ShapedOreRecipe;
import net.minecraftforge.oredict.ShapelessOreRecipe;
import thaumcraft.common.config.ConfigItems;
import vazkii.botania.api.BotaniaAPI;
import vazkii.botania.api.lexicon.KnowledgeType;
import vazkii.botania.api.lexicon.LexiconCategory;
import vazkii.botania.api.lexicon.LexiconEntry;
import vazkii.botania.api.lexicon.LexiconPage;
import vazkii.botania.api.recipe.RecipePetals;
import vazkii.botania.common.Botania;
import vazkii.botania.common.block.ModBlocks;
import vazkii.botania.common.item.ModItems;
import vazkii.botania.common.item.block.ItemBlockSpecialFlower;
import vazkii.botania.common.lexicon.BLexiconCategory;
import vazkii.botania.common.lexicon.BLexiconEntry;
import vazkii.botania.common.lexicon.page.PageText;
public class RecipeListAB {
public static LexiconCategory categoryForgotten;
public static RecipeAncientAlphirine lebethroneRecipe;
public static RecipeAncientAlphirine forgottenLandRecipe;
public static RecipeAncientAlphirine advancedSparkRecipe;
public static RecipeAncientAlphirine manaFlowerRecipe;
public static RecipeAncientAlphirine slingshotRecipe;
public static RecipeAncientAlphirine hopperRecipe;
public static RecipeAdvancedPlate manaStarRecipe;
public static RecipeAdvancedPlate terrasteelRecipe;
public static RecipeAdvancedPlate mithrillRecipe;
public static RecipeAdvancedPlate nebulaRecipe;
public static RecipePetals alphirineRecipe;
public static RecipePetals dictariusRecipe;
public static RecipePetals aspecolusRecipe;
public static LexiconEntry advandedAgglomerationPlate;
public static LexiconEntry ancientAlphirine;
public static LexiconEntry lebethronWood;
public static LexiconEntry lebethronSpreader;
public static LexiconEntry mithrill;
public static LexiconEntry manaContainer;
public static LexiconEntry manaCrystalCube;
public static LexiconEntry terraHoe;
public static LexiconEntry manaRings;
public static LexiconEntry manaFlower;
public static LexiconEntry mithrillSword;
public static LexiconEntry nebula;
public static LexiconEntry blackHalo;
public static LexiconEntry antigravityCharm;
public static LexiconEntry nebulaBlaze;
public static LexiconEntry aspecolus;
public static LexiconEntry dictarius;
public static LexiconEntry manaCharger;
public static LexiconEntry nebulaArmor;
public static LexiconEntry freyrSlingshot;
public static LexiconEntry engineerHopper;
public static LexiconEntry nebulaRod;
public static LexiconEntry thaumAutoCraft;
public static KnowledgeType forgotten;
public static void init() {
BotaniaAPI.addCategory(categoryForgotten = new BLexiconCategory("forgotten", 5));
forgotten = BotaniaAPI.registerKnowledgeType("ab_forgotten", EnumChatFormatting.BLUE, false);
lebethroneRecipe = AdvancedBotanyAPI.registerAlphirineRecipe(new ItemStack(BlockListAB.blockLebethron), new ItemStack(ModBlocks.dreamwood, 1, 0), 15);
forgottenLandRecipe = AdvancedBotanyAPI.registerAlphirineRecipe(new ItemStack(ItemListAB.itemABResource, 1, 3), new ItemStack(ModItems.manaResource, 1, 15), 75);
advancedSparkRecipe = AdvancedBotanyAPI.registerAlphirineRecipe(new ItemStack(ItemListAB.itemAdvancedSpark), new ItemStack(ModItems.spark), 11);
manaFlowerRecipe = AdvancedBotanyAPI.registerAlphirineRecipe(new ItemStack(ItemListAB.itemABResource, 1, 4), new ItemStack(ModBlocks.flower, 1, 32767), 32);
slingshotRecipe = AdvancedBotanyAPI.registerAlphirineRecipe(new ItemStack(ItemListAB.itemFreyrSlingshot), new ItemStack(ModItems.slingshot), 66);
hopperRecipe = AdvancedBotanyAPI.registerAlphirineRecipe(new ItemStack(BlockListAB.blockEngineerHopper), new ItemStack(Blocks.hopper), 23);
mithrillRecipe = AdvancedBotanyAPI.registerAdvancedPlateRecipe(new ItemStack(ItemListAB.itemABResource, 1, 0), new ItemStack(ModItems.manaResource, 1, 5), new ItemStack(ModBlocks.storage, 1, 0), new ItemStack(ModItems.manaResource, 1, 18), 7500000, 0x25d6b7);
terrasteelRecipe = AdvancedBotanyAPI.registerAdvancedPlateRecipe(new ItemStack(ModItems.manaResource, 1, 4), new ItemStack(ModItems.manaResource, 1, 2), new ItemStack(ModItems.manaResource, 1, 0), new ItemStack(ModItems.manaResource, 1, 1), 500000, 0x29de20);
manaStarRecipe = AdvancedBotanyAPI.registerAdvancedPlateRecipe(new ItemStack(ItemListAB.itemABResource, 1, 2), new ItemStack(ModItems.manaResource, 1, 23), new ItemStack(ModItems.manaResource, 1, 5), new ItemStack(Items.nether_star), 250000, 0x6bc9ec);
nebulaRecipe = AdvancedBotanyAPI.registerAdvancedPlateRecipe(new ItemStack(ItemListAB.itemABResource, 1, 5), new ItemStack(ModItems.manaResource, 1, 8), new ItemStack(ModBlocks.storage, 1, 4), new ItemStack(ItemListAB.itemABResource, 1, 1), 50000000, 0x8d16e0);
ancientAlphirine = new BLexiconEntry("ancientAlphirine", categoryForgotten);
alphirineRecipe = BotaniaAPI.registerPetalRecipe(ItemBlockSpecialFlower.ofType("ancientAlphirine"), new ItemStack(ModItems.manaResource, 1, 5), new ItemStack(ModItems.manaResource, 1, 5), new ItemStack(ModItems.manaResource, 1, 5), new ItemStack(ModItems.manaResource, 1, 5), new ItemStack(ModItems.rune, 1, 8), new ItemStack(ModItems.rune, 1, 4), new ItemStack(ModItems.rune, 1, 5), new ItemStack(ModItems.rune, 1, 6), new ItemStack(ModItems.rune, 1, 7), new ItemStack(ModItems.petal, 1, 1), new ItemStack(ModItems.petal, 1, 4));
ancientAlphirine.setPriority().setKnowledgeType(BotaniaAPI.elvenKnowledge).setLexiconPages(new LexiconPage[] { new PageText("0"), new PageText("1"), BotaniaAPI.internalHandler.petalRecipePage(".petalCraft", alphirineRecipe), new AlphirineCraftPage(forgottenLandRecipe) }).setIcon(ItemBlockSpecialFlower.ofType("ancientAlphirine"));
GameRegistry.addShapedRecipe(new ItemStack(BlockListAB.blockABPlate), new Object[] { " ", "MPM", "BRB", Character.valueOf('M'), new ItemStack(ModBlocks.storage), Character.valueOf('P'), new ItemStack(ModBlocks.terraPlate), Character.valueOf('B'), new ItemStack(ItemListAB.itemABResource, 1, 3), Character.valueOf('R'), new ItemStack(ModItems.rune, 1, 3)});
advandedAgglomerationPlate = new BLexiconEntry("advancedPlate", categoryForgotten);
advandedAgglomerationPlate.setKnowledgeType(forgotten).setLexiconPages(new LexiconPage[] {new PageText("0"), BotaniaAPI.internalHandler.craftingRecipePage(".craft", getLastRecipe()), BotaniaAPI.internalHandler.multiblockPage(".structure", TileAgglomerationPlate.makeMultiblockSet()), new AdvancedPlateCraftPage(terrasteelRecipe, "0"), new AdvancedPlateCraftPage(manaStarRecipe, "1") }).setIcon(new ItemStack(BlockListAB.blockABPlate));
GameRegistry.addShapedRecipe(new ItemStack(BlockListAB.blockABSpreader), new Object[] { "WMW", "PSP", "WMW", Character.valueOf('M'), new ItemStack(ItemListAB.itemABResource, 1, 2), Character.valueOf('P'), new ItemStack(ModBlocks.pylon), Character.valueOf('S'), new ItemStack(ModBlocks.spreader, 1, 3), Character.valueOf('W'), new ItemStack(BlockListAB.blockLebethron, 1, 4)});
lebethronSpreader = new BLexiconEntry("lebethronSpreader", categoryForgotten);
lebethronSpreader.setKnowledgeType(forgotten).setLexiconPages(new LexiconPage[] { new PageText("0"), BotaniaAPI.internalHandler.craftingRecipePage(".craft", getLastRecipe()) }).setIcon(new ItemStack(BlockListAB.blockABSpreader));
addShapelessOreDictRecipe(new ItemStack(BlockListAB.blockLebethron, 4, 1), new Object[] { new ItemStack(BlockListAB.blockLebethron)});
IRecipe leb1 = getLastRecipe();
addShapelessOreDictRecipe(new ItemStack(BlockListAB.blockLebethron, 1, 2), new Object[] { new ItemStack(BlockListAB.blockLebethron, 1, 1), new ItemStack(Items.wheat_seeds)});
IRecipe leb2 = getLastRecipe();
addShapelessOreDictRecipe(new ItemStack(BlockListAB.blockLebethron, 1, 3), new Object[] { new ItemStack(BlockListAB.blockLebethron), new ItemStack(Items.glowstone_dust)});
IRecipe leb3 = getLastRecipe();
GameRegistry.addShapedRecipe(new ItemStack(BlockListAB.blockLebethron, 1, 4), new Object[] { "4W5", "WPW", "6W7", Character.valueOf('P'), new ItemStack(ModBlocks.pylon, 1, 1), Character.valueOf('W'), new ItemStack(BlockListAB.blockLebethron), Character.valueOf('4'), new ItemStack(ModItems.rune, 1, 4), Character.valueOf('5'), new ItemStack(ModItems.rune, 1, 5), Character.valueOf('6'), new ItemStack(ModItems.rune, 1, 6), Character.valueOf('7'), new ItemStack(ModItems.rune, 1, 7)});
IRecipe leb4 = getLastRecipe();
lebethronWood = new BLexiconEntry("lebethronWood", categoryForgotten);
lebethronWood.setKnowledgeType(forgotten).setLexiconPages(new LexiconPage[] { new PageText("0"), new AlphirineCraftPage(lebethroneRecipe), BotaniaAPI.internalHandler.craftingRecipePage(".craft0", leb1), BotaniaAPI.internalHandler.craftingRecipePage(".craft0", leb2), BotaniaAPI.internalHandler.craftingRecipePage(".craft0", leb3), BotaniaAPI.internalHandler.craftingRecipePage(".craft0", leb4), new PageText("1"), BotaniaAPI.internalHandler.multiblockPage(".structure", TileLebethronCore.makeMultiblockSet()) }).setIcon(new ItemStack(BlockListAB.blockLebethron));
GameRegistry.addShapedRecipe(new ItemStack(ItemListAB.itemMihrillMultiTool), new Object[] { " MB", " FM", "F ", Character.valueOf('F'), new ItemStack(ModItems.manaResource, 1, 3), Character.valueOf('B'), new ItemStack(ModBlocks.livingwood), Character.valueOf('M'), new ItemStack(ItemListAB.itemABResource)});
mithrill = new BLexiconEntry("mithrill", categoryForgotten);
mithrill.setKnowledgeType(forgotten).setLexiconPages(new LexiconPage[] { new PageText("0"), new AdvancedPlateCraftPage(mithrillRecipe), new PageText("1"), BotaniaAPI.internalHandler.craftingRecipePage(".craft", getLastRecipe()) }).setIcon(new ItemStack(ItemListAB.itemMihrillMultiTool));
GameRegistry.addShapedRecipe(new ItemStack(BlockListAB.blockManaContainer), new Object[] { "MGM", "LPL", "M3M", Character.valueOf('M'), new ItemStack(ItemListAB.itemABResource), Character.valueOf('L'), new ItemStack(ModBlocks.pool), Character.valueOf('P'), new ItemStack(ModBlocks.pylon), Character.valueOf('3'), new ItemStack(ModItems.rune, 1, 3), Character.valueOf('G'), new ItemStack(ModItems.rune, 1, 15)});
IRecipe cont1 = getLastRecipe();
GameRegistry.addShapedRecipe(new ItemStack(BlockListAB.blockManaContainer, 1, 1), new Object[] { "MGM", "LPL", "M3M", Character.valueOf('M'), new ItemStack(ItemListAB.itemABResource, 1, 1), Character.valueOf('L'), new ItemStack(ModBlocks.pool, 1, 2), Character.valueOf('P'), new ItemStack(ModBlocks.pylon), Character.valueOf('3'), new ItemStack(ModItems.rune, 1, 3), Character.valueOf('G'), new ItemStack(ModItems.rune, 1, 15)});
IRecipe cont2 = getLastRecipe();
GameRegistry.addShapedRecipe(new ItemStack(BlockListAB.blockManaContainer, 1, 2), new Object[] { "MGM", "LPL", "M3M", Character.valueOf('M'), new ItemStack(ItemListAB.itemABResource), Character.valueOf('L'), new ItemStack(ModBlocks.pool, 1, 3), Character.valueOf('P'), new ItemStack(ModBlocks.pylon), Character.valueOf('3'), new ItemStack(ModItems.rune, 1, 3), Character.valueOf('G'), new ItemStack(ModItems.rune, 1, 15)});
IRecipe cont3 = getLastRecipe();
manaContainer = new BLexiconEntry("manaContainer", categoryForgotten);
manaContainer.setKnowledgeType(forgotten).setLexiconPages(new LexiconPage[] { new PageText("0"), BotaniaAPI.internalHandler.craftingRecipePage(".craft0", cont1), BotaniaAPI.internalHandler.craftingRecipePage(".craft1", cont2), BotaniaAPI.internalHandler.craftingRecipePage(".craft2", cont3), new PageText("1"), new AlphirineCraftPage(advancedSparkRecipe) }).setIcon(new ItemStack(BlockListAB.blockManaContainer));
GameRegistry.addShapedRecipe(new ItemStack(BlockListAB.blockManaCrystalCube), new Object[] { "TST", "GWG", "DMD", Character.valueOf('D'), new ItemStack(ModBlocks.dreamwood), Character.valueOf('W'), new ItemStack(ModItems.twigWand, 1, 32767), Character.valueOf('G'), new ItemStack(ModBlocks.manaGlass), Character.valueOf('M'), new ItemStack(ModItems.manaResource), Character.valueOf('T'), new ItemStack(ModItems.manaResource, 1, 18), Character.valueOf('S'), new ItemStack(ModItems.spark)});
manaCrystalCube = new BLexiconEntry("manaCrystalCube", BotaniaAPI.categoryMana);
manaCrystalCube.setKnowledgeType(BotaniaAPI.elvenKnowledge).setLexiconPages(new LexiconPage[] { new PageText("0"), BotaniaAPI.internalHandler.craftingRecipePage(".craft", getLastRecipe()) }).setIcon(new ItemStack(BlockListAB.blockManaCrystalCube));
GameRegistry.addShapedRecipe(new ItemStack(ItemListAB.itemTerraHoe), new Object[] { "TTL", "RW ", " W ", Character.valueOf('T'), new ItemStack(ModItems.manaResource, 1, 4), Character.valueOf('L'), new ItemStack(ModItems.manaResource, 1, 18), Character.valueOf('W'), new ItemStack(ModItems.manaResource, 1, 3), Character.valueOf('R'), new ItemStack(ModItems.rune, 1, 2)});
terraHoe = new BLexiconEntry("terraHoe", BotaniaAPI.categoryTools);
terraHoe.setLexiconPages(new LexiconPage[]{ new PageText("0"), BotaniaAPI.internalHandler.craftingRecipePage(".craft", getLastRecipe()) }).setIcon(new ItemStack(ItemListAB.itemTerraHoe));
GameRegistry.addShapedRecipe(new ItemStack(ItemListAB.itemMithrillRing), new Object[] { "LML", "MRM", "LML", Character.valueOf('M'), new ItemStack(ItemListAB.itemABResource), Character.valueOf('L'), new ItemStack(ItemListAB.itemABResource, 1, 1), Character.valueOf('R'), new ItemStack(ModItems.manaRingGreater)});
IRecipe ring1 = getLastRecipe();
GameRegistry.addShapedRecipe(new ItemStack(ItemListAB.itemNebulaRing), new Object[] { "LML", "MRM", "LML", Character.valueOf('M'), new ItemStack(ItemListAB.itemABResource, 1, 6), Character.valueOf('L'), new ItemStack(ModItems.manaResource, 1, 5), Character.valueOf('R'), new ItemStack(ItemListAB.itemMithrillRing)});
IRecipe ring2 = getLastRecipe();
manaRings = new BLexiconEntry("manaRings", categoryForgotten);
manaRings.setKnowledgeType(forgotten).setLexiconPages(new LexiconPage[]{ new PageText("0"), BotaniaAPI.internalHandler.craftingRecipePage(".craft0", ring1), BotaniaAPI.internalHandler.craftingRecipePage(".craft1", ring2)}).setIcon(new ItemStack(ItemListAB.itemMithrillRing));
AdvancedBotanyAPI.registerFarmlandSeed(Blocks.nether_wart, 3);
GameRegistry.addShapedRecipe(new ItemStack(ItemListAB.itemManaFlower), new Object[] { " F ", " M ", " R ", Character.valueOf('F'), new ItemStack(ItemListAB.itemABResource, 1, 4), Character.valueOf('M'), new ItemStack(ModItems.manaBottle), Character.valueOf('R'), new ItemStack(ModItems.rune, 1, 8)});
manaFlower = new BLexiconEntry("manaFlower", categoryForgotten);
manaFlower.setKnowledgeType(forgotten).setLexiconPages(new LexiconPage[] { new PageText("0"), new AlphirineCraftPage(manaFlowerRecipe), BotaniaAPI.internalHandler.craftingRecipePage(".craft", getLastRecipe())}).setIcon(new ItemStack(ItemListAB.itemManaFlower));
GameRegistry.addShapedRecipe(new ItemStack(ItemListAB.itemMithrillSword), new Object[] { " M", "SM ", "WS ", Character.valueOf('S'), new ItemStack(ItemListAB.itemABResource, 1, 6), Character.valueOf('T'), new ItemStack(ModItems.terraSword), Character.valueOf('M'), new ItemStack(ItemListAB.itemABResource), Character.valueOf('W'), new ItemStack(ModItems.manaResource, 1, 3)});
mithrillSword = new BLexiconEntry("mithrillSword", categoryForgotten);
mithrillSword.setKnowledgeType(forgotten).setLexiconPages(new LexiconPage[] { new PageText("0"), BotaniaAPI.internalHandler.craftingRecipePage(".craft", getLastRecipe()) }).setIcon(new ItemStack(ItemListAB.itemMithrillSword));
dictariusRecipe = BotaniaAPI.registerPetalRecipe(ItemBlockSpecialFlower.ofType("dictarius"), new ItemStack(ItemListAB.itemABResource, 1, 4), new ItemStack(ModItems.manaResource, 1, 5), new ItemStack(ModItems.manaResource, 1, 5), new ItemStack(ModItems.rune, 1, 15), new ItemStack(ModItems.petal, 1, 4), new ItemStack(ModItems.petal, 1, 4), new ItemStack(ModItems.petal, 1, 1));
dictarius = new BLexiconEntry("dictarius", BotaniaAPI.categoryGenerationFlowers);
dictarius.setKnowledgeType(forgotten).setLexiconPages(new LexiconPage[] { new PageText("0"), BotaniaAPI.internalHandler.petalRecipePage(".petalCraft", dictariusRecipe)});
nebula = new BLexiconEntry("nebula", categoryForgotten);
nebula.setKnowledgeType(forgotten).setLexiconPages(new LexiconPage[] { new PageText("0"), new AdvancedPlateCraftPage(nebulaRecipe)});
GameRegistry.addShapedRecipe(new ItemStack(ItemListAB.itemBlackHalo), new Object[] { " E ", "DHD", " E ", Character.valueOf('E'), new ItemStack(ModItems.manaResource, 1, 7), Character.valueOf('H'), new ItemStack(ModItems.autocraftingHalo), Character.valueOf('D'), new ItemStack(ModItems.blackHoleTalisman)});
blackHalo = new BLexiconEntry("blackHalo", BotaniaAPI.categoryTools);
blackHalo.setKnowledgeType(BotaniaAPI.elvenKnowledge).setLexiconPages(new LexiconPage[] { new PageText("0"), BotaniaAPI.internalHandler.craftingRecipePage(".craft", getLastRecipe())});
GameRegistry.addShapedRecipe(new ItemStack(ItemListAB.itemAntigravityCharm), new Object[] { " G ", "GDG", "ERE", Character.valueOf('E'), new ItemStack(ModItems.manaResource, 1, 7), Character.valueOf('G'), new ItemStack(ModBlocks.elfGlass), Character.valueOf('D'), new ItemStack(ModBlocks.floatingFlower, 1, 32767), Character.valueOf('R'), new ItemStack(ModItems.rune, 1, 3)});
antigravityCharm = new BLexiconEntry("antigravityCharm", BotaniaAPI.categoryTools);
antigravityCharm.setKnowledgeType(BotaniaAPI.elvenKnowledge).setLexiconPages(new LexiconPage[] { new PageText("0"), BotaniaAPI.internalHandler.craftingRecipePage(".craft", getLastRecipe())}).setIcon(new ItemStack(ItemListAB.itemAntigravityCharm));
GameRegistry.addShapedRecipe(new ItemStack(ItemListAB.itemNebulaBlaze), new Object[] { " N ", "MMN", "AMN", Character.valueOf('N'), new ItemStack(ItemListAB.itemABResource, 1, 6), Character.valueOf('A'), new ItemStack(ItemListAB.itemABResource, 1, 3), Character.valueOf('M'), new ItemStack(ModBlocks.storage)});
nebulaBlaze = new BLexiconEntry("nebulaBlaze", categoryForgotten);
nebulaBlaze.setKnowledgeType(forgotten).setLexiconPages(new LexiconPage[] { new PageText("0"), BotaniaAPI.internalHandler.craftingRecipePage(".craft", getLastRecipe())});
GameRegistry.addShapedRecipe(new ItemStack(BlockListAB.blockManaCharger), new Object[] { "NLN", "MPM", " R ", Character.valueOf('N'), new ItemStack(ItemListAB.itemABResource, 1, 1), Character.valueOf('L'), new ItemStack(ModBlocks.livingrock), Character.valueOf('M'), new ItemStack(ModBlocks.bellows), Character.valueOf('P'), new ItemStack(ModBlocks.pylon), Character.valueOf('R'), new ItemStack(ModItems.rune, 1, 8)});
manaCharger = new BLexiconEntry("manaCharger", categoryForgotten);
manaCharger.setKnowledgeType(forgotten).setLexiconPages(new LexiconPage[] { new PageText("0"), BotaniaAPI.internalHandler.craftingRecipePage(".craft", getLastRecipe())});
GameRegistry.addShapedRecipe(new ItemStack(ItemListAB.itemNebulaHelm), new Object[] { "RNR", "NHN", " E ", Character.valueOf('N'), new ItemStack(ItemListAB.itemABResource, 1, 5), Character.valueOf('R'), new ItemStack(ModItems.manaResource, 1, 7), Character.valueOf('H'), new ItemStack(ModItems.terrasteelHelm), Character.valueOf('E'), new ItemStack(ModItems.manaResource, 1, 8)});
IRecipe nHelm = getLastRecipe();
GameRegistry.addShapedRecipe(new ItemStack(ItemListAB.itemNebulaChest), new Object[] { "RTR", "NHN", "ENE", Character.valueOf('N'), new ItemStack(ItemListAB.itemABResource, 1, 5), Character.valueOf('R'), new ItemStack(ModItems.manaResource, 1, 7), Character.valueOf('H'), new ItemStack(ModItems.terrasteelChest), Character.valueOf('E'), new ItemStack(ModItems.manaResource, 1, 8), Character.valueOf('T'), new ItemStack(ModItems.flightTiara, 1, 32767)});
IRecipe nChest = getLastRecipe();
GameRegistry.addShapedRecipe(new ItemStack(ItemListAB.itemNebulaLegs), new Object[] { "ENE", "RHR", "NAN", Character.valueOf('N'), new ItemStack(ItemListAB.itemABResource, 1, 5), Character.valueOf('R'), new ItemStack(ModItems.manaResource, 1, 7), Character.valueOf('H'), new ItemStack(ModItems.terrasteelLegs), Character.valueOf('E'), new ItemStack(ModItems.manaResource, 1, 8), Character.valueOf('A'), new ItemStack(ItemListAB.itemABResource, 1, 3)});
IRecipe nLegs = getLastRecipe();
GameRegistry.addShapedRecipe(new ItemStack(ItemListAB.itemNebulaBoots), new Object[] { "RBR", "NHN", " E ", Character.valueOf('N'), new ItemStack(ItemListAB.itemABResource, 1, 5), Character.valueOf('R'), new ItemStack(ModItems.manaResource, 1, 7), Character.valueOf('H'), new ItemStack(ModItems.terrasteelBoots), Character.valueOf('E'), new ItemStack(ModItems.manaResource, 1, 8), Character.valueOf('B'), new ItemStack(ModItems.speedUpBelt)});
IRecipe nBoots = getLastRecipe();
nebulaArmor = new BLexiconEntry("nebulaArmor", categoryForgotten);
nebulaArmor.setKnowledgeType(forgotten).setLexiconPages(new LexiconPage[] { new PageText("0"), new PageText("1"), BotaniaAPI.internalHandler.craftingRecipePage(".craft", nHelm), BotaniaAPI.internalHandler.craftingRecipePage(".craft", nChest), BotaniaAPI.internalHandler.craftingRecipePage(".craft", nLegs), BotaniaAPI.internalHandler.craftingRecipePage(".craft", nBoots)});
freyrSlingshot = new BLexiconEntry("freyrSlingshot", categoryForgotten);
freyrSlingshot.setKnowledgeType(forgotten).setLexiconPages(new LexiconPage[] { new PageText("0"), new AlphirineCraftPage(slingshotRecipe)});
engineerHopper = new BLexiconEntry("engineerHopper", categoryForgotten);
engineerHopper.setKnowledgeType(forgotten).setLexiconPages(new LexiconPage[] { new PageText("0"), new AlphirineCraftPage(hopperRecipe)});
GameRegistry.addShapedRecipe(new ItemStack(ItemListAB.itemNebulaRod), new Object[] { " WN", " RW", "W ", Character.valueOf('W'), new ItemStack(ModItems.manaResource, 1, 13), Character.valueOf('R'), new ItemStack(ModItems.rune, 1, 8), Character.valueOf('N'), new ItemStack(ItemListAB.itemABResource, 1, 5)});
nebulaRod = new BLexiconEntry("nebulaRod", categoryForgotten);
nebulaRod.setKnowledgeType(forgotten).setLexiconPages(new LexiconPage[] { new PageText("0"), BotaniaAPI.internalHandler.craftingRecipePage(".craft", getLastRecipe())});
for(int i = 0; i < 9; i++) {
boolean[][] patterns = ItemCraftingPattern.getPattern(i);
List<String> str = new ArrayList<String>();
for(int j = 0; j < patterns.length; j++) {
String str1 = "";
for(int k = 0; k < patterns[j].length; k++) {
str1 += patterns[j][k] ? "T" : "H";
}
str.add(str1);
}
GameRegistry.addShapedRecipe(new ItemStack(ItemListAB.itemCraftingPattern, 1, i), new Object[] { str.get(0), str.get(1), str.get(2), Character.valueOf('T'), new ItemStack(ModItems.manaResource, 1, 13), Character.valueOf('H'), new ItemStack(ModItems.rune, 1, 8)});
}
if(Botania.thaumcraftLoaded)
thaumcraft();
addShapelessOreDictRecipe(new ItemStack(ItemListAB.itemABResource, 9, 1), new Object[] { new ItemStack(ItemListAB.itemABResource)});
addShapelessOreDictRecipe(new ItemStack(ItemListAB.itemABResource, 9, 0), new Object[] { new ItemStack(BlockListAB.blockABStorage)});
addShapelessOreDictRecipe(new ItemStack(ItemListAB.itemABResource, 9, 6), new Object[] { new ItemStack(ItemListAB.itemABResource, 1, 5)});
GameRegistry.addShapedRecipe(new ItemStack(BlockListAB.blockABStorage), new Object[] { "III", "III", "III", Character.valueOf('I'), new ItemStack(ItemListAB.itemABResource)});
GameRegistry.addShapedRecipe(new ItemStack(ItemListAB.itemABResource, 1, 5), new Object[] { "III", "III", "III", Character.valueOf('I'), new ItemStack(ItemListAB.itemABResource, 1, 6)});
}
public static void thaumcraft() {
aspecolus = new BLexiconEntry("aspecolus", BotaniaAPI.categoryFunctionalFlowers);
aspecolusRecipe = BotaniaAPI.registerPetalRecipe(ItemBlockSpecialFlower.ofType("aspecolus"), new ItemStack(ModItems.manaResource, 1, 6), new ItemStack(ModItems.manaResource, 1, 5), new ItemStack(ModItems.rune, 1, 1), new ItemStack(ModItems.rune), new ItemStack(ItemListAB.itemABResource, 1, 2), new ItemStack(ModItems.petal, 1, 10), new ItemStack(ModItems.petal, 1, 13));
aspecolus.setKnowledgeType(forgotten).setLexiconPages(new LexiconPage[] { new PageText("0"), BotaniaAPI.internalHandler.petalRecipePage(".petalCraft", aspecolusRecipe) }).setIcon(ItemBlockSpecialFlower.ofType("aspecolus"));
addShapelessOreDictRecipe(new ItemStack(ItemListAB.itemNebulaHelmReveal), new Object[] { new ItemStack(ItemListAB.itemNebulaHelm), new ItemStack(ConfigItems.itemGoggles)});
}
private static IRecipe getLastRecipe() {
return (IRecipe)CraftingManager.getInstance().getRecipeList().get(CraftingManager.getInstance().getRecipeList().size() - 1);
}
private static void addOreDictRecipe(ItemStack output, Object... recipe) {
CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(output, recipe));
}
private static void addShapelessOreDictRecipe(ItemStack output, Object... recipe) {
CraftingManager.getInstance().getRecipeList().add(new ShapelessOreRecipe(output, recipe));
}
}
@@ -0,0 +1,272 @@
package ab.common.block;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12;
import ab.AdvancedBotany;
import ab.common.block.tile.TileMagicCraftCrate;
import ab.common.item.ItemCraftingPattern;
import net.minecraft.block.material.Material;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.Gui;
import net.minecraft.client.gui.ScaledResolution;
import net.minecraft.client.renderer.entity.RenderItem;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.IIcon;
import net.minecraft.util.MathHelper;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import thaumcraft.api.aspects.Aspect;
import thaumcraft.api.aspects.AspectList;
import thaumcraft.client.lib.UtilsFX;
import thaumcraft.common.items.wands.ItemWandCasting;
import thaumcraft.common.lib.crafting.ThaumcraftCraftingManager;
import vazkii.botania.api.wand.IWandHUD;
import vazkii.botania.api.wand.IWandable;
import vazkii.botania.common.block.BlockModContainer;
public class BlockMagicCraftCrate extends BlockModContainer implements IWandable, IWandHUD {
public static final Aspect[] primals = new Aspect[] { Aspect.AIR, Aspect.WATER, Aspect.EARTH, Aspect.FIRE, Aspect.ORDER, Aspect.ENTROPY };
IIcon iconSide;
IIcon iconBottom;
IIcon iconTop;
public IIcon nothing;
public BlockMagicCraftCrate() {
super(Material.wood);
this.setHardness(2.0F);
this.setStepSound(soundTypeWood);
this.setBlockName("magicThaumCrafter");
this.setCreativeTab(AdvancedBotany.tabAB);
}
public void registerBlockIcons(IIconRegister ir) {
iconSide = ir.registerIcon("ab:magicCrateSide");
iconTop = ir.registerIcon("ab:magicCrateTop");
iconBottom = ir.registerIcon("ab:magicCrateBottom");
nothing = ir.registerIcon("ab:nothing");
}
public boolean hasComparatorInputOverride() {
return true;
}
public int getComparatorInputOverride(World par1World, int par2, int par3, int par4, int par5) {
TileMagicCraftCrate crate = (TileMagicCraftCrate) par1World.getTileEntity(par2, par3, par4);
return crate.getSignal();
}
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
TileMagicCraftCrate crate = (TileMagicCraftCrate) world.getTileEntity(x, y, z);
ItemStack stack = player.getHeldItem();
if(player.isSneaking()) {
ItemStack item = crate.getStackInSlot(10);
if(item != null) {
if(stack != null) {
if(!world.isRemote) {
EntityItem e = new EntityItem(world, x + 0.5, y + 1.2f, z + 0.5f, item.copy());
world.spawnEntityInWorld(e);
}
} else
player.inventory.setInventorySlotContents(player.inventory.currentItem, item.copy());
crate.setInventorySlotContents(10, null);
world.playSoundEffect((double) x, (double) y, (double) z, "random.pop", 0.2f, ((world.rand.nextFloat() - world.rand.nextFloat()) * 0.7f + 1.0f) * 1.5f);
crate.markDirty();
return true;
} else {
item = crate.getStackInSlot(11);
if(item != null) {
if(!world.isRemote) {
EntityItem e = new EntityItem(world, x + 0.5, y + 1.2f, z + 0.5f, item.copy());
world.spawnEntityInWorld(e);
}
}
crate.setInventorySlotContents(11, null);
world.playSoundEffect((double) x, (double) y, (double) z, "random.pop", 0.2f, ((world.rand.nextFloat() - world.rand.nextFloat()) * 0.7f + 1.0f) * 1.5f);
crate.markDirty();
return true;
}
}
if(stack == null)
return false;
if(crate.isItemValidForSlot(10, stack)) {
ItemStack wand = crate.getStackInSlot(10);
if(wand != null) {
if(!world.isRemote) {
EntityItem e = new EntityItem(world, x + 0.5f, y + 1.2f, z + 0.5f, wand.copy());
world.spawnEntityInWorld(e);
}
}
crate.setInventorySlotContents(10, stack.copy());
stack.splitStack(1);
world.playSoundEffect((double) x, (double) y, (double) z, "random.pop", 0.2f, ((world.rand.nextFloat() - world.rand.nextFloat()) * 0.7f + 1.0f) * 1.5f);
crate.markDirty();
return true;
}
if(crate.isItemValidForSlot(11, stack)) {
ItemStack thaum = crate.getStackInSlot(11);
if(thaum != null) {
if(!world.isRemote) {
EntityItem e = new EntityItem(world, x, y, z, thaum);
world.spawnEntityInWorld(e);
}
}
crate.setInventorySlotContents(11, stack.copy());
world.playSoundEffect((double) x, (double) y, (double) z, "random.pop", 0.2f, ((world.rand.nextFloat() - world.rand.nextFloat()) * 0.7f + 1.0f) * 1.5f);
stack.splitStack(1);
crate.setPlayer(player);
crate.markDirty();
return true;
}
if(stack.getItem() instanceof ItemCraftingPattern && stack.getItemDamage() != 0) {
boolean[][] pattern = ((ItemCraftingPattern) stack.getItem()).getPattern(stack.getItemDamage());
crate.setPattern(pattern);
stack.splitStack(1);
return true;
}
return false;
}
public IIcon getIcon(int side, int meta) {
switch (side) {
case 0:
return iconBottom;
case 1:
return iconTop;
default:
return iconSide;
}
}
public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) {
switch (side) {
case 0:
return iconBottom;
case 1:
return iconTop;
default:
return iconSide;
}
}
public TileEntity createNewTileEntity(World world, int meta) {
return new TileMagicCraftCrate();
}
public void renderHUD(Minecraft mc, ScaledResolution res, World world, int x, int y, int z) {
TileEntity tile = world.getTileEntity(x, y, z);
if(tile instanceof TileMagicCraftCrate) {
TileMagicCraftCrate craft = (TileMagicCraftCrate) tile;
int width = 52;
int height = 52;
int xc = res.getScaledWidth() / 2 + 20;
int yc = res.getScaledHeight() / 2 - height / 2;
Gui.drawRect(xc - 6 - 3, yc - 6, xc + width + 3, yc + height + 6, 0x2294178a);
Gui.drawRect(xc - 4 - 3, yc - 4, xc + width + 1, yc + height + 4, 0x2294178a);
Gui.drawRect(xc + 60 - 3, yc + 18 - 3, xc + 60 + 16 + 3, yc + 18 + 16 + 3, 0x2294178a);
Gui.drawRect(xc + 60 - 2, yc + 18 - 2, xc + 60 + 16 + 2, yc + 18 + 16 + 2, 0x2294178a);
Gui.drawRect(xc + 60, yc + 18, xc + 60 + 16, yc + 18 + 16, 0x22efd3f4);
AspectList waitingAspects = null;
if (craft.getWaitingStack() != null && craft.getPlayer() != null) {
GL11.glColor4f(1.0f, 1.0f, 1.0f, 0.7f);
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
RenderItem.getInstance().renderItemAndEffectIntoGUI(mc.fontRenderer, mc.renderEngine,
craft.getWaitingStack(), xc + 60, yc + 18);
net.minecraft.client.renderer.RenderHelper.disableStandardItemLighting();
GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
waitingAspects = ThaumcraftCraftingManager.findMatchingArcaneRecipeAspects((IInventory) craft,
craft.getPlayer());
}
if (craft.getStackInSlot(10) != null) {
GL11.glEnable(GL11.GL_BLEND);
ItemStack wand = craft.getStackInSlot(10);
ItemWandCasting itemWand = ((ItemWandCasting) wand.getItem());
AspectList aspects = itemWand.getAllVis(wand);
int n = 0;
for (Aspect a : primals) {
float alpha = 1.0f;
if (waitingAspects != null) {
float amt = (float) waitingAspects.getAmount(a);
if (amt > 0) {
amt *= itemWand.getConsumptionModifier(wand, craft.getPlayer(), a, true);
if (amt * 100.0f > itemWand.getVis(wand, a)) {
alpha = 0.5f + (MathHelper.sin((craft.getPlayer().ticksExisted + n * 10) / 2.0f) * 0.2f
- 0.2f);
}
}
}
int xa = (int) (xc - 45 + Math.cos(0.2f * Math.PI * n + Math.PI / 2) * 45);
int ya = (int) (yc + 16 + Math.sin(0.2f * Math.PI * n + Math.PI / 2) * 45);
float amout = aspects.getAmount(a) + 0.000001f;
UtilsFX.drawTag(xa, ya, a, amout / 100f, 0, 0, 771, alpha, false);
n++;
}
GL11.glDisable(GL11.GL_BLEND);
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
net.minecraft.client.renderer.RenderHelper.disableStandardItemLighting();
}
Gui.drawRect(xc - 28 - 20 - 3, yc + 7 - 3, xc - 28 - 20 + 16 + 3, yc + 7 + 16 + 3, 0x2294178a);
Gui.drawRect(xc - 28 - 20 - 2, yc + 7 - 2, xc - 28 - 20 + 16 + 2, yc + 7 + 16 + 2, 0x2294178a);
Gui.drawRect(xc - 28 - 20, yc + 7, xc - 28 - 20 + 16, yc + 7 + 16, 0x22efd3f4);
net.minecraft.client.renderer.RenderHelper.enableGUIStandardItemLighting();
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
RenderItem.getInstance().renderItemAndEffectIntoGUI(mc.fontRenderer, mc.renderEngine,
craft.getStackInSlot(10), xc - 28 - 20, yc + 8);
net.minecraft.client.renderer.RenderHelper.disableStandardItemLighting();
Gui.drawRect(xc - 28 - 20 - 3, yc + 29 - 3, xc - 28 - 20 + 16 - 3, yc + 29 + 16 + 3, 0x2294178a);
Gui.drawRect(xc - 28 - 20 - 2, yc + 29 - 2, xc - 28 - 20 + 16 + 2, yc + 29 + 16 + 2, 0x2294178a);
Gui.drawRect(xc - 28 - 20, yc + 29, xc - 28 - 20 + 16, yc + 29 + 16, 0x22efd3f4);
net.minecraft.client.renderer.RenderHelper.enableGUIStandardItemLighting();
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
RenderItem.getInstance().renderItemAndEffectIntoGUI(mc.fontRenderer, mc.renderEngine,
craft.getStackInSlot(11), xc - 28 - 20, yc + 29);
net.minecraft.client.renderer.RenderHelper.disableStandardItemLighting();
for (int i = 0; i < 3; i++)
for (int j = 0; j < 3; j++) {
int index = i * 3 + j;
int xp = xc + j * 18 - 3;
int yp = yc + i * 18;
boolean enabled = craft.getPattern()[i][j];
Gui.drawRect(xp, yp, xp + 16, yp + 16, enabled ? 0x22efd3f4 : 0x22fb02a6);
ItemStack item = craft.getStackInSlot(index);
net.minecraft.client.renderer.RenderHelper.enableGUIStandardItemLighting();
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
RenderItem.getInstance().renderItemAndEffectIntoGUI(mc.fontRenderer, mc.renderEngine, item, xp, yp);
net.minecraft.client.renderer.RenderHelper.disableStandardItemLighting();
}
}
}
public boolean renderAsNormalBlock() {
return false;
}
public boolean isOpaqueCube() {
return false;
}
public boolean onUsedByWand(EntityPlayer player, ItemStack stack, World world, int x, int y, int z, int side) {
TileMagicCraftCrate crate = (TileMagicCraftCrate) world.getTileEntity(x, y, z);
crate.ejectAll();
return true;
}
}
@@ -0,0 +1,312 @@
package ab.common.block.tile;
import java.util.List;
import org.lwjgl.opengl.GL11;
import ab.api.IBoundRender;
import ab.client.core.ClientHelper;
import net.minecraft.block.Block;
import net.minecraft.block.BlockChest;
import net.minecraft.block.BlockHopper;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.Gui;
import net.minecraft.client.gui.ScaledResolution;
import net.minecraft.client.renderer.RenderHelper;
import net.minecraft.client.renderer.entity.RenderItem;
import net.minecraft.command.IEntitySelector;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.ISidedInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.IHopper;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.tileentity.TileEntityChest;
import net.minecraft.tileentity.TileEntityHopper;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.ChunkCoordinates;
import net.minecraft.util.Facing;
import net.minecraft.util.MathHelper;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
import vazkii.botania.api.wand.IWandBindable;
import vazkii.botania.client.core.handler.HUDHandler;
import vazkii.botania.common.core.helper.Vector3;
import vazkii.botania.common.item.ModItems;
public class TileEngineerHopper extends TileInventory implements IHopper, IBoundRender {
private int cooldown;
private int[] invPosX = new int[] {0, 0};
private int[] invPosY = new int[] {-1, -1};
private int[] invPosZ = new int[] {0, 0};
private int[] invSide = new int[] {-1, -1};
private boolean bindType;
public void updateEntity() {
if(this.worldObj != null) {
if(!this.worldObj.isRemote) {
if(cooldown > 0)
--this.cooldown;
else if(this.cooldown == 0) {
if(this.worldObj != null && !this.worldObj.isRemote && BlockHopper.func_149917_c(getBlockMetadata())) {
boolean flag = false;
ItemStack stack = this.getStackInSlot(0);
if(stack != null)
flag = canExtractStack();
if(stack == null || stack.stackSize != stack.getMaxStackSize())
flag = canInsertStack(this) || flag;
if(flag)
this.cooldown = 8;
this.markDirty();
}
}
}
}
}
public boolean bindTo(EntityPlayer player, ItemStack wand, int x, int y, int z, int side) {
TileEntity tile = player.getEntityWorld().getTileEntity(x, y, z);
boolean isFar = Math.abs(this.xCoord - x) >= 10 || Math.abs(this.yCoord - y) >= 10 || Math.abs(this.zCoord - z) >= 10;
if(isFar)
return false;
int invCount = bindType ? 0 : 1;
if(tile instanceof TileEngineerHopper)
return false;
else if(tile != null && tile instanceof IInventory) {
setDistantInventory(invCount, x, y, z);
invSide[invCount] = side;
return true;
} else {
setDistantInventory(invCount, 0, -1, 0);
invSide[invCount] = -1;
return false;
}
}
public void changeBindType() {
bindType = !bindType;
}
public void setDistantInventory(int count, int posX, int posY, int posZ) {
invPosX[count] = posX;
invPosY[count] = posY;
invPosZ[count] = posZ;
}
public IInventory getDistantInventory(int count) {
IInventory inv = TileEntityHopper.func_145893_b(this.getWorldObj(), invPosX[count], invPosY[count], invPosZ[count]);
if(inv == null)
setDistantInventory(count, 0, -1, 0);
return inv;
}
public boolean canSelect(EntityPlayer player, ItemStack wand, int x, int y, int z, int side) {
return true;
}
public ChunkCoordinates[] getBlocksCoord() {
return new ChunkCoordinates[] { new ChunkCoordinates(invPosX[0], invPosY[0], invPosZ[0]), new ChunkCoordinates(invPosX[1], invPosY[1], invPosZ[1]) };
}
public ChunkCoordinates getBinding() {
return null;
}
public void renderHUD(Minecraft mc, ScaledResolution res) {
int x = res.getScaledWidth() / 2 - 7;
int y = res.getScaledHeight() / 2 + 16;
GL11.glEnable(3042);
GL11.glBlendFunc(770, 771);
ClientHelper.drawArrow(x - 2, y, false);
for(int i = 0; i < 2; i++) {
ItemStack stack = null;
boolean hasInv = false;
int posX = x + (i == 0 ? 32 : -32);
if(getDistantInventory(i) != null && (TileEntity)getDistantInventory(i) != null) {
TileEntity tile = (TileEntity)getDistantInventory(i);
Block block = tile.getWorldObj().getBlock(tile.xCoord, tile.yCoord, tile.zCoord);
int meta = tile.getWorldObj().getBlockMetadata(tile.xCoord, tile.yCoord, tile.zCoord);
stack = new ItemStack(block, 1, meta);
hasInv = true;
}
Gui.drawRect(posX - 4, y - 4, posX + 20, y + 20, 1140850688);
Gui.drawRect(posX - 2, y - 2, posX + 18, y + 18, 1140850688);
if(stack != null) {
RenderHelper.enableGUIStandardItemLighting();
GL11.glEnable(32826);
RenderItem.getInstance().renderItemAndEffectIntoGUI(mc.fontRenderer, mc.renderEngine, stack, posX, y);
RenderHelper.disableStandardItemLighting();
GL11.glDisable(2929);
}
int invCount = bindType ? 0 : 1;
if(invCount == i) {
GL11.glTranslatef(0.0f, 0.0f, 300.0f);
RenderHelper.enableGUIStandardItemLighting();
GL11.glEnable(32826);
RenderItem.getInstance().renderItemIntoGUI(mc.fontRenderer, mc.renderEngine, new ItemStack(ModItems.twigWand), posX + 10, y + 7);
RenderHelper.disableStandardItemLighting();
GL11.glDisable(2929);
GL11.glTranslatef(0.0f, 0.0f, -300.0f);
}
boolean unicode = mc.fontRenderer.getUnicodeFlag();
mc.fontRenderer.setUnicodeFlag(true);
if(!hasInv) {
mc.fontRenderer.drawStringWithShadow("\u2717", posX + 5, y + 6, 4980736);
mc.fontRenderer.drawStringWithShadow("\u2717", posX + 5, y + 5, 13764621);
}
mc.fontRenderer.setUnicodeFlag(unicode);
GL11.glEnable(2929);
}
GL11.glDisable(3042);
}
public void writeCustomNBT(NBTTagCompound nbtt) {
super.writeCustomNBT(nbtt);
nbtt.setInteger("cooldown", this.cooldown);
nbtt.setBoolean("bindType", this.bindType);
nbtt.setIntArray("bindingX", this.invPosX);
nbtt.setIntArray("bindingY", this.invPosY);
nbtt.setIntArray("bindingZ", this.invPosZ);
nbtt.setIntArray("bindingSide", this.invSide);
}
public void readCustomNBT(NBTTagCompound nbtt) {
super.readCustomNBT(nbtt);
this.cooldown = nbtt.getInteger("cooldown");
this.bindType = nbtt.getBoolean("bindType");
this.invPosX = nbtt.getIntArray("bindingX");
this.invPosY = nbtt.getIntArray("bindingY");
this.invPosZ = nbtt.getIntArray("bindingZ");
this.invSide = nbtt.getIntArray("bindingSide");
}
private boolean canExtractStack() {
IInventory inv = getDistantInventory(0);
if(inv == null)
return false;
else {
int side = invSide[0];
if(!canPull(inv, side))
return false;
else {
if(getStackInSlot(0) != null) {
ItemStack itemstack = getStackInSlot(0).copy();
ItemStack itemstack1 = TileEntityHopper.func_145889_a(inv, this.decrStackSize(0, 8), side);
if(itemstack1 == null || itemstack1.stackSize == 0) {
inv.markDirty();
return true;
}
this.setInventorySlotContents(0, itemstack);
}
return false;
}
}
}
private boolean canPull(IInventory inv, int side) {
if(inv instanceof ISidedInventory && side > -1) {
ISidedInventory sideInv = (ISidedInventory)inv;
int[] slots = sideInv.getAccessibleSlotsFromSide(side);
for(int i = 0; i < slots.length; ++i) {
ItemStack stack = sideInv.getStackInSlot(slots[i]);
if(stack == null || stack.stackSize != stack.getMaxStackSize())
return true;
}
} else {
int size = inv.getSizeInventory();
for(int i = 0; i < size; ++i) {
ItemStack stack = inv.getStackInSlot(i);
if(stack == null || stack.stackSize != stack.getMaxStackSize())
return true;
}
}
return false;
}
private boolean canInsertStack(IHopper hopper) {
boolean hasDistantInv = getDistantInventory(1) != null;
IInventory inv = getDistantInventory(1);
if(inv != null) {
int b0 = hasDistantInv ? invSide[1] : 0;
if(!canTake(inv, b0))
return false;
if(inv instanceof ISidedInventory && b0 > -1) {
ISidedInventory sidedInv = (ISidedInventory)inv;
int[] slots = sidedInv.getAccessibleSlotsFromSide(b0);
for(int k = 0; k < slots.length; ++k) {
if(func_145892_a(hopper, inv, slots[k], b0)) {
return true;
}
}
} else {
int i = inv.getSizeInventory();
for(int j = 0; j < i; ++j) {
if(func_145892_a(hopper, inv, j, b0)) {
return true;
}
}
}
}
return false;
}
private boolean canTake(IInventory inv, int side) {
if(inv instanceof ISidedInventory && side > -1) {
ISidedInventory isidedinventory = (ISidedInventory)inv;
int[] aint = isidedinventory.getAccessibleSlotsFromSide(side);
for(int l = 0; l < aint.length; ++l) {
if(isidedinventory.getStackInSlot(aint[l]) != null)
return true;
}
} else {
int j = inv.getSizeInventory();
for(int k = 0; k < j; ++k) {
if(inv.getStackInSlot(k) != null)
return true;
}
}
return false;
}
private static boolean func_145892_a(IHopper hopper, IInventory inv, int slot, int side) {
ItemStack itemstack = inv.getStackInSlot(slot);
if(itemstack != null && func_145890_b(inv, itemstack, slot, side)) {
ItemStack itemstack1 = itemstack.copy();
ItemStack itemstack2 = TileEntityHopper.func_145889_a(hopper, inv.decrStackSize(slot, 8), -1);
if(itemstack2 == null || itemstack2.stackSize == 0) {
inv.markDirty();
return true;
}
inv.setInventorySlotContents(slot, itemstack1);
}
return false;
}
private static boolean func_145890_b(IInventory inv, ItemStack stack, int slot, int side) {
return !(inv instanceof ISidedInventory) || ((ISidedInventory)inv).canExtractItem(slot, stack, side);
}
public int getSizeInventory() {
return 1;
}
public String getInventoryName() {
return "engineerHopper";
}
public double getXPos() {
return this.xCoord;
}
public double getYPos() {
return this.yCoord;
}
public double getZPos() {
return this.zCoord;
}
}
@@ -0,0 +1,84 @@
package ab.common.entity;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.projectile.EntityThrowable;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
public class EntitySword extends EntityThrowable {
public EntitySword(World world) {
super(world);
}
public EntitySword(World world, EntityPlayer e, ItemStack stack) {
super(world, e);
}
protected void entityInit() {
super.entityInit();
this.dataWatcher.addObject(27, new ItemStack(Items.diamond_sword));
this.dataWatcher.setObjectWatched(27);
this.dataWatcher.addObject(28, Float.valueOf(0.0f));
this.dataWatcher.setObjectWatched(28);
}
public void onUpdate() {
super.onUpdate();
if(ticksExisted > 240)
setDead();
}
@SideOnly(Side.CLIENT)
public void setPositionAndRotation2(double x, double y, double z, float help, float me, int please) {}
protected void onImpact(MovingObjectPosition mov) {
Block block = this.worldObj.getBlock(mov.blockX, mov.blockY, mov.blockZ);
if(block != null && (block instanceof net.minecraft.block.BlockBush || block instanceof net.minecraft.block.BlockLeaves))
return;
}
public ItemStack getSword() {
return this.dataWatcher.getWatchableObjectItemStack(27);
}
public void setSword(ItemStack stack) {
this.dataWatcher.updateObject(27, stack);
}
public float getRotation() {
return this.dataWatcher.getWatchableObjectFloat(28);
}
public void setRotation(float rot) {
this.dataWatcher.updateObject(28, rot);
}
public void readEntityFromNBT(NBTTagCompound nbtt) {
super.readEntityFromNBT(nbtt);
ticksExisted = nbtt.getInteger("ticks");
NBTTagCompound stackCmp = nbtt.getCompoundTag("sword");
ItemStack stack = ItemStack.loadItemStackFromNBT(stackCmp);
setSword(stack);
}
public void writeEntityToNBT(NBTTagCompound nbtt) {
super.writeEntityToNBT(nbtt);
nbtt.setInteger("ticks", ticksExisted);
ItemStack stack = getSword();
NBTTagCompound stackNbt = new NBTTagCompound();
if(stack != null)
stack.writeToNBT(stackNbt);
nbtt.setTag("sword", stackNbt);
}
protected float getGravityVelocity() {
return 0.0F;
}
}
@@ -0,0 +1,250 @@
package ab.common.lib.register;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import ab.api.AdvancedBotanyAPI;
import ab.api.recipe.RecipeAdvancedPlate;
import ab.api.recipe.RecipeAncientAlphirine;
import ab.api.recipe.lexicon.AdvancedPlateCraftPage;
import ab.api.recipe.lexicon.AlphirineCraftPage;
import ab.common.block.tile.TileAgglomerationPlate;
import ab.common.block.tile.TileLebethronCore;
import ab.common.block.tile.TileMagicCraftCrate;
import ab.common.item.ItemCraftingPattern;
import cpw.mods.fml.common.registry.GameRegistry;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.CraftingManager;
import net.minecraft.item.crafting.IRecipe;
import net.minecraft.util.EnumChatFormatting;
import net.minecraftforge.oredict.ShapedOreRecipe;
import net.minecraftforge.oredict.ShapelessOreRecipe;
import thaumcraft.common.config.ConfigItems;
import vazkii.botania.api.BotaniaAPI;
import vazkii.botania.api.lexicon.KnowledgeType;
import vazkii.botania.api.lexicon.LexiconCategory;
import vazkii.botania.api.lexicon.LexiconEntry;
import vazkii.botania.api.lexicon.LexiconPage;
import vazkii.botania.api.recipe.RecipePetals;
import vazkii.botania.common.Botania;
import vazkii.botania.common.block.ModBlocks;
import vazkii.botania.common.item.ModItems;
import vazkii.botania.common.item.block.ItemBlockSpecialFlower;
import vazkii.botania.common.lexicon.BLexiconCategory;
import vazkii.botania.common.lexicon.BLexiconEntry;
import vazkii.botania.common.lexicon.page.PageText;
public class RecipeListAB {
public static LexiconCategory categoryForgotten;
public static RecipeAncientAlphirine lebethroneRecipe;
public static RecipeAncientAlphirine forgottenLandRecipe;
public static RecipeAncientAlphirine advancedSparkRecipe;
public static RecipeAncientAlphirine manaFlowerRecipe;
public static RecipeAncientAlphirine slingshotRecipe;
public static RecipeAncientAlphirine hopperRecipe;
public static RecipeAdvancedPlate manaStarRecipe;
public static RecipeAdvancedPlate terrasteelRecipe;
public static RecipeAdvancedPlate mithrillRecipe;
public static RecipeAdvancedPlate nebulaRecipe;
public static RecipePetals alphirineRecipe;
public static RecipePetals dictariusRecipe;
public static RecipePetals aspecolusRecipe;
public static LexiconEntry advandedAgglomerationPlate;
public static LexiconEntry ancientAlphirine;
public static LexiconEntry lebethronWood;
public static LexiconEntry lebethronSpreader;
public static LexiconEntry mithrill;
public static LexiconEntry manaContainer;
public static LexiconEntry manaCrystalCube;
public static LexiconEntry terraHoe;
public static LexiconEntry manaRings;
public static LexiconEntry manaFlower;
public static LexiconEntry mithrillSword;
public static LexiconEntry nebula;
public static LexiconEntry blackHalo;
public static LexiconEntry antigravityCharm;
public static LexiconEntry nebulaBlaze;
public static LexiconEntry aspecolus;
public static LexiconEntry dictarius;
public static LexiconEntry manaCharger;
public static LexiconEntry nebulaArmor;
public static LexiconEntry freyrSlingshot;
public static LexiconEntry engineerHopper;
public static LexiconEntry nebulaRod;
public static LexiconEntry thaumAutoCraft;
public static KnowledgeType forgotten;
public static void init() {
BotaniaAPI.addCategory(categoryForgotten = new BLexiconCategory("forgotten", 5));
forgotten = BotaniaAPI.registerKnowledgeType("ab_forgotten", EnumChatFormatting.BLUE, false);
lebethroneRecipe = AdvancedBotanyAPI.registerAlphirineRecipe(new ItemStack(BlockListAB.blockLebethron), new ItemStack(ModBlocks.dreamwood, 1, 0), 15);
forgottenLandRecipe = AdvancedBotanyAPI.registerAlphirineRecipe(new ItemStack(ItemListAB.itemABResource, 1, 3), new ItemStack(ModItems.manaResource, 1, 15), 75);
advancedSparkRecipe = AdvancedBotanyAPI.registerAlphirineRecipe(new ItemStack(ItemListAB.itemAdvancedSpark), new ItemStack(ModItems.spark), 11);
manaFlowerRecipe = AdvancedBotanyAPI.registerAlphirineRecipe(new ItemStack(ItemListAB.itemABResource, 1, 4), new ItemStack(ModBlocks.flower, 1, 32767), 32);
slingshotRecipe = AdvancedBotanyAPI.registerAlphirineRecipe(new ItemStack(ItemListAB.itemFreyrSlingshot), new ItemStack(ModItems.slingshot), 66);
hopperRecipe = AdvancedBotanyAPI.registerAlphirineRecipe(new ItemStack(BlockListAB.blockEngineerHopper), new ItemStack(Blocks.hopper), 23);
mithrillRecipe = AdvancedBotanyAPI.registerAdvancedPlateRecipe(new ItemStack(ItemListAB.itemABResource, 1, 0), new ItemStack(ModItems.manaResource, 1, 5), new ItemStack(ModBlocks.storage, 1, 0), new ItemStack(ModItems.manaResource, 1, 18), 7500000, 0x25d6b7);
terrasteelRecipe = AdvancedBotanyAPI.registerAdvancedPlateRecipe(new ItemStack(ModItems.manaResource, 1, 4), new ItemStack(ModItems.manaResource, 1, 2), new ItemStack(ModItems.manaResource, 1, 0), new ItemStack(ModItems.manaResource, 1, 1), 500000, 0x29de20);
manaStarRecipe = AdvancedBotanyAPI.registerAdvancedPlateRecipe(new ItemStack(ItemListAB.itemABResource, 1, 2), new ItemStack(ModItems.manaResource, 1, 23), new ItemStack(ModItems.manaResource, 1, 5), new ItemStack(Items.nether_star), 250000, 0x6bc9ec);
nebulaRecipe = AdvancedBotanyAPI.registerAdvancedPlateRecipe(new ItemStack(ItemListAB.itemABResource, 1, 5), new ItemStack(ModItems.manaResource, 1, 8), new ItemStack(ModBlocks.storage, 1, 4), new ItemStack(ItemListAB.itemABResource, 1, 1), 50000000, 0x8d16e0);
ancientAlphirine = new BLexiconEntry("ancientAlphirine", categoryForgotten);
alphirineRecipe = BotaniaAPI.registerPetalRecipe(ItemBlockSpecialFlower.ofType("ancientAlphirine"), new ItemStack(ModItems.manaResource, 1, 5), new ItemStack(ModItems.manaResource, 1, 5), new ItemStack(ModItems.manaResource, 1, 5), new ItemStack(ModItems.manaResource, 1, 5), new ItemStack(ModItems.rune, 1, 8), new ItemStack(ModItems.rune, 1, 4), new ItemStack(ModItems.rune, 1, 5), new ItemStack(ModItems.rune, 1, 6), new ItemStack(ModItems.rune, 1, 7), new ItemStack(ModItems.petal, 1, 1), new ItemStack(ModItems.petal, 1, 4));
ancientAlphirine.setPriority().setKnowledgeType(BotaniaAPI.elvenKnowledge).setLexiconPages(new LexiconPage[] { new PageText("0"), new PageText("1"), BotaniaAPI.internalHandler.petalRecipePage(".petalCraft", alphirineRecipe), new AlphirineCraftPage(forgottenLandRecipe) }).setIcon(ItemBlockSpecialFlower.ofType("ancientAlphirine"));
GameRegistry.addShapedRecipe(new ItemStack(BlockListAB.blockABPlate), new Object[] { " ", "MPM", "BRB", Character.valueOf('M'), new ItemStack(ModBlocks.storage), Character.valueOf('P'), new ItemStack(ModBlocks.terraPlate), Character.valueOf('B'), new ItemStack(ItemListAB.itemABResource, 1, 3), Character.valueOf('R'), new ItemStack(ModItems.rune, 1, 3)});
advandedAgglomerationPlate = new BLexiconEntry("advancedPlate", categoryForgotten);
advandedAgglomerationPlate.setKnowledgeType(forgotten).setLexiconPages(new LexiconPage[] {new PageText("0"), BotaniaAPI.internalHandler.craftingRecipePage(".craft", getLastRecipe()), BotaniaAPI.internalHandler.multiblockPage(".structure", TileAgglomerationPlate.makeMultiblockSet()), new AdvancedPlateCraftPage(terrasteelRecipe, "0"), new AdvancedPlateCraftPage(manaStarRecipe, "1") }).setIcon(new ItemStack(BlockListAB.blockABPlate));
GameRegistry.addShapedRecipe(new ItemStack(BlockListAB.blockABSpreader), new Object[] { "WMW", "PSP", "WMW", Character.valueOf('M'), new ItemStack(ItemListAB.itemABResource, 1, 2), Character.valueOf('P'), new ItemStack(ModBlocks.pylon), Character.valueOf('S'), new ItemStack(ModBlocks.spreader, 1, 3), Character.valueOf('W'), new ItemStack(BlockListAB.blockLebethron, 1, 4)});
lebethronSpreader = new BLexiconEntry("lebethronSpreader", categoryForgotten);
lebethronSpreader.setKnowledgeType(forgotten).setLexiconPages(new LexiconPage[] { new PageText("0"), BotaniaAPI.internalHandler.craftingRecipePage(".craft", getLastRecipe()) }).setIcon(new ItemStack(BlockListAB.blockABSpreader));
addShapelessOreDictRecipe(new ItemStack(BlockListAB.blockLebethron, 4, 1), new Object[] { new ItemStack(BlockListAB.blockLebethron)});
IRecipe leb1 = getLastRecipe();
addShapelessOreDictRecipe(new ItemStack(BlockListAB.blockLebethron, 1, 2), new Object[] { new ItemStack(BlockListAB.blockLebethron, 1, 1), new ItemStack(Items.wheat_seeds)});
IRecipe leb2 = getLastRecipe();
addShapelessOreDictRecipe(new ItemStack(BlockListAB.blockLebethron, 1, 3), new Object[] { new ItemStack(BlockListAB.blockLebethron), new ItemStack(Items.glowstone_dust)});
IRecipe leb3 = getLastRecipe();
GameRegistry.addShapedRecipe(new ItemStack(BlockListAB.blockLebethron, 1, 4), new Object[] { "4W5", "WPW", "6W7", Character.valueOf('P'), new ItemStack(ModBlocks.pylon, 1, 1), Character.valueOf('W'), new ItemStack(BlockListAB.blockLebethron), Character.valueOf('4'), new ItemStack(ModItems.rune, 1, 4), Character.valueOf('5'), new ItemStack(ModItems.rune, 1, 5), Character.valueOf('6'), new ItemStack(ModItems.rune, 1, 6), Character.valueOf('7'), new ItemStack(ModItems.rune, 1, 7)});
IRecipe leb4 = getLastRecipe();
lebethronWood = new BLexiconEntry("lebethronWood", categoryForgotten);
lebethronWood.setKnowledgeType(forgotten).setLexiconPages(new LexiconPage[] { new PageText("0"), new AlphirineCraftPage(lebethroneRecipe), BotaniaAPI.internalHandler.craftingRecipePage(".craft0", leb1), BotaniaAPI.internalHandler.craftingRecipePage(".craft0", leb2), BotaniaAPI.internalHandler.craftingRecipePage(".craft0", leb3), BotaniaAPI.internalHandler.craftingRecipePage(".craft0", leb4), new PageText("1"), BotaniaAPI.internalHandler.multiblockPage(".structure", TileLebethronCore.makeMultiblockSet()) }).setIcon(new ItemStack(BlockListAB.blockLebethron));
GameRegistry.addShapedRecipe(new ItemStack(ItemListAB.itemMihrillMultiTool), new Object[] { " MB", " FM", "F ", Character.valueOf('F'), new ItemStack(ModItems.manaResource, 1, 3), Character.valueOf('B'), new ItemStack(ModBlocks.livingwood), Character.valueOf('M'), new ItemStack(ItemListAB.itemABResource)});
mithrill = new BLexiconEntry("mithrill", categoryForgotten);
mithrill.setKnowledgeType(forgotten).setLexiconPages(new LexiconPage[] { new PageText("0"), new AdvancedPlateCraftPage(mithrillRecipe), new PageText("1"), BotaniaAPI.internalHandler.craftingRecipePage(".craft", getLastRecipe()) }).setIcon(new ItemStack(ItemListAB.itemMihrillMultiTool));
GameRegistry.addShapedRecipe(new ItemStack(BlockListAB.blockManaContainer), new Object[] { "MGM", "LPL", "M3M", Character.valueOf('M'), new ItemStack(ItemListAB.itemABResource), Character.valueOf('L'), new ItemStack(ModBlocks.pool), Character.valueOf('P'), new ItemStack(ModBlocks.pylon), Character.valueOf('3'), new ItemStack(ModItems.rune, 1, 3), Character.valueOf('G'), new ItemStack(ModItems.rune, 1, 15)});
IRecipe cont1 = getLastRecipe();
GameRegistry.addShapedRecipe(new ItemStack(BlockListAB.blockManaContainer, 1, 1), new Object[] { "MGM", "LPL", "M3M", Character.valueOf('M'), new ItemStack(ItemListAB.itemABResource, 1, 1), Character.valueOf('L'), new ItemStack(ModBlocks.pool, 1, 2), Character.valueOf('P'), new ItemStack(ModBlocks.pylon), Character.valueOf('3'), new ItemStack(ModItems.rune, 1, 3), Character.valueOf('G'), new ItemStack(ModItems.rune, 1, 15)});
IRecipe cont2 = getLastRecipe();
GameRegistry.addShapedRecipe(new ItemStack(BlockListAB.blockManaContainer, 1, 2), new Object[] { "MGM", "LPL", "M3M", Character.valueOf('M'), new ItemStack(ItemListAB.itemABResource), Character.valueOf('L'), new ItemStack(ModBlocks.pool, 1, 3), Character.valueOf('P'), new ItemStack(ModBlocks.pylon), Character.valueOf('3'), new ItemStack(ModItems.rune, 1, 3), Character.valueOf('G'), new ItemStack(ModItems.rune, 1, 15)});
IRecipe cont3 = getLastRecipe();
manaContainer = new BLexiconEntry("manaContainer", categoryForgotten);
manaContainer.setKnowledgeType(forgotten).setLexiconPages(new LexiconPage[] { new PageText("0"), BotaniaAPI.internalHandler.craftingRecipePage(".craft0", cont1), BotaniaAPI.internalHandler.craftingRecipePage(".craft1", cont2), BotaniaAPI.internalHandler.craftingRecipePage(".craft2", cont3), new PageText("1"), new AlphirineCraftPage(advancedSparkRecipe) }).setIcon(new ItemStack(BlockListAB.blockManaContainer));
GameRegistry.addShapedRecipe(new ItemStack(BlockListAB.blockManaCrystalCube), new Object[] { "TST", "GWG", "DMD", Character.valueOf('D'), new ItemStack(ModBlocks.dreamwood), Character.valueOf('W'), new ItemStack(ModItems.twigWand, 1, 32767), Character.valueOf('G'), new ItemStack(ModBlocks.manaGlass), Character.valueOf('M'), new ItemStack(ModItems.manaResource), Character.valueOf('T'), new ItemStack(ModItems.manaResource, 1, 18), Character.valueOf('S'), new ItemStack(ModItems.spark)});
manaCrystalCube = new BLexiconEntry("manaCrystalCube", BotaniaAPI.categoryMana);
manaCrystalCube.setKnowledgeType(BotaniaAPI.elvenKnowledge).setLexiconPages(new LexiconPage[] { new PageText("0"), BotaniaAPI.internalHandler.craftingRecipePage(".craft", getLastRecipe()) }).setIcon(new ItemStack(BlockListAB.blockManaCrystalCube));
GameRegistry.addShapedRecipe(new ItemStack(ItemListAB.itemTerraHoe), new Object[] { "TTL", "RW ", " W ", Character.valueOf('T'), new ItemStack(ModItems.manaResource, 1, 4), Character.valueOf('L'), new ItemStack(ModItems.manaResource, 1, 18), Character.valueOf('W'), new ItemStack(ModItems.manaResource, 1, 3), Character.valueOf('R'), new ItemStack(ModItems.rune, 1, 2)});
terraHoe = new BLexiconEntry("terraHoe", BotaniaAPI.categoryTools);
terraHoe.setLexiconPages(new LexiconPage[]{ new PageText("0"), BotaniaAPI.internalHandler.craftingRecipePage(".craft", getLastRecipe()) }).setIcon(new ItemStack(ItemListAB.itemTerraHoe));
GameRegistry.addShapedRecipe(new ItemStack(ItemListAB.itemMithrillRing), new Object[] { "LML", "MRM", "LML", Character.valueOf('M'), new ItemStack(ItemListAB.itemABResource), Character.valueOf('L'), new ItemStack(ItemListAB.itemABResource, 1, 1), Character.valueOf('R'), new ItemStack(ModItems.manaRingGreater)});
IRecipe ring1 = getLastRecipe();
GameRegistry.addShapedRecipe(new ItemStack(ItemListAB.itemNebulaRing), new Object[] { "LML", "MRM", "LML", Character.valueOf('M'), new ItemStack(ItemListAB.itemABResource, 1, 6), Character.valueOf('L'), new ItemStack(ModItems.manaResource, 1, 5), Character.valueOf('R'), new ItemStack(ItemListAB.itemMithrillRing)});
IRecipe ring2 = getLastRecipe();
manaRings = new BLexiconEntry("manaRings", categoryForgotten);
manaRings.setKnowledgeType(forgotten).setLexiconPages(new LexiconPage[]{ new PageText("0"), BotaniaAPI.internalHandler.craftingRecipePage(".craft0", ring1), BotaniaAPI.internalHandler.craftingRecipePage(".craft1", ring2)}).setIcon(new ItemStack(ItemListAB.itemMithrillRing));
AdvancedBotanyAPI.registerFarmlandSeed(Blocks.nether_wart, 3);
GameRegistry.addShapedRecipe(new ItemStack(ItemListAB.itemManaFlower), new Object[] { " F ", " M ", " R ", Character.valueOf('F'), new ItemStack(ItemListAB.itemABResource, 1, 4), Character.valueOf('M'), new ItemStack(ModItems.manaBottle), Character.valueOf('R'), new ItemStack(ModItems.rune, 1, 8)});
manaFlower = new BLexiconEntry("manaFlower", categoryForgotten);
manaFlower.setKnowledgeType(forgotten).setLexiconPages(new LexiconPage[] { new PageText("0"), new AlphirineCraftPage(manaFlowerRecipe), BotaniaAPI.internalHandler.craftingRecipePage(".craft", getLastRecipe())}).setIcon(new ItemStack(ItemListAB.itemManaFlower));
GameRegistry.addShapedRecipe(new ItemStack(ItemListAB.itemMithrillSword), new Object[] { " M", "SM ", "WS ", Character.valueOf('S'), new ItemStack(ItemListAB.itemABResource, 1, 6), Character.valueOf('T'), new ItemStack(ModItems.terraSword), Character.valueOf('M'), new ItemStack(ItemListAB.itemABResource), Character.valueOf('W'), new ItemStack(ModItems.manaResource, 1, 3)});
mithrillSword = new BLexiconEntry("mithrillSword", categoryForgotten);
mithrillSword.setKnowledgeType(forgotten).setLexiconPages(new LexiconPage[] { new PageText("0"), BotaniaAPI.internalHandler.craftingRecipePage(".craft", getLastRecipe()) }).setIcon(new ItemStack(ItemListAB.itemMithrillSword));
dictariusRecipe = BotaniaAPI.registerPetalRecipe(ItemBlockSpecialFlower.ofType("dictarius"), new ItemStack(ItemListAB.itemABResource, 1, 4), new ItemStack(ModItems.manaResource, 1, 5), new ItemStack(ModItems.manaResource, 1, 5), new ItemStack(ModItems.rune, 1, 15), new ItemStack(ModItems.petal, 1, 4), new ItemStack(ModItems.petal, 1, 4), new ItemStack(ModItems.petal, 1, 1));
dictarius = new BLexiconEntry("dictarius", BotaniaAPI.categoryGenerationFlowers);
dictarius.setKnowledgeType(forgotten).setLexiconPages(new LexiconPage[] { new PageText("0"), BotaniaAPI.internalHandler.petalRecipePage(".petalCraft", dictariusRecipe)});
nebula = new BLexiconEntry("nebula", categoryForgotten);
nebula.setKnowledgeType(forgotten).setLexiconPages(new LexiconPage[] { new PageText("0"), new AdvancedPlateCraftPage(nebulaRecipe)});
GameRegistry.addShapedRecipe(new ItemStack(ItemListAB.itemBlackHalo), new Object[] { " E ", "DHD", " E ", Character.valueOf('E'), new ItemStack(ModItems.manaResource, 1, 7), Character.valueOf('H'), new ItemStack(ModItems.autocraftingHalo), Character.valueOf('D'), new ItemStack(ModItems.blackHoleTalisman)});
blackHalo = new BLexiconEntry("blackHalo", BotaniaAPI.categoryTools);
blackHalo.setKnowledgeType(BotaniaAPI.elvenKnowledge).setLexiconPages(new LexiconPage[] { new PageText("0"), BotaniaAPI.internalHandler.craftingRecipePage(".craft", getLastRecipe())});
GameRegistry.addShapedRecipe(new ItemStack(ItemListAB.itemAntigravityCharm), new Object[] { " G ", "GDG", "ERE", Character.valueOf('E'), new ItemStack(ModItems.manaResource, 1, 7), Character.valueOf('G'), new ItemStack(ModBlocks.elfGlass), Character.valueOf('D'), new ItemStack(ModBlocks.floatingFlower, 1, 32767), Character.valueOf('R'), new ItemStack(ModItems.rune, 1, 3)});
antigravityCharm = new BLexiconEntry("antigravityCharm", BotaniaAPI.categoryTools);
antigravityCharm.setKnowledgeType(BotaniaAPI.elvenKnowledge).setLexiconPages(new LexiconPage[] { new PageText("0"), BotaniaAPI.internalHandler.craftingRecipePage(".craft", getLastRecipe())}).setIcon(new ItemStack(ItemListAB.itemAntigravityCharm));
GameRegistry.addShapedRecipe(new ItemStack(ItemListAB.itemNebulaBlaze), new Object[] { " N ", "MMN", "AMN", Character.valueOf('N'), new ItemStack(ItemListAB.itemABResource, 1, 6), Character.valueOf('A'), new ItemStack(ItemListAB.itemABResource, 1, 3), Character.valueOf('M'), new ItemStack(ModBlocks.storage)});
nebulaBlaze = new BLexiconEntry("nebulaBlaze", categoryForgotten);
nebulaBlaze.setKnowledgeType(forgotten).setLexiconPages(new LexiconPage[] { new PageText("0"), BotaniaAPI.internalHandler.craftingRecipePage(".craft", getLastRecipe())});
GameRegistry.addShapedRecipe(new ItemStack(BlockListAB.blockManaCharger), new Object[] { "NLN", "MPM", " R ", Character.valueOf('N'), new ItemStack(ItemListAB.itemABResource, 1, 1), Character.valueOf('L'), new ItemStack(ModBlocks.livingrock), Character.valueOf('M'), new ItemStack(ModBlocks.bellows), Character.valueOf('P'), new ItemStack(ModBlocks.pylon), Character.valueOf('R'), new ItemStack(ModItems.rune, 1, 8)});
manaCharger = new BLexiconEntry("manaCharger", categoryForgotten);
manaCharger.setKnowledgeType(forgotten).setLexiconPages(new LexiconPage[] { new PageText("0"), BotaniaAPI.internalHandler.craftingRecipePage(".craft", getLastRecipe())});
GameRegistry.addShapedRecipe(new ItemStack(ItemListAB.itemNebulaHelm), new Object[] { "RNR", "NHN", " E ", Character.valueOf('N'), new ItemStack(ItemListAB.itemABResource, 1, 5), Character.valueOf('R'), new ItemStack(ModItems.manaResource, 1, 7), Character.valueOf('H'), new ItemStack(ModItems.terrasteelHelm), Character.valueOf('E'), new ItemStack(ModItems.manaResource, 1, 8)});
IRecipe nHelm = getLastRecipe();
GameRegistry.addShapedRecipe(new ItemStack(ItemListAB.itemNebulaChest), new Object[] { "RTR", "NHN", "ENE", Character.valueOf('N'), new ItemStack(ItemListAB.itemABResource, 1, 5), Character.valueOf('R'), new ItemStack(ModItems.manaResource, 1, 7), Character.valueOf('H'), new ItemStack(ModItems.terrasteelChest), Character.valueOf('E'), new ItemStack(ModItems.manaResource, 1, 8), Character.valueOf('T'), new ItemStack(ModItems.flightTiara, 1, 32767)});
IRecipe nChest = getLastRecipe();
GameRegistry.addShapedRecipe(new ItemStack(ItemListAB.itemNebulaLegs), new Object[] { "ENE", "RHR", "NAN", Character.valueOf('N'), new ItemStack(ItemListAB.itemABResource, 1, 5), Character.valueOf('R'), new ItemStack(ModItems.manaResource, 1, 7), Character.valueOf('H'), new ItemStack(ModItems.terrasteelLegs), Character.valueOf('E'), new ItemStack(ModItems.manaResource, 1, 8), Character.valueOf('A'), new ItemStack(ItemListAB.itemABResource, 1, 3)});
IRecipe nLegs = getLastRecipe();
GameRegistry.addShapedRecipe(new ItemStack(ItemListAB.itemNebulaBoots), new Object[] { "RBR", "NHN", " E ", Character.valueOf('N'), new ItemStack(ItemListAB.itemABResource, 1, 5), Character.valueOf('R'), new ItemStack(ModItems.manaResource, 1, 7), Character.valueOf('H'), new ItemStack(ModItems.terrasteelBoots), Character.valueOf('E'), new ItemStack(ModItems.manaResource, 1, 8), Character.valueOf('B'), new ItemStack(ModItems.speedUpBelt)});
IRecipe nBoots = getLastRecipe();
nebulaArmor = new BLexiconEntry("nebulaArmor", categoryForgotten);
nebulaArmor.setKnowledgeType(forgotten).setLexiconPages(new LexiconPage[] { new PageText("0"), new PageText("1"), BotaniaAPI.internalHandler.craftingRecipePage(".craft", nHelm), BotaniaAPI.internalHandler.craftingRecipePage(".craft", nChest), BotaniaAPI.internalHandler.craftingRecipePage(".craft", nLegs), BotaniaAPI.internalHandler.craftingRecipePage(".craft", nBoots)});
freyrSlingshot = new BLexiconEntry("freyrSlingshot", categoryForgotten);
freyrSlingshot.setKnowledgeType(forgotten).setLexiconPages(new LexiconPage[] { new PageText("0"), new AlphirineCraftPage(slingshotRecipe)});
engineerHopper = new BLexiconEntry("engineerHopper", categoryForgotten);
engineerHopper.setKnowledgeType(forgotten).setLexiconPages(new LexiconPage[] { new PageText("0"), new AlphirineCraftPage(hopperRecipe)});
GameRegistry.addShapedRecipe(new ItemStack(ItemListAB.itemNebulaRod), new Object[] { " WN", " RW", "W ", Character.valueOf('W'), new ItemStack(ModItems.manaResource, 1, 13), Character.valueOf('R'), new ItemStack(ModItems.rune, 1, 8), Character.valueOf('N'), new ItemStack(ItemListAB.itemABResource, 1, 5)});
nebulaRod = new BLexiconEntry("nebulaRod", categoryForgotten);
nebulaRod.setKnowledgeType(forgotten).setLexiconPages(new LexiconPage[] { new PageText("0"), BotaniaAPI.internalHandler.craftingRecipePage(".craft", getLastRecipe())});
List recipeObjects = Arrays.asList(new Object[] { Character.valueOf('R'), "dustRedstone", Character.valueOf('P'), new ItemStack(ItemListAB.itemCraftingPattern) });
for (int i = 0; i < 9; i++) {
List<Object> recipe = new ArrayList();
boolean[][] patterns = ItemCraftingPattern.getPattern(i);
for (int j = 0; j < 3; j++) {
String s = "";
for (int k = 0; k < 3; k++)
s = String.valueOf(s) + (patterns[i][j * 3 + k] ? "R" : "P");
recipe.add(s);
}
recipe.addAll(recipeObjects);
addOreDictRecipe(new ItemStack(ModItems.craftPattern, 1, i), recipe.toArray(new Object[recipe.size()]));
}
if(Botania.thaumcraftLoaded)
thaumcraft();
addShapelessOreDictRecipe(new ItemStack(ItemListAB.itemABResource, 9, 1), new Object[] { new ItemStack(ItemListAB.itemABResource)});
addShapelessOreDictRecipe(new ItemStack(ItemListAB.itemABResource, 9, 0), new Object[] { new ItemStack(BlockListAB.blockABStorage)});
addShapelessOreDictRecipe(new ItemStack(ItemListAB.itemABResource, 9, 6), new Object[] { new ItemStack(ItemListAB.itemABResource, 1, 5)});
GameRegistry.addShapedRecipe(new ItemStack(BlockListAB.blockABStorage), new Object[] { "III", "III", "III", Character.valueOf('I'), new ItemStack(ItemListAB.itemABResource)});
GameRegistry.addShapedRecipe(new ItemStack(ItemListAB.itemABResource, 1, 5), new Object[] { "III", "III", "III", Character.valueOf('I'), new ItemStack(ItemListAB.itemABResource, 1, 6)});
}
public static void thaumcraft() {
aspecolus = new BLexiconEntry("aspecolus", BotaniaAPI.categoryFunctionalFlowers);
aspecolusRecipe = BotaniaAPI.registerPetalRecipe(ItemBlockSpecialFlower.ofType("aspecolus"), new ItemStack(ModItems.manaResource, 1, 6), new ItemStack(ModItems.manaResource, 1, 5), new ItemStack(ModItems.rune, 1, 1), new ItemStack(ModItems.rune), new ItemStack(ItemListAB.itemABResource, 1, 2), new ItemStack(ModItems.petal, 1, 10), new ItemStack(ModItems.petal, 1, 13));
aspecolus.setKnowledgeType(forgotten).setLexiconPages(new LexiconPage[] { new PageText("0"), BotaniaAPI.internalHandler.petalRecipePage(".petalCraft", aspecolusRecipe) }).setIcon(ItemBlockSpecialFlower.ofType("aspecolus"));
addShapelessOreDictRecipe(new ItemStack(ItemListAB.itemNebulaHelmReveal), new Object[] { new ItemStack(ItemListAB.itemNebulaHelm), new ItemStack(ConfigItems.itemGoggles)});
}
private static IRecipe getLastRecipe() {
return (IRecipe)CraftingManager.getInstance().getRecipeList().get(CraftingManager.getInstance().getRecipeList().size() - 1);
}
private static void addOreDictRecipe(ItemStack output, Object... recipe) {
CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(output, recipe));
}
private static void addShapelessOreDictRecipe(ItemStack output, Object... recipe) {
CraftingManager.getInstance().getRecipeList().add(new ShapelessOreRecipe(output, recipe));
}
}
@@ -0,0 +1,134 @@
package ab.client.render.tile;
import java.util.Random;
import org.lwjgl.opengl.GL11;
import ab.common.block.BlockMagicCraftCrate;
import ab.common.block.tile.TileMagicCraftCrate;
import ab.common.lib.register.BlockListAB;
import net.minecraft.client.Minecraft;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelRenderer;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.entity.RenderItem;
import net.minecraft.client.renderer.entity.RenderManager;
import net.minecraft.client.renderer.texture.TextureMap;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.IIcon;
import net.minecraft.util.ResourceLocation;
import vazkii.botania.client.core.handler.ClientTickHandler;
public class RenderTileMagicCraftingCrate extends TileEntitySpecialRenderer {
private ModelCrateBook model = new ModelCrateBook();
public void renderTileEntityAt(TileEntity tile, double x, double y, double z, float fq) {
double time = (tile.getWorldObj() == null) ? 0.0D : (ClientTickHandler.ticksInGame + fq);
if(tile != null)
time += (new Random((tile.xCoord ^ tile.yCoord ^ tile.zCoord))).nextInt(360);
float f1 = 0.002f;
float f2 = 0.125f;
float f3 = 0.1875f;
float f4 = 0.25f;
TileMagicCraftCrate crate = (TileMagicCraftCrate) tile;
boolean[][] pattern = crate.getPattern();
GL11.glPushMatrix();
GL11.glEnable(GL11.GL_BLEND);
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationBlocksTexture);
Tessellator t = new Tessellator();
t.startDrawingQuads();
t.setColorRGBA_I(0xfc0195, 50);
IIcon icon = ((BlockMagicCraftCrate)BlockListAB.blockMagicCraftCrate).nothing;
float maxU = icon.getMaxU();
float maxV = icon.getMaxV();
float minU = icon.getMinU();
float minV = icon.getMinV();
boolean hasPattern = false;
for(int i = 0; i < 3; i++)
for(int j = 0; j < 3; j++) {
if(!pattern[i][j]) {
int i1 = 2 - i;
int j1 = 2 - j;
hasPattern = true;
t.addVertexWithUV(x + f4 + f3 * j1 + f2, y + 1 + f1, z + f4 + f3 * i1+ f2, maxU, maxV);
t.addVertexWithUV(x + f4 + f3 * j1 + f2, y + 1 + f1, z + f4 + f3 * i1, maxU, minV);
t.addVertexWithUV(x + f4 + f3 * j1, y + 1 + f1, z + f4 + f3 * i1, minU, minV);
t.addVertexWithUV(x + f4 + f3 * j1, y + 1 + f1, z + f4 + f3 * i1+ f2, minU, maxV);
float f0 = f2;
if(i == 0 && j == 1)
f0 = 0.0625f;
float minY = (float) (y + f4 + f3 * i1);
float maxY = minY + f0;
t.addVertexWithUV(x + f4 + f3 * j1, minY, z - f1, maxU, maxV);
t.addVertexWithUV(x + f4 + f3 * j1, maxY, z - f1, maxU, minV);
t.addVertexWithUV(x + f4 + f3 * j1 + f2, maxY, z - f1, minU, minV);
t.addVertexWithUV(x + f4 + f3 * j1 + f2, minY, z - f1, minU, maxV);
t.addVertexWithUV(x + 1 + f1, minY, z + f4 + f3 * j1, maxU, maxV);
t.addVertexWithUV(x + 1 + f1, maxY, z + f4 + f3 * j1, maxU, minV);
t.addVertexWithUV(x + 1 + f1, maxY, z + f4 + f3 * j1 + f2, minU, minV);
t.addVertexWithUV(x + 1 + f1, minY, z + f4 + f3 * j1 + f2, minU, maxV);
j1 = j;
t.addVertexWithUV(x - f1, minY, z + f4 + f3 * j1 + f2, maxU, maxV);
t.addVertexWithUV(x - f1, maxY, z + f4 + f3 * j1 + f2, maxU, minV);
t.addVertexWithUV(x - f1, maxY, z + f4 + f3 * j1, minU, minV);
t.addVertexWithUV(x - f1, minY, z + f4 + f3 * j1, minU, maxV);
t.addVertexWithUV(x + f4 + f3 * j1 + f2, minY, z + 1 + f1, maxU, maxV);
t.addVertexWithUV(x + f4 + f3 * j1 + f2, maxY, z + 1 + f1, maxU, minV);
t.addVertexWithUV(x + f4 + f3 * j1, maxY, z + 1 + f1, minU, minV);
t.addVertexWithUV(x + f4 + f3 * j1, minY, z + 1 + f1, minU, maxV);
}
}
t.draw();
GL11.glDisable(GL11.GL_BLEND);
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glPopMatrix();
ItemStack wand = crate.getStackInSlot(10);
if(wand != null) {
GL11.glPushMatrix();
GL11.glTranslated(x + 0.5f, y + 1.12f + (Math.sin(time / 24.0D) / 40.0D - 0.05D), z + 0.275f);
GL11.glRotated(Math.sin(time / 24.0D) * 5.0f, 0.0f, 1.0f, 0.0f);
GL11.glRotatef(90.0f, 0.0f, 0.0f, 1.0f);
EntityItem entity = new EntityItem(tile.getWorldObj(), 0, -0.125, 0, wand.copy());
entity.hoverStart = 0.0f;
RenderItem.renderInFrame = true;
RenderManager.instance.renderEntityWithPosYaw(entity, 0, -0.285, 0, 0.0f, 0.0f);
RenderItem.renderInFrame = false;
GL11.glPopMatrix();
}
ItemStack book = crate.getStackInSlot(11);
if(book != null) {
GL11.glPushMatrix();
GL11.glTranslated(x + 0.6735f, y + 0.825f + (Math.sin(-time / 24.0D) / 40.0D - 0.05D), z + 0.825f);
GL11.glRotatef(90.0f, 0.0f, 0.0f, 1.0f);
GL11.glRotatef(90.0f, 0.0f, 1.0f, 0.0f);
GL11.glRotated(Math.sin(-time / 24.0D) * 5.0f, 0.0f, 0.0f, 1.0f);
Minecraft.getMinecraft().renderEngine.bindTexture(model.texture);
model.render();
GL11.glPopMatrix();
}
}
public class ModelCrateBook extends ModelBase {
public final ResourceLocation texture = new ResourceLocation("thaumcraft:textures/models/fortress_armor.png");
private ModelRenderer Book;
public ModelCrateBook() {
textureWidth = 128;
textureHeight = 64;
Book = new ModelRenderer(this, 100, 8);
Book.addBox(1.0F, -0.3F, 4.0F, 5, 7, 2);
Book.setRotationPoint(0.0F, 0.0F, 0.0F);
Book.setTextureSize(128, 64);
}
public void render() {
Book.render(0.0625f);
}
}
}
@@ -0,0 +1,82 @@
package ab.client.render.entity;
import java.awt.Color;
import java.util.Random;
import org.lwjgl.opengl.GL11;
import ab.common.entity.EntitySword;
import net.minecraft.block.Block;
import net.minecraft.client.Minecraft;
import net.minecraft.client.entity.AbstractClientPlayer;
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.TextureMap;
import net.minecraft.entity.Entity;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import net.minecraft.util.MathHelper;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World;
import net.minecraftforge.client.ForgeHooksClient;
import vazkii.botania.client.core.handler.ClientTickHandler;
import vazkii.botania.client.core.helper.ShaderHelper;
public class RenderEntitySword extends Render {
Minecraft mc = Minecraft.getMinecraft();
public void doRender(Entity entity, double x, double y, double z, float fl, float fl1) {
double worldTime = (entity.worldObj == null) ? 0.0D : (ClientTickHandler.ticksInGame + fl1);
if(entity != null)
worldTime += (new Random(((int)entity.posX ^ (int)entity.posY ^ (int)entity.posZ))).nextInt(360);
EntitySword sword = (EntitySword)entity;
GL11.glPushMatrix();
GL11.glTranslated(x, y, z);
GL11.glEnable(3042);
GL11.glBlendFunc(770, 771);
GL11.glRotatef(sword.getRotation1(), 0.0f, 1.0f, 0.0f);
GL11.glRotatef(sword.getRotation2(), 1.0f, 0.0f, 0.0f);
GL11.glRotatef(135.0f, 0.0F, 0.0F, 1.0F);
GL11.glRotatef((float)worldTime * 0.175F, 0.0F, 0.0F, 1.0F);
mc.renderEngine.bindTexture(TextureMap.locationItemsTexture);
if(entity.worldObj != null)
renderItemStack(sword.getSword(), (int)Math.min(160.0f, entity.ticksExisted * 17.67f), entity.worldObj, x, y, z);
GL11.glDisable(3042);
GL11.glPopMatrix();
}
public void renderItemStack(ItemStack stack, int alpha, World world, double posX, double posY, double posZ) {
if(stack != null) {
float s = 0.25F;
GL11.glTranslatef(-4 * 0.0625f, -4 * 0.0625f, 0.0f);
GL11.glScalef(s, s, s);
GL11.glScalef(2.0F, 2.0F, 2.0F);
if(!ForgeHooksClient.renderEntityItem(new EntityItem(world, posX, posY, posZ, stack), stack, 0.0F, 0.0F, world.rand, mc.renderEngine, RenderBlocks.getInstance(), 1)) {
int renderPass = 0;
do {
IIcon icon = stack.getItem().getIcon(stack, renderPass);
if(icon == null)
continue;
Color color = new Color(stack.getItem().getColorFromItemStack(stack, renderPass));
GL11.glColor4ub((byte)color.getRed(), (byte)color.getGreen(), (byte)color.getBlue(), (byte)alpha);
float f = icon.getMinU();
float f1 = icon.getMaxU();
float f2 = icon.getMinV();
float f3 = icon.getMaxV();
ItemRenderer.renderItemIn2D(Tessellator.instance, f1, f2, f, f3, icon.getIconWidth(), icon.getIconHeight(), 0.0625F);
GL11.glColor3f(1.0F, 1.0F, 1.0F);
++renderPass;
} while(renderPass < stack.getItem().getRenderPasses(stack.getItemDamage()));
}
GL11.glScalef(1.0F / s, 1.0F / s, 1.0F / s);
}
}
protected ResourceLocation getEntityTexture(Entity entity) {
return AbstractClientPlayer.locationStevePng;
}
}
@@ -0,0 +1,97 @@
package ab.api.recipe.lexicon;
import java.util.ArrayList;
import java.util.List;
import org.lwjgl.opengl.GL11;
import ab.api.AdvancedBotanyAPI;
import ab.api.recipe.RecipeAdvancedPlate;
import ab.api.recipe.RecipeAncientAlphirine;
import ab.client.core.ClientHelper;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.FontRenderer;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.client.renderer.texture.TextureManager;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.StatCollector;
import vazkii.botania.api.internal.IGuiLexiconEntry;
import vazkii.botania.api.lexicon.LexiconEntry;
import vazkii.botania.api.lexicon.LexiconRecipeMappings;
import vazkii.botania.common.item.block.ItemBlockSpecialFlower;
import vazkii.botania.common.lexicon.page.PageRecipe;
import vazkii.botania.common.lexicon.page.PageText;
public class AlphirineCraftPage extends PageRecipe {
private static final ResourceLocation alphirineOverlay = new ResourceLocation("botania:textures/gui/pureDaisyOverlay.png");
private RecipeAncientAlphirine recipe;
private final ItemStack resultStack;
public AlphirineCraftPage(LexiconEntry entry, ItemStack stack) {
this(entry, stack, "");
}
public AlphirineCraftPage(LexiconEntry entry, ItemStack stack, String str) {
super(str);
resultStack = stack;
refreshRecipe(entry, stack);
}
public ItemStack getResult() {
return resultStack;
}
public void refreshRecipe(LexiconEntry entry, ItemStack stack) {
RecipeAncientAlphirine rec = null;
for(RecipeAncientAlphirine recipe : AdvancedBotanyAPI.alphirineRecipes) {
if(stack != null && recipe.getOutput() != null && recipe.getOutput().isItemEqual(stack)) {
rec = recipe;
break;
}
}
if(rec == null)
entry.pages.remove(this);
recipe = rec;
}
public void onPageAdded(LexiconEntry entry, int index) {
LexiconRecipeMappings.map(recipe.getOutput(), entry, index);
}
@SideOnly(Side.CLIENT)
public void renderRecipe(IGuiLexiconEntry gui, int mx, int my) {
TextureManager render = (Minecraft.getMinecraft()).renderEngine;
FontRenderer font = (Minecraft.getMinecraft()).fontRenderer;
GL11.glEnable(3042);
GL11.glBlendFunc(770, 771);
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
render.bindTexture(alphirineOverlay);
((GuiScreen)gui).drawTexturedModalRect(gui.getLeft() + 40, gui.getTop() + 44, 0, 0, gui.getWidth(), gui.getHeight());
ItemStack inp = recipe.getInput().copy();
if (inp.getItemDamage() == 32767)
inp.setItemDamage(0);
this.renderItem(gui, gui.getLeft() + 34, gui.getTop() + 59, inp, false);
this.renderItem(gui, gui.getLeft() + 62, gui.getTop() + 57, ItemBlockSpecialFlower.ofType("ancientAlphirine").copy(), false);
this.renderItem(gui, gui.getLeft() + 93, gui.getTop() + 54, recipe.getOutput().copy(), false);
int x = gui.getLeft() + gui.getWidth() / 2 - 50;
int y = gui.getTop() + 85;
String name = EnumChatFormatting.BOLD + StatCollector.translateToLocal("ab.name.alpherine.craft");
boolean unicode = font.getUnicodeFlag();
font.setUnicodeFlag(true);
font.drawString(name, x + 50 - font.getStringWidth(name) / 2, y - 65, -1728053248);
font.setUnicodeFlag(unicode);
ClientHelper.drawChanceBar(x + 21, y + 14, recipe.getChance());
GL11.glDisable(3042);
}
public List<ItemStack> getDisplayedRecipes() {
ArrayList<ItemStack> list = new ArrayList<ItemStack>();
list.add(recipe.getOutput());
return list;
}
}
@@ -0,0 +1,313 @@
package ab.common.block.tile;
import java.util.List;
import org.lwjgl.opengl.GL11;
import ab.api.IBoundRender;
import ab.client.core.ClientHelper;
import net.minecraft.block.Block;
import net.minecraft.block.BlockChest;
import net.minecraft.block.BlockHopper;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.Gui;
import net.minecraft.client.gui.ScaledResolution;
import net.minecraft.client.renderer.RenderHelper;
import net.minecraft.client.renderer.entity.RenderItem;
import net.minecraft.command.IEntitySelector;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.ISidedInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.IHopper;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.tileentity.TileEntityChest;
import net.minecraft.tileentity.TileEntityHopper;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.ChunkCoordinates;
import net.minecraft.util.Facing;
import net.minecraft.util.MathHelper;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
import vazkii.botania.api.wand.IWandBindable;
import vazkii.botania.client.core.handler.HUDHandler;
import vazkii.botania.common.core.helper.Vector3;
import vazkii.botania.common.item.ModItems;
public class TileEngineerHopper extends TileInventory implements IHopper, IBoundRender {
private int cooldown;
private int[] invPosX = new int[] {0, 0};
private int[] invPosY = new int[] {-1, -1};
private int[] invPosZ = new int[] {0, 0};
private int[] invSide = new int[] {-1, -1};
private boolean bindType;
public void updateEntity() {
if(this.worldObj != null) {
if(!this.worldObj.isRemote) {
if(cooldown > 0)
--cooldown;
else if(cooldown == 0) {
if(worldObj != null && !worldObj.isRemote) {
boolean hasUpdate = false;
ItemStack stack = getStackInSlot(0);
if(stack != null)
hasUpdate = canExtractStack();
if(stack == null || stack.stackSize != stack.getMaxStackSize())
hasUpdate = canInsertStack() || hasUpdate;
if(hasUpdate)
this.cooldown = 8;
this.markDirty();
}
}
}
}
}
public boolean bindTo(EntityPlayer player, ItemStack wand, int x, int y, int z, int side) {
TileEntity tile = player.getEntityWorld().getTileEntity(x, y, z);
boolean isFar = Math.abs(this.xCoord - x) >= 10 || Math.abs(this.yCoord - y) >= 10 || Math.abs(this.zCoord - z) >= 10;
if(isFar)
return false;
int invCount = bindType ? 0 : 1;
if(tile instanceof TileEngineerHopper)
return false;
else if(tile != null && tile instanceof IInventory) {
setDistantInventory(invCount, x, y, z);
invSide[invCount] = side;
return true;
} else {
setDistantInventory(invCount, 0, -1, 0);
invSide[invCount] = -1;
return false;
}
}
public void changeBindType() {
bindType = !bindType;
}
public void setDistantInventory(int count, int posX, int posY, int posZ) {
invPosX[count] = posX;
invPosY[count] = posY;
invPosZ[count] = posZ;
}
public IInventory getDistantInventory(int count) {
IInventory inv = TileEntityHopper.func_145893_b(this.getWorldObj(), invPosX[count], invPosY[count], invPosZ[count]);
if(inv == null)
setDistantInventory(count, 0, -1, 0);
return inv;
}
public boolean canSelect(EntityPlayer player, ItemStack wand, int x, int y, int z, int side) {
return true;
}
public ChunkCoordinates[] getBlocksCoord() {
return new ChunkCoordinates[] { new ChunkCoordinates(invPosX[0], invPosY[0], invPosZ[0]), new ChunkCoordinates(invPosX[1], invPosY[1], invPosZ[1]) };
}
public ChunkCoordinates getBinding() {
return null;
}
public void renderHUD(Minecraft mc, ScaledResolution res) {
int x = res.getScaledWidth() / 2 - 7;
int y = res.getScaledHeight() / 2 + 16;
GL11.glEnable(3042);
GL11.glBlendFunc(770, 771);
ClientHelper.drawArrow(x - 2, y, false);
for(int i = 0; i < 2; i++) {
ItemStack stack = null;
boolean hasInv = false;
int posX = x + (i == 0 ? 32 : -32);
if(getDistantInventory(i) != null && (TileEntity)getDistantInventory(i) != null) {
TileEntity tile = (TileEntity)getDistantInventory(i);
Block block = tile.getWorldObj().getBlock(tile.xCoord, tile.yCoord, tile.zCoord);
int meta = tile.getWorldObj().getBlockMetadata(tile.xCoord, tile.yCoord, tile.zCoord);
stack = new ItemStack(block, 1, meta);
hasInv = true;
}
Gui.drawRect(posX - 4, y - 4, posX + 20, y + 20, 1140850688);
Gui.drawRect(posX - 2, y - 2, posX + 18, y + 18, 1140850688);
if(stack != null) {
RenderHelper.enableGUIStandardItemLighting();
GL11.glEnable(32826);
RenderItem.getInstance().renderItemAndEffectIntoGUI(mc.fontRenderer, mc.renderEngine, stack, posX, y);
RenderHelper.disableStandardItemLighting();
GL11.glDisable(2929);
}
int invCount = bindType ? 0 : 1;
if(invCount == i) {
GL11.glTranslatef(0.0f, 0.0f, 300.0f);
RenderHelper.enableGUIStandardItemLighting();
GL11.glEnable(32826);
RenderItem.getInstance().renderItemIntoGUI(mc.fontRenderer, mc.renderEngine, new ItemStack(ModItems.twigWand), posX + 10, y + 7);
RenderHelper.disableStandardItemLighting();
GL11.glDisable(2929);
GL11.glTranslatef(0.0f, 0.0f, -300.0f);
}
boolean unicode = mc.fontRenderer.getUnicodeFlag();
mc.fontRenderer.setUnicodeFlag(true);
if(!hasInv) {
mc.fontRenderer.drawStringWithShadow("\u2717", posX + 5, y + 6, 4980736);
mc.fontRenderer.drawStringWithShadow("\u2717", posX + 5, y + 5, 13764621);
}
mc.fontRenderer.setUnicodeFlag(unicode);
GL11.glEnable(2929);
}
GL11.glDisable(3042);
}
public void writeCustomNBT(NBTTagCompound nbtt) {
super.writeCustomNBT(nbtt);
nbtt.setInteger("cooldown", this.cooldown);
nbtt.setBoolean("bindType", this.bindType);
nbtt.setIntArray("bindingX", this.invPosX);
nbtt.setIntArray("bindingY", this.invPosY);
nbtt.setIntArray("bindingZ", this.invPosZ);
nbtt.setIntArray("bindingSide", this.invSide);
}
public void readCustomNBT(NBTTagCompound nbtt) {
super.readCustomNBT(nbtt);
this.cooldown = nbtt.getInteger("cooldown");
this.bindType = nbtt.getBoolean("bindType");
this.invPosX = nbtt.getIntArray("bindingX");
this.invPosY = nbtt.getIntArray("bindingY");
this.invPosZ = nbtt.getIntArray("bindingZ");
this.invSide = nbtt.getIntArray("bindingSide");
}
private boolean canExtractStack() {
IInventory inv = getDistantInventory(0);
if(inv == null)
return false;
else {
int side = invSide[0];
int pullCount = getPullCount(inv, side);
if(pullCount <= 0)
return false;
else {
if(getStackInSlot(0) != null) {
ItemStack itemstack = getStackInSlot(0).copy();
ItemStack itemstack1 = TileEntityHopper.func_145889_a(inv, decrStackSize(0, pullCount), side);
if(itemstack1 == null || itemstack1.stackSize == 0) {
inv.markDirty();
return true;
}
setInventorySlotContents(0, itemstack);
}
return false;
}
}
}
private int getPullCount(IInventory inv, int side) {
if(inv instanceof ISidedInventory && side > -1) {
ISidedInventory sideInv = (ISidedInventory)inv;
int[] slots = sideInv.getAccessibleSlotsFromSide(side);
for(int i = 0; i < slots.length; ++i) {
ItemStack stack = sideInv.getStackInSlot(slots[i]);
if(stack == null)
return inv.getInventoryStackLimit();
else if(inv.getInventoryStackLimit() != stack.stackSize && stack.stackSize != stack.getMaxStackSize() && TileAgglomerationPlate.isItemEqual(stack, getStackInSlot(0)))
return inv.getInventoryStackLimit() - stack.stackSize;
}
} else {
int size = inv.getSizeInventory();
for(int i = 0; i < size; ++i) {
ItemStack stack = inv.getStackInSlot(i);
if(stack == null)
return inv.getInventoryStackLimit();
else if(inv.getInventoryStackLimit() != stack.stackSize && stack.stackSize != stack.getMaxStackSize() && TileAgglomerationPlate.isItemEqual(stack, getStackInSlot(0)))
return inv.getInventoryStackLimit() - stack.stackSize;
}
}
return 0;
}
private boolean canInsertStack() {
IInventory inv = getDistantInventory(1);
if(inv != null) {
int side = invSide[1];
if(!canTake(inv, side))
return false;
if(inv instanceof ISidedInventory && side > -1) {
ISidedInventory sidedInv = (ISidedInventory)inv;
int[] slots = sidedInv.getAccessibleSlotsFromSide(side);
for(int k = 0; k < slots.length; ++k) {
if(func_145892_a(inv, slots[k], side))
return true;
}
} else {
int i = inv.getSizeInventory();
for(int j = 0; j < i; ++j) {
if(func_145892_a(inv, j, side))
return true;
}
}
}
return false;
}
private boolean canTake(IInventory inv, int side) {
if(inv instanceof ISidedInventory && side > -1) {
ISidedInventory isidedinventory = (ISidedInventory)inv;
int[] aint = isidedinventory.getAccessibleSlotsFromSide(side);
for(int i = 0; i < aint.length; ++i) {
if(isidedinventory.getStackInSlot(aint[i]) != null)
return true;
}
} else {
for(int i = 0; i < inv.getSizeInventory(); ++i) {
if(inv.getStackInSlot(i) != null)
return true;
}
}
return false;
}
private boolean func_145892_a(IInventory inv, int slot, int side) {
ItemStack itemstack = inv.getStackInSlot(slot);
if(itemstack != null && func_145890_b(inv, itemstack, slot, side)) {
ItemStack itemstack1 = itemstack.copy();
ItemStack itemstack2 = TileEntityHopper.func_145889_a(this, inv.decrStackSize(slot, this.getInventoryStackLimit()), side);
if(itemstack2 == null || itemstack2.stackSize == 0) {
inv.markDirty();
return true;
}
inv.setInventorySlotContents(slot, itemstack1);
}
return false;
}
private static boolean func_145890_b(IInventory inv, ItemStack stack, int slot, int side) {
return !(inv instanceof ISidedInventory) || ((ISidedInventory)inv).canExtractItem(slot, stack, side);
}
public int getSizeInventory() {
return 1;
}
public String getInventoryName() {
return "engineerHopper";
}
public double getXPos() {
return this.xCoord;
}
public double getYPos() {
return this.yCoord;
}
public double getZPos() {
return this.zCoord;
}
}
@@ -0,0 +1,308 @@
package ab.common.block.tile;
import java.util.List;
import org.lwjgl.opengl.GL11;
import ab.api.IBoundRender;
import ab.client.core.ClientHelper;
import net.minecraft.block.Block;
import net.minecraft.block.BlockChest;
import net.minecraft.block.BlockHopper;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.Gui;
import net.minecraft.client.gui.ScaledResolution;
import net.minecraft.client.renderer.RenderHelper;
import net.minecraft.client.renderer.entity.RenderItem;
import net.minecraft.command.IEntitySelector;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.ISidedInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.IHopper;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.tileentity.TileEntityChest;
import net.minecraft.tileentity.TileEntityHopper;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.ChunkCoordinates;
import net.minecraft.util.Facing;
import net.minecraft.util.MathHelper;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
import vazkii.botania.api.wand.IWandBindable;
import vazkii.botania.client.core.handler.HUDHandler;
import vazkii.botania.common.core.helper.Vector3;
import vazkii.botania.common.item.ModItems;
public class TileEngineerHopper extends TileInventory implements IHopper, IBoundRender {
private int cooldown;
private int[] invPosX = new int[] {0, 0};
private int[] invPosY = new int[] {-1, -1};
private int[] invPosZ = new int[] {0, 0};
private int[] invSide = new int[] {-1, -1};
private boolean bindType;
public void updateEntity() {
if(this.worldObj != null) {
if(!this.worldObj.isRemote) {
if(cooldown > 0)
--cooldown;
else if(cooldown == 0) {
if(worldObj != null && !worldObj.isRemote) {
boolean hasUpdate = false;
ItemStack stack = getStackInSlot(0);
if(stack != null)
hasUpdate = canExtractStack();
if(stack == null || stack.stackSize != stack.getMaxStackSize())
hasUpdate = canInsertStack() || hasUpdate;
if(hasUpdate)
this.cooldown = 8;
this.markDirty();
}
}
}
}
}
public boolean bindTo(EntityPlayer player, ItemStack wand, int x, int y, int z, int side) {
TileEntity tile = player.getEntityWorld().getTileEntity(x, y, z);
boolean isFar = Math.abs(this.xCoord - x) >= 10 || Math.abs(this.yCoord - y) >= 10 || Math.abs(this.zCoord - z) >= 10;
if(isFar)
return false;
int invCount = bindType ? 0 : 1;
if(tile instanceof TileEngineerHopper)
return false;
else if(tile != null && tile instanceof IInventory) {
setDistantInventory(invCount, x, y, z);
invSide[invCount] = side;
return true;
} else {
setDistantInventory(invCount, 0, -1, 0);
invSide[invCount] = -1;
return false;
}
}
public void changeBindType() {
bindType = !bindType;
}
public void setDistantInventory(int count, int posX, int posY, int posZ) {
invPosX[count] = posX;
invPosY[count] = posY;
invPosZ[count] = posZ;
}
public IInventory getDistantInventory(int count) {
IInventory inv = TileEntityHopper.func_145893_b(this.getWorldObj(), invPosX[count], invPosY[count], invPosZ[count]);
if(inv == null)
setDistantInventory(count, 0, -1, 0);
return inv;
}
public boolean canSelect(EntityPlayer player, ItemStack wand, int x, int y, int z, int side) {
return true;
}
public ChunkCoordinates[] getBlocksCoord() {
return new ChunkCoordinates[] { new ChunkCoordinates(invPosX[0], invPosY[0], invPosZ[0]), new ChunkCoordinates(invPosX[1], invPosY[1], invPosZ[1]) };
}
public ChunkCoordinates getBinding() {
return null;
}
public void renderHUD(Minecraft mc, ScaledResolution res) {
int x = res.getScaledWidth() / 2 - 7;
int y = res.getScaledHeight() / 2 + 16;
GL11.glEnable(3042);
GL11.glBlendFunc(770, 771);
ClientHelper.drawArrow(x - 2, y, false);
for(int i = 0; i < 2; i++) {
ItemStack stack = null;
boolean hasInv = false;
int posX = x + (i == 0 ? 32 : -32);
if(getDistantInventory(i) != null && (TileEntity)getDistantInventory(i) != null) {
TileEntity tile = (TileEntity)getDistantInventory(i);
Block block = tile.getWorldObj().getBlock(tile.xCoord, tile.yCoord, tile.zCoord);
int meta = tile.getWorldObj().getBlockMetadata(tile.xCoord, tile.yCoord, tile.zCoord);
stack = new ItemStack(block, 1, meta);
hasInv = true;
}
Gui.drawRect(posX - 4, y - 4, posX + 20, y + 20, 1140850688);
Gui.drawRect(posX - 2, y - 2, posX + 18, y + 18, 1140850688);
if(stack != null) {
RenderHelper.enableGUIStandardItemLighting();
GL11.glEnable(32826);
RenderItem.getInstance().renderItemAndEffectIntoGUI(mc.fontRenderer, mc.renderEngine, stack, posX, y);
RenderHelper.disableStandardItemLighting();
GL11.glDisable(2929);
}
int invCount = bindType ? 0 : 1;
if(invCount == i) {
GL11.glTranslatef(0.0f, 0.0f, 300.0f);
RenderHelper.enableGUIStandardItemLighting();
GL11.glEnable(32826);
RenderItem.getInstance().renderItemIntoGUI(mc.fontRenderer, mc.renderEngine, new ItemStack(ModItems.twigWand), posX + 10, y + 7);
RenderHelper.disableStandardItemLighting();
GL11.glDisable(2929);
GL11.glTranslatef(0.0f, 0.0f, -300.0f);
}
boolean unicode = mc.fontRenderer.getUnicodeFlag();
mc.fontRenderer.setUnicodeFlag(true);
if(!hasInv) {
mc.fontRenderer.drawStringWithShadow("\u2717", posX + 5, y + 6, 4980736);
mc.fontRenderer.drawStringWithShadow("\u2717", posX + 5, y + 5, 13764621);
}
mc.fontRenderer.setUnicodeFlag(unicode);
GL11.glEnable(2929);
}
GL11.glDisable(3042);
}
public void writeCustomNBT(NBTTagCompound nbtt) {
super.writeCustomNBT(nbtt);
nbtt.setInteger("cooldown", this.cooldown);
nbtt.setBoolean("bindType", this.bindType);
nbtt.setIntArray("bindingX", this.invPosX);
nbtt.setIntArray("bindingY", this.invPosY);
nbtt.setIntArray("bindingZ", this.invPosZ);
nbtt.setIntArray("bindingSide", this.invSide);
}
public void readCustomNBT(NBTTagCompound nbtt) {
super.readCustomNBT(nbtt);
this.cooldown = nbtt.getInteger("cooldown");
this.bindType = nbtt.getBoolean("bindType");
this.invPosX = nbtt.getIntArray("bindingX");
this.invPosY = nbtt.getIntArray("bindingY");
this.invPosZ = nbtt.getIntArray("bindingZ");
this.invSide = nbtt.getIntArray("bindingSide");
}
private boolean canExtractStack() {
IInventory inv = getDistantInventory(0);
if(inv == null)
return false;
else {
int side = invSide[0];
if(!canPull(inv, side))
return false;
else {
if(getStackInSlot(0) != null) {
ItemStack itemstack = getStackInSlot(0).copy();
ItemStack itemstack1 = TileEntityHopper.func_145889_a(inv, decrStackSize(0, inv.getInventoryStackLimit()), side);
if(itemstack1 == null || itemstack1.stackSize == 0) {
inv.markDirty();
return true;
}
setInventorySlotContents(0, itemstack);
}
return false;
}
}
}
private boolean canPull(IInventory inv, int side) {
if(inv instanceof ISidedInventory && side > -1) {
ISidedInventory sideInv = (ISidedInventory)inv;
int[] slots = sideInv.getAccessibleSlotsFromSide(side);
for(int i = 0; i < slots.length; ++i) {
ItemStack stack = sideInv.getStackInSlot(slots[i]);
if(stack == null || (stack.stackSize != stack.getMaxStackSize() && stack.stackSize != inv.getInventoryStackLimit()))
return true;
}
} else {
int size = inv.getSizeInventory();
for(int i = 0; i < size; ++i) {
ItemStack stack = inv.getStackInSlot(i);
if(stack == null || (stack.stackSize != stack.getMaxStackSize() && stack.stackSize != inv.getInventoryStackLimit()))
return true;
}
}
return false;
}
private boolean canInsertStack() {
IInventory inv = getDistantInventory(1);
if(inv != null) {
int side = invSide[1];
if(!canTake(inv, side))
return false;
if(inv instanceof ISidedInventory && side > -1) {
ISidedInventory sidedInv = (ISidedInventory)inv;
int[] slots = sidedInv.getAccessibleSlotsFromSide(side);
for(int k = 0; k < slots.length; ++k) {
if(func_145892_a(inv, slots[k], side))
return true;
}
} else {
int i = inv.getSizeInventory();
for(int j = 0; j < i; ++j) {
if(func_145892_a(inv, j, side))
return true;
}
}
}
return false;
}
private boolean canTake(IInventory inv, int side) {
if(inv instanceof ISidedInventory && side > -1) {
ISidedInventory isidedinventory = (ISidedInventory)inv;
int[] aint = isidedinventory.getAccessibleSlotsFromSide(side);
for(int i = 0; i < aint.length; ++i) {
if(isidedinventory.getStackInSlot(aint[i]) != null)
return true;
}
} else {
for(int i = 0; i < inv.getSizeInventory(); ++i) {
if(inv.getStackInSlot(i) != null)
return true;
}
}
return false;
}
private boolean func_145892_a(IInventory inv, int slot, int side) {
ItemStack itemstack = inv.getStackInSlot(slot);
if(itemstack != null && func_145890_b(inv, itemstack, slot, side)) {
ItemStack itemstack1 = itemstack.copy();
ItemStack itemstack2 = TileEntityHopper.func_145889_a(this, inv.decrStackSize(slot, this.getInventoryStackLimit()), side);
if(itemstack2 == null || itemstack2.stackSize == 0) {
inv.markDirty();
return true;
}
inv.setInventorySlotContents(slot, itemstack1);
}
return false;
}
private static boolean func_145890_b(IInventory inv, ItemStack stack, int slot, int side) {
return !(inv instanceof ISidedInventory) || ((ISidedInventory)inv).canExtractItem(slot, stack, side);
}
public int getSizeInventory() {
return 1;
}
public String getInventoryName() {
return "engineerHopper";
}
public double getXPos() {
return this.xCoord;
}
public double getYPos() {
return this.yCoord;
}
public double getZPos() {
return this.zCoord;
}
}
@@ -0,0 +1,100 @@
package ab.client.render.tile;
import java.util.Random;
import org.lwjgl.opengl.GL11;
import ab.common.block.BlockMagicCraftCrate;
import ab.common.block.tile.TileMagicCraftCrate;
import ab.common.lib.register.BlockListAB;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.entity.RenderItem;
import net.minecraft.client.renderer.entity.RenderManager;
import net.minecraft.client.renderer.texture.TextureMap;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.IIcon;
import vazkii.botania.client.core.handler.ClientTickHandler;
public class RenderTileMagicCraftingCrate extends TileEntitySpecialRenderer {
public void renderTileEntityAt(TileEntity tile, double x, double y, double z, float fq) {
double time = (tile.getWorldObj() == null) ? 0.0D : (ClientTickHandler.ticksInGame + fq);
if(tile != null)
time += (new Random((tile.xCoord ^ tile.yCoord ^ tile.zCoord))).nextInt(360);
float f1 = 0.002f;
float f2 = 0.125f;
float f3 = 0.1875f;
float f4 = 0.25f;
TileMagicCraftCrate crate = (TileMagicCraftCrate) tile;
boolean[][] pattern = crate.getPattern();
GL11.glPushMatrix();
GL11.glEnable(GL11.GL_BLEND);
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationBlocksTexture);
Tessellator t = new Tessellator();
t.startDrawingQuads();
t.setColorRGBA_I(0xfc0195, 50);
IIcon icon = ((BlockMagicCraftCrate)BlockListAB.blockMagicCraftCrate).nothing;
float maxU = icon.getMaxU();
float maxV = icon.getMaxV();
float minU = icon.getMinU();
float minV = icon.getMinV();
boolean hasPattern = false;
for(int i = 0; i < 3; i++)
for(int j = 0; j < 3; j++) {
if(!pattern[i][j]) {
int i1 = 2 - i;
int j1 = 2 - j;
hasPattern = true;
t.addVertexWithUV(x + f4 + f3 * j1 + f2, y + 1 + f1, z + f4 + f3 * i1+ f2, maxU, maxV);
t.addVertexWithUV(x + f4 + f3 * j1 + f2, y + 1 + f1, z + f4 + f3 * i1, maxU, minV);
t.addVertexWithUV(x + f4 + f3 * j1, y + 1 + f1, z + f4 + f3 * i1, minU, minV);
t.addVertexWithUV(x + f4 + f3 * j1, y + 1 + f1, z + f4 + f3 * i1+ f2, minU, maxV);
float f0 = f2;
if(i == 0 && j == 1)
f0 = 0.0625f;
float minY = (float) (y + f4 + f3 * i1);
float maxY = minY + f0;
t.addVertexWithUV(x + f4 + f3 * j1, minY, z - f1, maxU, maxV);
t.addVertexWithUV(x + f4 + f3 * j1, maxY, z - f1, maxU, minV);
t.addVertexWithUV(x + f4 + f3 * j1 + f2, maxY, z - f1, minU, minV);
t.addVertexWithUV(x + f4 + f3 * j1 + f2, minY, z - f1, minU, maxV);
t.addVertexWithUV(x + 1 + f1, minY, z + f4 + f3 * j1, maxU, maxV);
t.addVertexWithUV(x + 1 + f1, maxY, z + f4 + f3 * j1, maxU, minV);
t.addVertexWithUV(x + 1 + f1, maxY, z + f4 + f3 * j1 + f2, minU, minV);
t.addVertexWithUV(x + 1 + f1, minY, z + f4 + f3 * j1 + f2, minU, maxV);
j1 = j;
t.addVertexWithUV(x - f1, minY, z + f4 + f3 * j1 + f2, maxU, maxV);
t.addVertexWithUV(x - f1, maxY, z + f4 + f3 * j1 + f2, maxU, minV);
t.addVertexWithUV(x - f1, maxY, z + f4 + f3 * j1, minU, minV);
t.addVertexWithUV(x - f1, minY, z + f4 + f3 * j1, minU, maxV);
t.addVertexWithUV(x + f4 + f3 * j1 + f2, minY, z + 1 + f1, maxU, maxV);
t.addVertexWithUV(x + f4 + f3 * j1 + f2, maxY, z + 1 + f1, maxU, minV);
t.addVertexWithUV(x + f4 + f3 * j1, maxY, z + 1 + f1, minU, minV);
t.addVertexWithUV(x + f4 + f3 * j1, minY, z + 1 + f1, minU, maxV);
}
}
t.draw();
GL11.glDisable(GL11.GL_BLEND);
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glPopMatrix();
ItemStack wand = crate.getStackInSlot(10);
if(wand != null) {
GL11.glPushMatrix();
GL11.glTranslated(x + 0.5f, y + 1.12f + (Math.sin(time / 40.0D) / 30.0D - 0.025D), z + 0.5f);
// GL11.glRotatef(0.0f, 0.0f, 1.0f, 0.0f);
GL11.glRotatef(90.0f, 0.0f, 0.0f, 1.0f);
EntityItem entity = new EntityItem(tile.getWorldObj(), 0, -0.125, 0, wand.copy());
entity.hoverStart = 0.0f;
RenderItem.renderInFrame = true;
RenderManager.instance.renderEntityWithPosYaw(entity, 0, -0.285, 0, 0.0f, 0.0f);
RenderItem.renderInFrame = false;
GL11.glPopMatrix();
}
}
}
@@ -0,0 +1,5 @@
package ab.common.minetweaker;
public class AlphirineMT {
}
@@ -0,0 +1,328 @@
package ab.common.item.equipment;
import java.awt.Color;
import java.util.List;
import java.util.UUID;
import com.google.common.collect.Multimap;
import ab.AdvancedBotany;
import ab.api.AdvancedBotanyAPI;
import ab.api.IRankItem;
import ab.common.core.ConfigABHandler;
import ab.common.entity.EntitySword;
import cpw.mods.fml.relauncher.ReflectionHelper;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.SharedMonsterAttributes;
import net.minecraft.entity.ai.attributes.AttributeModifier;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.projectile.EntityThrowable;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.item.ItemSword;
import net.minecraft.potion.Potion;
import net.minecraft.potion.PotionEffect;
import net.minecraft.server.MinecraftServer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.DamageSource;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.IIcon;
import net.minecraft.util.MathHelper;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.util.StatCollector;
import net.minecraft.util.Vec3;
import net.minecraft.world.World;
import vazkii.botania.api.internal.IManaBurst;
import vazkii.botania.api.mana.BurstProperties;
import vazkii.botania.api.mana.ILensEffect;
import vazkii.botania.api.mana.IManaItem;
import vazkii.botania.api.mana.IManaUsingItem;
import vazkii.botania.api.mana.ManaItemHandler;
import vazkii.botania.common.Botania;
import vazkii.botania.common.core.helper.ItemNBTHelper;
import vazkii.botania.common.entity.EntityManaBurst;
public class ItemSpaceBlade extends ItemSword implements IRankItem, ILensEffect, IManaUsingItem {
private static final IIcon[] icons = new IIcon[3];
private static final int recharge = 36;
public static final int[] LEVELS = new int[] { 0, 10000, 1000000, 10000000, 100000000, 1000000000 };
private static final int[] CREATIVE_MANA = new int[] { 9999, 999999, 9999999, 99999999, 999999999, 2147483646 };
public ItemSpaceBlade() {
super(AdvancedBotanyAPI.mithrilToolMaterial);
this.setCreativeTab(AdvancedBotany.tabAB);
this.setUnlocalizedName("spaceBlade");
}
public void getSubItems(Item item, CreativeTabs tab, List list) {
for(int mana : CREATIVE_MANA) {
ItemStack stack = new ItemStack(item);
setMana(stack, mana);
list.add(stack);
}
}
public boolean onLeftClickEntity(ItemStack stack, EntityPlayer player, Entity entity) {
if(!player.worldObj.isRemote) {
ItemNBTHelper.setInt(stack, "postAttackTick", 3);
if(this.getLevel(stack) >= 3 && this.isEnabledMode(stack)) {
float size = this.getLevel(stack) >= 4 ? (this.getLevel(stack) >= 5 ? 3.2f : 2.2f) : 1.2f;
AxisAlignedBB axis = AxisAlignedBB.getBoundingBox(entity.posX, entity.posY, entity.posZ, entity.lastTickPosX, entity.lastTickPosY, entity.lastTickPosZ).expand(size, 1.0f, size);
List<EntityLivingBase> entities = entity.worldObj.getEntitiesWithinAABB(EntityLivingBase.class, axis);
for(EntityLivingBase living : entities) {
if(living instanceof EntityPlayer && (((EntityPlayer)living).getCommandSenderName().equals(player.getCommandSenderName()) || (MinecraftServer.getServer() != null && !MinecraftServer.getServer().isPVPEnabled())))
continue;
if(living.hurtTime == 0) {
float damage = 4.0F + AdvancedBotanyAPI.mithrilToolMaterial.getDamageVsEntity();
living.attackEntityFrom(DamageSource.causePlayerDamage(player), damage);
}
}
}
}
return super.onLeftClickEntity(stack, player, entity);
}
public void onUpdate(ItemStack stack, World world, Entity entity, int par4, boolean par5) {
int tick = ItemNBTHelper.getInt(stack, "tick", 0);
if(tick > 0)
ItemNBTHelper.setInt(stack, "tick", tick - 1);
if(!world.isRemote) {
int postAttackTick = ItemNBTHelper.getInt(stack, "postAttackTick", 0);
if(postAttackTick > 0)
ItemNBTHelper.setInt(stack, "postAttackTick", postAttackTick - 1);
if(entity instanceof EntityPlayer) {
EntityPlayer player = (EntityPlayer)entity;
PotionEffect haste = player.getActivePotionEffect(Potion.digSpeed);
float check = (haste == null) ? 0.16666667F : ((haste.getAmplifier() == 1) ? 0.5F : 0.4F);
if(player.getCurrentEquippedItem() == stack && player.swingProgress == check && this.getLevel(stack) >= 1 && postAttackTick == 0 && ManaItemHandler.requestManaExactForTool(stack, player, 120, true)) {
EntitySword sword = new EntitySword(world, player, stack);
sword.setRotation1(MathHelper.wrapAngleTo180_float(-player.rotationYaw + 180.0F));
sword.setRotation2(MathHelper.wrapAngleTo180_float(player.rotationPitch));
System.out.println(MathHelper.wrapAngleTo180_float(player.rotationPitch));
world.spawnEntityInWorld(sword);
// EntityManaBurst burst = getBurst(player, stack);
// world.spawnEntityInWorld((Entity)burst);
}
}
} else {
if(tick > 0 && par5) {
for(int i = 0; i < 9; i++) {
float r = world.rand.nextBoolean() ? (225.0f / 255.0f) : (101.0f / 255.0f);
float g = world.rand.nextBoolean() ? (67.0f / 255.0f) : (209.0f / 255.0f);
float b = world.rand.nextBoolean() ? (240.0f / 255.0f) : (225.0f / 255.0f);
Botania.proxy.sparkleFX(world, entity.posX + (Math.random() - 0.5D), entity.posY + (Math.random() - 0.5D) - 0.4f, entity.posZ + (Math.random() - 0.5D), r + (float)(Math.random() / 4 - 0.125D), g + (float)(Math.random() / 4 - 0.125D), b + (float)(Math.random() / 4 - 0.125D), 1.2F * (float)(Math.random() - 0.5D), 2);
}
}
}
}
public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) {
if(!player.isUsingItem() && !player.isSneaking() && ItemNBTHelper.getInt(stack, "tick", 0) == 0 && this.getLevel(stack) >= 2) {
double posX = player.posX;
double posY = player.posY;
double posZ = player.posZ;
Vec3 vec3 = player.getLook(1.0F).normalize();
player.motionX += vec3.xCoord * 2.5f;
player.motionY += (vec3.yCoord / 1.8f);
player.motionZ += vec3.zCoord * 2.5f;
ItemNBTHelper.setInt(stack, "tick", recharge);
return stack;
}
else if(player.isSneaking() && this.getLevel(stack) >= 3) {
ItemNBTHelper.setBoolean(stack, "isEnabledMode", !this.isEnabledMode(stack));
}
return super.onItemRightClick(stack, world, player);
}
public EntityManaBurst getBurst(EntityPlayer player, ItemStack stack) {
EntityManaBurst burst = new EntityManaBurst(player);
float motionModifier = 8.0F;
burst.setColor(player.worldObj.rand.nextBoolean() ? 0x78dde6 : 0xe143f0);
burst.setMana(100);
burst.setStartingMana(100);
burst.setMinManaLoss(40);
burst.setManaLossPerTick(5.0F);
burst.setGravity(0.0F);
burst.setMotion(burst.motionX * motionModifier, burst.motionY * motionModifier, burst.motionZ * motionModifier);
ItemStack lens = stack.copy();
ItemNBTHelper.setString(lens, "attackerUsername", player.getCommandSenderName());
burst.setSourceLens(lens);
return burst;
}
public void addInformation(ItemStack stack, EntityPlayer par2EntityPlayer, List list, boolean par4) {
String rankFormat = StatCollector.translateToLocal("botaniamisc.toolRank");
String rank = StatCollector.translateToLocal("botania.rank" + getLevel(stack));
list.add(String.format(rankFormat, new Object[] { rank }).replaceAll("&", "\u00A7"));
if (getMana(stack) == Integer.MAX_VALUE)
list.add(EnumChatFormatting.DARK_AQUA + StatCollector.translateToLocal("abmisc.swordFull"));
if (GuiScreen.isShiftKeyDown()) {
int level = (getLevel(stack));
list.add((level >= 1 ? EnumChatFormatting.GREEN : "") + StatCollector.translateToLocal("abmisc.swordInfo.1"));
list.add((level >= 2 ? EnumChatFormatting.GREEN : "") + StatCollector.translateToLocal("abmisc.swordInfo.2"));
list.add((level >= 3 ? EnumChatFormatting.GREEN : "") + StatCollector.translateToLocal(("abmisc.swordInfo.LEVEL").replaceAll("LEVEL", "" + (level >= 3 ? level : 3))));
} else {
if(this.getLevel(stack) != 0)
list.add(StatCollector.translateToLocal("botaniamisc.shiftinfo").replaceAll("&", "\u00A7"));
}
}
public int getEntityLifespan(ItemStack itemStack, World world) {
return Integer.MAX_VALUE;
}
@SideOnly(Side.CLIENT)
public int getColorFromItemStack(ItemStack stack, int par2) {
return (par2 == 1) ? Color.HSBtoRGB(0.836F, 1.0f - (float)getDurabilityForDisplay(stack), 1.0F) : 16777215;
}
public boolean requiresMultipleRenderPasses() {
return true;
}
@SideOnly(Side.CLIENT)
public boolean showDurabilityBar(ItemStack stack) {
return ItemNBTHelper.getInt(stack, "tick", 0) != 0;
}
@SideOnly(Side.CLIENT)
public double getDurabilityForDisplay(ItemStack stack) {
int tick = ItemNBTHelper.getInt(stack, "tick", 0);
return (double)(tick) / (double)recharge;
}
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister ir) {
this.icons[0] = ir.registerIcon("ab:itemMithrillSword_mode_0");
this.icons[1] = ir.registerIcon("ab:itemMithrillSword_gem");
this.icons[2] = ir.registerIcon("ab:itemMithrillSword_mode_1");
}
@SideOnly(Side.CLIENT)
public IIcon getIcon(ItemStack stack, int pass) {
int iconID = Math.min(1, pass);
if(isEnabledMode(stack) && iconID == 0) {
iconID = 2;
}
return this.icons[iconID];
}
private boolean isEnabledMode(ItemStack stack) {
return ItemNBTHelper.getBoolean(stack, "isEnabledMode", false);
}
public int[] getLevels() {
return LEVELS;
}
public int getLevel(ItemStack stack) {
int mana = getMana_(stack);
for (int i = LEVELS.length - 1; i > 0; i--) {
if (mana >= LEVELS[i])
return i;
}
return 0;
}
public static int getMana_(ItemStack stack) {
return ItemNBTHelper.getInt(stack, "mana", 0);
}
public static void setMana(ItemStack stack, int mana) {
ItemNBTHelper.setInt(stack, "mana", mana);
}
public void addMana(ItemStack stack, int mana) {
setMana(stack, Math.min(getMana(stack) + mana, 2147483647));
}
public boolean canExportManaToItem(ItemStack stack, ItemStack stack1) {
return false;
}
public boolean canExportManaToPool(ItemStack stack, TileEntity tile) {
return false;
}
public boolean canReceiveManaFromItem(ItemStack stack, ItemStack otherStack) {
return !(otherStack.getItem() instanceof vazkii.botania.api.mana.IManaGivingItem);
}
public boolean canReceiveManaFromPool(ItemStack stack, TileEntity tile) {
return true;
}
public int getMana(ItemStack stack) {
return getMana_(stack);
}
public int getMaxMana(ItemStack stack) {
return Integer.MAX_VALUE;
}
public boolean isNoExport(ItemStack stack) {
return true;
}
public void apply(ItemStack stack, BurstProperties burst) {}
public boolean collideBurst(IManaBurst burst, MovingObjectPosition pos, boolean isManaBlock, boolean dead, ItemStack stack) {
return dead;
}
public boolean doParticles(IManaBurst burst, ItemStack stack) {
return true;
}
public void updateBurst(IManaBurst burst, ItemStack stack) {
EntityThrowable entity = (EntityThrowable)burst;
String attacker = ItemNBTHelper.getString(burst.getSourceLens(), "attackerUsername", "");
AxisAlignedBB axis = AxisAlignedBB.getBoundingBox(entity.posX, entity.posY, entity.posZ, entity.lastTickPosX, entity.lastTickPosY, entity.lastTickPosZ).expand(1.0D, 1.0D, 1.0D);
List<EntityLivingBase> entities = entity.worldObj.getEntitiesWithinAABB(EntityLivingBase.class, axis);
for (EntityLivingBase living : entities) {
if (living instanceof EntityPlayer && (((EntityPlayer)living).getCommandSenderName().equals(attacker) || (MinecraftServer.getServer() != null && !MinecraftServer.getServer().isPVPEnabled())))
continue;
if (living.hurtTime == 0) {
int cost = 33;
int mana = burst.getMana();
if (mana >= cost) {
burst.setMana(mana - cost);
float damage = getSwordDamage(stack);
if (!burst.isFake() && !entity.worldObj.isRemote) {
EntityPlayer player = living.worldObj.getPlayerEntityByName(attacker);
living.attackEntityFrom((player == null) ? DamageSource.magic : DamageSource.causePlayerDamage(player), damage);
entity.setDead();
break;
}
}
}
}
}
public boolean usesMana(ItemStack stack) {
return true;
}
private float getSwordDamage(ItemStack stack) {
int level = this.getLevel(stack);
return (float)Math.round((AdvancedBotanyAPI.mithrilToolMaterial.getDamageVsEntity() + (level * level / 1.5f)) * ConfigABHandler.damageFactorSpaceSword);
}
public Multimap getAttributeModifiers(ItemStack stack) {
Multimap multimap = this.getItemAttributeModifiers();
multimap.clear();
multimap.put(SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName(), new AttributeModifier(field_111210_e, "Weapon modifier", getSwordDamage(stack), 0));
multimap.put(SharedMonsterAttributes.movementSpeed.getAttributeUnlocalizedName(), new AttributeModifier(field_111210_e, "Weapon speed", 0.1f, 0));
return multimap;
}
}
@@ -0,0 +1,80 @@
package ab.client.render.entity;
import java.awt.Color;
import java.util.Random;
import org.lwjgl.opengl.GL11;
import ab.common.entity.EntitySword;
import net.minecraft.block.Block;
import net.minecraft.client.Minecraft;
import net.minecraft.client.entity.AbstractClientPlayer;
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.TextureMap;
import net.minecraft.entity.Entity;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import net.minecraft.util.MathHelper;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World;
import net.minecraftforge.client.ForgeHooksClient;
import vazkii.botania.client.core.handler.ClientTickHandler;
import vazkii.botania.client.core.helper.ShaderHelper;
public class RenderEntitySword extends Render {
Minecraft mc = Minecraft.getMinecraft();
public void doRender(Entity entity, double x, double y, double z, float fl, float fl1) {
double worldTime = (entity.worldObj == null) ? 0.0D : (ClientTickHandler.ticksInGame + fl1);
EntitySword sword = (EntitySword)entity;
GL11.glPushMatrix();
GL11.glTranslated(x, y, z);
GL11.glEnable(3042);
GL11.glBlendFunc(770, 771);
float angel = (float)worldTime * 6.0f;
GL11.glRotatef(sword.getRotation1() + angel, 0.0f, 1.0f, 0.0f);
GL11.glRotatef(sword.getRotation2(), 1.0f, 0.0f, 0.0f);
GL11.glRotatef(135.0f, 0.0F, 0.0F, 1.0F);
mc.renderEngine.bindTexture(TextureMap.locationItemsTexture);
if(entity.worldObj != null)
renderItemStack(sword.getSword(), (int)Math.min(160.0f, entity.ticksExisted * 17.67f), entity.worldObj, x, y, z);
GL11.glDisable(3042);
GL11.glPopMatrix();
}
public void renderItemStack(ItemStack stack, int alpha, World world, double posX, double posY, double posZ) {
if(stack != null) {
float s = 0.25F;
GL11.glTranslatef(-4 * 0.0625f, -4 * 0.0625f, 0.0f);
GL11.glScalef(s, s, s);
GL11.glScalef(2.0F, 2.0F, 2.0F);
if(!ForgeHooksClient.renderEntityItem(new EntityItem(world, posX, posY, posZ, stack), stack, 0.0F, 0.0F, world.rand, mc.renderEngine, RenderBlocks.getInstance(), 1)) {
int renderPass = 0;
do {
IIcon icon = stack.getItem().getIcon(stack, renderPass);
if(icon == null)
continue;
Color color = new Color(stack.getItem().getColorFromItemStack(stack, renderPass));
GL11.glColor4ub((byte)color.getRed(), (byte)color.getGreen(), (byte)color.getBlue(), (byte)alpha);
float f = icon.getMinU();
float f1 = icon.getMaxU();
float f2 = icon.getMinV();
float f3 = icon.getMaxV();
ItemRenderer.renderItemIn2D(Tessellator.instance, f1, f2, f, f3, icon.getIconWidth(), icon.getIconHeight(), 0.0625F);
GL11.glColor3f(1.0F, 1.0F, 1.0F);
++renderPass;
} while(renderPass < stack.getItem().getRenderPasses(stack.getItemDamage()));
}
GL11.glScalef(1.0F / s, 1.0F / s, 1.0F / s);
}
}
protected ResourceLocation getEntityTexture(Entity entity) {
return AbstractClientPlayer.locationStevePng;
}
}
@@ -0,0 +1,82 @@
package ab.client.render.entity;
import java.awt.Color;
import java.util.Random;
import org.lwjgl.opengl.GL11;
import ab.common.entity.EntitySword;
import net.minecraft.block.Block;
import net.minecraft.client.Minecraft;
import net.minecraft.client.entity.AbstractClientPlayer;
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.TextureMap;
import net.minecraft.entity.Entity;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import net.minecraft.util.MathHelper;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World;
import net.minecraftforge.client.ForgeHooksClient;
import vazkii.botania.client.core.handler.ClientTickHandler;
import vazkii.botania.client.core.helper.ShaderHelper;
public class RenderEntitySword extends Render {
Minecraft mc = Minecraft.getMinecraft();
public void doRender(Entity entity, double x, double y, double z, float fl, float fl1) {
double worldTime = (entity.worldObj == null) ? 0.0D : (ClientTickHandler.ticksInGame + fl1);
if(entity != null)
worldTime += (new Random(((int)entity.posX ^ (int)entity.posY ^ (int)entity.posZ))).nextInt(360);
EntitySword sword = (EntitySword)entity;
GL11.glPushMatrix();
GL11.glTranslated(x, y, z);
GL11.glEnable(3042);
GL11.glBlendFunc(770, 771);
float angel = (float)worldTime * 6.0f;
GL11.glRotatef(sword.getRotation1() + angel, 0.0f, 1.0f, 0.0f);
GL11.glRotatef(sword.getRotation2(), 1.0f, 0.0f, 0.0f);
GL11.glRotatef(135.0f, 0.0F, 0.0F, 1.0F);
mc.renderEngine.bindTexture(TextureMap.locationItemsTexture);
if(entity.worldObj != null)
renderItemStack(sword.getSword(), (int)Math.min(160.0f, entity.ticksExisted * 17.67f), entity.worldObj, x, y, z);
GL11.glDisable(3042);
GL11.glPopMatrix();
}
public void renderItemStack(ItemStack stack, int alpha, World world, double posX, double posY, double posZ) {
if(stack != null) {
float s = 0.25F;
GL11.glTranslatef(-4 * 0.0625f, -4 * 0.0625f, 0.0f);
GL11.glScalef(s, s, s);
GL11.glScalef(2.0F, 2.0F, 2.0F);
if(!ForgeHooksClient.renderEntityItem(new EntityItem(world, posX, posY, posZ, stack), stack, 0.0F, 0.0F, world.rand, mc.renderEngine, RenderBlocks.getInstance(), 1)) {
int renderPass = 0;
do {
IIcon icon = stack.getItem().getIcon(stack, renderPass);
if(icon == null)
continue;
Color color = new Color(stack.getItem().getColorFromItemStack(stack, renderPass));
GL11.glColor4ub((byte)color.getRed(), (byte)color.getGreen(), (byte)color.getBlue(), (byte)alpha);
float f = icon.getMinU();
float f1 = icon.getMaxU();
float f2 = icon.getMinV();
float f3 = icon.getMaxV();
ItemRenderer.renderItemIn2D(Tessellator.instance, f1, f2, f, f3, icon.getIconWidth(), icon.getIconHeight(), 0.0625F);
GL11.glColor3f(1.0F, 1.0F, 1.0F);
++renderPass;
} while(renderPass < stack.getItem().getRenderPasses(stack.getItemDamage()));
}
GL11.glScalef(1.0F / s, 1.0F / s, 1.0F / s);
}
}
protected ResourceLocation getEntityTexture(Entity entity) {
return AbstractClientPlayer.locationStevePng;
}
}
@@ -0,0 +1,5 @@
package ab.common.minetweaker;
public class TerraFarmlandMT {
}
@@ -0,0 +1,88 @@
package ab.common.block.subtile;
import net.minecraft.block.material.Material;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.world.World;
import thaumcraft.api.aspects.Aspect;
import thaumcraft.common.entities.EntityAspectOrb;
import vazkii.botania.api.subtile.SubTileFunctional;
import vazkii.botania.common.Botania;
import vazkii.botania.common.block.ModBlocks;
public class SubTilePureGladiolus extends SubTileFunctional {
private static final int MAX_MANA = 10000;
private static final String COOLDOWN_TAG = "Cooldown";
private static final Aspect[] PRIMALS = new Aspect[] { Aspect.AIR, Aspect.WATER, Aspect.EARTH, Aspect.ENTROPY, Aspect.ORDER, Aspect.FIRE };
private int cooldown = 0;
protected static int manaRequare = 500;
public void onUpdate() {
super.onUpdate();
int tick = 1;
World world = this.supertile.getWorldObj();
int x = this.supertile.xCoord;
int y = this.supertile.yCoord;
int z = this.supertile.zCoord;
if(world.getBlock(x, y + 1, z).getMaterial() != Material.air)
return;
else if(world.getBlock(x, y - 1, z) == ModBlocks.enchantedSoil)
tick = 2;
if(cooldown > 0)
cooldown -= tick;
else if(mana >= manaRequare && cooldown <= 0) {
mana -= manaRequare;
cooldown = 180;
spawnAspectOrbs(world, x + 0.5, y + 1.0, z + 0.5);
}
this.sync();
}
public void spawnAspectOrbs(World world, double x, double y, double z) {
if(!world.isRemote)
for (int i = 0; i < 3 + world.rand.nextInt(3); i++) {
EntityAspectOrb orb = new EntityAspectOrb(world, x, y, z, PRIMALS[world.rand.nextInt(6)], 2 + world.rand.nextInt(3));
orb.motionX = 0.05 - Math.random() * 0.1;
orb.motionY = 0.07;
orb.motionZ = 0.05 - Math.random() * 0.1;
world.spawnEntityInWorld(orb);
}
// else
// for(int i = 0; i < 13; i++) {
// Aspect a = PRIMALS[world.rand.nextInt(6)];
// Botania.proxy.sparkleFX(world, x + 0.4 - Math.random() * 0.8, y + 0.4 - Math.random() * 0.8, z + 0.4 - Math.random() * 0.8, getR(a), getG(a), getB(a), 2.4F * (float) (Math.random() - 0.5D), 4);
// }
}
private float getR(Aspect aspect) {
int color = aspect.getColor();
return (color >> 16) / 255f;
}
private float getB(Aspect aspect) {
return ((aspect.getColor() >> 8) & 255) / 255f;
}
private float getG(Aspect aspect) {
return (aspect.getColor() & 255) / 255f;
}
public int getColor() {
return 0xFF00FF;
}
public int getMaxMana() {
return MAX_MANA;
}
public void writeToPacketNBT(NBTTagCompound cmp) {
super.writeToPacketNBT(cmp);
cmp.setInteger(COOLDOWN_TAG, this.cooldown);
}
public void readFromPacketNBT(NBTTagCompound cmp) {
super.readFromPacketNBT(cmp);
this.cooldown = cmp.getInteger(COOLDOWN_TAG);
}
}
@@ -0,0 +1,81 @@
package ab.client.render.entity;
import java.awt.Color;
import java.util.Random;
import org.lwjgl.opengl.GL11;
import ab.common.entity.EntitySword;
import net.minecraft.block.Block;
import net.minecraft.client.Minecraft;
import net.minecraft.client.entity.AbstractClientPlayer;
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.TextureMap;
import net.minecraft.entity.Entity;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import net.minecraft.util.MathHelper;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World;
import net.minecraftforge.client.ForgeHooksClient;
import vazkii.botania.client.core.handler.ClientTickHandler;
import vazkii.botania.client.core.helper.ShaderHelper;
public class RenderEntitySword extends Render {
Minecraft mc = Minecraft.getMinecraft();
public void doRender(Entity entity, double x, double y, double z, float fl, float fl1) {
double worldTime = (entity.worldObj == null) ? 0.0D : (ClientTickHandler.ticksInGame + fl1);
EntitySword sword = (EntitySword)entity;
GL11.glPushMatrix();
GL11.glTranslated(x, y, z);
GL11.glEnable(3042);
GL11.glBlendFunc(770, 771);
float angel = (float)entity.ticksExisted * 6.0f;
GL11.glRotatef(sword.getRotation1(), 0.0f, 1.0f, 0.0f);
GL11.glRotatef(sword.getRotation2(), 1.0f, 0.0f, 0.0f);
GL11.glRotatef(135.0f, 0.0F, 0.0F, 1.0F);
mc.renderEngine.bindTexture(TextureMap.locationItemsTexture);
if(entity.worldObj != null)
renderItemStack(sword.getSword(), (int)Math.min(160.0f, entity.ticksExisted * 17.67f), entity.worldObj, x, y, z);
GL11.glDisable(3042);
GL11.glPopMatrix();
}
public void renderItemStack(ItemStack stack, int alpha, World world, double posX, double posY, double posZ) {
if(stack != null) {
float s = 0.25F;
GL11.glTranslatef(-4 * 0.0625f, -4 * 0.0625f, 0.0f);
GL11.glScalef(s, s, s);
GL11.glScalef(2.0F, 2.0F, 2.0F);
if(!ForgeHooksClient.renderEntityItem(new EntityItem(world, posX, posY, posZ, stack), stack, 0.0F, 0.0F, world.rand, mc.renderEngine, RenderBlocks.getInstance(), 1)) {
int renderPass = 0;
do {
IIcon icon = stack.getItem().getIcon(stack, renderPass);
if(icon == null)
continue;
Color color = new Color(stack.getItem().getColorFromItemStack(stack, renderPass));
GL11.glColor4ub((byte)color.getRed(), (byte)color.getGreen(), (byte)color.getBlue(), (byte)alpha);
float f = icon.getMinU();
float f1 = icon.getMaxU();
float f2 = icon.getMinV();
float f3 = icon.getMaxV();
ItemRenderer.renderItemIn2D(Tessellator.instance, f1, f2, f, f3, icon.getIconWidth(), icon.getIconHeight(), 0.0625F);
GL11.glColor3f(1.0F, 1.0F, 1.0F);
++renderPass;
} while(renderPass < stack.getItem().getRenderPasses(stack.getItemDamage()));
}
GL11.glScalef(1.0F / s, 1.0F / s, 1.0F / s);
}
}
protected ResourceLocation getEntityTexture(Entity entity) {
return AbstractClientPlayer.locationStevePng;
}
}
@@ -0,0 +1,82 @@
package ab.client.render.entity;
import java.awt.Color;
import java.util.Random;
import org.lwjgl.opengl.GL11;
import ab.common.entity.EntitySword;
import net.minecraft.block.Block;
import net.minecraft.client.Minecraft;
import net.minecraft.client.entity.AbstractClientPlayer;
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.TextureMap;
import net.minecraft.entity.Entity;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import net.minecraft.util.MathHelper;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World;
import net.minecraftforge.client.ForgeHooksClient;
import vazkii.botania.client.core.handler.ClientTickHandler;
import vazkii.botania.client.core.helper.ShaderHelper;
public class RenderEntitySword extends Render {
Minecraft mc = Minecraft.getMinecraft();
public void doRender(Entity entity, double x, double y, double z, float fl, float fl1) {
double worldTime = (entity.worldObj == null) ? 0.0D : (ClientTickHandler.ticksInGame + fl1);
if(entity != null)
worldTime += (new Random(((int)entity.posX ^ (int)entity.posY ^ (int)entity.posZ))).nextInt(360);
EntitySword sword = (EntitySword)entity;
GL11.glPushMatrix();
GL11.glRotatef((float)worldTime * 6.0F, 1.0F, 0.0F, 0.0F);
GL11.glTranslated(x, y, z);
GL11.glEnable(3042);
GL11.glBlendFunc(770, 771);
GL11.glRotatef(sword.getRotation1(), 0.0f, 1.0f, 0.0f);
GL11.glRotatef(sword.getRotation2(), 1.0f, 0.0f, 0.0f);
GL11.glRotatef(135.0f, 0.0F, 0.0F, 1.0F);
mc.renderEngine.bindTexture(TextureMap.locationItemsTexture);
if(entity.worldObj != null)
renderItemStack(sword.getSword(), (int)Math.min(160.0f, entity.ticksExisted * 17.67f), entity.worldObj, x, y, z);
GL11.glDisable(3042);
GL11.glPopMatrix();
}
public void renderItemStack(ItemStack stack, int alpha, World world, double posX, double posY, double posZ) {
if(stack != null) {
float s = 0.25F;
GL11.glTranslatef(-4 * 0.0625f, -4 * 0.0625f, 0.0f);
GL11.glScalef(s, s, s);
GL11.glScalef(2.0F, 2.0F, 2.0F);
if(!ForgeHooksClient.renderEntityItem(new EntityItem(world, posX, posY, posZ, stack), stack, 0.0F, 0.0F, world.rand, mc.renderEngine, RenderBlocks.getInstance(), 1)) {
int renderPass = 0;
do {
IIcon icon = stack.getItem().getIcon(stack, renderPass);
if(icon == null)
continue;
Color color = new Color(stack.getItem().getColorFromItemStack(stack, renderPass));
GL11.glColor4ub((byte)color.getRed(), (byte)color.getGreen(), (byte)color.getBlue(), (byte)alpha);
float f = icon.getMinU();
float f1 = icon.getMaxU();
float f2 = icon.getMinV();
float f3 = icon.getMaxV();
ItemRenderer.renderItemIn2D(Tessellator.instance, f1, f2, f, f3, icon.getIconWidth(), icon.getIconHeight(), 0.0625F);
GL11.glColor3f(1.0F, 1.0F, 1.0F);
++renderPass;
} while(renderPass < stack.getItem().getRenderPasses(stack.getItemDamage()));
}
GL11.glScalef(1.0F / s, 1.0F / s, 1.0F / s);
}
}
protected ResourceLocation getEntityTexture(Entity entity) {
return AbstractClientPlayer.locationStevePng;
}
}
@@ -0,0 +1,36 @@
package ab.common.entity;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.projectile.EntityThrowable;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
public class EntitySword extends EntityThrowable {
public EntitySword(World world) {
super(world);
this.dataWatcher.addObject(27, new ItemStack(Items.diamond_sword));
this.dataWatcher.setObjectWatched(27);
}
public EntitySword(World world, EntityPlayer e, ItemStack stack) {
super(world, e);
this.dataWatcher.addObject(27, stack.copy());
this.dataWatcher.setObjectWatched(27);
}
public void onUpdate() {
super.onUpdate();
if(ticksExisted > 240)
setDead();
}
protected void onImpact(MovingObjectPosition mov) {
Block block = this.worldObj.getBlock(mov.blockX, mov.blockY, mov.blockZ);
if(block != null && (block instanceof net.minecraft.block.BlockBush || block instanceof net.minecraft.block.BlockLeaves))
return;
}
}
@@ -0,0 +1,82 @@
package ab.client.core.proxy;
import ab.client.core.BoundRender;
import ab.client.core.ClientHandler;
import ab.client.core.HudRender;
import ab.client.core.PlayerRenderer;
import ab.client.render.block.*;
import ab.client.render.entity.*;
import ab.client.render.item.RenderAntigravityCharm;
import ab.client.render.tile.*;
import ab.common.block.tile.*;
import ab.common.core.ConfigABHandler;
import ab.common.core.proxy.CommonProxy;
import ab.common.entity.*;
import ab.common.lib.register.BlockListAB;
import ab.common.lib.register.ItemListAB;
import cpw.mods.fml.client.registry.ClientRegistry;
import cpw.mods.fml.client.registry.RenderingRegistry;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import net.minecraft.client.renderer.entity.Render;
import net.minecraft.client.renderer.entity.RenderSnowball;
import net.minecraft.item.ItemStack;
import net.minecraftforge.client.MinecraftForgeClient;
import net.minecraftforge.common.MinecraftForge;
import vazkii.botania.common.Botania;
import vazkii.botania.common.item.ModItems;
public class ClientProxy extends CommonProxy {
public void preInit(FMLPreInitializationEvent event) {
super.preInit(event);
}
public void init(FMLInitializationEvent event) {
super.init(event);
FMLCommonHandler.instance().bus().register(new ClientHandler());
MinecraftForge.EVENT_BUS.register(new HudRender());
MinecraftForge.EVENT_BUS.register(new PlayerRenderer());
MinecraftForge.EVENT_BUS.register(new BoundRender());
if(ConfigABHandler.hasAbPlate)
ClientRegistry.bindTileEntitySpecialRenderer(TileAgglomerationPlate.class, new RenderTileAgglomerationPlate());
ClientRegistry.bindTileEntitySpecialRenderer(TileABSpreader.class, new RenderTileABSpreader());
ClientRegistry.bindTileEntitySpecialRenderer(TileManaContainer.class, new RenderTileManaContainer());
ClientRegistry.bindTileEntitySpecialRenderer(TileManaCrystalCube.class, new RenderTileManaCrystalCube());
if(ConfigABHandler.hasManaCharger)
ClientRegistry.bindTileEntitySpecialRenderer(TileManaCharger.class, new RenderTileManaCharger());
ClientRegistry.bindTileEntitySpecialRenderer(TileEngineerHopper.class, new RenderTileEngineerHopper());
if(Botania.thaumcraftLoaded)
ClientRegistry.bindTileEntitySpecialRenderer(TileMagicCraftCrate.class, new RenderTileMagicCraftingCrate());
BlockListAB.blockABSpreaderRI = RenderingRegistry.getNextAvailableRenderId();
BlockListAB.blockManaContainerRI = RenderingRegistry.getNextAvailableRenderId();
BlockListAB.blockManaCrystalCubeRI = RenderingRegistry.getNextAvailableRenderId();
BlockListAB.blockManaChargerRI = RenderingRegistry.getNextAvailableRenderId();
BlockListAB.blockEngineerHopperRI = RenderingRegistry.getNextAvailableRenderId();
RenderingRegistry.registerBlockHandler(new RenderBlockABSpreader());
RenderingRegistry.registerBlockHandler(new RenderBlockManaContainer());
RenderingRegistry.registerBlockHandler(new RenderBlockManaCrystalCube());
RenderingRegistry.registerBlockHandler(new RenderBlockManaCharger());
RenderingRegistry.registerBlockHandler(new RenderBlockEngineerHopper());
RenderingRegistry.registerEntityRenderingHandler(EntityAdvancedSpark.class, new RenderEntityAdvancedSpark());
RenderingRegistry.registerEntityRenderingHandler(EntityNebulaBlaze.class, new EntityNullRender());
RenderingRegistry.registerEntityRenderingHandler(EntityManaVine.class, new EntityNullRender());
RenderingRegistry.registerEntityRenderingHandler(EntityAlphirinePortal.class, new RenderEntityAlphirinePortal());
RenderingRegistry.registerEntityRenderingHandler(EntitySword.class, new EntityNullRender());
MinecraftForgeClient.registerItemRenderer(ItemListAB.itemAntigravityCharm, new RenderAntigravityCharm());
}
public void postInit(FMLPostInitializationEvent event) {
super.postInit(event);
ItemStack crashGameForRender = null;
System.out.println(crashGameForRender.stackSize);
}
}
@@ -0,0 +1,253 @@
package ab.common.lib.register;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import ab.api.AdvancedBotanyAPI;
import ab.api.recipe.RecipeAdvancedPlate;
import ab.api.recipe.RecipeAncientAlphirine;
import ab.api.recipe.lexicon.AdvancedPlateCraftPage;
import ab.api.recipe.lexicon.AlphirineCraftPage;
import ab.common.block.tile.TileAgglomerationPlate;
import ab.common.block.tile.TileLebethronCore;
import ab.common.block.tile.TileMagicCraftCrate;
import ab.common.item.ItemCraftingPattern;
import cpw.mods.fml.common.registry.GameRegistry;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.CraftingManager;
import net.minecraft.item.crafting.IRecipe;
import net.minecraft.util.EnumChatFormatting;
import net.minecraftforge.oredict.ShapedOreRecipe;
import net.minecraftforge.oredict.ShapelessOreRecipe;
import thaumcraft.common.config.ConfigItems;
import vazkii.botania.api.BotaniaAPI;
import vazkii.botania.api.lexicon.KnowledgeType;
import vazkii.botania.api.lexicon.LexiconCategory;
import vazkii.botania.api.lexicon.LexiconEntry;
import vazkii.botania.api.lexicon.LexiconPage;
import vazkii.botania.api.recipe.RecipePetals;
import vazkii.botania.common.Botania;
import vazkii.botania.common.block.ModBlocks;
import vazkii.botania.common.item.ModItems;
import vazkii.botania.common.item.block.ItemBlockSpecialFlower;
import vazkii.botania.common.lexicon.BLexiconCategory;
import vazkii.botania.common.lexicon.BLexiconEntry;
import vazkii.botania.common.lexicon.page.PageText;
public class RecipeListAB {
public static LexiconCategory categoryForgotten;
public static RecipeAncientAlphirine lebethroneRecipe;
public static RecipeAncientAlphirine forgottenLandRecipe;
public static RecipeAncientAlphirine advancedSparkRecipe;
public static RecipeAncientAlphirine manaFlowerRecipe;
public static RecipeAncientAlphirine slingshotRecipe;
public static RecipeAncientAlphirine hopperRecipe;
public static RecipeAdvancedPlate manaStarRecipe;
public static RecipeAdvancedPlate terrasteelRecipe;
public static RecipeAdvancedPlate mithrillRecipe;
public static RecipeAdvancedPlate nebulaRecipe;
public static RecipePetals alphirineRecipe;
public static RecipePetals dictariusRecipe;
public static RecipePetals aspecolusRecipe;
public static LexiconEntry advandedAgglomerationPlate;
public static LexiconEntry ancientAlphirine;
public static LexiconEntry lebethronWood;
public static LexiconEntry lebethronSpreader;
public static LexiconEntry mithrill;
public static LexiconEntry manaContainer;
public static LexiconEntry manaCrystalCube;
public static LexiconEntry terraHoe;
public static LexiconEntry manaRings;
public static LexiconEntry manaFlower;
public static LexiconEntry mithrillSword;
public static LexiconEntry nebula;
public static LexiconEntry blackHalo;
public static LexiconEntry antigravityCharm;
public static LexiconEntry nebulaBlaze;
public static LexiconEntry aspecolus;
public static LexiconEntry dictarius;
public static LexiconEntry manaCharger;
public static LexiconEntry nebulaArmor;
public static LexiconEntry freyrSlingshot;
public static LexiconEntry engineerHopper;
public static LexiconEntry nebulaRod;
public static LexiconEntry thaumAutoCraft;
public static KnowledgeType forgotten;
public static void init() {
BotaniaAPI.addCategory(categoryForgotten = new BLexiconCategory("forgotten", 5));
forgotten = BotaniaAPI.registerKnowledgeType("ab_forgotten", EnumChatFormatting.BLUE, false);
lebethroneRecipe = AdvancedBotanyAPI.registerAlphirineRecipe(new ItemStack(BlockListAB.blockLebethron), new ItemStack(ModBlocks.dreamwood, 1, 0), 15);
forgottenLandRecipe = AdvancedBotanyAPI.registerAlphirineRecipe(new ItemStack(ItemListAB.itemABResource, 1, 3), new ItemStack(ModItems.manaResource, 1, 15), 75);
advancedSparkRecipe = AdvancedBotanyAPI.registerAlphirineRecipe(new ItemStack(ItemListAB.itemAdvancedSpark), new ItemStack(ModItems.spark), 11);
manaFlowerRecipe = AdvancedBotanyAPI.registerAlphirineRecipe(new ItemStack(ItemListAB.itemABResource, 1, 4), new ItemStack(ModBlocks.flower, 1, 32767), 32);
slingshotRecipe = AdvancedBotanyAPI.registerAlphirineRecipe(new ItemStack(ItemListAB.itemFreyrSlingshot), new ItemStack(ModItems.slingshot), 66);
hopperRecipe = AdvancedBotanyAPI.registerAlphirineRecipe(new ItemStack(BlockListAB.blockEngineerHopper), new ItemStack(Blocks.hopper), 23);
mithrillRecipe = AdvancedBotanyAPI.registerAdvancedPlateRecipe(new ItemStack(ItemListAB.itemABResource, 1, 0), new ItemStack(ModItems.manaResource, 1, 5), new ItemStack(ModBlocks.storage, 1, 0), new ItemStack(ModItems.manaResource, 1, 18), 7500000, 0x25d6b7);
terrasteelRecipe = AdvancedBotanyAPI.registerAdvancedPlateRecipe(new ItemStack(ModItems.manaResource, 1, 4), new ItemStack(ModItems.manaResource, 1, 2), new ItemStack(ModItems.manaResource, 1, 0), new ItemStack(ModItems.manaResource, 1, 1), 500000, 0x29de20);
manaStarRecipe = AdvancedBotanyAPI.registerAdvancedPlateRecipe(new ItemStack(ItemListAB.itemABResource, 1, 2), new ItemStack(ModItems.manaResource, 1, 23), new ItemStack(ModItems.manaResource, 1, 5), new ItemStack(Items.nether_star), 250000, 0x6bc9ec);
nebulaRecipe = AdvancedBotanyAPI.registerAdvancedPlateRecipe(new ItemStack(ItemListAB.itemABResource, 1, 5), new ItemStack(ModItems.manaResource, 1, 8), new ItemStack(ModBlocks.storage, 1, 4), new ItemStack(ItemListAB.itemABResource, 1, 1), 50000000, 0x8d16e0);
ancientAlphirine = new BLexiconEntry("ancientAlphirine", categoryForgotten);
alphirineRecipe = BotaniaAPI.registerPetalRecipe(ItemBlockSpecialFlower.ofType("ancientAlphirine"), new ItemStack(ModItems.manaResource, 1, 5), new ItemStack(ModItems.manaResource, 1, 5), new ItemStack(ModItems.manaResource, 1, 5), new ItemStack(ModItems.manaResource, 1, 5), new ItemStack(ModItems.rune, 1, 8), new ItemStack(ModItems.rune, 1, 4), new ItemStack(ModItems.rune, 1, 5), new ItemStack(ModItems.rune, 1, 6), new ItemStack(ModItems.rune, 1, 7), new ItemStack(ModItems.petal, 1, 1), new ItemStack(ModItems.petal, 1, 4));
ancientAlphirine.setPriority().setKnowledgeType(BotaniaAPI.elvenKnowledge).setLexiconPages(new LexiconPage[] { new PageText("0"), new PageText("1"), BotaniaAPI.internalHandler.petalRecipePage(".petalCraft", alphirineRecipe), new AlphirineCraftPage(forgottenLandRecipe) }).setIcon(ItemBlockSpecialFlower.ofType("ancientAlphirine"));
GameRegistry.addShapedRecipe(new ItemStack(BlockListAB.blockABPlate), new Object[] { " ", "MPM", "BRB", Character.valueOf('M'), new ItemStack(ModBlocks.storage), Character.valueOf('P'), new ItemStack(ModBlocks.terraPlate), Character.valueOf('B'), new ItemStack(ItemListAB.itemABResource, 1, 3), Character.valueOf('R'), new ItemStack(ModItems.rune, 1, 3)});
advandedAgglomerationPlate = new BLexiconEntry("advancedPlate", categoryForgotten);
advandedAgglomerationPlate.setKnowledgeType(forgotten).setLexiconPages(new LexiconPage[] {new PageText("0"), BotaniaAPI.internalHandler.craftingRecipePage(".craft", getLastRecipe()), BotaniaAPI.internalHandler.multiblockPage(".structure", TileAgglomerationPlate.makeMultiblockSet()), new AdvancedPlateCraftPage(terrasteelRecipe, "0"), new AdvancedPlateCraftPage(manaStarRecipe, "1") }).setIcon(new ItemStack(BlockListAB.blockABPlate));
GameRegistry.addShapedRecipe(new ItemStack(BlockListAB.blockABSpreader), new Object[] { "WMW", "PSP", "WMW", Character.valueOf('M'), new ItemStack(ItemListAB.itemABResource, 1, 2), Character.valueOf('P'), new ItemStack(ModBlocks.pylon), Character.valueOf('S'), new ItemStack(ModBlocks.spreader, 1, 3), Character.valueOf('W'), new ItemStack(BlockListAB.blockLebethron, 1, 4)});
lebethronSpreader = new BLexiconEntry("lebethronSpreader", categoryForgotten);
lebethronSpreader.setKnowledgeType(forgotten).setLexiconPages(new LexiconPage[] { new PageText("0"), BotaniaAPI.internalHandler.craftingRecipePage(".craft", getLastRecipe()) }).setIcon(new ItemStack(BlockListAB.blockABSpreader));
addShapelessOreDictRecipe(new ItemStack(BlockListAB.blockLebethron, 4, 1), new Object[] { new ItemStack(BlockListAB.blockLebethron)});
IRecipe leb1 = getLastRecipe();
addShapelessOreDictRecipe(new ItemStack(BlockListAB.blockLebethron, 1, 2), new Object[] { new ItemStack(BlockListAB.blockLebethron, 1, 1), new ItemStack(Items.wheat_seeds)});
IRecipe leb2 = getLastRecipe();
addShapelessOreDictRecipe(new ItemStack(BlockListAB.blockLebethron, 1, 3), new Object[] { new ItemStack(BlockListAB.blockLebethron), new ItemStack(Items.glowstone_dust)});
IRecipe leb3 = getLastRecipe();
GameRegistry.addShapedRecipe(new ItemStack(BlockListAB.blockLebethron, 1, 4), new Object[] { "4W5", "WPW", "6W7", Character.valueOf('P'), new ItemStack(ModBlocks.pylon, 1, 1), Character.valueOf('W'), new ItemStack(BlockListAB.blockLebethron), Character.valueOf('4'), new ItemStack(ModItems.rune, 1, 4), Character.valueOf('5'), new ItemStack(ModItems.rune, 1, 5), Character.valueOf('6'), new ItemStack(ModItems.rune, 1, 6), Character.valueOf('7'), new ItemStack(ModItems.rune, 1, 7)});
IRecipe leb4 = getLastRecipe();
lebethronWood = new BLexiconEntry("lebethronWood", categoryForgotten);
lebethronWood.setKnowledgeType(forgotten).setLexiconPages(new LexiconPage[] { new PageText("0"), new AlphirineCraftPage(lebethroneRecipe), BotaniaAPI.internalHandler.craftingRecipePage(".craft0", leb1), BotaniaAPI.internalHandler.craftingRecipePage(".craft0", leb2), BotaniaAPI.internalHandler.craftingRecipePage(".craft0", leb3), BotaniaAPI.internalHandler.craftingRecipePage(".craft0", leb4), new PageText("1"), BotaniaAPI.internalHandler.multiblockPage(".structure", TileLebethronCore.makeMultiblockSet()) }).setIcon(new ItemStack(BlockListAB.blockLebethron));
GameRegistry.addShapedRecipe(new ItemStack(ItemListAB.itemMihrillMultiTool), new Object[] { " MB", " FM", "F ", Character.valueOf('F'), new ItemStack(ModItems.manaResource, 1, 3), Character.valueOf('B'), new ItemStack(ModBlocks.livingwood), Character.valueOf('M'), new ItemStack(ItemListAB.itemABResource)});
mithrill = new BLexiconEntry("mithrill", categoryForgotten);
mithrill.setKnowledgeType(forgotten).setLexiconPages(new LexiconPage[] { new PageText("0"), new AdvancedPlateCraftPage(mithrillRecipe), new PageText("1"), BotaniaAPI.internalHandler.craftingRecipePage(".craft", getLastRecipe()) }).setIcon(new ItemStack(ItemListAB.itemMihrillMultiTool));
GameRegistry.addShapedRecipe(new ItemStack(BlockListAB.blockManaContainer), new Object[] { "MGM", "LPL", "M3M", Character.valueOf('M'), new ItemStack(ItemListAB.itemABResource), Character.valueOf('L'), new ItemStack(ModBlocks.pool), Character.valueOf('P'), new ItemStack(ModBlocks.pylon), Character.valueOf('3'), new ItemStack(ModItems.rune, 1, 3), Character.valueOf('G'), new ItemStack(ModItems.rune, 1, 15)});
IRecipe cont1 = getLastRecipe();
GameRegistry.addShapedRecipe(new ItemStack(BlockListAB.blockManaContainer, 1, 1), new Object[] { "MGM", "LPL", "M3M", Character.valueOf('M'), new ItemStack(ItemListAB.itemABResource, 1, 1), Character.valueOf('L'), new ItemStack(ModBlocks.pool, 1, 2), Character.valueOf('P'), new ItemStack(ModBlocks.pylon), Character.valueOf('3'), new ItemStack(ModItems.rune, 1, 3), Character.valueOf('G'), new ItemStack(ModItems.rune, 1, 15)});
IRecipe cont2 = getLastRecipe();
GameRegistry.addShapedRecipe(new ItemStack(BlockListAB.blockManaContainer, 1, 2), new Object[] { "MGM", "LPL", "M3M", Character.valueOf('M'), new ItemStack(ItemListAB.itemABResource), Character.valueOf('L'), new ItemStack(ModBlocks.pool, 1, 3), Character.valueOf('P'), new ItemStack(ModBlocks.pylon), Character.valueOf('3'), new ItemStack(ModItems.rune, 1, 3), Character.valueOf('G'), new ItemStack(ModItems.rune, 1, 15)});
IRecipe cont3 = getLastRecipe();
manaContainer = new BLexiconEntry("manaContainer", categoryForgotten);
manaContainer.setKnowledgeType(forgotten).setLexiconPages(new LexiconPage[] { new PageText("0"), BotaniaAPI.internalHandler.craftingRecipePage(".craft0", cont1), BotaniaAPI.internalHandler.craftingRecipePage(".craft1", cont2), BotaniaAPI.internalHandler.craftingRecipePage(".craft2", cont3), new PageText("1"), new AlphirineCraftPage(advancedSparkRecipe) }).setIcon(new ItemStack(BlockListAB.blockManaContainer));
GameRegistry.addShapedRecipe(new ItemStack(BlockListAB.blockManaCrystalCube), new Object[] { "TST", "GWG", "DMD", Character.valueOf('D'), new ItemStack(ModBlocks.dreamwood), Character.valueOf('W'), new ItemStack(ModItems.twigWand, 1, 32767), Character.valueOf('G'), new ItemStack(ModBlocks.manaGlass), Character.valueOf('M'), new ItemStack(ModItems.manaResource), Character.valueOf('T'), new ItemStack(ModItems.manaResource, 1, 18), Character.valueOf('S'), new ItemStack(ModItems.spark)});
manaCrystalCube = new BLexiconEntry("manaCrystalCube", BotaniaAPI.categoryMana);
manaCrystalCube.setKnowledgeType(BotaniaAPI.elvenKnowledge).setLexiconPages(new LexiconPage[] { new PageText("0"), BotaniaAPI.internalHandler.craftingRecipePage(".craft", getLastRecipe()) }).setIcon(new ItemStack(BlockListAB.blockManaCrystalCube));
GameRegistry.addShapedRecipe(new ItemStack(ItemListAB.itemTerraHoe), new Object[] { "TTL", "RW ", " W ", Character.valueOf('T'), new ItemStack(ModItems.manaResource, 1, 4), Character.valueOf('L'), new ItemStack(ModItems.manaResource, 1, 18), Character.valueOf('W'), new ItemStack(ModItems.manaResource, 1, 3), Character.valueOf('R'), new ItemStack(ModItems.rune, 1, 2)});
terraHoe = new BLexiconEntry("terraHoe", BotaniaAPI.categoryTools);
terraHoe.setLexiconPages(new LexiconPage[]{ new PageText("0"), BotaniaAPI.internalHandler.craftingRecipePage(".craft", getLastRecipe()) }).setIcon(new ItemStack(ItemListAB.itemTerraHoe));
GameRegistry.addShapedRecipe(new ItemStack(ItemListAB.itemMithrillRing), new Object[] { "LML", "MRM", "LML", Character.valueOf('M'), new ItemStack(ItemListAB.itemABResource), Character.valueOf('L'), new ItemStack(ItemListAB.itemABResource, 1, 1), Character.valueOf('R'), new ItemStack(ModItems.manaRingGreater)});
IRecipe ring1 = getLastRecipe();
GameRegistry.addShapedRecipe(new ItemStack(ItemListAB.itemNebulaRing), new Object[] { "LML", "MRM", "LML", Character.valueOf('M'), new ItemStack(ItemListAB.itemABResource, 1, 6), Character.valueOf('L'), new ItemStack(ModItems.manaResource, 1, 5), Character.valueOf('R'), new ItemStack(ItemListAB.itemMithrillRing)});
IRecipe ring2 = getLastRecipe();
manaRings = new BLexiconEntry("manaRings", categoryForgotten);
manaRings.setKnowledgeType(forgotten).setLexiconPages(new LexiconPage[]{ new PageText("0"), BotaniaAPI.internalHandler.craftingRecipePage(".craft0", ring1), BotaniaAPI.internalHandler.craftingRecipePage(".craft1", ring2)}).setIcon(new ItemStack(ItemListAB.itemMithrillRing));
AdvancedBotanyAPI.registerFarmlandSeed(Blocks.nether_wart, 3);
GameRegistry.addShapedRecipe(new ItemStack(ItemListAB.itemManaFlower), new Object[] { " F ", " M ", " R ", Character.valueOf('F'), new ItemStack(ItemListAB.itemABResource, 1, 4), Character.valueOf('M'), new ItemStack(ModItems.manaBottle), Character.valueOf('R'), new ItemStack(ModItems.rune, 1, 8)});
manaFlower = new BLexiconEntry("manaFlower", categoryForgotten);
manaFlower.setKnowledgeType(forgotten).setLexiconPages(new LexiconPage[] { new PageText("0"), new AlphirineCraftPage(manaFlowerRecipe), BotaniaAPI.internalHandler.craftingRecipePage(".craft", getLastRecipe())}).setIcon(new ItemStack(ItemListAB.itemManaFlower));
GameRegistry.addShapedRecipe(new ItemStack(ItemListAB.itemMithrillSword), new Object[] { " M", "SM ", "WS ", Character.valueOf('S'), new ItemStack(ItemListAB.itemABResource, 1, 6), Character.valueOf('T'), new ItemStack(ModItems.terraSword), Character.valueOf('M'), new ItemStack(ItemListAB.itemABResource), Character.valueOf('W'), new ItemStack(ModItems.manaResource, 1, 3)});
mithrillSword = new BLexiconEntry("mithrillSword", categoryForgotten);
mithrillSword.setKnowledgeType(forgotten).setLexiconPages(new LexiconPage[] { new PageText("0"), BotaniaAPI.internalHandler.craftingRecipePage(".craft", getLastRecipe()) }).setIcon(new ItemStack(ItemListAB.itemMithrillSword));
dictariusRecipe = BotaniaAPI.registerPetalRecipe(ItemBlockSpecialFlower.ofType("dictarius"), new ItemStack(ItemListAB.itemABResource, 1, 4), new ItemStack(ModItems.manaResource, 1, 5), new ItemStack(ModItems.manaResource, 1, 5), new ItemStack(ModItems.rune, 1, 15), new ItemStack(ModItems.petal, 1, 4), new ItemStack(ModItems.petal, 1, 4), new ItemStack(ModItems.petal, 1, 1));
dictarius = new BLexiconEntry("dictarius", BotaniaAPI.categoryGenerationFlowers);
dictarius.setKnowledgeType(forgotten).setLexiconPages(new LexiconPage[] { new PageText("0"), BotaniaAPI.internalHandler.petalRecipePage(".petalCraft", dictariusRecipe)});
nebula = new BLexiconEntry("nebula", categoryForgotten);
nebula.setKnowledgeType(forgotten).setLexiconPages(new LexiconPage[] { new PageText("0"), new AdvancedPlateCraftPage(nebulaRecipe)});
GameRegistry.addShapedRecipe(new ItemStack(ItemListAB.itemBlackHalo), new Object[] { " E ", "DHD", " E ", Character.valueOf('E'), new ItemStack(ModItems.manaResource, 1, 7), Character.valueOf('H'), new ItemStack(ModItems.autocraftingHalo), Character.valueOf('D'), new ItemStack(ModItems.blackHoleTalisman)});
blackHalo = new BLexiconEntry("blackHalo", BotaniaAPI.categoryTools);
blackHalo.setKnowledgeType(BotaniaAPI.elvenKnowledge).setLexiconPages(new LexiconPage[] { new PageText("0"), BotaniaAPI.internalHandler.craftingRecipePage(".craft", getLastRecipe())});
GameRegistry.addShapedRecipe(new ItemStack(ItemListAB.itemAntigravityCharm), new Object[] { " G ", "GDG", "ERE", Character.valueOf('E'), new ItemStack(ModItems.manaResource, 1, 7), Character.valueOf('G'), new ItemStack(ModBlocks.elfGlass), Character.valueOf('D'), new ItemStack(ModBlocks.floatingFlower, 1, 32767), Character.valueOf('R'), new ItemStack(ModItems.rune, 1, 3)});
antigravityCharm = new BLexiconEntry("antigravityCharm", BotaniaAPI.categoryTools);
antigravityCharm.setKnowledgeType(BotaniaAPI.elvenKnowledge).setLexiconPages(new LexiconPage[] { new PageText("0"), BotaniaAPI.internalHandler.craftingRecipePage(".craft", getLastRecipe())}).setIcon(new ItemStack(ItemListAB.itemAntigravityCharm));
GameRegistry.addShapedRecipe(new ItemStack(ItemListAB.itemNebulaBlaze), new Object[] { " N ", "MMN", "AMN", Character.valueOf('N'), new ItemStack(ItemListAB.itemABResource, 1, 6), Character.valueOf('A'), new ItemStack(ItemListAB.itemABResource, 1, 3), Character.valueOf('M'), new ItemStack(ModBlocks.storage)});
nebulaBlaze = new BLexiconEntry("nebulaBlaze", categoryForgotten);
nebulaBlaze.setKnowledgeType(forgotten).setLexiconPages(new LexiconPage[] { new PageText("0"), BotaniaAPI.internalHandler.craftingRecipePage(".craft", getLastRecipe())});
GameRegistry.addShapedRecipe(new ItemStack(BlockListAB.blockManaCharger), new Object[] { "NLN", "MPM", " R ", Character.valueOf('N'), new ItemStack(ItemListAB.itemABResource, 1, 1), Character.valueOf('L'), new ItemStack(ModBlocks.livingrock), Character.valueOf('M'), new ItemStack(ModBlocks.bellows), Character.valueOf('P'), new ItemStack(ModBlocks.pylon), Character.valueOf('R'), new ItemStack(ModItems.rune, 1, 8)});
manaCharger = new BLexiconEntry("manaCharger", categoryForgotten);
manaCharger.setKnowledgeType(forgotten).setLexiconPages(new LexiconPage[] { new PageText("0"), BotaniaAPI.internalHandler.craftingRecipePage(".craft", getLastRecipe())});
GameRegistry.addShapedRecipe(new ItemStack(ItemListAB.itemNebulaHelm), new Object[] { "RNR", "NHN", " E ", Character.valueOf('N'), new ItemStack(ItemListAB.itemABResource, 1, 5), Character.valueOf('R'), new ItemStack(ModItems.manaResource, 1, 7), Character.valueOf('H'), new ItemStack(ModItems.terrasteelHelm), Character.valueOf('E'), new ItemStack(ModItems.manaResource, 1, 8)});
IRecipe nHelm = getLastRecipe();
GameRegistry.addShapedRecipe(new ItemStack(ItemListAB.itemNebulaChest), new Object[] { "RTR", "NHN", "ENE", Character.valueOf('N'), new ItemStack(ItemListAB.itemABResource, 1, 5), Character.valueOf('R'), new ItemStack(ModItems.manaResource, 1, 7), Character.valueOf('H'), new ItemStack(ModItems.terrasteelChest), Character.valueOf('E'), new ItemStack(ModItems.manaResource, 1, 8), Character.valueOf('T'), new ItemStack(ModItems.flightTiara, 1, 32767)});
IRecipe nChest = getLastRecipe();
GameRegistry.addShapedRecipe(new ItemStack(ItemListAB.itemNebulaLegs), new Object[] { "ENE", "RHR", "NAN", Character.valueOf('N'), new ItemStack(ItemListAB.itemABResource, 1, 5), Character.valueOf('R'), new ItemStack(ModItems.manaResource, 1, 7), Character.valueOf('H'), new ItemStack(ModItems.terrasteelLegs), Character.valueOf('E'), new ItemStack(ModItems.manaResource, 1, 8), Character.valueOf('A'), new ItemStack(ItemListAB.itemABResource, 1, 3)});
IRecipe nLegs = getLastRecipe();
GameRegistry.addShapedRecipe(new ItemStack(ItemListAB.itemNebulaBoots), new Object[] { "RBR", "NHN", " E ", Character.valueOf('N'), new ItemStack(ItemListAB.itemABResource, 1, 5), Character.valueOf('R'), new ItemStack(ModItems.manaResource, 1, 7), Character.valueOf('H'), new ItemStack(ModItems.terrasteelBoots), Character.valueOf('E'), new ItemStack(ModItems.manaResource, 1, 8), Character.valueOf('B'), new ItemStack(ModItems.speedUpBelt)});
IRecipe nBoots = getLastRecipe();
nebulaArmor = new BLexiconEntry("nebulaArmor", categoryForgotten);
nebulaArmor.setKnowledgeType(forgotten).setLexiconPages(new LexiconPage[] { new PageText("0"), new PageText("1"), BotaniaAPI.internalHandler.craftingRecipePage(".craft", nHelm), BotaniaAPI.internalHandler.craftingRecipePage(".craft", nChest), BotaniaAPI.internalHandler.craftingRecipePage(".craft", nLegs), BotaniaAPI.internalHandler.craftingRecipePage(".craft", nBoots)});
freyrSlingshot = new BLexiconEntry("freyrSlingshot", categoryForgotten);
freyrSlingshot.setKnowledgeType(forgotten).setLexiconPages(new LexiconPage[] { new PageText("0"), new AlphirineCraftPage(slingshotRecipe)});
engineerHopper = new BLexiconEntry("engineerHopper", categoryForgotten);
engineerHopper.setKnowledgeType(forgotten).setLexiconPages(new LexiconPage[] { new PageText("0"), new AlphirineCraftPage(hopperRecipe)});
GameRegistry.addShapedRecipe(new ItemStack(ItemListAB.itemNebulaRod), new Object[] { " WN", " RW", "W ", Character.valueOf('W'), new ItemStack(ModItems.manaResource, 1, 13), Character.valueOf('R'), new ItemStack(ModItems.rune, 1, 8), Character.valueOf('N'), new ItemStack(ItemListAB.itemABResource, 1, 5)});
nebulaRod = new BLexiconEntry("nebulaRod", categoryForgotten);
nebulaRod.setKnowledgeType(forgotten).setLexiconPages(new LexiconPage[] { new PageText("0"), BotaniaAPI.internalHandler.craftingRecipePage(".craft", getLastRecipe())});
if(Botania.thaumcraftLoaded)
thaumcraft();
addShapelessOreDictRecipe(new ItemStack(ItemListAB.itemABResource, 9, 1), new Object[] { new ItemStack(ItemListAB.itemABResource)});
addShapelessOreDictRecipe(new ItemStack(ItemListAB.itemABResource, 9, 0), new Object[] { new ItemStack(BlockListAB.blockABStorage)});
addShapelessOreDictRecipe(new ItemStack(ItemListAB.itemABResource, 9, 6), new Object[] { new ItemStack(ItemListAB.itemABResource, 1, 5)});
GameRegistry.addShapedRecipe(new ItemStack(BlockListAB.blockABStorage), new Object[] { "III", "III", "III", Character.valueOf('I'), new ItemStack(ItemListAB.itemABResource)});
GameRegistry.addShapedRecipe(new ItemStack(ItemListAB.itemABResource, 1, 5), new Object[] { "III", "III", "III", Character.valueOf('I'), new ItemStack(ItemListAB.itemABResource, 1, 6)});
}
public static void thaumcraft() {
aspecolus = new BLexiconEntry("aspecolus", BotaniaAPI.categoryFunctionalFlowers);
aspecolusRecipe = BotaniaAPI.registerPetalRecipe(ItemBlockSpecialFlower.ofType("aspecolus"), new ItemStack(ModItems.manaResource, 1, 6), new ItemStack(ModItems.manaResource, 1, 5), new ItemStack(ModItems.rune, 1, 1), new ItemStack(ModItems.rune), new ItemStack(ItemListAB.itemABResource, 1, 2), new ItemStack(ModItems.petal, 1, 10), new ItemStack(ModItems.petal, 1, 13));
aspecolus.setKnowledgeType(forgotten).setLexiconPages(new LexiconPage[] { new PageText("0"), BotaniaAPI.internalHandler.petalRecipePage(".petalCraft", aspecolusRecipe) }).setIcon(ItemBlockSpecialFlower.ofType("aspecolus"));
addShapelessOreDictRecipe(new ItemStack(ItemListAB.itemNebulaHelmReveal), new Object[] { new ItemStack(ItemListAB.itemNebulaHelm), new ItemStack(ConfigItems.itemGoggles)});
List<IRecipe> recipes = new ArrayList<IRecipe>();
for(int i = 1; i < 10; i++) {
boolean[][] patterns = ItemCraftingPattern.getPattern(i);
List<String> str = new ArrayList<String>();
for(int j = 0; j < patterns.length; j++) {
String str1 = "";
for(int k = 0; k < patterns[j].length; k++)
str1 += patterns[j][k] ? "T" : "H";
str.add(str1);
}
GameRegistry.addShapedRecipe(new ItemStack(ItemListAB.itemCraftingPattern, 1, i), new Object[] { str.get(0), str.get(1), str.get(2), Character.valueOf('T'), new ItemStack(ItemListAB.itemCraftingPattern), Character.valueOf('H'), new ItemStack(ConfigItems.itemNugget, 1, 6)});
recipes.add(getLastRecipe());
}
addShapelessOreDictRecipe(new ItemStack(ItemListAB.itemCraftingPattern, 48), new Object[] { new ItemStack(Blocks.crafting_table), new ItemStack(ModBlocks.livingrock), new ItemStack(ConfigItems.itemResource, 1, 14)});
thaumAutoCraft = new BLexiconEntry("thaumAutoCraft", BotaniaAPI.categoryDevices);
thaumAutoCraft.setKnowledgeType(BotaniaAPI.elvenKnowledge).setLexiconPages(new LexiconPage[] { new PageText("0"), BotaniaAPI.internalHandler.craftingRecipePage(".craft0", getLastRecipe()), BotaniaAPI.internalHandler.craftingRecipesPage(".craft1", recipes)});
}
private static IRecipe getLastRecipe() {
return (IRecipe)CraftingManager.getInstance().getRecipeList().get(CraftingManager.getInstance().getRecipeList().size() - 1);
}
private static void addOreDictRecipe(ItemStack output, Object... recipe) {
CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(output, recipe));
}
private static void addShapelessOreDictRecipe(ItemStack output, Object... recipe) {
CraftingManager.getInstance().getRecipeList().add(new ShapelessOreRecipe(output, recipe));
}
}
@@ -0,0 +1,82 @@
package ab.client.render.entity;
import java.awt.Color;
import java.util.Random;
import org.lwjgl.opengl.GL11;
import ab.common.entity.EntitySword;
import net.minecraft.block.Block;
import net.minecraft.client.Minecraft;
import net.minecraft.client.entity.AbstractClientPlayer;
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.TextureMap;
import net.minecraft.entity.Entity;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import net.minecraft.util.MathHelper;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World;
import net.minecraftforge.client.ForgeHooksClient;
import vazkii.botania.client.core.handler.ClientTickHandler;
import vazkii.botania.client.core.helper.ShaderHelper;
public class RenderEntitySword extends Render {
Minecraft mc = Minecraft.getMinecraft();
public void doRender(Entity entity, double x, double y, double z, float fl, float fl1) {
double worldTime = (entity.worldObj == null) ? 0.0D : (ClientTickHandler.ticksInGame + fl1);
EntitySword sword = (EntitySword)entity;
GL11.glPushMatrix();
GL11.glTranslated(x, y, z);
GL11.glEnable(3042);
GL11.glBlendFunc(770, 771);
float angel = (float)worldTime * 16.0f;
GL11.glRotatef(sword.getRotation1(), 0.0f, 1.0f, 0.0f);
GL11.glRotatef(sword.getRotation2(), 1.0f, 0.0f, 0.0f);
GL11.glRotatef(135.0f, 0.0F, 0.0F, 1.0F);
GL11.glRotatef(angel, 0.0F, 0.0F, 1.0F);
GL11.glRotatef(angel, 0.0F, 1.0F, 0.0F);
mc.renderEngine.bindTexture(TextureMap.locationItemsTexture);
if(entity.worldObj != null)
renderItemStack(sword.getSword(), (int)Math.min(160.0f, entity.ticksExisted * 17.67f), entity.worldObj, x, y, z);
GL11.glDisable(3042);
GL11.glPopMatrix();
}
public void renderItemStack(ItemStack stack, int alpha, World world, double posX, double posY, double posZ) {
if(stack != null) {
float s = 0.25F;
GL11.glTranslatef(-4 * 0.0625f, -4 * 0.0625f, 0.0f);
GL11.glScalef(s, s, s);
GL11.glScalef(2.0F, 2.0F, 2.0F);
if(!ForgeHooksClient.renderEntityItem(new EntityItem(world, posX, posY, posZ, stack), stack, 0.0F, 0.0F, world.rand, mc.renderEngine, RenderBlocks.getInstance(), 1)) {
int renderPass = 0;
do {
IIcon icon = stack.getItem().getIcon(stack, renderPass);
if(icon == null)
continue;
Color color = new Color(stack.getItem().getColorFromItemStack(stack, renderPass));
GL11.glColor4ub((byte)color.getRed(), (byte)color.getGreen(), (byte)color.getBlue(), (byte)alpha);
float f = icon.getMinU();
float f1 = icon.getMaxU();
float f2 = icon.getMinV();
float f3 = icon.getMaxV();
ItemRenderer.renderItemIn2D(Tessellator.instance, f1, f2, f, f3, icon.getIconWidth(), icon.getIconHeight(), 0.0625F);
GL11.glColor3f(1.0F, 1.0F, 1.0F);
++renderPass;
} while(renderPass < stack.getItem().getRenderPasses(stack.getItemDamage()));
}
GL11.glScalef(1.0F / s, 1.0F / s, 1.0F / s);
}
}
protected ResourceLocation getEntityTexture(Entity entity) {
return AbstractClientPlayer.locationStevePng;
}
}
@@ -0,0 +1,98 @@
package ab.common.minetweaker;
import ab.api.AdvancedBotanyAPI;
import ab.api.recipe.RecipeAdvancedPlate;
import minetweaker.IUndoableAction;
import minetweaker.MineTweakerAPI;
import minetweaker.api.item.IItemStack;
import minetweaker.api.minecraft.MineTweakerMC;
import net.minecraft.item.ItemStack;
import stanhebben.zenscript.annotations.ZenClass;
import stanhebben.zenscript.annotations.ZenMethod;
@ZenClass("mods.advBotany.AdvancedPlate")
public class AdvancedPlateMT {
@ZenMethod
public void addRecipe(IItemStack output, int rgb, IItemStack input1, IItemStack input2, IItemStack input3, int mana) {
MineTweakerAPI.apply(new Add(new RecipeAdvancedPlate(MineTweakerMC.getItemStack(output), mana, rgb, MineTweakerMC.getItemStack(input1), MineTweakerMC.getItemStack(input2), MineTweakerMC.getItemStack(input3))));
}
private class Add implements IUndoableAction {
private RecipeAdvancedPlate recipe;
public Add(RecipeAdvancedPlate recipe) {
this.recipe = recipe;
}
public void apply() {
AdvancedBotanyAPI.advancedPlateRecipes.add(recipe);
}
public boolean canUndo() {
return true;
}
public void undo() {
AdvancedBotanyAPI.advancedPlateRecipes.remove(recipe);
}
public String describe() {
return "Adding Advanced Plate Recipe for " + recipe.getOutput().getDisplayName();
}
public String describeUndo() {
return "Removing Advanced Plate Recipe for " + recipe.getOutput().getDisplayName();
}
public Object getOverrideKey() {
return null;
}
}
@ZenMethod
public void remove(IItemStack output) {
MineTweakerAPI.apply(new Remove(MineTweakerMC.getItemStack(output)));
}
private class Remove implements IUndoableAction {
private ItemStack output;
private RecipeAdvancedPlate recipe;
public Remove(ItemStack output) {
this.output = output;
}
public void apply() {
for(RecipeAdvancedPlate r : AdvancedBotanyAPI.advancedPlateRecipes) {
if(r.getOutput() != null && r.getOutput().isItemEqual(output)) {
AdvancedBotanyAPI.advancedPlateRecipes.remove(r);
recipe = r;
break;
}
}
}
public boolean canUndo() {
return true;
}
public void undo() {
AdvancedBotanyAPI.advancedPlateRecipes.add(recipe);
}
public String describe() {
return "Removing Advanced Plate Recipe for " + output.getDisplayName();
}
public String describeUndo() {
return "Restoring Advanced Plate Recipe for " + output.getDisplayName();
}
public Object getOverrideKey() {
return null;
}
}
}
@@ -0,0 +1,99 @@
package ab.common.minetweaker;
import ab.api.AdvancedBotanyAPI;
import ab.api.recipe.RecipeAdvancedPlate;
import minetweaker.IUndoableAction;
import minetweaker.MineTweakerAPI;
import minetweaker.api.item.IItemStack;
import minetweaker.api.minecraft.MineTweakerMC;
import net.minecraft.item.ItemStack;
import stanhebben.zenscript.annotations.ZenClass;
import stanhebben.zenscript.annotations.ZenMethod;
@ZenClass("mods.advBotany.AdvancedPlate")
public class AdvancedPlateMT {
@ZenMethod
public static void addRecipe(IItemStack output, String rgb, IItemStack input1, IItemStack input2, IItemStack input3, int mana) {
MineTweakerAPI.apply(new Add(new RecipeAdvancedPlate(MineTweakerMC.getItemStack(output), mana, Integer.parseInt(rgb), MineTweakerMC.getItemStack(input1), MineTweakerMC.getItemStack(input2), MineTweakerMC.getItemStack(input3))));
}
private static class Add implements IUndoableAction {
private RecipeAdvancedPlate recipe;
public Add(RecipeAdvancedPlate recipe) {
this.recipe = recipe;
}
public void apply() {
AdvancedBotanyAPI.advancedPlateRecipes.add(recipe);
}
public boolean canUndo() {
return true;
}
public void undo() {
AdvancedBotanyAPI.advancedPlateRecipes.remove(recipe);
}
public String describe() {
return "Adding Advanced Plate Recipe for " + recipe.getOutput().getDisplayName();
}
public String describeUndo() {
return "Removing Advanced Plate Recipe for " + recipe.getOutput().getDisplayName();
}
public Object getOverrideKey() {
return null;
}
}
@ZenMethod
public static void remove(IItemStack output) {
MineTweakerAPI.apply(new Remove(MineTweakerMC.getItemStack(output)));
}
private static class Remove implements IUndoableAction {
private ItemStack output;
private RecipeAdvancedPlate recipe;
public Remove(ItemStack output) {
this.output = output;
}
public void apply() {
for(RecipeAdvancedPlate r : AdvancedBotanyAPI.advancedPlateRecipes) {
if(r.getOutput() != null && r.getOutput().isItemEqual(output)) {
AdvancedBotanyAPI.advancedPlateRecipes.remove(r);
recipe = r;
break;
}
}
}
public boolean canUndo() {
return true;
}
public void undo() {
AdvancedBotanyAPI.advancedPlateRecipes.add(recipe);
}
public String describe() {
return "Removing Advanced Plate Recipe for " + output.getDisplayName();
}
public String describeUndo() {
return "Restoring Advanced Plate Recipe for " + output.getDisplayName();
}
public Object getOverrideKey() {
return null;
}
}
}
@@ -0,0 +1,75 @@
package ab.client.render.entity;
import java.awt.Color;
import org.lwjgl.opengl.GL11;
import ab.common.entity.EntitySword;
import net.minecraft.block.Block;
import net.minecraft.client.Minecraft;
import net.minecraft.client.entity.AbstractClientPlayer;
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.TextureMap;
import net.minecraft.entity.Entity;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import net.minecraft.util.MathHelper;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World;
import net.minecraftforge.client.ForgeHooksClient;
import vazkii.botania.client.core.helper.ShaderHelper;
public class RenderEntitySword extends Render {
Minecraft mc = Minecraft.getMinecraft();
public void doRender(Entity entity, double x, double y, double z, float fl, float fl1) {
EntitySword sword = (EntitySword)entity;
GL11.glPushMatrix();
GL11.glTranslated(x, y, z);
GL11.glEnable(3042);
GL11.glBlendFunc(770, 771);
GL11.glRotatef(sword.getRotation1(), 0.0f, 1.0f, 0.0f);
GL11.glRotatef(sword.getRotation2(), 1.0f, 0.0f, 0.0f);
GL11.glRotatef(135.0f, 0.0F, 0.0F, 1.0F);
mc.renderEngine.bindTexture(TextureMap.locationItemsTexture);
renderItemStack(sword.getSword(), (int)Math.min(160.0f, entity.ticksExisted * 17.67f), entity.worldObj, x, y, z);
GL11.glDisable(3042);
GL11.glPopMatrix();
}
public void renderItemStack(ItemStack stack, int alpha, World world, double posX, double posY, double posZ) {
if(stack != null) {
float s = 0.25F;
GL11.glTranslatef(-5 * 0.0625f, -5 * 0.0625f, 0.0f);
GL11.glScalef(s, s, s);
GL11.glScalef(2.0F, 2.0F, 2.0F);
if(!ForgeHooksClient.renderEntityItem(new EntityItem(world, posX, posY, posZ, stack), stack, 0.0F, 0.0F, world.rand, mc.renderEngine, RenderBlocks.getInstance(), 1)) {
int renderPass = 0;
do {
IIcon icon = stack.getItem().getIcon(stack, renderPass);
if(icon == null)
continue;
Color color = new Color(stack.getItem().getColorFromItemStack(stack, renderPass));
GL11.glColor4ub((byte)color.getRed(), (byte)color.getGreen(), (byte)color.getBlue(), (byte)alpha);
float f = icon.getMinU();
float f1 = icon.getMaxU();
float f2 = icon.getMinV();
float f3 = icon.getMaxV();
ItemRenderer.renderItemIn2D(Tessellator.instance, f1, f2, f, f3, icon.getIconWidth(), icon.getIconHeight(), 0.0625F);
GL11.glColor3f(1.0F, 1.0F, 1.0F);
++renderPass;
} while(renderPass < stack.getItem().getRenderPasses(stack.getItemDamage()));
}
GL11.glScalef(1.0F / s, 1.0F / s, 1.0F / s);
}
}
protected ResourceLocation getEntityTexture(Entity entity) {
return AbstractClientPlayer.locationStevePng;
}
}
@@ -0,0 +1,67 @@
package ab.common.entity;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.projectile.EntityThrowable;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
public class EntitySword extends EntityThrowable {
public EntitySword(World world) {
super(world);
this.dataWatcher.addObject(27, new ItemStack(Items.diamond_sword));
this.dataWatcher.setObjectWatched(27);
}
public EntitySword(World world, EntityPlayer e, ItemStack stack) {
super(world, e);
this.dataWatcher.addObject(27, stack.copy());
this.dataWatcher.setObjectWatched(27);
}
public void onUpdate() {
super.onUpdate();
if(ticksExisted > 240)
setDead();
}
protected void onImpact(MovingObjectPosition mov) {
Block block = this.worldObj.getBlock(mov.blockX, mov.blockY, mov.blockZ);
if(block != null && (block instanceof net.minecraft.block.BlockBush || block instanceof net.minecraft.block.BlockLeaves))
return;
}
public ItemStack getSword() {
return this.dataWatcher.getWatchableObjectItemStack(27);
}
public void setSword(ItemStack stack) {
this.dataWatcher.updateObject(27, stack);
}
public void readEntityFromNBT(NBTTagCompound nbtt) {
super.readEntityFromNBT(nbtt);
ticksExisted = nbtt.getInteger("ticks");
NBTTagCompound stackCmp = nbtt.getCompoundTag("sword");
ItemStack stack = ItemStack.loadItemStackFromNBT(stackCmp);
setSword(stack);
}
public void writeEntityToNBT(NBTTagCompound nbtt) {
super.writeEntityToNBT(nbtt);
nbtt.setInteger("ticks", ticksExisted);
ItemStack stack = getSword();
NBTTagCompound stackNbt = new NBTTagCompound();
if(stack != null)
stack.writeToNBT(stackNbt);
nbtt.setTag("sword", stackNbt);
}
protected float getGravityVelocity() {
return 0.0F;
}
}
@@ -0,0 +1,312 @@
package ab.common.block.tile;
import java.util.List;
import org.lwjgl.opengl.GL11;
import ab.api.IBoundRender;
import ab.client.core.ClientHelper;
import net.minecraft.block.Block;
import net.minecraft.block.BlockChest;
import net.minecraft.block.BlockHopper;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.Gui;
import net.minecraft.client.gui.ScaledResolution;
import net.minecraft.client.renderer.RenderHelper;
import net.minecraft.client.renderer.entity.RenderItem;
import net.minecraft.command.IEntitySelector;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.ISidedInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.IHopper;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.tileentity.TileEntityChest;
import net.minecraft.tileentity.TileEntityHopper;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.ChunkCoordinates;
import net.minecraft.util.Facing;
import net.minecraft.util.MathHelper;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
import vazkii.botania.api.wand.IWandBindable;
import vazkii.botania.client.core.handler.HUDHandler;
import vazkii.botania.common.core.helper.Vector3;
import vazkii.botania.common.item.ModItems;
public class TileEngineerHopper extends TileInventory implements IHopper, IBoundRender {
private int cooldown;
private int[] invPosX = new int[] {0, 0};
private int[] invPosY = new int[] {-1, -1};
private int[] invPosZ = new int[] {0, 0};
private int[] invSide = new int[] {-1, -1};
private boolean bindType;
public void updateEntity() {
if(this.worldObj != null) {
if(!this.worldObj.isRemote) {
if(cooldown > 0)
--this.cooldown;
else if(this.cooldown == 0) {
if(this.worldObj != null && !this.worldObj.isRemote && BlockHopper.func_149917_c(getBlockMetadata())) {
boolean flag = false;
ItemStack stack = this.getStackInSlot(0);
if(stack != null)
flag = canExtractStack();
if(stack == null || stack.stackSize != stack.getMaxStackSize())
flag = canInsertStack(this) || flag;
if(flag)
this.cooldown = 8;
this.markDirty();
}
}
}
}
}
public boolean bindTo(EntityPlayer player, ItemStack wand, int x, int y, int z, int side) {
TileEntity tile = player.getEntityWorld().getTileEntity(x, y, z);
boolean isFar = Math.abs(this.xCoord - x) >= 10 || Math.abs(this.yCoord - y) >= 10 || Math.abs(this.zCoord - z) >= 10;
if(isFar)
return false;
int invCount = bindType ? 0 : 1;
if(tile instanceof TileEngineerHopper)
return false;
else if(tile != null && tile instanceof IInventory) {
setDistantInventory(invCount, x, y, z);
invSide[invCount] = side;
return true;
} else {
setDistantInventory(invCount, 0, -1, 0);
invSide[invCount] = -1;
return false;
}
}
public void changeBindType() {
bindType = !bindType;
}
public void setDistantInventory(int count, int posX, int posY, int posZ) {
invPosX[count] = posX;
invPosY[count] = posY;
invPosZ[count] = posZ;
}
public IInventory getDistantInventory(int count) {
IInventory inv = TileEntityHopper.func_145893_b(this.getWorldObj(), invPosX[count], invPosY[count], invPosZ[count]);
if(inv == null)
setDistantInventory(count, 0, -1, 0);
return inv;
}
public boolean canSelect(EntityPlayer player, ItemStack wand, int x, int y, int z, int side) {
return true;
}
public ChunkCoordinates[] getBlocksCoord() {
return new ChunkCoordinates[] { new ChunkCoordinates(invPosX[0], invPosY[0], invPosZ[0]), new ChunkCoordinates(invPosX[1], invPosY[1], invPosZ[1]) };
}
public ChunkCoordinates getBinding() {
return null;
}
public void renderHUD(Minecraft mc, ScaledResolution res) {
int x = res.getScaledWidth() / 2 - 7;
int y = res.getScaledHeight() / 2 + 16;
GL11.glEnable(3042);
GL11.glBlendFunc(770, 771);
ClientHelper.drawArrow(x - 2, y, false);
for(int i = 0; i < 2; i++) {
ItemStack stack = null;
boolean hasInv = false;
int posX = x + (i == 0 ? 32 : -32);
if(getDistantInventory(i) != null && (TileEntity)getDistantInventory(i) != null) {
TileEntity tile = (TileEntity)getDistantInventory(i);
Block block = tile.getWorldObj().getBlock(tile.xCoord, tile.yCoord, tile.zCoord);
int meta = tile.getWorldObj().getBlockMetadata(tile.xCoord, tile.yCoord, tile.zCoord);
stack = new ItemStack(block, 1, meta);
hasInv = true;
}
Gui.drawRect(posX - 4, y - 4, posX + 20, y + 20, 1140850688);
Gui.drawRect(posX - 2, y - 2, posX + 18, y + 18, 1140850688);
if(stack != null) {
RenderHelper.enableGUIStandardItemLighting();
GL11.glEnable(32826);
RenderItem.getInstance().renderItemAndEffectIntoGUI(mc.fontRenderer, mc.renderEngine, stack, posX, y);
RenderHelper.disableStandardItemLighting();
GL11.glDisable(2929);
}
int invCount = bindType ? 0 : 1;
if(invCount == i) {
GL11.glTranslatef(0.0f, 0.0f, 300.0f);
RenderHelper.enableGUIStandardItemLighting();
GL11.glEnable(32826);
RenderItem.getInstance().renderItemIntoGUI(mc.fontRenderer, mc.renderEngine, new ItemStack(ModItems.twigWand), posX + 10, y + 7);
RenderHelper.disableStandardItemLighting();
GL11.glDisable(2929);
GL11.glTranslatef(0.0f, 0.0f, -300.0f);
}
boolean unicode = mc.fontRenderer.getUnicodeFlag();
mc.fontRenderer.setUnicodeFlag(true);
if(!hasInv) {
mc.fontRenderer.drawStringWithShadow("\u2717", posX + 5, y + 6, 4980736);
mc.fontRenderer.drawStringWithShadow("\u2717", posX + 5, y + 5, 13764621);
}
mc.fontRenderer.setUnicodeFlag(unicode);
GL11.glEnable(2929);
}
GL11.glDisable(3042);
}
public void writeCustomNBT(NBTTagCompound nbtt) {
super.writeCustomNBT(nbtt);
nbtt.setInteger("cooldown", this.cooldown);
nbtt.setBoolean("bindType", this.bindType);
nbtt.setIntArray("bindingX", this.invPosX);
nbtt.setIntArray("bindingY", this.invPosY);
nbtt.setIntArray("bindingZ", this.invPosZ);
nbtt.setIntArray("bindingSide", this.invSide);
}
public void readCustomNBT(NBTTagCompound nbtt) {
super.readCustomNBT(nbtt);
this.cooldown = nbtt.getInteger("cooldown");
this.bindType = nbtt.getBoolean("bindType");
this.invPosX = nbtt.getIntArray("bindingX");
this.invPosY = nbtt.getIntArray("bindingY");
this.invPosZ = nbtt.getIntArray("bindingZ");
this.invSide = nbtt.getIntArray("bindingSide");
}
private boolean canExtractStack() {
IInventory inv = getDistantInventory(0);
if(inv == null)
return false;
else {
int side = invSide[0];
if(!canPull(inv, side))
return false;
else {
if(getStackInSlot(0) != null) {
ItemStack itemstack = getStackInSlot(0).copy();
ItemStack itemstack1 = TileEntityHopper.func_145889_a(inv, this.decrStackSize(0, 8), side);
if(itemstack1 == null || itemstack1.stackSize == 0) {
inv.markDirty();
return true;
}
this.setInventorySlotContents(0, itemstack);
}
return false;
}
}
}
private boolean canPull(IInventory inv, int side) {
if(inv instanceof ISidedInventory && side > -1) {
ISidedInventory sideInv = (ISidedInventory)inv;
int[] slots = sideInv.getAccessibleSlotsFromSide(side);
for(int i = 0; i < slots.length; ++i) {
ItemStack stack = sideInv.getStackInSlot(slots[i]);
if(stack == null || stack.stackSize != stack.getMaxStackSize())
return true;
}
} else {
int size = inv.getSizeInventory();
for(int i = 0; i < size; ++i) {
ItemStack stack = inv.getStackInSlot(i);
if(stack == null || stack.stackSize != stack.getMaxStackSize())
return true;
}
}
return false;
}
private boolean canInsertStack(IHopper hopper) {
boolean hasDistantInv = getDistantInventory(1) != null;
IInventory inv = getDistantInventory(1);
if(inv != null) {
int b0 = hasDistantInv ? invSide[1] : 0;
if(!canTake(inv, b0))
return false;
if(inv instanceof ISidedInventory && b0 > -1) {
ISidedInventory sidedInv = (ISidedInventory)inv;
int[] slots = sidedInv.getAccessibleSlotsFromSide(b0);
for(int k = 0; k < slots.length; ++k) {
if(func_145892_a(hopper, inv, slots[k], b0)) {
return true;
}
}
} else {
int i = inv.getSizeInventory();
for(int j = 0; j < i; ++j) {
if(func_145892_a(hopper, inv, j, b0)) {
return true;
}
}
}
}
return false;
}
private boolean canTake(IInventory inv, int side) {
if(inv instanceof ISidedInventory && side > -1) {
ISidedInventory isidedinventory = (ISidedInventory)inv;
int[] aint = isidedinventory.getAccessibleSlotsFromSide(side);
for(int l = 0; l < aint.length; ++l) {
if(isidedinventory.getStackInSlot(aint[l]) != null)
return true;
}
} else {
int j = inv.getSizeInventory();
for(int k = 0; k < j; ++k) {
if(inv.getStackInSlot(k) != null)
return true;
}
}
return false;
}
private static boolean func_145892_a(IHopper hopper, IInventory inv, int slot, int side) {
ItemStack itemstack = inv.getStackInSlot(slot);
if(itemstack != null && func_145890_b(inv, itemstack, slot, side)) {
ItemStack itemstack1 = itemstack.copy();
ItemStack itemstack2 = TileEntityHopper.func_145889_a(hopper, inv.decrStackSize(slot, 8), -8);
if(itemstack2 == null || itemstack2.stackSize == 0) {
inv.markDirty();
return true;
}
inv.setInventorySlotContents(slot, itemstack1);
}
return false;
}
private static boolean func_145890_b(IInventory inv, ItemStack stack, int slot, int side) {
return !(inv instanceof ISidedInventory) || ((ISidedInventory)inv).canExtractItem(slot, stack, side);
}
public int getSizeInventory() {
return 1;
}
public String getInventoryName() {
return "engineerHopper";
}
public double getXPos() {
return this.xCoord;
}
public double getYPos() {
return this.yCoord;
}
public double getZPos() {
return this.zCoord;
}
}
@@ -0,0 +1,272 @@
package ab.common.block;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12;
import ab.AdvancedBotany;
import ab.common.block.tile.TileMagicCraftCrate;
import ab.common.item.ItemCraftingPattern;
import net.minecraft.block.material.Material;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.Gui;
import net.minecraft.client.gui.ScaledResolution;
import net.minecraft.client.renderer.entity.RenderItem;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.IIcon;
import net.minecraft.util.MathHelper;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import thaumcraft.api.aspects.Aspect;
import thaumcraft.api.aspects.AspectList;
import thaumcraft.client.lib.UtilsFX;
import thaumcraft.common.items.wands.ItemWandCasting;
import thaumcraft.common.lib.crafting.ThaumcraftCraftingManager;
import vazkii.botania.api.wand.IWandHUD;
import vazkii.botania.api.wand.IWandable;
import vazkii.botania.common.block.BlockModContainer;
public class BlockMagicCraftCrate extends BlockModContainer implements IWandable, IWandHUD {
public static final Aspect[] primals = new Aspect[] { Aspect.AIR, Aspect.WATER, Aspect.EARTH, Aspect.FIRE, Aspect.ORDER, Aspect.ENTROPY };
IIcon iconSide;
IIcon iconBottom;
IIcon iconTop;
public IIcon nothing;
public BlockMagicCraftCrate() {
super(Material.wood);
this.setHardness(2.0F);
this.setStepSound(soundTypeWood);
this.setBlockName("magicThaumCrafter");
this.setCreativeTab(AdvancedBotany.tabAB);
}
public void registerBlockIcons(IIconRegister ir) {
iconSide = ir.registerIcon("ab:magicCrateSide");
iconTop = ir.registerIcon("ab:magicCrateTop");
iconBottom = ir.registerIcon("ab:magicCrateBottom");
nothing = ir.registerIcon("ab:nothing");
}
public boolean hasComparatorInputOverride() {
return true;
}
public int getComparatorInputOverride(World par1World, int par2, int par3, int par4, int par5) {
TileMagicCraftCrate crate = (TileMagicCraftCrate) par1World.getTileEntity(par2, par3, par4);
return crate.getSignal();
}
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
TileMagicCraftCrate crate = (TileMagicCraftCrate) world.getTileEntity(x, y, z);
ItemStack stack = player.getHeldItem();
if(player.isSneaking()) {
ItemStack item = crate.getStackInSlot(10);
if(item != null) {
if(stack != null) {
if(!world.isRemote) {
EntityItem e = new EntityItem(world, x + 0.5, y + 1.2f, z + 0.5f, item.copy());
world.spawnEntityInWorld(e);
}
} else
player.inventory.setInventorySlotContents(player.inventory.currentItem, item.copy());
crate.setInventorySlotContents(10, null);
world.playSoundEffect((double) x, (double) y, (double) z, "random.pop", 0.2f, ((world.rand.nextFloat() - world.rand.nextFloat()) * 0.7f + 1.0f) * 1.5f);
crate.markDirty();
return true;
} else {
item = crate.getStackInSlot(11);
if(item != null) {
if(!world.isRemote) {
EntityItem e = new EntityItem(world, x + 0.5, y + 1.2f, z + 0.5f, item.copy());
world.spawnEntityInWorld(e);
}
}
crate.setInventorySlotContents(11, null);
world.playSoundEffect((double) x, (double) y, (double) z, "random.pop", 0.2f, ((world.rand.nextFloat() - world.rand.nextFloat()) * 0.7f + 1.0f) * 1.5f);
crate.markDirty();
return true;
}
}
if(stack == null)
return false;
if(crate.isItemValidForSlot(10, stack)) {
ItemStack wand = crate.getStackInSlot(10);
if(wand != null) {
if(!world.isRemote) {
EntityItem e = new EntityItem(world, x + 0.5f, y + 1.2f, z + 0.5f, wand.copy());
world.spawnEntityInWorld(e);
}
}
crate.setInventorySlotContents(10, stack.copy());
stack.splitStack(1);
world.playSoundEffect((double) x, (double) y, (double) z, "random.pop", 0.2f, ((world.rand.nextFloat() - world.rand.nextFloat()) * 0.7f + 1.0f) * 1.5f);
crate.markDirty();
return true;
}
if(crate.isItemValidForSlot(11, stack)) {
ItemStack thaum = crate.getStackInSlot(11);
if(thaum != null) {
if(!world.isRemote) {
EntityItem e = new EntityItem(world, x, y, z, thaum);
world.spawnEntityInWorld(e);
}
}
crate.setInventorySlotContents(11, stack.copy());
world.playSoundEffect((double) x, (double) y, (double) z, "random.pop", 0.2f, ((world.rand.nextFloat() - world.rand.nextFloat()) * 0.7f + 1.0f) * 1.5f);
stack.splitStack(1);
crate.setPlayer(player);
crate.markDirty();
return true;
}
if(stack.getItem() instanceof ItemCraftingPattern && stack.getItemDamage() != 0) {
boolean[][] pattern = ((ItemCraftingPattern) stack.getItem()).getPattern(stack.getItemDamage());
crate.setPattern(pattern);
stack.splitStack(1);
return true;
}
return false;
}
public IIcon getIcon(int side, int meta) {
switch (side) {
case 0:
return iconBottom;
case 1:
return iconTop;
default:
return iconSide;
}
}
public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) {
switch (side) {
case 0:
return iconBottom;
case 1:
return iconTop;
default:
return iconSide;
}
}
public TileEntity createNewTileEntity(World world, int meta) {
return new TileMagicCraftCrate();
}
public void renderHUD(Minecraft mc, ScaledResolution res, World world, int x, int y, int z) {
TileEntity tile = world.getTileEntity(x, y, z);
if(tile instanceof TileMagicCraftCrate) {
TileMagicCraftCrate craft = (TileMagicCraftCrate) tile;
int width = 52;
int height = 52;
int xc = res.getScaledWidth() / 2 + 20;
int yc = res.getScaledHeight() / 2 - height / 2;
Gui.drawRect(xc - 6 - 3, yc - 6, xc + width + 3, yc + height + 6, 0x2294178a);
Gui.drawRect(xc - 4 - 3, yc - 4, xc + width + 1, yc + height + 4, 0x2294178a);
Gui.drawRect(xc + 60 - 3, yc + 18 - 3, xc + 60 + 16 + 3, yc + 18 + 16 + 3, 0x2294178a);
Gui.drawRect(xc + 60 - 2, yc + 18 - 2, xc + 60 + 16 + 2, yc + 18 + 16 + 2, 0x2294178a);
Gui.drawRect(xc + 60, yc + 18, xc + 60 + 16, yc + 18 + 16, 0x22efd3f4);
AspectList waitingAspects = null;
if (craft.getWaitingStack() != null && craft.getPlayer() != null) {
GL11.glColor4f(1.0f, 1.0f, 1.0f, 0.7f);
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
RenderItem.getInstance().renderItemAndEffectIntoGUI(mc.fontRenderer, mc.renderEngine,
craft.getWaitingStack(), xc + 60, yc + 18);
net.minecraft.client.renderer.RenderHelper.disableStandardItemLighting();
GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
waitingAspects = ThaumcraftCraftingManager.findMatchingArcaneRecipeAspects((IInventory) craft,
craft.getPlayer());
}
if (craft.getStackInSlot(10) != null) {
GL11.glEnable(GL11.GL_BLEND);
ItemStack wand = craft.getStackInSlot(10);
ItemWandCasting itemWand = ((ItemWandCasting) wand.getItem());
AspectList aspects = itemWand.getAllVis(wand);
int n = 0;
for (Aspect a : primals) {
float alpha = 1.0f;
if (waitingAspects != null) {
float amt = (float) waitingAspects.getAmount(a);
if (amt > 0) {
amt *= itemWand.getConsumptionModifier(wand, craft.getPlayer(), a, true);
if (amt * 100.0f > itemWand.getVis(wand, a)) {
alpha = 0.5f + (MathHelper.sin((craft.getPlayer().ticksExisted + n * 10) / 2.0f) * 0.2f
- 0.2f);
}
}
}
int xa = (int) (xc - 45 + Math.cos(0.2f * Math.PI * n + Math.PI / 2) * 45);
int ya = (int) (yc + 16 + Math.sin(0.2f * Math.PI * n + Math.PI / 2) * 45);
float amout = aspects.getAmount(a) + 0.000001f;
UtilsFX.drawTag(xa, ya, a, amout / 100f, 0, 0, 771, alpha, false);
n++;
}
GL11.glDisable(GL11.GL_BLEND);
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
net.minecraft.client.renderer.RenderHelper.disableStandardItemLighting();
}
Gui.drawRect(xc - 28 - 20 - 3, yc + 7 - 3, xc - 28 - 20 + 16 + 3, yc + 7 + 16 + 3, 0x2294178a);
Gui.drawRect(xc - 28 - 20 - 2, yc + 7 - 2, xc - 28 - 20 + 16 + 2, yc + 7 + 16 + 2, 0x2294178a);
Gui.drawRect(xc - 28 - 20, yc + 7, xc - 28 - 20 + 16, yc + 7 + 16, 0x22efd3f4);
net.minecraft.client.renderer.RenderHelper.enableGUIStandardItemLighting();
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
RenderItem.getInstance().renderItemAndEffectIntoGUI(mc.fontRenderer, mc.renderEngine,
craft.getStackInSlot(10), xc - 28 - 20, yc + 8);
net.minecraft.client.renderer.RenderHelper.disableStandardItemLighting();
Gui.drawRect(xc - 28 - 20 - 3, yc + 29 - 3, xc - 28 - 20 + 16 - 3, yc + 29 + 16 + 3, 0x2294178a);
Gui.drawRect(xc - 28 - 20 - 2, yc + 29 - 2, xc - 28 - 20 + 16 + 2, yc + 29 + 16 + 2, 0x2294178a);
Gui.drawRect(xc - 28 - 20, yc + 29, xc - 28 - 20 + 16, yc + 29 + 16, 0x22efd3f4);
net.minecraft.client.renderer.RenderHelper.enableGUIStandardItemLighting();
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
RenderItem.getInstance().renderItemAndEffectIntoGUI(mc.fontRenderer, mc.renderEngine,
craft.getStackInSlot(11), xc - 28 - 20, yc + 29);
net.minecraft.client.renderer.RenderHelper.disableStandardItemLighting();
for (int i = 0; i < 3; i++)
for (int j = 0; j < 3; j++) {
int index = i * 3 + j;
int xp = xc + j * 18 - 3;
int yp = yc + i * 18;
boolean enabled = craft.getPattern()[i][j];
Gui.drawRect(xp, yp, xp + 16, yp + 16, enabled ? 0x22efd3f4 : 0x22fb02a6);
ItemStack item = craft.getStackInSlot(index);
net.minecraft.client.renderer.RenderHelper.enableGUIStandardItemLighting();
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
RenderItem.getInstance().renderItemAndEffectIntoGUI(mc.fontRenderer, mc.renderEngine, item, xp, yp);
net.minecraft.client.renderer.RenderHelper.disableStandardItemLighting();
}
}
}
public boolean renderAsNormalBlock() {
return false;
}
public boolean isOpaqueCube() {
return false;
}
public boolean onUsedByWand(EntityPlayer player, ItemStack stack, World world, int x, int y, int z, int side) {
TileMagicCraftCrate crate = (TileMagicCraftCrate) world.getTileEntity(x, y, z);
crate.ejectAll();
return true;
}
}
@@ -0,0 +1,134 @@
package ab.client.render.tile;
import java.util.Random;
import org.lwjgl.opengl.GL11;
import ab.common.block.BlockMagicCraftCrate;
import ab.common.block.tile.TileMagicCraftCrate;
import ab.common.lib.register.BlockListAB;
import net.minecraft.client.Minecraft;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelRenderer;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.entity.RenderItem;
import net.minecraft.client.renderer.entity.RenderManager;
import net.minecraft.client.renderer.texture.TextureMap;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.IIcon;
import net.minecraft.util.ResourceLocation;
import vazkii.botania.client.core.handler.ClientTickHandler;
public class RenderTileMagicCraftingCrate extends TileEntitySpecialRenderer {
private ModelCrateBook model = new ModelCrateBook();
public void renderTileEntityAt(TileEntity tile, double x, double y, double z, float fq) {
double time = (tile.getWorldObj() == null) ? 0.0D : (ClientTickHandler.ticksInGame + fq);
if(tile != null)
time += (new Random((tile.xCoord ^ tile.yCoord ^ tile.zCoord))).nextInt(360);
float f1 = 0.002f;
float f2 = 0.125f;
float f3 = 0.1875f;
float f4 = 0.25f;
TileMagicCraftCrate crate = (TileMagicCraftCrate) tile;
boolean[][] pattern = crate.getPattern();
GL11.glPushMatrix();
GL11.glEnable(GL11.GL_BLEND);
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationBlocksTexture);
Tessellator t = new Tessellator();
t.startDrawingQuads();
t.setColorRGBA_I(0xfc0195, 50);
IIcon icon = ((BlockMagicCraftCrate)BlockListAB.blockMagicCraftCrate).nothing;
float maxU = icon.getMaxU();
float maxV = icon.getMaxV();
float minU = icon.getMinU();
float minV = icon.getMinV();
boolean hasPattern = false;
for(int i = 0; i < 3; i++)
for(int j = 0; j < 3; j++) {
if(!pattern[i][j]) {
int i1 = 2 - i;
int j1 = 2 - j;
hasPattern = true;
t.addVertexWithUV(x + f4 + f3 * j1 + f2, y + 1 + f1, z + f4 + f3 * i1+ f2, maxU, maxV);
t.addVertexWithUV(x + f4 + f3 * j1 + f2, y + 1 + f1, z + f4 + f3 * i1, maxU, minV);
t.addVertexWithUV(x + f4 + f3 * j1, y + 1 + f1, z + f4 + f3 * i1, minU, minV);
t.addVertexWithUV(x + f4 + f3 * j1, y + 1 + f1, z + f4 + f3 * i1+ f2, minU, maxV);
float f0 = f2;
if(i == 0 && j == 1)
f0 = 0.0625f;
float minY = (float) (y + f4 + f3 * i1);
float maxY = minY + f0;
t.addVertexWithUV(x + f4 + f3 * j1, minY, z - f1, maxU, maxV);
t.addVertexWithUV(x + f4 + f3 * j1, maxY, z - f1, maxU, minV);
t.addVertexWithUV(x + f4 + f3 * j1 + f2, maxY, z - f1, minU, minV);
t.addVertexWithUV(x + f4 + f3 * j1 + f2, minY, z - f1, minU, maxV);
t.addVertexWithUV(x + 1 + f1, minY, z + f4 + f3 * j1, maxU, maxV);
t.addVertexWithUV(x + 1 + f1, maxY, z + f4 + f3 * j1, maxU, minV);
t.addVertexWithUV(x + 1 + f1, maxY, z + f4 + f3 * j1 + f2, minU, minV);
t.addVertexWithUV(x + 1 + f1, minY, z + f4 + f3 * j1 + f2, minU, maxV);
j1 = j;
t.addVertexWithUV(x - f1, minY, z + f4 + f3 * j1 + f2, maxU, maxV);
t.addVertexWithUV(x - f1, maxY, z + f4 + f3 * j1 + f2, maxU, minV);
t.addVertexWithUV(x - f1, maxY, z + f4 + f3 * j1, minU, minV);
t.addVertexWithUV(x - f1, minY, z + f4 + f3 * j1, minU, maxV);
t.addVertexWithUV(x + f4 + f3 * j1 + f2, minY, z + 1 + f1, maxU, maxV);
t.addVertexWithUV(x + f4 + f3 * j1 + f2, maxY, z + 1 + f1, maxU, minV);
t.addVertexWithUV(x + f4 + f3 * j1, maxY, z + 1 + f1, minU, minV);
t.addVertexWithUV(x + f4 + f3 * j1, minY, z + 1 + f1, minU, maxV);
}
}
t.draw();
GL11.glDisable(GL11.GL_BLEND);
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glPopMatrix();
ItemStack wand = crate.getStackInSlot(10);
if(wand != null) {
GL11.glPushMatrix();
GL11.glTranslated(x + 0.5f, y + 1.12f + (Math.sin(time / 24.0D) / 40.0D - 0.05D), z + 0.25f);
GL11.glRotated(Math.sin(time / 24.0D) * 5.0f, 0.0f, 1.0f, 0.0f);
GL11.glRotatef(90.0f, 0.0f, 0.0f, 1.0f);
EntityItem entity = new EntityItem(tile.getWorldObj(), 0, -0.125, 0, wand.copy());
entity.hoverStart = 0.0f;
RenderItem.renderInFrame = true;
RenderManager.instance.renderEntityWithPosYaw(entity, 0, -0.285, 0, 0.0f, 0.0f);
RenderItem.renderInFrame = false;
GL11.glPopMatrix();
}
ItemStack book = crate.getStackInSlot(11);
if(book != null) {
GL11.glPushMatrix();
GL11.glTranslated(x + 0.75f, y + 1.12f + (Math.sin(-time / 24.0D) / 40.0D - 0.05D), z + 0.5f);
GL11.glRotated(Math.sin(-time / 24.0D) * 5.0f, 0.0f, 1.0f, 0.0f);
GL11.glRotatef(90.0f, 0.0f, 0.0f, 1.0f);
GL11.glRotatef(90.0f, 0.0f, 1.0f, 0.0f);
Minecraft.getMinecraft().renderEngine.bindTexture(model.texture);
model.render();
GL11.glPopMatrix();
}
}
public class ModelCrateBook extends ModelBase {
public final ResourceLocation texture = new ResourceLocation("thaumcraft:textures/models/fortress_armor.png");
private ModelRenderer Book;
public ModelCrateBook() {
textureWidth = 128;
textureHeight = 64;
Book = new ModelRenderer(this, 100, 8);
Book.addBox(1.0F, -0.3F, 4.0F, 5, 7, 2);
Book.setRotationPoint(0.0F, 0.0F, 0.0F);
Book.setTextureSize(128, 64);
}
public void render() {
Book.render(0.0625f);
}
}
}
@@ -0,0 +1,121 @@
package ab.common.entity;
import java.util.List;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.projectile.EntityThrowable;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.server.MinecraftServer;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.DamageSource;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
import vazkii.botania.api.internal.IManaBurst;
import vazkii.botania.common.Botania;
import vazkii.botania.common.core.helper.ItemNBTHelper;
public class EntitySword extends EntityThrowable {
public EntitySword(World world) {
super(world);
}
public EntitySword(World world, EntityPlayer e) {
super(world, e);
}
protected void entityInit() {
super.entityInit();
this.dataWatcher.addObject(27, Float.valueOf(0.0f));
this.dataWatcher.addObject(28, "");
this.dataWatcher.setObjectWatched(27);
this.dataWatcher.setObjectWatched(28);
}
public void onUpdate() {
super.onUpdate();
update();
if(ticksExisted < 20) {
this.motionX *= 1.115f;
this.motionY *= 1.115f;
this.motionZ *= 1.115f;
}
else if(ticksExisted > 160)
setDead();
if(worldObj.isRemote) {
for(int i = 0; i < 12; i++) {
float r = worldObj.rand.nextBoolean() ? (225.0f / 255.0f) : (101.0f / 255.0f);
float g = worldObj.rand.nextBoolean() ? (67.0f / 255.0f) : (209.0f / 255.0f);
float b = worldObj.rand.nextBoolean() ? (240.0f / 255.0f) : (225.0f / 255.0f);
Botania.proxy.sparkleFX(worldObj, posX + ((Math.random() - 0.5D)) * 0.25f, posY + ((Math.random() - 0.5D) * 0.25f), (posZ + (Math.random() - 0.5D) * 0.25f), r + (float)(Math.random() / 4 - 0.125D), g + (float)(Math.random() / 4 - 0.125D), b + (float)(Math.random() / 4 - 0.125D), 1.6F * (float)(Math.random() - 0.5D), 2);
}
}
}
public void update() {
String attacker = getAttacker();
AxisAlignedBB axis = AxisAlignedBB.getBoundingBox(posX, posY, posZ, lastTickPosX, lastTickPosY, lastTickPosZ).expand(1.0D, 1.0D, 1.0D);
List<EntityLivingBase> entities = worldObj.getEntitiesWithinAABB(EntityLivingBase.class, axis);
for(EntityLivingBase living : entities) {
if(living instanceof EntityPlayer && (((EntityPlayer)living).getCommandSenderName().equals(attacker) || (MinecraftServer.getServer() != null && !MinecraftServer.getServer().isPVPEnabled())))
continue;
if(living.hurtTime == 0) {
float damage = getDamage();
if(!worldObj.isRemote) {
EntityPlayer player = living.worldObj.getPlayerEntityByName(attacker);
living.attackEntityFrom((player == null) ? DamageSource.magic : DamageSource.causePlayerDamage(player), damage);
setDead();
break;
}
}
}
}
public String getAttacker() {
return this.dataWatcher.getWatchableObjectString(28);
}
public void setAttacker(String str) {
this.dataWatcher.updateObject(28, str);
}
public float getDamage() {
return this.dataWatcher.getWatchableObjectFloat(27);
}
public void setDamage(float damage) {
this.dataWatcher.updateObject(27, damage);
}
@SideOnly(Side.CLIENT)
public void setPositionAndRotation2(double x, double y, double z, float help, float me, int please) {}
protected void onImpact(MovingObjectPosition mov) {
Block block = this.worldObj.getBlock(mov.blockX, mov.blockY, mov.blockZ);
if(block != null && (block instanceof net.minecraft.block.BlockBush || block instanceof net.minecraft.block.BlockLeaves))
return;
setDead();
}
public void readEntityFromNBT(NBTTagCompound nbtt) {
super.readEntityFromNBT(nbtt);
ticksExisted = nbtt.getInteger("ticks");
}
public void writeEntityToNBT(NBTTagCompound nbtt) {
super.writeEntityToNBT(nbtt);
nbtt.setInteger("ticks", ticksExisted);
}
protected float getGravityVelocity() {
return 0.0F;
}
}
@@ -0,0 +1,82 @@
package ab.client.core.proxy;
import ab.client.core.BoundRender;
import ab.client.core.ClientHandler;
import ab.client.core.HudRender;
import ab.client.core.PlayerRenderer;
import ab.client.render.block.*;
import ab.client.render.entity.*;
import ab.client.render.item.RenderAntigravityCharm;
import ab.client.render.tile.*;
import ab.common.block.tile.*;
import ab.common.core.ConfigABHandler;
import ab.common.core.proxy.CommonProxy;
import ab.common.entity.*;
import ab.common.lib.register.BlockListAB;
import ab.common.lib.register.ItemListAB;
import cpw.mods.fml.client.registry.ClientRegistry;
import cpw.mods.fml.client.registry.RenderingRegistry;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import net.minecraft.client.renderer.entity.Render;
import net.minecraft.client.renderer.entity.RenderSnowball;
import net.minecraft.item.ItemStack;
import net.minecraftforge.client.MinecraftForgeClient;
import net.minecraftforge.common.MinecraftForge;
import vazkii.botania.common.Botania;
import vazkii.botania.common.item.ModItems;
public class ClientProxy extends CommonProxy {
public void preInit(FMLPreInitializationEvent event) {
super.preInit(event);
}
public void init(FMLInitializationEvent event) {
super.init(event);
FMLCommonHandler.instance().bus().register(new ClientHandler());
MinecraftForge.EVENT_BUS.register(new HudRender());
MinecraftForge.EVENT_BUS.register(new PlayerRenderer());
MinecraftForge.EVENT_BUS.register(new BoundRender());
if(ConfigABHandler.hasAbPlate)
ClientRegistry.bindTileEntitySpecialRenderer(TileAgglomerationPlate.class, new RenderTileAgglomerationPlate());
ClientRegistry.bindTileEntitySpecialRenderer(TileABSpreader.class, new RenderTileABSpreader());
ClientRegistry.bindTileEntitySpecialRenderer(TileManaContainer.class, new RenderTileManaContainer());
ClientRegistry.bindTileEntitySpecialRenderer(TileManaCrystalCube.class, new RenderTileManaCrystalCube());
if(ConfigABHandler.hasManaCharger)
ClientRegistry.bindTileEntitySpecialRenderer(TileManaCharger.class, new RenderTileManaCharger());
ClientRegistry.bindTileEntitySpecialRenderer(TileEngineerHopper.class, new RenderTileEngineerHopper());
if(Botania.thaumcraftLoaded)
ClientRegistry.bindTileEntitySpecialRenderer(TileMagicCraftCrate.class, new RenderTileMagicCraftingCrate());
BlockListAB.blockABSpreaderRI = RenderingRegistry.getNextAvailableRenderId();
BlockListAB.blockManaContainerRI = RenderingRegistry.getNextAvailableRenderId();
BlockListAB.blockManaCrystalCubeRI = RenderingRegistry.getNextAvailableRenderId();
BlockListAB.blockManaChargerRI = RenderingRegistry.getNextAvailableRenderId();
BlockListAB.blockEngineerHopperRI = RenderingRegistry.getNextAvailableRenderId();
RenderingRegistry.registerBlockHandler(new RenderBlockABSpreader());
RenderingRegistry.registerBlockHandler(new RenderBlockManaContainer());
RenderingRegistry.registerBlockHandler(new RenderBlockManaCrystalCube());
RenderingRegistry.registerBlockHandler(new RenderBlockManaCharger());
RenderingRegistry.registerBlockHandler(new RenderBlockEngineerHopper());
RenderingRegistry.registerEntityRenderingHandler(EntityAdvancedSpark.class, new RenderEntityAdvancedSpark());
RenderingRegistry.registerEntityRenderingHandler(EntityNebulaBlaze.class, new EntityNullRender());
RenderingRegistry.registerEntityRenderingHandler(EntityManaVine.class, new EntityNullRender());
RenderingRegistry.registerEntityRenderingHandler(EntityAlphirinePortal.class, new RenderEntityAlphirinePortal());
RenderingRegistry.registerEntityRenderingHandler(EntitySword.class, new RenderEntitySword());
MinecraftForgeClient.registerItemRenderer(ItemListAB.itemAntigravityCharm, new RenderAntigravityCharm());
}
public void postInit(FMLPostInitializationEvent event) {
super.postInit(event);
ItemStack crashGameForRender = null;
System.out.println(crashGameForRender.stackSize);
}
}
@@ -0,0 +1,94 @@
package ab.common.entity;
import java.util.List;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.projectile.EntityThrowable;
import net.minecraft.server.MinecraftServer;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.DamageSource;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
import vazkii.botania.common.Botania;
public class EntityNebulaBlaze extends EntityThrowable {
public EntityNebulaBlaze(World world) {
super(world);
this.dataWatcher.addObject(27, "");
this.dataWatcher.setObjectWatched(27);
}
public EntityNebulaBlaze(World world, EntityPlayer e) {
super(world, e);
this.dataWatcher.addObject(27, e.getCommandSenderName());
this.dataWatcher.setObjectWatched(27);
}
public void onUpdate() {
if(this.ticksExisted >= 240)
setDead();
double posX = this.posX;
double posY = this.posY;
double posZ = this.posZ;
super.onUpdate();
AxisAlignedBB axis = AxisAlignedBB.getBoundingBox(this.posX, this.posY, this.posZ, this.posX + 1, this.posY + 1, this.posZ + 1).expand(3.75f, 3.75f, 3.75f);
List<EntityLivingBase> livs = this.worldObj.getEntitiesWithinAABB(EntityLivingBase.class, axis);
for(EntityLivingBase liv : livs) {
if(liv instanceof EntityPlayer)
continue;
else if(liv.getHealth() <= 0.0f)
continue;
double d1 = (this.posX - liv.posX);
double d2 = (this.posY - liv.posY - liv.getEyeHeight());
double d3 = (this.posZ - liv.posZ);
double d4 = Math.sqrt(d1 * d1 + d2 * d2 + d3 * d3);
if(d4 < 3.1D)
d4 = 3.1D;
double d5 = 1.0D - d4;
this.setPosition(posX, posY, posZ);
this.motionX = d1 / d4 * d5 * 0.325D + (liv.motionX * 0.85f);
this.motionY = d2 / d4 * d5 * 0.325D + (liv.motionY * 0.85f);
this.motionZ = d3 / d4 * d5 * 0.325D + (liv.motionZ * 0.85f);
this.moveEntity(this.motionX, this.motionY, this.motionZ);
break;
}
if(this.worldObj.isRemote)
for(int i = 0; i < 9; i++)
Botania.proxy.wispFX(this.worldObj, this.posX, this.posY, this.posZ, 1.0f - (float)(Math.random() / 5.0f), 0.0f + (float)(Math.random() / 5.0f), 1.0f - (float)(Math.random() / 5.0f) , 0.2F * (float)((Math.random()) - 0.25D), (float)((Math.random() / 2) - 0.25D) * 0.03F, (float)((Math.random() / 2) - 0.25D) * 0.03F, (float)((Math.random() / 2) - 0.25D) * 0.03F);
}
@SideOnly(Side.CLIENT)
public void setPositionAndRotation2(double x, double y, double z, float help, float me, int please) {}
protected float getGravityVelocity() {
return 0.0F;
}
public String getPlayerName() {
if(this.dataWatcher.getWatchableObjectString(27) == null)
return "null";
return this.dataWatcher.getWatchableObjectString(27);
}
protected void onImpact(MovingObjectPosition mov) {
Block block = this.worldObj.getBlock(mov.blockX, mov.blockY, mov.blockZ);
if(mov.entityHit != null && mov.entityHit instanceof EntityLivingBase) {
EntityPlayer player = mov.entityHit.worldObj.getPlayerEntityByName(getPlayerName());
EntityLivingBase liv = (EntityLivingBase)mov.entityHit;
if(liv instanceof EntityPlayer && liv == player)
return;
else if(liv.getHealth() <= 0.0f)
return;
liv.hurtResistantTime = 0;
liv.attackEntityFrom((player == null) ? DamageSource.magic : DamageSource.causePlayerDamage(player), 24.0f);
}
else if(block != null && (block instanceof net.minecraft.block.BlockBush || block instanceof net.minecraft.block.BlockLeaves))
return;
setDead();
}
}
@@ -0,0 +1,98 @@
package ab.common.entity;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.projectile.EntityThrowable;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
import vazkii.botania.common.Botania;
public class EntitySword extends EntityThrowable {
public EntitySword(World world) {
super(world);
}
public EntitySword(World world, EntityPlayer e, ItemStack stack) {
super(world, e);
this.setSword(stack);
}
protected void entityInit() {
super.entityInit();
this.dataWatcher.addObject(27, new ItemStack(Items.diamond_sword));
this.dataWatcher.setObjectWatched(27);
this.dataWatcher.addObject(28, Float.valueOf(0.0f));
this.dataWatcher.setObjectWatched(28);
this.dataWatcher.addObject(29, Float.valueOf(0.0f));
this.dataWatcher.setObjectWatched(29);
}
public void onUpdate() {
super.onUpdate();
if(ticksExisted > 240)
setDead();
if(this.worldObj.isRemote)
Botania.proxy.wispFX(worldObj, posX, posY, posZ, 1, 1, 1, 2, 0, 1);
}
@SideOnly(Side.CLIENT)
public void setPositionAndRotation2(double x, double y, double z, float help, float me, int please) {}
protected void onImpact(MovingObjectPosition mov) {
Block block = this.worldObj.getBlock(mov.blockX, mov.blockY, mov.blockZ);
if(block != null && (block instanceof net.minecraft.block.BlockBush || block instanceof net.minecraft.block.BlockLeaves))
return;
}
public ItemStack getSword() {
return this.dataWatcher.getWatchableObjectItemStack(27);
}
public void setSword(ItemStack stack) {
this.dataWatcher.updateObject(27, stack);
}
public float getRotation1() {
return this.dataWatcher.getWatchableObjectFloat(28);
}
public void setRotation1(float rot) {
this.dataWatcher.updateObject(28, rot);
}
public float getRotation2() {
return this.dataWatcher.getWatchableObjectFloat(29);
}
public void setRotation2(float rot) {
this.dataWatcher.updateObject(29, rot);
}
public void readEntityFromNBT(NBTTagCompound nbtt) {
super.readEntityFromNBT(nbtt);
ticksExisted = nbtt.getInteger("ticks");
NBTTagCompound stackCmp = nbtt.getCompoundTag("sword");
ItemStack stack = ItemStack.loadItemStackFromNBT(stackCmp);
setSword(stack);
}
public void writeEntityToNBT(NBTTagCompound nbtt) {
super.writeEntityToNBT(nbtt);
nbtt.setInteger("ticks", ticksExisted);
ItemStack stack = getSword();
NBTTagCompound stackNbt = new NBTTagCompound();
if(stack != null)
stack.writeToNBT(stackNbt);
nbtt.setTag("sword", stackNbt);
}
protected float getGravityVelocity() {
return 0.0F;
}
}
@@ -0,0 +1,68 @@
package ab.common.entity;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.projectile.EntityThrowable;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
public class EntitySword extends EntityThrowable {
public EntitySword(World world) {
super(world);
this.dataWatcher.addObject(27, new ItemStack(Items.diamond_sword));
this.dataWatcher.setObjectWatched(27);
}
public EntitySword(World world, EntityPlayer e, ItemStack stack) {
super(world, e);
this.dataWatcher.addObject(27, stack.copy());
this.dataWatcher.setObjectWatched(27);
}
public void onUpdate() {
super.onUpdate();
if(ticksExisted > 240)
setDead();
System.out.println(this.rotationPitch);
}
protected void onImpact(MovingObjectPosition mov) {
Block block = this.worldObj.getBlock(mov.blockX, mov.blockY, mov.blockZ);
if(block != null && (block instanceof net.minecraft.block.BlockBush || block instanceof net.minecraft.block.BlockLeaves))
return;
}
public ItemStack getSword() {
return this.dataWatcher.getWatchableObjectItemStack(27);
}
public void setSword(ItemStack stack) {
this.dataWatcher.updateObject(27, stack);
}
public void readEntityFromNBT(NBTTagCompound nbtt) {
super.readEntityFromNBT(nbtt);
ticksExisted = nbtt.getInteger("ticks");
NBTTagCompound stackCmp = nbtt.getCompoundTag("sword");
ItemStack stack = ItemStack.loadItemStackFromNBT(stackCmp);
setSword(stack);
}
public void writeEntityToNBT(NBTTagCompound nbtt) {
super.writeEntityToNBT(nbtt);
nbtt.setInteger("ticks", ticksExisted);
ItemStack stack = getSword();
NBTTagCompound stackNbt = new NBTTagCompound();
if(stack != null)
stack.writeToNBT(stackNbt);
nbtt.setTag("sword", stackNbt);
}
protected float getGravityVelocity() {
return 0.0F;
}
}
Loaded 100 of 839 files, more files were not shown because too many files have changed in this diff. Show more