Updated to 1.6.2, started on amethyst buckets

This commit is contained in:
Adubbz 2013-07-09 13:37:21 +10:00
parent fe39bd0189
commit 116003e3ea
28 changed files with 72 additions and 519 deletions

View File

@ -344,7 +344,8 @@
<entry key="item.bop.flowerBand.exoticflowerband.name">Exotic Flower Band</entry>
<!--Liquids -->
<entry key="item.bop.bopBucket.spring_water.name">Spring Water Bucket</entry>
<entry key="item.bop.bopBucket.amethyst_empty.name">Amethyst Bucket</entry>
<entry key="item.bop.bopBucket.amethyst_spring_water.name">Spring Water Amethyst Bucket</entry>
<entry key="item.bop.bopBucket.liquid_poison.name">Liquid Poison Bucket</entry>
<entry key="tile.bop.liquidPoison.name">Liquid Poison</entry>

Binary file not shown.

After

Width:  |  Height:  |  Size: 286 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 313 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 323 B

View File

@ -13,6 +13,7 @@ import biomesoplenty.configuration.BOPLiquids;
import biomesoplenty.configuration.BOPPotions;
import biomesoplenty.configuration.BOPVanillaCompat;
import biomesoplenty.handlers.BOPCraftHandler;
import biomesoplenty.handlers.BOPLiquidEventHandler;
import biomesoplenty.handlers.BonemealHandler;
import biomesoplenty.handlers.BreakSpeedHandler;
import biomesoplenty.handlers.EntityEventHandler;
@ -21,7 +22,6 @@ import biomesoplenty.handlers.SoundHandler;
import biomesoplenty.handlers.TickHandlerClient;
import biomesoplenty.handlers.TickHandlerServer;
import biomesoplenty.helpers.AchievementHelper;
import biomesoplenty.helpers.BOPLiquidHelper;
import biomesoplenty.helpers.CreativeTabsBOP;
import biomesoplenty.helpers.Localizations;
import biomesoplenty.helpers.Version;
@ -100,7 +100,7 @@ public class BiomesOPlenty
MinecraftForge.EVENT_BUS.register(new AchievementHelper());
MinecraftForge.EVENT_BUS.register(new BonemealHandler());
MinecraftForge.EVENT_BUS.register(new EntityEventHandler());
MinecraftForge.EVENT_BUS.register(new BOPLiquidHelper());
MinecraftForge.EVENT_BUS.register(new BOPLiquidEventHandler());
MinecraftForge.EVENT_BUS.register(new BreakSpeedHandler());
MinecraftForge.EVENT_BUS.register(new MovementHandler());

View File

@ -107,7 +107,7 @@ public class BlockGrave extends Block
d0 = (double)target.blockX + block.getBlockBoundsMaxX() + (double)f;
}
effectRenderer.addEffect((new EntityDiggingFX(worldObj, d0, d1, d2, 0.0D, 0.0D, 0.0D, block, 0)).func_70596_a(target.blockX, target.blockY, target.blockZ).multiplyVelocity(0.2F).multipleParticleScaleBy(0.6F));
effectRenderer.addEffect((new EntityDiggingFX(worldObj, d0, d1, d2, 0.0D, 0.0D, 0.0D, block, 0)).applyColourMultiplier(target.blockX, target.blockY, target.blockZ).multiplyVelocity(0.2F).multipleParticleScaleBy(0.6F));
}
return true;
@ -129,7 +129,7 @@ public class BlockGrave extends Block
double d1 = (double)y + ((double)k1 + 0.5D) / (double)b0;
double d2 = (double)z + ((double)l1 + 0.5D) / (double)b0;
int i2 = world.rand.nextInt(6);
effectRenderer.addEffect(new EntityDiggingFX(world, d0, d1, d2, d0 - (double)x - 0.5D, d1 - (double)y - 0.5D, d2 - (double)z - 0.5D, Block.stone, i2, meta).func_70596_a(x, y, z));
effectRenderer.addEffect(new EntityDiggingFX(world, d0, d1, d2, d0 - (double)x - 0.5D, d1 - (double)y - 0.5D, d2 - (double)z - 0.5D, Block.stone, i2, meta).applyColourMultiplier(x, y, z));
}
}
}

View File

