Tinkering with the new TC API/IMC system

This commit is contained in:
Adubbz 2013-11-19 19:55:48 +11:00
parent fdbba68ef7
commit 0b954634a9
25 changed files with 78 additions and 1039 deletions

View file

@ -1,53 +0,0 @@
package thermalexpansion.api;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.item.Item;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import cpw.mods.fml.common.registry.GameRegistry;
/**
* This class contains some general hooks that can be useful if Thermal Expansion is installed.
*/
public class ThermalExpansionInfo {
public static ItemStack coal = new ItemStack(Item.coal, 1, 0);
public static ItemStack charcoal = new ItemStack(Item.coal, 1, 1);
public static int lavaFuelValue = 18000;
public static int getFuelValue(ItemStack theFuel) {
if (theFuel == null) {
return 0;
}
if (theFuel.isItemEqual(coal)) {
return 4800;
}
if (theFuel.isItemEqual(charcoal)) {
return 3200;
}
int itemId = theFuel.getItem().itemID;
if (theFuel.getItem() instanceof ItemBlock && Block.blocksList[itemId].blockMaterial == Material.wood) {
return 450;
}
if (itemId == Item.stick.itemID) {
return 150;
}
if (itemId == Block.sapling.blockID) {
return 150;
}
return GameRegistry.getFuelValue(theFuel) * 3 / 2;
}
/*public static int getFuelValue(LiquidStack theFuel) {
if (theFuel.itemID == Block.lavaStill.blockID) {
return lavaFuelValue;
}
return 0;
}*/
}

View file

@ -1,106 +0,0 @@
package thermalexpansion.api.crafting;
import net.minecraft.block.Block;
import net.minecraft.item.ItemStack;
import thermalexpansion.api.item.ItemRegistry;
/**
* This class adds some basic and fool-proof recipe handlers that can help you out. They will add
* simple recipes that follow the TE defaults - they are not the only way of adding recipes. You can
* also use the more specific recipe functions defined in the Manager interfaces if necessary. Once
* again, only call these during @PostInit or things may not go so rosy.
*/
public class CraftingHelpers {
private static ItemStack sawdust = ItemRegistry.getItem("sawdust", 1);
private static ItemStack slag = ItemRegistry.getItem("slag", 1);
private static ItemStack slagRich = ItemRegistry.getItem("slagRich", 1);
private static ItemStack fluxSand = new ItemStack(Block.sand);
/**
* Ore x1 to Dust x2 conversion. 400 MJ. Will return false if recipe already exists.
*/
public static boolean addPulverizerOreToDustRecipe(ItemStack inputOre, ItemStack outputDust) {
ItemStack ore = inputOre.copy();
ore.stackSize = 1;
ItemStack primaryDust = outputDust.copy();
primaryDust.stackSize = 2;
return CraftingManagers.pulverizerManager.addRecipe(400, ore, primaryDust, false);
}
/**
* Ore x1 to Dust x2 conversion, 10% chance of Secondary x1 being generated. 400 MJ. Will return
* false if recipe already exists.
*/
public static boolean addPulverizerOreToDustRecipe(ItemStack inputOre, ItemStack outputDust, ItemStack outputSecondary) {
ItemStack ore = inputOre.copy();
ore.stackSize = 1;
ItemStack primaryDust = outputDust.copy();
primaryDust.stackSize = 2;
ItemStack secondary = outputSecondary.copy();
secondary.stackSize = 1;
return CraftingManagers.pulverizerManager.addRecipe(400, ore, primaryDust, secondary, 10, false);
}
/**
* Log x1 to Plank x6 conversion, 100% chance of Sawdust. 80 MJ. Will return false if recipe
* already exists.
*/
public static boolean addSawmillLogToPlankRecipe(ItemStack inputLog, ItemStack outputPlanks) {
ItemStack log = inputLog.copy();
log.stackSize = 1;
ItemStack planks = outputPlanks.copy();
planks.stackSize = 6;
return CraftingManagers.sawmillManager.addRecipe(80, log, planks, sawdust, false);
}
/**
* Dust x2, Sand x1 to Ingot x2, 25% chance of Slag. 80 MJ. Will return false if recipe already
* exists.
*/
public static boolean addSmelterDustToIngotsRecipe(ItemStack inputDust, ItemStack outputIngots) {
ItemStack dust = inputDust.copy();
dust.stackSize = 2;
ItemStack ingots = outputIngots.copy();
ingots.stackSize = 2;
return CraftingManagers.smelterManager.addRecipe(80, dust, fluxSand, ingots, slag, 25, false);
}
/**
* Ore x1, Sand x1 to Ingot x2, 5% chance of Rich Slag. 320 MJ. Also, Ore x1, Rich Slag x1 to
* Ingot x3, 75% chance of Slag. 400 MJ. Will return false if recipe already exists.
*/
public static boolean addSmelterOreToIngotsRecipe(ItemStack inputOre, ItemStack outputIngots) {
ItemStack ore = inputOre.copy();
ore.stackSize = 1;
ItemStack ingots2 = outputIngots.copy();
ingots2.stackSize = 2;
ItemStack ingots3 = outputIngots.copy();
ingots3.stackSize = 3;
if (!CraftingManagers.smelterManager.addRecipe(320, ore, fluxSand, ingots2, slagRich, 5, false)) {
return false;
}
if (!CraftingManagers.smelterManager.addRecipe(400, ore, slagRich, ingots3, slag, 75, false)) {
return false;
}
return true;
}
}

