Finish multi-ID machine support
This commit is contained in:
parent
96ba50a673
commit
22fe896bcd
22 changed files with 256 additions and 241 deletions
|
@ -61,6 +61,7 @@ import mekanism.common.EntityObsidianTNT;
|
||||||
import mekanism.common.EntityRobit;
|
import mekanism.common.EntityRobit;
|
||||||
import mekanism.common.IElectricChest;
|
import mekanism.common.IElectricChest;
|
||||||
import mekanism.common.Mekanism;
|
import mekanism.common.Mekanism;
|
||||||
|
import mekanism.common.block.BlockMachine.MachineType;
|
||||||
import mekanism.common.inventory.InventoryElectricChest;
|
import mekanism.common.inventory.InventoryElectricChest;
|
||||||
import mekanism.common.item.ItemPortableTeleporter;
|
import mekanism.common.item.ItemPortableTeleporter;
|
||||||
import mekanism.common.tileentity.TileEntityAdvancedElectricMachine;
|
import mekanism.common.tileentity.TileEntityAdvancedElectricMachine;
|
||||||
|
@ -181,7 +182,7 @@ public class ClientProxy extends CommonProxy
|
||||||
FMLClientHandler.instance().getClient().sndManager.playSoundFX("random.chestopen", 1.0F, 1.0F);
|
FMLClientHandler.instance().getClient().sndManager.playSoundFX("random.chestopen", 1.0F, 1.0F);
|
||||||
ItemStack stack = entityplayer.getCurrentEquippedItem();
|
ItemStack stack = entityplayer.getCurrentEquippedItem();
|
||||||
|
|
||||||
if(stack != null && stack.getItem() instanceof IElectricChest && ((IElectricChest)stack.getItem()).isElectricChest(stack))
|
if(stack != null && stack.getItem() instanceof IElectricChest && MachineType.get(stack) == MachineType.ELECTRIC_CHEST)
|
||||||
{
|
{
|
||||||
InventoryElectricChest inventory = new InventoryElectricChest(entityplayer);
|
InventoryElectricChest inventory = new InventoryElectricChest(entityplayer);
|
||||||
FMLClientHandler.instance().displayGuiScreen(entityplayer, new GuiElectricChest(entityplayer.inventory, inventory));
|
FMLClientHandler.instance().displayGuiScreen(entityplayer, new GuiElectricChest(entityplayer.inventory, inventory));
|
||||||
|
@ -198,7 +199,7 @@ public class ClientProxy extends CommonProxy
|
||||||
else {
|
else {
|
||||||
ItemStack stack = entityplayer.getCurrentEquippedItem();
|
ItemStack stack = entityplayer.getCurrentEquippedItem();
|
||||||
|
|
||||||
if(stack != null && stack.getItem() instanceof IElectricChest && ((IElectricChest)stack.getItem()).isElectricChest(stack))
|
if(stack != null && stack.getItem() instanceof IElectricChest && MachineType.get(stack) == MachineType.ELECTRIC_CHEST)
|
||||||
{
|
{
|
||||||
FMLClientHandler.instance().displayGuiScreen(entityplayer, new GuiPasswordEnter(stack));
|
FMLClientHandler.instance().displayGuiScreen(entityplayer, new GuiPasswordEnter(stack));
|
||||||
}
|
}
|
||||||
|
@ -213,7 +214,7 @@ public class ClientProxy extends CommonProxy
|
||||||
else {
|
else {
|
||||||
ItemStack stack = entityplayer.getCurrentEquippedItem();
|
ItemStack stack = entityplayer.getCurrentEquippedItem();
|
||||||
|
|
||||||
if(stack != null && stack.getItem() instanceof IElectricChest && ((IElectricChest)stack.getItem()).isElectricChest(stack))
|
if(stack != null && stack.getItem() instanceof IElectricChest && MachineType.get(stack) == MachineType.ELECTRIC_CHEST)
|
||||||
{
|
{
|
||||||
FMLClientHandler.instance().displayGuiScreen(entityplayer, new GuiPasswordModify(stack));
|
FMLClientHandler.instance().displayGuiScreen(entityplayer, new GuiPasswordModify(stack));
|
||||||
}
|
}
|
||||||
|
@ -264,6 +265,7 @@ public class ClientProxy extends CommonProxy
|
||||||
|
|
||||||
MinecraftForgeClient.registerItemRenderer(Mekanism.energyCubeID, handler);
|
MinecraftForgeClient.registerItemRenderer(Mekanism.energyCubeID, handler);
|
||||||
MinecraftForgeClient.registerItemRenderer(Mekanism.machineBlockID, handler);
|
MinecraftForgeClient.registerItemRenderer(Mekanism.machineBlockID, handler);
|
||||||
|
MinecraftForgeClient.registerItemRenderer(Mekanism.machineBlock2ID, handler);
|
||||||
MinecraftForgeClient.registerItemRenderer(Mekanism.Robit.itemID, handler);
|
MinecraftForgeClient.registerItemRenderer(Mekanism.Robit.itemID, handler);
|
||||||
MinecraftForgeClient.registerItemRenderer(Mekanism.WalkieTalkie.itemID, handler);
|
MinecraftForgeClient.registerItemRenderer(Mekanism.WalkieTalkie.itemID, handler);
|
||||||
MinecraftForgeClient.registerItemRenderer(Mekanism.gasTankID, handler);
|
MinecraftForgeClient.registerItemRenderer(Mekanism.gasTankID, handler);
|
||||||
|
|
|
@ -8,6 +8,7 @@ import mekanism.api.energy.IEnergizedItem;
|
||||||
import mekanism.common.IEnergyCube;
|
import mekanism.common.IEnergyCube;
|
||||||
import mekanism.common.IFactory;
|
import mekanism.common.IFactory;
|
||||||
import mekanism.common.MekanismRecipe;
|
import mekanism.common.MekanismRecipe;
|
||||||
|
import mekanism.common.block.BlockMachine.MachineType;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.item.crafting.CraftingManager;
|
import net.minecraft.item.crafting.CraftingManager;
|
||||||
import net.minecraft.item.crafting.IRecipe;
|
import net.minecraft.item.crafting.IRecipe;
|
||||||
|
@ -122,7 +123,7 @@ public class MekanismRecipeHandler extends ShapedRecipeHandler
|
||||||
}
|
}
|
||||||
else if(stack1.getItem() instanceof IFactory && stack2.getItem() instanceof IFactory)
|
else if(stack1.getItem() instanceof IFactory && stack2.getItem() instanceof IFactory)
|
||||||
{
|
{
|
||||||
if(((IFactory)stack1.getItem()).isFactory(stack1) && ((IFactory)stack2.getItem()).isFactory(stack2))
|
if(isFactory(stack1) && isFactory(stack2))
|
||||||
{
|
{
|
||||||
if(((IFactory)stack1.getItem()).getRecipeType(stack1) != ((IFactory)stack2.getItem()).getRecipeType(stack2))
|
if(((IFactory)stack1.getItem()).getRecipeType(stack1) != ((IFactory)stack2.getItem()).getRecipeType(stack2))
|
||||||
{
|
{
|
||||||
|
@ -135,6 +136,11 @@ public class MekanismRecipeHandler extends ShapedRecipeHandler
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static boolean isFactory(ItemStack stack)
|
||||||
|
{
|
||||||
|
return MachineType.get(stack) == MachineType.BASIC_FACTORY || MachineType.get(stack) == MachineType.ADVANCED_FACTORY || MachineType.get(stack) == MachineType.ELITE_FACTORY;
|
||||||
|
}
|
||||||
|
|
||||||
public class CachedEnergyRecipe extends CachedRecipe
|
public class CachedEnergyRecipe extends CachedRecipe
|
||||||
{
|
{
|
||||||
public ArrayList<PositionedStack> ingredients;
|
public ArrayList<PositionedStack> ingredients;
|
||||||
|
|
|
@ -41,7 +41,7 @@ public class MachineRenderingHandler implements ISimpleBlockRenderingHandler
|
||||||
GL11.glPushMatrix();
|
GL11.glPushMatrix();
|
||||||
GL11.glRotatef(90F, 0.0F, 1.0F, 0.0F);
|
GL11.glRotatef(90F, 0.0F, 1.0F, 0.0F);
|
||||||
|
|
||||||
if(metadata == MachineType.ELECTRIC_PUMP.meta)
|
if(MachineType.get(block.blockID, metadata) == MachineType.ELECTRIC_PUMP)
|
||||||
{
|
{
|
||||||
GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
|
GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
|
||||||
GL11.glRotatef(90F, 0.0F, -1.0F, 0.0F);
|
GL11.glRotatef(90F, 0.0F, -1.0F, 0.0F);
|
||||||
|
@ -49,7 +49,7 @@ public class MachineRenderingHandler implements ISimpleBlockRenderingHandler
|
||||||
Minecraft.getMinecraft().renderEngine.bindTexture(MekanismUtils.getResource(ResourceType.RENDER, "ElectricPump.png"));
|
Minecraft.getMinecraft().renderEngine.bindTexture(MekanismUtils.getResource(ResourceType.RENDER, "ElectricPump.png"));
|
||||||
electricPump.render(0.0560F);
|
electricPump.render(0.0560F);
|
||||||
}
|
}
|
||||||
else if(metadata == MachineType.METALLURGIC_INFUSER.meta)
|
else if(MachineType.get(block.blockID, metadata) == MachineType.METALLURGIC_INFUSER)
|
||||||
{
|
{
|
||||||
GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
|
GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
|
||||||
GL11.glRotatef(270F, 0.0F, -1.0F, 0.0F);
|
GL11.glRotatef(270F, 0.0F, -1.0F, 0.0F);
|
||||||
|
@ -57,14 +57,14 @@ public class MachineRenderingHandler implements ISimpleBlockRenderingHandler
|
||||||
Minecraft.getMinecraft().renderEngine.bindTexture(MekanismUtils.getResource(ResourceType.RENDER, "MetallurgicInfuser.png"));
|
Minecraft.getMinecraft().renderEngine.bindTexture(MekanismUtils.getResource(ResourceType.RENDER, "MetallurgicInfuser.png"));
|
||||||
metallurgicInfuser.render(0.0625F);
|
metallurgicInfuser.render(0.0625F);
|
||||||
}
|
}
|
||||||
else if(metadata == MachineType.CHARGEPAD.meta)
|
else if(MachineType.get(block.blockID, metadata) == MachineType.CHARGEPAD)
|
||||||
{
|
{
|
||||||
GL11.glRotatef(180F, 1.0F, 0.0F, 0.0F);
|
GL11.glRotatef(180F, 1.0F, 0.0F, 0.0F);
|
||||||
GL11.glTranslatef(0.0F, -1.1F, 0.0F);
|
GL11.glTranslatef(0.0F, -1.1F, 0.0F);
|
||||||
Minecraft.getMinecraft().renderEngine.bindTexture(MekanismUtils.getResource(ResourceType.RENDER, "Chargepad.png"));
|
Minecraft.getMinecraft().renderEngine.bindTexture(MekanismUtils.getResource(ResourceType.RENDER, "Chargepad.png"));
|
||||||
chargepad.render(0.0625F);
|
chargepad.render(0.0625F);
|
||||||
}
|
}
|
||||||
else if(metadata == MachineType.LOGISTICAL_SORTER.meta)
|
else if(MachineType.get(block.blockID, metadata) == MachineType.LOGISTICAL_SORTER)
|
||||||
{
|
{
|
||||||
GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
|
GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
|
||||||
GL11.glRotatef(270F, 0.0F, -1.0F, 0.0F);
|
GL11.glRotatef(270F, 0.0F, -1.0F, 0.0F);
|
||||||
|
@ -72,7 +72,7 @@ public class MachineRenderingHandler implements ISimpleBlockRenderingHandler
|
||||||
Minecraft.getMinecraft().renderEngine.bindTexture(MekanismUtils.getResource(ResourceType.RENDER, "LogisticalSorter.png"));
|
Minecraft.getMinecraft().renderEngine.bindTexture(MekanismUtils.getResource(ResourceType.RENDER, "LogisticalSorter.png"));
|
||||||
logisticalSorter.render(0.0625F, false);
|
logisticalSorter.render(0.0625F, false);
|
||||||
}
|
}
|
||||||
else if(metadata == MachineType.DIGITAL_MINER.meta)
|
else if(MachineType.get(block.blockID, metadata) == MachineType.DIGITAL_MINER)
|
||||||
{
|
{
|
||||||
GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
|
GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
|
||||||
GL11.glRotatef(90F, 0.0F, 1.0F, 0.0F);
|
GL11.glRotatef(90F, 0.0F, 1.0F, 0.0F);
|
||||||
|
|
|
@ -277,7 +277,7 @@ public class ItemRenderingHandler implements IItemRenderer
|
||||||
MekanismRenderer.glowOff();
|
MekanismRenderer.glowOff();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(item.getItem() instanceof ItemBlockMachine && item.getItemDamage() == MachineType.ELECTRIC_CHEST.meta)
|
else if(MachineType.get(item) == MachineType.ELECTRIC_CHEST)
|
||||||
{
|
{
|
||||||
IElectricChest chest = (IElectricChest)item.getItem();
|
IElectricChest chest = (IElectricChest)item.getItem();
|
||||||
|
|
||||||
|
|
|
@ -152,6 +152,7 @@ public class CommonProxy
|
||||||
Mekanism.boundingBlockID = Mekanism.configuration.getBlock("BoundingBlock", 3005).getInt();
|
Mekanism.boundingBlockID = Mekanism.configuration.getBlock("BoundingBlock", 3005).getInt();
|
||||||
Mekanism.gasTankID = Mekanism.configuration.getBlock("GasTank", 3006).getInt();
|
Mekanism.gasTankID = Mekanism.configuration.getBlock("GasTank", 3006).getInt();
|
||||||
Mekanism.transmitterID = Mekanism.configuration.getBlock("Transmitter", 3007).getInt();
|
Mekanism.transmitterID = Mekanism.configuration.getBlock("Transmitter", 3007).getInt();
|
||||||
|
Mekanism.machineBlock2ID = Mekanism.configuration.getBlock("MachineBlock2", 3008).getInt();
|
||||||
|
|
||||||
Mekanism.osmiumGenerationEnabled = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "OsmiumGenerationEnabled", true).getBoolean(true);
|
Mekanism.osmiumGenerationEnabled = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "OsmiumGenerationEnabled", true).getBoolean(true);
|
||||||
Mekanism.disableBCSteelCrafting = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "DisableBCSteelCrafting", false).getBoolean(true);
|
Mekanism.disableBCSteelCrafting = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "DisableBCSteelCrafting", false).getBoolean(true);
|
||||||
|
|
|
@ -92,11 +92,4 @@ public interface IElectricChest
|
||||||
* @return prevLidAngle value
|
* @return prevLidAngle value
|
||||||
*/
|
*/
|
||||||
public float getPrevLidAngle(ItemStack itemStack);
|
public float getPrevLidAngle(ItemStack itemStack);
|
||||||
|
|
||||||
/**
|
|
||||||
* Whether or not the given ItemStack is an electric chest.
|
|
||||||
* @param itemStack - stack to check
|
|
||||||
* @return if the stack is an electric chest
|
|
||||||
*/
|
|
||||||
public boolean isElectricChest(ItemStack itemStack);
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,21 +27,14 @@ public interface IFactory
|
||||||
*/
|
*/
|
||||||
public void setRecipeType(int type, ItemStack itemStack);
|
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
|
public static enum RecipeType
|
||||||
{
|
{
|
||||||
SMELTING("Smelting", "Smelter.ogg", new ItemStack(Mekanism.MachineBlock, 1, MachineType.ENERGIZED_SMELTER.meta), false),
|
SMELTING("Smelting", "Smelter.ogg", MachineType.ENERGIZED_SMELTER.getStack(), false),
|
||||||
ENRICHING("Enriching", "Chamber.ogg", new ItemStack(Mekanism.MachineBlock, 1, MachineType.ENRICHMENT_CHAMBER.meta), false),
|
ENRICHING("Enriching", "Chamber.ogg", MachineType.ENRICHMENT_CHAMBER.getStack(), false),
|
||||||
CRUSHING("Crushing", "Crusher.ogg", new ItemStack(Mekanism.MachineBlock, 1, MachineType.CRUSHER.meta), false),
|
CRUSHING("Crushing", "Crusher.ogg", MachineType.CRUSHER.getStack(), false),
|
||||||
COMPRESSING("Compressing", "Compressor.ogg", new ItemStack(Mekanism.MachineBlock, 1, MachineType.OSMIUM_COMPRESSOR.meta), true),
|
COMPRESSING("Compressing", "Compressor.ogg", MachineType.OSMIUM_COMPRESSOR.getStack(), true),
|
||||||
COMBINING("Combining", "Combiner.ogg", new ItemStack(Mekanism.MachineBlock, 1, MachineType.COMBINER.meta), true),
|
COMBINING("Combining", "Combiner.ogg", MachineType.COMBINER.getStack(), true),
|
||||||
PURIFYING("Purifying", "PurificationChamber.ogg", new ItemStack(Mekanism.MachineBlock, 1, MachineType.PURIFICATION_CHAMBER.meta), true);
|
PURIFYING("Purifying", "PurificationChamber.ogg", MachineType.PURIFICATION_CHAMBER.getStack(), true);
|
||||||
|
|
||||||
private String name;
|
private String name;
|
||||||
private String sound;
|
private String sound;
|
||||||
|
|
|
@ -173,14 +173,15 @@ public class Mekanism
|
||||||
public static Set<Object3D> ic2Registered = new HashSet<Object3D>();
|
public static Set<Object3D> ic2Registered = new HashSet<Object3D>();
|
||||||
|
|
||||||
//Block IDs
|
//Block IDs
|
||||||
public static int basicBlockID = 3000;
|
public static int basicBlockID;
|
||||||
public static int machineBlockID = 3001;
|
public static int machineBlockID;
|
||||||
public static int oreBlockID = 3002;
|
public static int machineBlock2ID;
|
||||||
public static int obsidianTNTID = 3003;
|
public static int oreBlockID;
|
||||||
public static int energyCubeID = 3004;
|
public static int obsidianTNTID;
|
||||||
public static int boundingBlockID = 3005;
|
public static int energyCubeID;
|
||||||
public static int gasTankID = 3006;
|
public static int boundingBlockID;
|
||||||
public static int transmitterID = 3007;
|
public static int gasTankID;
|
||||||
|
public static int transmitterID;
|
||||||
|
|
||||||
//Items
|
//Items
|
||||||
public static ItemElectricBow ElectricBow;
|
public static ItemElectricBow ElectricBow;
|
||||||
|
@ -205,6 +206,7 @@ public class Mekanism
|
||||||
//Blocks
|
//Blocks
|
||||||
public static Block BasicBlock;
|
public static Block BasicBlock;
|
||||||
public static Block MachineBlock;
|
public static Block MachineBlock;
|
||||||
|
public static Block MachineBlock2;
|
||||||
public static Block OreBlock;
|
public static Block OreBlock;
|
||||||
public static Block ObsidianTNT;
|
public static Block ObsidianTNT;
|
||||||
public static Block EnergyCube;
|
public static Block EnergyCube;
|
||||||
|
@ -260,7 +262,7 @@ public class Mekanism
|
||||||
{
|
{
|
||||||
//Storage Recipes
|
//Storage Recipes
|
||||||
CraftingManager.getInstance().getRecipeList().add(new MekanismRecipe(new ItemStack(BasicBlock, 1, 3), new Object[] {
|
CraftingManager.getInstance().getRecipeList().add(new MekanismRecipe(new ItemStack(BasicBlock, 1, 3), new Object[] {
|
||||||
"***", "***", "***", Character.valueOf('*'), Item.coal
|
"***", "***", "***", Character.valueOf('*'), new ItemStack(Item.coal, 1, 1)
|
||||||
}));
|
}));
|
||||||
CraftingManager.getInstance().getRecipeList().add(new MekanismRecipe(new ItemStack(Item.coal, 9), new Object[] {
|
CraftingManager.getInstance().getRecipeList().add(new MekanismRecipe(new ItemStack(Item.coal, 9), new Object[] {
|
||||||
"*", Character.valueOf('*'), new ItemStack(BasicBlock, 1, 3)
|
"*", Character.valueOf('*'), new ItemStack(BasicBlock, 1, 3)
|
||||||
|
@ -575,6 +577,7 @@ public class Mekanism
|
||||||
//Declarations
|
//Declarations
|
||||||
BasicBlock = new BlockBasic(basicBlockID).setUnlocalizedName("BasicBlock");
|
BasicBlock = new BlockBasic(basicBlockID).setUnlocalizedName("BasicBlock");
|
||||||
MachineBlock = new BlockMachine(machineBlockID).setUnlocalizedName("MachineBlock");
|
MachineBlock = new BlockMachine(machineBlockID).setUnlocalizedName("MachineBlock");
|
||||||
|
MachineBlock2 = new BlockMachine(machineBlock2ID).setUnlocalizedName("MachineBlock2");
|
||||||
OreBlock = new BlockOre(oreBlockID).setUnlocalizedName("OreBlock");
|
OreBlock = new BlockOre(oreBlockID).setUnlocalizedName("OreBlock");
|
||||||
EnergyCube = new BlockEnergyCube(energyCubeID).setUnlocalizedName("EnergyCube");
|
EnergyCube = new BlockEnergyCube(energyCubeID).setUnlocalizedName("EnergyCube");
|
||||||
ObsidianTNT = new BlockObsidianTNT(obsidianTNTID).setUnlocalizedName("ObsidianTNT").setCreativeTab(tabMekanism);
|
ObsidianTNT = new BlockObsidianTNT(obsidianTNTID).setUnlocalizedName("ObsidianTNT").setCreativeTab(tabMekanism);
|
||||||
|
@ -589,6 +592,7 @@ public class Mekanism
|
||||||
//Add block items into itemsList for blocks with common IDs.
|
//Add block items into itemsList for blocks with common IDs.
|
||||||
Item.itemsList[basicBlockID] = new ItemBlockBasic(basicBlockID - 256, BasicBlock).setUnlocalizedName("BasicBlock");
|
Item.itemsList[basicBlockID] = new ItemBlockBasic(basicBlockID - 256, BasicBlock).setUnlocalizedName("BasicBlock");
|
||||||
Item.itemsList[machineBlockID] = new ItemBlockMachine(machineBlockID - 256, MachineBlock).setUnlocalizedName("MachineBlock");
|
Item.itemsList[machineBlockID] = new ItemBlockMachine(machineBlockID - 256, MachineBlock).setUnlocalizedName("MachineBlock");
|
||||||
|
Item.itemsList[machineBlock2ID] = new ItemBlockMachine(machineBlock2ID - 256, MachineBlock2).setUnlocalizedName("MachineBlock2");
|
||||||
Item.itemsList[oreBlockID] = new ItemBlockOre(oreBlockID - 256, OreBlock).setUnlocalizedName("OreBlock");
|
Item.itemsList[oreBlockID] = new ItemBlockOre(oreBlockID - 256, OreBlock).setUnlocalizedName("OreBlock");
|
||||||
Item.itemsList[energyCubeID] = new ItemBlockEnergyCube(energyCubeID - 256, EnergyCube).setUnlocalizedName("EnergyCube");
|
Item.itemsList[energyCubeID] = new ItemBlockEnergyCube(energyCubeID - 256, EnergyCube).setUnlocalizedName("EnergyCube");
|
||||||
Item.itemsList[gasTankID] = new ItemBlockGasTank(gasTankID - 256, GasTank).setUnlocalizedName("GasTank");
|
Item.itemsList[gasTankID] = new ItemBlockGasTank(gasTankID - 256, GasTank).setUnlocalizedName("GasTank");
|
||||||
|
|
|
@ -5,6 +5,7 @@ import java.util.HashMap;
|
||||||
|
|
||||||
import mekanism.api.IUpgradeManagement;
|
import mekanism.api.IUpgradeManagement;
|
||||||
import mekanism.api.energy.IEnergizedItem;
|
import mekanism.api.energy.IEnergizedItem;
|
||||||
|
import mekanism.common.block.BlockMachine.MachineType;
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.inventory.InventoryCrafting;
|
import net.minecraft.inventory.InventoryCrafting;
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
|
@ -312,7 +313,7 @@ public class MekanismRecipe implements IRecipe
|
||||||
}
|
}
|
||||||
else if(target.getItem() instanceof IFactory && input.getItem() instanceof IFactory)
|
else if(target.getItem() instanceof IFactory && input.getItem() instanceof IFactory)
|
||||||
{
|
{
|
||||||
if(((IFactory)target.getItem()).isFactory(target) && ((IFactory)input.getItem()).isFactory(input))
|
if(isFactory(target) && isFactory(input))
|
||||||
{
|
{
|
||||||
if(((IFactory)target.getItem()).getRecipeType(target) != ((IFactory)input.getItem()).getRecipeType(input))
|
if(((IFactory)target.getItem()).getRecipeType(target) != ((IFactory)input.getItem()).getRecipeType(input))
|
||||||
{
|
{
|
||||||
|
@ -325,6 +326,11 @@ public class MekanismRecipe implements IRecipe
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static boolean isFactory(ItemStack stack)
|
||||||
|
{
|
||||||
|
return MachineType.get(stack) == MachineType.BASIC_FACTORY || MachineType.get(stack) == MachineType.ADVANCED_FACTORY || MachineType.get(stack) == MachineType.ELITE_FACTORY;
|
||||||
|
}
|
||||||
|
|
||||||
public MekanismRecipe setMirrored(boolean mirror)
|
public MekanismRecipe setMirrored(boolean mirror)
|
||||||
{
|
{
|
||||||
mirrored = mirror;
|
mirrored = mirror;
|
||||||
|
|
|
@ -49,7 +49,7 @@ import cpw.mods.fml.relauncher.SideOnly;
|
||||||
* 0: Osmium Block
|
* 0: Osmium Block
|
||||||
* 1: Bronze Block
|
* 1: Bronze Block
|
||||||
* 2: Refined Obsidian
|
* 2: Refined Obsidian
|
||||||
* 3: Coal Block
|
* 3: Charcoal Block
|
||||||
* 4: Refined Glowstone
|
* 4: Refined Glowstone
|
||||||
* 5: Steel Block
|
* 5: Steel Block
|
||||||
* 6: Bin
|
* 6: Bin
|
||||||
|
|
|
@ -113,34 +113,37 @@ public class BlockMachine extends BlockContainer implements ISpecialBounds
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public void registerIcons(IconRegister register)
|
public void registerIcons(IconRegister register)
|
||||||
{
|
{
|
||||||
icons[blockID][0][0] = register.registerIcon("mekanism:EnrichmentChamberFrontOff");
|
if(blockID == Mekanism.machineBlockID)
|
||||||
icons[blockID][0][1] = register.registerIcon("mekanism:EnrichmentChamberFrontOn");
|
{
|
||||||
icons[blockID][0][2] = register.registerIcon("mekanism:SteelCasing");
|
icons[blockID][0][0] = register.registerIcon("mekanism:EnrichmentChamberFrontOff");
|
||||||
icons[blockID][1][0] = register.registerIcon("mekanism:OsmiumCompressorFrontOff");
|
icons[blockID][0][1] = register.registerIcon("mekanism:EnrichmentChamberFrontOn");
|
||||||
icons[blockID][1][1] = register.registerIcon("mekanism:OsmiumCompressorFrontOn");
|
icons[blockID][0][2] = register.registerIcon("mekanism:SteelCasing");
|
||||||
icons[blockID][1][2] = register.registerIcon("mekanism:SteelCasing");
|
icons[blockID][1][0] = register.registerIcon("mekanism:OsmiumCompressorFrontOff");
|
||||||
icons[blockID][2][0] = register.registerIcon("mekanism:CombinerFrontOff");
|
icons[blockID][1][1] = register.registerIcon("mekanism:OsmiumCompressorFrontOn");
|
||||||
icons[blockID][2][1] = register.registerIcon("mekanism:CombinerFrontOn");
|
icons[blockID][1][2] = register.registerIcon("mekanism:SteelCasing");
|
||||||
icons[blockID][2][2] = register.registerIcon("mekanism:SteelCasing");
|
icons[blockID][2][0] = register.registerIcon("mekanism:CombinerFrontOff");
|
||||||
icons[blockID][3][0] = register.registerIcon("mekanism:CrusherFrontOff");
|
icons[blockID][2][1] = register.registerIcon("mekanism:CombinerFrontOn");
|
||||||
icons[blockID][3][1] = register.registerIcon("mekanism:CrusherFrontOn");
|
icons[blockID][2][2] = register.registerIcon("mekanism:SteelCasing");
|
||||||
icons[blockID][3][2] = register.registerIcon("mekanism:SteelCasing");
|
icons[blockID][3][0] = register.registerIcon("mekanism:CrusherFrontOff");
|
||||||
icons[blockID][5][0] = register.registerIcon("mekanism:BasicFactoryFront");
|
icons[blockID][3][1] = register.registerIcon("mekanism:CrusherFrontOn");
|
||||||
icons[blockID][5][1] = register.registerIcon("mekanism:BasicFactorySide");
|
icons[blockID][3][2] = register.registerIcon("mekanism:SteelCasing");
|
||||||
icons[blockID][5][2] = register.registerIcon("mekanism:BasicFactoryTop");
|
icons[blockID][5][0] = register.registerIcon("mekanism:BasicFactoryFront");
|
||||||
icons[blockID][6][0] = register.registerIcon("mekanism:AdvancedFactoryFront");
|
icons[blockID][5][1] = register.registerIcon("mekanism:BasicFactorySide");
|
||||||
icons[blockID][6][1] = register.registerIcon("mekanism:AdvancedFactorySide");
|
icons[blockID][5][2] = register.registerIcon("mekanism:BasicFactoryTop");
|
||||||
icons[blockID][6][2] = register.registerIcon("mekanism:AdvancedFactoryTop");
|
icons[blockID][6][0] = register.registerIcon("mekanism:AdvancedFactoryFront");
|
||||||
icons[blockID][7][0] = register.registerIcon("mekanism:EliteFactoryFront");
|
icons[blockID][6][1] = register.registerIcon("mekanism:AdvancedFactorySide");
|
||||||
icons[blockID][7][1] = register.registerIcon("mekanism:EliteFactorySide");
|
icons[blockID][6][2] = register.registerIcon("mekanism:AdvancedFactoryTop");
|
||||||
icons[blockID][7][2] = register.registerIcon("mekanism:EliteFactoryTop");
|
icons[blockID][7][0] = register.registerIcon("mekanism:EliteFactoryFront");
|
||||||
icons[blockID][9][0] = register.registerIcon("mekanism:PurificationChamberFrontOff");
|
icons[blockID][7][1] = register.registerIcon("mekanism:EliteFactorySide");
|
||||||
icons[blockID][9][1] = register.registerIcon("mekanism:PurificationChamberFrontOn");
|
icons[blockID][7][2] = register.registerIcon("mekanism:EliteFactoryTop");
|
||||||
icons[blockID][9][2] = register.registerIcon("mekanism:SteelCasing");
|
icons[blockID][9][0] = register.registerIcon("mekanism:PurificationChamberFrontOff");
|
||||||
icons[blockID][10][0] = register.registerIcon("mekanism:EnergizedSmelterFrontOff");
|
icons[blockID][9][1] = register.registerIcon("mekanism:PurificationChamberFrontOn");
|
||||||
icons[blockID][10][1] = register.registerIcon("mekanism:EnergizedSmelterFrontOn");
|
icons[blockID][9][2] = register.registerIcon("mekanism:SteelCasing");
|
||||||
icons[blockID][10][2] = register.registerIcon("mekanism:SteelCasing");
|
icons[blockID][10][0] = register.registerIcon("mekanism:EnergizedSmelterFrontOff");
|
||||||
icons[blockID][11][0] = register.registerIcon("mekanism:Teleporter");
|
icons[blockID][10][1] = register.registerIcon("mekanism:EnergizedSmelterFrontOn");
|
||||||
|
icons[blockID][10][2] = register.registerIcon("mekanism:SteelCasing");
|
||||||
|
icons[blockID][11][0] = register.registerIcon("mekanism:Teleporter");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -398,111 +401,114 @@ public class BlockMachine extends BlockContainer implements ISpecialBounds
|
||||||
int metadata = world.getBlockMetadata(x, y, z);
|
int metadata = world.getBlockMetadata(x, y, z);
|
||||||
TileEntityBasicBlock tileEntity = (TileEntityBasicBlock)world.getBlockTileEntity(x, y, z);
|
TileEntityBasicBlock tileEntity = (TileEntityBasicBlock)world.getBlockTileEntity(x, y, z);
|
||||||
|
|
||||||
if(metadata == 0)
|
if(blockID == Mekanism.machineBlockID)
|
||||||
{
|
{
|
||||||
if(side == tileEntity.facing)
|
if(metadata == 0)
|
||||||
{
|
{
|
||||||
return MekanismUtils.isActive(world, x, y, z) ? icons[blockID][0][1] : icons[blockID][0][0];
|
if(side == tileEntity.facing)
|
||||||
}
|
{
|
||||||
else {
|
return MekanismUtils.isActive(world, x, y, z) ? icons[blockID][0][1] : icons[blockID][0][0];
|
||||||
return icons[blockID][0][2];
|
}
|
||||||
}
|
else {
|
||||||
}
|
return icons[blockID][0][2];
|
||||||
else if(metadata == 1)
|
}
|
||||||
{
|
}
|
||||||
if(side == tileEntity.facing)
|
else if(metadata == 1)
|
||||||
{
|
{
|
||||||
return MekanismUtils.isActive(world, x, y, z) ? icons[blockID][1][1] : icons[blockID][1][0];
|
if(side == tileEntity.facing)
|
||||||
}
|
{
|
||||||
else {
|
return MekanismUtils.isActive(world, x, y, z) ? icons[blockID][1][1] : icons[blockID][1][0];
|
||||||
return icons[blockID][1][2];
|
}
|
||||||
}
|
else {
|
||||||
}
|
return icons[blockID][1][2];
|
||||||
else if(metadata == 2)
|
}
|
||||||
{
|
}
|
||||||
if(side == tileEntity.facing)
|
else if(metadata == 2)
|
||||||
{
|
{
|
||||||
return MekanismUtils.isActive(world, x, y, z) ? icons[blockID][2][1] : icons[blockID][2][0];
|
if(side == tileEntity.facing)
|
||||||
}
|
{
|
||||||
else {
|
return MekanismUtils.isActive(world, x, y, z) ? icons[blockID][2][1] : icons[blockID][2][0];
|
||||||
return icons[blockID][2][2];
|
}
|
||||||
}
|
else {
|
||||||
}
|
return icons[blockID][2][2];
|
||||||
else if(metadata == 3)
|
}
|
||||||
{
|
}
|
||||||
if(side == tileEntity.facing)
|
else if(metadata == 3)
|
||||||
{
|
{
|
||||||
return MekanismUtils.isActive(world, x, y, z) ? icons[blockID][3][1] : icons[blockID][3][0];
|
if(side == tileEntity.facing)
|
||||||
}
|
{
|
||||||
else {
|
return MekanismUtils.isActive(world, x, y, z) ? icons[blockID][3][1] : icons[blockID][3][0];
|
||||||
return icons[blockID][3][2];
|
}
|
||||||
}
|
else {
|
||||||
}
|
return icons[blockID][3][2];
|
||||||
else if(metadata == 5)
|
}
|
||||||
{
|
}
|
||||||
if(side == tileEntity.facing)
|
else if(metadata == 5)
|
||||||
{
|
{
|
||||||
return icons[blockID][5][0];
|
if(side == tileEntity.facing)
|
||||||
}
|
{
|
||||||
else if(side == 0 || side == 1)
|
return icons[blockID][5][0];
|
||||||
{
|
}
|
||||||
return icons[blockID][5][2];
|
else if(side == 0 || side == 1)
|
||||||
}
|
{
|
||||||
else {
|
return icons[blockID][5][2];
|
||||||
return icons[blockID][5][1];
|
}
|
||||||
}
|
else {
|
||||||
}
|
return icons[blockID][5][1];
|
||||||
else if(metadata == 6)
|
}
|
||||||
{
|
}
|
||||||
if(side == tileEntity.facing)
|
else if(metadata == 6)
|
||||||
{
|
{
|
||||||
return icons[blockID][6][0];
|
if(side == tileEntity.facing)
|
||||||
}
|
{
|
||||||
else if(side == 0 || side == 1)
|
return icons[blockID][6][0];
|
||||||
{
|
}
|
||||||
return icons[blockID][6][2];
|
else if(side == 0 || side == 1)
|
||||||
}
|
{
|
||||||
else {
|
return icons[blockID][6][2];
|
||||||
return icons[blockID][6][1];
|
}
|
||||||
}
|
else {
|
||||||
}
|
return icons[blockID][6][1];
|
||||||
else if(metadata == 7)
|
}
|
||||||
{
|
}
|
||||||
if(side == tileEntity.facing)
|
else if(metadata == 7)
|
||||||
{
|
{
|
||||||
return icons[blockID][7][0];
|
if(side == tileEntity.facing)
|
||||||
}
|
{
|
||||||
else if(side == 0 || side == 1)
|
return icons[blockID][7][0];
|
||||||
{
|
}
|
||||||
return icons[blockID][7][2];
|
else if(side == 0 || side == 1)
|
||||||
}
|
{
|
||||||
else {
|
return icons[blockID][7][2];
|
||||||
return icons[blockID][7][1];
|
}
|
||||||
}
|
else {
|
||||||
}
|
return icons[blockID][7][1];
|
||||||
else if(metadata == 9)
|
}
|
||||||
{
|
}
|
||||||
if(side == tileEntity.facing)
|
else if(metadata == 9)
|
||||||
{
|
{
|
||||||
return MekanismUtils.isActive(world, x, y, z) ? icons[blockID][9][1] : icons[blockID][9][0];
|
if(side == tileEntity.facing)
|
||||||
}
|
{
|
||||||
else {
|
return MekanismUtils.isActive(world, x, y, z) ? icons[blockID][9][1] : icons[blockID][9][0];
|
||||||
return icons[blockID][9][2];
|
}
|
||||||
}
|
else {
|
||||||
}
|
return icons[blockID][9][2];
|
||||||
else if(metadata == 10)
|
}
|
||||||
{
|
}
|
||||||
if(side == tileEntity.facing)
|
else if(metadata == 10)
|
||||||
{
|
{
|
||||||
return MekanismUtils.isActive(world, x, y, z) ? icons[blockID][10][1] : icons[blockID][10][0];
|
if(side == tileEntity.facing)
|
||||||
}
|
{
|
||||||
else {
|
return MekanismUtils.isActive(world, x, y, z) ? icons[blockID][10][1] : icons[blockID][10][0];
|
||||||
return icons[blockID][10][2];
|
}
|
||||||
}
|
else {
|
||||||
}
|
return icons[blockID][10][2];
|
||||||
else if(metadata == 11)
|
}
|
||||||
{
|
}
|
||||||
return icons[blockID][11][0];
|
else if(metadata == 11)
|
||||||
|
{
|
||||||
|
return icons[blockID][11][0];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
|
@ -518,30 +524,24 @@ public class BlockMachine extends BlockContainer implements ISpecialBounds
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public void getSubBlocks(int i, CreativeTabs creativetabs, List list)
|
public void getSubBlocks(int i, CreativeTabs creativetabs, List list)
|
||||||
{
|
{
|
||||||
list.add(new ItemStack(i, 1, 0));
|
for(MachineType type : MachineType.values())
|
||||||
list.add(new ItemStack(i, 1, 1));
|
|
||||||
list.add(new ItemStack(i, 1, 2));
|
|
||||||
list.add(new ItemStack(i, 1, 3));
|
|
||||||
list.add(new ItemStack(i, 1, 4));
|
|
||||||
|
|
||||||
for(FactoryTier tier : FactoryTier.values())
|
|
||||||
{
|
{
|
||||||
for(RecipeType type : RecipeType.values())
|
if(type.typeId == blockID)
|
||||||
{
|
{
|
||||||
ItemStack stack = new ItemStack(i, 1, 5+tier.ordinal());
|
if(type == MachineType.BASIC_FACTORY || type == MachineType.ADVANCED_FACTORY || type == MachineType.ELITE_FACTORY)
|
||||||
((IFactory)stack.getItem()).setRecipeType(type.ordinal(), stack);
|
{
|
||||||
list.add(stack);
|
for(RecipeType recipe : RecipeType.values())
|
||||||
|
{
|
||||||
|
ItemStack stack = new ItemStack(i, 1, type.meta);
|
||||||
|
((IFactory)stack.getItem()).setRecipeType(type.ordinal(), stack);
|
||||||
|
list.add(stack);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
list.add(new ItemStack(i, 1, type.meta));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
list.add(new ItemStack(i, 1, 8));
|
|
||||||
list.add(new ItemStack(i, 1, 9));
|
|
||||||
list.add(new ItemStack(i, 1, 10));
|
|
||||||
list.add(new ItemStack(i, 1, 11));
|
|
||||||
list.add(new ItemStack(i, 1, 12));
|
|
||||||
list.add(new ItemStack(i, 1, 13));
|
|
||||||
list.add(new ItemStack(i, 1, 14));
|
|
||||||
list.add(new ItemStack(i, 1, 15));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -1055,6 +1055,16 @@ public class BlockMachine extends BlockContainer implements ISpecialBounds
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ItemStack getStack()
|
||||||
|
{
|
||||||
|
return new ItemStack(typeId, 1, meta);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static MachineType get(ItemStack stack)
|
||||||
|
{
|
||||||
|
return get(stack.itemID, stack.getItemDamage());
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString()
|
public String toString()
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package mekanism.common.inventory.container;
|
package mekanism.common.inventory.container;
|
||||||
|
|
||||||
import mekanism.common.IElectricChest;
|
import mekanism.common.IElectricChest;
|
||||||
|
import mekanism.common.block.BlockMachine.MachineType;
|
||||||
import mekanism.common.inventory.slot.SlotElectricChest;
|
import mekanism.common.inventory.slot.SlotElectricChest;
|
||||||
import mekanism.common.inventory.slot.SlotEnergy.SlotDischarge;
|
import mekanism.common.inventory.slot.SlotEnergy.SlotDischarge;
|
||||||
import mekanism.common.tileentity.TileEntityElectricChest;
|
import mekanism.common.tileentity.TileEntityElectricChest;
|
||||||
|
@ -165,13 +166,14 @@ public class ContainerElectricChest extends Container
|
||||||
ItemStack itemStack = player.inventory.getStackInSlot(destSlot);
|
ItemStack itemStack = player.inventory.getStackInSlot(destSlot);
|
||||||
if(itemStack != null && itemStack.getItem() instanceof IElectricChest)
|
if(itemStack != null && itemStack.getItem() instanceof IElectricChest)
|
||||||
{
|
{
|
||||||
if(((IElectricChest)itemStack.getItem()).isElectricChest(itemStack))
|
if(MachineType.get(itemStack) == MachineType.ELECTRIC_CHEST)
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return super.slotClick(slotNumber, destSlot, modifier, player);
|
return super.slotClick(slotNumber, destSlot, modifier, player);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -259,12 +259,11 @@ public class ContainerFactory extends Container
|
||||||
{
|
{
|
||||||
if(itemStack != null && itemStack.getItem() instanceof ItemBlockMachine)
|
if(itemStack != null && itemStack.getItem() instanceof ItemBlockMachine)
|
||||||
{
|
{
|
||||||
if(itemStack.getItemDamage() == MachineType.ENERGIZED_SMELTER.meta ||
|
MachineType type = MachineType.get(itemStack);
|
||||||
itemStack.getItemDamage() == MachineType.ENRICHMENT_CHAMBER.meta ||
|
|
||||||
itemStack.getItemDamage() == MachineType.CRUSHER.meta ||
|
if(type == MachineType.ENERGIZED_SMELTER || type == MachineType.ENRICHMENT_CHAMBER ||
|
||||||
itemStack.getItemDamage() == MachineType.OSMIUM_COMPRESSOR.meta ||
|
type == MachineType.CRUSHER || type == MachineType.OSMIUM_COMPRESSOR ||
|
||||||
itemStack.getItemDamage() == MachineType.COMBINER.meta ||
|
type == MachineType.COMBINER || type == MachineType.PURIFICATION_CHAMBER)
|
||||||
itemStack.getItemDamage() == MachineType.PURIFICATION_CHAMBER.meta)
|
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package mekanism.common.inventory.slot;
|
package mekanism.common.inventory.slot;
|
||||||
|
|
||||||
import mekanism.common.IElectricChest;
|
import mekanism.common.IElectricChest;
|
||||||
|
import mekanism.common.block.BlockMachine.MachineType;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.inventory.IInventory;
|
import net.minecraft.inventory.IInventory;
|
||||||
import net.minecraft.inventory.Slot;
|
import net.minecraft.inventory.Slot;
|
||||||
|
@ -25,7 +26,7 @@ public class SlotElectricChest extends Slot
|
||||||
|
|
||||||
if(itemstack.getItem() instanceof IElectricChest)
|
if(itemstack.getItem() instanceof IElectricChest)
|
||||||
{
|
{
|
||||||
if(((IElectricChest)itemstack.getItem()).isElectricChest(itemstack))
|
if(MachineType.get(itemstack) == MachineType.ELECTRIC_CHEST)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,7 +23,7 @@ import cpw.mods.fml.relauncher.SideOnly;
|
||||||
* 0: Osmium Block
|
* 0: Osmium Block
|
||||||
* 1: Bronze Block
|
* 1: Bronze Block
|
||||||
* 2: Refined Obsidian
|
* 2: Refined Obsidian
|
||||||
* 3: Coal Block
|
* 3: Charcoal Block
|
||||||
* 4: Refined Glowstone
|
* 4: Refined Glowstone
|
||||||
* 5: Steel Block
|
* 5: Steel Block
|
||||||
* 6: Bin
|
* 6: Bin
|
||||||
|
@ -165,7 +165,7 @@ public class ItemBlockBasic extends ItemBlock
|
||||||
name = "RefinedObsidian";
|
name = "RefinedObsidian";
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
name = "CoalBlock";
|
name = "CharcoalBlock";
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
name = "RefinedGlowstone";
|
name = "RefinedGlowstone";
|
||||||
|
|
|
@ -112,23 +112,25 @@ public class ItemBlockMachine extends ItemBlock implements IEnergizedItem, IItem
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public void addInformation(ItemStack itemstack, EntityPlayer entityplayer, List list, boolean flag)
|
public void addInformation(ItemStack itemstack, EntityPlayer entityplayer, List list, boolean flag)
|
||||||
{
|
{
|
||||||
|
MachineType type = MachineType.get(itemstack);
|
||||||
|
|
||||||
if(!Keyboard.isKeyDown(Keyboard.KEY_LSHIFT))
|
if(!Keyboard.isKeyDown(Keyboard.KEY_LSHIFT))
|
||||||
{
|
{
|
||||||
list.add("Hold " + EnumColor.AQUA + "shift" + EnumColor.GREY + " for more details.");
|
list.add("Hold " + EnumColor.AQUA + "shift" + EnumColor.GREY + " for more details.");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if(isFactory(itemstack))
|
if(type == MachineType.BASIC_FACTORY || type == MachineType.ADVANCED_FACTORY || type == MachineType.ELITE_FACTORY)
|
||||||
{
|
{
|
||||||
list.add(EnumColor.INDIGO + "Recipe Type: " + EnumColor.GREY + RecipeType.values()[getRecipeType(itemstack)].getName());
|
list.add(EnumColor.INDIGO + "Recipe Type: " + EnumColor.GREY + RecipeType.values()[getRecipeType(itemstack)].getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
if(isElectricChest(itemstack))
|
if(type == MachineType.ELECTRIC_CHEST)
|
||||||
{
|
{
|
||||||
list.add(EnumColor.INDIGO + "Authenticated: " + EnumColor.GREY + getAuthenticated(itemstack));
|
list.add(EnumColor.INDIGO + "Authenticated: " + EnumColor.GREY + getAuthenticated(itemstack));
|
||||||
list.add(EnumColor.INDIGO + "Locked: " + EnumColor.GREY + getLocked(itemstack));
|
list.add(EnumColor.INDIGO + "Locked: " + EnumColor.GREY + getLocked(itemstack));
|
||||||
}
|
}
|
||||||
|
|
||||||
if(itemstack.getItemDamage() != MachineType.LOGISTICAL_SORTER.meta)
|
if(type != MachineType.LOGISTICAL_SORTER)
|
||||||
{
|
{
|
||||||
list.add(EnumColor.BRIGHT_GREEN + "Stored Energy: " + EnumColor.GREY + MekanismUtils.getEnergyDisplay(getEnergyStored(itemstack)));
|
list.add(EnumColor.BRIGHT_GREEN + "Stored Energy: " + EnumColor.GREY + MekanismUtils.getEnergyDisplay(getEnergyStored(itemstack)));
|
||||||
list.add(EnumColor.BRIGHT_GREEN + "Voltage: " + EnumColor.GREY + getVoltage(itemstack) + "v");
|
list.add(EnumColor.BRIGHT_GREEN + "Voltage: " + EnumColor.GREY + getVoltage(itemstack) + "v");
|
||||||
|
@ -148,7 +150,7 @@ public class ItemBlockMachine extends ItemBlock implements IEnergizedItem, IItem
|
||||||
list.add(EnumColor.PURPLE + "Speed: " + EnumColor.GREY + "x" + (getSpeedMultiplier(itemstack)+1));
|
list.add(EnumColor.PURPLE + "Speed: " + EnumColor.GREY + "x" + (getSpeedMultiplier(itemstack)+1));
|
||||||
}
|
}
|
||||||
|
|
||||||
if(itemstack.getItemDamage() != 14)
|
if(type != MachineType.CHARGEPAD && type != MachineType.LOGISTICAL_SORTER)
|
||||||
{
|
{
|
||||||
list.add(EnumColor.AQUA + "Inventory: " + EnumColor.GREY + (getInventory(itemstack) != null && getInventory(itemstack).tagCount() != 0));
|
list.add(EnumColor.AQUA + "Inventory: " + EnumColor.GREY + (getInventory(itemstack) != null && getInventory(itemstack).tagCount() != 0));
|
||||||
}
|
}
|
||||||
|
@ -166,7 +168,7 @@ public class ItemBlockMachine extends ItemBlock implements IEnergizedItem, IItem
|
||||||
{
|
{
|
||||||
boolean place = true;
|
boolean place = true;
|
||||||
|
|
||||||
if(stack.getItemDamage() == MachineType.DIGITAL_MINER.meta)
|
if(MachineType.get(stack) == MachineType.DIGITAL_MINER)
|
||||||
{
|
{
|
||||||
for(int xPos = x-1; xPos <= x+1; xPos++)
|
for(int xPos = x-1; xPos <= x+1; xPos++)
|
||||||
{
|
{
|
||||||
|
@ -344,7 +346,7 @@ public class ItemBlockMachine extends ItemBlock implements IEnergizedItem, IItem
|
||||||
@Override
|
@Override
|
||||||
public void onUpdate(ItemStack itemstack, World world, Entity entity, int i, boolean flag)
|
public void onUpdate(ItemStack itemstack, World world, Entity entity, int i, boolean flag)
|
||||||
{
|
{
|
||||||
if(isElectricChest(itemstack))
|
if(MachineType.get(itemstack) == MachineType.ELECTRIC_CHEST)
|
||||||
{
|
{
|
||||||
if(world != null && !world.isRemote)
|
if(world != null && !world.isRemote)
|
||||||
{
|
{
|
||||||
|
@ -493,7 +495,7 @@ public class ItemBlockMachine extends ItemBlock implements IEnergizedItem, IItem
|
||||||
{
|
{
|
||||||
if(!world.isRemote)
|
if(!world.isRemote)
|
||||||
{
|
{
|
||||||
if(isElectricChest(itemstack))
|
if(MachineType.get(itemstack) == MachineType.ELECTRIC_CHEST)
|
||||||
{
|
{
|
||||||
if(!getAuthenticated(itemstack))
|
if(!getAuthenticated(itemstack))
|
||||||
{
|
{
|
||||||
|
@ -535,12 +537,6 @@ public class ItemBlockMachine extends ItemBlock implements IEnergizedItem, IItem
|
||||||
itemStack.stackTagCompound.setInteger("recipeType", type);
|
itemStack.stackTagCompound.setInteger("recipeType", type);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean isFactory(ItemStack itemStack)
|
|
||||||
{
|
|
||||||
return itemStack.getItem() instanceof ItemBlockMachine && itemStack.getItemDamage() >= 5 && itemStack.getItemDamage() <= 7;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setInventory(NBTTagList nbtTags, Object... data)
|
public void setInventory(NBTTagList nbtTags, Object... data)
|
||||||
{
|
{
|
||||||
|
@ -620,7 +616,7 @@ public class ItemBlockMachine extends ItemBlock implements IEnergizedItem, IItem
|
||||||
@Override
|
@Override
|
||||||
public boolean hasTank(Object... data)
|
public boolean hasTank(Object... data)
|
||||||
{
|
{
|
||||||
return data[0] instanceof ItemStack && ((ItemStack)data[0]).getItem() instanceof ISustainedTank && ((ItemStack)data[0]).getItemDamage() == 12;
|
return data[0] instanceof ItemStack && ((ItemStack)data[0]).getItem() instanceof ISustainedTank && MachineType.get((ItemStack)data[0]) == MachineType.ELECTRIC_PUMP;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -645,12 +641,6 @@ public class ItemBlockMachine extends ItemBlock implements IEnergizedItem, IItem
|
||||||
return itemStack.stackTagCompound.getBoolean("authenticated");
|
return itemStack.stackTagCompound.getBoolean("authenticated");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean isElectricChest(ItemStack itemStack)
|
|
||||||
{
|
|
||||||
return itemStack.getItemDamage() == 13;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setPassword(ItemStack itemStack, String pass)
|
public void setPassword(ItemStack itemStack, String pass)
|
||||||
{
|
{
|
||||||
|
|
|
@ -6,6 +6,7 @@ import mekanism.api.Object3D;
|
||||||
import mekanism.api.energy.IEnergizedItem;
|
import mekanism.api.energy.IEnergizedItem;
|
||||||
import mekanism.common.IElectricChest;
|
import mekanism.common.IElectricChest;
|
||||||
import mekanism.common.Mekanism;
|
import mekanism.common.Mekanism;
|
||||||
|
import mekanism.common.block.BlockMachine.MachineType;
|
||||||
import mekanism.common.inventory.InventoryElectricChest;
|
import mekanism.common.inventory.InventoryElectricChest;
|
||||||
import mekanism.common.tileentity.TileEntityElectricChest;
|
import mekanism.common.tileentity.TileEntityElectricChest;
|
||||||
import mekanism.common.util.MekanismUtils;
|
import mekanism.common.util.MekanismUtils;
|
||||||
|
@ -121,7 +122,7 @@ public class PacketElectricChest implements IMekanismPacket
|
||||||
else {
|
else {
|
||||||
ItemStack stack = player.getCurrentEquippedItem();
|
ItemStack stack = player.getCurrentEquippedItem();
|
||||||
|
|
||||||
if(stack != null && stack.getItem() instanceof IElectricChest && ((IElectricChest)stack.getItem()).isElectricChest(stack))
|
if(stack != null && stack.getItem() instanceof IElectricChest && MachineType.get(stack) == MachineType.ELECTRIC_CHEST)
|
||||||
{
|
{
|
||||||
if(energy)
|
if(energy)
|
||||||
{
|
{
|
||||||
|
@ -180,7 +181,7 @@ public class PacketElectricChest implements IMekanismPacket
|
||||||
else {
|
else {
|
||||||
ItemStack stack = player.getCurrentEquippedItem();
|
ItemStack stack = player.getCurrentEquippedItem();
|
||||||
|
|
||||||
if(stack != null && stack.getItem() instanceof IElectricChest && ((IElectricChest)stack.getItem()).isElectricChest(stack))
|
if(stack != null && stack.getItem() instanceof IElectricChest && MachineType.get(stack) == MachineType.ELECTRIC_CHEST)
|
||||||
{
|
{
|
||||||
((IElectricChest)stack.getItem()).setPassword(stack, pass);
|
((IElectricChest)stack.getItem()).setPassword(stack, pass);
|
||||||
((IElectricChest)stack.getItem()).setAuthenticated(stack, true);
|
((IElectricChest)stack.getItem()).setAuthenticated(stack, true);
|
||||||
|
@ -209,7 +210,7 @@ public class PacketElectricChest implements IMekanismPacket
|
||||||
else {
|
else {
|
||||||
ItemStack stack = player.getCurrentEquippedItem();
|
ItemStack stack = player.getCurrentEquippedItem();
|
||||||
|
|
||||||
if(stack != null && stack.getItem() instanceof IElectricChest && ((IElectricChest)stack.getItem()).isElectricChest(stack))
|
if(stack != null && stack.getItem() instanceof IElectricChest && MachineType.get(stack) == MachineType.ELECTRIC_CHEST)
|
||||||
{
|
{
|
||||||
((IElectricChest)stack.getItem()).setLocked(stack, lock);
|
((IElectricChest)stack.getItem()).setLocked(stack, lock);
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,6 +12,7 @@ import mekanism.api.gas.GasRegistry;
|
||||||
import mekanism.api.gas.GasStack;
|
import mekanism.api.gas.GasStack;
|
||||||
import mekanism.api.gas.GasUtils;
|
import mekanism.api.gas.GasUtils;
|
||||||
import mekanism.api.gas.IGasAcceptor;
|
import mekanism.api.gas.IGasAcceptor;
|
||||||
|
import mekanism.api.gas.IGasItem;
|
||||||
import mekanism.api.gas.IGasStorage;
|
import mekanism.api.gas.IGasStorage;
|
||||||
import mekanism.api.gas.ITubeConnection;
|
import mekanism.api.gas.ITubeConnection;
|
||||||
import mekanism.client.sound.IHasSound;
|
import mekanism.client.sound.IHasSound;
|
||||||
|
@ -31,7 +32,6 @@ import mekanism.common.util.ChargeUtils;
|
||||||
import mekanism.common.util.MekanismUtils;
|
import mekanism.common.util.MekanismUtils;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
|
||||||
import net.minecraftforge.common.ForgeDirection;
|
import net.minecraftforge.common.ForgeDirection;
|
||||||
|
|
||||||
import com.google.common.io.ByteArrayDataInput;
|
import com.google.common.io.ByteArrayDataInput;
|
||||||
|
@ -258,10 +258,13 @@ public class TileEntityFactory extends TileEntityElectricBlock implements IPerip
|
||||||
{
|
{
|
||||||
if(recipeType == RecipeType.PURIFYING.ordinal())
|
if(recipeType == RecipeType.PURIFYING.ordinal())
|
||||||
{
|
{
|
||||||
GasStack removed = GasUtils.removeGas(inventory[4], GasRegistry.getGas("oxygen"), getMaxSecondaryEnergy()-secondaryEnergyStored);
|
if(inventory[4].getItem() instanceof IGasItem)
|
||||||
setSecondaryEnergy(secondaryEnergyStored + (removed != null ? removed.amount : 0));
|
{
|
||||||
|
GasStack removed = GasUtils.removeGas(inventory[4], GasRegistry.getGas("oxygen"), getMaxSecondaryEnergy()-secondaryEnergyStored);
|
||||||
|
setSecondaryEnergy(secondaryEnergyStored + (removed != null ? removed.amount : 0));
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int fuelTicks = RecipeType.values()[recipeType].getFuelTicks(inventory[4]);
|
int fuelTicks = RecipeType.values()[recipeType].getFuelTicks(inventory[4]);
|
||||||
|
|
|
@ -0,0 +1,6 @@
|
||||||
|
package mekanism.common.tileentity;
|
||||||
|
|
||||||
|
public class TileEntityRotaryCondensentrator extends TileEntityElectricBlock
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
|
@ -55,7 +55,7 @@ public class MekanismGenerators implements IModule
|
||||||
public static Block Generator;
|
public static Block Generator;
|
||||||
|
|
||||||
//Block IDs
|
//Block IDs
|
||||||
public static int generatorID = 3005;
|
public static int generatorID;
|
||||||
|
|
||||||
//Generation Configuration
|
//Generation Configuration
|
||||||
public static double advancedSolarGeneration;
|
public static double advancedSolarGeneration;
|
||||||
|
|
|
@ -2,6 +2,7 @@ package mekanism.induction.common;
|
||||||
|
|
||||||
import mekanism.common.IModule;
|
import mekanism.common.IModule;
|
||||||
import mekanism.common.Mekanism;
|
import mekanism.common.Mekanism;
|
||||||
|
import mekanism.common.MekanismRecipe;
|
||||||
import mekanism.common.Tier.EnergyCubeTier;
|
import mekanism.common.Tier.EnergyCubeTier;
|
||||||
import mekanism.common.Version;
|
import mekanism.common.Version;
|
||||||
import mekanism.common.util.MekanismUtils;
|
import mekanism.common.util.MekanismUtils;
|
||||||
|
@ -129,23 +130,20 @@ public class MekanismInduction implements IModule
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void postInit(FMLPostInitializationEvent evt)
|
public void postInit(FMLPostInitializationEvent evt)
|
||||||
{
|
{
|
||||||
/** Capacitor **/
|
|
||||||
GameRegistry.addRecipe(new ShapedOreRecipe(Mekanism.EnergyTablet, "RRR", "RIR", "RRR", 'R', Item.redstone, 'I', UniversalRecipes.PRIMARY_METAL));
|
|
||||||
|
|
||||||
/** Linker **/
|
/** Linker **/
|
||||||
GameRegistry.addRecipe(new ShapedOreRecipe(Linker, " E ", "GCG", " E ", 'E', Item.eyeOfEnder, 'C', Mekanism.EnergyTablet, 'G', UniversalRecipes.SECONDARY_METAL));
|
GameRegistry.addRecipe(new MekanismRecipe(new ItemStack(Linker), new Object[] {" E ", "GCG", " E ", 'E', Item.eyeOfEnder, 'C', Mekanism.EnergyTablet.getUnchargedItem(), 'G', UniversalRecipes.SECONDARY_METAL}));
|
||||||
|
|
||||||
/** Tesla - by Jyzarc */
|
/** Tesla - by Jyzarc */
|
||||||
GameRegistry.addRecipe(new ShapedOreRecipe(Tesla, "WEW", " C ", " I ", 'W', Mekanism.EnrichedAlloy, 'E', Item.eyeOfEnder, 'C', Mekanism.EnergyTablet, 'I', new ItemStack(Mekanism.BasicBlock, 1, 8)));
|
GameRegistry.addRecipe(new MekanismRecipe(new ItemStack(Tesla), new Object[] {"WEW", " C ", " I ", 'W', Mekanism.EnrichedAlloy, 'E', Item.eyeOfEnder, 'C', Mekanism.EnergyTablet.getUnchargedItem(), 'I', new ItemStack(Mekanism.BasicBlock, 1, 8)}));
|
||||||
|
|
||||||
/** Multimeter */
|
/** Multimeter */
|
||||||
GameRegistry.addRecipe(new ShapedOreRecipe(Multimeter, "WWW", "ICI", 'W', Mekanism.EnrichedAlloy, 'C', Mekanism.EnergyTablet, 'I', UniversalRecipes.PRIMARY_METAL));
|
GameRegistry.addRecipe(new MekanismRecipe(new ItemStack(Multimeter), new Object[] {"WWW", "ICI", 'W', Mekanism.EnrichedAlloy, 'C', Mekanism.EnergyTablet.getUnchargedItem(), 'I', UniversalRecipes.PRIMARY_METAL}));
|
||||||
|
|
||||||
/** Battery */
|
/** Battery */
|
||||||
GameRegistry.addRecipe(new ShapedOreRecipe(Battery, "III", "IRI", "III", 'R', Block.blockRedstone, 'I', MekanismUtils.getEnergyCube(EnergyCubeTier.BASIC)));
|
GameRegistry.addRecipe(new MekanismRecipe(new ItemStack(Battery), new Object[] {"III", "IRI", "III", 'R', Block.blockRedstone, 'I', MekanismUtils.getEnergyCube(EnergyCubeTier.BASIC)}));
|
||||||
|
|
||||||
/** EM Contractor */
|
/** EM Contractor */
|
||||||
GameRegistry.addRecipe(new ShapedOreRecipe(ElectromagneticContractor, " I ", "GCG", "WWW", 'W', UniversalRecipes.PRIMARY_METAL, 'C', Mekanism.EnergyTablet, 'G', UniversalRecipes.SECONDARY_METAL, 'I', UniversalRecipes.PRIMARY_METAL));
|
GameRegistry.addRecipe(new MekanismRecipe(new ItemStack(ElectromagneticContractor), new Object[] {" I ", "GCG", "WWW", 'W', UniversalRecipes.PRIMARY_METAL, 'C', Mekanism.EnergyTablet.getUnchargedItem(), 'G', UniversalRecipes.SECONDARY_METAL, 'I', UniversalRecipes.PRIMARY_METAL}));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -29,7 +29,7 @@ item.WalkieTalkie.name=Walkie-Talkie
|
||||||
tile.BasicBlock.OsmiumBlock.name=Osmium Block
|
tile.BasicBlock.OsmiumBlock.name=Osmium Block
|
||||||
tile.BasicBlock.BronzeBlock.name=Bronze Block
|
tile.BasicBlock.BronzeBlock.name=Bronze Block
|
||||||
tile.BasicBlock.RefinedObsidian.name=Refined Obsidian
|
tile.BasicBlock.RefinedObsidian.name=Refined Obsidian
|
||||||
tile.BasicBlock.CoalBlock.name=Coal Block
|
tile.BasicBlock.CharcoalBlock.name=Charcoal Block
|
||||||
tile.BasicBlock.RefinedGlowstone.name=Refined Glowstone
|
tile.BasicBlock.RefinedGlowstone.name=Refined Glowstone
|
||||||
tile.BasicBlock.SteelBlock.name=Steel Block
|
tile.BasicBlock.SteelBlock.name=Steel Block
|
||||||
tile.BasicBlock.Bin.name=Bin
|
tile.BasicBlock.Bin.name=Bin
|
||||||
|
|
Loading…
Reference in a new issue