@ -1,4 +1,4 @@
package biomesoplenty.helpers;
package biomesoplenty.handlers;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
@ -9,7 +9,7 @@ import net.minecraftforge.event.ForgeSubscribe;
import net.minecraftforge.event.entity.player.FillBucketEvent;
import biomesoplenty.api.Liquids;
public class BOPLiquidHelper
public class BOPLiquidEventHandler
{
@ForgeSubscribe
public void onBucketFill(FillBucketEvent event)
@ -39,8 +39,11 @@ public class BOPLiquidHelper
{
world.setBlock(pos.blockX, pos.blockY, pos.blockZ, 0);
return new ItemStack(Liquids.bopBucket.get(), 1, 1);
} else
return new ItemStack(Liquids.bopBucket.get(), 1, 2);
}
else
{
return null;
}
}
}

View File

@ -1,8 +1,6 @@
package biomesoplenty.integration;
import net.minecraft.block.Block;
import net.minecraft.item.ItemStack;
import net.minecraftforge.liquids.LiquidStack;
import net.minecraftforge.oredict.OreDictionary;
import biomesoplenty.api.Blocks;
import biomesoplenty.api.Items;
@ -11,8 +9,6 @@ import forestry.api.apiculture.FlowerManager;
import forestry.api.core.EnumHumidity;
import forestry.api.core.EnumTemperature;
import forestry.api.core.GlobalManager;
import forestry.api.core.ItemInterface;
import forestry.api.recipes.RecipeManagers;
import forestry.api.storage.BackpackManager;
public class ForestryIntegration
@ -252,13 +248,13 @@ public class ForestryIntegration
private static void addFermenterRecipes()
{
addFermenterRecipeSapling(new ItemStack(Blocks.saplings.get(), 1, OreDictionary.WILDCARD_VALUE));
addFermenterRecipeSapling(new ItemStack(Blocks.colorizedSaplings.get(), 1, OreDictionary.WILDCARD_VALUE));
//addFermenterRecipeSapling(new ItemStack(Blocks.saplings.get(), 1, OreDictionary.WILDCARD_VALUE));
//addFermenterRecipeSapling(new ItemStack(Blocks.colorizedSaplings.get(), 1, OreDictionary.WILDCARD_VALUE));
RecipeManagers.squeezerManager.addRecipe(10, new ItemStack[] {new ItemStack(Items.berries.get(), 1)}, new LiquidStack(ItemInterface.getItem("liquidJuice").itemID, 50), ItemInterface.getItem("mulch"), 5);
//RecipeManagers.squeezerManager.addRecipe(10, new ItemStack[] {new ItemStack(Items.berries.get(), 1)}, new LiquidStack(ItemInterface.getItem("liquidJuice").itemID, 50), ItemInterface.getItem("mulch"), 5);
}
private static void addFermenterRecipeSapling(ItemStack resource) {
/*private static void addFermenterRecipeSapling(ItemStack resource) {
RecipeManagers.fermenterManager.addRecipe(resource, 250, 1.0f,
new LiquidStack(ItemInterface.getItem("liquidBiomass").itemID, 1, ItemInterface.getItem("liquidBiomass").getItemDamage()),
@ -271,7 +267,7 @@ public class ForestryIntegration
RecipeManagers.fermenterManager.addRecipe(resource, 250, 1.0f,
new LiquidStack(ItemInterface.getItem("liquidBiomass").itemID, 1, ItemInterface.getItem("liquidBiomass").getItemDamage()),
new LiquidStack(ItemInterface.getItem("liquidHoney").itemID, 1, ItemInterface.getItem("liquidHoney").getItemDamage()));
}
}*/
private static void addFlowers()
{

View File

@ -2,7 +2,6 @@ package biomesoplenty.items;
import java.util.List;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
@ -12,9 +11,6 @@ import net.minecraft.util.EnumMovingObjectType;
import net.minecraft.util.Icon;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.Event;
import net.minecraftforge.event.entity.player.FillBucketEvent;
import biomesoplenty.BiomesOPlenty;
import biomesoplenty.api.Liquids;
import cpw.mods.fml.relauncher.Side;
@ -24,7 +20,7 @@ public class ItemBOPBucket extends Item
{
private int isFull;
private static final String[] bucketTypes = new String[] {"spring_water", "liquid_poison"};
private static final String[] bucketTypes = new String[] {"amethyst_empty", "amethyst_spring_water", "liquid_poison"};
@SideOnly(Side.CLIENT)
private Icon[] textures;
@ -50,67 +46,21 @@ public class ItemBOPBucket extends Item
boolean flag = isFull == 0;
MovingObjectPosition movingobjectposition = this.getMovingObjectPositionFromPlayer(par2World, par3EntityPlayer, flag);
if (movingobjectposition == null)
return par1ItemStack;
else
if (par1ItemStack.getItemDamage() != 0)
{
FillBucketEvent event = new FillBucketEvent(par3EntityPlayer, par1ItemStack, par2World, movingobjectposition);
if (MinecraftForge.EVENT_BUS.post(event))
if (movingobjectposition == null)
return par1ItemStack;
if (event.getResult() == Event.Result.ALLOW)
else
{
if (par3EntityPlayer.capabilities.isCreativeMode)
return par1ItemStack;
if (--par1ItemStack.stackSize <= 0)
return event.result;
if (!par3EntityPlayer.inventory.addItemStackToInventory(event.result))
if (movingobjectposition.typeOfHit == EnumMovingObjectType.TILE)
{
par3EntityPlayer.dropPlayerItem(event.result);
}
int i = movingobjectposition.blockX;
int j = movingobjectposition.blockY;
int k = movingobjectposition.blockZ;
return par1ItemStack;
}
if (movingobjectposition.typeOfHit == EnumMovingObjectType.TILE)
{
int i = movingobjectposition.blockX;
int j = movingobjectposition.blockY;
int k = movingobjectposition.blockZ;
if (!par2World.canMineBlock(par3EntityPlayer, i, j, k))
return par1ItemStack;
if (isFull == 0)
{
if (!par3EntityPlayer.canPlayerEdit(i, j, k, movingobjectposition.sideHit, par1ItemStack))
if (!par2World.canMineBlock(par3EntityPlayer, i, j, k))
return par1ItemStack;
if (par2World.getBlockMaterial(i, j, k) == Material.water && (par2World.getBlockMetadata(i, j, k) == 0))
{
par2World.setBlockToAir(i, j, k);
if (par3EntityPlayer.capabilities.isCreativeMode)
return par1ItemStack;
if (--par1ItemStack.stackSize <= 0)
return new ItemStack(Item.bucketWater);
if (!par3EntityPlayer.inventory.addItemStackToInventory(new ItemStack(Item.bucketWater)))
{
par3EntityPlayer.dropPlayerItem(new ItemStack(Item.bucketWater.itemID, 1, 0));
}
return par1ItemStack;
}
if (!par3EntityPlayer.canPlayerEdit(i, j, k, movingobjectposition.sideHit, par1ItemStack))
return par1ItemStack;
}
else
{
if (isFull < 0)
return new ItemStack(Item.bucketEmpty);
@ -148,12 +98,17 @@ public class ItemBOPBucket extends Item
return par1ItemStack;
if (this.tryPlaceContainedLiquid(par2World, d0, d1, d2, i, j, k) && !par3EntityPlayer.capabilities.isCreativeMode)
return new ItemStack(Item.bucketEmpty);
{
if (par1ItemStack.getItemDamage() != 1)
return new ItemStack(Item.bucketEmpty);
else
return new ItemStack(Liquids.bopBucket.get(), 1, 0);
}
}
}
return par1ItemStack;
}
return par1ItemStack;
}
/**
@ -189,14 +144,14 @@ public class ItemBOPBucket extends Item
{
switch (meta)
{
case 0:
return Liquids.springWater.get().blockID;
case 1:
return Liquids.springWater.get().blockID;
case 1:
return Liquids.liquidPoison.get().blockID;
case 2:
return Liquids.liquidPoison.get().blockID;
default:
return Liquids.springWater.get().blockID;
default:
return Liquids.liquidPoison.get().blockID;
}
}

View File

@ -2,8 +2,6 @@ package forestry.api.fuels;
import java.util.HashMap;
import net.minecraftforge.liquids.LiquidStack;
public class GeneratorFuel {
public static HashMap<Integer, GeneratorFuel> fuels = new HashMap<Integer, GeneratorFuel>();
@ -11,20 +9,20 @@ public class GeneratorFuel {
/**
* LiquidStack representing the fuel type and amount consumed per triggered cycle.
*/
public final LiquidStack fuelConsumed;
//public final LiquidStack fuelConsumed;
/**
* EU emitted per tick while this fuel is being consumed in the generator (i.e. biofuel = 32, biomass = 8).
*/
public final int eu;
//public final int eu;
/**
* Rate at which the fuel is consumed. 1 - Every tick 2 - Every second tick 3 - Every third tick etc.
*/
public final int rate;
//public final int rate;
public GeneratorFuel(LiquidStack fuelConsumed, int eu, int rate) {
/*public GeneratorFuel(LiquidStack fuelConsumed, int eu, int rate) {
this.fuelConsumed = fuelConsumed;
this.eu = eu;
this.rate = rate;
}
}*/
}

View File

@ -6,7 +6,6 @@ import java.util.Map;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraftforge.liquids.LiquidStack;
public class ItemStackMap<T> extends HashMap<ItemStack, T> {
@ -45,8 +44,8 @@ public class ItemStackMap<T> extends HashMap<ItemStack, T> {
return false;
if (b instanceof ItemStack)
return ItemStack.areItemStackTagsEqual(a, (ItemStack) b) && a.isItemEqual((ItemStack) b);
else if (b instanceof LiquidStack)
return ItemStack.areItemStackTagsEqual(a, ((LiquidStack) b).asItemStack()) && a.isItemEqual(((LiquidStack) b).asItemStack());
//else if (b instanceof LiquidStack)
//return ItemStack.areItemStackTagsEqual(a, ((LiquidStack) b).asItemStack()) && a.isItemEqual(((LiquidStack) b).asItemStack());
else if (b instanceof Integer)
return ((Integer) b).equals(a.itemID);
else if (b instanceof Item)

View File

@ -1,7 +1,5 @@
package forestry.api.recipes;
import net.minecraft.item.ItemStack;
import net.minecraftforge.liquids.LiquidStack;
/**
* Provides an interface to the recipe manager of the bottler.
@ -31,6 +29,6 @@ public interface IBottlerManager extends ICraftingProvider {
* @param bottled
* ItemStack representing the finished product
*/
@Deprecated
public void addRecipe(int cyclesPerUnit, LiquidStack input, ItemStack can, ItemStack bottled);
//@Deprecated
//public void addRecipe(int cyclesPerUnit, LiquidStack input, ItemStack can, ItemStack bottled);
}

View File

@ -2,7 +2,6 @@ package forestry.api.recipes;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.ShapedRecipes;
import net.minecraftforge.liquids.LiquidStack;
/**
* Provides an interface to the recipe manager of the carpenter.
@ -59,7 +58,7 @@ public interface ICarpenterManager extends ICraftingProvider {
* @param materials
* Materials needed in the crafting matrix. This gets passed directly to {@link ShapedRecipes}. Notation is the same.
*/
public void addRecipe(int packagingTime, LiquidStack liquid, ItemStack box, ItemStack product, Object materials[]);
//public void addRecipe(int packagingTime, LiquidStack liquid, ItemStack box, ItemStack product, Object materials[]);
public void addCrating(String toCrate, ItemStack unpack, ItemStack crated);

View File

@ -1,12 +1,10 @@
package forestry.api.recipes;
import net.minecraft.item.ItemStack;
import net.minecraftforge.liquids.LiquidStack;
public interface IFabricatorManager extends ICraftingProvider {
void addRecipe(ItemStack plan, LiquidStack molten, ItemStack result, Object[] pattern);
//void addRecipe(ItemStack plan, LiquidStack molten, ItemStack result, Object[] pattern);
void addSmelting(ItemStack resource, LiquidStack molten, int meltingPoint);
//void addSmelting(ItemStack resource, LiquidStack molten, int meltingPoint);
}

View File

@ -1,7 +1,5 @@
package forestry.api.recipes;
import net.minecraft.item.ItemStack;
import net.minecraftforge.liquids.LiquidStack;
/**
* Provides an interface to the recipe manager of the fermenter.
@ -29,7 +27,7 @@ public interface IFermenterManager extends ICraftingProvider {
* @param liquid
* LiquidStack representing resource liquid and amount.
*/
public void addRecipe(ItemStack resource, int fermentationValue, float modifier, LiquidStack output, LiquidStack liquid);
//public void addRecipe(ItemStack resource, int fermentationValue, float modifier, LiquidStack output, LiquidStack liquid);
/**
* Add a recipe to the fermenter. Defaults to water as input liquid.
@ -43,6 +41,6 @@ public interface IFermenterManager extends ICraftingProvider {
* @param output
* LiquidStack representing output liquid. Amount is determined by fermentationValue*modifier.
*/
public void addRecipe(ItemStack resource, int fermentationValue, float modifier, LiquidStack output);
//public void addRecipe(ItemStack resource, int fermentationValue, float modifier, LiquidStack output);
}

View File

@ -1,7 +1,5 @@
package forestry.api.recipes;
import net.minecraft.item.ItemStack;
import net.minecraftforge.liquids.LiquidStack;
/**
* Provides an interface to the recipe manager of the suqeezer.
@ -29,7 +27,7 @@ public interface ISqueezerManager extends ICraftingProvider {
* @param chance
* Chance remnants will be produced by a single recipe cycle.
*/
public void addRecipe(int timePerItem, ItemStack[] resources, LiquidStack liquid, ItemStack remnants, int chance);
//public void addRecipe(int timePerItem, ItemStack[] resources, LiquidStack liquid, ItemStack remnants, int chance);
/**
* Add a recipe to the squeezer.
@ -41,5 +39,5 @@ public interface ISqueezerManager extends ICraftingProvider {
* @param liquid
* {@link LiquidStack} representing the output of this recipe.
*/
public void addRecipe(int timePerItem, ItemStack[] resources, LiquidStack liquid);
//public void addRecipe(int timePerItem, ItemStack[] resources, LiquidStack liquid);
}

View File

@ -1,6 +1,5 @@
package forestry.api.recipes;
import net.minecraftforge.liquids.LiquidStack;
/**
* Provides an interface to the recipe manager of the still.
@ -25,5 +24,5 @@ public interface IStillManager extends ICraftingProvider {
* @param output
* ItemStack representing the output liquid
*/
public void addRecipe(int cyclesPerUnit, LiquidStack input, LiquidStack output);
//public void addRecipe(int cyclesPerUnit, LiquidStack input, LiquidStack output);
}