View file

@ -1,46 +0,0 @@
/**
* Team CoFH
*
* Thermal Expansion
*/
package thermalexpansion.api.crafting;
/**
* Allows access to all of the Thermal Expansion crafting managers. Add your recipes during @PostInit
* or risk a null pointer. :)
*/
public class CraftingManagers {
/**
* Allows you to add recipes to the Magma Crucible. See {@link ICrucibleManager} for details.
*/
public static ICrucibleManager crucibleManager;
/**
* Allows you to add recipes to the Liquid Transposer. See {@link ITransposerManager} for
* details.
*/
public static ITransposerManager transposerManager;
/**
* Allows you to add recipes to the Powered Furnace. See {@link IFurnaceManager} for details.
*/
public static IFurnaceManager furnaceManager;
/**
* Allows you to add recipes to the Pulverizer. See {@link IPulverizerManager} for details.
*/
public static IPulverizerManager pulverizerManager;
/**
* Allows you to add recipes to the Sawmill. See {@link ISawmillManager} for details.
*/
public static ISawmillManager sawmillManager;
/**
* Allows you to add recipes to the Induction Smelter. See {@link ISmelterManager} for details.
*/
public static ISmelterManager smelterManager;
}

View file

@ -1,37 +0,0 @@
/**
* Team CoFH
*
* Thermal Expansion
*/
package thermalexpansion.api.crafting;
/**
* Provides an interface to the recipe manager of the Crucible. Accessible via
* {@link CraftingManagers.crucibleManager}
*/
public interface ICrucibleManager {
/**
* Add a recipe to the Crucible.
*
* @param energy
* Energy needed to process the item.
* @param input
* ItemStack representing the input item.
* @param output
* LiquidStack representing the output liquid.
* @param overwrite
* Flag to enable recipe overwriting. This will only be allowed if enabled in the
* Thermal Expansion Configuration file and will be logged for information purposes.
*/
//public boolean addRecipe(int energy, ItemStack input, LiquidStack output, boolean overwrite);
// public boolean addRecipe(int energy, ItemStack input, LiquidStack output);
/**
* Access to the full list of recipes.
*/
ICrucibleRecipe[] getRecipeList();
}

View file

@ -1,18 +0,0 @@
/**
* Team CoFH
*
* Thermal Expansion
*/
package thermalexpansion.api.crafting;
import net.minecraft.item.ItemStack;
public interface ICrucibleRecipe {
public ItemStack getInput();
//public LiquidStack getOutput();
public int getEnergy();
}

View file

@ -1,38 +0,0 @@
/**
* Team CoFH
*
* Thermal Expansion
*/
package thermalexpansion.api.crafting;
import net.minecraft.item.ItemStack;
/**
* Provides an interface to the recipe manager of the Powered Furnace. Accessible via
* {@link CraftingManagers.FurnaceManager}
*/
public interface IFurnaceManager {
/**
* Add a recipe to the Powered Furnace.
*
* @param energy
* Energy needed to process the item.
* @param input
* ItemStack representing the input item.
* @param output
* ItemStack representing the output item.
* @param overwrite
* Flag to enable recipe overwriting. This will only be allowed if enabled in the
* Thermal Expansion Configuration file and will be logged for information purposes.
*/
public boolean addRecipe(int energy, ItemStack input, ItemStack output, boolean overwrite);
public boolean addRecipe(int energy, ItemStack input, ItemStack output);
/**
* Access to the full list of recipes.
*/
IFurnaceRecipe[] getRecipeList();
}

View file

@ -1,18 +0,0 @@
/**
* Team CoFH
*
* Thermal Expansion
*/
package thermalexpansion.api.crafting;
import net.minecraft.item.ItemStack;
public interface IFurnaceRecipe {
public ItemStack getInput();
public ItemStack getOutput();
public int getEnergy();
}

View file

