Mekanism-tilera-Edition/src/minecraft/mekanism/common/IFactory.java
Aidan Brady 86696e696e v5.2.2 Beta #1
*More javadocs.
*Fixed energy duplication with IC2 energy storage blocks.
*Made Universal Cable connect to IC2 energy outputters.
*Made machines have sustained inventories.
*Added option to configurator to empty a block's inventory contents.
*Added option to configurator to dump all a machine's upgrades.
*Tooltips now have colors associated with their values.
*Tooltips on blocks are now only shown when 'shift' is held down.
*Electric Bow now changes state when holding 'M' and shift.
*Configurator can change state by holding 'M' and shift.
*Updated IC2 API.
*Merged teleporter into BlockMachine.
*Added option to hide packet logs.
*Fixed Smelting Factory crash.
*Made IC2 machines output into Universal Cable regardless of it's
surroundings.
*Made teleporter sustain energy storage.
*Cleaned up code.
*Fixed crash if versionNumber or recentNews are null.
*Client-side player tick handler.
2013-03-30 19:13:59 -04:00

88 lines
1.8 KiB
Java

package mekanism.common;
import mekanism.common.RecipeHandler.Recipe;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.FurnaceRecipes;
public interface IFactory
{
/**
* Gets the recipe type this Smelting Factory currently has.
* @param itemStack - stack to check
* @return RecipeType ordinal
*/
public int getRecipeType(ItemStack itemStack);
/**
* Sets the recipe type of this Smelting Factory to a new value.
* @param type - RecipeType ordinal
* @param itemStack - stack to set
*/
public void setRecipeType(int type, ItemStack itemStack);
/**
* Whether or not this item is a Smelting Factory.
* @param itemStack - stack to check
* @return if the item is a smelting factory
*/
public boolean isFactory(ItemStack itemStack);
public static enum RecipeType
{
SMELTING("Smelting", "Smelter.ogg"),
ENRICHING("Enriching", "Chamber.ogg"),
CRUSHING("Crushing", "Crusher.ogg");
private String name;
private String sound;
public ItemStack getCopiedOutput(ItemStack input, boolean stackDecrease)
{
if(input == null)
{
return null;
}
if(this == SMELTING)
{
if(FurnaceRecipes.smelting().getSmeltingResult(input) != null)
{
ItemStack toReturn = FurnaceRecipes.smelting().getSmeltingResult(input).copy();
if(stackDecrease)
{
input.stackSize--;
}
return toReturn;
}
}
else if(this == ENRICHING)
{
return RecipeHandler.getOutput(input, stackDecrease, Recipe.ENRICHMENT_CHAMBER.get());
}
else if(this == CRUSHING)
{
return RecipeHandler.getOutput(input, stackDecrease, Recipe.CRUSHER.get());
}
return null;
}
public String getName()
{
return name;
}
public String getSound()
{
return sound;
}
private RecipeType(String s, String s1)
{
name = s;
sound = s1;
}
}
}