View File

@ -7,7 +7,6 @@ import java.util.HashMap;
import java.util.List;
import mods.tinker.tconstruct.library.crafting.Detailing;
import mods.tinker.tconstruct.library.crafting.LiquidCasting;
import mods.tinker.tconstruct.library.crafting.ToolBuilder;
import mods.tinker.tconstruct.library.tools.ToolCore;
import mods.tinker.tconstruct.library.tools.ToolMaterial;
@ -264,7 +263,7 @@ public class TConstructRegistry
return (toolMaterialStrings.get(key));
}
public static LiquidCasting getTableCasting ()
/*public static LiquidCasting getTableCasting ()
{
return instance.tableCasting();
}
@ -304,7 +303,7 @@ public class TConstructRegistry
System.out.println("[TCon API] Could not find casting basin recipes.");
return null;
}
}
}*/
public static Detailing getChiselDetailing ()
{

View File

@ -166,7 +166,7 @@ public abstract class InventoryLogic extends TileEntity
return this.invName != null && this.invName.length() > 0;
}
@Override
/*@Override
public boolean isStackValidForSlot (int slot, ItemStack itemstack)
{
if (slot < getSizeInventory())
@ -175,5 +175,5 @@ public abstract class InventoryLogic extends TileEntity
return true;
}
return false;
}
}*/
}