@ -1,79 +0,0 @@
/**
* Team CoFH
*
* Thermal Expansion
*/
package thermalexpansion.api.crafting;
import net.minecraft.item.ItemStack;
/**
* Provides an interface to the recipe manager of the Pulverizer. Accessible via
* {@link CraftingManagers.pulverizerManager}
*/
public interface IPulverizerManager {
/**
* Add a recipe to the Pulverizer
*
* @param energy
* Energy needed to process the item.
* @param input
* ItemStack representing the input item.
* @param primaryOutput
* ItemStack representing the primary (only) output product.
* @param overwrite
* Flag to enable recipe overwriting. This will only be allowed if enabled in the
* Thermal Expansion Configuration file and will be logged for information purposes.
*/
public boolean addRecipe(int energy, ItemStack input, ItemStack primaryOutput, boolean overwrite);
public boolean addRecipe(int energy, ItemStack input, ItemStack primaryOutput);
/**
* Add a recipe to the Pulverizer
*
* @param energy
* Energy needed to process the item.
* @param input
* ItemStack representing the input item.
* @param primaryOutput
* ItemStack representing the primary output product.
* @param secondaryOutput
* ItemStack representing the secondary output product. Product % is taken to be 100.
* @param overwrite
* Flag to enable recipe overwriting. This will only be allowed if enabled in the
* Thermal Expansion Configuration file and will be logged for information purposes.
*/
public boolean addRecipe(int energy, ItemStack input, ItemStack primaryOutput, ItemStack secondaryOutput, boolean overwrite);
public boolean addRecipe(int energy, ItemStack input, ItemStack primaryOutput, ItemStack secondaryOutput);
/**
* Add a recipe to the Pulverizer
*
* @param energy
* Energy needed to process the item.
* @param input
* ItemStack representing the input item.
* @param outputPrimary
* ItemStack representing the primary output product.
* @param outputSecondary
* ItemStack representing the secondary output product.
* @param secondaryChance
* Integer representing % chance (out of 100) of the secondary product being created.
*
@param overwrite
* Flag to enable recipe overwriting. This will only be allowed if enabled in the
* Thermal Expansion Configuration file and will be logged for information purposes.
*/
public boolean addRecipe(int energy, ItemStack input, ItemStack primaryOutput, ItemStack secondaryOutput, int secondaryChance, boolean overwrite);
public boolean addRecipe(int energy, ItemStack input, ItemStack primaryOutput, ItemStack secondaryOutput, int secondaryChance);
/**
* Access to the list of recipes.
*/
IPulverizerRecipe[] getRecipeList();
}

View file

@ -1,22 +0,0 @@
/**
* Team CoFH
*
* Thermal Expansion
*/
package thermalexpansion.api.crafting;
import net.minecraft.item.ItemStack;
public interface IPulverizerRecipe {
public ItemStack getInput();
public ItemStack getPrimaryOutput();
public ItemStack getSecondaryOutput();
public int getSecondaryOutputChance();
public int getEnergy();
}

View file

@ -1,78 +0,0 @@
/**
* Team CoFH
*
* Thermal Expansion
*/
package thermalexpansion.api.crafting;
import net.minecraft.item.ItemStack;
/**
* Provides an interface to the recipe manager of the Sawmill. Accessible via
* {@link CraftingManagers.sawmillManager}
*/
public interface ISawmillManager {
/**
* Add a recipe to the Sawmill
*
* @param energy
* Energy needed to process the item.
* @param input
* ItemStack representing the input item.
* @param primaryOutput
* ItemStack representing the primary (only) output product.
* @param overwrite
* Flag to enable recipe overwriting. This will only be allowed if enabled in the
* Thermal Expansion Configuration file and will be logged for information purposes.
*/
public boolean addRecipe(int energy, ItemStack input, ItemStack primaryOutput, boolean overwrite);
public boolean addRecipe(int energy, ItemStack input, ItemStack primaryOutput);
/**
* Add a recipe to the Sawmill
*
* @param energy
* Energy needed to process the item.
* @param input
* ItemStack representing the input item.
* @param primaryOutput
* ItemStack representing the primary output product.
* @param secondaryOutput
* ItemStack representing the secondary output product. Product % is taken to be 100.
* @param overwrite
* Flag to enable recipe overwriting. This will only be allowed if enabled in the
* Thermal Expansion Configuration file and will be logged for information purposes.
*/
public boolean addRecipe(int energy, ItemStack input, ItemStack primaryOutput, ItemStack secondaryOutput, boolean overwrite);
public boolean addRecipe(int energy, ItemStack input, ItemStack primaryOutput, ItemStack secondaryOutput);
/**
* Add a recipe to the Sawmill
*
* @param energy
* Energy needed to process the item.
* @param input
* ItemStack representing the input item.
* @param outputprimaryOutput
* ItemStack representing the primary output product.
* @param outputsecondaryOutput
* ItemStack representing the secondary output product.
* @param secondaryChance
* Integer representing % chance (out of 100) of the secondary product being created.
* @param overwrite
* Flag to enable recipe overwriting. This will only be allowed if enabled in the
* Thermal Expansion Configuration file and will be logged for information purposes.
*/
public boolean addRecipe(int energy, ItemStack input, ItemStack primaryOutput, ItemStack secondaryOutput, int secondaryChance, boolean overwrite);
public boolean addRecipe(int energy, ItemStack input, ItemStack primaryOutput, ItemStack secondaryOutput, int secondaryChance);
/**
* Access to the list of recipes.
*/
ISawmillRecipe[] getRecipeList();
}

