diff --git a/src/api/java/vazkii/botania/api/BotaniaAPI.java b/src/api/java/vazkii/botania/api/BotaniaAPI.java deleted file mode 100644 index b994afc..0000000 --- a/src/api/java/vazkii/botania/api/BotaniaAPI.java +++ /dev/null @@ -1,546 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Jan 14, 2014, 6:15:28 PM (GMT)] - */ -package vazkii.botania.api; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.LinkedHashMap; -import java.util.LinkedHashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.init.Items; -import net.minecraft.item.EnumRarity; -import net.minecraft.item.Item; -import net.minecraft.item.Item.ToolMaterial; -import net.minecraft.item.ItemArmor.ArmorMaterial; -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.common.util.EnumHelper; -import net.minecraftforge.oredict.OreDictionary; -import vazkii.botania.api.brew.Brew; -import vazkii.botania.api.internal.DummyMethodHandler; -import vazkii.botania.api.internal.DummySubTile; -import vazkii.botania.api.internal.IInternalMethodHandler; -import vazkii.botania.api.lexicon.KnowledgeType; -import vazkii.botania.api.lexicon.LexiconCategory; -import vazkii.botania.api.lexicon.LexiconEntry; -import vazkii.botania.api.recipe.RecipeBrew; -import vazkii.botania.api.recipe.RecipeElvenTrade; -import vazkii.botania.api.recipe.RecipeManaInfusion; -import vazkii.botania.api.recipe.RecipeMiniFlower; -import vazkii.botania.api.recipe.RecipePetals; -import vazkii.botania.api.recipe.RecipePureDaisy; -import vazkii.botania.api.recipe.RecipeRuneAltar; -import vazkii.botania.api.subtile.SubTileEntity; -import vazkii.botania.api.subtile.signature.BasicSignature; -import vazkii.botania.api.subtile.signature.SubTileSignature; -import vazkii.botania.api.wiki.IWikiProvider; -import vazkii.botania.api.wiki.SimpleWikiProvider; -import vazkii.botania.api.wiki.WikiHooks; - -import com.google.common.collect.BiMap; -import com.google.common.collect.HashBiMap; - -import cpw.mods.fml.common.Loader; - -public final class BotaniaAPI { - - private static List categories = new ArrayList(); - private static List allEntries = new ArrayList(); - - public static Map knowledgeTypes = new HashMap(); - - public static Map brewMap = new LinkedHashMap(); - - public static List petalRecipes = new ArrayList(); - public static List pureDaisyRecipes = new ArrayList(); - public static List manaInfusionRecipes = new ArrayList(); - public static List runeAltarRecipes = new ArrayList(); - public static List elvenTradeRecipes = new ArrayList(); - public static List brewRecipes = new ArrayList(); - public static List miniFlowerRecipes = new ArrayList(); - - private static BiMap> subTiles = HashBiMap.> create(); - private static Map, SubTileSignature> subTileSignatures = new HashMap, SubTileSignature>(); - public static Set subtilesForCreativeMenu = new LinkedHashSet(); - public static Map subTileMods = new HashMap(); - public static BiMap miniFlowers = HashBiMap. create(); - - public static Map oreWeights = new HashMap(); - public static Map oreWeightsNether = new HashMap(); - public static Map seeds = new HashMap(); - public static Set looniumBlacklist = new LinkedHashSet(); - - public static ArmorMaterial manasteelArmorMaterial = EnumHelper.addArmorMaterial("MANASTEEL", 16, new int[] { 2, 6, 5, 2 }, 18); - public static ToolMaterial manasteelToolMaterial = EnumHelper.addToolMaterial("MANASTEEL", 3, 300, 6.2F, 2F, 20); - - public static ArmorMaterial elementiumArmorMaterial = EnumHelper.addArmorMaterial("B_ELEMENTIUM", 18, new int[] { 2, 6, 5, 2 }, 18); - public static ToolMaterial elementiumToolMaterial = EnumHelper.addToolMaterial("B_ELEMENTIUM", 3, 720, 6.2F, 2F, 20); - - public static ArmorMaterial terrasteelArmorMaterial = EnumHelper.addArmorMaterial("TERRASTEEL", 34, new int[] {3, 8, 6, 3}, 26); - public static ToolMaterial terrasteelToolMaterial = EnumHelper.addToolMaterial("TERRASTEEL", 4, 2300, 9F, 3F, 26); - - public static ArmorMaterial manaweaveArmorMaterial = EnumHelper.addArmorMaterial("MANAWEAVE", 5, new int[] { 1, 2, 2, 1 }, 18); - - public static EnumRarity rarityRelic = EnumHelper.addRarity("RELIC", EnumChatFormatting.GOLD, "Relic"); - - public static KnowledgeType basicKnowledge; - public static KnowledgeType elvenKnowledge; - - // This is here for completeness sake, but you shouldn't use it - public static KnowledgeType relicKnowledge; - - // All of these categories are initialized during botania's PreInit stage. - public static LexiconCategory categoryBasics; - public static LexiconCategory categoryMana; - public static LexiconCategory categoryFunctionalFlowers; - public static LexiconCategory categoryGenerationFlowers; - public static LexiconCategory categoryDevices; - public static LexiconCategory categoryTools; - public static LexiconCategory categoryBaubles; - public static LexiconCategory categoryEnder; - public static LexiconCategory categoryAlfhomancy; - public static LexiconCategory categoryMisc; - - public static Brew fallbackBrew = new Brew("fallback", "botania.brew.fallback", 0, 0); - - static { - registerSubTile("", DummySubTile.class); - - basicKnowledge = registerKnowledgeType("minecraft", EnumChatFormatting.RESET, true); - elvenKnowledge = registerKnowledgeType("alfheim", EnumChatFormatting.DARK_GREEN, false); - relicKnowledge = registerKnowledgeType("relic", EnumChatFormatting.DARK_PURPLE, false); - - addOreWeight("oreAluminum", 3940); // Tinkers' Construct - addOreWeight("oreAmber", 2075); // Thaumcraft - addOreWeight("oreApatite", 1595); // Forestry - addOreWeight("oreBlueTopaz", 3195); // Ars Magica - addOreWeight("oreCertusQuartz", 3975); // Applied Energistics - addOreWeight("oreChimerite", 3970); // Ars Magica - addOreWeight("oreCinnabar", 2585); // Thaumcraft - addOreWeight("oreCoal", 46525); // Vanilla - addOreWeight("oreCopper", 8325); // IC2, Thermal Expansion, Tinkers' Construct, etc. - addOreWeight("oreDark", 1350); // EvilCraft - addOreWeight("oreDarkIron", 1700); // Factorization (older versions) - addOreWeight("oreFzDarkIron", 1700); // Factorization (newer versions) - addOreWeight("oreDiamond", 1265); // Vanilla - addOreWeight("oreEmerald", 780); // Vanilla - addOreWeight("oreGalena", 1000); // Factorization - addOreWeight("oreGold", 2970); // Vanilla - addOreWeight("oreInfusedAir", 925); // Thaumcraft - addOreWeight("oreInfusedEarth", 925); // Thaumcraft - addOreWeight("oreInfusedEntropy", 925); // Thaumcraft - addOreWeight("oreInfusedFire", 925); // Thaumcraft - addOreWeight("oreInfusedOrder", 925); // Thaumcraft - addOreWeight("oreInfusedWater", 925); // Thaumcraft - addOreWeight("oreIron", 20665); // Vanilla - addOreWeight("oreLapis", 1285); // Vanilla - addOreWeight("oreLead", 7985); // IC2, Thermal Expansion, Factorization, etc. - addOreWeight("oreMCropsEssence", 3085); // Magical Crops - addOreWeight("oreMithril", 8); // Thermal Expansion - addOreWeight("oreNickel", 2275); // Thermal Expansion - addOreWeight("oreOlivine", 1100); // Project RED - addOreWeight("orePlatinum", 365); // Thermal Expansion - addOreWeight("oreRedstone", 6885); // Vanilla - addOreWeight("oreRuby", 1100); // Project RED - addOreWeight("oreSapphire", 1100); // Project RED - addOreWeight("oreSilver", 6300); // Thermal Expansion, Factorization, etc. - addOreWeight("oreSulfur", 1105); // Railcraft - addOreWeight("oreTin", 9450); // IC2, Thermal Expansion, etc. - addOreWeight("oreUranium", 1337); // IC2 - addOreWeight("oreVinteum", 5925); // Ars Magica - addOreWeight("oreYellorite", 3520); // Big Reactors - addOreWeight("oreZinc", 6485); // Flaxbeard's Steam Power - addOreWeight("oreMythril", 6485); // Simple Ores2 - addOreWeight("oreAdamantium", 2275); // Simple Ores2 - addOreWeight("oreTungsten", 3520); // Simple Tungsten - - addOreWeightNether("oreQuartz", 19600); // Vanilla - addOreWeightNether("oreCobalt", 500); // Tinker's Construct - addOreWeightNether("oreArdite", 500); // Tinker's Construct - addOreWeightNether("oreFirestone", 5); // Railcraft - addOreWeightNether("oreNetherCoal", 17000); // Nether Ores - addOreWeightNether("oreNetherCopper", 4700); // Nether Ores - addOreWeightNether("oreNetherDiamond", 175); // Nether Ores - addOreWeightNether("oreNetherEssence", 2460); // Magical Crops - addOreWeightNether("oreNetherGold", 3635); // Nether Ores - addOreWeightNether("oreNetherIron", 5790); // Nether Ores - addOreWeightNether("oreNetherLapis", 3250); // Nether Ores - addOreWeightNether("oreNetherLead", 2790); // Nether Ores - addOreWeightNether("oreNetherNickel", 1790); // Nether Ores - addOreWeightNether("oreNetherPlatinum", 170); // Nether Ores - addOreWeightNether("oreNetherRedstone", 5600); // Nether Ores - addOreWeightNether("oreNetherSilver", 1550); // Nether Ores - addOreWeightNether("oreNetherSteel", 1690); // Nether Ores - addOreWeightNether("oreNetherTin", 3750); // Nether Ores - addOreWeightNether("oreFyrite", 1000); // Netherrocks - addOreWeightNether("oreAshstone", 1000); // Netherrocks - addOreWeightNether("oreDragonstone", 175); // Netherrocks - addOreWeightNether("oreArgonite", 1000); // Netherrocks - addOreWeightNether("oreOnyx", 500); // SimpleOres 2 - addOreWeightNether("oreHaditeCoal", 500); // Hadite - - addSeed(Items.wheat_seeds, Blocks.wheat); - addSeed(Items.potato, Blocks.potatoes); - addSeed(Items.carrot, Blocks.carrots); - addSeed(Items.nether_wart, Blocks.nether_wart); - addSeed(Items.pumpkin_seeds, Blocks.pumpkin_stem); - addSeed(Items.melon_seeds, Blocks.melon_stem); - - registerModWiki("Minecraft", new SimpleWikiProvider("Minecraft Wiki", "http://minecraft.gamepedia.com/%s")); - - IWikiProvider technicWiki = new SimpleWikiProvider("Technic Wiki", "http://wiki.technicpack.net/%s"); - IWikiProvider mekanismWiki = new SimpleWikiProvider("Mekanism Wiki", "http://wiki.aidancbrady.com/wiki/%s"); - IWikiProvider buildcraftWiki = new SimpleWikiProvider("BuildCraft Wiki", "http://www.mod-buildcraft.com/wiki/doku.php?id=%s"); - - registerModWiki("Mekanism", mekanismWiki); - registerModWiki("MekanismGenerators", mekanismWiki); - registerModWiki("MekanismTools", mekanismWiki); - registerModWiki("EnderIO", new SimpleWikiProvider("EnderIO Wiki", "http://wiki.enderio.com/%s")); - registerModWiki("TropiCraft", new SimpleWikiProvider("Tropicraft Wiki", "http://wiki.tropicraft.net/wiki/%s")); - registerModWiki("RandomThings", new SimpleWikiProvider("Random Things Wiki", "http://randomthingsminecraftmod.wikispaces.com/%s")); - registerModWiki("Witchery", new SimpleWikiProvider("Witchery Wiki", "https://sites.google.com/site/witcherymod/%s", "-")); - registerModWiki("AppliedEnergistics2", new SimpleWikiProvider("AE2 Wiki", "http://ae-mod.info/%s")); - registerModWiki("BigReactors", technicWiki); - registerModWiki("BuildCraft|Core", buildcraftWiki); - registerModWiki("BuildCraft|Builders", buildcraftWiki); - registerModWiki("BuildCraft|Energy", buildcraftWiki); - registerModWiki("BuildCraft|Factory", buildcraftWiki); - registerModWiki("BuildCraft|Silicon", buildcraftWiki); - registerModWiki("BuildCraft|Transport", buildcraftWiki); - registerModWiki("ArsMagica2", new SimpleWikiProvider("ArsMagica2 Wiki", "http://wiki.arsmagicamod.com/wiki/%s")); - registerModWiki("PneumaticCraft", new SimpleWikiProvider("PneumaticCraft Wiki", "http://www.minemaarten.com/wikis/pneumaticcraft-wiki/pneumaticcraft-wiki-%s")); - registerModWiki("StevesCarts2", new SimpleWikiProvider("Steve's Carts Wiki", "http://stevescarts2.wikispaces.com/%s")); - registerModWiki("GanysSurface", new SimpleWikiProvider("Gany's Surface Wiki", "http://ganys-surface.wikia.com/wiki/%s")); - registerModWiki("GanysNether", new SimpleWikiProvider("Gany's Nether Wiki", "http://ganys-nether.wikia.com/wiki/%s")); - registerModWiki("GanysEnd", new SimpleWikiProvider("Gany's End Wiki", "http://ganys-end.wikia.com/wiki/%s")); - } - - /** - * The internal method handler in use. Do not overwrite. - * @see IInternalMethodHandler - */ - public static IInternalMethodHandler internalHandler = new DummyMethodHandler(); - - - /** - * Registers a new Knowledge Type. - * @param id The ID for this knowledge type. - * @param color The color to display this knowledge type as. - */ - public static KnowledgeType registerKnowledgeType(String id, EnumChatFormatting color, boolean autoUnlock) { - KnowledgeType type = new KnowledgeType(id, color, autoUnlock); - knowledgeTypes.put(id, type); - return type; - } - - /** - * Registers a Brew and returns it. - */ - public static Brew registerBrew(Brew brew) { - brewMap.put(brew.getKey(), brew); - return brew; - } - - /** - * Gets a brew from the key passed in, returns the fallback if - * it's not in the map. - */ - public static Brew getBrewFromKey(String key) { - if(brewMap.containsKey(key)) - return brewMap.get(key); - return fallbackBrew; - } - - /** - * Registers a Petal Recipe. - * @param output The ItemStack to craft. - * @param inputs The objects for crafting. Can be ItemStack, MappableStackWrapper - * or String (case for Ore Dictionary). The array can't be larger than 16. - * @return The recipe created. - */ - public static RecipePetals registerPetalRecipe(ItemStack output, Object... inputs) { - RecipePetals recipe = new RecipePetals(output, inputs); - petalRecipes.add(recipe); - return recipe; - } - - /** - * Registers a Pure Daisy Recipe. - * @param input The block that works as an input for the recipe. Can be a Block or an oredict String. - * @param output The block to be placed upon recipe completion. - * @param outputMeta The metadata to be placed upon recipe completion. - * @return The recipe created. - */ - public static RecipePureDaisy registerPureDaisyRecipe(Object input, Block output, int outputMeta) { - RecipePureDaisy recipe = new RecipePureDaisy(input, output, outputMeta); - pureDaisyRecipes.add(recipe); - return recipe; - } - - /** - * Registers a Rune Altar Recipe. - * @param output The ItemStack to craft. - * @param mana The amount of mana required. Don't go over 100000! - * @param inputs The objects for crafting. Can be ItemStack, MappableStackWrapper - * or String (case for Ore Dictionary). The array can't be larger than 16. - * @return The recipe created. - */ - public static RecipeRuneAltar registerRuneAltarRecipe(ItemStack output, int mana, Object... inputs) { - RecipeRuneAltar recipe = new RecipeRuneAltar(output, mana, inputs); - runeAltarRecipes.add(recipe); - return recipe; - } - - /** - * Registers a Mana Infusion Recipe (throw an item in a mana pool) - * @param output The ItemStack to craft - * @param input The input item, be it an ItemStack or an ore dictionary entry String. - * @param mana The amount of mana required. Don't go over 100000! - * @return The recipe created. - */ - public static RecipeManaInfusion registerManaInfusionRecipe(ItemStack output, Object input, int mana) { - RecipeManaInfusion recipe = new RecipeManaInfusion(output, input, mana); - manaInfusionRecipes.add(recipe); - return recipe; - } - - /** - * Register a Mana Infusion Recipe and flags it as an Alchemy recipe (requires an - * Alchemy Catalyst below the pool). - * @see BotaniaAPI#registerManaInfusionRecipe - */ - public static RecipeManaInfusion registerManaAlchemyRecipe(ItemStack output, Object input, int mana) { - RecipeManaInfusion recipe = registerManaInfusionRecipe(output, input, mana); - recipe.setAlchemy(true); - return recipe; - } - - /** - * Register a Mana Infusion Recipe and flags it as an Conjuration recipe (requires a - * Conjuration Catalyst below the pool). - * @see BotaniaAPI#registerManaInfusionRecipe - */ - public static RecipeManaInfusion registerManaConjurationRecipe(ItemStack output, Object input, int mana) { - RecipeManaInfusion recipe = registerManaInfusionRecipe(output, input, mana); - recipe.setConjuration(true); - return recipe; - } - - /** - * Registers a Elven Trade recipe (throw an item in an Alfheim Portal). - * @param output The ItemStack to return. - * @param inputs The items required, can be ItemStack or ore dictionary entry string. - * @return The recipe created. - */ - public static RecipeElvenTrade registerElvenTradeRecipe(ItemStack output, Object... inputs) { - RecipeElvenTrade recipe = new RecipeElvenTrade(output, inputs); - elvenTradeRecipes.add(recipe); - return recipe; - } - - /** - * Registers a Brew Recipe (for the Botanical Brewery). - * @param brew The brew in to be set in this recipe. - * @inputs The items used in the recipe, no more than 6. - */ - public static RecipeBrew registerBrewRecipe(Brew brew, Object... inputs) { - RecipeBrew recipe = new RecipeBrew(brew, inputs); - brewRecipes.add(recipe); - return recipe; - } - - /** - * Registers a SubTileEntity, a new special flower. Look in the subtile package of the API. - * If you call this after PostInit you're a failiure and we are very disappointed in you. - */ - public static void registerSubTile(String key, Class subtileClass) { - subTiles.put(key, subtileClass); - subTileMods.put(key, Loader.instance().activeModContainer().getModId()); - } - - /** - * Register a SubTileEntity and makes it a mini flower. Also adds the recipe and returns it. - * @see BotaniaAPI#registerSubTile - */ - public static RecipeManaInfusion registerMiniSubTile(String key, Class subtileClass, String original) { - registerSubTile(key, subtileClass); - miniFlowers.put(original, key); - - RecipeMiniFlower recipe = new RecipeMiniFlower(key, original, 2500); - manaInfusionRecipes.add(recipe); - miniFlowerRecipes.add(recipe); - return recipe; - } - - /** - * Registers a SubTileEntity's signature. - * @see SubTileSignature - */ - public static void registerSubTileSignature(Class subtileClass, SubTileSignature signature) { - subTileSignatures.put(subtileClass, signature); - } - - /** - * Gets the singleton signature for a SubTileEntity class. Registers a fallback if one wasn't registered - * before the call. - */ - public static SubTileSignature getSignatureForClass(Class subtileClass) { - if(!subTileSignatures.containsKey(subtileClass)) - registerSubTileSignature(subtileClass, new BasicSignature(subTiles.inverse().get(subtileClass))); - - return subTileSignatures.get(subtileClass); - } - - /** - * Gets the singleton signature for a SubTileEntity's name. Registers a fallback if one wasn't registered - * before the call. - */ - public static SubTileSignature getSignatureForName(String name) { - Class subtileClass = subTiles.get(name); - return getSignatureForClass(subtileClass); - } - - /** - * Adds the key for a SubTileEntity into the creative menu. This goes into the - * subtilesForCreativeMenu Set. This does not need to be called for mini flowers, - * those will just use the mini flower map to add themselves next to the source. - */ - public static void addSubTileToCreativeMenu(String key) { - subtilesForCreativeMenu.add(key); - } - - /** - * Adds a category to the list of registered categories to appear in the Lexicon. - */ - public static void addCategory(LexiconCategory category) { - categories.add(category); - } - - /** - * Gets all registered categories. - */ - public static List getAllCategories() { - return categories; - } - - /** - * Gets all registered entries. - */ - public static List getAllEntries() { - return allEntries; - } - - /** - * Registers a Lexicon Entry and adds it to the category passed in. - */ - public static void addEntry(LexiconEntry entry, LexiconCategory category) { - allEntries.add(entry); - category.entries.add(entry); - } - - /** - * Maps an ore (ore dictionary key) to it's weight on the world generation. This - * is used for the Orechid flower. Check the static block in the BotaniaAPI class - * to get the weights for the vanilla blocks.
- * Alternatively get the values with the OreDetector mod:
- * https://gist.github.com/Vazkii/9493322 - */ - public static void addOreWeight(String ore, int weight) { - oreWeights.put(ore, weight); - } - - /** - * Maps an ore (ore dictionary key) to it's weight on the nether world generation. This - * is used for the Orechid Ignem flower. Check the static block in the BotaniaAPI class - * to get the weights for the vanilla blocks.
- * Alternatively get the values with the OreDetector mod:
- * https://gist.github.com/Vazkii/9493322 - */ - public static void addOreWeightNether(String ore, int weight) { - if(ore.contains("Nether") && OreDictionary.getOres(ore.replace("Nether", "")).size() == 0) - return; - - oreWeightsNether.put(ore, weight); - } - - public static int getOreWeight(String ore) { - return oreWeights.get(ore); - } - - public static int getOreWeightNether(String ore) { - return oreWeightsNether.get(ore); - } - - /** - * Allows an item to be counted as a seed. Any item in this list can be - * dispensed by a dispenser, the block is the block to be placed. - */ - public static void addSeed(Item item, Block block) { - seeds.put(item, block); - } - - /** - * Blacklists an item from the Loonium drop table. - */ - public static void blackListItemFromLoonium(Item item) { - looniumBlacklist.add(item); - } - - /** - * Gets the last recipe to have been added to the recipe list. - */ - public static IRecipe getLatestAddedRecipe() { - List list = CraftingManager.getInstance().getRecipeList(); - return list.get(list.size() - 1); - } - - /** - * Gets the last x recipes added to the recipe list. - */ - public static List getLatestAddedRecipes(int x) { - List list = CraftingManager.getInstance().getRecipeList(); - List newList = new ArrayList(); - for(int i = x - 1; i >= 0; i--) - newList.add(list.get(list.size() - 1 - i)); - - return newList; - } - - /** - * Registers a Wiki provider for a mod so it uses that instead of the fallback - * FTB wiki. Make sure to call this on PostInit only! - */ - public static void registerModWiki(String mod, IWikiProvider provider) { - WikiHooks.registerModWiki(mod, provider); - } - - public static Class getSubTileMapping(String key) { - if(!subTiles.containsKey(key)) - key = ""; - - return subTiles.get(key); - } - - public static String getSubTileStringMapping(Class clazz) { - return subTiles.inverse().get(clazz); - } - - public static Set getAllSubTiles() { - return subTiles.keySet(); - } -} diff --git a/src/api/java/vazkii/botania/api/boss/IBotaniaBoss.java b/src/api/java/vazkii/botania/api/boss/IBotaniaBoss.java deleted file mode 100644 index d337e6a..0000000 --- a/src/api/java/vazkii/botania/api/boss/IBotaniaBoss.java +++ /dev/null @@ -1,62 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Oct 29, 2014, 6:09:48 PM (GMT)] - */ -package vazkii.botania.api.boss; - -import java.awt.Rectangle; - -import net.minecraft.client.gui.ScaledResolution; -import net.minecraft.entity.boss.IBossDisplayData; -import net.minecraft.util.ResourceLocation; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -/** - * An extension of IBossDisplayData. This counts as a botania boss and as a normal - * minecraft boss since it has IBossDisplayData. Instead of using the typical - * BossStatus.setBossStatus(entity, true) to set the health bar in the render use - * BotaniaAPI.internalMethodHandler.setBossStatus(entity);

- * Alternatively, you can check if botania is loaded and use the vanilla one - * if that's not the case. - */ -public interface IBotaniaBoss extends IBossDisplayData { - - /** - * The ResourceLocation to bind for this boss's boss bar. - * You can use BotaniaAPI.internalMethodHandler.getDefaultBossBarTexture() to get - * the one used by botania bosses. - */ - @SideOnly(Side.CLIENT) - public ResourceLocation getBossBarTexture(); - - /** - * A Rectangle instance delimiting the uv, width and height of this boss's - * boss bar texture. This is for the background, not the bar that shows - * the HP. - */ - @SideOnly(Side.CLIENT) - public Rectangle getBossBarTextureRect(); - - /** - * A Rectangle instance delimiting the uv, width and height of this boss's - * boss bar HP texture. This is for the foreground that shows how much - * HP the boss has. The width of the rectangle will be multiplied by the - * faction of the boss's current HP by max HP. - */ - @SideOnly(Side.CLIENT) - public Rectangle getBossBarHPTextureRect(); - - /** - * A callback for when this boss's boss bar renders, you can do aditional rendering - * here if needed. - */ - @SideOnly(Side.CLIENT) - public void bossBarRenderCallback(ScaledResolution res, int x, int y); -} diff --git a/src/api/java/vazkii/botania/api/boss/IBotaniaBossWithShader.java b/src/api/java/vazkii/botania/api/boss/IBotaniaBossWithShader.java deleted file mode 100644 index 82221d3..0000000 --- a/src/api/java/vazkii/botania/api/boss/IBotaniaBossWithShader.java +++ /dev/null @@ -1,42 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Oct 29, 2014, 6:13:21 PM (GMT)] - */ -package vazkii.botania.api.boss; - -import vazkii.botania.api.internal.ShaderCallback; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -/** - * A Botania boss whose HP bar makes use of shaders. Shaders - * used through this have a few uniforms available: - *
  • int time - The amount of total ticks elapsed.
  • - *
  • int startX - The U coordinate passed in for the render of this bar's texture.
  • - *
  • int startY - The V coordinate passed in for the render of this bar's texture.
  • - */ -public interface IBotaniaBossWithShader extends IBotaniaBoss { - - /** - * The Shader Program to use for this boss bar. Return 0 case - * you don't want a shader to be used. You can use separate shaders - * for the background and foreground. - * @param background True if rendering the background of the boss bar, - * false if rendering the bar itself that shows the HP. - */ - @SideOnly(Side.CLIENT) - public int getBossBarShaderProgram(boolean background); - - /** - * A callback for the shader, used to pass in uniforms. Return null for no callback. - */ - @SideOnly(Side.CLIENT) - public ShaderCallback getBossBarShaderCallback(boolean background, int shader); - -} diff --git a/src/api/java/vazkii/botania/api/brew/Brew.java b/src/api/java/vazkii/botania/api/brew/Brew.java deleted file mode 100644 index d0dd6ba..0000000 --- a/src/api/java/vazkii/botania/api/brew/Brew.java +++ /dev/null @@ -1,126 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Nov 1, 2014, 6:22:54 PM (GMT)] - */ -package vazkii.botania.api.brew; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import net.minecraft.item.ItemStack; -import net.minecraft.potion.PotionEffect; - -/** - * The class for a Brew definition, each one is a singleton. - */ -public class Brew { - - String key; - String name; - int color; - int cost; - List effects; - boolean canInfuseBloodPendant = true; - boolean canInfuseIncense = true; - - /** - * @param name The unlocalized name of this potion. - * @param color The color for the potion to be rendered in the bottle, note that it will get - * changed a bit when it renders (for more or less brightness) to give a fancy effect. - * @param cost The cost, in Mana for this brew. - * @param effects A list of effects to apply to the player when they drink it. - */ - public Brew(String key, String name, int color, int cost, PotionEffect... effects) { - this.key = key; - this.name = name; - this.color = color; - this.cost = cost; - this.effects = new ArrayList(Arrays.asList(effects)); - } - - /** - * Sets this brew to not be able to be infused onto the Tainted Blood Pendant. - */ - public Brew setNotBloodPendantInfusable() { - canInfuseBloodPendant = false; - return this; - } - - /** - * Sets this brew to not be able to be infused onto Incense Sticks. - */ - public Brew setNotIncenseInfusable() { - canInfuseIncense = false; - return this; - } - - public boolean canInfuseBloodPendant() { - return canInfuseBloodPendant; - } - - public boolean canInfuseIncense() { - return canInfuseIncense; - } - - /** - * Returns the key for this brew, for it to be found in the map in the API. - * This should ALWAYS return the same result. - */ - public String getKey() { - return key; - } - - /** - * Gets the insensitive unlocalized name. This is used for the lexicon. - */ - public String getUnlocalizedName() { - return name; - } - - /** - * Gets the unlocalized name for the ItemStack passed in. - */ - public String getUnlocalizedName(ItemStack stack) { - return getUnlocalizedName(); - } - - /** - * Gets the display color for the ItemStack passed in. Note that for - * the lexicon, this passes in a botania Managlass Vial or an - * Alfglass Flask at all times. - */ - public int getColor(ItemStack stack) { - return color; - } - - /** - * Gets the insensitive unlocalized mana cost. This is used for the lexicon. - */ - public int getManaCost() { - return cost; - } - - /** - * Gets the mana cost for the ItemStack passed in. - */ - public int getManaCost(ItemStack stack) { - return getManaCost(); - } - - /** - * Gets the list of potion effects for the ItemStack passed in. - * Note that for the lexicon, this passes in a botania Managlass - * Vial or an Alfglass Flask at all times. - */ - public List getPotionEffects(ItemStack stack) { - return effects; - } - -} diff --git a/src/api/java/vazkii/botania/api/brew/IBrewContainer.java b/src/api/java/vazkii/botania/api/brew/IBrewContainer.java deleted file mode 100644 index 0d155ec..0000000 --- a/src/api/java/vazkii/botania/api/brew/IBrewContainer.java +++ /dev/null @@ -1,35 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Nov 1, 2014, 6:26:40 PM (GMT)] - */ -package vazkii.botania.api.brew; - -import net.minecraft.item.ItemStack; - -/** - * An Item that implements this counts as a Brew Container, by which - * it can be used a center item for brew recipes and can contain - * a brew. - */ -public interface IBrewContainer { - - /** - * Returs an ItemStack that should be an item that has the brew - * passed in. - */ - public ItemStack getItemForBrew(Brew brew, ItemStack stack); - - /** - * Gets the cost to add this brew onto this container. Return -1 - * to not allow for the brew to be added. Normally you'd - * use brew.getManaCost(stack); - */ - public int getManaCost(Brew brew, ItemStack stack); - -} diff --git a/src/api/java/vazkii/botania/api/brew/IBrewItem.java b/src/api/java/vazkii/botania/api/brew/IBrewItem.java deleted file mode 100644 index d51c9fa..0000000 --- a/src/api/java/vazkii/botania/api/brew/IBrewItem.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Nov 1, 2014, 9:20:33 PM (GMT)] - */ -package vazkii.botania.api.brew; - -import net.minecraft.item.ItemStack; - -/** - * An Item that implements this is a Brew item, by which it contains - * a brew. This is only used in vanilla to prevent the brew item - * from going back into the brewery but other mods might use it for whatever. - */ -public interface IBrewItem { - - public Brew getBrew(ItemStack brew); - -} diff --git a/src/api/java/vazkii/botania/api/corporea/CorporeaHelper.java b/src/api/java/vazkii/botania/api/corporea/CorporeaHelper.java deleted file mode 100644 index a1e7726..0000000 --- a/src/api/java/vazkii/botania/api/corporea/CorporeaHelper.java +++ /dev/null @@ -1,348 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Feb 14, 2015, 3:28:54 PM (GMT)] - */ -package vazkii.botania.api.corporea; -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.WeakHashMap; -import java.util.regex.Pattern; - -import net.minecraft.inventory.IInventory; -import net.minecraft.inventory.ISidedInventory; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.world.World; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.common.util.ForgeDirection; - -public final class CorporeaHelper { - - private static final List empty = Collections.unmodifiableList(new ArrayList()); - private static final WeakHashMap, List> cachedNetworks = new WeakHashMap(); - private static final List autoCompleteControllers = new ArrayList(); - - private static final Pattern patternControlCode = Pattern.compile("(?i)\\u00A7[0-9A-FK-OR]"); - - public static final String[] WILDCARD_STRINGS = new String[] { - "...", "~", "+", "?" , "*" - }; - - /** - * How many items were matched in the last request. If java had "out" params like C# this wouldn't be needed :V - */ - public static int lastRequestMatches = 0; - /** - * How many items were extracted in the last request. - */ - public static int lastRequestExtractions = 0; - - /** - * Gets a list of all the inventories on this spark network. This list is cached for use once every tick, - * and if something changes during that tick it'll still have the first result. - */ - public static List getInventoriesOnNetwork(ICorporeaSpark spark) { - ICorporeaSpark master = spark.getMaster(); - if(master == null) - return empty; - List network = master.getConnections(); - - if(cachedNetworks.containsKey(network)) { - List cache = cachedNetworks.get(network); - if(cache != null) - return cache; - } - - List inventories = new ArrayList(); - if(network != null) - for(ICorporeaSpark otherSpark : network) - if(otherSpark != null) { - IInventory inv = otherSpark.getInventory(); - if(inv != null) - inventories.add(inv); - } - - cachedNetworks.put(network, inventories); - return inventories; - } - - /** - * Gets the amount of available items in the network of the type passed in, checking NBT or not. - * The higher level functions that use a List< IInventory > or a Map< IInventory, Integer > should be - * called instead if the context for those exists to avoid having to get the values again. - */ - public static int getCountInNetwork(ItemStack stack, ICorporeaSpark spark, boolean checkNBT) { - List inventories = getInventoriesOnNetwork(spark); - return getCountInNetwork(stack, inventories, checkNBT); - } - - /** - * Gets the amount of available items in the network of the type passed in, checking NBT or not. - * The higher level function that use a Map< IInventory, Integer > should be - * called instead if the context for this exists to avoid having to get the value again. - */ - public static int getCountInNetwork(ItemStack stack, List inventories, boolean checkNBT) { - Map map = getInventoriesWithItemInNetwork(stack, inventories, checkNBT); - return getCountInNetwork(stack, map, checkNBT); - } - - /** - * Gets the amount of available items in the network of the type passed in, checking NBT or not. - */ - public static int getCountInNetwork(ItemStack stack, Map inventories, boolean checkNBT) { - int count = 0; - - for(IInventory inv : inventories.keySet()) - count += inventories.get(inv); - - return count; - } - - /** - * Gets a Map mapping IInventories to the amount of items of the type passed in that exist - * The higher level function that use a List< IInventory > should be - * called instead if the context for this exists to avoid having to get the value again. - */ - public static Map getInventoriesWithItemInNetwork(ItemStack stack, ICorporeaSpark spark, boolean checkNBT) { - List inventories = getInventoriesOnNetwork(spark); - return getInventoriesWithItemInNetwork(stack, inventories, checkNBT); - } - - /** - * Gets a Map mapping IInventories to the amount of items of the type passed in that exist - * The deeper level function that use a List< IInventory > should be - * called instead if the context for this exists to avoid having to get the value again. - */ - public static Map getInventoriesWithItemInNetwork(ItemStack stack, List inventories, boolean checkNBT) { - Map countMap = new HashMap(); - - for(IInventory inv : inventories) { - int count = 0; - for(int i = 0; i < inv.getSizeInventory(); i++) { - if(!isValidSlot(inv, i)) - continue; - - ItemStack stackAt = inv.getStackInSlot(i); - if(stacksMatch(stack, stackAt, checkNBT)) - count += stackAt.stackSize; - } - - if(count > 0) - countMap.put(inv, count); - } - - return countMap; - } - - /** - * Bridge for requestItem() using an ItemStack. - */ - public static List requestItem(ItemStack stack, ICorporeaSpark spark, boolean checkNBT, boolean doit) { - return requestItem(stack, stack.stackSize, spark, checkNBT, doit); - } - - /** - * Bridge for requestItem() using a String and an item count. - */ - public static List requestItem(String name, int count, ICorporeaSpark spark, boolean doit) { - return requestItem(name, count, spark, false, doit); - } - - /** - * Requests list of ItemStacks of the type passed in from the network, or tries to, checking NBT or not. - * This will remove the items from the adequate inventories unless the "doit" parameter is false. - * Returns a new list of ItemStacks of the items acquired or an empty list if none was found. - * Case itemCount is -1 it'll find EVERY item it can. - *

    - * The "matcher" parameter has to be an ItemStack or a String, if the first it'll check if the - * two stacks are similar using the "checkNBT" parameter, else it'll check if the name of the item - * equals or matches (case a regex is passed in) the matcher string. - */ - public static List requestItem(Object matcher, int itemCount, ICorporeaSpark spark, boolean checkNBT, boolean doit) { - List stacks = new ArrayList(); - CorporeaRequestEvent event = new CorporeaRequestEvent(matcher, itemCount, spark, checkNBT, doit); - if(MinecraftForge.EVENT_BUS.post(event)) - return stacks; - - List inventories = getInventoriesOnNetwork(spark); - Map interceptors = new HashMap(); - - lastRequestMatches = 0; - lastRequestExtractions = 0; - - int count = itemCount; - for(IInventory inv : inventories) { - boolean removedAny = false; - ICorporeaSpark invSpark = getSparkForInventory(inv); - - if(inv instanceof ICorporeaInterceptor) { - ICorporeaInterceptor interceptor = (ICorporeaInterceptor) inv; - interceptor.interceptRequest(matcher, itemCount, invSpark, spark, stacks, inventories, doit); - interceptors.put(interceptor, invSpark); - } - - for(int i = inv.getSizeInventory() - 1; i >= 0; i--) { - if(!isValidSlot(inv, i)) - continue; - - ItemStack stackAt = inv.getStackInSlot(i); - if(matcher instanceof ItemStack ? stacksMatch((ItemStack) matcher, stackAt, checkNBT) : matcher instanceof String ? stacksMatch(stackAt, (String) matcher) : false) { - int rem = Math.min(stackAt.stackSize, count == -1 ? stackAt.stackSize : count); - - if(rem > 0) { - ItemStack copy = stackAt.copy(); - if(rem < copy.stackSize) - copy.stackSize = rem; - stacks.add(copy); - } - - lastRequestMatches += stackAt.stackSize; - lastRequestExtractions += rem; - if(doit && rem > 0) { - inv.decrStackSize(i, rem); - removedAny = true; - if(invSpark != null) - invSpark.onItemExtracted(stackAt); - } - if(count != -1) - count -= rem; - } - } - - if(removedAny) - inv.markDirty(); - } - - for(ICorporeaInterceptor interceptor : interceptors.keySet()) - interceptor.interceptRequestLast(matcher, itemCount, interceptors.get(interceptor), spark, stacks, inventories, doit); - - return stacks; - } - - /** - * Gets the spark attached to the inventory passed case it's a TileEntity. - */ - public static ICorporeaSpark getSparkForInventory(IInventory inv) { - if(!(inv instanceof TileEntity)) - return null; - - TileEntity tile = (TileEntity) inv; - return getSparkForBlock(tile.getWorldObj(), tile.xCoord, tile.yCoord, tile.zCoord); - } - - /** - * Gets the spark attached to the block in the coords passed in. Note that the coords passed - * in are for the block that the spark will be on, not the coords of the spark itself. - */ - public static ICorporeaSpark getSparkForBlock(World world, int x, int y, int z) { - List sparks = world.getEntitiesWithinAABB(ICorporeaSpark.class, AxisAlignedBB.getBoundingBox(x, y + 1, z, x + 1, y + 2, z + 1)); - return sparks.isEmpty() ? null : sparks.get(0); - } - - /** - * Gets if the block in the coords passed in has a spark attached. Note that the coords passed - * in are for the block that the spark will be on, not the coords of the spark itself. - */ - public static boolean doesBlockHaveSpark(World world, int x, int y, int z) { - return getSparkForBlock(world, x, y, z) != null; - } - - /** - * Gets if the slot passed in can be extracted from by a spark. - */ - public static boolean isValidSlot(IInventory inv, int slot) { - return !(inv instanceof ISidedInventory) || arrayHas(((ISidedInventory) inv).getAccessibleSlotsFromSide(ForgeDirection.UP.ordinal()), slot) && ((ISidedInventory) inv).canExtractItem(slot, inv.getStackInSlot(slot), ForgeDirection.UP.ordinal()); - } - - /** - * Gets if two stacks match. - */ - public static boolean stacksMatch(ItemStack stack1, ItemStack stack2, boolean checkNBT) { - return stack1 != null && stack2 != null && stack1.isItemEqual(stack2) && (!checkNBT || ItemStack.areItemStackTagsEqual(stack1, stack2)); - } - - /** - * Gets if the name of a stack matches the string passed in. - */ - public static boolean stacksMatch(ItemStack stack, String s) { - if(stack == null) - return false; - - boolean contains = false; - for(String wc : WILDCARD_STRINGS) { - if(s.endsWith(wc)) { - contains = true; - s = s.substring(0, s.length() - wc.length()); - } - else if(s.startsWith(wc)) { - contains = true; - s = s.substring(wc.length()); - } - - if(contains) - break; - } - - - String name = stripControlCodes(stack.getDisplayName().toLowerCase().trim()); - return equalOrContain(name, s, contains) || equalOrContain(name + "s", s, contains) || equalOrContain(name + "es", s, contains) || name.endsWith("y") && equalOrContain(name.substring(0, name.length() - 1) + "ies", s, contains); - } - - /** - * Clears the cached networks, called once per tick, should not be called outside - * of the botania code. - */ - public static void clearCache() { - cachedNetworks.clear(); - } - - /** - * Helper method to check if an int array contains an int. - */ - public static boolean arrayHas(int[] arr, int val) { - for (int element : arr) - if(element == val) - return true; - - return false; - } - - /** - * Helper method to make stacksMatch() less messy. - */ - public static boolean equalOrContain(String s1, String s2, boolean contain) { - return contain ? s1.contains(s2) : s1.equals(s2); - } - - /** - * Registers a ICorporeaAutoCompleteController - */ - public static void registerAutoCompleteController(ICorporeaAutoCompleteController controller) { - autoCompleteControllers.add(controller); - } - - /** - * Returns if the auto complete helper should run - */ - public static boolean shouldAutoComplete() { - for(ICorporeaAutoCompleteController controller : autoCompleteControllers) - if(controller.shouldAutoComplete()) - return true; - return false; - } - - // Copy from StringUtils - public static String stripControlCodes(String str) { - return patternControlCode.matcher(str).replaceAll(""); - } -} diff --git a/src/api/java/vazkii/botania/api/corporea/CorporeaRequestEvent.java b/src/api/java/vazkii/botania/api/corporea/CorporeaRequestEvent.java deleted file mode 100644 index a55ef7b..0000000 --- a/src/api/java/vazkii/botania/api/corporea/CorporeaRequestEvent.java +++ /dev/null @@ -1,40 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Apr 30, 2015, 2:55:57 PM (GMT)] - */ -package vazkii.botania.api.corporea; - -import cpw.mods.fml.common.eventhandler.Cancelable; -import cpw.mods.fml.common.eventhandler.Event; - -/** - * Fired when a corporea request is initiated. Can be cancelled. - */ -@Cancelable -public class CorporeaRequestEvent extends Event { - - public final Object request; - public final int count; - public final ICorporeaSpark spark; - public final boolean checkNBT; - /** - * If false then items won't be pulled. - */ - public final boolean realRequest; - - public CorporeaRequestEvent(Object request, int count, ICorporeaSpark spark, boolean nbt, boolean real) { - this.request = request; - this.count = count; - this.spark = spark; - checkNBT = nbt; - realRequest = real; - } - - -} diff --git a/src/api/java/vazkii/botania/api/corporea/ICorporeaAutoCompleteController.java b/src/api/java/vazkii/botania/api/corporea/ICorporeaAutoCompleteController.java deleted file mode 100644 index fc0a3e9..0000000 --- a/src/api/java/vazkii/botania/api/corporea/ICorporeaAutoCompleteController.java +++ /dev/null @@ -1,27 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [June 8, 2015, 1:04:05 PM (GMT)] - */ -package vazkii.botania.api.corporea; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -/** - * An interface for systems which may control if the item auto complete system should be active - */ -public interface ICorporeaAutoCompleteController { - - /** - * Return true if auto completion should be enabled. - */ - @SideOnly(Side.CLIENT) - public boolean shouldAutoComplete(); - -} diff --git a/src/api/java/vazkii/botania/api/corporea/ICorporeaInterceptor.java b/src/api/java/vazkii/botania/api/corporea/ICorporeaInterceptor.java deleted file mode 100644 index eeea16a..0000000 --- a/src/api/java/vazkii/botania/api/corporea/ICorporeaInterceptor.java +++ /dev/null @@ -1,38 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Apr 19, 2015, 6:23:31 PM (GMT)] - */ -package vazkii.botania.api.corporea; - -import java.util.List; - -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; - -/** - * A TileEntity that implements this will be able to intercept corporea - * requests case there is a Corporea Spark on top. - */ -public interface ICorporeaInterceptor { - - /** - * Intercepts a request as it goes. The list of inventories has all the inventories - * at this point, but the list of stacks is not complete. The request parameter can - * be either a String or ItemStack. - */ - public void interceptRequest(Object request, int count, ICorporeaSpark spark, ICorporeaSpark source, List stacks, List inventories, boolean doit); - - /** - * Intercepts a request after all the stacks have been found and processed. Both the - * list of inventories and stacks is complete at this point. The request parameter can - * be either a String or ItemStack. - */ - public void interceptRequestLast(Object request, int count, ICorporeaSpark spark, ICorporeaSpark source, List stacks, List inventories, boolean doit); - -} diff --git a/src/api/java/vazkii/botania/api/corporea/ICorporeaSpark.java b/src/api/java/vazkii/botania/api/corporea/ICorporeaSpark.java deleted file mode 100644 index 943e29e..0000000 --- a/src/api/java/vazkii/botania/api/corporea/ICorporeaSpark.java +++ /dev/null @@ -1,87 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Feb 13, 2015, 10:53:05 PM (GMT)] - */ -package vazkii.botania.api.corporea; - -import java.util.List; - -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; - -/** - * An interface for a Corporea Spark. Includes functions for handling - * connections. - */ -public interface ICorporeaSpark { - - /** - * Called to register the connections for the spark network passed in. Parameters include the master spark, - * which is the one that initiated the chain call, the referrer which passed the call to this instance - * and the List of sparks connected. Normal behavior should be to find any sparks around that are not - * already present in the list of connections and add them to it, passing the function call to them. - *

    - * The connections List and the master Spark should be kept in this instance as pointers for use in - * getConnections() and getMaster() and passed in to any subsequent registerConnections calls on sparks - * found nearby. This is only called whenever a new spark is added or removed from and to the network, - * at that point the connection list in the master spark would be cleared out, also clearing out the one - * in this instance, as it should be a pointer. - */ - public void registerConnections(ICorporeaSpark master, ICorporeaSpark referrer, List connections); - - /** - * Gets the inventory this spark is bound to, generally the one right below it. - */ - public IInventory getInventory(); - - /** - * Gets the list of sparks this spark is connected to, see registerConnections(). This list - * should also include itself. This list must be checked against on a regular basis to verify - * that the spark is still in the network, if that's not the case, the pointer should be - * eliminated. - */ - public List getConnections(); - - /** - * Gets the list of sparks that this spark added to the list of connections during registerConnections(), this - * is mainly used to create a non messy chain of particles to display the network when a spark is right - * clicked with a wand. - */ - public List getRelatives(); - - /** - * Gets the master spark in this network, see registerConnections(). The value this returns - * should be null and the pointer should be eliminated if the spark is no longer present - * in the network. - */ - public ICorporeaSpark getMaster(); - - /** - * Called when an item is extracted from the inventory this spark is attached to through this - * spark. - */ - public void onItemExtracted(ItemStack stack); - - /** - * Called when this spark requests items, passes in the result of the request and not the actual requested stack(s). - */ - public void onItemsRequested(List stacks); - - /** - * Gets if this spark is considered a master spark. - */ - public boolean isMaster(); - - /** - * Gets the network that this spark is on, or the color it's displaying. Sparks may only connect to others - * of the same network, and on changing network should trigger a re-cache of the previous network. - */ - public int getNetwork(); - -} diff --git a/src/api/java/vazkii/botania/api/internal/DummyManaNetwork.java b/src/api/java/vazkii/botania/api/internal/DummyManaNetwork.java deleted file mode 100644 index f74d0ca..0000000 --- a/src/api/java/vazkii/botania/api/internal/DummyManaNetwork.java +++ /dev/null @@ -1,50 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Mar 7, 2014, 3:47:43 PM (GMT)] - */ -package vazkii.botania.api.internal; - -import java.util.ArrayList; -import java.util.List; - -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import vazkii.botania.api.mana.TileSignature; - -public class DummyManaNetwork implements IManaNetwork { - - public static final DummyManaNetwork instance = new DummyManaNetwork(); - - @Override - public void clear() { - // NO-OP - } - - @Override - public TileEntity getClosestPool(ChunkCoordinates pos, World world, int limit) { - return null; - } - - @Override - public TileEntity getClosestCollector(ChunkCoordinates pos, World world, int limit) { - return null; - } - - @Override - public List getAllCollectorsInWorld(World world) { - return new ArrayList(); - } - - @Override - public List getAllPoolsInWorld(World world) { - return new ArrayList(); - } - -} diff --git a/src/api/java/vazkii/botania/api/internal/DummyMethodHandler.java b/src/api/java/vazkii/botania/api/internal/DummyMethodHandler.java deleted file mode 100644 index d8eb343..0000000 --- a/src/api/java/vazkii/botania/api/internal/DummyMethodHandler.java +++ /dev/null @@ -1,224 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Jan 14, 2014, 6:43:03 PM (GMT)] - */ -package vazkii.botania.api.internal; - -import java.util.List; - -import net.minecraft.client.gui.ScaledResolution; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.item.crafting.IRecipe; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.IIcon; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.World; -import vazkii.botania.api.boss.IBotaniaBoss; -import vazkii.botania.api.lexicon.LexiconPage; -import vazkii.botania.api.lexicon.multiblock.MultiblockSet; -import vazkii.botania.api.recipe.RecipeBrew; -import vazkii.botania.api.recipe.RecipeElvenTrade; -import vazkii.botania.api.recipe.RecipeManaInfusion; -import vazkii.botania.api.recipe.RecipePetals; -import vazkii.botania.api.recipe.RecipeRuneAltar; -import vazkii.botania.api.subtile.SubTileEntity; - -public class DummyMethodHandler implements IInternalMethodHandler { - - @Override - public LexiconPage textPage(String key) { - return dummyPage(key); - } - - @Override - public LexiconPage elfPaperTextPage(String key) { - return dummyPage(key); - } - - @Override - public LexiconPage imagePage(String key, String resource) { - return dummyPage(key); - } - - @Override - public LexiconPage craftingRecipesPage(String key, List recipes) { - return dummyPage(key); - } - - @Override - public LexiconPage craftingRecipePage(String key, IRecipe recipe) { - return dummyPage(key); - } - - @Override - public LexiconPage petalRecipesPage(String key, List recipes) { - return dummyPage(key); - } - - @Override - public LexiconPage petalRecipePage(String key, RecipePetals recipe) { - return dummyPage(key); - } - - @Override - public LexiconPage runeRecipesPage(String key, List recipes) { - return dummyPage(key); - } - - @Override - public LexiconPage runeRecipePage(String key, RecipeRuneAltar recipe) { - return dummyPage(key); - } - - @Override - public LexiconPage manaInfusionRecipesPage(String key, List recipes) { - return dummyPage(key); - } - - @Override - public LexiconPage manaInfusionRecipePage(String key, RecipeManaInfusion recipe) { - return dummyPage(key); - } - - @Override - public LexiconPage elvenTradePage(String key, List recipes) { - return dummyPage(key); - } - - @Override - public LexiconPage elvenTradesPage(String key, RecipeElvenTrade recipe) { - return dummyPage(key); - } - - @Override - public LexiconPage brewPage(String key, String bottomText, RecipeBrew recipe) { - return dummyPage(key); - } - - @Override - public LexiconPage multiblockPage(String key, MultiblockSet mb) { - return dummyPage(key); - } - - private LexiconPage dummyPage(String key) { - return new DummyPage(key); - } - - @Override - public ItemStack getSubTileAsStack(String subTile) { - return new ItemStack(Blocks.stone, 0, 0); - } - - @Override - public ItemStack getSubTileAsFloatingFlowerStack(String subTile) { - return getSubTileAsStack(subTile); - } - - @Override - public String getStackSubTileKey(ItemStack stack) { - return null; - } - - @Override - public IIcon getSubTileIconForName(String name) { - return Blocks.red_flower.getIcon(0, 0); - } - - @Override - public void registerBasicSignatureIcons(String name, IIconRegister register) { - // NO-OP - } - - @Override - public IManaNetwork getManaNetworkInstance() { - return DummyManaNetwork.instance; - } - - @Override - public void drawSimpleManaHUD(int color, int mana, int maxMana, String name, ScaledResolution res) { - // NO-OP - } - - @Override - public void drawComplexManaHUD(int color, int mana, int maxMana, String name, ScaledResolution res, ItemStack bindDisplay, boolean properlyBound) { - // NO-OP - } - - @Override - public ItemStack getBindDisplayForFlowerType(SubTileEntity e) { - return new ItemStack(Blocks.stone, 0, 0); - } - - @Override - public void renderLexiconText(int x, int y, int width, int height, String unlocalizedText) { - // NO-OP - } - - @Override - public void sparkleFX(World world, double x, double y, double z, float r, float g, float b, float size, int m) { - // NO-OP - } - - @Override - public IInventory getBaublesInventory(EntityPlayer player) { - return null; - } - - @Override - public boolean shouldForceCheck() { - return true; - } - - @Override - public int getPassiveFlowerDecay() { - return 0; - } - - @Override - public ResourceLocation getDefaultBossBarTexture() { - return null; - } - - @Override - public void setBossStatus(IBotaniaBoss status) { - // NO-OP - } - - @Override - public boolean isBuildcraftPipe(TileEntity tile) { - return false; - } - - - @Override - public void breakOnAllCursors(EntityPlayer player, Item item, ItemStack stack, int x, int y, int z, int side) { - // NO-OP - } - - @Override - public long getWorldElapsedTicks() { - return 0; - } - - @Override - public boolean isBotaniaFlower(World world, int x, int y, int z) { - return false; - } - - @Override - public void sendBaubleUpdatePacket(EntityPlayer player, int slot) { - // NO-OP - } - -} diff --git a/src/api/java/vazkii/botania/api/internal/DummyPage.java b/src/api/java/vazkii/botania/api/internal/DummyPage.java deleted file mode 100644 index 843198c..0000000 --- a/src/api/java/vazkii/botania/api/internal/DummyPage.java +++ /dev/null @@ -1,34 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Jan 14, 2014, 6:41:23 PM (GMT)] - */ -package vazkii.botania.api.internal; - -import vazkii.botania.api.lexicon.LexiconPage; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -/** - * A dummy page. It does absolutely nothing and is only - * existant to make sure everything goes right even if - * Botania isn't loaded. - */ -public class DummyPage extends LexiconPage { - - public DummyPage(String unlocalizedName) { - super(unlocalizedName); - } - - @Override - @SideOnly(Side.CLIENT) - public void renderScreen(IGuiLexiconEntry gui, int x, int y) { - // NO-OP - } - -} diff --git a/src/api/java/vazkii/botania/api/internal/DummySubTile.java b/src/api/java/vazkii/botania/api/internal/DummySubTile.java deleted file mode 100644 index d8ac6ab..0000000 --- a/src/api/java/vazkii/botania/api/internal/DummySubTile.java +++ /dev/null @@ -1,17 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Jan 24, 2014, 4:17:33 PM (GMT)] - */ -package vazkii.botania.api.internal; - -import vazkii.botania.api.subtile.SubTileEntity; - -public class DummySubTile extends SubTileEntity { - -} diff --git a/src/api/java/vazkii/botania/api/internal/IGuiLexiconEntry.java b/src/api/java/vazkii/botania/api/internal/IGuiLexiconEntry.java deleted file mode 100644 index b0d4d6e..0000000 --- a/src/api/java/vazkii/botania/api/internal/IGuiLexiconEntry.java +++ /dev/null @@ -1,81 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Jan 14, 2014, 6:48:41 PM (GMT)] - */ -package vazkii.botania.api.internal; - -import java.util.List; - -import net.minecraft.client.gui.GuiButton; -import vazkii.botania.api.lexicon.LexiconEntry; - -/** - * Internal interface for the Lexicon Entry GUI. This contains - * everything that can be accessed from it. It's safe to cast - * this type to GuiScreen. - */ -public interface IGuiLexiconEntry { - - /** - * Gets the entry currently portrayed in this gui. - */ - public LexiconEntry getEntry(); - - /** - * Gets the current page the lexicon GUI is browsing. - */ - public int getPageOn(); - - /** - * Gets the leftmost part of the GUI. - */ - public int getLeft(); - - /** - * Gets the topmost part of the GUI. - */ - public int getTop(); - - /** - * Gets the GUI's width. - */ - public int getWidth(); - - /** - * Gets the GUI's height - */ - public int getHeight(); - - /** - * Gets the GUI's Z level for rendering. - */ - public float getZLevel(); - - /** - * Gets the list of buttons in this gui. - */ - public List getButtonList(); - - /** - * Gets the total amount of ticks (+ partial ticks) the player - * has been in this gui. - */ - public float getElapsedTicks(); - - /** - * Gets the current partial ticks. - */ - public float getPartialTicks(); - - /** - * Gets the delta (1F = 1 tick) between this render call - * and the last one. - */ - public float getTickDelta(); -} diff --git a/src/api/java/vazkii/botania/api/internal/IInternalMethodHandler.java b/src/api/java/vazkii/botania/api/internal/IInternalMethodHandler.java deleted file mode 100644 index 9061812..0000000 --- a/src/api/java/vazkii/botania/api/internal/IInternalMethodHandler.java +++ /dev/null @@ -1,125 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Jan 14, 2014, 6:34:34 PM (GMT)] - */ -package vazkii.botania.api.internal; - -import java.util.List; - -import net.minecraft.client.gui.ScaledResolution; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.item.crafting.IRecipe; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.IIcon; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.World; -import vazkii.botania.api.boss.IBotaniaBoss; -import vazkii.botania.api.lexicon.LexiconPage; -import vazkii.botania.api.lexicon.multiblock.MultiblockSet; -import vazkii.botania.api.recipe.RecipeBrew; -import vazkii.botania.api.recipe.RecipeElvenTrade; -import vazkii.botania.api.recipe.RecipeManaInfusion; -import vazkii.botania.api.recipe.RecipePetals; -import vazkii.botania.api.recipe.RecipeRuneAltar; -import vazkii.botania.api.subtile.SubTileEntity; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -/** - * Any methods that refer to internal methods in Botania are here. - * This is defaulted to a dummy handler, whose methods do nothing. - * This handler is set to a proper one on PreInit. Make sure to - * make your mod load after Botania if you have any intention of - * doing anythign with this on PreInit. - */ -public interface IInternalMethodHandler { - - public LexiconPage textPage(String key); - - public LexiconPage elfPaperTextPage(String key); - - public LexiconPage imagePage(String key, String resource); - - public LexiconPage craftingRecipesPage(String key, List recipes); - - public LexiconPage craftingRecipePage(String key, IRecipe recipe); - - public LexiconPage petalRecipesPage(String key, List recipes); - - public LexiconPage petalRecipePage(String key, RecipePetals recipe); - - public LexiconPage runeRecipesPage(String key, List recipes); - - public LexiconPage runeRecipePage(String key, RecipeRuneAltar recipe); - - public LexiconPage manaInfusionRecipesPage(String key, List recipes); - - public LexiconPage manaInfusionRecipePage(String key, RecipeManaInfusion recipe); - - public LexiconPage elvenTradePage(String key, List recipes); - - public LexiconPage elvenTradesPage(String key, RecipeElvenTrade recipe); - - public LexiconPage brewPage(String key, String bottomText, RecipeBrew recipe); - - public LexiconPage multiblockPage(String key, MultiblockSet mb); - - public IManaNetwork getManaNetworkInstance(); - - public ItemStack getSubTileAsStack(String subTile); - - public ItemStack getSubTileAsFloatingFlowerStack(String subTile); - - public String getStackSubTileKey(ItemStack stack); - - public IIcon getSubTileIconForName(String name); - - public void registerBasicSignatureIcons(String name, IIconRegister register); - - public boolean shouldForceCheck(); - - public int getPassiveFlowerDecay(); - - public IInventory getBaublesInventory(EntityPlayer player); - - public void breakOnAllCursors(EntityPlayer player, Item item, ItemStack stack, int x, int y, int z, int side); - - @SideOnly(Side.CLIENT) - public void drawSimpleManaHUD(int color, int mana, int maxMana, String name, ScaledResolution res); - - @SideOnly(Side.CLIENT) - public void drawComplexManaHUD(int color, int mana, int maxMana, String name, ScaledResolution res, ItemStack bindDisplay, boolean properlyBound); - - @SideOnly(Side.CLIENT) - public ItemStack getBindDisplayForFlowerType(SubTileEntity e); - - @SideOnly(Side.CLIENT) - public void renderLexiconText(int x, int y, int width, int height, String unlocalizedText); - - @SideOnly(Side.CLIENT) - public ResourceLocation getDefaultBossBarTexture(); - - @SideOnly(Side.CLIENT) - public void setBossStatus(IBotaniaBoss status); - - public boolean isBuildcraftPipe(TileEntity tile); - - public void sparkleFX(World world, double x, double y, double z, float r, float g, float b, float size, int m); - - public long getWorldElapsedTicks(); - - public boolean isBotaniaFlower(World world, int x, int y, int z); - - public void sendBaubleUpdatePacket(EntityPlayer player, int slot); - -} diff --git a/src/api/java/vazkii/botania/api/internal/IManaBurst.java b/src/api/java/vazkii/botania/api/internal/IManaBurst.java deleted file mode 100644 index 945aa99..0000000 --- a/src/api/java/vazkii/botania/api/internal/IManaBurst.java +++ /dev/null @@ -1,73 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Jan 31, 2014, 4:36:13 PM (GMT)] - */ -package vazkii.botania.api.internal; - -import java.util.UUID; - -import net.minecraft.item.ItemStack; -import net.minecraft.util.ChunkCoordinates; - -/** - * Interface for the Mana Burst entity. This can safely be casted to EntityThrowable. - */ -public interface IManaBurst { - - public boolean isFake(); - - public void setMotion(double x, double y, double z); - - public int getColor(); - - public void setColor(int color); - - public int getMana(); - - public void setMana(int mana); - - public int getStartingMana(); - - public void setStartingMana(int mana); - - public int getMinManaLoss(); - - public void setMinManaLoss(int minManaLoss); - - public float getManaLossPerTick(); - - public void setManaLossPerTick(float mana); - - public float getGravity(); - - public void setGravity(float gravity); - - public ChunkCoordinates getBurstSourceChunkCoordinates(); - - public void setBurstSourceCoords(int x, int y, int z); - - public ItemStack getSourceLens(); - - public void setSourceLens(ItemStack lens); - - public boolean hasAlreadyCollidedAt(int x, int y, int z); - - public void setCollidedAt(int x, int y, int z); - - public int getTicksExisted(); - - public void setFake(boolean fake); - - public void setShooterUUID(UUID uuid); - - public UUID getShooterUIID(); - - public void ping(); - -} diff --git a/src/api/java/vazkii/botania/api/internal/IManaNetwork.java b/src/api/java/vazkii/botania/api/internal/IManaNetwork.java deleted file mode 100644 index fc4553e..0000000 --- a/src/api/java/vazkii/botania/api/internal/IManaNetwork.java +++ /dev/null @@ -1,67 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Mar 7, 2014, 3:39:48 PM (GMT)] - */ -package vazkii.botania.api.internal; - -import java.util.List; - -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import vazkii.botania.api.mana.TileSignature; - -/** - * A basic interface for a world's Mana Network. - * @see IInternalMethodHandler#getManaNetworkInstance() - */ -public interface IManaNetwork { - - /** - * Clears the entire Mana Network of all it's contents, you probably - * don't want to call this unless you have a very good reason. - */ - public void clear(); - - /** - * Gets the closest Mana Collector (eg. Mana Spreader) in the network to the Chunk - * Coordinates passed in, in the given dimension.
    - * A way of getting the dimension is via worldObj.provider.dimensionId
    - * Note that this function *can* get performance intensive, it's reccomended you - * call it sparingly and take cache of the value returned. - * @param limit The maximum distance the closest block can be, if the closest block - * is farther away than that, null will be returned instead. - */ - public TileEntity getClosestCollector(ChunkCoordinates pos, World world, int limit); - - /** - * Gets the closest Mana Pool in the network to the Chunk Coordinates passed in, - * in the given dimension.
    - * A way of getting the dimension is via worldObj.provider.dimensionId
    - * Note that this function *can* get performance intensive, it's reccomended you - * call it sparingly and take cache of the value returned. - * @param limit The maximum distance the closest block can be, if the closest block - * is farther away than that, null will be returned instead. - */ - public TileEntity getClosestPool(ChunkCoordinates pos, World world, int limit); - - /** - * Gets the list of all Mana Collectors (eg. Mana Spreader) in the dimension - * passed in. Note that this is the actual list and not a copy, make sure to - * clone the list if you intend to change it in any way. - */ - public List getAllCollectorsInWorld(World world); - - /** - * Gets the list of all Mana Pools in the dimension passed in. Note that this - * is the actual list and not a copy, make sure to clone the list if you intend - * to change it in any way. - */ - public List getAllPoolsInWorld(World world); -} diff --git a/src/api/java/vazkii/botania/api/internal/ShaderCallback.java b/src/api/java/vazkii/botania/api/internal/ShaderCallback.java deleted file mode 100644 index 12186a2..0000000 --- a/src/api/java/vazkii/botania/api/internal/ShaderCallback.java +++ /dev/null @@ -1,20 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Oct 29, 2014, 6:31:35 PM (GMT)] - */ -package vazkii.botania.api.internal; - -/** - * A Callback for when a shader is called. Used to define shader uniforms. - */ -public abstract class ShaderCallback { - - public abstract void call(int shader); - -} diff --git a/src/api/java/vazkii/botania/api/internal/VanillaPacketDispatcher.java b/src/api/java/vazkii/botania/api/internal/VanillaPacketDispatcher.java deleted file mode 100644 index dff8b96..0000000 --- a/src/api/java/vazkii/botania/api/internal/VanillaPacketDispatcher.java +++ /dev/null @@ -1,42 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Apr 9, 2015, 9:38:44 PM (GMT)] - */ -package vazkii.botania.api.internal; - -import java.util.List; - -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; - -public final class VanillaPacketDispatcher { - - public static void dispatchTEToNearbyPlayers(TileEntity tile) { - World world = tile.getWorldObj(); - List players = world.playerEntities; - for(Object player : players) - if(player instanceof EntityPlayerMP) { - EntityPlayerMP mp = (EntityPlayerMP) player; - if(pointDistancePlane(mp.posX, mp.posZ, tile.xCoord + 0.5, tile.zCoord + 0.5) < 64) - ((EntityPlayerMP) player).playerNetServerHandler.sendPacket(tile.getDescriptionPacket()); - } - } - - public static void dispatchTEToNearbyPlayers(World world, int x, int y, int z) { - TileEntity tile = world.getTileEntity(x, y, z); - if(tile != null) - dispatchTEToNearbyPlayers(tile); - } - - public static float pointDistancePlane(double x1, double y1, double x2, double y2) { - return (float) Math.hypot(x1 - x2, y1 - y2); - } - -} diff --git a/src/api/java/vazkii/botania/api/item/IAncientWillContainer.java b/src/api/java/vazkii/botania/api/item/IAncientWillContainer.java deleted file mode 100644 index 2d2abe2..0000000 --- a/src/api/java/vazkii/botania/api/item/IAncientWillContainer.java +++ /dev/null @@ -1,25 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Jan 30, 2015, 11:24:54 PM (GMT)] - */ -package vazkii.botania.api.item; - -import net.minecraft.item.ItemStack; - -/** - * An item that implements this can have Ancient Wills - * crafted onto it. - */ -public interface IAncientWillContainer { - - public void addAncientWill(ItemStack stack, int will); - - public boolean hasAncientWill(ItemStack stack, int will); - -} diff --git a/src/api/java/vazkii/botania/api/item/IBaubleRender.java b/src/api/java/vazkii/botania/api/item/IBaubleRender.java deleted file mode 100644 index 7cc492a..0000000 --- a/src/api/java/vazkii/botania/api/item/IBaubleRender.java +++ /dev/null @@ -1,77 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Dec 4, 2014, 3:28:43 PM (GMT)] - */ -package vazkii.botania.api.item; - -import net.minecraft.client.Minecraft; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraftforge.client.event.RenderPlayerEvent; - -import org.lwjgl.opengl.GL11; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -/** - * A Bauble Item that implements this will be have hooks to render something on - * the player while its equipped. - * This class doesn't extend IBauble to make the API not depend on the Baubles - * API, but the item in question still needs to implement IBauble. - */ -public interface IBaubleRender { - - /** - * Called for the rendering of the bauble on the player. The player instance can be - * acquired through the event parameter. Transformations are already applied for - * the RenderType passed in. Make sure to check against the type parameter for - * rendering. Will not be called if the item is a ICosmeticAttachable and - * has a cosmetic bauble attached to it. - */ - @SideOnly(Side.CLIENT) - public void onPlayerBaubleRender(ItemStack stack, RenderPlayerEvent event, RenderType type); - - /** - * A few helper methods for the render. - */ - public static class Helper { - - public static void rotateIfSneaking(EntityPlayer player) { - if(player.isSneaking()) - applySneakingRotation(); - } - - public static void applySneakingRotation() { - GL11.glRotatef(28.64789F, 1.0F, 0.0F, 0.0F); - } - - public static void translateToHeadLevel(EntityPlayer player) { - GL11.glTranslated(0, (player != Minecraft.getMinecraft().thePlayer ? 1.62F : 0F) - player.getDefaultEyeHeight() + (player.isSneaking() ? 0.0625 : 0), 0); - } - - } - - public static enum RenderType { - /** - * Render Type for the player's body, translations apply on the player's rotation. - * Sneaking is not handled and should be done during the render. - * @see IBaubleRender.Helper - */ - BODY, - - /** - * Render Type for the player's body, translations apply on the player's head rotations. - * Sneaking is not handled and should be done during the render.~ - * @see IBaubleRender.Helper - */ - HEAD; - } - -} diff --git a/src/api/java/vazkii/botania/api/item/IBlockProvider.java b/src/api/java/vazkii/botania/api/item/IBlockProvider.java deleted file mode 100644 index 42f2e3f..0000000 --- a/src/api/java/vazkii/botania/api/item/IBlockProvider.java +++ /dev/null @@ -1,40 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Aug 20, 2015, 10:31:54 PM (GMT)] - */ -package vazkii.botania.api.item; - -import net.minecraft.block.Block; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; - -/** - * An Item that implements this can provide blocks to other items that use them. - * For example, the Black Hole Talisman implements this in order to allow for - * the Rod of the Shifting Crust to pull blocks from it. - */ -public interface IBlockProvider { - - /** - * Provides the requested item. The doit paremeter specifies whether this is - * just a test (false) or if the item should actually be removed (true). - * If you need to use calls to ManaItemHandler.requestMana[Exact], use - * the requestor as the ItemStack passed in. - */ - public boolean provideBlock(EntityPlayer player, ItemStack requestor, ItemStack stack, Block block, int meta, boolean doit); - - /** - * Gets the amount of blocks of the type passed stored in this item. You must - * check for the block passed in to not give the counter for a wrong block. Returning - * -1 states that the item can provide infinite of the item passed in (for example, - * the Rod of the Lands would return -1 if the block is dirt). - */ - public int getBlockCount(EntityPlayer player, ItemStack requestor, ItemStack stack, Block block, int meta); - -} diff --git a/src/api/java/vazkii/botania/api/item/IBurstViewerBauble.java b/src/api/java/vazkii/botania/api/item/IBurstViewerBauble.java deleted file mode 100644 index 4402a71..0000000 --- a/src/api/java/vazkii/botania/api/item/IBurstViewerBauble.java +++ /dev/null @@ -1,20 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Jan 24, 2015, 3:08:40 PM (GMT)] - */ -package vazkii.botania.api.item; - -/** - * Base Interface for the Manaseer Monocle and items of the sort. - * Having a IBauble of this type equipped on the 0th slot (amulet) - * will draw bursts without depth testing and to see sub tile radiuses. - */ -public interface IBurstViewerBauble { - -} diff --git a/src/api/java/vazkii/botania/api/item/ICosmeticAttachable.java b/src/api/java/vazkii/botania/api/item/ICosmeticAttachable.java deleted file mode 100644 index 4fbee0e..0000000 --- a/src/api/java/vazkii/botania/api/item/ICosmeticAttachable.java +++ /dev/null @@ -1,33 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Feb 22, 2015, 8:31:39 PM (GMT)] - */ -package vazkii.botania.api.item; - -import net.minecraft.item.ItemStack; - -/** - * An Item that implements this interface can have cosmetic items attached to it. - * The item does not have to be a bauble, but it is the render is automatically - * handled by botania internally. Recipes to add and remove the cosmetic items will be - * handled internally, but the cosmetic item has to be set as a container item. - */ -public interface ICosmeticAttachable { - - /** - * Gets the cosmetic item stored in the stack passed in. - */ - public ItemStack getCosmeticItem(ItemStack stack); - - /** - * Sets the stack's cosmetic item to the one passed in. - */ - public void setCosmeticItem(ItemStack stack, ItemStack cosmetic); - -} diff --git a/src/api/java/vazkii/botania/api/item/ICosmeticBauble.java b/src/api/java/vazkii/botania/api/item/ICosmeticBauble.java deleted file mode 100644 index d488ad4..0000000 --- a/src/api/java/vazkii/botania/api/item/ICosmeticBauble.java +++ /dev/null @@ -1,20 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Feb 22, 2015, 2:02:02 PM (GMT)] - */ -package vazkii.botania.api.item; - -/** - * A bauble that counts as a cosmetic only item. These can be added to - * other baubles to add the render to them. Other cosmetic baubles - * can't be stacked on this. - */ -public interface ICosmeticBauble extends IBaubleRender { - -} diff --git a/src/api/java/vazkii/botania/api/item/IDyablePool.java b/src/api/java/vazkii/botania/api/item/IDyablePool.java deleted file mode 100644 index 8bb8e94..0000000 --- a/src/api/java/vazkii/botania/api/item/IDyablePool.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Jan 18, 2015, 12:20:44 AM (GMT)] - */ -package vazkii.botania.api.item; - - -/** - * Used to define a Mana Pool that can be dyed through floral powder. - */ -public interface IDyablePool { - - public int getColor(); - - public void setColor(int color); - - -} diff --git a/src/api/java/vazkii/botania/api/item/IExoflameHeatable.java b/src/api/java/vazkii/botania/api/item/IExoflameHeatable.java deleted file mode 100644 index bd00734..0000000 --- a/src/api/java/vazkii/botania/api/item/IExoflameHeatable.java +++ /dev/null @@ -1,43 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Aug 30, 2014, 4:28:29 PM (GMT)] - */ -package vazkii.botania.api.item; - -/** - * A TileEntity that implements this can be heated by an Exoflame flower. - */ -public interface IExoflameHeatable { - - /** - * Can this TileEntity smelt its contents. If true, the Exoflame is allowed - * to fuel it. - */ - public boolean canSmelt(); - - /** - * Gets the amount of ticks left for the fuel. If below 2, the exoflame - * will call boostBurnTime. - */ - public int getBurnTime(); - - /** - * Called to increase the amount of time this furnace should be burning - * the fuel for. Even if it doesn't have any fuel. - */ - public void boostBurnTime(); - - /** - * Called once every two ticks to increase the speed of the furnace. Feel - * free to not do anything if all you want is to allow the exoflame to feed - * it, not make it faster. - */ - public void boostCookTime(); - -} diff --git a/src/api/java/vazkii/botania/api/item/IExtendedPlayerController.java b/src/api/java/vazkii/botania/api/item/IExtendedPlayerController.java deleted file mode 100644 index e07d076..0000000 --- a/src/api/java/vazkii/botania/api/item/IExtendedPlayerController.java +++ /dev/null @@ -1,28 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Aug 6, 2014, 6:02:29 PM (GMT)] - */ -package vazkii.botania.api.item; - -/** - * An interface that defines an instance of PlayerControllerMP with - * the ability to modify reach. See vazkii.botania.client.core.handler.BotaniaPlayerController - */ -public interface IExtendedPlayerController { - - /** - * Sets the extra reach the player should have. - */ - public void setReachDistanceExtension(float f); - - /** - * Gets the current reach extension. - */ - public float getReachDistanceExtension(); -} diff --git a/src/api/java/vazkii/botania/api/item/IExtendedWireframeCoordinateListProvider.java b/src/api/java/vazkii/botania/api/item/IExtendedWireframeCoordinateListProvider.java deleted file mode 100644 index 7713eaa..0000000 --- a/src/api/java/vazkii/botania/api/item/IExtendedWireframeCoordinateListProvider.java +++ /dev/null @@ -1,28 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Apr 30, 2015, 1:43:17 PM (GMT)] - */ -package vazkii.botania.api.item; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.util.ChunkCoordinates; - -/** - * An extension of IWireframeCoordinateListProvider that allows for - * rendering a single thicker wireframe. - */ -public interface IExtendedWireframeCoordinateListProvider extends IWireframeCoordinateListProvider { - - /** - * Gets the source wireframe to draw, this one will be drawn thicker. - */ - public ChunkCoordinates getSourceWireframe(EntityPlayer player, ItemStack stack); - -} diff --git a/src/api/java/vazkii/botania/api/item/IFlowerlessBiome.java b/src/api/java/vazkii/botania/api/item/IFlowerlessBiome.java deleted file mode 100644 index 16543e4..0000000 --- a/src/api/java/vazkii/botania/api/item/IFlowerlessBiome.java +++ /dev/null @@ -1,21 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [? (GMT)] - */ -package vazkii.botania.api.item; -import net.minecraft.world.World; -/** - * A BiomeGenBase that implements this will not have Botania flowers generated. - */ -public interface IFlowerlessBiome { - /** - * @return Should this world be allowed to generate flowers? - */ - public boolean canGenerateFlowers(World world, int x, int z); -} \ No newline at end of file diff --git a/src/api/java/vazkii/botania/api/item/IFlowerlessWorld.java b/src/api/java/vazkii/botania/api/item/IFlowerlessWorld.java deleted file mode 100644 index 5d25d79..0000000 --- a/src/api/java/vazkii/botania/api/item/IFlowerlessWorld.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [? (GMT)] - */ -package vazkii.botania.api.item; - -import net.minecraft.world.World; - -/** - * A WorldProvider that implements this will not have Botania flowers generated. - */ -public interface IFlowerlessWorld { - - /** - * @return Should this world be allowed to generate flowers? - */ - public boolean generateFlowers(World world); -} diff --git a/src/api/java/vazkii/botania/api/item/IGrassHornExcempt.java b/src/api/java/vazkii/botania/api/item/IGrassHornExcempt.java deleted file mode 100644 index b23774c..0000000 --- a/src/api/java/vazkii/botania/api/item/IGrassHornExcempt.java +++ /dev/null @@ -1,23 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Oct 29, 2014, 4:52:04 PM (GMT)] - */ -package vazkii.botania.api.item; - -import net.minecraft.world.World; - -/** - * A BlockBush can implement this to check if it can be broken - * by a Horn/Drum of the Wild or not. - */ -public interface IGrassHornExcempt { - - public boolean canUproot(World world, int x, int y, int z); - -} diff --git a/src/api/java/vazkii/botania/api/item/IManaDissolvable.java b/src/api/java/vazkii/botania/api/item/IManaDissolvable.java deleted file mode 100644 index 0d9ad5d..0000000 --- a/src/api/java/vazkii/botania/api/item/IManaDissolvable.java +++ /dev/null @@ -1,29 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Jan 18, 2015, 12:10:00 AM (GMT)] - */ -package vazkii.botania.api.item; - -import net.minecraft.entity.item.EntityItem; -import net.minecraft.item.ItemStack; -import vazkii.botania.api.mana.IManaPool; - -/** - * An item that implements this will have a function called when its standing atop - * a mana pool. - */ -public interface IManaDissolvable { - - /** - * Called for every tick the item is on a mana pool. If the stack has stack - * size 0 the item is killed. This is called in both the server and client. - */ - public void onDissolveTick(IManaPool pool, ItemStack stack, EntityItem item); - -} diff --git a/src/api/java/vazkii/botania/api/item/IManaProficiencyArmor.java b/src/api/java/vazkii/botania/api/item/IManaProficiencyArmor.java deleted file mode 100644 index 595e800..0000000 --- a/src/api/java/vazkii/botania/api/item/IManaProficiencyArmor.java +++ /dev/null @@ -1,44 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Aug 28, 2015, 9:04:53 PM (GMT)] - */ -package vazkii.botania.api.item; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; - -/** - * An armor item that implements this gives the player wearing it mana proficiency, by - * which it makes Rods the player use have a stronger effect. This is a boolean, and only - * one armor piece with this returning true is required for the player to be considered - * to be having proficiency, by which it's suggested that this is used alongside an - * armor set, where only one piece implements it. - */ -public interface IManaProficiencyArmor { - - public boolean shouldGiveProficiency(ItemStack stack, int slot, EntityPlayer player); - - public final static class Helper { - - public static boolean hasProficiency(EntityPlayer player) { - for(int i = 0; i < 4; i++) { - ItemStack armor = player.getCurrentArmor(i); - if(armor != null) { - Item item = armor.getItem(); - if(item instanceof IManaProficiencyArmor && ((IManaProficiencyArmor) item).shouldGiveProficiency(armor, i, player)) - return true; - } - } - return false; - } - - } - -} diff --git a/src/api/java/vazkii/botania/api/item/IPetalApothecary.java b/src/api/java/vazkii/botania/api/item/IPetalApothecary.java deleted file mode 100644 index 15ae69c..0000000 --- a/src/api/java/vazkii/botania/api/item/IPetalApothecary.java +++ /dev/null @@ -1,29 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Aug 30, 2014, 4:22:15 PM (GMT)] - */ -package vazkii.botania.api.item; - -/** - * Base Interface for the Petal Apothecary block. Can - * be safely casted to TileEntity. - */ -public interface IPetalApothecary { - - /** - * Sets if the the apothecary has water or not. - */ - public void setWater(boolean water); - - /** - * Does the apothecary have water in it? - */ - public boolean hasWater(); - -} diff --git a/src/api/java/vazkii/botania/api/item/IPhantomInkable.java b/src/api/java/vazkii/botania/api/item/IPhantomInkable.java deleted file mode 100644 index dc2f397..0000000 --- a/src/api/java/vazkii/botania/api/item/IPhantomInkable.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Mar 17, 2015, 4:57:44 PM (GMT)] - */ -package vazkii.botania.api.item; - -import net.minecraft.item.ItemStack; - -/** - * An Item that implements this can be crafted with Phantom Ink. - */ -public interface IPhantomInkable { - - public boolean hasPhantomInk(ItemStack stack); - - public void setPhantomInk(ItemStack stack, boolean ink); - -} diff --git a/src/api/java/vazkii/botania/api/item/IPixieSpawner.java b/src/api/java/vazkii/botania/api/item/IPixieSpawner.java deleted file mode 100644 index de8c973..0000000 --- a/src/api/java/vazkii/botania/api/item/IPixieSpawner.java +++ /dev/null @@ -1,29 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Aug 6, 2014, 6:06:27 PM (GMT)] - */ -package vazkii.botania.api.item; - -import net.minecraft.item.ItemStack; - -/** - * Any item that implements this allows for pixies to be spawned when the player takes damage when...
    - * - Case the item is armor, having it equipped.
    - * - Case the item is a bauble, having it worn.
    - * - On any other case, having the item being the current held item. - */ -public interface IPixieSpawner { - - /** - * The chance this item adds for pixies to be spawned. From 0.0 to 1.0. All values - * are put together when calculating. - */ - public float getPixieChance(ItemStack stack); - -} \ No newline at end of file diff --git a/src/api/java/vazkii/botania/api/item/IRelic.java b/src/api/java/vazkii/botania/api/item/IRelic.java deleted file mode 100644 index aecd1cd..0000000 --- a/src/api/java/vazkii/botania/api/item/IRelic.java +++ /dev/null @@ -1,42 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Mar 29, 2015, 7:17:41 PM (GMT)] - */ -package vazkii.botania.api.item; - -import net.minecraft.item.ItemStack; -import net.minecraft.stats.Achievement; - -/** - * An item that implements this counts as a Relic item. This is purely for interaction - * and other mod items should not implement this interface. - */ -public interface IRelic { - - /** - * Binds to the player name passed in. - */ - public void bindToUsername(String playerName, ItemStack stack); - - /** - * Gets the username of the person this relic is bound to. - */ - public String getSoulbindUsername(ItemStack stack); - - /** - * Sets the achievement that this relic binds to. - */ - public void setBindAchievement(Achievement achievement); - - /** - * Gets the achievement that this relic binds to. - */ - public Achievement getBindAchievement(); - -} diff --git a/src/api/java/vazkii/botania/api/item/ISequentialBreaker.java b/src/api/java/vazkii/botania/api/item/ISequentialBreaker.java deleted file mode 100644 index 87af2d0..0000000 --- a/src/api/java/vazkii/botania/api/item/ISequentialBreaker.java +++ /dev/null @@ -1,27 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Mar 30, 2015, 2:46:05 PM (GMT)] - */ -package vazkii.botania.api.item; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; - -/** - * An item that implements this can break multiple blocks at once - * with a Ring of Loki. Usage of this interface requires an implementation - * (see ItemTerraPick). - */ -public interface ISequentialBreaker { - - public void breakOtherBlock(EntityPlayer player, ItemStack stack, int x, int y, int z, int originX, int originY, int originZ, int side); - - public boolean disposeOfTrashBlocks(ItemStack stack); - -} diff --git a/src/api/java/vazkii/botania/api/item/ISortableTool.java b/src/api/java/vazkii/botania/api/item/ISortableTool.java deleted file mode 100644 index af450bc..0000000 --- a/src/api/java/vazkii/botania/api/item/ISortableTool.java +++ /dev/null @@ -1,47 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Feb 23, 2015, 7:03:48 PM (GMT)] - */ -package vazkii.botania.api.item; - -import net.minecraft.item.ItemStack; - -/** - * This interface describes a tool that can be sorted by the Ring of - * Correction. - */ -public interface ISortableTool { - - /** - * Gets the type of tool that this is. A pick, axe or shovel. - */ - public ToolType getSortingType(ItemStack stack); - - /** - * Gets the priority that this tool should have when being sorted. The - * tool with the highest priority will be picked. The way this is specified - * should be (tool-level) * 100 + (tool-modifier) * 10 + (efficiency-level). - *

    - * For example, a Manasteel Pickaxe is tool-level 10 and it doesn't have - * modifiers. Assuming Efficiency 4, the priority should be 10 * 100 + 4 = 1004. - * This will rate higher than a similar pickaxe with Efficiency 3.
    - * A Terra Shatterer has a modifier, its rank and is tool-level 20. With Efficiency - * 5 and rank B (2) the priority should be 20 * 100 + 2 * 10 + 5 = 2025. - *

    - * All intermediate tool levels are there for other mod tools that wish to occupy the spots inbetween. - * Of course, you don't have to always adhere to this. Tools like the Vitreous Pickaxe don't, - * that one in particular is priority 0 so it's never picked. - */ - public int getSortingPriority(ItemStack stack); - - public static enum ToolType { - PICK, AXE, SHOVEL - } - -} \ No newline at end of file diff --git a/src/api/java/vazkii/botania/api/item/IWireframeCoordinateListProvider.java b/src/api/java/vazkii/botania/api/item/IWireframeCoordinateListProvider.java deleted file mode 100644 index ae0863c..0000000 --- a/src/api/java/vazkii/botania/api/item/IWireframeCoordinateListProvider.java +++ /dev/null @@ -1,35 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Mar 29, 2015, 11:30:41 PM (GMT)] - */ -package vazkii.botania.api.item; - -import java.util.List; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.util.ChunkCoordinates; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -/** - * An item that implements this will allow for various wireframes to be drawn - * around the player. This will be called while the item is in the inventory, - * armor slot or bauble slots. - */ -public interface IWireframeCoordinateListProvider { - - /** - * Returns a list of ChunkCoordinates for the wireframes to draw. - * Can be null. - */ - @SideOnly(Side.CLIENT) - public List getWireframesToDraw(EntityPlayer player, ItemStack stack); - -} diff --git a/src/api/java/vazkii/botania/api/item/TinyPotatoRenderEvent.java b/src/api/java/vazkii/botania/api/item/TinyPotatoRenderEvent.java deleted file mode 100644 index 8b51c26..0000000 --- a/src/api/java/vazkii/botania/api/item/TinyPotatoRenderEvent.java +++ /dev/null @@ -1,38 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Jul 25, 2015, 8:02:41 PM (GMT)] - */ -package vazkii.botania.api.item; - -import net.minecraft.tileentity.TileEntity; -import cpw.mods.fml.common.eventhandler.Event; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -/** - * Why would you ever want this ._. - */ -@SideOnly(Side.CLIENT) -public class TinyPotatoRenderEvent extends Event { - - public final TileEntity tile; - public final String name; - public final double x, y, z; - public final float partTicks; - - public TinyPotatoRenderEvent(TileEntity tile, String name, double x, double y, double z, float partTicks) { - this.tile = tile; - this.name = name; - this.x = x; - this.y = y; - this.z = z; - this.partTicks = partTicks; - } - -} diff --git a/src/api/java/vazkii/botania/api/lexicon/IAddonEntry.java b/src/api/java/vazkii/botania/api/lexicon/IAddonEntry.java deleted file mode 100644 index a92e608..0000000 --- a/src/api/java/vazkii/botania/api/lexicon/IAddonEntry.java +++ /dev/null @@ -1,28 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Jun 8, 2014, 7:02:48 PM (GMT)] - */ -package vazkii.botania.api.lexicon; - -/** - * Have a LexiconEntry implement this to signify it's an "Addon entry", as - * in, one provided by an Addon. This allows it to draw a subtitle of - * sorts, to prevent the [Mod tag here] nonsense that happened with thaumcraft - * addons. It can also be used for other purposes, such as stating an - * entry is WIP. - */ -public interface IAddonEntry { - - /** - * Returns the unlocalized subtitle to show below the title. Here you'd - * return something like "(This Entry is provided by the Botanic Tinkerer addon)". - */ - public String getSubtitle(); - -} diff --git a/src/api/java/vazkii/botania/api/lexicon/ILexicon.java b/src/api/java/vazkii/botania/api/lexicon/ILexicon.java deleted file mode 100644 index ee07e17..0000000 --- a/src/api/java/vazkii/botania/api/lexicon/ILexicon.java +++ /dev/null @@ -1,21 +0,0 @@ -package vazkii.botania.api.lexicon; - -import net.minecraft.item.ItemStack; - -/** - * Basic interface for the Lexica Botania. - */ -public interface ILexicon { - - /** - * Gets if a specific knowledge is unlocked. Check the knowledge types in - * BotaniaAPI. - */ - public boolean isKnowledgeUnlocked(ItemStack stack, KnowledgeType knowledge); - - /** - * Unlocks a specfic type of knowledge. - */ - public void unlockKnowledge(ItemStack stack, KnowledgeType knowledge); - -} diff --git a/src/api/java/vazkii/botania/api/lexicon/ILexiconable.java b/src/api/java/vazkii/botania/api/lexicon/ILexiconable.java deleted file mode 100644 index 5baff9f..0000000 --- a/src/api/java/vazkii/botania/api/lexicon/ILexiconable.java +++ /dev/null @@ -1,28 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Jan 20, 2014, 7:05:44 PM (GMT)] - */ -package vazkii.botania.api.lexicon; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; - -/** - * Any block that implements this can be right clicked with - * a Lexica Botania to open a entry page. - */ -public interface ILexiconable { - - /** - * Gets the lexicon entry to open at this location. null works too. - */ - public LexiconEntry getEntry(World world, int x, int y, int z, EntityPlayer player, ItemStack lexicon); - -} diff --git a/src/api/java/vazkii/botania/api/lexicon/IRecipeKeyProvider.java b/src/api/java/vazkii/botania/api/lexicon/IRecipeKeyProvider.java deleted file mode 100644 index 5b0c063..0000000 --- a/src/api/java/vazkii/botania/api/lexicon/IRecipeKeyProvider.java +++ /dev/null @@ -1,23 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Mar 20, 2014, 6:08:48 PM (GMT)] - */ -package vazkii.botania.api.lexicon; - -import net.minecraft.item.ItemStack; - -/** - * Have an Item implement this so that the method used for mapping it into - * the lexicon recipe mappings isn't the typical id:meta key. - */ -public interface IRecipeKeyProvider { - - public String getKey(ItemStack stack); - -} diff --git a/src/api/java/vazkii/botania/api/lexicon/ITwoNamedPage.java b/src/api/java/vazkii/botania/api/lexicon/ITwoNamedPage.java deleted file mode 100644 index 073b870..0000000 --- a/src/api/java/vazkii/botania/api/lexicon/ITwoNamedPage.java +++ /dev/null @@ -1,23 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Nov 3, 2014, 2:59:55 PM (GMT)] - */ -package vazkii.botania.api.lexicon; - -/** - * A LexiconPage that implements this has two unlocalized names - * rather than one. (See brew pages) - */ -public interface ITwoNamedPage { - - public void setSecondUnlocalizedName(String name); - - public String getSecondUnlocalizedName(); - -} diff --git a/src/api/java/vazkii/botania/api/lexicon/KnowledgeType.java b/src/api/java/vazkii/botania/api/lexicon/KnowledgeType.java deleted file mode 100644 index 5a08c9c..0000000 --- a/src/api/java/vazkii/botania/api/lexicon/KnowledgeType.java +++ /dev/null @@ -1,20 +0,0 @@ -package vazkii.botania.api.lexicon; - -import net.minecraft.util.EnumChatFormatting; - -public class KnowledgeType { - - public final String id; - public final EnumChatFormatting color; - public final boolean autoUnlock; - - public KnowledgeType(String id, EnumChatFormatting color, boolean autoUnlock) { - this.id = id; - this.color = color; - this.autoUnlock = autoUnlock; - } - - public String getUnlocalizedName() { - return "botania.knowledge." + id; - } -} diff --git a/src/api/java/vazkii/botania/api/lexicon/LexiconCategory.java b/src/api/java/vazkii/botania/api/lexicon/LexiconCategory.java deleted file mode 100644 index 06f678d..0000000 --- a/src/api/java/vazkii/botania/api/lexicon/LexiconCategory.java +++ /dev/null @@ -1,76 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Jan 14, 2014, 6:23:47 PM (GMT)] - */ -package vazkii.botania.api.lexicon; - -import java.util.ArrayList; -import java.util.List; - -import net.minecraft.util.ResourceLocation; - -public class LexiconCategory implements Comparable { - - private static int count = 0; - - public final String unlocalizedName; - public final List entries = new ArrayList(); - private final int sortingId; - private ResourceLocation icon; - private int priority = 5; - - /** - * @param unlocalizedName The unlocalized name of this category. This will be localized by the client display. - */ - public LexiconCategory(String unlocalizedName) { - this.unlocalizedName = unlocalizedName; - sortingId = count; - count++; - } - - public String getUnlocalizedName() { - return unlocalizedName; - } - - /** - * Sets the priority for this category for sorting. Higher numbers - * means they'll appear first in the book. The basics category - * is 9, the miscellaneous category is 0, other vanilla botania categories - * are 5. Using 9 and 0 is not recommended, since having your - * categories before basics or after miscellaneous is a bad idea. - * If two categories have the same priority they'll be sorted - * by insertion order. - */ - public LexiconCategory setPriority(int priority) { - this.priority = priority; - return this; - } - - public int getSortingPriority() { - return priority; - } - - public final int getSortingId() { - return sortingId; - } - - public LexiconCategory setIcon(ResourceLocation icon) { - this.icon = icon; - return this; - } - - public ResourceLocation getIcon() { - return icon; - } - - @Override - public int compareTo(LexiconCategory category) { - return priority == category.priority ? sortingId - category.sortingId : category.priority - priority; - } -} diff --git a/src/api/java/vazkii/botania/api/lexicon/LexiconEntry.java b/src/api/java/vazkii/botania/api/lexicon/LexiconEntry.java deleted file mode 100644 index e09ebfc..0000000 --- a/src/api/java/vazkii/botania/api/lexicon/LexiconEntry.java +++ /dev/null @@ -1,127 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Jan 14, 2014, 6:17:06 PM (GMT)] - */ -package vazkii.botania.api.lexicon; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import net.minecraft.item.ItemStack; -import net.minecraft.util.StatCollector; -import vazkii.botania.api.BotaniaAPI; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class LexiconEntry implements Comparable { - - public final String unlocalizedName; - public final LexiconCategory category; - - private KnowledgeType type = BotaniaAPI.basicKnowledge; - - public List pages = new ArrayList(); - private boolean priority = false; - private ItemStack icon = null; - - /** - * @param unlocalizedName The unlocalized name of this entry. This will be localized by the client display. - */ - public LexiconEntry(String unlocalizedName, LexiconCategory category) { - this.unlocalizedName = unlocalizedName; - this.category = category; - } - - /** - * Sets this page as prioritized, as in, will appear before others in the lexicon. - */ - public LexiconEntry setPriority() { - priority = true; - return this; - } - - /** - * Sets the Knowledge type of this entry. - */ - public LexiconEntry setKnowledgeType(KnowledgeType type) { - this.type = type; - return this; - } - - public KnowledgeType getKnowledgeType() { - return type; - } - - /** - * Sets the display icon for this entry. Overriding the one already there. When adding recipe pages to the - * entry, this will be called once for the result of the first found recipe. - */ - public void setIcon(ItemStack stack) { - icon = stack; - } - - public ItemStack getIcon() { - return icon; - } - - public boolean isPriority() { - return priority; - } - - public String getUnlocalizedName() { - return unlocalizedName; - } - - @SideOnly(Side.CLIENT) - public boolean isVisible() { - return true; - } - - /** - * Sets what pages you want this entry to have. - */ - public LexiconEntry setLexiconPages(LexiconPage... pages) { - this.pages.addAll(Arrays.asList(pages)); - - for(int i = 0; i < this.pages.size(); i++) { - LexiconPage page = this.pages.get(i); - if(!page.skipRegistry) - page.onPageAdded(this, i); - } - - return this; - } - - /** - * Returns the web link for this entry. If this isn't null, looking at this entry will - * show a "View Online" button in the book. The String returned should be the URL to - * open when the button is clicked. - */ - public String getWebLink() { - return null; - } - - /** - * Adds a page to the list of pages. - */ - public void addPage(LexiconPage page) { - pages.add(page); - } - - public final String getNameForSorting() { - return (priority ? 0 : 1) + StatCollector.translateToLocal(getUnlocalizedName()); - } - - @Override - public int compareTo(LexiconEntry o) { - return getNameForSorting().compareTo(o.getNameForSorting()); - } - -} \ No newline at end of file diff --git a/src/api/java/vazkii/botania/api/lexicon/LexiconPage.java b/src/api/java/vazkii/botania/api/lexicon/LexiconPage.java deleted file mode 100644 index e0982e7..0000000 --- a/src/api/java/vazkii/botania/api/lexicon/LexiconPage.java +++ /dev/null @@ -1,102 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Jan 14, 2014, 6:17:24 PM (GMT)] - */ -package vazkii.botania.api.lexicon; - -import net.minecraft.client.gui.GuiButton; -import vazkii.botania.api.internal.IGuiLexiconEntry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public abstract class LexiconPage { - - public String unlocalizedName; - public boolean skipRegistry; - - public LexiconPage(String unlocalizedName) { - this.unlocalizedName = unlocalizedName; - } - - /** - * Does the rendering for this page. - * @param gui The active GuiScreen - * @param mx The mouse's relative X position. - * @param my The mouse's relative Y position. - */ - @SideOnly(Side.CLIENT) - public abstract void renderScreen(IGuiLexiconEntry gui, int mx, int my); - - /** - * Called per update tick. Non gui-sensitive version, kept for backwards compatibility only. - */ - @SideOnly(Side.CLIENT) - public void updateScreen() { - // NO-OP - } - - /** - * Called per update tick. Feel free to override fully, the - * call to updateScreen() is for backwards compatibility. - */ - @SideOnly(Side.CLIENT) - public void updateScreen(IGuiLexiconEntry gui) { - updateScreen(); - } - - /** - * Called when this page is opened, be it via initGui() or when the player changes page. - * You can add buttons and whatever you'd do on initGui() here. - */ - @SideOnly(Side.CLIENT) - public void onOpened(IGuiLexiconEntry gui) { - // NO-OP - } - - /** - * Called when this page is opened, be it via closing the gui or when the player changes page. - * Make sure to dispose of anything you don't use any more, such as buttons in the gui's buttonList. - */ - @SideOnly(Side.CLIENT) - public void onClosed(IGuiLexiconEntry gui) { - // NO-OP - } - - /** - * Called when a button is pressed, equivalent to GuiScreen.actionPerformed. - */ - @SideOnly(Side.CLIENT) - public void onActionPerformed(IGuiLexiconEntry gui, GuiButton button) { - // NO-OP - } - - /** - * Called when a key is pressed. - */ - @SideOnly(Side.CLIENT) - public void onKeyPressed(char c, int key) { - // NO-OP - } - - /** - * Called when {@link LexiconEntry#setLexiconPages(LexiconPage...)} is called. - */ - public void onPageAdded(LexiconEntry entry, int index) { - // NO-OP - } - - public String getUnlocalizedName() { - return unlocalizedName; - } - - public LexiconPage setSkipRegistry() { - skipRegistry = true; - return this; - } -} diff --git a/src/api/java/vazkii/botania/api/lexicon/LexiconRecipeMappings.java b/src/api/java/vazkii/botania/api/lexicon/LexiconRecipeMappings.java deleted file mode 100644 index f4456b9..0000000 --- a/src/api/java/vazkii/botania/api/lexicon/LexiconRecipeMappings.java +++ /dev/null @@ -1,70 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Mar 6, 2014, 3:54:12 PM (GMT)] - */ -package vazkii.botania.api.lexicon; - -import java.util.HashMap; -import java.util.Map; - -import net.minecraft.item.ItemStack; - -/** - * This class contains mappings for which entry and page correspond to each - * craftable ItemStack. Use the map method to map an ItemStack to a page in - * an entry in the lexicon. - */ -public final class LexiconRecipeMappings { - - private static Map mappings = new HashMap(); - - /** - * Maps the given stack to the given page of the entry. - */ - public static void map(ItemStack stack, LexiconEntry entry, int page, boolean force) { - EntryData data = new EntryData(entry, page); - String str = stackToString(stack); - - if(force || !mappings.containsKey(str)) - mappings.put(str, data); - if(entry.getIcon() == null) - entry.setIcon(stack.copy()); - } - - public static void map(ItemStack stack, LexiconEntry entry, int page) { - map(stack, entry, page, false); - } - - public static void remove(ItemStack stack) { - mappings.remove(stackToString(stack)); - } - - public static EntryData getDataForStack(ItemStack stack) { - return mappings.get(stackToString(stack)); - } - - public static String stackToString(ItemStack stack) { - if(stack.hasTagCompound() && stack.getItem() instanceof IRecipeKeyProvider) - return ((IRecipeKeyProvider) stack.getItem()).getKey(stack); - - return stack.getUnlocalizedName() + "~" + stack.getItemDamage(); - } - - public static class EntryData { - - public final LexiconEntry entry; - public final int page; - - public EntryData(LexiconEntry entry, int page) { - this.entry = entry; - this.page = page; - } - - } -} diff --git a/src/api/java/vazkii/botania/api/lexicon/multiblock/IMultiblockRenderHook.java b/src/api/java/vazkii/botania/api/lexicon/multiblock/IMultiblockRenderHook.java deleted file mode 100644 index eeb6c45..0000000 --- a/src/api/java/vazkii/botania/api/lexicon/multiblock/IMultiblockRenderHook.java +++ /dev/null @@ -1,29 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Jun 27, 2015, 7:48:47 PM (GMT)] - */ -package vazkii.botania.api.lexicon.multiblock; - -import java.util.HashMap; -import java.util.Map; - -import net.minecraft.block.Block; -import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.world.IBlockAccess; - -/** - * A hook for rendering blocks in the multiblock display. - */ -public interface IMultiblockRenderHook { - - public static Map renderHooks = new HashMap(); - - public void renderBlockForMultiblock(IBlockAccess world, Multiblock mb, Block block, int meta, RenderBlocks renderBlocks); - -} diff --git a/src/api/java/vazkii/botania/api/lexicon/multiblock/Multiblock.java b/src/api/java/vazkii/botania/api/lexicon/multiblock/Multiblock.java deleted file mode 100644 index 655bd04..0000000 --- a/src/api/java/vazkii/botania/api/lexicon/multiblock/Multiblock.java +++ /dev/null @@ -1,153 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Jun 27, 2015, 2:37:22 PM (GMT)] - */ -package vazkii.botania.api.lexicon.multiblock; - -import java.util.ArrayList; -import java.util.List; - -import net.minecraft.block.Block; -import net.minecraft.item.ItemStack; -import net.minecraft.util.ChunkCoordinates; -import vazkii.botania.api.lexicon.multiblock.component.MultiblockComponent; - -/** - * This class describes a Mutiblock object. It's used to display a - * multiblock in the lexicon and to show the player in a ghost-like - * look in the world. - */ -public class Multiblock { - - public List components = new ArrayList(); - public List materials = new ArrayList(); - - public int minX, minY, minZ, maxX, maxY, maxZ, offX, offY, offZ; - - /** - * Adds a multiblock component to this multiblock. The component's x y z - * coords should be pivoted to the center of the structure. - */ - public void addComponent(MultiblockComponent component) { - components.add(component); - changeAxisForNewComponent(component.relPos.posX, component.relPos.posY, component.relPos.posZ); - calculateCostForNewComponent(component); - } - - /** - * Constructs and adds a multiblock component to this multiblock. The x y z - * coords should be pivoted to the center of the structure. - */ - public void addComponent(int x, int y, int z, Block block, int meta) { - addComponent(new MultiblockComponent(new ChunkCoordinates(x, y, z), block, meta)); - } - - private void changeAxisForNewComponent(int x, int y, int z) { - if(x < minX) - minX = x; - else if(x > maxX) - maxX = x; - - if(y < minY) - minY = y; - else if(y > maxY) - maxY = y; - - if(z < minZ) - minZ = z; - else if(z > maxZ) - maxZ = z; - } - - private void calculateCostForNewComponent(MultiblockComponent comp) { - ItemStack[] materials = comp.getMaterials(); - if(materials != null) - for(ItemStack stack : materials) - addStack(stack); - } - - private void addStack(ItemStack stack) { - if(stack == null) - return; - - for(ItemStack oStack : materials) - if(oStack.isItemEqual(stack) && ItemStack.areItemStackTagsEqual(oStack, stack)) { - oStack.stackSize += stack.stackSize; - return; - } - - materials.add(stack); - } - - public void setRenderOffset(int x, int y, int z) { - offX = x; - offY = y; - offZ = z; - } - - public List getComponents() { - return components; - } - - /** - * Rotates this multiblock by the angle passed in. For the best results, use - * only multiples of pi/2. - */ - public void rotate(double angle) { - for(MultiblockComponent comp : getComponents()) - comp.rotate(angle); - } - - public Multiblock copy() { - Multiblock mb = new Multiblock(); - for(MultiblockComponent comp : getComponents()) - mb.addComponent(comp.copy()); - - return mb; - } - - /** - * Creates a length 4 array of all the rotations multiple of pi/2 required - * to render this multiblock in the world relevant to the 4 cardinal - * orientations. - */ - public Multiblock[] createRotations() { - Multiblock[] blocks = new Multiblock[4]; - blocks[0] = this; - blocks[1] = blocks[0].copy(); - blocks[1].rotate(Math.PI / 2); - blocks[2] = blocks[1].copy(); - blocks[2].rotate(Math.PI / 2); - blocks[3] = blocks[2].copy(); - blocks[3].rotate(Math.PI / 2); - - return blocks; - } - - /** - * Makes a MultiblockSet from this Multiblock and its rotations using - * createRotations(). - */ - public MultiblockSet makeSet() { - return new MultiblockSet(this); - } - - public int getXSize() { - return Math.abs(minX) + Math.abs(maxX) + 1; - } - - public int getYSize() { - return Math.abs(minY) + Math.abs(maxY) + 1; - } - - public int getZSize() { - return Math.abs(minZ) + Math.abs(maxZ) + 1; - } - -} diff --git a/src/api/java/vazkii/botania/api/lexicon/multiblock/MultiblockSet.java b/src/api/java/vazkii/botania/api/lexicon/multiblock/MultiblockSet.java deleted file mode 100644 index 8e4187c..0000000 --- a/src/api/java/vazkii/botania/api/lexicon/multiblock/MultiblockSet.java +++ /dev/null @@ -1,43 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Jun 27, 2015, 7:31:58 PM (GMT)] - */ -package vazkii.botania.api.lexicon.multiblock; - -import net.minecraft.entity.Entity; -import net.minecraft.util.MathHelper; - -/** - * A set of Multiblock objects for various rotations. - */ -public class MultiblockSet { - - private final Multiblock[] mbs; - - public MultiblockSet(Multiblock[] mbs) { - this.mbs = mbs; - } - - public MultiblockSet(Multiblock mb) { - this(mb.createRotations()); - } - - public Multiblock getForEntity(Entity e) { - return getForRotation(e.rotationYaw); - } - - public Multiblock getForRotation(double rotation) { - int facing = MathHelper.floor_double(rotation * 4.0 / 360.0 + 0.5) & 3; - return getForIndex(facing); - } - - public Multiblock getForIndex(int index) { - return mbs[index]; - } -} diff --git a/src/api/java/vazkii/botania/api/lexicon/multiblock/component/ColorSwitchingComponent.java b/src/api/java/vazkii/botania/api/lexicon/multiblock/component/ColorSwitchingComponent.java deleted file mode 100644 index 27eb32a..0000000 --- a/src/api/java/vazkii/botania/api/lexicon/multiblock/component/ColorSwitchingComponent.java +++ /dev/null @@ -1,43 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Jun 27, 2015, 7:20:09 PM (GMT)] - */ -package vazkii.botania.api.lexicon.multiblock.component; - -import net.minecraft.block.Block; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import vazkii.botania.api.BotaniaAPI; - -/** - * A multiblock component that switches through the 16 colors of the - * minecraft spectrum. This can be used for flowers, for example. - */ -public class ColorSwitchingComponent extends MultiblockComponent { - - public ColorSwitchingComponent(ChunkCoordinates relPos, Block block) { - super(relPos, block, -1); - } - - @Override - public int getMeta() { - return (int) (BotaniaAPI.internalHandler.getWorldElapsedTicks() / 20) % 16; - } - - @Override - public boolean matches(World world, int x, int y, int z) { - return world.getBlock(x, y, z) == getBlock(); - } - - @Override - public MultiblockComponent copy() { - return new ColorSwitchingComponent(relPos, block); - } - -} diff --git a/src/api/java/vazkii/botania/api/lexicon/multiblock/component/FlowerComponent.java b/src/api/java/vazkii/botania/api/lexicon/multiblock/component/FlowerComponent.java deleted file mode 100644 index 8a4f0ad..0000000 --- a/src/api/java/vazkii/botania/api/lexicon/multiblock/component/FlowerComponent.java +++ /dev/null @@ -1,37 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Jun 28, 2015, 3:23:15 PM (GMT)] - */ -package vazkii.botania.api.lexicon.multiblock.component; - -import net.minecraft.block.Block; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import vazkii.botania.api.BotaniaAPI; - -/** - * A multiblock component that matches any botania flower. - */ -public class FlowerComponent extends ColorSwitchingComponent { - - public FlowerComponent(ChunkCoordinates relPos, Block block) { - super(relPos, block); - } - - @Override - public boolean matches(World world, int x, int y, int z) { - return BotaniaAPI.internalHandler.isBotaniaFlower(world, x, y, z); - } - - @Override - public MultiblockComponent copy() { - return new FlowerComponent(relPos, block); - } - -} diff --git a/src/api/java/vazkii/botania/api/lexicon/multiblock/component/MultiblockComponent.java b/src/api/java/vazkii/botania/api/lexicon/multiblock/component/MultiblockComponent.java deleted file mode 100644 index d1e6570..0000000 --- a/src/api/java/vazkii/botania/api/lexicon/multiblock/component/MultiblockComponent.java +++ /dev/null @@ -1,68 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Jun 27, 2015, 2:42:32 PM (GMT)] - */ -package vazkii.botania.api.lexicon.multiblock.component; - -import net.minecraft.block.Block; -import net.minecraft.item.ItemStack; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; - -/** - * A component of a multiblock, the normal one - * is just a block. - */ -public class MultiblockComponent { - - public ChunkCoordinates relPos; - public final Block block; - public final int meta; - - public MultiblockComponent(ChunkCoordinates relPos, Block block, int meta) { - this.relPos = relPos; - this.block = block; - this.meta = meta; - } - - public ChunkCoordinates getRelativePosition() { - return relPos; - } - - public Block getBlock() { - return block; - } - - public int getMeta() { - return meta; - } - - public boolean matches(World world, int x, int y, int z) { - return world.getBlock(x, y, z) == getBlock() && (meta == -1 || world.getBlockMetadata(x, y, z) == meta); - } - - public ItemStack[] getMaterials() { - return new ItemStack[] { new ItemStack(block, 1, meta) }; - } - - public void rotate(double angle) { - double x = relPos.posX; - double z = relPos.posZ; - double sin = Math.sin(angle); - double cos = Math.cos(angle); - - double xn = x * cos - z * sin; - double zn = x * sin + z * cos; - relPos = new ChunkCoordinates((int) Math.round(xn), relPos.posY, (int) Math.round(zn)); - } - - public MultiblockComponent copy() { - return new MultiblockComponent(relPos, block, meta); - } -} diff --git a/src/api/java/vazkii/botania/api/mana/BurstProperties.java b/src/api/java/vazkii/botania/api/mana/BurstProperties.java deleted file mode 100644 index 75ff0f8..0000000 --- a/src/api/java/vazkii/botania/api/mana/BurstProperties.java +++ /dev/null @@ -1,36 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Jan 31, 2014, 3:49:30 PM (GMT)] - */ -package vazkii.botania.api.mana; - -/** - * The properties of a mana burst, when shot. This is passed to the lens - * currently on the mana spreader to apply changes. - */ -public final class BurstProperties { - - public int maxMana; - public int ticksBeforeManaLoss; - public float manaLossPerTick; - public float gravity; - public float motionModifier; - - public int color; - - public BurstProperties(int maxMana, int ticksBeforeManaLoss, float manaLossPerTick, float gravity, float motionModifier, int color) { - this.maxMana = maxMana; - this.ticksBeforeManaLoss = ticksBeforeManaLoss; - this.manaLossPerTick = manaLossPerTick; - this.gravity = gravity; - this.motionModifier = motionModifier; - this.color = color; - } - -} diff --git a/src/api/java/vazkii/botania/api/mana/IClientManaHandler.java b/src/api/java/vazkii/botania/api/mana/IClientManaHandler.java deleted file mode 100644 index aea14b9..0000000 --- a/src/api/java/vazkii/botania/api/mana/IClientManaHandler.java +++ /dev/null @@ -1,20 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Jul 2, 2014, 5:26:02 PM (GMT)] - */ -package vazkii.botania.api.mana; - -/** - * A TileEntity that implements this will get it's recieveMana call - * called on both client and server. If this is not implemented - * the call will only occur on the server. - */ -public interface IClientManaHandler extends IManaReceiver { - -} diff --git a/src/api/java/vazkii/botania/api/mana/ICreativeManaProvider.java b/src/api/java/vazkii/botania/api/mana/ICreativeManaProvider.java deleted file mode 100644 index 2556663..0000000 --- a/src/api/java/vazkii/botania/api/mana/ICreativeManaProvider.java +++ /dev/null @@ -1,25 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [May 25, 2014, 7:34:00 PM (GMT)] - */ -package vazkii.botania.api.mana; - -import net.minecraft.item.ItemStack; - -/** - * Have an item implement this to flag it as an infinite - * mana source for the purposes of the HUD rendered when - * an IManaUserItem implementing item is present. - */ -public interface ICreativeManaProvider { - - public boolean isCreative(ItemStack stack); - -} - diff --git a/src/api/java/vazkii/botania/api/mana/IIdentifiable.java b/src/api/java/vazkii/botania/api/mana/IIdentifiable.java deleted file mode 100644 index 65f2edc..0000000 --- a/src/api/java/vazkii/botania/api/mana/IIdentifiable.java +++ /dev/null @@ -1,23 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Jun 19, 2015, 10:05:24 PM (GMT)] - */ -package vazkii.botania.api.mana; - -import java.util.UUID; - -/** - * This interface marks a TileEntity that can be identified through - * an UUID. This UUID must presist between sessions. - */ -public interface IIdentifiable { - - public UUID getIdentifier(); - -} diff --git a/src/api/java/vazkii/botania/api/mana/IKeyLocked.java b/src/api/java/vazkii/botania/api/mana/IKeyLocked.java deleted file mode 100644 index ce71694..0000000 --- a/src/api/java/vazkii/botania/api/mana/IKeyLocked.java +++ /dev/null @@ -1,29 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Jul 11, 2014, 4:29:32 PM (GMT)] - */ -package vazkii.botania.api.mana; - -/** - * A TileEntity that implements this interface has an IO key lock. This - * interface defines an input and output key.

    - * - * A Spreader can only shoot mana into a IKeyLocked interfaced TE if the Input - * key of the TE is equal to the Output key of the Spreader.

    - * - * A Spreader can only pull mana from a IKeyLocked interfaced IManaPool TE if the - * Output key of the IManaPool is equal to the Input key of the Spreader. - */ -public interface IKeyLocked { - - public String getInputKey(); - - public String getOutputKey(); - -} diff --git a/src/api/java/vazkii/botania/api/mana/ILaputaImmobile.java b/src/api/java/vazkii/botania/api/mana/ILaputaImmobile.java deleted file mode 100644 index dfa2945..0000000 --- a/src/api/java/vazkii/botania/api/mana/ILaputaImmobile.java +++ /dev/null @@ -1,22 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Jul 26, 2014, 9:51:58 PM (GMT)] - */ -package vazkii.botania.api.mana; - -import net.minecraft.world.World; - -/** - * A block that implements this has a flag for whether it can be moved by the Shard of Laputa. - */ -public interface ILaputaImmobile { - - public boolean canMove(World world, int x, int y, int z); - -} diff --git a/src/api/java/vazkii/botania/api/mana/ILens.java b/src/api/java/vazkii/botania/api/mana/ILens.java deleted file mode 100644 index d125e57..0000000 --- a/src/api/java/vazkii/botania/api/mana/ILens.java +++ /dev/null @@ -1,42 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Jan 31, 2014, 3:03:04 PM (GMT)] - */ -package vazkii.botania.api.mana; - -import net.minecraft.item.ItemStack; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -/** - * Have an Item implement this to be counted as a lens for the mana spreader. - */ -public interface ILens extends ILensEffect { - - @SideOnly(Side.CLIENT) - public int getLensColor(ItemStack stack); - - /** - * Can the source lens be combined with the composite lens? This is called - * for both the ILens instance of ItemStack.getItem() of sourceLens and compositeLens. - */ - public boolean canCombineLenses(ItemStack sourceLens, ItemStack compositeLens); - - /** - * Gets the composite lens in the stack passed in, return null for none. - */ - public ItemStack getCompositeLens(ItemStack stack); - - /** - * Sets the composite lens for the sourceLens as the compositeLens, returns - * the ItemStack with the combination. - */ - public ItemStack setCompositeLens(ItemStack sourceLens, ItemStack compositeLens); - -} diff --git a/src/api/java/vazkii/botania/api/mana/ILensEffect.java b/src/api/java/vazkii/botania/api/mana/ILensEffect.java deleted file mode 100644 index 4c88f55..0000000 --- a/src/api/java/vazkii/botania/api/mana/ILensEffect.java +++ /dev/null @@ -1,48 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Apr 14, 2014, 7:30:00 PM (GMT)] - */ -package vazkii.botania.api.mana; - -import net.minecraft.item.ItemStack; -import net.minecraft.util.MovingObjectPosition; -import vazkii.botania.api.internal.IManaBurst; - -/** - * Have an item implement this for it to count as a lens effect and - * be able to change the properties of Mana Bursts. - */ -public interface ILensEffect { - - /** - * Called when a mana spreader that has this focus shoots a burst. This is where - * you change the properties of the burst. - */ - public void apply(ItemStack stack, BurstProperties props); - - /** - * Called when a mana burst fired from a mana spreader with this focus collides against - * any block. This is called after the collision is handled. - * @return True to kill the burst. False to keep it alive. - */ - public boolean collideBurst(IManaBurst burst, MovingObjectPosition pos, boolean isManaBlock, boolean dead, ItemStack stack); - - /** - * Called when a mana burst fired from a mana spreader with this focus is updated. - * This is called before the update is handled. - */ - public void updateBurst(IManaBurst burst, ItemStack stack); - - /** - * Called when the mana burst should do it's particles. Return false to not - * do any particles. - */ - public boolean doParticles(IManaBurst burst, ItemStack stack); - -} diff --git a/src/api/java/vazkii/botania/api/mana/IManaBlock.java b/src/api/java/vazkii/botania/api/mana/IManaBlock.java deleted file mode 100644 index 56aa037..0000000 --- a/src/api/java/vazkii/botania/api/mana/IManaBlock.java +++ /dev/null @@ -1,25 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Jan 22, 2014, 4:59:05 PM (GMT)] - */ -package vazkii.botania.api.mana; - -/** - * A TileEntity that implements this is considered a Mana Block. - * Just being a Mana Block doesn't mean much, look at the other IMana - * interfaces. - */ -public interface IManaBlock { - - /** - * Gets the amount of mana currently in this block. - */ - public int getCurrentMana(); - -} diff --git a/src/api/java/vazkii/botania/api/mana/IManaCollector.java b/src/api/java/vazkii/botania/api/mana/IManaCollector.java deleted file mode 100644 index 280e460..0000000 --- a/src/api/java/vazkii/botania/api/mana/IManaCollector.java +++ /dev/null @@ -1,42 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Jan 22, 2014, 5:01:19 PM (GMT)] - */ -package vazkii.botania.api.mana; - -import vazkii.botania.api.internal.IManaBurst; - -/** - * Any TileEntity that implements this is considered a mana collector, by - * which nearby generating flowers will pump mana into it.

    - * - * Implementation Instructions:
    - * - Override invalidate() and onChunkUnload(), calling ManaNetworkEvent.removeCollector(this); on both.
    - * - On the first tick of onUpdate(), call ManaNetworkEvent.addCollector(this); - */ -public interface IManaCollector extends IManaReceiver { - - /** - * Called every tick on the client case the player is holding a Wand of the Forest. - */ - public void onClientDisplayTick(); - - /** - * Get the multiplier of mana to input into the block, 1.0 is the original amount of mana - * in the burst. 0.9, for example, is 90%, so 10% of the mana in the burst will get - * dissipated. - */ - public float getManaYieldMultiplier(IManaBurst burst); - - /** - * Gets the maximum amount of mana this collector can have. - */ - public int getMaxMana(); - -} diff --git a/src/api/java/vazkii/botania/api/mana/IManaCollisionGhost.java b/src/api/java/vazkii/botania/api/mana/IManaCollisionGhost.java deleted file mode 100644 index 76b537e..0000000 --- a/src/api/java/vazkii/botania/api/mana/IManaCollisionGhost.java +++ /dev/null @@ -1,21 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Mar 10, 2014, 7:49:19 PM (GMT)] - */ -package vazkii.botania.api.mana; - -/** - * Any TileEntity that implements this can be counted as a "ghost" block of - * sorts, that won't call the collision code for the mana bursts. - */ -public interface IManaCollisionGhost { - - public boolean isGhost(); - -} diff --git a/src/api/java/vazkii/botania/api/mana/IManaDiscountArmor.java b/src/api/java/vazkii/botania/api/mana/IManaDiscountArmor.java deleted file mode 100644 index 56a9683..0000000 --- a/src/api/java/vazkii/botania/api/mana/IManaDiscountArmor.java +++ /dev/null @@ -1,31 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Jan 28, 2015, 9:22:53 PM (GMT)] - */ -package vazkii.botania.api.mana; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; - -/** - * An armor item that implements this can provide a mana discount for mana tools. - * Mana tools are the ones on the main toolset (Pick, Shovel, Axe, Sword and Shovel) - * as well as Rods. - */ -public interface IManaDiscountArmor { - - /** - * Gets the mana discount that this piece of armor provides. This is added - * together to create the full discount. - * Value is to be from 0.0 to 1.0. 0.1 is 10% discount, as an example. - * You can also return negative values to make tools cost more. - */ - public float getDiscount(ItemStack stack, int slot, EntityPlayer player); - -} diff --git a/src/api/java/vazkii/botania/api/mana/IManaItem.java b/src/api/java/vazkii/botania/api/mana/IManaItem.java deleted file mode 100644 index f4463fb..0000000 --- a/src/api/java/vazkii/botania/api/mana/IManaItem.java +++ /dev/null @@ -1,68 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Mar 6, 2014, 9:07:40 AM (GMT)] - */ -package vazkii.botania.api.mana; - -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; - -/** - * An item that implements this can be counted as an item that can - * contain mana. - */ -public interface IManaItem { - - /** - * Gets the amount of mana this item contains - */ - public int getMana(ItemStack stack); - - /** - * Gets the max amount of mana this item can hold. - */ - public int getMaxMana(ItemStack stack); - - /** - * Adds mana to this item. - */ - public void addMana(ItemStack stack, int mana); - - /** - * Can this item receive mana from a mana Pool? - * @param pool The pool it's receiving mana from, can be casted to IManaPool. - * @see IManaPool#isOutputtingPower() - */ - public boolean canReceiveManaFromPool(ItemStack stack, TileEntity pool); - - /** - * Can this item recieve mana from another item? - */ - public boolean canReceiveManaFromItem(ItemStack stack, ItemStack otherStack); - - /** - * Can this item export mana to a mana Pool? - * @param pool The pool it's exporting mana to, can be casted to IManaPool. - * @see IManaPool#isOutputtingPower() - */ - public boolean canExportManaToPool(ItemStack stack,TileEntity pool); - - /** - * Can this item export mana to another item? - */ - public boolean canExportManaToItem(ItemStack stack, ItemStack otherStack); - - /** - * If this item simply does not export mana at all, set this to true. This is - * used to skip items that contain mana but can't export it when drawing the - * mana bar above the XP bar. - */ - public boolean isNoExport(ItemStack stack); - -} diff --git a/src/api/java/vazkii/botania/api/mana/IManaPool.java b/src/api/java/vazkii/botania/api/mana/IManaPool.java deleted file mode 100644 index df523a6..0000000 --- a/src/api/java/vazkii/botania/api/mana/IManaPool.java +++ /dev/null @@ -1,30 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Jan 22, 2014, 5:03:09 PM (GMT)] - */ -package vazkii.botania.api.mana; - -/** - * Any TileEntity that implements this is considered a Mana Pool, - * by which nearby functional flowers will pull mana from it.
    - * Mana Distributors will also accept it as valid output.

    - * - * Implementation Instructions:
    - * - Override invalidate() and onChunkUnload(), calling ManaNetworkEvent.removePool(this); on both.
    - * - On the first tick of onUpdate(), call ManaNetworkEvent.addPool(this); - */ -public interface IManaPool extends IManaReceiver { - - /** - * Returns false if the mana pool is accepting power from other power items, - * true if it's sending power into them. - */ - public boolean isOutputtingPower(); - -} diff --git a/src/api/java/vazkii/botania/api/mana/IManaReceiver.java b/src/api/java/vazkii/botania/api/mana/IManaReceiver.java deleted file mode 100644 index 178856f..0000000 --- a/src/api/java/vazkii/botania/api/mana/IManaReceiver.java +++ /dev/null @@ -1,34 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Jan 22, 2014, 4:55:00 PM (GMT)] - */ -package vazkii.botania.api.mana; - -/** - * Any TileEntity that implements this can receive mana from mana bursts. - */ -public interface IManaReceiver extends IManaBlock { - - /** - * Is this Mana Receiver is full? Being full means no mana bursts will be sent. - */ - public boolean isFull(); - - /** - * Called when this receiver receives mana. - */ - public void recieveMana(int mana); - - /** - * Can this tile receive mana from bursts? Generally set to false for - * implementations of IManaCollector. - */ - public boolean canRecieveManaFromBursts(); - -} diff --git a/src/api/java/vazkii/botania/api/mana/IManaSpreader.java b/src/api/java/vazkii/botania/api/mana/IManaSpreader.java deleted file mode 100644 index 0dda30a..0000000 --- a/src/api/java/vazkii/botania/api/mana/IManaSpreader.java +++ /dev/null @@ -1,35 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Apr 18, 2015, 7:30:00 PM (GMT)] - */ -package vazkii.botania.api.mana; - - -/** - * Any TileEntity that implements this is considered a Mana Spreader, - * by which can fire mana bursts as a spreader. - * - */ -public interface IManaSpreader extends IManaBlock, IPingable { - - public float getRotationX(); - - public float getRotationY(); - - public void setCanShoot(boolean canShoot); - - public int getBurstParticleTick(); - - public void setBurstParticleTick(int i); - - public int getLastBurstDeathTick(); - - public void setLastBurstDeathTick(int ticksExisted); - -} diff --git a/src/api/java/vazkii/botania/api/mana/IManaTrigger.java b/src/api/java/vazkii/botania/api/mana/IManaTrigger.java deleted file mode 100644 index 61aadfc..0000000 --- a/src/api/java/vazkii/botania/api/mana/IManaTrigger.java +++ /dev/null @@ -1,23 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [May 16, 2014, 7:52:53 PM (GMT)] - */ -package vazkii.botania.api.mana; - -import net.minecraft.world.World; -import vazkii.botania.api.internal.IManaBurst; - -/** - * Have a block implement this class to make it do something when a mana burst collides with it. - */ -public interface IManaTrigger { - - public void onBurstCollision(IManaBurst burst, World world, int x, int y, int z); - -} diff --git a/src/api/java/vazkii/botania/api/mana/IManaUsingItem.java b/src/api/java/vazkii/botania/api/mana/IManaUsingItem.java deleted file mode 100644 index 9fe55fc..0000000 --- a/src/api/java/vazkii/botania/api/mana/IManaUsingItem.java +++ /dev/null @@ -1,25 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [May 25, 2014, 7:32:10 PM (GMT)] - */ -package vazkii.botania.api.mana; - -import net.minecraft.item.ItemStack; - -/** - * Any item that implements this interface is an item that would use mana - * from the player's inventory. If there's any items in the inventory or - * equipped in either the baubles or armor inventories that implement - * this interface, a mana bar will be rendered. - */ -public interface IManaUsingItem { - - public boolean usesMana(ItemStack stack); - -} diff --git a/src/api/java/vazkii/botania/api/mana/IPingable.java b/src/api/java/vazkii/botania/api/mana/IPingable.java deleted file mode 100644 index 1605b42..0000000 --- a/src/api/java/vazkii/botania/api/mana/IPingable.java +++ /dev/null @@ -1,31 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Jun 19, 2015, 9:52:05 PM (GMT)] - */ -package vazkii.botania.api.mana; - -import java.util.UUID; - -import vazkii.botania.api.internal.IManaBurst; - -/** - * This describes an interface of a Mana Sender block that should be able to pingbackable - * by a burst to tell it that the burst is still alive. - */ -public interface IPingable extends IIdentifiable { - - /** - * Pings this object back, telling it that the burst passed in is still alive - * in the world. The UUID parameter should be the UUID with which the burst - * was created, this is used to let the object handle the check for if it's the - * correct ID internally. IManaBurst implementations should do this every tick. - */ - public void pingback(IManaBurst burst, UUID expectedIdentity); - -} diff --git a/src/api/java/vazkii/botania/api/mana/IPoolOverlayProvider.java b/src/api/java/vazkii/botania/api/mana/IPoolOverlayProvider.java deleted file mode 100644 index e443e2c..0000000 --- a/src/api/java/vazkii/botania/api/mana/IPoolOverlayProvider.java +++ /dev/null @@ -1,25 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Jul 2, 2014, 6:36:54 PM (GMT)] - */ -package vazkii.botania.api.mana; - -import net.minecraft.util.IIcon; -import net.minecraft.world.World; - -/** - * A block that implements this can provide an IIcon (block icons only) - * to be used as an overlay for the mana pool, similarly to the mana void - * and catalysts. - */ -public interface IPoolOverlayProvider { - - public IIcon getIcon(World world, int x, int y, int z); - -} diff --git a/src/api/java/vazkii/botania/api/mana/IThrottledPacket.java b/src/api/java/vazkii/botania/api/mana/IThrottledPacket.java deleted file mode 100644 index ff760be..0000000 --- a/src/api/java/vazkii/botania/api/mana/IThrottledPacket.java +++ /dev/null @@ -1,22 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Apr 12, 2015, 3:08:09 PM (GMT)] - */ -package vazkii.botania.api.mana; - -/** - * A TileEntity that will only send a few packets rather than one per every entity collision. - * markDispatchable marks that this TE needs to send a packet. Further handling is to be done - * in the TE itself. - */ -public interface IThrottledPacket { - - public void markDispatchable(); - -} diff --git a/src/api/java/vazkii/botania/api/mana/ITinyPlanetExcempt.java b/src/api/java/vazkii/botania/api/mana/ITinyPlanetExcempt.java deleted file mode 100644 index a82114c..0000000 --- a/src/api/java/vazkii/botania/api/mana/ITinyPlanetExcempt.java +++ /dev/null @@ -1,23 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Jul 22, 2014, 2:26:14 PM (GMT)] - */ -package vazkii.botania.api.mana; - -import net.minecraft.item.ItemStack; - -/** - * Any Item that implements ILensEffect and this will have - * a check before being pulled by the Tiny Planet. - */ -public interface ITinyPlanetExcempt { - - public boolean shouldPull(ItemStack stack); - -} diff --git a/src/api/java/vazkii/botania/api/mana/ManaItemHandler.java b/src/api/java/vazkii/botania/api/mana/ManaItemHandler.java deleted file mode 100644 index d261d55..0000000 --- a/src/api/java/vazkii/botania/api/mana/ManaItemHandler.java +++ /dev/null @@ -1,255 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Mar 13, 2014, 5:32:24 PM (GMT)] - */ -package vazkii.botania.api.mana; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; -import vazkii.botania.api.BotaniaAPI; - -public final class ManaItemHandler { - - /** - * Requests mana from items in a given player's inventory. - * @param manaToGet How much mana is to be requested, if less mana exists than this amount, - * the amount of mana existent will be returned instead, if you want exact values use requestManaExact. - * @param remove If true, the mana will be removed from the target item. Set to false to just check. - * @return The amount of mana received from the request. - */ - public static int requestMana(ItemStack stack, EntityPlayer player, int manaToGet, boolean remove) { - if(stack == null) - return 0; - - IInventory mainInv = player.inventory; - IInventory baublesInv = BotaniaAPI.internalHandler.getBaublesInventory(player); - - int invSize = mainInv.getSizeInventory(); - int size = invSize; - if(baublesInv != null) - size += baublesInv.getSizeInventory(); - - for(int i = 0; i < size; i++) { - boolean useBaubles = i >= invSize; - IInventory inv = useBaubles ? baublesInv : mainInv; - int slot = i - (useBaubles ? invSize : 0); - ItemStack stackInSlot = inv.getStackInSlot(slot); - if(stackInSlot == stack) - continue; - - if(stackInSlot != null && stackInSlot.getItem() instanceof IManaItem) { - IManaItem manaItem = (IManaItem) stackInSlot.getItem(); - if(manaItem.canExportManaToItem(stackInSlot, stack) && manaItem.getMana(stackInSlot) > 0) { - if(stack.getItem() instanceof IManaItem && !((IManaItem) stack.getItem()).canReceiveManaFromItem(stack, stackInSlot)) - continue; - - int mana = Math.min(manaToGet, manaItem.getMana(stackInSlot)); - - if(remove) - manaItem.addMana(stackInSlot, -mana); - if(useBaubles) - BotaniaAPI.internalHandler.sendBaubleUpdatePacket(player, slot); - - return mana; - } - } - } - - return 0; - } - - /** - * Requests an exact amount of mana from items in a given player's inventory. - * @param manaToGet How much mana is to be requested, if less mana exists than this amount, - * false will be returned instead, and nothing will happen. - * @param remove If true, the mana will be removed from the target item. Set to false to just check. - * @return If the request was succesful. - */ - public static boolean requestManaExact(ItemStack stack, EntityPlayer player, int manaToGet, boolean remove) { - if(stack == null) - return false; - - IInventory mainInv = player.inventory; - IInventory baublesInv = BotaniaAPI.internalHandler.getBaublesInventory(player); - - int invSize = mainInv.getSizeInventory(); - int size = invSize; - if(baublesInv != null) - size += baublesInv.getSizeInventory(); - - for(int i = 0; i < size; i++) { - boolean useBaubles = i >= invSize; - IInventory inv = useBaubles ? baublesInv : mainInv; - int slot = i - (useBaubles ? invSize : 0); - ItemStack stackInSlot = inv.getStackInSlot(slot); - if(stackInSlot == stack) - continue; - - if(stackInSlot != null && stackInSlot.getItem() instanceof IManaItem) { - IManaItem manaItemSlot = (IManaItem) stackInSlot.getItem(); - if(manaItemSlot.canExportManaToItem(stackInSlot, stack) && manaItemSlot.getMana(stackInSlot) > manaToGet) { - if(stack.getItem() instanceof IManaItem && !((IManaItem) stack.getItem()).canReceiveManaFromItem(stack, stackInSlot)) - continue; - - if(remove) - manaItemSlot.addMana(stackInSlot, -manaToGet); - if(useBaubles) - BotaniaAPI.internalHandler.sendBaubleUpdatePacket(player, slot); - - return true; - } - } - } - - return false; - } - - /** - * Dispatches mana to items in a given player's inventory. Note that this method - * does not automatically remove mana from the item which is exporting. - * @param manaToSend How much mana is to be sent. - * @param remove If true, the mana will be added from the target item. Set to false to just check. - * @return The amount of mana actually sent. - */ - public static int dispatchMana(ItemStack stack, EntityPlayer player, int manaToSend, boolean add) { - if(stack == null) - return 0; - - IInventory mainInv = player.inventory; - IInventory baublesInv = BotaniaAPI.internalHandler.getBaublesInventory(player); - - int invSize = mainInv.getSizeInventory(); - int size = invSize; - if(baublesInv != null) - size += baublesInv.getSizeInventory(); - - for(int i = 0; i < size; i++) { - boolean useBaubles = i >= invSize; - IInventory inv = useBaubles ? baublesInv : mainInv; - int slot = i - (useBaubles ? invSize : 0); - ItemStack stackInSlot = inv.getStackInSlot(slot); - if(stackInSlot == stack) - continue; - - if(stackInSlot != null && stackInSlot.getItem() instanceof IManaItem) { - IManaItem manaItemSlot = (IManaItem) stackInSlot.getItem(); - - if(manaItemSlot.canReceiveManaFromItem(stackInSlot, stack)) { - if(stack.getItem() instanceof IManaItem && !((IManaItem) stack.getItem()).canExportManaToItem(stack, stackInSlot)) - continue; - - int received = 0; - if(manaItemSlot.getMana(stackInSlot) + manaToSend <= manaItemSlot.getMaxMana(stackInSlot)) - received = manaToSend; - else received = manaToSend - (manaItemSlot.getMana(stackInSlot) + manaToSend - manaItemSlot.getMaxMana(stackInSlot)); - - - if(add) - manaItemSlot.addMana(stackInSlot, manaToSend); - if(useBaubles) - BotaniaAPI.internalHandler.sendBaubleUpdatePacket(player, slot); - - return received; - } - } - } - - return 0; - } - - /** - * Dispatches an exact amount of mana to items in a given player's inventory. Note that this method - * does not automatically remove mana from the item which is exporting. - * @param manaToSend How much mana is to be sent. - * @param remove If true, the mana will be added from the target item. Set to false to just check. - * @return If an item received the mana sent. - */ - public static boolean dispatchManaExact(ItemStack stack, EntityPlayer player, int manaToSend, boolean add) { - if(stack == null) - return false; - - IInventory mainInv = player.inventory; - IInventory baublesInv = BotaniaAPI.internalHandler.getBaublesInventory(player); - - int invSize = mainInv.getSizeInventory(); - int size = invSize; - if(baublesInv != null) - size += baublesInv.getSizeInventory(); - - for(int i = 0; i < size; i++) { - boolean useBaubles = i >= invSize; - IInventory inv = useBaubles ? baublesInv : mainInv; - int slot = i - (useBaubles ? invSize : 0); - ItemStack stackInSlot = inv.getStackInSlot(slot); - if(stackInSlot == stack) - continue; - - if(stackInSlot != null && stackInSlot.getItem() instanceof IManaItem) { - IManaItem manaItemSlot = (IManaItem) stackInSlot.getItem(); - if(manaItemSlot.getMana(stackInSlot) + manaToSend <= manaItemSlot.getMaxMana(stackInSlot) && manaItemSlot.canReceiveManaFromItem(stackInSlot, stack)) { - if(stack.getItem() instanceof IManaItem && !((IManaItem) stack.getItem()).canExportManaToItem(stack, stackInSlot)) - continue; - - if(add) - manaItemSlot.addMana(stackInSlot, manaToSend); - if(useBaubles) - BotaniaAPI.internalHandler.sendBaubleUpdatePacket(player, slot); - - return true; - } - } - } - - return false; - } - - /** - * Requests mana from items in a given player's inventory. This version also - * checks for IManaDiscountArmor items equipped to lower the cost. - * @param manaToGet How much mana is to be requested, if less mana exists than this amount, - * the amount of mana existent will be returned instead, if you want exact values use requestManaExact. - * @param remove If true, the mana will be removed from the target item. Set to false to just check. - * @return The amount of mana received from the request. - */ - public static int requestManaForTool(ItemStack stack, EntityPlayer player, int manaToGet, boolean remove) { - float multiplier = Math.max(0F, 1F - getFullDiscountForTools(player)); - int cost = (int) (manaToGet * multiplier); - return (int) (requestMana(stack, player, cost, remove) / multiplier); - } - - /** - * Requests an exact amount of mana from items in a given player's inventory. This version also - * checks for IManaDiscountArmor items equipped to lower the cost. - * @param manaToGet How much mana is to be requested, if less mana exists than this amount, - * false will be returned instead, and nothing will happen. - * @param remove If true, the mana will be removed from the target item. Set to false to just check. - * @return If the request was succesful. - */ - public static boolean requestManaExactForTool(ItemStack stack, EntityPlayer player, int manaToGet, boolean remove) { - float multiplier = Math.max(0F, 1F - getFullDiscountForTools(player)); - int cost = (int) (manaToGet * multiplier); - return requestManaExact(stack, player, cost, remove); - } - - /** - * Gets the sum of all the discounts on IManaDiscountArmor items equipped - * on the player passed in. - */ - public static float getFullDiscountForTools(EntityPlayer player) { - float discount = 0F; - for(int i = 0; i < player.inventory.armorInventory.length; i++) { - ItemStack armor = player.inventory.armorInventory[i]; - if(armor != null && armor.getItem() instanceof IManaDiscountArmor) - discount += ((IManaDiscountArmor) armor.getItem()).getDiscount(armor, i, player); - } - - return discount; - } -} diff --git a/src/api/java/vazkii/botania/api/mana/ManaNetworkEvent.java b/src/api/java/vazkii/botania/api/mana/ManaNetworkEvent.java deleted file mode 100644 index 9116602..0000000 --- a/src/api/java/vazkii/botania/api/mana/ManaNetworkEvent.java +++ /dev/null @@ -1,56 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Jan 22, 2014, 5:04:30 PM (GMT)] - */ -package vazkii.botania.api.mana; - -import net.minecraft.tileentity.TileEntity; -import net.minecraftforge.common.MinecraftForge; -import cpw.mods.fml.common.eventhandler.Event; - -public class ManaNetworkEvent extends Event { - - public final TileEntity tile; - public final ManaBlockType type; - public final Action action; - - public ManaNetworkEvent(TileEntity tile, ManaBlockType type, Action action) { - this.tile = tile; - this.type = type; - this.action = action; - } - - public static void addCollector(TileEntity tile) { - ManaNetworkEvent event = new ManaNetworkEvent(tile, ManaBlockType.COLLECTOR, Action.ADD); - MinecraftForge.EVENT_BUS.post(event); - } - - public static void removeCollector(TileEntity tile) { - ManaNetworkEvent event = new ManaNetworkEvent(tile, ManaBlockType.COLLECTOR, Action.REMOVE); - MinecraftForge.EVENT_BUS.post(event); - } - - public static void addPool(TileEntity tile) { - ManaNetworkEvent event = new ManaNetworkEvent(tile, ManaBlockType.POOL, Action.ADD); - MinecraftForge.EVENT_BUS.post(event); - } - - public static void removePool(TileEntity tile) { - ManaNetworkEvent event = new ManaNetworkEvent(tile, ManaBlockType.POOL, Action.REMOVE); - MinecraftForge.EVENT_BUS.post(event); - } - - public enum ManaBlockType { - POOL, COLLECTOR - } - - public enum Action { - REMOVE, ADD - } -} diff --git a/src/api/java/vazkii/botania/api/mana/TileSignature.java b/src/api/java/vazkii/botania/api/mana/TileSignature.java deleted file mode 100644 index 5573670..0000000 --- a/src/api/java/vazkii/botania/api/mana/TileSignature.java +++ /dev/null @@ -1,15 +0,0 @@ -package vazkii.botania.api.mana; - -import net.minecraft.tileentity.TileEntity; - -public class TileSignature { - - public final TileEntity tile; - public final boolean remoteWorld; - - public TileSignature(TileEntity tile, boolean remoteWorld) { - this.tile = tile; - this.remoteWorld = remoteWorld; - } - -} diff --git a/src/api/java/vazkii/botania/api/mana/spark/ISparkAttachable.java b/src/api/java/vazkii/botania/api/mana/spark/ISparkAttachable.java deleted file mode 100644 index 880e169..0000000 --- a/src/api/java/vazkii/botania/api/mana/spark/ISparkAttachable.java +++ /dev/null @@ -1,59 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Aug 21, 2014, 5:44:13 PM (GMT)] - */ -package vazkii.botania.api.mana.spark; - -import net.minecraft.item.ItemStack; -import vazkii.botania.api.mana.IManaReceiver; - -/** - * A TileEntity that implements this can have a Spark attached to it. - * For the Spark to be allowed to have upgrades, it needs to be an IManaPool. - */ -public interface ISparkAttachable extends IManaReceiver { - - /** - * Can this block have a Spark attached to it. Note that this will not - * unattach the Spark if it's changed later. - */ - public boolean canAttachSpark(ItemStack stack); - - /** - * Called when the Spark is attached. - */ - public void attachSpark(ISparkEntity entity); - - /** - * Returns how much space for mana is available in this block, normally the total - the current. - * Should NEVER return negative values. Make sure to check against that. - */ - public int getAvailableSpaceForMana(); - - /** - * Gets the Spark that is attached to this block. A common implementation is - * to check for Spark entities above: - * - List sparks = worldObj.getEntitiesWithinAABB(ISparkEntity.class, AxisAlignedBB.getBoundingBox(xCoord, yCoord + 1, zCoord, xCoord + 1, yCoord + 2, zCoord + 1)); - if(sparks.size() == 1) { - Entity e = (Entity) sparks.get(0); - return (ISparkEntity) e; - } - - return null; - */ - public ISparkEntity getAttachedSpark(); - - /** - * Return true if this Tile no longer requires mana and all Sparks - * transferring mana to it should cancel their transfer. - */ - public boolean areIncomingTranfersDone(); - -} diff --git a/src/api/java/vazkii/botania/api/mana/spark/ISparkEntity.java b/src/api/java/vazkii/botania/api/mana/spark/ISparkEntity.java deleted file mode 100644 index e35076c..0000000 --- a/src/api/java/vazkii/botania/api/mana/spark/ISparkEntity.java +++ /dev/null @@ -1,64 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Aug 21, 2014, 5:44:07 PM (GMT)] - */ -package vazkii.botania.api.mana.spark; - -import java.util.Collection; - -/** - * An Entity that implements this is considered a Spark. - */ -public interface ISparkEntity { - - /** - * Which TileEntity is this Spark attached to? A common implementation is checking the block below. - * - int x = MathHelper.floor_double(posX); - int y = MathHelper.floor_double(posY) - 1; - int z = MathHelper.floor_double(posZ); - TileEntity tile = worldObj.getTileEntity(x, y, z); - if(tile != null && tile instanceof ISparkAttachable) - return (ISparkAttachable) tile; - - return null; - */ - public ISparkAttachable getAttachedTile(); - - /** - * Gets a collection of all Sparks this is tranfering to. - */ - public Collection getTransfers(); - - /** - * Registers the Spark passed in as a Spark meant for mana to be transfered towards. - */ - public void registerTransfer(ISparkEntity entity); - - /** - * Gets which upgrade is in this Spark.
    - * 0: None
    - * 1: Dispersive
    - * 2: Dominant
    - * 3: Recessive
    - * 4: Isolated - */ - public int getUpgrade(); - - /** - * Sets the upgrade on this Spark. See {@link ISparkEntity#getUpgrade} - */ - public void setUpgrade(int upgrade); - - /** - * See {@link ISparkAttachable#areIncomingTranfersDone()} - */ - public boolean areIncomingTransfersDone(); - -} diff --git a/src/api/java/vazkii/botania/api/mana/spark/SparkHelper.java b/src/api/java/vazkii/botania/api/mana/spark/SparkHelper.java deleted file mode 100644 index 7351036..0000000 --- a/src/api/java/vazkii/botania/api/mana/spark/SparkHelper.java +++ /dev/null @@ -1,32 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Aug 21, 2014, 7:16:11 PM (GMT)] - */ -package vazkii.botania.api.mana.spark; - -import java.util.List; - -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.world.World; - -public final class SparkHelper { - - public static final int SPARK_SCAN_RANGE = 12; - - public static List getSparksAround(World world, double x, double y, double z) { - return SparkHelper.getEntitiesAround(ISparkEntity.class, world, x, y, z); - } - - public static List getEntitiesAround(Class clazz, World world, double x, double y, double z) { - int r = SPARK_SCAN_RANGE; - List entities = world.getEntitiesWithinAABB(clazz, AxisAlignedBB.getBoundingBox(x - r, y - r, z - r, x + r, y + r, z + r)); - return entities; - } - -} diff --git a/src/api/java/vazkii/botania/api/package-info.java b/src/api/java/vazkii/botania/api/package-info.java deleted file mode 100644 index d8a672b..0000000 --- a/src/api/java/vazkii/botania/api/package-info.java +++ /dev/null @@ -1,4 +0,0 @@ -@API(owner = "Botania", apiVersion = "61", provides = "BotaniaAPI") -package vazkii.botania.api; -import cpw.mods.fml.common.API; - diff --git a/src/api/java/vazkii/botania/api/recipe/ElvenPortalUpdateEvent.java b/src/api/java/vazkii/botania/api/recipe/ElvenPortalUpdateEvent.java deleted file mode 100644 index 40d9713..0000000 --- a/src/api/java/vazkii/botania/api/recipe/ElvenPortalUpdateEvent.java +++ /dev/null @@ -1,42 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Apr 17, 2015, 4:58:30 PM (GMT)] - */ -package vazkii.botania.api.recipe; - -import java.util.List; - -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.AxisAlignedBB; -import cpw.mods.fml.common.eventhandler.Event; - -/** - * An event fired when an Elven Portal TE updates. The portal's - * relevant AABB and other stuff is passed in for convenience. This - * is fired in MinecraftForge.EVENT_BUS. - */ -public class ElvenPortalUpdateEvent extends Event { - - /** - * May be casted to TileAlfPortal if you have botania code access aside from the API. - */ - public final TileEntity portalTile; - public final AxisAlignedBB aabb; - public boolean open; - public final List stacksInside; - - public ElvenPortalUpdateEvent(TileEntity te, AxisAlignedBB aabb, boolean open, List stacks) { - portalTile = te; - this.aabb = aabb; - this.open = open; - stacksInside = stacks; - } - -} diff --git a/src/api/java/vazkii/botania/api/recipe/IElvenItem.java b/src/api/java/vazkii/botania/api/recipe/IElvenItem.java deleted file mode 100644 index e614014..0000000 --- a/src/api/java/vazkii/botania/api/recipe/IElvenItem.java +++ /dev/null @@ -1,14 +0,0 @@ -package vazkii.botania.api.recipe; - -import net.minecraft.item.ItemStack; - -/** - * Any Item that implements this is classified as an "Elven Item", by which, - * it'll not go through the alfheim portal. Any item that comes out of it - * must implement this or it'll just go back in. - */ -public interface IElvenItem { - - public boolean isElvenItem(ItemStack stack); - -} diff --git a/src/api/java/vazkii/botania/api/recipe/IFlowerComponent.java b/src/api/java/vazkii/botania/api/recipe/IFlowerComponent.java deleted file mode 100644 index ca46124..0000000 --- a/src/api/java/vazkii/botania/api/recipe/IFlowerComponent.java +++ /dev/null @@ -1,25 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Feb 15, 2014, 2:36:35 PM (GMT)] - */ -package vazkii.botania.api.recipe; - -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; - -/** - * Have an Item implement this to allow it to be used in the Petal Apothecary. - */ -public interface IFlowerComponent { - - public boolean canFit(ItemStack stack, IInventory apothecary); - - public int getParticleColor(ItemStack stack); - -} diff --git a/src/api/java/vazkii/botania/api/recipe/RecipeBrew.java b/src/api/java/vazkii/botania/api/recipe/RecipeBrew.java deleted file mode 100644 index 9557778..0000000 --- a/src/api/java/vazkii/botania/api/recipe/RecipeBrew.java +++ /dev/null @@ -1,114 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Nov 1, 2014, 8:52:00 PM (GMT)] - */ -package vazkii.botania.api.recipe; - -import java.util.ArrayList; -import java.util.List; - -import net.minecraft.init.Items; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; -import net.minecraftforge.oredict.OreDictionary; -import vazkii.botania.api.brew.Brew; -import vazkii.botania.api.brew.IBrewContainer; - -public class RecipeBrew { - - Brew brew; - List inputs; - - public RecipeBrew(Brew brew, Object... inputs) { - this.brew = brew; - - List inputsToSet = new ArrayList(); - for(Object obj : inputs) { - if(obj instanceof String || obj instanceof ItemStack) - inputsToSet.add(obj); - else throw new IllegalArgumentException("Invalid input"); - } - - this.inputs = inputsToSet; - } - - public boolean matches(IInventory inv) { - List inputsMissing = new ArrayList(inputs); - - for(int i = 0; i < inv.getSizeInventory(); i++) { - ItemStack stack = inv.getStackInSlot(i); - if(stack == null) - break; - - if(stack.getItem() instanceof IBrewContainer) - continue; - - int stackIndex = -1, oredictIndex = -1; - - for(int j = 0; j < inputsMissing.size(); j++) { - Object input = inputsMissing.get(j); - if(input instanceof String) { - List validStacks = OreDictionary.getOres((String) input); - boolean found = false; - for(ItemStack ostack : validStacks) { - ItemStack cstack = ostack.copy(); - if(cstack.getItemDamage() == Short.MAX_VALUE) - cstack.setItemDamage(stack.getItemDamage()); - - if(stack.isItemEqual(cstack)) { - oredictIndex = j; - found = true; - break; - } - } - - - if(found) - break; - } else if(input instanceof ItemStack && simpleAreStacksEqual((ItemStack) input, stack)) { - stackIndex = j; - break; - } - } - - if(stackIndex != -1) - inputsMissing.remove(stackIndex); - else if(oredictIndex != -1) - inputsMissing.remove(oredictIndex); - else return false; - } - - return inputsMissing.isEmpty(); - } - - boolean simpleAreStacksEqual(ItemStack stack, ItemStack stack2) { - return stack.getItem() == stack2.getItem() && stack.getItemDamage() == stack2.getItemDamage(); - } - - public List getInputs() { - return new ArrayList(inputs); - } - - public Brew getBrew() { - return brew; - } - - public int getManaUsage() { - return brew.getManaCost(); - } - - public ItemStack getOutput(ItemStack stack) { - if(stack == null || !(stack.getItem() instanceof IBrewContainer)) - return new ItemStack(Items.glass_bottle); // Fallback... - IBrewContainer container = (IBrewContainer) stack.getItem(); - - return container.getItemForBrew(brew, stack); - } - -} diff --git a/src/api/java/vazkii/botania/api/recipe/RecipeElvenTrade.java b/src/api/java/vazkii/botania/api/recipe/RecipeElvenTrade.java deleted file mode 100644 index dbea13e..0000000 --- a/src/api/java/vazkii/botania/api/recipe/RecipeElvenTrade.java +++ /dev/null @@ -1,94 +0,0 @@ -package vazkii.botania.api.recipe; - -import java.util.ArrayList; -import java.util.List; - -import net.minecraft.item.ItemStack; -import net.minecraftforge.oredict.OreDictionary; - -public class RecipeElvenTrade { - - ItemStack output; - List inputs; - - public RecipeElvenTrade(ItemStack output, Object... inputs) { - this.output = output; - - List inputsToSet = new ArrayList(); - for(Object obj : inputs) { - if(obj instanceof String || obj instanceof ItemStack) - inputsToSet.add(obj); - else throw new IllegalArgumentException("Invalid input"); - } - - this.inputs = inputsToSet; - } - - public boolean matches(List stacks, boolean remove) { - List inputsMissing = new ArrayList(inputs); - List stacksToRemove = new ArrayList(); - - for(ItemStack stack : stacks) { - if(stack == null) { - continue; - } - if(inputsMissing.isEmpty()) - break; - - int stackIndex = -1, oredictIndex = -1; - - for(int j = 0; j < inputsMissing.size(); j++) { - Object input = inputsMissing.get(j); - if(input instanceof String) { - List validStacks = OreDictionary.getOres((String) input); - boolean found = false; - for(ItemStack ostack : validStacks) { - ItemStack cstack = ostack.copy(); - if(cstack.getItemDamage() == Short.MAX_VALUE) - cstack.setItemDamage(stack.getItemDamage()); - - if(stack.isItemEqual(cstack)) { - if(!stacksToRemove.contains(stack)) - stacksToRemove.add(stack); - oredictIndex = j; - found = true; - break; - } - } - - if(found) - break; - } else if(input instanceof ItemStack && simpleAreStacksEqual((ItemStack) input, stack)) { - if(!stacksToRemove.contains(stack)) - stacksToRemove.add(stack); - stackIndex = j; - break; - } - } - - if(stackIndex != -1) - inputsMissing.remove(stackIndex); - else if(oredictIndex != -1) - inputsMissing.remove(oredictIndex); - } - - if(remove) - for(ItemStack r : stacksToRemove) - stacks.remove(r); - - return inputsMissing.isEmpty(); - } - - boolean simpleAreStacksEqual(ItemStack stack, ItemStack stack2) { - return stack.getItem() == stack2.getItem() && stack.getItemDamage() == stack2.getItemDamage(); - } - - public List getInputs() { - return new ArrayList(inputs); - } - - public ItemStack getOutput() { - return output; - } - -} diff --git a/src/api/java/vazkii/botania/api/recipe/RecipeManaInfusion.java b/src/api/java/vazkii/botania/api/recipe/RecipeManaInfusion.java deleted file mode 100644 index 368c8d4..0000000 --- a/src/api/java/vazkii/botania/api/recipe/RecipeManaInfusion.java +++ /dev/null @@ -1,85 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Jan 30, 2014, 5:57:07 PM (GMT)] - */ -package vazkii.botania.api.recipe; - -import java.util.List; - -import net.minecraft.item.ItemStack; -import net.minecraftforge.oredict.OreDictionary; - -public class RecipeManaInfusion { - - ItemStack output; - Object input; - int mana; - boolean isAlchemy = false; - boolean isConjuration = false; - - public RecipeManaInfusion(ItemStack output, Object input, int mana) { - this.output = output; - this.input = input; - this.mana = mana; - } - - public boolean matches(ItemStack stack) { - if(input instanceof ItemStack) { - ItemStack inputCopy = ((ItemStack) input).copy(); - if(inputCopy.getItemDamage() == Short.MAX_VALUE) - inputCopy.setItemDamage(stack.getItemDamage()); - - return stack.isItemEqual(inputCopy); - } - - if(input instanceof String) { - List validStacks = OreDictionary.getOres((String) input); - - for(ItemStack ostack : validStacks) { - ItemStack cstack = ostack.copy(); - if(cstack.getItemDamage() == Short.MAX_VALUE) - cstack.setItemDamage(stack.getItemDamage()); - - if(stack.isItemEqual(cstack)) - return true; - } - } - - return false; - } - - public void setAlchemy(boolean alchemy) { - isAlchemy = alchemy; - } - - public boolean isAlchemy() { - return isAlchemy; - } - - public void setConjuration(boolean conjuration) { - isConjuration = conjuration; - } - - public boolean isConjuration() { - return isConjuration; - } - - public Object getInput() { - return input; - } - - public ItemStack getOutput() { - return output; - } - - public int getManaToConsume() { - return mana; - } -} - diff --git a/src/api/java/vazkii/botania/api/recipe/RecipeMiniFlower.java b/src/api/java/vazkii/botania/api/recipe/RecipeMiniFlower.java deleted file mode 100644 index 92908c0..0000000 --- a/src/api/java/vazkii/botania/api/recipe/RecipeMiniFlower.java +++ /dev/null @@ -1,30 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Apr 22, 2015, 5:57:59 PM (GMT)] - */ -package vazkii.botania.api.recipe; - -import net.minecraft.item.ItemStack; -import vazkii.botania.api.BotaniaAPI; - -public class RecipeMiniFlower extends RecipeManaInfusion { - - public RecipeMiniFlower(String flower, String mini, int mana) { - super(BotaniaAPI.internalHandler.getSubTileAsStack(flower), BotaniaAPI.internalHandler.getSubTileAsStack(mini), mana); - setAlchemy(true); - } - - @Override - public boolean matches(ItemStack stack) { - String key = BotaniaAPI.internalHandler.getStackSubTileKey(stack); - String input = this.input instanceof String ? (String) this.input : BotaniaAPI.internalHandler.getStackSubTileKey((ItemStack) this.input); - return key != null && key.equals(input); - } - -} diff --git a/src/api/java/vazkii/botania/api/recipe/RecipePetals.java b/src/api/java/vazkii/botania/api/recipe/RecipePetals.java deleted file mode 100644 index 60e4635..0000000 --- a/src/api/java/vazkii/botania/api/recipe/RecipePetals.java +++ /dev/null @@ -1,96 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Jan 22, 2014, 2:02:44 PM (GMT)] - */ -package vazkii.botania.api.recipe; - -import java.util.ArrayList; -import java.util.List; - -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; -import net.minecraftforge.oredict.OreDictionary; - -public class RecipePetals { - - ItemStack output; - List inputs; - - public RecipePetals(ItemStack output, Object... inputs) { - this.output = output; - - List inputsToSet = new ArrayList(); - for(Object obj : inputs) { - if(obj instanceof String || obj instanceof ItemStack) - inputsToSet.add(obj); - else throw new IllegalArgumentException("Invalid input"); - } - - this.inputs = inputsToSet; - } - - public boolean matches(IInventory inv) { - List inputsMissing = new ArrayList(inputs); - - for(int i = 0; i < inv.getSizeInventory(); i++) { - ItemStack stack = inv.getStackInSlot(i); - if(stack == null) - break; - - int stackIndex = -1, oredictIndex = -1; - - for(int j = 0; j < inputsMissing.size(); j++) { - Object input = inputsMissing.get(j); - if(input instanceof String) { - List validStacks = OreDictionary.getOres((String) input); - boolean found = false; - for(ItemStack ostack : validStacks) { - ItemStack cstack = ostack.copy(); - if(cstack.getItemDamage() == Short.MAX_VALUE) - cstack.setItemDamage(stack.getItemDamage()); - - if(stack.isItemEqual(cstack)) { - oredictIndex = j; - found = true; - break; - } - } - - - if(found) - break; - } else if(input instanceof ItemStack && simpleAreStacksEqual((ItemStack) input, stack)) { - stackIndex = j; - break; - } - } - - if(stackIndex != -1) - inputsMissing.remove(stackIndex); - else if(oredictIndex != -1) - inputsMissing.remove(oredictIndex); - else return false; - } - - return inputsMissing.isEmpty(); - } - - boolean simpleAreStacksEqual(ItemStack stack, ItemStack stack2) { - return stack.getItem() == stack2.getItem() && stack.getItemDamage() == stack2.getItemDamage(); - } - - public List getInputs() { - return new ArrayList(inputs); - } - - public ItemStack getOutput() { - return output; - } - -} diff --git a/src/api/java/vazkii/botania/api/recipe/RecipePureDaisy.java b/src/api/java/vazkii/botania/api/recipe/RecipePureDaisy.java deleted file mode 100644 index 19248e6..0000000 --- a/src/api/java/vazkii/botania/api/recipe/RecipePureDaisy.java +++ /dev/null @@ -1,99 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Apr 17, 2015, 5:07:25 PM (GMT)] - */ -package vazkii.botania.api.recipe; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import net.minecraft.block.Block; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import net.minecraftforge.oredict.OreDictionary; -import vazkii.botania.api.subtile.SubTileEntity; - -public class RecipePureDaisy { - - private static final Map> oreMap = new HashMap(); - - Object input; - Block output; - int outputMeta; - - public RecipePureDaisy(Object input, Block output, int outputMeta) { - this.input = input; - this.output = output; - this.outputMeta = outputMeta; - - if(input != null && !(input instanceof String || input instanceof Block)) - throw new IllegalArgumentException("input must be an oredict String or a Block."); - } - - /** - * This gets called every tick, please be careful with your checks. - */ - public boolean matches(World world, int x, int y, int z, SubTileEntity pureDaisy, Block block, int meta) { - if(input instanceof Block) - return block == input; - - ItemStack stack = new ItemStack(block, 1, meta); - String oredict = (String) input; - return isOreDict(stack, oredict); - } - - public boolean isOreDict(ItemStack stack, String entry) { - if(stack == null || stack.getItem() == null) - return false; - - List ores; - if(oreMap.containsKey(entry)) - ores = oreMap.get(entry); - else { - ores = OreDictionary.getOres(entry); - oreMap.put(entry, ores); - } - - for(ItemStack ostack : ores) { - ItemStack cstack = ostack.copy(); - if(cstack.getItemDamage() == Short.MAX_VALUE) - cstack.setItemDamage(stack.getItemDamage()); - - if(stack.isItemEqual(cstack)) - return true; - } - - return false; - } - - /** - * Returns true if the block was placed (and if the Pure Daisy should do particles and stuffs). - * Should only place the block if !world.isRemote, but should return true if it would've placed - * it otherwise. You may return false to cancel the normal particles and do your own. - */ - public boolean set(World world, int x, int y, int z, SubTileEntity pureDaisy) { - if(!world.isRemote) - world.setBlock(x, y, z, output, outputMeta, 1 | 2); - return true; - } - - public Object getInput() { - return input; - } - - public Block getOutput() { - return output; - } - - public int getOutputMeta() { - return outputMeta; - } - -} diff --git a/src/api/java/vazkii/botania/api/recipe/RecipeRuneAltar.java b/src/api/java/vazkii/botania/api/recipe/RecipeRuneAltar.java deleted file mode 100644 index f8bb211..0000000 --- a/src/api/java/vazkii/botania/api/recipe/RecipeRuneAltar.java +++ /dev/null @@ -1,28 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Feb 5, 2014, 1:41:14 PM (GMT)] - */ -package vazkii.botania.api.recipe; - -import net.minecraft.item.ItemStack; - -public class RecipeRuneAltar extends RecipePetals { - - int mana; - - public RecipeRuneAltar(ItemStack output, int mana, Object... inputs) { - super(output, inputs); - this.mana = mana; - } - - public int getManaUsage() { - return mana; - } - -} diff --git a/src/api/java/vazkii/botania/api/subtile/ISpecialFlower.java b/src/api/java/vazkii/botania/api/subtile/ISpecialFlower.java deleted file mode 100644 index 3bca431..0000000 --- a/src/api/java/vazkii/botania/api/subtile/ISpecialFlower.java +++ /dev/null @@ -1,20 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Jan 22, 2014, 7:12:28 PM (GMT)] - */ -package vazkii.botania.api.subtile; - -/** - * The special flowers in botania implement this. Used for cases where - * BlockFlower would be checked against, but isn't convenient for - * the special flowers with effects. For Azanor and Lycaon. - */ -public interface ISpecialFlower { - -} diff --git a/src/api/java/vazkii/botania/api/subtile/ISubTileContainer.java b/src/api/java/vazkii/botania/api/subtile/ISubTileContainer.java deleted file mode 100644 index 3a99d6d..0000000 --- a/src/api/java/vazkii/botania/api/subtile/ISubTileContainer.java +++ /dev/null @@ -1,29 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Aug 26, 2014, 5:42:16 PM (GMT)] - */ -package vazkii.botania.api.subtile; - -/** - * A TileEntity that implements this contains a SubTileEntity. - */ -public interface ISubTileContainer { - - /** - * Gets the SubTile in this block. Generally shouldn't return null, but in that - * case use the fallback DummySubTile. - */ - public SubTileEntity getSubTile(); - - /** - * Sets the SubTile on this block from it's name. - */ - public void setSubTile(String name); - -} diff --git a/src/api/java/vazkii/botania/api/subtile/RadiusDescriptor.java b/src/api/java/vazkii/botania/api/subtile/RadiusDescriptor.java deleted file mode 100644 index f57b6fa..0000000 --- a/src/api/java/vazkii/botania/api/subtile/RadiusDescriptor.java +++ /dev/null @@ -1,89 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Mar 31, 2015, 2:59:19 PM (GMT)] - */ -package vazkii.botania.api.subtile; - -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.ChunkCoordinates; - -/** - * This object describes the Radius of a SubTileEntity. It can either be - * a circle or rectangle, it's to note that the - */ -public class RadiusDescriptor { - - final ChunkCoordinates subtileCoords; - - public RadiusDescriptor(ChunkCoordinates subtileCoords) { - this.subtileCoords = subtileCoords; - } - - public ChunkCoordinates getSubtileCoords() { - return subtileCoords; - } - - public boolean isCircle() { - return false; - } - - public double getCircleRadius() { - return 0; - } - - public AxisAlignedBB getAABB() { - return null; - } - - public static class Circle extends RadiusDescriptor { - - final double radius; - - public Circle(ChunkCoordinates subtileCoords, double radius) { - super(subtileCoords); - this.radius = radius; - } - - @Override - public boolean isCircle() { - return true; - } - - @Override - public double getCircleRadius() { - return radius; - } - - } - - public static class Rectangle extends RadiusDescriptor { - - final AxisAlignedBB aabb; - - public Rectangle(ChunkCoordinates subtileCoords, AxisAlignedBB aabb) { - super(subtileCoords); - this.aabb = aabb; - } - - @Override - public AxisAlignedBB getAABB() { - return aabb; - } - - } - - public static class Square extends Rectangle { - - public Square(ChunkCoordinates subtileCoords, int expand) { - super(subtileCoords, AxisAlignedBB.getBoundingBox(subtileCoords.posX - expand, subtileCoords.posY, subtileCoords.posZ - expand, subtileCoords.posX + 1 + expand, subtileCoords.posY, subtileCoords.posZ + 1 + expand)); - } - - } - -} diff --git a/src/api/java/vazkii/botania/api/subtile/SubTileEntity.java b/src/api/java/vazkii/botania/api/subtile/SubTileEntity.java deleted file mode 100644 index fa58466..0000000 --- a/src/api/java/vazkii/botania/api/subtile/SubTileEntity.java +++ /dev/null @@ -1,218 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Jan 24, 2014, 3:59:06 PM (GMT)] - */ -package vazkii.botania.api.subtile; - -import java.util.ArrayList; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.ScaledResolution; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.IIcon; -import net.minecraft.world.World; -import vazkii.botania.api.BotaniaAPI; -import vazkii.botania.api.internal.VanillaPacketDispatcher; -import vazkii.botania.api.lexicon.LexiconEntry; -import vazkii.botania.api.wand.IWandBindable; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -/** - * A Sub-TileEntity, this is used for the flower system. Make sure to map subclasses - * of this using BotaniaAPI.mapSubTile(String, Class). Any subclass of this must have - * a no parameter constructor. - */ -public class SubTileEntity { - - protected TileEntity supertile; - - public int ticksExisted = 0; - - /** The Tag items should use to store which sub tile they are. **/ - public static final String TAG_TYPE = "type"; - public static final String TAG_TICKS_EXISTED = "ticksExisted"; - - public void setSupertile(TileEntity tile) { - supertile = tile; - } - - public boolean canUpdate() { - return true; - } - - public void onUpdate() { - ticksExisted++; - } - - public final void writeToPacketNBTInternal(NBTTagCompound cmp) { - cmp.setInteger(TAG_TICKS_EXISTED, ticksExisted); - writeToPacketNBT(cmp); - } - - public final void readFromPacketNBTInternal(NBTTagCompound cmp) { - if(cmp.hasKey(TAG_TICKS_EXISTED)) - ticksExisted = cmp.getInteger(TAG_TICKS_EXISTED); - readFromPacketNBT(cmp); - } - - /** - * Writes some extra data to a network packet. This data is read - * by readFromPacketNBT on the client that receives the packet. - * Note: This method is also used to write to the world NBT. - */ - public void writeToPacketNBT(NBTTagCompound cmp) { } - - /** - * Reads data from a network packet. This data is written by - * writeToPacketNBT in the server. Note: This method is also used - * to read from the world NBT. - */ - public void readFromPacketNBT(NBTTagCompound cmp) { } - - public void sync() { - VanillaPacketDispatcher.dispatchTEToNearbyPlayers(supertile); - } - - public String getUnlocalizedName() { - return BotaniaAPI.getSubTileStringMapping(getClass()); - } - - /** - * Gets the icon for this SubTileEntity, this is a block icon. - */ - @SideOnly(Side.CLIENT) - public IIcon getIcon() { - return BotaniaAPI.internalHandler.getSubTileIconForName(getUnlocalizedName()); - } - - /** - * Called when a Wand of the Forest is used on this sub tile. Note that the - * player parameter can be null if this is called from a dispenser. - */ - public boolean onWanded(EntityPlayer player, ItemStack wand) { - return false; - } - - /** - * Called when this sub tile is placed in the world (by an entity). - */ - public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase entity, ItemStack stack) { - // NO-OP - } - - /** - * Called when a player right clicks this sub tile. - */ - public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) { return false; } - - /** - * Called when this sub tile is added to the world. - */ - public void onBlockAdded(World world, int x, int y, int z) { - //NO-OP - } - - /** - * Called when this sub tile is harvested - */ - public void onBlockHarvested(World world, int x, int y, int z, int side, EntityPlayer player) { - //NO-OP - } - - /** - * Allows additional processing of sub tile drops - */ - public ArrayList getDrops(ArrayList list) { - return list; - } - - /** - * Gets which Lexicon Entry to open when this sub tile is right clicked with a lexicon. - */ - public LexiconEntry getEntry() { - return null; - } - - /** - * Gets the block coordinates this is bound to, for use with the wireframe render - * when the sub tile is being hovered with a wand of the forest. - */ - @SideOnly(Side.CLIENT) - public ChunkCoordinates getBinding() { - return null; - } - - /** - * Returns a descriptor for the radius of this sub tile. This is called while a player - * is looking at the block with a Manaseer Monocle (IBurstViewerBauble). - */ - @SideOnly(Side.CLIENT) - public RadiusDescriptor getRadius() { - return null; - } - - /** - * Gets a ChunkCoordinates instance with the position of this sub tile. - */ - public ChunkCoordinates toChunkCoordinates() { - return new ChunkCoordinates(supertile.xCoord, supertile.yCoord, supertile.zCoord); - } - - /** - * @see IWandBindable#canSelect(EntityPlayer, ItemStack, int, int, int, int) - */ - public boolean canSelect(EntityPlayer player, ItemStack wand, int x, int y, int z, int side) { - return false; - } - - /** - * @see IWandBindable#bindTo(EntityPlayer, ItemStack, int, int, int, int) - */ - public boolean bindTo(EntityPlayer player, ItemStack wand, int x, int y, int z, int side) { - return false; - } - - /** - * Called on the client when the block being pointed at is the one with this sub tile. - * Used to render a HUD portraying some data from this sub tile. - */ - @SideOnly(Side.CLIENT) - public void renderHUD(Minecraft mc, ScaledResolution res) { - // NO-OP - } - - /** - * Gets the light value for this SubTileEntity, this is a int (-1 to default to the flower) - */ - public int getLightValue() { - return -1; - } - - /** - * Gets the comparator input value for this SubTileEntity - */ - public int getComparatorInputOverride(int side) { - return 0; - } - - /** - * Gets the redstone power level for this SubTileEntity - */ - public int getPowerLevel(int side) { - return 0; - } - - -} diff --git a/src/api/java/vazkii/botania/api/subtile/SubTileFunctional.java b/src/api/java/vazkii/botania/api/subtile/SubTileFunctional.java deleted file mode 100644 index d6156ea..0000000 --- a/src/api/java/vazkii/botania/api/subtile/SubTileFunctional.java +++ /dev/null @@ -1,220 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Jan 24, 2014, 8:03:44 PM (GMT)] - */ -package vazkii.botania.api.subtile; - -import java.awt.Color; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.ScaledResolution; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.StatCollector; -import net.minecraftforge.common.util.ForgeDirection; -import vazkii.botania.api.BotaniaAPI; -import vazkii.botania.api.internal.IManaNetwork; -import vazkii.botania.api.mana.IManaPool; - -/** - * The basic class for a Functional Flower. - */ -public class SubTileFunctional extends SubTileEntity { - - public static final int RANGE = 10; - - private static final String TAG_MANA = "mana"; - - private static final String TAG_POOL_X = "poolX"; - private static final String TAG_POOL_Y = "poolY"; - private static final String TAG_POOL_Z = "poolZ"; - - public int mana; - - public int redstoneSignal = 0; - - int sizeLastCheck = -1; - TileEntity linkedPool = null; - public int knownMana = -1; - - ChunkCoordinates cachedPoolCoordinates = null; - - /** - * If set to true, redstoneSignal will be updated every tick. - */ - public boolean acceptsRedstone() { - return false; - } - - @Override - public void onUpdate() { - super.onUpdate(); - - linkPool(); - - if(linkedPool != null && isValidBinding()) { - IManaPool pool = (IManaPool) linkedPool; - int manaInPool = pool.getCurrentMana(); - int manaMissing = getMaxMana() - mana; - int manaToRemove = Math.min(manaMissing, manaInPool); - pool.recieveMana(-manaToRemove); - addMana(manaToRemove); - } - - if(acceptsRedstone()) { - redstoneSignal = 0; - for(ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) { - int redstoneSide = supertile.getWorldObj().getIndirectPowerLevelTo(supertile.xCoord + dir.offsetX, supertile.yCoord + dir.offsetY, supertile.zCoord + dir.offsetZ, dir.ordinal()); - redstoneSignal = Math.max(redstoneSignal, redstoneSide); - } - } - - if(supertile.getWorldObj().isRemote) { - double particleChance = 1F - (double) mana / (double) getMaxMana() / 3.5F; - Color color = new Color(getColor()); - if(Math.random() > particleChance) - BotaniaAPI.internalHandler.sparkleFX(supertile.getWorldObj(), supertile.xCoord + 0.3 + Math.random() * 0.5, supertile.yCoord + 0.5 + Math.random() * 0.5, supertile.zCoord + 0.3 + Math.random() * 0.5, color.getRed() / 255F, color.getGreen() / 255F, color.getBlue() / 255F, (float) Math.random(), 5); - } - } - - public void linkPool() { - boolean needsNew = false; - if(linkedPool == null) { - needsNew = true; - - if(cachedPoolCoordinates != null) { - needsNew = false; - if(supertile.getWorldObj().blockExists(cachedPoolCoordinates.posX, cachedPoolCoordinates.posY, cachedPoolCoordinates.posZ)) { - needsNew = true; - TileEntity tileAt = supertile.getWorldObj().getTileEntity(cachedPoolCoordinates.posX, cachedPoolCoordinates.posY, cachedPoolCoordinates.posZ); - if(tileAt != null && tileAt instanceof IManaPool && !tileAt.isInvalid()) { - linkedPool = tileAt; - needsNew = false; - } - cachedPoolCoordinates = null; - } - } - } else { - TileEntity tileAt = supertile.getWorldObj().getTileEntity(linkedPool.xCoord, linkedPool.yCoord, linkedPool.zCoord); - if(tileAt != null && tileAt instanceof IManaPool) - linkedPool = tileAt; - } - - if(needsNew && ticksExisted == 1) { // Only for new flowers - IManaNetwork network = BotaniaAPI.internalHandler.getManaNetworkInstance(); - int size = network.getAllPoolsInWorld(supertile.getWorldObj()).size(); - if(BotaniaAPI.internalHandler.shouldForceCheck() || size != sizeLastCheck) { - ChunkCoordinates coords = new ChunkCoordinates(supertile.xCoord, supertile.yCoord, supertile.zCoord); - linkedPool = network.getClosestPool(coords, supertile.getWorldObj(), RANGE); - sizeLastCheck = size; - } - } - } - - public void linkToForcefully(TileEntity pool) { - linkedPool = pool; - } - - public void addMana(int mana) { - this.mana = Math.min(getMaxMana(), this.mana + mana); - } - - @Override - public boolean onWanded(EntityPlayer player, ItemStack wand) { - if(player == null) - return false; - - knownMana = mana; - player.worldObj.playSoundAtEntity(player, "botania:ding", 0.1F, 1F); - - return super.onWanded(player, wand); - } - - public int getMaxMana() { - return 20; - } - - public int getColor() { - return 0xFFFFFF; - } - - @Override - public void readFromPacketNBT(NBTTagCompound cmp) { - mana = cmp.getInteger(TAG_MANA); - - int x = cmp.getInteger(TAG_POOL_X); - int y = cmp.getInteger(TAG_POOL_Y); - int z = cmp.getInteger(TAG_POOL_Z); - - cachedPoolCoordinates = y < 0 ? null : new ChunkCoordinates(x, y, z); - } - - @Override - public void writeToPacketNBT(NBTTagCompound cmp) { - cmp.setInteger(TAG_MANA, mana); - - if(cachedPoolCoordinates != null) { - cmp.setInteger(TAG_POOL_X, cachedPoolCoordinates.posX); - cmp.setInteger(TAG_POOL_Y, cachedPoolCoordinates.posY); - cmp.setInteger(TAG_POOL_Z, cachedPoolCoordinates.posZ); - } else { - int x = linkedPool == null ? 0 : linkedPool.xCoord; - int y = linkedPool == null ? -1 : linkedPool.yCoord; - int z = linkedPool == null ? 0 : linkedPool.zCoord; - - cmp.setInteger(TAG_POOL_X, x); - cmp.setInteger(TAG_POOL_Y, y); - cmp.setInteger(TAG_POOL_Z, z); - } - } - - @Override - public ChunkCoordinates getBinding() { - if(linkedPool == null) - return null; - return new ChunkCoordinates(linkedPool.xCoord, linkedPool.yCoord, linkedPool.zCoord); - } - - @Override - public boolean canSelect(EntityPlayer player, ItemStack wand, int x, int y, int z, int side) { - return true; - } - - @Override - public boolean bindTo(EntityPlayer player, ItemStack wand, int x, int y, int z, int side) { - int range = 10; - range *= range; - - double dist = (x - supertile.xCoord) * (x - supertile.xCoord) + (y - supertile.yCoord) * (y - supertile.yCoord) + (z - supertile.zCoord) * (z - supertile.zCoord); - if(range >= dist) { - TileEntity tile = player.worldObj.getTileEntity(x, y, z); - if(tile instanceof IManaPool) { - linkedPool = tile; - return true; - } - } - - return false; - } - - public boolean isValidBinding() { - return linkedPool != null && !linkedPool.isInvalid() && supertile.getWorldObj().getTileEntity(linkedPool.xCoord, linkedPool.yCoord, linkedPool.zCoord) == linkedPool; - } - - @Override - public void renderHUD(Minecraft mc, ScaledResolution res) { - String name = StatCollector.translateToLocal("tile.botania:flower." + getUnlocalizedName() + ".name"); - int color = getColor(); - BotaniaAPI.internalHandler.drawComplexManaHUD(color, knownMana, getMaxMana(), name, res, BotaniaAPI.internalHandler.getBindDisplayForFlowerType(this), isValidBinding()); - } - -} diff --git a/src/api/java/vazkii/botania/api/subtile/SubTileGenerating.java b/src/api/java/vazkii/botania/api/subtile/SubTileGenerating.java deleted file mode 100644 index 70c81e4..0000000 --- a/src/api/java/vazkii/botania/api/subtile/SubTileGenerating.java +++ /dev/null @@ -1,253 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Jan 24, 2014, 8:03:36 PM (GMT)] - */ -package vazkii.botania.api.subtile; - -import java.awt.Color; - -import net.minecraft.block.Block; -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.ScaledResolution; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.StatCollector; -import net.minecraftforge.common.util.ForgeDirection; -import vazkii.botania.api.BotaniaAPI; -import vazkii.botania.api.internal.IManaNetwork; -import vazkii.botania.api.mana.IManaCollector; - -/** - * The basic class for a Generating Flower. - */ -public class SubTileGenerating extends SubTileEntity { - - public static final int RANGE = 6; - - private static final String TAG_MANA = "mana"; - - private static final String TAG_COLLECTOR_X = "collectorX"; - private static final String TAG_COLLECTOR_Y = "collectorY"; - private static final String TAG_COLLECTOR_Z = "collectorZ"; - - protected int mana; - - int sizeLastCheck = -1; - protected TileEntity linkedCollector = null; - public int knownMana = -1; - - ChunkCoordinates cachedCollectorCoordinates = null; - - @Override - public void onUpdate() { - super.onUpdate(); - - linkCollector(); - - if(canGeneratePassively()) { - int delay = getDelayBetweenPassiveGeneration(); - if(delay > 0 && ticksExisted % delay == 0 && !supertile.getWorldObj().isRemote) { - if(shouldSyncPassiveGeneration()) - sync(); - addMana(getValueForPassiveGeneration()); - } - } - emptyManaIntoCollector(); - - if(supertile.getWorldObj().isRemote) { - double particleChance = 1F - (double) mana / (double) getMaxMana() / 3.5F; - Color color = new Color(getColor()); - if(Math.random() > particleChance) - BotaniaAPI.internalHandler.sparkleFX(supertile.getWorldObj(), supertile.xCoord + 0.3 + Math.random() * 0.5, supertile.yCoord + 0.5 + Math.random() * 0.5, supertile.zCoord + 0.3 + Math.random() * 0.5, color.getRed() / 255F, color.getGreen() / 255F, color.getBlue() / 255F, (float) Math.random(), 5); - } - - if(!supertile.getWorldObj().isRemote) { - int muhBalance = BotaniaAPI.internalHandler.getPassiveFlowerDecay(); - - if(isPassiveFlower() && muhBalance > 0 && ticksExisted > muhBalance) { - supertile.getWorldObj().playAuxSFX(2001, supertile.xCoord, supertile.yCoord, supertile.zCoord, Block.getIdFromBlock(supertile.getBlockType())); - if(supertile.getWorldObj().getBlock(supertile.xCoord, supertile.yCoord - 1, supertile.zCoord).isSideSolid(supertile.getWorldObj(), supertile.xCoord, supertile.yCoord - 1, supertile.zCoord, ForgeDirection.UP)) - supertile.getWorldObj().setBlock(supertile.xCoord, supertile.yCoord, supertile.zCoord, Blocks.deadbush); - else supertile.getWorldObj().setBlockToAir(supertile.xCoord, supertile.yCoord, supertile.zCoord); - } - } - } - - public void linkCollector() { - boolean needsNew = false; - if(linkedCollector == null) { - needsNew = true; - - if(cachedCollectorCoordinates != null) { - needsNew = false; - if(supertile.getWorldObj().blockExists(cachedCollectorCoordinates.posX, cachedCollectorCoordinates.posY, cachedCollectorCoordinates.posZ)) { - needsNew = true; - TileEntity tileAt = supertile.getWorldObj().getTileEntity(cachedCollectorCoordinates.posX, cachedCollectorCoordinates.posY, cachedCollectorCoordinates.posZ); - if(tileAt != null && tileAt instanceof IManaCollector && !tileAt.isInvalid()) { - linkedCollector = tileAt; - needsNew = false; - } - cachedCollectorCoordinates = null; - } - } - } else { - TileEntity tileAt = supertile.getWorldObj().getTileEntity(linkedCollector.xCoord, linkedCollector.yCoord, linkedCollector.zCoord); - if(tileAt != null && tileAt instanceof IManaCollector) - linkedCollector = tileAt; - } - - if(needsNew && ticksExisted == 1) { // New flowers only - IManaNetwork network = BotaniaAPI.internalHandler.getManaNetworkInstance(); - int size = network.getAllCollectorsInWorld(supertile.getWorldObj()).size(); - if(BotaniaAPI.internalHandler.shouldForceCheck() || size != sizeLastCheck) { - ChunkCoordinates coords = new ChunkCoordinates(supertile.xCoord, supertile.yCoord, supertile.zCoord); - linkedCollector = network.getClosestCollector(coords, supertile.getWorldObj(), RANGE); - sizeLastCheck = size; - } - } - } - - public void linkToForcefully(TileEntity collector) { - linkedCollector = collector; - } - - public void addMana(int mana) { - this.mana = Math.min(getMaxMana(), this.mana + mana); - } - - public void emptyManaIntoCollector() { - if(linkedCollector != null && isValidBinding()) { - IManaCollector collector = (IManaCollector) linkedCollector; - if(!collector.isFull() && mana > 0) { - int manaval = Math.min(mana, collector.getMaxMana() - collector.getCurrentMana()); - mana -= manaval; - collector.recieveMana(manaval); - } - } - } - - public boolean isPassiveFlower() { - return false; - } - - public boolean shouldSyncPassiveGeneration() { - return false; - } - - public boolean canGeneratePassively() { - return false; - } - - public int getDelayBetweenPassiveGeneration() { - return 20; - } - - public int getValueForPassiveGeneration() { - return 1; - } - - @Override - public boolean onWanded(EntityPlayer player, ItemStack wand) { - if(player == null) - return false; - - if(!player.worldObj.isRemote) - sync(); - - knownMana = mana; - player.worldObj.playSoundAtEntity(player, "botania:ding", 0.1F, 1F); - - return super.onWanded(player, wand); - } - - public int getMaxMana() { - return 20; - } - - public int getColor() { - return 0xFFFFFF; - } - - @Override - public void readFromPacketNBT(NBTTagCompound cmp) { - mana = cmp.getInteger(TAG_MANA); - - int x = cmp.getInteger(TAG_COLLECTOR_X); - int y = cmp.getInteger(TAG_COLLECTOR_Y); - int z = cmp.getInteger(TAG_COLLECTOR_Z); - - cachedCollectorCoordinates = y < 0 ? null : new ChunkCoordinates(x, y, z); - } - - @Override - public void writeToPacketNBT(NBTTagCompound cmp) { - cmp.setInteger(TAG_MANA, mana); - cmp.setInteger(TAG_TICKS_EXISTED, ticksExisted); - - if(cachedCollectorCoordinates != null) { - cmp.setInteger(TAG_COLLECTOR_X, cachedCollectorCoordinates.posX); - cmp.setInteger(TAG_COLLECTOR_Y, cachedCollectorCoordinates.posY); - cmp.setInteger(TAG_COLLECTOR_Z, cachedCollectorCoordinates.posZ); - } else { - int x = linkedCollector == null ? 0 : linkedCollector.xCoord; - int y = linkedCollector == null ? -1 : linkedCollector.yCoord; - int z = linkedCollector == null ? 0 : linkedCollector.zCoord; - - cmp.setInteger(TAG_COLLECTOR_X, x); - cmp.setInteger(TAG_COLLECTOR_Y, y); - cmp.setInteger(TAG_COLLECTOR_Z, z); - } - } - - @Override - public ChunkCoordinates getBinding() { - if(linkedCollector == null) - return null; - return new ChunkCoordinates(linkedCollector.xCoord, linkedCollector.yCoord, linkedCollector.zCoord); - } - - @Override - public boolean canSelect(EntityPlayer player, ItemStack wand, int x, int y, int z, int side) { - return true; - } - - @Override - public boolean bindTo(EntityPlayer player, ItemStack wand, int x, int y, int z, int side) { - int range = 6; - range *= range; - - double dist = (x - supertile.xCoord) * (x - supertile.xCoord) + (y - supertile.yCoord) * (y - supertile.yCoord) + (z - supertile.zCoord) * (z - supertile.zCoord); - if(range >= dist) { - TileEntity tile = player.worldObj.getTileEntity(x, y, z); - if(tile instanceof IManaCollector) { - linkedCollector = tile; - return true; - } - } - - return false; - } - - - public boolean isValidBinding() { - return linkedCollector != null && !linkedCollector.isInvalid() && supertile.getWorldObj().getTileEntity(linkedCollector.xCoord, linkedCollector.yCoord, linkedCollector.zCoord) == linkedCollector; - } - - @Override - public void renderHUD(Minecraft mc, ScaledResolution res) { - String name = StatCollector.translateToLocal("tile.botania:flower." + getUnlocalizedName() + ".name"); - int color = getColor(); - BotaniaAPI.internalHandler.drawComplexManaHUD(color, knownMana, getMaxMana(), name, res, BotaniaAPI.internalHandler.getBindDisplayForFlowerType(this), isValidBinding()); - } - -} diff --git a/src/api/java/vazkii/botania/api/subtile/signature/BasicSignature.java b/src/api/java/vazkii/botania/api/subtile/signature/BasicSignature.java deleted file mode 100644 index a179387..0000000 --- a/src/api/java/vazkii/botania/api/subtile/signature/BasicSignature.java +++ /dev/null @@ -1,57 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Oct 17, 2014, 5:34:35 PM (GMT)] - */ -package vazkii.botania.api.subtile.signature; - -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; -import vazkii.botania.api.BotaniaAPI; - -/** - * A basic (and fallback) implementation of SubTileSignature. - */ -public class BasicSignature extends SubTileSignature { - - final String name; - - public BasicSignature(String name) { - this.name = name; - } - - @Override - public void registerIcons(IIconRegister register) { - BotaniaAPI.internalHandler.registerBasicSignatureIcons(name, register); - } - - @Override - public IIcon getIconForStack(ItemStack stack) { - return BotaniaAPI.internalHandler.getSubTileIconForName(name); - } - - @Override - public String getUnlocalizedNameForStack(ItemStack stack) { - return unlocalizedName(""); - } - - @Override - public String getUnlocalizedLoreTextForStack(ItemStack stack) { - return unlocalizedName(".reference"); - } - - public String getName() { - return name; - } - - private String unlocalizedName(String end) { - return "tile.botania:" + SubTileSignature.SPECIAL_FLOWER_PREFIX + name + end; - } - -} diff --git a/src/api/java/vazkii/botania/api/subtile/signature/SubTileSignature.java b/src/api/java/vazkii/botania/api/subtile/signature/SubTileSignature.java deleted file mode 100644 index 65fac22..0000000 --- a/src/api/java/vazkii/botania/api/subtile/signature/SubTileSignature.java +++ /dev/null @@ -1,56 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Oct 17, 2014, 5:29:26 PM (GMT)] - */ -package vazkii.botania.api.subtile.signature; - -import java.util.List; - -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; - -/** - * A singleton instance for a SubTileEntity, this is called for a few methods. - */ -public abstract class SubTileSignature { - - public static final String SPECIAL_FLOWER_PREFIX = "flower."; - - /** - * Equivalent to Block.registerBlockIcons. - */ - public abstract void registerIcons(IIconRegister register); - - /** - * Gets the icon to display for the flower item. - */ - public abstract IIcon getIconForStack(ItemStack stack); - - /** - * Gets the display name for the flower item. - */ - public abstract String getUnlocalizedNameForStack(ItemStack stack); - - /** - * Gets the lore text for the flower item, displayed in the item's tooltip. - * If you do not want a reference return a key that does not have localization such - * as "botaniamisc.noloc". - */ - public abstract String getUnlocalizedLoreTextForStack(ItemStack stack); - - /** - * Adds additional text to the tooltip. This text is added after getUnlocalizedLoreTextForStack. - */ - public void addTooltip(ItemStack stack, EntityPlayer player, List tooltip) { - // NO-OP - } - -} diff --git a/src/api/java/vazkii/botania/api/wand/ICoordBoundItem.java b/src/api/java/vazkii/botania/api/wand/ICoordBoundItem.java deleted file mode 100644 index f7c8036..0000000 --- a/src/api/java/vazkii/botania/api/wand/ICoordBoundItem.java +++ /dev/null @@ -1,18 +0,0 @@ -package vazkii.botania.api.wand; - -import net.minecraft.item.ItemStack; -import net.minecraft.util.ChunkCoordinates; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -/** - * The item equivalent of ITileBound, renders when the - * item is in hand. - * @see ITileBound - */ -public interface ICoordBoundItem { - - @SideOnly(Side.CLIENT) - public ChunkCoordinates getBinding(ItemStack stack); - -} diff --git a/src/api/java/vazkii/botania/api/wand/ITileBound.java b/src/api/java/vazkii/botania/api/wand/ITileBound.java deleted file mode 100644 index 199390b..0000000 --- a/src/api/java/vazkii/botania/api/wand/ITileBound.java +++ /dev/null @@ -1,30 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Mar 24, 2014, 6:47:53 PM (GMT)] - */ -package vazkii.botania.api.wand; - -import net.minecraft.util.ChunkCoordinates; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -/** - * Any TileEntity that implements this is technically bound - * to something, and the binding will be shown when hovering - * over with a Wand of the Forest. - */ -public interface ITileBound { - - /** - * Gets where this block is bound to, can return null. - */ - @SideOnly(Side.CLIENT) - public ChunkCoordinates getBinding(); - -} diff --git a/src/api/java/vazkii/botania/api/wand/IWandBindable.java b/src/api/java/vazkii/botania/api/wand/IWandBindable.java deleted file mode 100644 index 0c5786c..0000000 --- a/src/api/java/vazkii/botania/api/wand/IWandBindable.java +++ /dev/null @@ -1,34 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Oct 9, 2014, 3:01:58 PM (GMT)] - */ -package vazkii.botania.api.wand; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; - -/** - * A TileEntity that implements this can be bound to another block - * via the Wand of the Forest. Also see IWireframeAABBProvider to change - * the displayed bounding box. - */ -public interface IWandBindable extends ITileBound { - - /** - * Return true if the Wand can select this tile. - */ - public boolean canSelect(EntityPlayer player, ItemStack wand, int x, int y, int z, int side); - - /** - * Call to bind the TileEntity to where the player clicked. Return true to deselect - * the TileEntity for another bind or false case the TileEntity should stay selected. - */ - public boolean bindTo(EntityPlayer player, ItemStack wand, int x, int y, int z, int side); - -} diff --git a/src/api/java/vazkii/botania/api/wand/IWandHUD.java b/src/api/java/vazkii/botania/api/wand/IWandHUD.java deleted file mode 100644 index a75e44a..0000000 --- a/src/api/java/vazkii/botania/api/wand/IWandHUD.java +++ /dev/null @@ -1,25 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Feb 5, 2014, 1:34:44 PM (GMT)] - */ -package vazkii.botania.api.wand; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.ScaledResolution; -import net.minecraft.world.World; - -/** - * Any block that implements this has a HUD rendered when being hovered - * with a Wand of the Forest. - */ -public interface IWandHUD { - - public void renderHUD(Minecraft mc, ScaledResolution res, World world, int x, int y, int z); - -} diff --git a/src/api/java/vazkii/botania/api/wand/IWandable.java b/src/api/java/vazkii/botania/api/wand/IWandable.java deleted file mode 100644 index 52349fa..0000000 --- a/src/api/java/vazkii/botania/api/wand/IWandable.java +++ /dev/null @@ -1,28 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Jan 22, 2014, 5:12:53 PM (GMT)] - */ -package vazkii.botania.api.wand; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; - -/** - * Any block that implements this can be used with the Wand for the Forest for some purpose. - */ -public interface IWandable { - - /** - * Called when the block is used by a wand. Note that the player parameter can be null - * if this function is called from a dispenser. - */ - public boolean onUsedByWand(EntityPlayer player, ItemStack stack, World world, int x, int y, int z, int side); - -} diff --git a/src/api/java/vazkii/botania/api/wand/IWireframeAABBProvider.java b/src/api/java/vazkii/botania/api/wand/IWireframeAABBProvider.java deleted file mode 100644 index 3b6e807..0000000 --- a/src/api/java/vazkii/botania/api/wand/IWireframeAABBProvider.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Apr 19, 2014, 7:23:59 PM (GMT)] - */ -package vazkii.botania.api.wand; - -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.world.World; - -/** - * A block that implements this can provide a custom AABB - * for rendering the wireframe with ITileBound. - */ -public interface IWireframeAABBProvider { - - public AxisAlignedBB getWireframeAABB(World world, int x, int y, int z); - -} diff --git a/src/api/java/vazkii/botania/api/wiki/IWikiProvider.java b/src/api/java/vazkii/botania/api/wiki/IWikiProvider.java deleted file mode 100644 index 285c154..0000000 --- a/src/api/java/vazkii/botania/api/wiki/IWikiProvider.java +++ /dev/null @@ -1,38 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Sep 2, 2014, 5:57:35 PM (GMT)] - */ -package vazkii.botania.api.wiki; - -import net.minecraft.util.MovingObjectPosition; -import net.minecraft.world.World; - -/** - * An interface for a Wiki Provider, these are registered to allow a mod to provide a wiki - * for all the blocks in them, used for the world interaction with the Lexica Botania. - * A simple, mostly all-inclusive implementation can be found on SimpleWikiProvider. - */ -public interface IWikiProvider { - - /** - * Gets the name of the block being looked at for display. - */ - public String getBlockName(World world, MovingObjectPosition pos); - - /** - * Gets the URL to open when the block is clicked. - */ - public String getWikiURL(World world, MovingObjectPosition pos); - - /** - * Gets the name of the wiki for display. - */ - public String getWikiName(World world, MovingObjectPosition pos); - -} diff --git a/src/api/java/vazkii/botania/api/wiki/SimpleWikiProvider.java b/src/api/java/vazkii/botania/api/wiki/SimpleWikiProvider.java deleted file mode 100644 index 9e0fa81..0000000 --- a/src/api/java/vazkii/botania/api/wiki/SimpleWikiProvider.java +++ /dev/null @@ -1,72 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Sep 2, 2014, 5:58:39 PM (GMT)] - */ -package vazkii.botania.api.wiki; - -import net.minecraft.block.Block; -import net.minecraft.item.ItemStack; -import net.minecraft.util.MovingObjectPosition; -import net.minecraft.world.World; - -import org.apache.commons.lang3.text.WordUtils; - -public class SimpleWikiProvider implements IWikiProvider { - - final String name, urlBase, replacement; - - public SimpleWikiProvider(String name, String urlBase) { - this(name, urlBase, "%20"); - } - - public SimpleWikiProvider(String name, String urlBase, String replacement) { - this.name = name; - this.urlBase = urlBase; - this.replacement = replacement; - } - - @Override - public String getBlockName(World world, MovingObjectPosition pos) { - int x = pos.blockX; - int y = pos.blockY; - int z = pos.blockZ; - - Block block = world.getBlock(x, y, z); - if(block == null) - return null; - - ItemStack stack = block.getPickBlock(pos, world, x, y, z); - - if(stack == null || stack.getItem() == null) - stack = new ItemStack(block, 1, world.getBlockMetadata(x, y, z)); - - if(stack.getItem() == null) - return null; - - String name = stack.getDisplayName(); - if(name == null || name.isEmpty()) - return null; - - return name; - } - - @Override - public String getWikiURL(World world, MovingObjectPosition pos) { - String name = getBlockName(world, pos); - if(name == null) - return null; - return String.format(urlBase, WordUtils.capitalizeFully(name).replaceAll(" ", replacement)); - } - - @Override - public String getWikiName(World world, MovingObjectPosition pos) { - return name; - } - -} diff --git a/src/api/java/vazkii/botania/api/wiki/WikiHooks.java b/src/api/java/vazkii/botania/api/wiki/WikiHooks.java deleted file mode 100644 index ae42fd8..0000000 --- a/src/api/java/vazkii/botania/api/wiki/WikiHooks.java +++ /dev/null @@ -1,42 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Sep 2, 2014, 6:05:03 PM (GMT)] - */ -package vazkii.botania.api.wiki; - -import java.util.HashMap; -import java.util.Map; - -import net.minecraft.block.Block; -import cpw.mods.fml.common.registry.GameRegistry; -import cpw.mods.fml.common.registry.GameRegistry.UniqueIdentifier; - -public class WikiHooks { - - private static final IWikiProvider FALLBACK_PROVIDER = new SimpleWikiProvider("FTB Wiki", "http://ftb.gamepedia.com/%s"); - - private static final Map modWikis = new HashMap(); - - public static IWikiProvider getWikiFor(Block block) { - UniqueIdentifier mod = GameRegistry.findUniqueIdentifierFor(block); - return getWikiFor(mod == null ? "" : mod.modId.toLowerCase()); - } - - public static IWikiProvider getWikiFor(String mod) { - if(!modWikis.containsKey(mod)) - modWikis.put(mod, FALLBACK_PROVIDER); - - return modWikis.get(mod); - } - - public static void registerModWiki(String mod, IWikiProvider provider) { - modWikis.put(mod.toLowerCase(), provider); - } - -} diff --git a/src/main/java/fox/spiteful/avaritia/compat/Compat.java b/src/main/java/fox/spiteful/avaritia/compat/Compat.java index 7856349..c3522e5 100644 --- a/src/main/java/fox/spiteful/avaritia/compat/Compat.java +++ b/src/main/java/fox/spiteful/avaritia/compat/Compat.java @@ -170,9 +170,9 @@ public class Compat { try { if(gt){ try { - Block resource = getBlock("gregtech", "gt.meta.storage.ingot"); - ItemStack osmir = new ItemStack(resource, 1, 8682); - Grinder.catalyst.getInput().add(osmir); + Item resource = getItem("gregtech", "gt.metaitem.01"); + ItemStack lolneutronium = new ItemStack(resource, 1, 9129); + Grinder.catalyst.getInput().add(lolneutronium); } catch(Throwable e){ Lumberjack.log(Level.INFO, "Avaritia got sick of only getting 2 planks per log."); diff --git a/src/main/resources/assets/avaritia/textures/items/resource_infinity_ingot.png.mcmeta b/src/main/resources/assets/avaritia/textures/items/resource_infinity_ingot.png.mcmeta index 203da75..642d835 100644 --- a/src/main/resources/assets/avaritia/textures/items/resource_infinity_ingot.png.mcmeta +++ b/src/main/resources/assets/avaritia/textures/items/resource_infinity_ingot.png.mcmeta @@ -1,37 +1,24 @@ { "animation": { - "frametime": 1, + "interpolate": true, + "frametime": 30, "frames": [ - 0, - 0, - 0, - 1, - 1, - 1, - 2, - 2, - 2, - 3, - 3, - 4, - 4, + {index: 0, time: 3}, + {index: 1, time: 3}, + {index: 2, time: 3}, + {index: 3, time: 2}, + {index: 4, time: 2}, 5, 6, 7, 8, 7, 6, - 5, - 4, - 4, - 3, - 3, - 2, - 2, - 2, - 1, - 1, - 1, + 5, + {index: 4, time: 2}, + {index: 3, time: 2}, + {index: 2, time: 3}, + {index: 1, time: 3}, ] } -} +} \ No newline at end of file