View File

@ -1,93 +0,0 @@
package mods.tinker.tconstruct.library.crafting;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import net.minecraftforge.liquids.LiquidStack;
public class AlloyMix
{
public final LiquidStack result;
public final List<LiquidStack> mixers;
public AlloyMix(LiquidStack output, List<LiquidStack> inputs)
{
result = output;
mixers = inputs;
}
/*public boolean matches(List liquids)
{
ArrayList list = new ArrayList(mixers);
return false;
}*/
public LiquidStack mix (ArrayList<LiquidStack> liquids)
{
ArrayList<LiquidStack> copyMix = new ArrayList(mixers);
ArrayList effectiveAmount = new ArrayList();
for (int i = 0; i < liquids.size(); i++)
{
LiquidStack liquid = liquids.get(i);
Iterator iter = copyMix.iterator();
while (iter.hasNext())
{
LiquidStack mixer = (LiquidStack) iter.next();
if (mixer.itemID == liquid.itemID && mixer.itemMeta == liquid.itemMeta)
{
int eAmt = liquid.amount / mixer.amount;
effectiveAmount.add(eAmt);
copyMix.remove(mixer);
//inputs.add(liquid);
break;
}
}
}
//}
if (copyMix.size() > 0)
return null;
//Remove old liquids
int low = getLowestAmount(effectiveAmount);
ArrayList<LiquidStack> copyMix2 = new ArrayList(mixers);
for (int i = 0; i < liquids.size(); i++)
{
LiquidStack liquid = liquids.get(i);
Iterator iter = copyMix2.iterator();
while (iter.hasNext())
{
LiquidStack mixer = (LiquidStack) iter.next();
if (mixer.itemID == liquid.itemID && mixer.itemMeta == liquid.itemMeta)
{
int eAmt = low * mixer.amount;
liquid.amount -= eAmt;
if (liquid.amount <= 0)
{
liquids.remove(liquid);
i--;
}
copyMix2.remove(mixer);
break;
}
}
}
return new LiquidStack(result.itemID, result.amount * low, result.itemMeta);
}
int getLowestAmount (ArrayList list)
{
int frist = (Integer) list.get(0); //FRIST!!!
for (int i = 1; i < list.size(); i++)
{
int compare = (Integer) list.get(i);
if (frist > compare)
frist = compare;
}
return frist;
}
}