View file

@ -1,22 +0,0 @@
/**
* Team CoFH
*
* Thermal Expansion
*/
package thermalexpansion.api.crafting;
import net.minecraft.item.ItemStack;
public interface ISawmillRecipe {
public ItemStack getInput();
public ItemStack getPrimaryOutput();
public ItemStack getSecondaryOutput();
public int getSecondaryOutputChance();
public int getEnergy();
}

View file

@ -1,85 +0,0 @@
/**
* Team CoFH
*
* Thermal Expansion
*/
package thermalexpansion.api.crafting;
import net.minecraft.item.ItemStack;
/**
* Provides an interface to the recipe manager of the Induction Smelter. Accessible via
* {@link CraftingManagers.smelterManager}
*/
public interface ISmelterManager {
/**
* Add a recipe to the Induction Smelter
*
* @param energy
* Energy needed to process the item.
* @param primaryInput
* ItemStack representing the primary input item.
* @param secondaryInput
* ItemStack representing the secondary input item.
* @param primaryOutput
* ItemStack representing the primary (only) output product.
* @param overwrite
* Flag to enable recipe overwriting. This will only be allowed if enabled in the
* Thermal Expansion Configuration file and will be logged for information purposes.
*/
public boolean addRecipe(int energy, ItemStack primaryInput, ItemStack secondaryInput, ItemStack primaryOutput, boolean overwrite);
public boolean addRecipe(int energy, ItemStack primaryInput, ItemStack secondaryInput, ItemStack primaryOutput);
/**
* Add a recipe to the Induction Smelter
*
* @param energy
* Energy needed to process the item.
* @param primaryInput
* ItemStack representing the primary input item.
* @param secondaryInput
* ItemStack representing the secondary input item.
* @param primaryOutput
* ItemStack representing the primary output product.
* @param secondaryOutput
* ItemStack representing the secondary output product. Product % is taken to be 100.
* @param overwrite
* Flag to enable recipe overwriting. This will only be allowed if enabled in the
* Thermal Expansion Configuration file and will be logged for information purposes.
*/
public boolean addRecipe(int energy, ItemStack primaryInput, ItemStack secondaryInput, ItemStack primaryOutput, ItemStack secondaryOutput, boolean overwrite);
public boolean addRecipe(int energy, ItemStack primaryInput, ItemStack secondaryInput, ItemStack primaryOutput, ItemStack secondaryOutput);
/**
* Add a recipe to the Induction Smelter
*
* @param energy
* Energy needed to process the item.
* @param primaryInput
* ItemStack representing the primary input item.
* @param secondaryInput
* ItemStack representing the secondary input item.
* @param primaryOutput
* ItemStack representing the primary output product.
* @param secondaryOutput
* ItemStack representing the secondary output product.
* @param secondaryChance
* Integer representing % chance (out of 100) of the secondary product being created.
* @param overwrite
* Flag to enable recipe overwriting. This will only be allowed if enabled in the
* Thermal Expansion Configuration file and will be logged for information purposes.
*/
public boolean addRecipe(int energy, ItemStack primaryInput, ItemStack secondaryInput, ItemStack primaryOutput, ItemStack secondaryOutput, int secondaryChance,
boolean overwrite);
public boolean addRecipe(int energy, ItemStack primaryInput, ItemStack secondaryInput, ItemStack primaryOutput, ItemStack secondaryOutput, int secondaryChance);
/**
* Access to the list of recipes.
*/
ISmelterRecipe[] getRecipeList();
}

View file

@ -1,24 +0,0 @@
/**
* Team CoFH
*
* Thermal Expansion
*/
package thermalexpansion.api.crafting;
import net.minecraft.item.ItemStack;
public interface ISmelterRecipe {
public ItemStack getPrimaryInput();
public ItemStack getSecondaryInput();
public ItemStack getPrimaryOutput();
public ItemStack getSecondaryOutput();
public int getSecondaryOutputChance();
public int getEnergy();
}