View File

@ -1,35 +0,0 @@
package mods.tinker.tconstruct.library.crafting;
import net.minecraft.item.ItemStack;
import net.minecraftforge.liquids.LiquidStack;
public class CastingRecipe
{
public ItemStack output;
public LiquidStack castingMetal;
public ItemStack cast;
public boolean consumeCast;
public int coolTime;
public CastingRecipe(ItemStack replacement, LiquidStack metal, ItemStack cast, boolean consume, int delay)
{
castingMetal = metal;
this.cast = cast;
output = replacement;
consumeCast = consume;
coolTime = delay;
}
public boolean matches(LiquidStack metal, ItemStack cast)
{
if (castingMetal.isLiquidEqual(metal) && ItemStack.areItemStacksEqual(this.cast, cast))
return true;
else
return false;
}
public ItemStack getResult()
{
return output.copy();
}
}

View File

@ -1,81 +0,0 @@
package mods.tinker.tconstruct.library.crafting;
import java.util.ArrayList;
import net.minecraft.item.ItemStack;
import net.minecraftforge.liquids.LiquidStack;
/* Melting becomes hardened */
public class LiquidCasting
{
//public static LiquidCasting instance = new LiquidCasting();
private ArrayList<CastingRecipe> casts = new ArrayList<CastingRecipe>();
/** Adds a casting recipe
*
* @param output Result of the cast
* @param metal Liquid to be used in casting. This also decides how much metal is consumed
* @param cast The empty item to cast with. ex Ingot Cast
* @param consume Whether the item should be consumed while casting
* @param delay Time to cast in ticks
*/
public void addCastingRecipe (ItemStack output, LiquidStack metal, ItemStack cast, boolean consume, int delay)
{
casts.add(new CastingRecipe(output, metal, cast, consume, delay));
}
/** Adds a casting recipe. Does not consume the cast
*
* @param output Result of the cast
* @param metal Liquid to be used in casting. This also decides how much metal is consumed
* @param cast The empty item to cast with. ex Ingot Cast
* @param delay Time to cast in ticks
*/
public void addCastingRecipe (ItemStack output, LiquidStack metal, ItemStack cast, int delay)
{
addCastingRecipe(output, metal, cast, false, delay);
}
/** Adds a casting recipe. Does not consume the cast or have an item to cast against
*
* @param output Result of the cast
* @param metal Liquid to be used in casting. This also decides how much metal is consumed
* @param delay Time to cast in ticks
*/
public void addCastingRecipe (ItemStack output, LiquidStack metal, int delay)
{
addCastingRecipe(output, metal, null, false, delay);
}
public int getCastingDelay (LiquidStack metal, ItemStack cast)
{
CastingRecipe recipe = getCastingRecipe(metal, cast);
if (recipe != null)
return recipe.coolTime;
return -1;
}
public int getCastingAmount (LiquidStack metal, ItemStack cast)
{
CastingRecipe recipe = getCastingRecipe(metal, cast);
if (recipe != null)
return recipe.castingMetal.amount;
return 0;
}
public CastingRecipe getCastingRecipe (LiquidStack metal, ItemStack cast)
{
for (CastingRecipe recipe : casts)
{
if (recipe.matches(metal, cast))
return recipe;
}
return null;
}
//Getter for public viewing
public ArrayList<CastingRecipe> getCastingRecipes()
{
return casts;
}
}