View file

@ -1,69 +0,0 @@
/**
* Team CoFH
*
* Thermal Expansion
*/
package thermalexpansion.api.crafting;
/**
* Provides an interface to the recipe manager of the Liquid Transposer. Accessible via
* {@link CraftingManagers.transposerManager}
*/
public interface ITransposerManager {
/**
* Add a recipe to the Liquid Transposer
*
* @param energy
* Energy needed to process the item.
* @param input
* ItemStack representing the input item.
* @param output
* ItemStack representing the output item.
* @param liquid
* LiquidStack representing the required liquid.
* @param reversible
* Flag the recipe as reversible (container can be emptied).
* @param overwrite
* Flag to enable recipe overwriting. This will only be allowed if enabled in the
* Thermal Expansion Configuration file and will be logged for information purposes.
*/
//public boolean addFillRecipe(int energy, ItemStack input, ItemStack output, LiquidStack liquid, boolean reversible, boolean overwrite);
//public boolean addFillRecipe(int energy, ItemStack input, ItemStack output, LiquidStack liquid, boolean reversible);
/**
* Add a recipe to the Liquid Transposer
*
* @param energy
* Energy needed to process the item.
* @param input
* ItemStack representing the input item.
* @param output
* ItemStack representing the output item - this can be NULL if necessary, if the
* recipe is NOT reversible.
* @param liquid
* LiquidStack representing the required liquid.
* @param chance
* Integer representing % chance (out of 100) of receiving the item - liquid will
* always be extracted. If output is NULL, this MUST be set to 0. The recipe will not
* be added otherwise.
* @param reversible
* Flag the recipe as reversible (container can be filled).
* @param overwrite
* Flag to enable recipe overwriting. This will only be allowed if enabled in the
* Thermal Expansion Configuration file and will be logged for information purposes.
*/
//public boolean addExtractionRecipe(int energy, ItemStack input, ItemStack output, LiquidStack liquid, int chance, boolean reversible, boolean overwrite);
//public boolean addExtractionRecipe(int energy, ItemStack input, ItemStack output, LiquidStack liquid, int chance, boolean reversible);
/**
* Access to the list of recipes.
*/
ITransposerRecipe[] getFillRecipeList();
ITransposerRecipe[] getExtractionRecipeList();
}

View file

@ -1,22 +0,0 @@
/**
* Team CoFH
*
* Thermal Expansion
*/
package thermalexpansion.api.crafting;
import net.minecraft.item.ItemStack;
public interface ITransposerRecipe {
public ItemStack getInput();
public ItemStack getOutput();
//public LiquidStack getLiquid();
public int getEnergy();
public int getChance();
}

View file

@ -1,52 +0,0 @@
package thermalexpansion.api.item;
import net.minecraft.item.ItemStack;
/**
* Implement this interface on Item classes that support external manipulation of their internal
* energy storages. This interface does not provide methods for the underlying internal energy
* usage.
*/
public interface IChargeableItem {
/**
* Adds energy to an item. Returns the quantity of energy that was accepted. This should always
* return 0 if the item cannot be externally charged.
*
* @param theItem
* ItemStack to be charged.
* @param energy
* Maximum amount of energy to be sent into the item.
* @param doReceive
* If false, the charge will only be simulated.
* @return Amount of energy that was accepted by the item.
*/
public float receiveEnergy(ItemStack theItem, float energy, boolean doReceive);
/**
* Removes energy from an item. Returns the quantity of energy that was removed. This should
* always return 0 if the item cannot be externally discharged.
*
* @param theItem
* ItemStack to be discharged.
* @param energy
* Maximum amount of energy to be removed from the item.
* @param doTransfer
* If false, the discharge will only be simulated.
* @return Amount of energy that was removed from the item.
*/
public float transferEnergy(ItemStack theItem, float energy, boolean doTransfer);
/**
* Get the amount of energy currently stored in the item.
*/
public float getEnergyStored(ItemStack theItem);
/**
* Get the max amount of energy that can be stored in the item.
*/
public float getMaxEnergyStored(ItemStack theItem);
}

View file

@ -1,123 +0,0 @@
package thermalexpansion.api.item;
import java.util.Map;
import java.util.TreeMap;
import net.minecraft.item.ItemStack;
public final class ItemRegistry {
private static final Map<String, ItemStack> registry = new TreeMap<String, ItemStack>();
/**
* Returns an ItemStack containing the item that corresponds to the provided name.
*
* @param name
* Name of the item.
* @param qty
* Requested quantity of the item.
*/
public static ItemStack getItem(String name, int qty) {
ItemStack result = registry.get(name);
if (result != null) {
result = result.copy();
result.stackSize = qty;
}
return result;
}
/**
* Registers a new item with the ItemRegistry.
*
* @param name
* Name of the item.
* @param item
* ItemStack representing the item.
*/
public static void registerItem(String name, ItemStack item) {
registry.put(name, item);
}
/**
* Print a list of all currently registered items to the console.
*/
public static void printItemNames() {
System.out.println("Printing all registered Thermal Expansion items:");
for (String itemName : registry.keySet()) {
System.out.println(itemName);
}
}
// String identifiers for obtaining Thermal Expansion Items:
// dustIron - Dust obtained by pulverizing Iron Ore.
// dustGold - Dust obtained by pulverizing Gold Ore.
// dustObsidian - Dust obtained by pulverizing Obsidian.
// dustCopper - Dust obtained by pulverizing Copper Ore.
// dustTin - Dust obtained by pulverizing Tin Ore.
// dustSilver - Dust obtained by pulverizing Silver Ore.
// dustLead - Dust obtained by pulverizing Lead Ore.
// dustNickel - Dust obtained by pulverizing Ferrous Ore.
// dustPlatinum - Dust obtained as a secondary output from pulverizing Ferrous Ore (Shiny
// Ingots).
// dustElectrum - Dust obtained by crafting Gold and Silver Dusts together.
// dustInvar - Dust obtained by crafting 2 Iron Dusts and Ferrous Dust.
// dustBronze - Uncraftable
// dustBrass - Uncraftable
// ingotCopper - Ingot obtained by smelting Copper Dust.
// ingotTin - Ingot obtained by smelting Tin Dust.
// ingotSilver - Ingot obtained by smelting Silver Dust.
// ingotLead - Ingot obtained by smelting Lead Dust.
// ingotNickel - Ingot obtained by smelting Ferrous Dust.
// ingotPlatinum - Ingot obtained by smelting Shiny Dust.
// ingotElectrum - Ingot obtained by smelting Electrum Dust.
// ingotInvar - Ingot obtained by smelting Invar Dust.
// nuggetCopper - Nugget obtained from Copper Ingots.
// nuggetTin - Nugget obtained from Tin Ingots.
// nuggetSilver - Nugget obtained from Silver Ingots.
// nuggetLead - Nugget obtained from Lead Ingots.
// nuggetNickel - Nugget obtained from Ferrous Ingots.
// nuggetPlatinum - Nugget obtained from Shiny Ingots.
// nuggetElectrum - Nugget obtained from Electrum Ingots.
// nuggetInvar - Nugget obtained from Invar Ingots.
// crystalSulfur - Sulfur
// crystalNiter - Niter
// woodchips - Woodchips obtained by putting logs in a Pulverizer.
// sawdust - Sawdust obtained
// through the Sawmill.
// sawdustCompressed - Sawdust compressed into one item.
// slag - Slag obtained in Smelter which can be used to create rockwool.
// slagRich - Rich Slag obtained in Smelter which can be used to boost ore output.
// pneumaticServo - Used in Thermal Expansion recipes for machines that do not use power.
// powerCoilGold - Used in Thermal Expansion recipes for machines that receive power.
// powerCoilSilver - Used in Thermal Expansion recipes for machines that send power.
// powerCoilElectrum - Used in Thermal Expansion recipes for machines that both send/receive
// power.
// gearCopper - Copper Gear.
// gearTin - Tin Gear.
// gearInvar - Invar Gear.
// wrench - Cresent Hammer, rotates and dismantles things.
// multimeter - Multimeter, used to read
// Redstone Energy Conduits and Liquiducts.
// machineFrame - Used as a crafting recipe in many Thermal Expansion machines.
// energyCellFrameEmpty - Redstone Energy Cell before it has been filled with Liquid Redstone.
// energyCellFrameFull - Redstone Energy Cell after it has been filled with Liquid Redstone, but
// before it can be placed in the world.
// energyConduitEmpty - Redstone Energy Conduit before it is filled with Liquid Redstone.
// tesseractFrameEmpty - Tesseract before it has been filled with Liquid Ender.
// tesseractFrameFull - Tesseract after it has been filled with Liquid Ender, but before it can
// be placed in the world.
}

View file

@ -1,13 +0,0 @@
package thermalexpansion.api.tileentity;
public interface IAccessControl {
public boolean isPublic();
public boolean isFriends();
public boolean isPrivate();
public boolean setAccessMode(byte mode);
}

View file

@ -1,19 +0,0 @@
package thermalexpansion.api.tileentity;
public interface IRedstoneControl {
public boolean getRedstoneDisable();
public boolean getRedstoneState();
public boolean redstoneControl();
public boolean redstoneControlOrDisable();
public boolean setRedstoneDisable(boolean disable);
public boolean setRedstoneState(boolean state);
public boolean setRedstoneInfo(boolean disable, boolean state);
}