View File

@ -1,172 +0,0 @@
package mods.tinker.tconstruct.library.crafting;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.item.ItemStack;
import net.minecraftforge.liquids.LiquidStack;
/** Melting and hacking, churn and burn */
public class Smeltery
{
public static Smeltery instance = new Smeltery();
private HashMap<List<Integer>, LiquidStack> smeltingList = new HashMap<List<Integer>, LiquidStack>();
private HashMap<List<Integer>, Integer> temperatureList = new HashMap<List<Integer>, Integer>();
private HashMap<List<Integer>, ItemStack> renderIndex = new HashMap<List<Integer>, ItemStack>();
private ArrayList<AlloyMix> alloys = new ArrayList<AlloyMix>();
/** Adds mappings between an itemstack and an output liquid
* Example: Smeltery.addMelting(Block.oreIron, 0, 600, new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 2, 0));
*
* @param stack The itemstack to liquify
* @param temperature How hot the block should be before liquifying. Max temp in the Smeltery is 800, other structures may vary
* @param output The result of the process in liquid form
*/
public static void addMelting(ItemStack stack, int temperature, LiquidStack output)
{
addMelting(stack, stack.itemID, stack.getItemDamage(), temperature, output);
}
/** Adds mappings between a block and its liquid
* Example: Smeltery.addMelting(Block.oreIron, 0, 600, new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 2, 0));
*
* @param blockID The ID of the block to liquify and render
* @param metadata The metadata of the block to liquify and render
* @param temperature How hot the block should be before liquifying. Max temp in the Smeltery is 800, other structures may vary
* @param output The result of the process in liquid form
*/
public static void addMelting(Block block, int metadata, int temperature, LiquidStack output)
{
addMelting(new ItemStack(block, 1, metadata), block.blockID, metadata, temperature, output);
}
/** Adds mappings between an input and its liquid.
* Renders with the given input's block ID and metadata
* Example: Smeltery.addMelting(Block.oreIron, 0, 600, new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 2, 0));
*
* @param input The item to liquify
* @param blockID The ID of the block to render
* @param metadata The metadata of the block to render
* @param temperature How hot the block should be before liquifying
* @param liquid The result of the process
*/
public static void addMelting(ItemStack input, int blockID, int metadata, int temperature, LiquidStack liquid)
{
instance.smeltingList.put(Arrays.asList(input.itemID, input.getItemDamage()), liquid);
instance.temperatureList.put(Arrays.asList(input.itemID, input.getItemDamage()), temperature);
instance.renderIndex.put(Arrays.asList(input.itemID, input.getItemDamage()), new ItemStack(blockID, input.stackSize, metadata));
}
/** Adds an alloy mixing recipe.
* Example: Smeltery.addAlloyMixing(new LiquidStack(bronzeID, 2, 0), new LiquidStack(copperID, 3, 0), new LiquidStack(tinID, 1, 0));
* The example mixes 3 copper with 1 tin to make 2 bronze
*
* @param result The output of the combination of mixers. The quantity is used for amount of a successful mix
* @param mixers the liquids to be mixed. Quantities are used as ratios
*/
public static void addAlloyMixing(LiquidStack result, LiquidStack... mixers)
{
ArrayList inputs = new ArrayList();
for (LiquidStack liquid : mixers)
inputs.add(liquid);
instance.alloys.add(new AlloyMix(result, inputs));
}
/**
* Used to get the resulting temperature from a source ItemStack
* @param item The Source ItemStack
* @return The result temperature
*/
public static Integer getLiquifyTemperature(ItemStack item)
{
if (item == null)
return 20;
Integer temp = instance.temperatureList.get(Arrays.asList(item.itemID, item.getItemDamage()));
if (temp == null)
return 20;
else
return temp;
}
/**
* Used to get the resulting temperature from a source Block
* @param item The Source ItemStack
* @return The result ItemStack
*/
public static Integer getLiquifyTemperature(int blockID, int metadata)
{
return instance.temperatureList.get(Arrays.asList(blockID, metadata));
}
/**
* Used to get the resulting ItemStack from a source ItemStack
* @param item The Source ItemStack
* @return The result ItemStack
*/
public static LiquidStack getSmelteryResult(ItemStack item)
{
if (item == null)
return null;
LiquidStack stack = (LiquidStack) instance.smeltingList.get(Arrays.asList(item.itemID, item.getItemDamage()));
if (stack == null)
return null;
return stack.copy();
}
/**
* Used to get the resulting ItemStack from a source Block
* @param item The Source ItemStack
* @return The result ItemStack
*/
public static LiquidStack getSmelteryResult(int blockID, int metadata)
{
LiquidStack stack = (LiquidStack) instance.smeltingList.get(Arrays.asList(blockID, metadata));
if (stack == null)
return null;
return stack.copy();
}
public static ItemStack getRenderIndex(ItemStack input)
{
return instance.renderIndex.get(Arrays.asList(input.itemID, input.getItemDamage()));
}
public static ArrayList mixMetals(ArrayList<LiquidStack> moltenMetal)
{
ArrayList liquids = new ArrayList();
for (AlloyMix alloy : instance.alloys)
{
LiquidStack liquid = alloy.mix(moltenMetal);
if (liquid != null)
liquids.add(liquid);
}
return liquids;
}
public static HashMap<List<Integer>, LiquidStack> getSmeltingList()
{
return instance.smeltingList;
}
public static HashMap<List<Integer>, Integer> getTemperatureList()
{
return instance.temperatureList;
}
public static HashMap<List<Integer>, ItemStack> getRenderIndex()
{
return instance.renderIndex;
}
public static ArrayList<AlloyMix> getAlloyList()
{
return instance.alloys;
}
}

View File

@ -6,7 +6,6 @@ import net.minecraft.block.material.Material;
import net.minecraft.item.Item;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraftforge.liquids.LiquidStack;
import cpw.mods.fml.common.registry.GameRegistry;
/**
@ -43,12 +42,12 @@ public class ThermalExpansionInfo {
return GameRegistry.getFuelValue(theFuel) * 3 / 2;
}
public static int getFuelValue(LiquidStack theFuel) {
/*public static int getFuelValue(LiquidStack theFuel) {
if (theFuel.itemID == Block.lavaStill.blockID) {
return lavaFuelValue;
}
return 0;
}
}*/
}

View File

@ -6,8 +6,6 @@
package thermalexpansion.api.crafting;
import net.minecraft.item.ItemStack;
import net.minecraftforge.liquids.LiquidStack;
/**
* Provides an interface to the recipe manager of the Crucible. Accessible via
@ -28,9 +26,9 @@ public interface ICrucibleManager {
* 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, boolean overwrite);
public boolean addRecipe(int energy, ItemStack input, LiquidStack output);
// public boolean addRecipe(int energy, ItemStack input, LiquidStack output);
/**
* Access to the full list of recipes.

View File

@ -7,13 +7,12 @@
package thermalexpansion.api.crafting;
import net.minecraft.item.ItemStack;
import net.minecraftforge.liquids.LiquidStack;
public interface ICrucibleRecipe {
public ItemStack getInput();
public LiquidStack getOutput();
//public LiquidStack getOutput();
public int getEnergy();
}

View File

@ -6,8 +6,6 @@
package thermalexpansion.api.crafting;
import net.minecraft.item.ItemStack;
import net.minecraftforge.liquids.LiquidStack;
/**
* Provides an interface to the recipe manager of the Liquid Transposer. Accessible via
@ -32,9 +30,9 @@ public interface ITransposerManager {
* 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, boolean overwrite);
public boolean addFillRecipe(int energy, ItemStack input, ItemStack output, LiquidStack liquid, boolean reversible);
//public boolean addFillRecipe(int energy, ItemStack input, ItemStack output, LiquidStack liquid, boolean reversible);
/**
* Add a recipe to the Liquid Transposer
@ -58,9 +56,9 @@ public interface ITransposerManager {
* 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, boolean overwrite);
public boolean addExtractionRecipe(int energy, ItemStack input, ItemStack output, LiquidStack liquid, int chance, boolean reversible);
//public boolean addExtractionRecipe(int energy, ItemStack input, ItemStack output, LiquidStack liquid, int chance, boolean reversible);
/**
* Access to the list of recipes.

View File

@ -7,7 +7,6 @@
package thermalexpansion.api.crafting;
import net.minecraft.item.ItemStack;
import net.minecraftforge.liquids.LiquidStack;
public interface ITransposerRecipe {
@ -15,7 +14,7 @@ public interface ITransposerRecipe {
public ItemStack getOutput();
public LiquidStack getLiquid();
//public LiquidStack getLiquid();
public int getEnergy();