View file

@ -1,30 +0,0 @@
package thermalexpansion.api.tileentity;
import java.util.List;
import net.minecraft.tileentity.TileEntity;
/**
* This interface is implemented on Tesseract Tile Entities.
*
* @author King Lemming
*
*/
public interface ITesseract {
/**
* Returns a list of the connected input Tesseracts as Tile Entities. The list will only contain
* valid inputs; disabled Tesseracts will not be shown. This will allow you to determine where
* they are and what is around them.
*/
public List<TileEntity> getValidInputLinks();
/**
* Returns a list of the connected output Tesseracts as Tile Entities. The list will only
* contain valid outputs; disabled Tesseracts will not be shown. This will allow you to
* determine where they are and what is around them.
*/
public List<TileEntity> getValidOutputLinks();
}

View file

@ -1,37 +0,0 @@
Hi there! Thanks for taking a look at the TE API. Now before you go
integrate TE with your mod (which is awesome btw), please read this.
It'll save us both some grief in the future I promise.
When the API changes and other mods have directly included parts/all of
it, that's bad. :( Sometimes you have to include a file - if it's an
interface or something. No worries, just please don't include the whole
API. To interface with the crafting handlers, you don't have to include
anything. Here's an example of how to do that:
if (Loader.isModLoaded("ThermalExpansion")) {
try {
<your TE recipe stuff goes here>
} catch (Exception e) {
System.out.println("<your mod name>: Thermal Expansion integration was
unsuccessful - please contact the author of this mod to let them know
that the API may have changed.");
}
}
Again, that doesn't have to be exactly what you do, but if you follow
these two steps:
1. Use Loader.isModLoaded
2. Use a try/catch block just to be safe.
then you will NOT have to actually include the TE API in your zip file,
unless you are directly implementing / testing for an interface.
This also holds with most other mods as well, so hopefully it may help
you clean up your own zips and allow you to redistribute on your
schedule, not when another mod updates their API. ;)

View file

@ -15,12 +15,8 @@ import cpw.mods.fml.relauncher.SideOnly;
public class BOPBiomeColourBlending implements IClassTransformer
{
private static String SIDE = FMLLaunchHandler.side().name();
@Override
public byte[] transform(String name, String newname, byte[] bytes)
{
if (SIDE.equals("CLIENT"))
{
if (name.equals("net.minecraft.block.BlockFluid"))
{
@ -64,7 +60,6 @@ public class BOPBiomeColourBlending implements IClassTransformer
{
return BlockTallGrass.patchColourMultiplier(newname, bytes, true);
}
}
return bytes;
}

View file

@ -4,12 +4,15 @@ import java.io.File;
import java.util.Map;
import codechicken.core.launch.DepLoader;
import cpw.mods.fml.relauncher.FMLLaunchHandler;
import cpw.mods.fml.relauncher.IFMLLoadingPlugin;
import cpw.mods.fml.relauncher.IFMLLoadingPlugin.TransformerExclusions;
@TransformerExclusions({ "biomesoplenty.asm" })
public class BOPFMLLoadingPlugin implements IFMLLoadingPlugin
{
private static String SIDE = FMLLaunchHandler.side().name();
public BOPFMLLoadingPlugin()
{
DepLoader.load();
@ -25,10 +28,15 @@ public class BOPFMLLoadingPlugin implements IFMLLoadingPlugin
@Override
public String[] getASMTransformerClass()
{
if (SIDE.equals("CLIENT"))
{
return new String[] {BOPBiomeColourBlending.class.getName()};
}
return null;
}
@Override
public String getModContainerClass()
{

View file

@ -81,7 +81,7 @@ public class BOPCrossIntegration {
if (Loader.isModLoaded("ThermalExpansion"))
{
try {
// TEIntegration.init();
TEIntegration.init();
}
catch (Exception e) {
System.out.println("[BiomesOPlenty] There was an error while integrating Thermal Expansion with Biomes O' Plenty!");

View file

@ -2,20 +2,19 @@ package biomesoplenty.integration;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import thermalexpansion.api.crafting.CraftingHelpers;
import thermalexpansion.api.crafting.CraftingManagers;
import thermalexpansion.api.item.ItemRegistry;
import net.minecraft.nbt.NBTTagCompound;
import biomesoplenty.api.Blocks;
import cpw.mods.fml.common.event.FMLInterModComms;
public class TEIntegration
{
protected static void init()
{
addSawMillRecipes();
//addSawMillRecipes();
addPulverizerRecipes();
}
private static void addSawMillRecipes()
/*private static void addSawMillRecipes()
{
CraftingHelpers.addSawmillLogToPlankRecipe(new ItemStack(Blocks.logs1.get(), 1, 0), new ItemStack(Blocks.planks.get(), 6, 0));
CraftingHelpers.addSawmillLogToPlankRecipe(new ItemStack(Blocks.logs1.get(), 1, 1), new ItemStack(Blocks.planks.get(), 6, 1));
@ -27,11 +26,11 @@ public class TEIntegration
CraftingHelpers.addSawmillLogToPlankRecipe(new ItemStack(Blocks.logs2.get(), 1, 3), new ItemStack(Blocks.planks.get(), 6, 7));
CraftingHelpers.addSawmillLogToPlankRecipe(new ItemStack(Blocks.logs3.get(), 1, 0), new ItemStack(Blocks.planks.get(), 6, 8));
CraftingHelpers.addSawmillLogToPlankRecipe(new ItemStack(Blocks.logs3.get(), 1, 1), new ItemStack(Blocks.planks.get(), 6, 9));
}
}*/
private static void addPulverizerRecipes()
{
ItemStack woodchips = ItemRegistry.getItem("woodchips", 1);
/*ItemStack woodchips = ItemRegistry.getItem("woodchips", 1);
CraftingManagers.pulverizerManager.addRecipe(160, new ItemStack(Blocks.logs1.get(), 1, 0), woodchips);
CraftingManagers.pulverizerManager.addRecipe(160, new ItemStack(Blocks.logs1.get(), 1, 1), woodchips);
@ -43,10 +42,38 @@ public class TEIntegration
CraftingManagers.pulverizerManager.addRecipe(160, new ItemStack(Blocks.logs2.get(), 1, 3), woodchips);
CraftingManagers.pulverizerManager.addRecipe(160, new ItemStack(Blocks.logs3.get(), 1, 0), woodchips);
CraftingManagers.pulverizerManager.addRecipe(160, new ItemStack(Blocks.logs3.get(), 1, 1), woodchips);
CraftingManagers.pulverizerManager.addRecipe(160, new ItemStack(Blocks.logs3.get(), 1, 2), woodchips);
CraftingManagers.pulverizerManager.addRecipe(160, new ItemStack(Blocks.logs3.get(), 1, 2), woodchips);*/
CraftingManagers.pulverizerManager.addRecipe(160, new ItemStack(Blocks.bones.get(), 1, 0), new ItemStack(Item.dyePowder, 6, 15));
CraftingManagers.pulverizerManager.addRecipe(220, new ItemStack(Blocks.bones.get(), 1, 1), new ItemStack(Item.dyePowder, 12, 15));
CraftingManagers.pulverizerManager.addRecipe(280, new ItemStack(Blocks.bones.get(), 1, 2), new ItemStack(Item.dyePowder, 24, 15));
addPulverizerRecipe(160, new ItemStack(Blocks.bones.get(), 1, 0), new ItemStack(Item.dyePowder, 6, 15));
addPulverizerRecipe(220, new ItemStack(Blocks.bones.get(), 1, 1), new ItemStack(Item.dyePowder, 12, 15));
addPulverizerRecipe(280, new ItemStack(Blocks.bones.get(), 1, 2), new ItemStack(Item.dyePowder, 24, 15));
}
/*private static void addSawmillRecipe()
{
FMLInterModComms.sendMessage("ThermalExpansion", "SawmillRecipe", value)
}*/
private static void addPulverizerRecipe(int energy, ItemStack input, ItemStack primaryOutput)
{
addPulverizerRecipe(energy, input, primaryOutput, null, 0);
}
private static void addPulverizerRecipe(int energy, ItemStack input, ItemStack primaryOutput, ItemStack secondaryOutput)
{
addPulverizerRecipe(energy, input, primaryOutput, secondaryOutput, 0);
}
private static void addPulverizerRecipe(int energy, ItemStack input, ItemStack primaryOutput, ItemStack secondaryOutput, int secondaryChance)
{
NBTTagCompound pulverizerCompound = new NBTTagCompound();
pulverizerCompound.setInteger("energy", energy);
input.writeToNBT(pulverizerCompound.getCompoundTag("input"));
primaryOutput.writeToNBT(pulverizerCompound.getCompoundTag("primaryOutput"));
if (secondaryOutput != null) secondaryOutput.writeToNBT(pulverizerCompound.getCompoundTag("secondaryOutput"));
if (secondaryOutput != null && secondaryChance != 0) pulverizerCompound.setInteger("secondaryChance", secondaryChance);
FMLInterModComms.sendMessage("ThermalExpansion", "PulverizerRecipe", pulverizerCompound);
}
}