mirror of
https://github.com/Thorfusion/Mekanism-Community-Edition.git
synced 2026-11-28 07:36:01 +00:00
State & Render stuffs, get the MInfuser rendering again.
Still no textures. WIP.
This commit is contained in:
1 parent
5e54c0a681
commit
dd99f582af
56 files changed
+1589
-570
No files matched your search
@@ -95,21 +95,18 @@ import mekanism.client.render.tileentity.RenderSolarNeutronActivator;
|
||||
import mekanism.client.render.tileentity.RenderTeleporter;
|
||||
import mekanism.common.CommonProxy;
|
||||
import mekanism.common.Mekanism;
|
||||
import mekanism.common.MekanismBlocks;
|
||||
import mekanism.common.MekanismItems;
|
||||
import mekanism.common.base.IElectricChest;
|
||||
import mekanism.common.base.ISideConfiguration;
|
||||
import mekanism.common.base.IUpgradeTile;
|
||||
import mekanism.common.block.BlockMachine.MachineType;
|
||||
import mekanism.common.block.states.BlockStateMachine;
|
||||
import mekanism.common.entity.EntityBabySkeleton;
|
||||
import mekanism.common.entity.EntityBalloon;
|
||||
import mekanism.common.entity.EntityFlame;
|
||||
import mekanism.common.entity.EntityObsidianTNT;
|
||||
import mekanism.common.entity.EntityRobit;
|
||||
import mekanism.common.inventory.InventoryElectricChest;
|
||||
import mekanism.common.item.ItemPortableTeleporter;
|
||||
import mekanism.common.item.ItemSeismicReader;
|
||||
import mekanism.common.multiblock.MultiblockManager;
|
||||
import mekanism.common.network.PacketPortableTeleporter.PortableTeleporterMessage;
|
||||
import mekanism.common.tile.TileEntityAdvancedElectricMachine;
|
||||
import mekanism.common.tile.TileEntityAdvancedFactory;
|
||||
import mekanism.common.tile.TileEntityAmbientAccumulator;
|
||||
import mekanism.common.tile.TileEntityBin;
|
||||
@@ -126,14 +123,12 @@ import mekanism.common.tile.TileEntityDigitalMiner;
|
||||
import mekanism.common.tile.TileEntityDynamicTank;
|
||||
import mekanism.common.tile.TileEntityDynamicValve;
|
||||
import mekanism.common.tile.TileEntityElectricChest;
|
||||
import mekanism.common.tile.TileEntityElectricMachine;
|
||||
import mekanism.common.tile.TileEntityElectricPump;
|
||||
import mekanism.common.tile.TileEntityElectrolyticSeparator;
|
||||
import mekanism.common.tile.TileEntityEliteFactory;
|
||||
import mekanism.common.tile.TileEntityEnergizedSmelter;
|
||||
import mekanism.common.tile.TileEntityEnergyCube;
|
||||
import mekanism.common.tile.TileEntityEnrichmentChamber;
|
||||
import mekanism.common.tile.TileEntityEntangledBlock;
|
||||
import mekanism.common.tile.TileEntityFactory;
|
||||
import mekanism.common.tile.TileEntityFluidicPlenisher;
|
||||
import mekanism.common.tile.TileEntityGasTank;
|
||||
@@ -160,13 +155,16 @@ import mekanism.common.tile.TileEntitySolarEvaporationController;
|
||||
import mekanism.common.tile.TileEntitySolarNeutronActivator;
|
||||
import mekanism.common.tile.TileEntityStructuralGlass;
|
||||
import mekanism.common.tile.TileEntityTeleporter;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.client.renderer.entity.Render;
|
||||
import net.minecraft.client.renderer.entity.RenderManager;
|
||||
import net.minecraft.client.renderer.entity.RenderSkeleton;
|
||||
import net.minecraft.client.resources.model.ModelResourceLocation;
|
||||
import net.minecraft.entity.monster.EntitySkeleton;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.BlockPos;
|
||||
@@ -236,7 +234,7 @@ public class ClientProxy extends CommonProxy
|
||||
else {
|
||||
ItemStack stack = entityplayer.getCurrentEquippedItem();
|
||||
|
||||
if(stack != null && stack.getItem() instanceof IElectricChest && MachineType.get(stack) == MachineType.ELECTRIC_CHEST)
|
||||
if(stack != null && stack.getItem() instanceof IElectricChest && BlockStateMachine.MachineType.get(stack) == BlockStateMachine.MachineType.ELECTRIC_CHEST)
|
||||
{
|
||||
InventoryElectricChest inventory = new InventoryElectricChest(entityplayer);
|
||||
//TODO FMLClientHandler.instance().displayGuiScreen(entityplayer, new GuiElectricChest(entityplayer.inventory, inventory));
|
||||
@@ -253,7 +251,7 @@ public class ClientProxy extends CommonProxy
|
||||
else {
|
||||
ItemStack stack = entityplayer.getCurrentEquippedItem();
|
||||
|
||||
if(stack != null && stack.getItem() instanceof IElectricChest && MachineType.get(stack) == MachineType.ELECTRIC_CHEST)
|
||||
if(stack != null && stack.getItem() instanceof IElectricChest && BlockStateMachine.MachineType.get(stack) == BlockStateMachine.MachineType.ELECTRIC_CHEST)
|
||||
{
|
||||
//TODO FMLClientHandler.instance().displayGuiScreen(entityplayer, new GuiPasswordEnter(stack));
|
||||
}
|
||||
@@ -268,7 +266,7 @@ public class ClientProxy extends CommonProxy
|
||||
else {
|
||||
ItemStack stack = entityplayer.getCurrentEquippedItem();
|
||||
|
||||
if(stack != null && stack.getItem() instanceof IElectricChest && MachineType.get(stack) == MachineType.ELECTRIC_CHEST)
|
||||
if(stack != null && stack.getItem() instanceof IElectricChest && BlockStateMachine.MachineType.get(stack) == BlockStateMachine.MachineType.ELECTRIC_CHEST)
|
||||
{
|
||||
//TODO FMLClientHandler.instance().displayGuiScreen(entityplayer, new GuiPasswordModify(stack));
|
||||
}
|
||||
@@ -402,10 +400,70 @@ public class ClientProxy extends CommonProxy
|
||||
RenderingRegistry.registerBlockHandler(new PlasticRenderingHandler());
|
||||
RenderingRegistry.registerBlockHandler(new CTMRenderingHandler());
|
||||
*/
|
||||
// registerItemRender(MekanismItems.PartTransmitter);
|
||||
registerItemRender(MekanismItems.ElectricBow);
|
||||
registerItemRender(MekanismItems.Dust);
|
||||
registerItemRender(MekanismItems.Ingot);
|
||||
registerItemRender(MekanismItems.EnergyTablet);
|
||||
registerItemRender(MekanismItems.SpeedUpgrade);
|
||||
registerItemRender(MekanismItems.EnergyUpgrade);
|
||||
registerItemRender(MekanismItems.FilterUpgrade);
|
||||
registerItemRender(MekanismItems.GasUpgrade);
|
||||
registerItemRender(MekanismItems.Robit);
|
||||
registerItemRender(MekanismItems.AtomicDisassembler);
|
||||
registerItemRender(MekanismItems.EnrichedAlloy);
|
||||
registerItemRender(MekanismItems.ReinforcedAlloy);
|
||||
registerItemRender(MekanismItems.AtomicAlloy);
|
||||
registerItemRender(MekanismItems.ItemProxy);
|
||||
registerItemRender(MekanismItems.ControlCircuit);
|
||||
registerItemRender(MekanismItems.EnrichedIron);
|
||||
registerItemRender(MekanismItems.CompressedCarbon);
|
||||
registerItemRender(MekanismItems.CompressedRedstone);
|
||||
registerItemRender(MekanismItems.CompressedDiamond);
|
||||
registerItemRender(MekanismItems.CompressedObsidian);
|
||||
registerItemRender(MekanismItems.PortableTeleporter);
|
||||
registerItemRender(MekanismItems.TeleportationCore);
|
||||
registerItemRender(MekanismItems.Clump);
|
||||
registerItemRender(MekanismItems.DirtyDust);
|
||||
registerItemRender(MekanismItems.Configurator);
|
||||
registerItemRender(MekanismItems.NetworkReader);
|
||||
registerItemRender(MekanismItems.WalkieTalkie);
|
||||
registerItemRender(MekanismItems.Jetpack);
|
||||
registerItemRender(MekanismItems.Dictionary);
|
||||
registerItemRender(MekanismItems.GasMask);
|
||||
registerItemRender(MekanismItems.ScubaTank);
|
||||
registerItemRender(MekanismItems.Balloon);
|
||||
registerItemRender(MekanismItems.Shard);
|
||||
registerItemRender(MekanismItems.ElectrolyticCore);
|
||||
registerItemRender(MekanismItems.Sawdust);
|
||||
registerItemRender(MekanismItems.Salt);
|
||||
registerItemRender(MekanismItems.BrineBucket);
|
||||
registerItemRender(MekanismItems.LithiumBucket);
|
||||
registerItemRender(MekanismItems.HeavyWaterBucket);
|
||||
registerItemRender(MekanismItems.Crystal);
|
||||
registerItemRender(MekanismItems.FreeRunners);
|
||||
registerItemRender(MekanismItems.ArmoredJetpack);
|
||||
registerItemRender(MekanismItems.FilterCard);
|
||||
registerItemRender(MekanismItems.SeismicReader);
|
||||
registerItemRender(MekanismItems.Substrate);
|
||||
registerItemRender(MekanismItems.Polyethene);
|
||||
registerItemRender(MekanismItems.BioFuel);
|
||||
// registerItemRender(MekanismItems.GlowPanel);
|
||||
registerItemRender(MekanismItems.Flamethrower);
|
||||
registerItemRender(MekanismItems.GaugeDropper);
|
||||
registerItemRender(MekanismItems.FactoryInstaller);
|
||||
registerItemRender(MekanismItems.OtherDust);
|
||||
|
||||
MekanismBlocks.registerRender();
|
||||
|
||||
Mekanism.logger.info("Render registrations complete.");
|
||||
}
|
||||
|
||||
public void registerItemRender(Item item)
|
||||
{
|
||||
Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(item, 0, new ModelResourceLocation(item.getRegistryName(), "inventory"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public GuiScreen getClientGui(int ID, EntityPlayer player, World world, BlockPos pos)
|
||||
{
|
||||
|
||||
@@ -11,7 +11,7 @@ import mekanism.api.EnumColor;
|
||||
import mekanism.api.util.StackUtils;
|
||||
import mekanism.client.sound.SoundHandler;
|
||||
import mekanism.common.Mekanism;
|
||||
import mekanism.common.block.BlockMachine.MachineType;
|
||||
import mekanism.common.block.states.BlockStateMachine;
|
||||
import mekanism.common.item.*;
|
||||
import mekanism.common.item.ItemConfigurator.ConfiguratorMode;
|
||||
import mekanism.common.item.ItemJetpack.JetpackMode;
|
||||
@@ -91,7 +91,7 @@ public class MekanismKeyHandler extends MekKeyHandler
|
||||
{
|
||||
ItemBlockMachine machine = (ItemBlockMachine)item;
|
||||
|
||||
if(MachineType.get(toolStack) == MachineType.PORTABLE_TANK)
|
||||
if(BlockStateMachine.MachineType.get(toolStack) == BlockStateMachine.MachineType.PORTABLE_TANK)
|
||||
{
|
||||
machine.setBucketMode(toolStack, !machine.getBucketMode(toolStack));
|
||||
Mekanism.packetHandler.sendToServer(new PortableTankStateMessage(machine.getBucketMode(toolStack)));
|
||||
|
||||
@@ -21,12 +21,15 @@ public class RenderMetallurgicInfuser extends TileEntitySpecialRenderer<TileEnti
|
||||
@Override
|
||||
public void renderTileEntityAt(TileEntityMetallurgicInfuser tileEntity, double x, double y, double z, float partialTick, int destroyStage)
|
||||
{
|
||||
/*
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef((float)x + 0.5F, (float)y + 1.5F, (float)z + 0.5F);
|
||||
|
||||
bindTexture(MekanismUtils.getResource(ResourceType.RENDER, "MetallurgicInfuser.png"));
|
||||
|
||||
switch(tileEntity.facing.ordinal()) /*TODO: switch the enum*/
|
||||
switch(tileEntity.facing.ordinal())
|
||||
TODO: switch the enum
|
||||
|
||||
{
|
||||
case 2: GL11.glRotatef(0, 0.0F, 1.0F, 0.0F); break;
|
||||
case 3: GL11.glRotatef(180, 0.0F, 1.0F, 0.0F); break;
|
||||
@@ -39,5 +42,6 @@ public class RenderMetallurgicInfuser extends TileEntitySpecialRenderer<TileEnti
|
||||
GL11.glPopMatrix();
|
||||
|
||||
MekanismRenderer.machineRenderer.renderTileEntityAt(tileEntity, x, y, z, partialTick, destroyStage);
|
||||
*/
|
||||
}
|
||||
}
|
||||
@@ -14,7 +14,8 @@ import mekanism.api.util.UnitDisplayUtils.TempType;
|
||||
import mekanism.client.SparkleAnimation.INodeChecker;
|
||||
import mekanism.common.base.IGuiProvider;
|
||||
import mekanism.common.base.IUpgradeTile;
|
||||
import mekanism.common.block.BlockMachine.MachineType;
|
||||
import mekanism.common.block.states.BlockStateMachine.MachineType;
|
||||
import mekanism.common.block.states.BlockStateMachine;
|
||||
import mekanism.common.entity.EntityRobit;
|
||||
import mekanism.common.inventory.container.ContainerAdvancedElectricMachine;
|
||||
import mekanism.common.inventory.container.ContainerChanceMachine;
|
||||
@@ -121,7 +122,6 @@ import net.minecraft.world.World;
|
||||
import net.minecraft.world.WorldServer;
|
||||
import net.minecraftforge.common.config.Configuration;
|
||||
import net.minecraftforge.common.util.FakePlayerFactory;
|
||||
import net.minecraftforge.fml.client.registry.RenderingRegistry;
|
||||
import net.minecraftforge.fml.common.FMLCommonHandler;
|
||||
import net.minecraftforge.fml.common.network.simpleimpl.MessageContext;
|
||||
import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||
@@ -325,9 +325,9 @@ public class CommonProxy implements IGuiProvider
|
||||
general.enableAmbientLighting = Mekanism.configuration.get("general", "EnableAmbientLighting", true).getBoolean();
|
||||
general.ambientLightingLevel = Mekanism.configuration.get("general", "AmbientLightingLevel", 15).getInt();
|
||||
|
||||
for(MachineType type : MachineType.getValidMachines())
|
||||
for(MachineType type : BlockStateMachine.MachineType.getValidMachines())
|
||||
{
|
||||
machines.setEntry(type.name, Mekanism.configuration.get("machines", type.name + "Enabled", true).getBoolean());
|
||||
machines.setEntry(type.machineName, Mekanism.configuration.get("machines", type.machineName + "Enabled", true).getBoolean());
|
||||
}
|
||||
|
||||
usage.enrichmentChamberUsage = Mekanism.configuration.get("usage", "EnrichmentChamberUsage", 50D).getDouble();
|
||||
@@ -553,9 +553,9 @@ public class CommonProxy implements IGuiProvider
|
||||
|
||||
public void updateConfigRecipes()
|
||||
{
|
||||
for(MachineType type : MachineType.getValidMachines())
|
||||
for(MachineType type : BlockStateMachine.MachineType.getValidMachines())
|
||||
{
|
||||
if(machines.isEnabled(type.name))
|
||||
if(machines.isEnabled(type.machineName))
|
||||
{
|
||||
CraftingManager.getInstance().getRecipeList().removeAll(type.getRecipes());
|
||||
CraftingManager.getInstance().getRecipeList().addAll(type.getRecipes());
|
||||
@@ -576,7 +576,7 @@ public class CommonProxy implements IGuiProvider
|
||||
MekanismAPI.addBoxBlacklist(Blocks.mob_spawner, 0);
|
||||
}
|
||||
|
||||
MachineType.updateAllUsages();
|
||||
BlockStateMachine.MachineType.updateAllUsages();
|
||||
|
||||
updateConfigRecipes();
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ import mekanism.common.Tier.InductionProviderTier;
|
||||
import mekanism.common.base.IChunkLoadHandler;
|
||||
import mekanism.common.base.IFactory.RecipeType;
|
||||
import mekanism.common.base.IModule;
|
||||
import mekanism.common.block.BlockMachine.MachineType;
|
||||
import mekanism.common.block.states.BlockStateMachine;
|
||||
import mekanism.common.chunkloading.ChunkManager;
|
||||
import mekanism.common.content.boiler.BoilerManager;
|
||||
import mekanism.common.content.boiler.SynchronizedBoilerData;
|
||||
@@ -282,16 +282,16 @@ public class Mekanism
|
||||
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(MekanismItems.EnergyTablet.getUnchargedItem(),
|
||||
"RCR", "ECE", "RCR", Character.valueOf('C'), "ingotGold", Character.valueOf('R'), "dustRedstone", Character.valueOf('E'), MekanismItems.EnrichedAlloy
|
||||
));
|
||||
MachineType.ENRICHMENT_CHAMBER.addRecipe(new ShapedMekanismRecipe(new ItemStack(MekanismBlocks.MachineBlock, 1, 0),
|
||||
BlockStateMachine.MachineType.ENRICHMENT_CHAMBER.addRecipe(new ShapedMekanismRecipe(new ItemStack(MekanismBlocks.MachineBlock, 1, 0),
|
||||
"RCR", "iIi", "RCR", Character.valueOf('i'), "ingotIron", Character.valueOf('C'), MekanismUtils.getControlCircuit(BaseTier.BASIC), Character.valueOf('R'), "alloyBasic", Character.valueOf('I'), new ItemStack(MekanismBlocks.BasicBlock, 1, 8)
|
||||
));
|
||||
MachineType.OSMIUM_COMPRESSOR.addRecipe(new ShapedMekanismRecipe(new ItemStack(MekanismBlocks.MachineBlock, 1, 1),
|
||||
BlockStateMachine.MachineType.OSMIUM_COMPRESSOR.addRecipe(new ShapedMekanismRecipe(new ItemStack(MekanismBlocks.MachineBlock, 1, 1),
|
||||
"ECE", "BIB", "ECE", Character.valueOf('E'), "alloyAdvanced", Character.valueOf('C'), MekanismUtils.getControlCircuit(BaseTier.ADVANCED), Character.valueOf('B'), Items.bucket, Character.valueOf('I'), new ItemStack(MekanismBlocks.BasicBlock, 1, 8)
|
||||
));
|
||||
MachineType.COMBINER.addRecipe(new ShapedMekanismRecipe(new ItemStack(MekanismBlocks.MachineBlock, 1, 2),
|
||||
BlockStateMachine.MachineType.COMBINER.addRecipe(new ShapedMekanismRecipe(new ItemStack(MekanismBlocks.MachineBlock, 1, 2),
|
||||
"RCR", "SIS", "RCR", Character.valueOf('S'), Blocks.cobblestone, Character.valueOf('C'), MekanismUtils.getControlCircuit(BaseTier.ELITE), Character.valueOf('R'), "alloyElite", Character.valueOf('I'), new ItemStack(MekanismBlocks.BasicBlock, 1, 8)
|
||||
));
|
||||
MachineType.CRUSHER.addRecipe(new ShapedMekanismRecipe(new ItemStack(MekanismBlocks.MachineBlock, 1, 3),
|
||||
BlockStateMachine.MachineType.CRUSHER.addRecipe(new ShapedMekanismRecipe(new ItemStack(MekanismBlocks.MachineBlock, 1, 3),
|
||||
"RCR", "LIL", "RCR", Character.valueOf('R'), "dustRedstone", Character.valueOf('L'), Items.lava_bucket, Character.valueOf('C'), MekanismUtils.getControlCircuit(BaseTier.BASIC), Character.valueOf('I'), new ItemStack(MekanismBlocks.BasicBlock, 1, 8)
|
||||
));
|
||||
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(MekanismItems.SpeedUpgrade),
|
||||
@@ -312,7 +312,7 @@ public class Mekanism
|
||||
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(MekanismUtils.getEmptyGasTank(),
|
||||
"PPP", "PDP", "PPP", Character.valueOf('P'), "ingotOsmium", Character.valueOf('D'), "dustIron"
|
||||
));
|
||||
MachineType.METALLURGIC_INFUSER.addRecipe(new ShapedMekanismRecipe(new ItemStack(MekanismBlocks.MachineBlock, 1, 8),
|
||||
BlockStateMachine.MachineType.METALLURGIC_INFUSER.addRecipe(new ShapedMekanismRecipe(new ItemStack(MekanismBlocks.MachineBlock, 1, 8),
|
||||
"IFI", "ROR", "IFI", Character.valueOf('I'), "ingotIron", Character.valueOf('F'), Blocks.furnace, Character.valueOf('R'), "dustRedstone", Character.valueOf('O'), "ingotOsmium"
|
||||
));
|
||||
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(MekanismItems.TeleportationCore),
|
||||
@@ -321,10 +321,10 @@ public class Mekanism
|
||||
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(MekanismItems.PortableTeleporter.getUnchargedItem(),
|
||||
" E ", "CTC", " E ", Character.valueOf('E'), MekanismItems.EnergyTablet.getUnchargedItem(), Character.valueOf('C'), MekanismUtils.getControlCircuit(BaseTier.BASIC), Character.valueOf('T'), MekanismItems.TeleportationCore
|
||||
));
|
||||
MachineType.TELEPORTER.addRecipe(new ShapedMekanismRecipe(new ItemStack(MekanismBlocks.MachineBlock, 1, 11),
|
||||
BlockStateMachine.MachineType.TELEPORTER.addRecipe(new ShapedMekanismRecipe(new ItemStack(MekanismBlocks.MachineBlock, 1, 11),
|
||||
"COC", "OTO", "COC", Character.valueOf('C'), MekanismUtils.getControlCircuit(BaseTier.BASIC), Character.valueOf('O'), new ItemStack(MekanismBlocks.BasicBlock, 1, 8), Character.valueOf('T'), MekanismItems.TeleportationCore
|
||||
));
|
||||
MachineType.PURIFICATION_CHAMBER.addRecipe(new ShapedMekanismRecipe(new ItemStack(MekanismBlocks.MachineBlock, 1, 9),
|
||||
BlockStateMachine.MachineType.PURIFICATION_CHAMBER.addRecipe(new ShapedMekanismRecipe(new ItemStack(MekanismBlocks.MachineBlock, 1, 9),
|
||||
"ECE", "ORO", "ECE", Character.valueOf('C'), MekanismUtils.getControlCircuit(BaseTier.ADVANCED), Character.valueOf('E'), "alloyAdvanced", Character.valueOf('O'), "ingotOsmium", Character.valueOf('R'), new ItemStack(MekanismBlocks.MachineBlock, 1, 0)
|
||||
));
|
||||
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(MekanismItems.Configurator.getUnchargedItem(),
|
||||
@@ -336,13 +336,13 @@ public class Mekanism
|
||||
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(MekanismBlocks.BasicBlock, 1, 8),
|
||||
" S ", "SPS", " S ", Character.valueOf('S'), "ingotSteel", Character.valueOf('P'), "ingotOsmium"
|
||||
));
|
||||
MachineType.ENERGIZED_SMELTER.addRecipe(new ShapedMekanismRecipe(new ItemStack(MekanismBlocks.MachineBlock, 1, 10),
|
||||
BlockStateMachine.MachineType.ENERGIZED_SMELTER.addRecipe(new ShapedMekanismRecipe(new ItemStack(MekanismBlocks.MachineBlock, 1, 10),
|
||||
"RCR", "GIG", "RCR", Character.valueOf('C'), MekanismUtils.getControlCircuit(BaseTier.BASIC), Character.valueOf('R'), "alloyBasic", Character.valueOf('G'), "blockGlass", Character.valueOf('I'), new ItemStack(MekanismBlocks.BasicBlock, 1, 8)
|
||||
));
|
||||
MachineType.ELECTRIC_PUMP.addRecipe(new ShapedMekanismRecipe(new ItemStack(MekanismBlocks.MachineBlock, 1, 12),
|
||||
BlockStateMachine.MachineType.ELECTRIC_PUMP.addRecipe(new ShapedMekanismRecipe(new ItemStack(MekanismBlocks.MachineBlock, 1, 12),
|
||||
" B ", "ECE", "OOO", Character.valueOf('B'), Items.bucket, Character.valueOf('E'), MekanismItems.EnrichedAlloy, Character.valueOf('C'), new ItemStack(MekanismBlocks.BasicBlock, 1, 8), Character.valueOf('O'), "ingotOsmium"
|
||||
));
|
||||
MachineType.ELECTRIC_CHEST.addRecipe(new ShapedMekanismRecipe(new ItemStack(MekanismBlocks.MachineBlock, 1, 13),
|
||||
BlockStateMachine.MachineType.ELECTRIC_CHEST.addRecipe(new ShapedMekanismRecipe(new ItemStack(MekanismBlocks.MachineBlock, 1, 13),
|
||||
"SGS", "CcC", "SSS", Character.valueOf('S'), "ingotSteel", Character.valueOf('G'), "blockGlass", Character.valueOf('C'), Blocks.chest, Character.valueOf('c'), MekanismUtils.getControlCircuit(BaseTier.BASIC)
|
||||
));
|
||||
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(MekanismBlocks.BasicBlock, 4, 9),
|
||||
@@ -354,7 +354,7 @@ public class Mekanism
|
||||
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(MekanismBlocks.BasicBlock, 2, 11),
|
||||
" I ", "ICI", " I ", Character.valueOf('I'), new ItemStack(MekanismBlocks.BasicBlock, 1, 9), Character.valueOf('C'), MekanismUtils.getControlCircuit(BaseTier.BASIC)
|
||||
));
|
||||
MachineType.CHARGEPAD.addRecipe(new ShapedMekanismRecipe(new ItemStack(MekanismBlocks.MachineBlock, 1, 14),
|
||||
BlockStateMachine.MachineType.CHARGEPAD.addRecipe(new ShapedMekanismRecipe(new ItemStack(MekanismBlocks.MachineBlock, 1, 14),
|
||||
"PPP", "SES", Character.valueOf('P'), Blocks.stone_pressure_plate, Character.valueOf('S'), "ingotSteel", Character.valueOf('E'), MekanismItems.EnergyTablet.getUnchargedItem()
|
||||
));
|
||||
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(MekanismItems.Robit.getUnchargedItem(),
|
||||
@@ -366,17 +366,17 @@ public class Mekanism
|
||||
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(MekanismItems.WalkieTalkie),
|
||||
" O", "SCS", " S ", Character.valueOf('O'), "ingotOsmium", Character.valueOf('S'), "ingotSteel", Character.valueOf('C'), MekanismUtils.getControlCircuit(BaseTier.BASIC)
|
||||
));
|
||||
MachineType.LOGISTICAL_SORTER.addRecipe(new ShapedMekanismRecipe(new ItemStack(MekanismBlocks.MachineBlock, 1, 15),
|
||||
BlockStateMachine.MachineType.LOGISTICAL_SORTER.addRecipe(new ShapedMekanismRecipe(new ItemStack(MekanismBlocks.MachineBlock, 1, 15),
|
||||
"IPI", "ICI", "III", Character.valueOf('I'), "ingotIron", Character.valueOf('P'), Blocks.piston, Character.valueOf('C'), MekanismUtils.getControlCircuit(BaseTier.BASIC)
|
||||
));
|
||||
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(MekanismBlocks.BasicBlock, 1, 6),
|
||||
"SSS", "SCS", "SSS", Character.valueOf('S'), Blocks.cobblestone, Character.valueOf('C'), MekanismUtils.getControlCircuit(BaseTier.BASIC)
|
||||
));
|
||||
MachineType.DIGITAL_MINER.addRecipe(new ShapedMekanismRecipe(new ItemStack(MekanismBlocks.MachineBlock, 1, 4),
|
||||
BlockStateMachine.MachineType.DIGITAL_MINER.addRecipe(new ShapedMekanismRecipe(new ItemStack(MekanismBlocks.MachineBlock, 1, 4),
|
||||
"ACA", "SES", "TIT", Character.valueOf('A'), MekanismItems.AtomicAlloy, Character.valueOf('C'), MekanismUtils.getControlCircuit(BaseTier.BASIC), Character.valueOf('S'), new ItemStack(MekanismBlocks.MachineBlock, 1, 15), Character.valueOf('E'), MekanismItems.Robit.getUnchargedItem(),
|
||||
Character.valueOf('I'), new ItemStack(MekanismBlocks.BasicBlock, 1, 8), Character.valueOf('T'), MekanismItems.TeleportationCore
|
||||
));
|
||||
MachineType.ROTARY_CONDENSENTRATOR.addRecipe(new ShapedMekanismRecipe(new ItemStack(MekanismBlocks.MachineBlock2, 1, 0),
|
||||
BlockStateMachine.MachineType.ROTARY_CONDENSENTRATOR.addRecipe(new ShapedMekanismRecipe(new ItemStack(MekanismBlocks.MachineBlock2, 1, 0),
|
||||
"GCG", "tEI", "GCG", Character.valueOf('G'), "blockGlass", Character.valueOf('C'), MekanismUtils.getControlCircuit(BaseTier.BASIC), Character.valueOf('t'), MekanismUtils.getEmptyGasTank(), Character.valueOf('E'), MekanismItems.EnergyTablet.getUnchargedItem(),
|
||||
Character.valueOf('T'), new ItemStack(MekanismBlocks.BasicBlock, 1, 9), Character.valueOf('I'), new ItemStack(MekanismBlocks.MachineBlock2, 1, 11)
|
||||
));
|
||||
@@ -392,16 +392,16 @@ public class Mekanism
|
||||
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(MekanismItems.ScubaTank.getEmptyItem(),
|
||||
" C ", "ATA", "SSS", Character.valueOf('C'), MekanismUtils.getControlCircuit(BaseTier.BASIC), Character.valueOf('A'), MekanismItems.EnrichedAlloy, Character.valueOf('S'), "ingotSteel"
|
||||
));
|
||||
MachineType.CHEMICAL_OXIDIZER.addRecipe(new ShapedMekanismRecipe(new ItemStack(MekanismBlocks.MachineBlock2, 1, 1),
|
||||
BlockStateMachine.MachineType.CHEMICAL_OXIDIZER.addRecipe(new ShapedMekanismRecipe(new ItemStack(MekanismBlocks.MachineBlock2, 1, 1),
|
||||
"ACA", "ERG", "ACA", Character.valueOf('C'), MekanismUtils.getControlCircuit(BaseTier.BASIC), Character.valueOf('R'), new ItemStack(MekanismBlocks.BasicBlock, 1, 9), Character.valueOf('G'), MekanismUtils.getEmptyGasTank(), Character.valueOf('E'), new ItemStack(MekanismBlocks.MachineBlock, 1, 13), Character.valueOf('A'), MekanismItems.EnrichedAlloy
|
||||
));
|
||||
MachineType.CHEMICAL_INFUSER.addRecipe(new ShapedMekanismRecipe(new ItemStack(MekanismBlocks.MachineBlock2, 1, 2),
|
||||
BlockStateMachine.MachineType.CHEMICAL_INFUSER.addRecipe(new ShapedMekanismRecipe(new ItemStack(MekanismBlocks.MachineBlock2, 1, 2),
|
||||
"ACA", "GRG", "ACA", Character.valueOf('C'), MekanismUtils.getControlCircuit(BaseTier.BASIC), Character.valueOf('R'), new ItemStack(MekanismBlocks.BasicBlock, 1, 9), Character.valueOf('G'), MekanismUtils.getEmptyGasTank(), Character.valueOf('A'), MekanismItems.EnrichedAlloy
|
||||
));
|
||||
MachineType.CHEMICAL_INJECTION_CHAMBER.addRecipe(new ShapedMekanismRecipe(new ItemStack(MekanismBlocks.MachineBlock2, 1, 3),
|
||||
BlockStateMachine.MachineType.CHEMICAL_INJECTION_CHAMBER.addRecipe(new ShapedMekanismRecipe(new ItemStack(MekanismBlocks.MachineBlock2, 1, 3),
|
||||
"RCR", "GPG", "RCR", Character.valueOf('C'), MekanismUtils.getControlCircuit(BaseTier.ELITE), Character.valueOf('R'), "alloyElite", Character.valueOf('G'), "ingotGold", Character.valueOf('P'), new ItemStack(MekanismBlocks.MachineBlock, 1, 9)
|
||||
));
|
||||
MachineType.ELECTROLYTIC_SEPARATOR.addRecipe(new ShapedMekanismRecipe(new ItemStack(MekanismBlocks.MachineBlock2, 1, 4),
|
||||
BlockStateMachine.MachineType.ELECTROLYTIC_SEPARATOR.addRecipe(new ShapedMekanismRecipe(new ItemStack(MekanismBlocks.MachineBlock2, 1, 4),
|
||||
"IRI", "ECE", "IRI", Character.valueOf('I'), "ingotIron", Character.valueOf('R'), "dustRedstone", Character.valueOf('E'), MekanismItems.EnrichedAlloy, Character.valueOf('C'), MekanismItems.ElectrolyticCore
|
||||
));
|
||||
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(MekanismItems.ElectrolyticCore),
|
||||
@@ -413,7 +413,7 @@ public class Mekanism
|
||||
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(Items.paper, 6),
|
||||
"SSS", Character.valueOf('S'), MekanismItems.Sawdust
|
||||
));
|
||||
MachineType.PRECISION_SAWMILL.addRecipe(new ShapedMekanismRecipe(new ItemStack(MekanismBlocks.MachineBlock2, 1, 5),
|
||||
BlockStateMachine.MachineType.PRECISION_SAWMILL.addRecipe(new ShapedMekanismRecipe(new ItemStack(MekanismBlocks.MachineBlock2, 1, 5),
|
||||
"ICI", "ASA", "ICI", Character.valueOf('I'), "ingotIron", Character.valueOf('C'), MekanismUtils.getControlCircuit(BaseTier.BASIC), Character.valueOf('A'), MekanismItems.EnrichedAlloy, Character.valueOf('S'), new ItemStack(MekanismBlocks.BasicBlock, 1, 8)
|
||||
));
|
||||
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(MekanismBlocks.BasicBlock, 1, 14),
|
||||
@@ -425,13 +425,13 @@ public class Mekanism
|
||||
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(MekanismBlocks.BasicBlock2, 1, 0),
|
||||
"CCC", "CTC", "CCC", Character.valueOf('C'), "ingotCopper", Character.valueOf('T'), new ItemStack(MekanismBlocks.BasicBlock, 1, 9)
|
||||
));
|
||||
MachineType.CHEMICAL_DISSOLUTION_CHAMBER.addRecipe(new ShapedMekanismRecipe(new ItemStack(MekanismBlocks.MachineBlock2, 1, 6),
|
||||
BlockStateMachine.MachineType.CHEMICAL_DISSOLUTION_CHAMBER.addRecipe(new ShapedMekanismRecipe(new ItemStack(MekanismBlocks.MachineBlock2, 1, 6),
|
||||
"CGC", "EAE", "CGC", Character.valueOf('G'), MekanismUtils.getEmptyGasTank(), Character.valueOf('C'), MekanismUtils.getControlCircuit(BaseTier.BASIC), Character.valueOf('A'), MekanismItems.AtomicAlloy, Character.valueOf('E'), MekanismItems.EnrichedAlloy
|
||||
));
|
||||
MachineType.CHEMICAL_WASHER.addRecipe(new ShapedMekanismRecipe(new ItemStack(MekanismBlocks.MachineBlock2, 1, 7),
|
||||
BlockStateMachine.MachineType.CHEMICAL_WASHER.addRecipe(new ShapedMekanismRecipe(new ItemStack(MekanismBlocks.MachineBlock2, 1, 7),
|
||||
"CWC", "EIE", "CGC", Character.valueOf('W'), Items.bucket, Character.valueOf('C'), MekanismUtils.getControlCircuit(BaseTier.BASIC), Character.valueOf('E'), MekanismItems.EnrichedAlloy, Character.valueOf('G'), MekanismUtils.getEmptyGasTank(), Character.valueOf('I'), new ItemStack(MekanismBlocks.BasicBlock, 1, 8)
|
||||
));
|
||||
MachineType.CHEMICAL_CRYSTALLIZER.addRecipe(new ShapedMekanismRecipe(new ItemStack(MekanismBlocks.MachineBlock2, 1, 8),
|
||||
BlockStateMachine.MachineType.CHEMICAL_CRYSTALLIZER.addRecipe(new ShapedMekanismRecipe(new ItemStack(MekanismBlocks.MachineBlock2, 1, 8),
|
||||
"CGC", "ASA", "CGC", Character.valueOf('G'), MekanismUtils.getEmptyGasTank(), Character.valueOf('C'), MekanismUtils.getControlCircuit(BaseTier.BASIC), Character.valueOf('A'), MekanismItems.AtomicAlloy, Character.valueOf('S'), new ItemStack(MekanismBlocks.BasicBlock, 1, 8)
|
||||
));
|
||||
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(MekanismItems.FreeRunners.getUnchargedItem(),
|
||||
@@ -446,17 +446,17 @@ public class Mekanism
|
||||
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(MekanismItems.SeismicReader.getUnchargedItem(),
|
||||
"SLS", "STS", "SSS", Character.valueOf('S'), "ingotSteel", Character.valueOf('L'), new ItemStack(Items.dye, 1, 4), Character.valueOf('T'), MekanismItems.EnergyTablet.getUnchargedItem()
|
||||
));
|
||||
MachineType.SEISMIC_VIBRATOR.addRecipe(new ShapedMekanismRecipe(new ItemStack(MekanismBlocks.MachineBlock2, 1, 9),
|
||||
BlockStateMachine.MachineType.SEISMIC_VIBRATOR.addRecipe(new ShapedMekanismRecipe(new ItemStack(MekanismBlocks.MachineBlock2, 1, 9),
|
||||
"TLT", "CIC", "TTT", Character.valueOf('T'), "ingotTin", Character.valueOf('L'), new ItemStack(Items.dye, 1, 4), Character.valueOf('C'), MekanismUtils.getControlCircuit(BaseTier.BASIC), Character.valueOf('I'), new ItemStack(MekanismBlocks.BasicBlock, 1, 8)
|
||||
));
|
||||
MachineType.PRESSURIZED_REACTION_CHAMBER.addRecipe(new ShapedMekanismRecipe(new ItemStack(MekanismBlocks.MachineBlock2, 1, 10),
|
||||
BlockStateMachine.MachineType.PRESSURIZED_REACTION_CHAMBER.addRecipe(new ShapedMekanismRecipe(new ItemStack(MekanismBlocks.MachineBlock2, 1, 10),
|
||||
"TET", "CIC", "GFG", Character.valueOf('S'), "ingotSteel", Character.valueOf('E'), MekanismItems.EnrichedAlloy, Character.valueOf('C'), MekanismUtils.getControlCircuit(BaseTier.BASIC), Character.valueOf('G'), MekanismUtils.getEmptyGasTank(),
|
||||
Character.valueOf('I'), new ItemStack(MekanismBlocks.MachineBlock, 1, 0), Character.valueOf('F'), new ItemStack(MekanismBlocks.BasicBlock, 1, 9)
|
||||
));
|
||||
MachineType.PORTABLE_TANK.addRecipe(new ShapedMekanismRecipe(new ItemStack(MekanismBlocks.MachineBlock2, 1, 11),
|
||||
BlockStateMachine.MachineType.PORTABLE_TANK.addRecipe(new ShapedMekanismRecipe(new ItemStack(MekanismBlocks.MachineBlock2, 1, 11),
|
||||
"III", "GCG", "III", Character.valueOf('I'), "ingotIron", Character.valueOf('G'), "blockGlass", Character.valueOf('C'), MekanismUtils.getControlCircuit(BaseTier.BASIC)
|
||||
));
|
||||
MachineType.FLUIDIC_PLENISHER.addRecipe(new ShapedMekanismRecipe(new ItemStack(MekanismBlocks.MachineBlock2, 1, 12),
|
||||
BlockStateMachine.MachineType.FLUIDIC_PLENISHER.addRecipe(new ShapedMekanismRecipe(new ItemStack(MekanismBlocks.MachineBlock2, 1, 12),
|
||||
"TTT", "CPC", "TTT", Character.valueOf('P'), new ItemStack(MekanismBlocks.MachineBlock, 1, 12), Character.valueOf('T'), "ingotTin", Character.valueOf('C'), MekanismUtils.getControlCircuit(BaseTier.BASIC)
|
||||
));
|
||||
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(Blocks.rail, 24),
|
||||
@@ -468,7 +468,7 @@ public class Mekanism
|
||||
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(MekanismItems.GaugeDropper.getEmptyItem(),
|
||||
" O ", "G G", "GGG", Character.valueOf('O'), "ingotOsmium", Character.valueOf('G'), "paneGlass"
|
||||
));
|
||||
MachineType.SOLAR_NEUTRON_ACTIVATOR.addRecipe(new ShapedMekanismRecipe(new ItemStack(MekanismBlocks.MachineBlock3, 1, 1),
|
||||
BlockStateMachine.MachineType.SOLAR_NEUTRON_ACTIVATOR.addRecipe(new ShapedMekanismRecipe(new ItemStack(MekanismBlocks.MachineBlock3, 1, 1),
|
||||
"APA", "CSC", "BBB", Character.valueOf('A'), "alloyElite", Character.valueOf('S'), new ItemStack(MekanismBlocks.BasicBlock, 1, 8), Character.valueOf('P'), new ItemStack(MekanismItems.Polyethene, 1, 2), Character.valueOf('B'), "ingotBronze", Character.valueOf('C'), MekanismUtils.getControlCircuit(BaseTier.ELITE)
|
||||
));
|
||||
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(MekanismBlocks.BasicBlock2, 4, 1),
|
||||
@@ -486,16 +486,16 @@ public class Mekanism
|
||||
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(MekanismItems.FactoryInstaller, 1, 2),
|
||||
"RCR", "gWg", "RCR", Character.valueOf('R'), "alloyElite", Character.valueOf('C'), MekanismUtils.getControlCircuit(BaseTier.ELITE), Character.valueOf('g'), "ingotGold", Character.valueOf('W'), "plankWood"
|
||||
));
|
||||
MachineType.OREDICTIONIFICATOR.addRecipe(new ShapedMekanismRecipe(new ItemStack(MekanismBlocks.MachineBlock3, 1, 3),
|
||||
BlockStateMachine.MachineType.OREDICTIONIFICATOR.addRecipe(new ShapedMekanismRecipe(new ItemStack(MekanismBlocks.MachineBlock3, 1, 3),
|
||||
"SGS", "CBC", "SWS", Character.valueOf('S'), "ingotSteel", Character.valueOf('G'), "paneGlass", Character.valueOf('C'), MekanismUtils.getControlCircuit(BaseTier.BASIC), Character.valueOf('B'), MekanismItems.Dictionary, Character.valueOf('W'), Blocks.chest
|
||||
));
|
||||
MachineType.LASER.addRecipe(new ShapedMekanismRecipe(new ItemStack(MekanismBlocks.MachineBlock2, 1, 13),
|
||||
BlockStateMachine.MachineType.LASER.addRecipe(new ShapedMekanismRecipe(new ItemStack(MekanismBlocks.MachineBlock2, 1, 13),
|
||||
"RE ", "RCD", "RE ", Character.valueOf('R'), "alloyElite", Character.valueOf('E'), MekanismItems.EnergyTablet.getUnchargedItem(), Character.valueOf('C'), new ItemStack(MekanismBlocks.BasicBlock, 1, 8), Character.valueOf('D'), "gemDiamond"
|
||||
));
|
||||
MachineType.LASER_AMPLIFIER.addRecipe(new ShapedMekanismRecipe(new ItemStack(MekanismBlocks.MachineBlock2, 1, 14),
|
||||
BlockStateMachine.MachineType.LASER_AMPLIFIER.addRecipe(new ShapedMekanismRecipe(new ItemStack(MekanismBlocks.MachineBlock2, 1, 14),
|
||||
"SSS", "SED", "SSS", Character.valueOf('S'), "ingotSteel", Character.valueOf('E'), MekanismUtils.getEnergyCube(EnergyCubeTier.BASIC), Character.valueOf('D'), "gemDiamond"
|
||||
));
|
||||
MachineType.LASER_TRACTOR_BEAM.addRecipe(new ShapedMekanismRecipe(new ItemStack(MekanismBlocks.MachineBlock2, 1, 15),
|
||||
BlockStateMachine.MachineType.LASER_TRACTOR_BEAM.addRecipe(new ShapedMekanismRecipe(new ItemStack(MekanismBlocks.MachineBlock2, 1, 15),
|
||||
"C", "F", Character.valueOf('C'), new ItemStack(MekanismBlocks.MachineBlock, 1, 13), Character.valueOf('F'), new ItemStack(MekanismBlocks.MachineBlock2, 1, 14)
|
||||
));
|
||||
|
||||
@@ -555,13 +555,13 @@ public class Mekanism
|
||||
//Factory recipes
|
||||
for(RecipeType type : RecipeType.values())
|
||||
{
|
||||
MachineType.BASIC_FACTORY.addRecipe(new ShapedMekanismRecipe(MekanismUtils.getFactory(FactoryTier.BASIC, type),
|
||||
BlockStateMachine.MachineType.BASIC_FACTORY.addRecipe(new ShapedMekanismRecipe(MekanismUtils.getFactory(FactoryTier.BASIC, type),
|
||||
"RCR", "iOi", "RCR", Character.valueOf('R'), "alloyBasic", Character.valueOf('C'), MekanismUtils.getControlCircuit(BaseTier.BASIC), Character.valueOf('i'), "ingotIron", Character.valueOf('O'), type.getStack()
|
||||
));
|
||||
MachineType.ADVANCED_FACTORY.addRecipe(new ShapedMekanismRecipe(MekanismUtils.getFactory(FactoryTier.ADVANCED, type),
|
||||
BlockStateMachine.MachineType.ADVANCED_FACTORY.addRecipe(new ShapedMekanismRecipe(MekanismUtils.getFactory(FactoryTier.ADVANCED, type),
|
||||
"ECE", "oOo", "ECE", Character.valueOf('E'), "alloyAdvanced", Character.valueOf('C'), MekanismUtils.getControlCircuit(BaseTier.ADVANCED), Character.valueOf('o'), "ingotOsmium", Character.valueOf('O'), MekanismUtils.getFactory(FactoryTier.BASIC, type)
|
||||
));
|
||||
MachineType.ELITE_FACTORY.addRecipe(new ShapedMekanismRecipe(MekanismUtils.getFactory(FactoryTier.ELITE, type),
|
||||
BlockStateMachine.MachineType.ELITE_FACTORY.addRecipe(new ShapedMekanismRecipe(MekanismUtils.getFactory(FactoryTier.ELITE, type),
|
||||
"RCR", "gOg", "RCR", Character.valueOf('R'), "alloyElite", Character.valueOf('C'), MekanismUtils.getControlCircuit(BaseTier.ELITE), Character.valueOf('g'), "ingotGold", Character.valueOf('O'), MekanismUtils.getFactory(FactoryTier.ADVANCED, type)
|
||||
));
|
||||
}
|
||||
|
||||
@@ -6,11 +6,16 @@ import mekanism.common.block.BlockCardboardBox;
|
||||
import mekanism.common.block.BlockEnergyCube;
|
||||
import mekanism.common.block.BlockGasTank;
|
||||
import mekanism.common.block.BlockMachine;
|
||||
import mekanism.common.block.states.BlockStateBasic.BasicBlockStateMapper;
|
||||
import mekanism.common.block.states.BlockStateBasic.BasicBlockType;
|
||||
import mekanism.common.block.states.BlockStateMachine.MachineBlockStateMapper;
|
||||
import mekanism.common.block.states.BlockStateMachine.MachineType;
|
||||
import mekanism.common.block.BlockObsidianTNT;
|
||||
import mekanism.common.block.BlockOre;
|
||||
import mekanism.common.block.BlockPlastic;
|
||||
import mekanism.common.block.BlockPlasticFence;
|
||||
import mekanism.common.block.BlockSalt;
|
||||
import mekanism.common.block.states.BlockStateMachine;
|
||||
import mekanism.common.item.ItemBlockBasic;
|
||||
import mekanism.common.item.ItemBlockCardboardBox;
|
||||
import mekanism.common.item.ItemBlockEnergyCube;
|
||||
@@ -20,23 +25,33 @@ import mekanism.common.item.ItemBlockOre;
|
||||
import mekanism.common.item.ItemBlockPlastic;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.ItemModelMesher;
|
||||
import net.minecraft.client.renderer.block.statemap.BlockStateMapper;
|
||||
import net.minecraft.client.renderer.block.statemap.IStateMapper;
|
||||
import net.minecraft.client.resources.model.ModelBakery;
|
||||
import net.minecraft.client.resources.model.ModelResourceLocation;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||
import net.minecraftforge.fml.common.registry.GameRegistry.ObjectHolder;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import static mekanism.common.block.BlockBasic.BasicBlock.BASIC_BLOCK_1;
|
||||
import static mekanism.common.block.BlockBasic.BasicBlock.BASIC_BLOCK_2;
|
||||
import static mekanism.common.block.BlockMachine.MachineBlock.MACHINE_BLOCK_1;
|
||||
import static mekanism.common.block.BlockMachine.MachineBlock.MACHINE_BLOCK_2;
|
||||
import static mekanism.common.block.BlockMachine.MachineBlock.MACHINE_BLOCK_3;
|
||||
import static mekanism.common.block.states.BlockStateBasic.BasicBlock.BASIC_BLOCK_1;
|
||||
import static mekanism.common.block.states.BlockStateBasic.BasicBlock.BASIC_BLOCK_2;
|
||||
import static mekanism.common.block.states.BlockStateMachine.MachineBlock.MACHINE_BLOCK_1;
|
||||
import static mekanism.common.block.states.BlockStateMachine.MachineBlock.MACHINE_BLOCK_2;
|
||||
import static mekanism.common.block.states.BlockStateMachine.MachineBlock.MACHINE_BLOCK_3;
|
||||
|
||||
@ObjectHolder("Mekanism")
|
||||
public class MekanismBlocks
|
||||
{
|
||||
public static final Block BasicBlock = new BlockBasic(BASIC_BLOCK_1).setUnlocalizedName("BasicBlock");
|
||||
public static final Block BasicBlock2 = new BlockBasic(BASIC_BLOCK_2).setUnlocalizedName("BasicBlock2");
|
||||
public static final Block MachineBlock = new BlockMachine(MACHINE_BLOCK_1).setUnlocalizedName("MachineBlock");
|
||||
public static final Block MachineBlock2 = new BlockMachine(MACHINE_BLOCK_2).setUnlocalizedName("MachineBlock2");
|
||||
public static final Block MachineBlock3 = new BlockMachine(MACHINE_BLOCK_3).setUnlocalizedName("MachineBlock3");
|
||||
public static final Block BasicBlock = BlockBasic.getBlockBasic(BASIC_BLOCK_1).setUnlocalizedName("BasicBlock");
|
||||
public static final Block BasicBlock2 = BlockBasic.getBlockBasic(BASIC_BLOCK_2).setUnlocalizedName("BasicBlock2");
|
||||
public static final Block MachineBlock = BlockMachine.getBlockMachine(MACHINE_BLOCK_1).setUnlocalizedName("MachineBlock");
|
||||
public static final Block MachineBlock2 = BlockMachine.getBlockMachine(MACHINE_BLOCK_2).setUnlocalizedName("MachineBlock2");
|
||||
public static final Block MachineBlock3 = BlockMachine.getBlockMachine(MACHINE_BLOCK_3).setUnlocalizedName("MachineBlock3");
|
||||
public static final Block OreBlock = new BlockOre().setUnlocalizedName("OreBlock");
|
||||
public static final Block ObsidianTNT = new BlockObsidianTNT().setUnlocalizedName("ObsidianTNT").setCreativeTab(Mekanism.tabMekanism);
|
||||
public static final Block EnergyCube = new BlockEnergyCube().setUnlocalizedName("EnergyCube");
|
||||
@@ -51,6 +66,11 @@ public class MekanismBlocks
|
||||
public static final Block PlasticFence = new BlockPlasticFence().setUnlocalizedName("PlasticFence");
|
||||
public static final Block SaltBlock = new BlockSalt().setUnlocalizedName("SaltBlock");
|
||||
|
||||
private static final IStateMapper machineMapper = new MachineBlockStateMapper();
|
||||
private static final IStateMapper basicMapper = new BasicBlockStateMapper();
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Adds and registers all blocks.
|
||||
*/
|
||||
@@ -75,4 +95,100 @@ public class MekanismBlocks
|
||||
GameRegistry.registerBlock(PlasticFence, ItemBlockPlastic.class, "PlasticFence");
|
||||
GameRegistry.registerBlock(SaltBlock, "SaltBlock");
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public static void registerRender()
|
||||
{
|
||||
ItemModelMesher mesher = Minecraft.getMinecraft().getRenderItem().getItemModelMesher();
|
||||
|
||||
for(MachineType type : BlockStateMachine.MachineType.values())
|
||||
{
|
||||
mesher.register(Item.getItemFromBlock(type.typeBlock.getBlock()), type.meta, new ModelResourceLocation("mekanism:" + type.getName(), "inventory"));
|
||||
}
|
||||
|
||||
for(BasicBlockType type : BasicBlockType.values())
|
||||
{
|
||||
mesher.register(Item.getItemFromBlock(type.blockType.getBlock()), type.meta, new ModelResourceLocation("mekanism:" + type.getName(), "inventory"));
|
||||
}
|
||||
|
||||
ModelBakery.registerItemVariants(Item.getItemFromBlock(MachineBlock),
|
||||
new ResourceLocation("mekanism", "enrichment_chamber"),
|
||||
new ResourceLocation("mekanism", "osmium_compressor"),
|
||||
new ResourceLocation("mekanism", "combiner"),
|
||||
new ResourceLocation("mekanism", "crusher"),
|
||||
new ResourceLocation("mekanism", "digital_miner"),
|
||||
new ResourceLocation("mekanism", "basic_factory"),
|
||||
new ResourceLocation("mekanism", "advanced_factory"),
|
||||
new ResourceLocation("mekanism", "elite_factory"),
|
||||
new ResourceLocation("mekanism", "metallurgic_infuser"),
|
||||
new ResourceLocation("mekanism", "purification_chamber"),
|
||||
new ResourceLocation("mekanism", "energized_smelter"),
|
||||
new ResourceLocation("mekanism", "teleporter"),
|
||||
new ResourceLocation("mekanism", "electric_pump"),
|
||||
new ResourceLocation("mekanism", "electric_chest"),
|
||||
new ResourceLocation("mekanism", "chargepad"),
|
||||
new ResourceLocation("mekanism", "logistical_sorter")
|
||||
);
|
||||
|
||||
ModelBakery.registerItemVariants(Item.getItemFromBlock(MachineBlock2),
|
||||
new ResourceLocation("mekanism", "rotary_condensentrator"),
|
||||
new ResourceLocation("mekanism", "chemical_oxidiser"),
|
||||
new ResourceLocation("mekanism", "chemical_infuser"),
|
||||
new ResourceLocation("mekanism", "chemical_injection_chamber"),
|
||||
new ResourceLocation("mekanism", "electrolytic_separator"),
|
||||
new ResourceLocation("mekanism", "precision_sawmill"),
|
||||
new ResourceLocation("mekanism", "chemical_dissolution_chamber"),
|
||||
new ResourceLocation("mekanism", "chemical_washer"),
|
||||
new ResourceLocation("mekanism", "chemical_crystallizer"),
|
||||
new ResourceLocation("mekanism", "seismic_vibrator"),
|
||||
new ResourceLocation("mekanism", "pressurized_reaction_chamber"),
|
||||
new ResourceLocation("mekanism", "portable_tank"),
|
||||
new ResourceLocation("mekanism", "fluidic_plenisher"),
|
||||
new ResourceLocation("mekanism", "laser"),
|
||||
new ResourceLocation("mekanism", "laser_amplifier"),
|
||||
new ResourceLocation("mekanism", "laser_tractor_bean")
|
||||
);
|
||||
|
||||
ModelBakery.registerItemVariants(Item.getItemFromBlock(MachineBlock3),
|
||||
new ResourceLocation("mekanism", "entangled_block"),
|
||||
new ResourceLocation("mekanism", "solat_neutron_activator"),
|
||||
new ResourceLocation("mekanism", "ambient_accumulator"),
|
||||
new ResourceLocation("mekanism", "oredictionificator")
|
||||
);
|
||||
|
||||
ModelBakery.registerItemVariants(Item.getItemFromBlock(BasicBlock),
|
||||
new ResourceLocation("mekanism", "osmium_block"),
|
||||
new ResourceLocation("mekanism", "bronze_block"),
|
||||
new ResourceLocation("mekanism", "refined_obsidian"),
|
||||
new ResourceLocation("mekanism", "coal_block"),
|
||||
new ResourceLocation("mekanism", "refined_glowstone"),
|
||||
new ResourceLocation("mekanism", "steel_block"),
|
||||
new ResourceLocation("mekanism", "bin"),
|
||||
new ResourceLocation("mekanism", "teleporter_frame"),
|
||||
new ResourceLocation("mekanism", "steel_casing"),
|
||||
new ResourceLocation("mekanism", "dynamic_tank"),
|
||||
new ResourceLocation("mekanism", "dynamic_glass"),
|
||||
new ResourceLocation("mekanism", "dynamic_valve"),
|
||||
new ResourceLocation("mekanism", "copper_block"),
|
||||
new ResourceLocation("mekanism", "tin_block"),
|
||||
new ResourceLocation("mekanism", "solar_evaporation_controller"),
|
||||
new ResourceLocation("mekanism", "solar_evaporation_valve")
|
||||
);
|
||||
|
||||
ModelBakery.registerItemVariants(Item.getItemFromBlock(BasicBlock2),
|
||||
new ResourceLocation("mekanism", "solar_evaporation_block"),
|
||||
new ResourceLocation("mekanism", "induction_casing"),
|
||||
new ResourceLocation("mekanism", "induction_port"),
|
||||
new ResourceLocation("mekanism", "induction_cell"),
|
||||
new ResourceLocation("mekanism", "induction_provider")
|
||||
);
|
||||
|
||||
Minecraft.getMinecraft().getBlockRendererDispatcher().getBlockModelShapes().registerBlockWithStateMapper(MachineBlock, machineMapper);
|
||||
Minecraft.getMinecraft().getBlockRendererDispatcher().getBlockModelShapes().registerBlockWithStateMapper(MachineBlock2, machineMapper);
|
||||
Minecraft.getMinecraft().getBlockRendererDispatcher().getBlockModelShapes().registerBlockWithStateMapper(MachineBlock3, machineMapper);
|
||||
Minecraft.getMinecraft().getBlockRendererDispatcher().getBlockModelShapes().registerBlockWithStateMapper(BasicBlock, basicMapper);
|
||||
Minecraft.getMinecraft().getBlockRendererDispatcher().getBlockModelShapes().registerBlockWithStateMapper(BasicBlock2, basicMapper);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -3,6 +3,8 @@ package mekanism.common;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import mekanism.api.EnumColor;
|
||||
import mekanism.common.util.LangUtils;
|
||||
|
||||
import net.minecraft.util.IStringSerializable;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
/**
|
||||
@@ -58,7 +60,7 @@ public final class Tier
|
||||
* @author aidancbrady
|
||||
*
|
||||
*/
|
||||
public static enum EnergyCubeTier
|
||||
public static enum EnergyCubeTier implements IStringSerializable
|
||||
{
|
||||
BASIC(2000000, 800),
|
||||
ADVANCED(8000000, 3200),
|
||||
@@ -113,6 +115,12 @@ public final class Tier
|
||||
baseMaxEnergy = maxEnergy = max;
|
||||
baseOutput = output = out;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName()
|
||||
{
|
||||
return name().toLowerCase();
|
||||
}
|
||||
}
|
||||
|
||||
public static enum InductionCellTier
|
||||
|
||||
@@ -5,7 +5,8 @@ import java.util.Map;
|
||||
import mekanism.api.gas.Gas;
|
||||
import mekanism.api.gas.GasStack;
|
||||
import mekanism.api.util.StackUtils;
|
||||
import mekanism.common.block.BlockMachine.MachineType;
|
||||
import mekanism.common.block.states.BlockStateMachine.MachineType;
|
||||
import mekanism.common.block.states.BlockStateMachine;
|
||||
import mekanism.common.recipe.RecipeHandler;
|
||||
import mekanism.common.recipe.RecipeHandler.Recipe;
|
||||
import mekanism.common.recipe.inputs.AdvancedMachineInput;
|
||||
@@ -43,13 +44,13 @@ public interface IFactory
|
||||
|
||||
public static enum RecipeType
|
||||
{
|
||||
SMELTING("Smelting", "smelter", MachineType.ENERGIZED_SMELTER.getStack(), false, false, Recipe.ENERGIZED_SMELTER),
|
||||
ENRICHING("Enriching", "enrichment", MachineType.ENRICHMENT_CHAMBER.getStack(), false, false, Recipe.ENRICHMENT_CHAMBER),
|
||||
CRUSHING("Crushing", "crusher", MachineType.CRUSHER.getStack(), false, false, Recipe.CRUSHER),
|
||||
COMPRESSING("Compressing", "compressor", MachineType.OSMIUM_COMPRESSOR.getStack(), true, false, Recipe.OSMIUM_COMPRESSOR),
|
||||
COMBINING("Combining", "combiner", MachineType.COMBINER.getStack(), true, false, Recipe.COMBINER),
|
||||
PURIFYING("Purifying", "purifier", MachineType.PURIFICATION_CHAMBER.getStack(), true, true, Recipe.PURIFICATION_CHAMBER),
|
||||
INJECTING("Injecting", "injection", MachineType.CHEMICAL_INJECTION_CHAMBER.getStack(), true, true, Recipe.CHEMICAL_INJECTION_CHAMBER);
|
||||
SMELTING("Smelting", "smelter", BlockStateMachine.MachineType.ENERGIZED_SMELTER.getStack(), false, false, Recipe.ENERGIZED_SMELTER),
|
||||
ENRICHING("Enriching", "enrichment", BlockStateMachine.MachineType.ENRICHMENT_CHAMBER.getStack(), false, false, Recipe.ENRICHMENT_CHAMBER),
|
||||
CRUSHING("Crushing", "crusher", BlockStateMachine.MachineType.CRUSHER.getStack(), false, false, Recipe.CRUSHER),
|
||||
COMPRESSING("Compressing", "compressor", BlockStateMachine.MachineType.OSMIUM_COMPRESSOR.getStack(), true, false, Recipe.OSMIUM_COMPRESSOR),
|
||||
COMBINING("Combining", "combiner", BlockStateMachine.MachineType.COMBINER.getStack(), true, false, Recipe.COMBINER),
|
||||
PURIFYING("Purifying", "purifier", BlockStateMachine.MachineType.PURIFICATION_CHAMBER.getStack(), true, true, Recipe.PURIFICATION_CHAMBER),
|
||||
INJECTING("Injecting", "injection", BlockStateMachine.MachineType.CHEMICAL_INJECTION_CHAMBER.getStack(), true, true, Recipe.CHEMICAL_INJECTION_CHAMBER);
|
||||
|
||||
private String name;
|
||||
private ResourceLocation sound;
|
||||
@@ -168,7 +169,7 @@ public interface IFactory
|
||||
{
|
||||
if(cacheTile == null)
|
||||
{
|
||||
MachineType type = MachineType.get(Block.getBlockFromItem(getStack().getItem()), getStack().getItemDamage());
|
||||
MachineType type = BlockStateMachine.MachineType.get(Block.getBlockFromItem(getStack().getItem()), getStack().getItemDamage());
|
||||
cacheTile = (TileEntityAdvancedElectricMachine)type.create();
|
||||
}
|
||||
|
||||
|
||||
@@ -10,6 +10,10 @@ import mekanism.common.Mekanism;
|
||||
import mekanism.common.Tier.BaseTier;
|
||||
import mekanism.common.base.IActiveState;
|
||||
import mekanism.common.base.IBoundingBlock;
|
||||
import mekanism.common.block.states.BlockStateBasic;
|
||||
import mekanism.common.block.states.BlockStateBasic.BasicBlock;
|
||||
import mekanism.common.block.states.BlockStateBasic.BasicBlockType;
|
||||
import mekanism.common.block.states.BlockStateMachine.MachineBlock;
|
||||
import mekanism.common.content.tank.TankUpdateProtocol;
|
||||
import mekanism.common.inventory.InventoryBin;
|
||||
import mekanism.common.item.ItemBlockBasic;
|
||||
@@ -30,6 +34,9 @@ import mekanism.common.tile.TileEntityStructuralGlass;
|
||||
import mekanism.common.util.MekanismUtils;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.properties.IProperty;
|
||||
import net.minecraft.block.properties.PropertyEnum;
|
||||
import net.minecraft.block.state.BlockState;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.EntityLiving.SpawnPlacementType;
|
||||
@@ -80,23 +87,57 @@ import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
* @author AidanBrady
|
||||
*
|
||||
*/
|
||||
public class BlockBasic extends Block//TODO? implements IBlockCTM, ICustomBlockIcon
|
||||
public abstract class BlockBasic extends Block//TODO? implements IBlockCTM, ICustomBlockIcon
|
||||
{
|
||||
// public CTMData[][] ctms = new CTMData[16][4];
|
||||
|
||||
// public static String ICON_BASE = "mekanism:SteelCasing";
|
||||
|
||||
public BasicBlock blockType;
|
||||
|
||||
public BlockBasic(BasicBlock type)
|
||||
public BlockBasic()
|
||||
{
|
||||
super(Material.iron);
|
||||
setHardness(5F);
|
||||
setResistance(10F);
|
||||
setCreativeTab(Mekanism.tabMekanism);
|
||||
blockType = type;
|
||||
}
|
||||
|
||||
|
||||
public static BlockBasic getBlockBasic(BasicBlock block)
|
||||
{
|
||||
return new BlockBasic() {
|
||||
@Override
|
||||
public BasicBlock getBasicBlock()
|
||||
{
|
||||
return block;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
public abstract BasicBlock getBasicBlock();
|
||||
|
||||
public BlockState createBlockState()
|
||||
{
|
||||
return new BlockStateBasic(this, getProperty());
|
||||
}
|
||||
|
||||
public PropertyEnum<BasicBlockType> getProperty()
|
||||
{
|
||||
return getBasicBlock().getProperty();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBlockState getStateFromMeta(int meta)
|
||||
{
|
||||
BasicBlockType type = BasicBlockType.getBlockType(getBasicBlock(), meta&0xF);
|
||||
|
||||
return this.getDefaultState().withProperty(getProperty(), type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetaFromState(IBlockState state)
|
||||
{
|
||||
BasicBlockType type = state.getValue(getProperty());
|
||||
return type.meta;
|
||||
}
|
||||
/*
|
||||
@Override
|
||||
public IIcon getIcon(ItemStack stack, int side)
|
||||
@@ -297,7 +338,7 @@ public class BlockBasic extends Block//TODO? implements IBlockCTM, ICustomBlockI
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubBlocks(Item item, CreativeTabs creativetabs, List<ItemStack> list)
|
||||
{
|
||||
switch(blockType)
|
||||
switch(getBasicBlock())
|
||||
{
|
||||
case BASIC_BLOCK_1:
|
||||
for(int i = 0; i < 16; i++)
|
||||
@@ -348,7 +389,7 @@ public class BlockBasic extends Block//TODO? implements IBlockCTM, ICustomBlockI
|
||||
IBlockState state = world.getBlockState(pos);
|
||||
int meta = state.getBlock().getMetaFromState(state);
|
||||
|
||||
switch(blockType)
|
||||
switch(getBasicBlock())
|
||||
{
|
||||
case BASIC_BLOCK_1:
|
||||
switch(meta)
|
||||
@@ -414,7 +455,7 @@ public class BlockBasic extends Block//TODO? implements IBlockCTM, ICustomBlockI
|
||||
IBlockState state = world.getBlockState(pos);
|
||||
int meta = state.getBlock().getMetaFromState(state);
|
||||
|
||||
if(blockType == BasicBlock.BASIC_BLOCK_1)
|
||||
if(getBasicBlock() == BasicBlock.BASIC_BLOCK_1)
|
||||
{
|
||||
if(!world.isRemote && meta == 6)
|
||||
{
|
||||
@@ -443,7 +484,7 @@ public class BlockBasic extends Block//TODO? implements IBlockCTM, ICustomBlockI
|
||||
{
|
||||
int metadata = state.getBlock().getMetaFromState(state);
|
||||
|
||||
if(blockType == BasicBlock.BASIC_BLOCK_1)
|
||||
if(getBasicBlock() == BasicBlock.BASIC_BLOCK_1)
|
||||
{
|
||||
if(metadata != 6)
|
||||
{
|
||||
@@ -546,7 +587,7 @@ public class BlockBasic extends Block//TODO? implements IBlockCTM, ICustomBlockI
|
||||
return ((IStructuralMultiblock)world.getTileEntity(pos)).onActivate(entityplayer);
|
||||
}
|
||||
}
|
||||
else if(blockType == BasicBlock.BASIC_BLOCK_2)
|
||||
else if(getBasicBlock() == BasicBlock.BASIC_BLOCK_2)
|
||||
{
|
||||
if(world.isRemote)
|
||||
{
|
||||
@@ -566,7 +607,7 @@ public class BlockBasic extends Block//TODO? implements IBlockCTM, ICustomBlockI
|
||||
public boolean isSideSolid(IBlockAccess world, BlockPos pos, EnumFacing side)
|
||||
{
|
||||
IBlockState state = world.getBlockState(pos);
|
||||
return !(blockType == BasicBlock.BASIC_BLOCK_1 && state.getBlock().getMetaFromState(state) == 10);
|
||||
return !(getBasicBlock() == BasicBlock.BASIC_BLOCK_1 && state.getBlock().getMetaFromState(state) == 10);
|
||||
}
|
||||
|
||||
public static boolean manageInventory(EntityPlayer player, TileEntityDynamicTank tileEntity)
|
||||
@@ -717,7 +758,7 @@ public class BlockBasic extends Block//TODO? implements IBlockCTM, ICustomBlockI
|
||||
}
|
||||
}
|
||||
|
||||
if(blockType == BasicBlock.BASIC_BLOCK_1)
|
||||
if(getBasicBlock() == BasicBlock.BASIC_BLOCK_1)
|
||||
{
|
||||
switch(metadata)
|
||||
{
|
||||
@@ -737,7 +778,7 @@ public class BlockBasic extends Block//TODO? implements IBlockCTM, ICustomBlockI
|
||||
public boolean hasTileEntity(IBlockState state)
|
||||
{
|
||||
int metadata = state.getBlock().getMetaFromState(state);
|
||||
switch(blockType)
|
||||
switch(getBasicBlock())
|
||||
{
|
||||
case BASIC_BLOCK_1:
|
||||
switch(metadata)
|
||||
@@ -788,7 +829,7 @@ public class BlockBasic extends Block//TODO? implements IBlockCTM, ICustomBlockI
|
||||
public TileEntity createTileEntity(World world, IBlockState state)
|
||||
{
|
||||
int metadata = state.getBlock().getMetaFromState(state);
|
||||
switch(blockType)
|
||||
switch(getBasicBlock())
|
||||
{
|
||||
case BASIC_BLOCK_1:
|
||||
switch(metadata)
|
||||
@@ -897,7 +938,7 @@ public class BlockBasic extends Block//TODO? implements IBlockCTM, ICustomBlockI
|
||||
IBlockState state = world.getBlockState(pos);
|
||||
ItemStack ret = new ItemStack(this, 1, state.getBlock().getMetaFromState(state));
|
||||
|
||||
if(blockType == BasicBlock.BASIC_BLOCK_1)
|
||||
if(getBasicBlock() == BasicBlock.BASIC_BLOCK_1)
|
||||
{
|
||||
if(ret.getItemDamage() == 6)
|
||||
{
|
||||
@@ -912,7 +953,7 @@ public class BlockBasic extends Block//TODO? implements IBlockCTM, ICustomBlockI
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(blockType == BasicBlock.BASIC_BLOCK_2)
|
||||
else if(getBasicBlock() == BasicBlock.BASIC_BLOCK_2)
|
||||
{
|
||||
if(ret.getItemDamage() == 3)
|
||||
{
|
||||
@@ -990,7 +1031,7 @@ public class BlockBasic extends Block//TODO? implements IBlockCTM, ICustomBlockI
|
||||
{
|
||||
Coord4D obj = new Coord4D(pos).offset(EnumFacing.getFront(side).getOpposite());
|
||||
|
||||
if(blockType == BasicBlock.BASIC_BLOCK_1 && obj.getBlockState(world) == 10)
|
||||
if(getBasicBlock() == BasicBlock.BASIC_BLOCK_1 && obj.getBlockState(world) == 10)
|
||||
{
|
||||
return ctms[10][0].shouldRenderSide(world, pos, side);
|
||||
}
|
||||
@@ -1050,7 +1091,7 @@ public class BlockBasic extends Block//TODO? implements IBlockCTM, ICustomBlockI
|
||||
return ctms[meta][1];
|
||||
}
|
||||
|
||||
if(blockType == BasicBlock.BASIC_BLOCK_2)
|
||||
if(getBasicBlock() == BasicBlock.BASIC_BLOCK_2)
|
||||
{
|
||||
if(meta == 3)
|
||||
{
|
||||
@@ -1067,10 +1108,4 @@ public class BlockBasic extends Block//TODO? implements IBlockCTM, ICustomBlockI
|
||||
return ctms[meta][0];
|
||||
}
|
||||
*/
|
||||
|
||||
public static enum BasicBlock
|
||||
{
|
||||
BASIC_BLOCK_1,
|
||||
BASIC_BLOCK_2;
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,5 @@
|
||||
package mekanism.common.block;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
@@ -10,13 +7,10 @@ import mekanism.api.Coord4D;
|
||||
import mekanism.api.EnumColor;
|
||||
import mekanism.api.MekanismConfig.client;
|
||||
import mekanism.api.MekanismConfig.general;
|
||||
import mekanism.api.MekanismConfig.machines;
|
||||
import mekanism.api.MekanismConfig.usage;
|
||||
import mekanism.api.energy.IEnergizedItem;
|
||||
import mekanism.api.energy.IStrictEnergyStorage;
|
||||
import mekanism.common.ItemAttacher;
|
||||
import mekanism.common.Mekanism;
|
||||
import mekanism.common.MekanismBlocks;
|
||||
import mekanism.common.base.IActiveState;
|
||||
import mekanism.common.base.IBoundingBlock;
|
||||
import mekanism.common.base.IElectricChest;
|
||||
@@ -29,49 +23,24 @@ import mekanism.common.base.ISustainedData;
|
||||
import mekanism.common.base.ISustainedInventory;
|
||||
import mekanism.common.base.ISustainedTank;
|
||||
import mekanism.common.base.IUpgradeTile;
|
||||
import mekanism.common.block.states.BlockStateBasic.BasicBlock;
|
||||
import mekanism.common.block.states.BlockStateMachine;
|
||||
import mekanism.common.block.states.BlockStateMachine.MachineBlock;
|
||||
import mekanism.common.block.states.BlockStateMachine.MachineType;
|
||||
import mekanism.common.item.ItemBlockMachine;
|
||||
import mekanism.common.network.PacketElectricChest.ElectricChestMessage;
|
||||
import mekanism.common.network.PacketElectricChest.ElectricChestPacketType;
|
||||
import mekanism.common.network.PacketLogisticalSorterGui.LogisticalSorterGuiMessage;
|
||||
import mekanism.common.network.PacketLogisticalSorterGui.SorterGuiPacket;
|
||||
import mekanism.common.recipe.ShapedMekanismRecipe;
|
||||
import mekanism.common.tile.TileEntityAdvancedFactory;
|
||||
import mekanism.common.tile.TileEntityAmbientAccumulator;
|
||||
import mekanism.common.tile.TileEntityBasicBlock;
|
||||
import mekanism.common.tile.TileEntityChargepad;
|
||||
import mekanism.common.tile.TileEntityChemicalCrystallizer;
|
||||
import mekanism.common.tile.TileEntityChemicalDissolutionChamber;
|
||||
import mekanism.common.tile.TileEntityChemicalInfuser;
|
||||
import mekanism.common.tile.TileEntityChemicalInjectionChamber;
|
||||
import mekanism.common.tile.TileEntityChemicalOxidizer;
|
||||
import mekanism.common.tile.TileEntityChemicalWasher;
|
||||
import mekanism.common.tile.TileEntityCombiner;
|
||||
import mekanism.common.tile.TileEntityContainerBlock;
|
||||
import mekanism.common.tile.TileEntityCrusher;
|
||||
import mekanism.common.tile.TileEntityDigitalMiner;
|
||||
import mekanism.common.tile.TileEntityElectricChest;
|
||||
import mekanism.common.tile.TileEntityElectricPump;
|
||||
import mekanism.common.tile.TileEntityElectrolyticSeparator;
|
||||
import mekanism.common.tile.TileEntityEliteFactory;
|
||||
import mekanism.common.tile.TileEntityEnergizedSmelter;
|
||||
import mekanism.common.tile.TileEntityEnrichmentChamber;
|
||||
import mekanism.common.tile.TileEntityEntangledBlock;
|
||||
import mekanism.common.tile.TileEntityFactory;
|
||||
import mekanism.common.tile.TileEntityFluidicPlenisher;
|
||||
import mekanism.common.tile.TileEntityLaser;
|
||||
import mekanism.common.tile.TileEntityLaserAmplifier;
|
||||
import mekanism.common.tile.TileEntityLaserTractorBeam;
|
||||
import mekanism.common.tile.TileEntityLogisticalSorter;
|
||||
import mekanism.common.tile.TileEntityMetallurgicInfuser;
|
||||
import mekanism.common.tile.TileEntityOredictionificator;
|
||||
import mekanism.common.tile.TileEntityOsmiumCompressor;
|
||||
import mekanism.common.tile.TileEntityPRC;
|
||||
import mekanism.common.tile.TileEntityPortableTank;
|
||||
import mekanism.common.tile.TileEntityPrecisionSawmill;
|
||||
import mekanism.common.tile.TileEntityPurificationChamber;
|
||||
import mekanism.common.tile.TileEntityRotaryCondensentrator;
|
||||
import mekanism.common.tile.TileEntitySeismicVibrator;
|
||||
import mekanism.common.tile.TileEntitySolarNeutronActivator;
|
||||
import mekanism.common.tile.TileEntityTeleporter;
|
||||
import mekanism.common.util.LangUtils;
|
||||
import mekanism.common.util.MekanismUtils;
|
||||
@@ -79,6 +48,8 @@ import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
|
||||
import net.minecraft.block.properties.PropertyEnum;
|
||||
import net.minecraft.block.state.BlockState;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.Entity;
|
||||
@@ -106,6 +77,7 @@ import net.minecraftforge.fluids.FluidContainerRegistry;
|
||||
import net.minecraftforge.fluids.FluidRegistry;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import buildcraft.api.tools.IToolWrench;
|
||||
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
@@ -151,21 +123,55 @@ import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
* @author AidanBrady
|
||||
*
|
||||
*/
|
||||
public class BlockMachine extends BlockContainer implements ISpecialBounds//, IBlockCTM, ICustomBlockIcon
|
||||
public abstract class BlockMachine extends BlockContainer implements ISpecialBounds//, IBlockCTM, ICustomBlockIcon
|
||||
{
|
||||
//public CTMData[][] ctms = new CTMData[16][4];
|
||||
|
||||
public MachineBlock blockType;
|
||||
|
||||
public BlockMachine(MachineBlock type)
|
||||
public BlockMachine()
|
||||
{
|
||||
super(Material.iron);
|
||||
setHardness(3.5F);
|
||||
setResistance(16F);
|
||||
setCreativeTab(Mekanism.tabMekanism);
|
||||
blockType = type;
|
||||
}
|
||||
|
||||
public static BlockMachine getBlockMachine(MachineBlock block)
|
||||
{
|
||||
return new BlockMachine() {
|
||||
@Override
|
||||
public MachineBlock getMachineBlock()
|
||||
{
|
||||
return block;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
public abstract MachineBlock getMachineBlock();
|
||||
|
||||
public BlockState createBlockState()
|
||||
{
|
||||
return new BlockStateMachine(this, getProperty());
|
||||
}
|
||||
|
||||
public PropertyEnum<MachineType> getProperty()
|
||||
{
|
||||
return getMachineBlock().getProperty();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBlockState getStateFromMeta(int meta)
|
||||
{
|
||||
MachineType type = MachineType.get(getMachineBlock(), meta&0xF);
|
||||
|
||||
return this.getDefaultState().withProperty(getProperty(), type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetaFromState(IBlockState state)
|
||||
{
|
||||
MachineType type = state.getValue(getProperty());
|
||||
return type.meta;
|
||||
}
|
||||
/*
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
@@ -493,9 +499,9 @@ public class BlockMachine extends BlockContainer implements ISpecialBounds//, IB
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubBlocks(Item item, CreativeTabs creativetabs, List<ItemStack> list)
|
||||
{
|
||||
for(MachineType type : MachineType.getValidMachines())
|
||||
for(MachineType type : BlockStateMachine.MachineType.getValidMachines())
|
||||
{
|
||||
if(type.typeBlock == blockType && type.isEnabled())
|
||||
if(type.typeBlock == getMachineBlock() && type.isEnabled())
|
||||
{
|
||||
switch(type)
|
||||
{
|
||||
@@ -558,7 +564,7 @@ public class BlockMachine extends BlockContainer implements ISpecialBounds//, IB
|
||||
|
||||
if(MekanismUtils.hasUsableWrench(entityplayer, pos))
|
||||
{
|
||||
if(entityplayer.isSneaking() && MachineType.get(blockType, metadata) != MachineType.ELECTRIC_CHEST)
|
||||
if(entityplayer.isSneaking() && BlockStateMachine.MachineType.get(getMachineBlock(), metadata) != BlockStateMachine.MachineType.ELECTRIC_CHEST)
|
||||
{
|
||||
dismantleBlock(world, pos, false);
|
||||
return true;
|
||||
@@ -596,7 +602,7 @@ public class BlockMachine extends BlockContainer implements ISpecialBounds//, IB
|
||||
|
||||
if(tileEntity != null)
|
||||
{
|
||||
MachineType type = MachineType.get(blockType, metadata);
|
||||
MachineType type = BlockStateMachine.MachineType.get(getMachineBlock(), metadata);
|
||||
|
||||
switch(type)
|
||||
{
|
||||
@@ -675,12 +681,12 @@ public class BlockMachine extends BlockContainer implements ISpecialBounds//, IB
|
||||
public TileEntity createTileEntity(World world, IBlockState state)
|
||||
{
|
||||
int metadata = getMetaFromState(state);
|
||||
if(MachineType.get(blockType, metadata) == null)
|
||||
if(BlockStateMachine.MachineType.get(getMachineBlock(), metadata) == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
return MachineType.get(blockType, metadata).create();
|
||||
return BlockStateMachine.MachineType.get(getMachineBlock(), metadata).create();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -711,7 +717,7 @@ public class BlockMachine extends BlockContainer implements ISpecialBounds//, IB
|
||||
public float getBlockHardness(World world, BlockPos pos)
|
||||
{
|
||||
IBlockState state = world.getBlockState(pos);
|
||||
if(MachineType.get(blockType, state.getBlock().getMetaFromState(state)) != MachineType.ELECTRIC_CHEST)
|
||||
if(BlockStateMachine.MachineType.get(getMachineBlock(), state.getBlock().getMetaFromState(state)) != BlockStateMachine.MachineType.ELECTRIC_CHEST)
|
||||
{
|
||||
return blockHardness;
|
||||
}
|
||||
@@ -725,7 +731,7 @@ public class BlockMachine extends BlockContainer implements ISpecialBounds//, IB
|
||||
public float getExplosionResistance(World world, BlockPos pos, Entity exploder, Explosion explosion)
|
||||
{
|
||||
IBlockState state = world.getBlockState(pos);
|
||||
if(MachineType.get(blockType, state.getBlock().getMetaFromState(state)) != MachineType.ELECTRIC_CHEST)
|
||||
if(BlockStateMachine.MachineType.get(getMachineBlock(), state.getBlock().getMetaFromState(state)) != BlockStateMachine.MachineType.ELECTRIC_CHEST)
|
||||
{
|
||||
return blockResistance;
|
||||
}
|
||||
@@ -991,7 +997,7 @@ public class BlockMachine extends BlockContainer implements ISpecialBounds//, IB
|
||||
public boolean canConnectRedstone(IBlockAccess world, BlockPos pos, EnumFacing side)
|
||||
{
|
||||
IBlockState state = world.getBlockState(pos);
|
||||
MachineType type = MachineType.get(blockType, state.getBlock().getMetaFromState(state));
|
||||
MachineType type = BlockStateMachine.MachineType.get(getMachineBlock(), state.getBlock().getMetaFromState(state));
|
||||
|
||||
switch(type)
|
||||
{
|
||||
@@ -1027,7 +1033,7 @@ public class BlockMachine extends BlockContainer implements ISpecialBounds//, IB
|
||||
public void setBlockBoundsBasedOnState(IBlockAccess world, BlockPos pos)
|
||||
{
|
||||
IBlockState state = world.getBlockState(pos);
|
||||
MachineType type = MachineType.get(blockType, state.getBlock().getMetaFromState(state));
|
||||
MachineType type = BlockStateMachine.MachineType.get(getMachineBlock(), state.getBlock().getMetaFromState(state));
|
||||
|
||||
switch(type)
|
||||
{
|
||||
@@ -1058,7 +1064,7 @@ public class BlockMachine extends BlockContainer implements ISpecialBounds//, IB
|
||||
public boolean isSideSolid(IBlockAccess world, BlockPos pos, EnumFacing side)
|
||||
{
|
||||
IBlockState state = world.getBlockState(pos);
|
||||
MachineType type = MachineType.get(blockType, state.getBlock().getMetaFromState(state));
|
||||
MachineType type = BlockStateMachine.MachineType.get(getMachineBlock(), state.getBlock().getMetaFromState(state));
|
||||
|
||||
switch(type)
|
||||
{
|
||||
@@ -1072,268 +1078,6 @@ public class BlockMachine extends BlockContainer implements ISpecialBounds//, IB
|
||||
}
|
||||
}
|
||||
|
||||
public static enum MachineBlock
|
||||
{
|
||||
MACHINE_BLOCK_1,
|
||||
MACHINE_BLOCK_2,
|
||||
MACHINE_BLOCK_3;
|
||||
|
||||
public Block getBlock()
|
||||
{
|
||||
switch(this)
|
||||
{
|
||||
case MACHINE_BLOCK_1:
|
||||
return MekanismBlocks.MachineBlock;
|
||||
case MACHINE_BLOCK_2:
|
||||
return MekanismBlocks.MachineBlock2;
|
||||
case MACHINE_BLOCK_3:
|
||||
return MekanismBlocks.MachineBlock3;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static enum MachineType
|
||||
{
|
||||
ENRICHMENT_CHAMBER(MachineBlock.MACHINE_BLOCK_1, 0, "EnrichmentChamber", 3, TileEntityEnrichmentChamber.class, true, false, true),
|
||||
OSMIUM_COMPRESSOR(MachineBlock.MACHINE_BLOCK_1, 1, "OsmiumCompressor", 4, TileEntityOsmiumCompressor.class, true, false, true),
|
||||
COMBINER(MachineBlock.MACHINE_BLOCK_1, 2, "Combiner", 5, TileEntityCombiner.class, true, false, true),
|
||||
CRUSHER(MachineBlock.MACHINE_BLOCK_1, 3, "Crusher", 6, TileEntityCrusher.class, true, false, true),
|
||||
DIGITAL_MINER(MachineBlock.MACHINE_BLOCK_1, 4, "DigitalMiner", 2, TileEntityDigitalMiner.class, true, true, true),
|
||||
BASIC_FACTORY(MachineBlock.MACHINE_BLOCK_1, 5, "Factory", 11, TileEntityFactory.class, true, false, true),
|
||||
ADVANCED_FACTORY(MachineBlock.MACHINE_BLOCK_1, 6, "Factory", 11, TileEntityAdvancedFactory.class, true, false, true),
|
||||
ELITE_FACTORY(MachineBlock.MACHINE_BLOCK_1, 7, "Factory", 11, TileEntityEliteFactory.class, true, false, true),
|
||||
METALLURGIC_INFUSER(MachineBlock.MACHINE_BLOCK_1, 8, "MetallurgicInfuser", 12, TileEntityMetallurgicInfuser.class, true, true, true),
|
||||
PURIFICATION_CHAMBER(MachineBlock.MACHINE_BLOCK_1, 9, "PurificationChamber", 15, TileEntityPurificationChamber.class, true, false, true),
|
||||
ENERGIZED_SMELTER(MachineBlock.MACHINE_BLOCK_1, 10, "EnergizedSmelter", 16, TileEntityEnergizedSmelter.class, true, false, true),
|
||||
TELEPORTER(MachineBlock.MACHINE_BLOCK_1, 11, "Teleporter", 13, TileEntityTeleporter.class, true, false, false),
|
||||
ELECTRIC_PUMP(MachineBlock.MACHINE_BLOCK_1, 12, "ElectricPump", 17, TileEntityElectricPump.class, true, true, false),
|
||||
ELECTRIC_CHEST(MachineBlock.MACHINE_BLOCK_1, 13, "ElectricChest", -1, TileEntityElectricChest.class, true, true, false),
|
||||
CHARGEPAD(MachineBlock.MACHINE_BLOCK_1, 14, "Chargepad", -1, TileEntityChargepad.class, true, true, false),
|
||||
LOGISTICAL_SORTER(MachineBlock.MACHINE_BLOCK_1, 15, "LogisticalSorter", -1, TileEntityLogisticalSorter.class, false, true, false),
|
||||
ROTARY_CONDENSENTRATOR(MachineBlock.MACHINE_BLOCK_2, 0, "RotaryCondensentrator", 7, TileEntityRotaryCondensentrator.class, true, true, false),
|
||||
CHEMICAL_OXIDIZER(MachineBlock.MACHINE_BLOCK_2, 1, "ChemicalOxidizer", 29, TileEntityChemicalOxidizer.class, true, true, true),
|
||||
CHEMICAL_INFUSER(MachineBlock.MACHINE_BLOCK_2, 2, "ChemicalInfuser", 30, TileEntityChemicalInfuser.class, true, true, false),
|
||||
CHEMICAL_INJECTION_CHAMBER(MachineBlock.MACHINE_BLOCK_2, 3, "ChemicalInjectionChamber", 31, TileEntityChemicalInjectionChamber.class, true, false, true),
|
||||
ELECTROLYTIC_SEPARATOR(MachineBlock.MACHINE_BLOCK_2, 4, "ElectrolyticSeparator", 32, TileEntityElectrolyticSeparator.class, true, true, false),
|
||||
PRECISION_SAWMILL(MachineBlock.MACHINE_BLOCK_2, 5, "PrecisionSawmill", 34, TileEntityPrecisionSawmill.class, true, false, true),
|
||||
CHEMICAL_DISSOLUTION_CHAMBER(MachineBlock.MACHINE_BLOCK_2, 6, "ChemicalDissolutionChamber", 35, TileEntityChemicalDissolutionChamber.class, true, true, true),
|
||||
CHEMICAL_WASHER(MachineBlock.MACHINE_BLOCK_2, 7, "ChemicalWasher", 36, TileEntityChemicalWasher.class, true, true, false),
|
||||
CHEMICAL_CRYSTALLIZER(MachineBlock.MACHINE_BLOCK_2, 8, "ChemicalCrystallizer", 37, TileEntityChemicalCrystallizer.class, true, true, true),
|
||||
SEISMIC_VIBRATOR(MachineBlock.MACHINE_BLOCK_2, 9, "SeismicVibrator", 39, TileEntitySeismicVibrator.class, true, true, false),
|
||||
PRESSURIZED_REACTION_CHAMBER(MachineBlock.MACHINE_BLOCK_2, 10, "PressurizedReactionChamber", 40, TileEntityPRC.class, true, true, false),
|
||||
PORTABLE_TANK(MachineBlock.MACHINE_BLOCK_2, 11, "PortableTank", 41, TileEntityPortableTank.class, false, true, false),
|
||||
FLUIDIC_PLENISHER(MachineBlock.MACHINE_BLOCK_2, 12, "FluidicPlenisher", 42, TileEntityFluidicPlenisher.class, true, true, false),
|
||||
LASER(MachineBlock.MACHINE_BLOCK_2, 13, "Laser", -1, TileEntityLaser.class, true, true, false),
|
||||
LASER_AMPLIFIER(MachineBlock.MACHINE_BLOCK_2, 14, "LaserAmplifier", 44, TileEntityLaserAmplifier.class, false, true, false),
|
||||
LASER_TRACTOR_BEAM(MachineBlock.MACHINE_BLOCK_2, 15, "LaserTractorBeam", 45, TileEntityLaserTractorBeam.class, false, true, false),
|
||||
ENTANGLED_BLOCK(MachineBlock.MACHINE_BLOCK_3, 0, "EntangledBlock", 46, TileEntityEntangledBlock.class, true, false, false),
|
||||
SOLAR_NEUTRON_ACTIVATOR(MachineBlock.MACHINE_BLOCK_3, 1, "SolarNeutronActivator", 47, TileEntitySolarNeutronActivator.class, false, true, false),
|
||||
AMBIENT_ACCUMULATOR(MachineBlock.MACHINE_BLOCK_3, 2, "AmbientAccumulator", 48, TileEntityAmbientAccumulator.class, true, false, false),
|
||||
OREDICTIONIFICATOR(MachineBlock.MACHINE_BLOCK_3, 3, "Oredictionificator", 52, TileEntityOredictionificator.class, false, false, false);
|
||||
|
||||
public MachineBlock typeBlock;
|
||||
public int meta;
|
||||
public String name;
|
||||
public int guiId;
|
||||
public double baseEnergy;
|
||||
public Class<? extends TileEntity> tileEntityClass;
|
||||
public boolean isElectric;
|
||||
public boolean hasModel;
|
||||
public boolean supportsUpgrades;
|
||||
public Collection<ShapedMekanismRecipe> machineRecipes = new HashSet<ShapedMekanismRecipe>();
|
||||
|
||||
private MachineType(MachineBlock block, int i, String s, int j, Class<? extends TileEntity> tileClass, boolean electric, boolean model, boolean upgrades)
|
||||
{
|
||||
typeBlock = block;
|
||||
meta = i;
|
||||
name = s;
|
||||
guiId = j;
|
||||
tileEntityClass = tileClass;
|
||||
isElectric = electric;
|
||||
hasModel = model;
|
||||
supportsUpgrades = upgrades;
|
||||
}
|
||||
|
||||
public boolean isEnabled()
|
||||
{
|
||||
return machines.isEnabled(this.name);
|
||||
}
|
||||
|
||||
public void addRecipes(Collection<ShapedMekanismRecipe> recipes)
|
||||
{
|
||||
machineRecipes.addAll(recipes);
|
||||
}
|
||||
|
||||
public void addRecipe(ShapedMekanismRecipe recipe)
|
||||
{
|
||||
machineRecipes.add(recipe);
|
||||
}
|
||||
|
||||
public Collection<ShapedMekanismRecipe> getRecipes()
|
||||
{
|
||||
return machineRecipes;
|
||||
}
|
||||
|
||||
public static List<MachineType> getValidMachines()
|
||||
{
|
||||
List<MachineType> ret = new ArrayList<MachineType>();
|
||||
|
||||
for(MachineType type : MachineType.values())
|
||||
{
|
||||
if(type != ENTANGLED_BLOCK && type != AMBIENT_ACCUMULATOR)
|
||||
{
|
||||
ret.add(type);
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
public static MachineType get(Block block, int meta)
|
||||
{
|
||||
if(block instanceof BlockMachine)
|
||||
{
|
||||
return get(((BlockMachine)block).blockType, meta);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public static MachineType get(MachineBlock block, int meta)
|
||||
{
|
||||
for(MachineType type : values())
|
||||
{
|
||||
if(type.meta == meta && type.typeBlock == block)
|
||||
{
|
||||
return type;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public TileEntity create()
|
||||
{
|
||||
try {
|
||||
return tileEntityClass.newInstance();
|
||||
} catch(Exception e) {
|
||||
Mekanism.logger.error("Unable to indirectly create tile entity.");
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/** Used for getting the base energy storage. */
|
||||
public double getUsage()
|
||||
{
|
||||
switch(this)
|
||||
{
|
||||
case ENRICHMENT_CHAMBER:
|
||||
return usage.enrichmentChamberUsage;
|
||||
case OSMIUM_COMPRESSOR:
|
||||
return usage.osmiumCompressorUsage;
|
||||
case COMBINER:
|
||||
return usage.combinerUsage;
|
||||
case CRUSHER:
|
||||
return usage.crusherUsage;
|
||||
case DIGITAL_MINER:
|
||||
return usage.digitalMinerUsage;
|
||||
case BASIC_FACTORY:
|
||||
return usage.factoryUsage * 3;
|
||||
case ADVANCED_FACTORY:
|
||||
return usage.factoryUsage * 5;
|
||||
case ELITE_FACTORY:
|
||||
return usage.factoryUsage * 7;
|
||||
case METALLURGIC_INFUSER:
|
||||
return usage.metallurgicInfuserUsage;
|
||||
case PURIFICATION_CHAMBER:
|
||||
return usage.purificationChamberUsage;
|
||||
case ENERGIZED_SMELTER:
|
||||
return usage.energizedSmelterUsage;
|
||||
case TELEPORTER:
|
||||
return 12500;
|
||||
case ELECTRIC_PUMP:
|
||||
return usage.electricPumpUsage;
|
||||
case ELECTRIC_CHEST:
|
||||
return 30;
|
||||
case CHARGEPAD:
|
||||
return 25;
|
||||
case LOGISTICAL_SORTER:
|
||||
return 0;
|
||||
case ROTARY_CONDENSENTRATOR:
|
||||
return usage.rotaryCondensentratorUsage;
|
||||
case CHEMICAL_OXIDIZER:
|
||||
return usage.oxidationChamberUsage;
|
||||
case CHEMICAL_INFUSER:
|
||||
return usage.chemicalInfuserUsage;
|
||||
case CHEMICAL_INJECTION_CHAMBER:
|
||||
return usage.chemicalInjectionChamberUsage;
|
||||
case ELECTROLYTIC_SEPARATOR:
|
||||
return general.FROM_H2 * 2;
|
||||
case PRECISION_SAWMILL:
|
||||
return usage.precisionSawmillUsage;
|
||||
case CHEMICAL_DISSOLUTION_CHAMBER:
|
||||
return usage.chemicalDissolutionChamberUsage;
|
||||
case CHEMICAL_WASHER:
|
||||
return usage.chemicalWasherUsage;
|
||||
case CHEMICAL_CRYSTALLIZER:
|
||||
return usage.chemicalCrystallizerUsage;
|
||||
case SEISMIC_VIBRATOR:
|
||||
return usage.seismicVibratorUsage;
|
||||
case PRESSURIZED_REACTION_CHAMBER:
|
||||
return usage.pressurizedReactionBaseUsage;
|
||||
case PORTABLE_TANK:
|
||||
return 0;
|
||||
case FLUIDIC_PLENISHER:
|
||||
return usage.fluidicPlenisherUsage;
|
||||
case LASER:
|
||||
return usage.laserUsage;
|
||||
case LASER_AMPLIFIER:
|
||||
return 0;
|
||||
case LASER_TRACTOR_BEAM:
|
||||
return 0;
|
||||
case ENTANGLED_BLOCK:
|
||||
return 0;
|
||||
case SOLAR_NEUTRON_ACTIVATOR:
|
||||
return 0;
|
||||
case AMBIENT_ACCUMULATOR:
|
||||
return 0;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
public static void updateAllUsages()
|
||||
{
|
||||
for(MachineType type : values())
|
||||
{
|
||||
type.updateUsage();
|
||||
}
|
||||
}
|
||||
|
||||
public void updateUsage()
|
||||
{
|
||||
baseEnergy = 400 * getUsage();
|
||||
}
|
||||
|
||||
public String getDescription()
|
||||
{
|
||||
return LangUtils.localize("tooltip." + name);
|
||||
}
|
||||
|
||||
public ItemStack getStack()
|
||||
{
|
||||
return new ItemStack(typeBlock.getBlock(), 1, meta);
|
||||
}
|
||||
|
||||
public static MachineType get(ItemStack stack)
|
||||
{
|
||||
return get(Block.getBlockFromItem(stack.getItem()), stack.getItemDamage());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRenderBounds(Block block, int metadata) {}
|
||||
|
||||
@@ -1396,7 +1140,6 @@ public class BlockMachine extends BlockContainer implements ISpecialBounds//, IB
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
@Override
|
||||
public CTMData getCTMData(IBlockAccess world, BlockPos pos, int meta)
|
||||
|
||||
@@ -0,0 +1,193 @@
|
||||
package mekanism.common.block.states;
|
||||
|
||||
import mekanism.common.MekanismBlocks;
|
||||
import mekanism.common.block.BlockBasic;
|
||||
import mekanism.common.block.BlockMachine;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.properties.PropertyBool;
|
||||
import net.minecraft.block.properties.PropertyEnum;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.renderer.block.statemap.StateMapperBase;
|
||||
import net.minecraft.client.resources.model.ModelResourceLocation;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.EnumFacing.Plane;
|
||||
import net.minecraft.util.IStringSerializable;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import com.google.common.base.Predicate;
|
||||
import com.google.common.base.Predicates;
|
||||
|
||||
public class BlockStateBasic extends BlockStateFacing
|
||||
{
|
||||
public static final PropertyBool activeProperty = PropertyBool.create("active");
|
||||
|
||||
public BlockStateBasic(BlockBasic block, PropertyEnum typeProperty)
|
||||
{
|
||||
super(block, typeProperty);
|
||||
}
|
||||
|
||||
public static enum BasicBlock
|
||||
{
|
||||
BASIC_BLOCK_1,
|
||||
BASIC_BLOCK_2;
|
||||
|
||||
public BlockBasic implBlock;
|
||||
private PropertyEnum<BasicBlockType> predicatedProperty;
|
||||
|
||||
public PropertyEnum<BasicBlockType> getProperty()
|
||||
{
|
||||
if(predicatedProperty == null)
|
||||
{
|
||||
predicatedProperty = PropertyEnum.create("type", BasicBlockType.class, new BasicBlockPredicate(this));
|
||||
}
|
||||
return predicatedProperty;
|
||||
}
|
||||
|
||||
public Block getBlock()
|
||||
{
|
||||
switch(this)
|
||||
{
|
||||
case BASIC_BLOCK_1:
|
||||
return MekanismBlocks.BasicBlock;
|
||||
case BASIC_BLOCK_2:
|
||||
return MekanismBlocks.BasicBlock2;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static enum BasicBlockType implements IStringSerializable
|
||||
{
|
||||
OSMIUM_BLOCK(BasicBlock.BASIC_BLOCK_1, 0, Predicates.<EnumFacing>alwaysFalse(), false),
|
||||
BRONZE_BLOCK(BasicBlock.BASIC_BLOCK_1, 1, Predicates.<EnumFacing>alwaysFalse(), false),
|
||||
REFINED_OBSIDIAN(BasicBlock.BASIC_BLOCK_1, 2, Predicates.<EnumFacing>alwaysFalse(), false),
|
||||
COAL_BLOCK(BasicBlock.BASIC_BLOCK_1, 3, Predicates.<EnumFacing>alwaysFalse(), false),
|
||||
REFINED_GLOWSTONE(BasicBlock.BASIC_BLOCK_1, 4, Predicates.<EnumFacing>alwaysFalse(), false),
|
||||
STEEL_BLOCK(BasicBlock.BASIC_BLOCK_1, 5, Predicates.<EnumFacing>alwaysFalse(), false),
|
||||
BIN(BasicBlock.BASIC_BLOCK_1, 6, Plane.HORIZONTAL, false),
|
||||
TELEPORTER_FRAME(BasicBlock.BASIC_BLOCK_1, 7, Predicates.<EnumFacing>alwaysFalse(), false),
|
||||
STEEL_CASING(BasicBlock.BASIC_BLOCK_1, 8, Predicates.<EnumFacing>alwaysFalse(), false),
|
||||
DYNAMIC_TANK(BasicBlock.BASIC_BLOCK_1, 9, Predicates.<EnumFacing>alwaysFalse(), false),
|
||||
DYNAMIC_GLASS(BasicBlock.BASIC_BLOCK_1, 10, Predicates.<EnumFacing>alwaysFalse(), false),
|
||||
DYNAMIC_VALVE(BasicBlock.BASIC_BLOCK_1, 11, Predicates.<EnumFacing>alwaysFalse(), false),
|
||||
COPPER_BLOCK(BasicBlock.BASIC_BLOCK_1, 12, Predicates.<EnumFacing>alwaysFalse(), false),
|
||||
TIN_BLOCK(BasicBlock.BASIC_BLOCK_1, 13, Predicates.<EnumFacing>alwaysFalse(), false),
|
||||
SALINATION_CONTROLLER(BasicBlock.BASIC_BLOCK_1, 14, Plane.HORIZONTAL, false),
|
||||
SALINATION_VALVE(BasicBlock.BASIC_BLOCK_1, 15, Predicates.<EnumFacing>alwaysFalse(), false),
|
||||
SALINATION_BLOCK(BasicBlock.BASIC_BLOCK_2, 0, Predicates.<EnumFacing>alwaysFalse(), false);
|
||||
|
||||
public BasicBlock blockType;
|
||||
public int meta;
|
||||
public Predicate<EnumFacing> facingPredicate;
|
||||
public boolean activable;
|
||||
|
||||
private BasicBlockType(BasicBlock block, int metadata, Predicate<EnumFacing> facingAllowed, boolean activeState)
|
||||
{
|
||||
blockType = block;
|
||||
meta = metadata;
|
||||
facingPredicate = facingAllowed;
|
||||
activable = activeState;
|
||||
}
|
||||
|
||||
public static BasicBlockType getBlockType(BasicBlock blockID, int metadata)
|
||||
{
|
||||
BasicBlockType firstTry = values()[blockID.ordinal() << 4 | metadata];
|
||||
if(firstTry.blockType == blockID && firstTry.meta == metadata)
|
||||
return firstTry;
|
||||
for(BasicBlockType type : values())
|
||||
{
|
||||
if(type.blockType == blockID && type.meta == metadata)
|
||||
return type;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName()
|
||||
{
|
||||
return name().toLowerCase();
|
||||
}
|
||||
|
||||
public ItemStack getStack(int amount)
|
||||
{
|
||||
return new ItemStack(blockType.implBlock, amount, meta);
|
||||
}
|
||||
|
||||
public boolean canRotateTo(EnumFacing side)
|
||||
{
|
||||
return facingPredicate.apply(side);
|
||||
}
|
||||
|
||||
public boolean hasRotations()
|
||||
{
|
||||
return !facingPredicate.equals(Predicates.alwaysFalse());
|
||||
}
|
||||
|
||||
public boolean hasActiveTexture()
|
||||
{
|
||||
return activable;
|
||||
}
|
||||
}
|
||||
|
||||
public static class BasicBlockPredicate implements Predicate<BasicBlockType>
|
||||
{
|
||||
public BasicBlock basicBlock;
|
||||
|
||||
public BasicBlockPredicate(BasicBlock type)
|
||||
{
|
||||
basicBlock = type;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(BasicBlockType input)
|
||||
{
|
||||
return input.blockType == basicBlock;
|
||||
}
|
||||
}
|
||||
|
||||
public static class BasicBlockStateMapper extends StateMapperBase
|
||||
{
|
||||
@Override
|
||||
protected ModelResourceLocation getModelResourceLocation(IBlockState state)
|
||||
{
|
||||
BlockBasic block = (BlockBasic)state.getBlock();
|
||||
BasicBlockType type = state.getValue(block.getProperty());
|
||||
StringBuilder builder = new StringBuilder();
|
||||
if(type.hasRotations())
|
||||
{
|
||||
EnumFacing facing = state.getValue(facingProperty);
|
||||
if(type.canRotateTo(facing))
|
||||
{
|
||||
builder.append(facingProperty.getName());
|
||||
builder.append("=");
|
||||
builder.append(facing.getName());
|
||||
}
|
||||
else
|
||||
{
|
||||
return new ModelResourceLocation("builtin/missing", "missing");
|
||||
}
|
||||
}
|
||||
if(type.hasActiveTexture())
|
||||
{
|
||||
String active = state.getValue(activeProperty) ? "active" : "inactive";
|
||||
if(builder.length() > 0)
|
||||
{
|
||||
builder.append(",");
|
||||
}
|
||||
builder.append(active);
|
||||
}
|
||||
|
||||
if(builder.length() == 0)
|
||||
{
|
||||
builder.append("normal");
|
||||
}
|
||||
|
||||
ResourceLocation baseLocation = new ResourceLocation("mekanism", type.getName());
|
||||
return new ModelResourceLocation(baseLocation, builder.toString());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package mekanism.common.block.states;
|
||||
|
||||
import mekanism.common.MekanismBlocks;
|
||||
import mekanism.common.block.BlockBounding;
|
||||
|
||||
import net.minecraft.block.properties.PropertyBool;
|
||||
import net.minecraft.block.state.BlockState;
|
||||
|
||||
public class BlockStateBounding extends BlockState
|
||||
{
|
||||
public static PropertyBool advancedProperty = PropertyBool.create("advanced");
|
||||
|
||||
public BlockStateBounding(BlockBounding block)
|
||||
{
|
||||
super(block, advancedProperty);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package mekanism.common.block.states;
|
||||
|
||||
import mekanism.common.MekanismBlocks;
|
||||
import mekanism.common.Tier;
|
||||
import mekanism.common.block.BlockEnergyCube;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.properties.PropertyEnum;
|
||||
|
||||
/**
|
||||
* Created by ben on 23/12/14.
|
||||
*/
|
||||
public class BlockStateEnergyCube extends BlockStateFacing
|
||||
{
|
||||
public static final PropertyEnum typeProperty = PropertyEnum.create("tier", Tier.EnergyCubeTier.class);
|
||||
|
||||
public BlockStateEnergyCube(BlockEnergyCube block)
|
||||
{
|
||||
super(block, typeProperty);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package mekanism.common.block.states;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.properties.PropertyBool;
|
||||
import net.minecraft.block.properties.PropertyDirection;
|
||||
import net.minecraft.block.properties.PropertyEnum;
|
||||
import net.minecraft.block.state.BlockState;
|
||||
|
||||
public class BlockStateFacing extends BlockState
|
||||
{
|
||||
public static final PropertyDirection facingProperty = PropertyDirection.create("facing");
|
||||
|
||||
public BlockStateFacing(Block block, PropertyEnum typeProperty, PropertyBool activeProperty)
|
||||
{
|
||||
super(block, facingProperty, typeProperty, activeProperty);
|
||||
}
|
||||
|
||||
public BlockStateFacing(Block block, PropertyEnum typeProperty)
|
||||
{
|
||||
super(block, facingProperty, typeProperty);
|
||||
}
|
||||
|
||||
public BlockStateFacing(Block block)
|
||||
{
|
||||
super(block, facingProperty);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package mekanism.common.block.states;
|
||||
|
||||
import mekanism.common.MekanismBlocks;
|
||||
import mekanism.common.block.BlockGasTank;
|
||||
|
||||
|
||||
/**
|
||||
* Created by ben on 23/12/14.
|
||||
*/
|
||||
public class BlockStateGasTank extends BlockStateFacing
|
||||
{
|
||||
|
||||
public BlockStateGasTank(BlockGasTank block)
|
||||
{
|
||||
super(block);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,438 @@
|
||||
package mekanism.common.block.states;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
|
||||
import mekanism.api.MekanismConfig.general;
|
||||
import mekanism.api.MekanismConfig.machines;
|
||||
import mekanism.api.MekanismConfig.usage;
|
||||
import mekanism.common.Mekanism;
|
||||
import mekanism.common.MekanismBlocks;
|
||||
import mekanism.common.block.BlockMachine;
|
||||
import mekanism.common.recipe.ShapedMekanismRecipe;
|
||||
import mekanism.common.tile.TileEntityAdvancedFactory;
|
||||
import mekanism.common.tile.TileEntityAmbientAccumulator;
|
||||
import mekanism.common.tile.TileEntityChargepad;
|
||||
import mekanism.common.tile.TileEntityChemicalCrystallizer;
|
||||
import mekanism.common.tile.TileEntityChemicalDissolutionChamber;
|
||||
import mekanism.common.tile.TileEntityChemicalInfuser;
|
||||
import mekanism.common.tile.TileEntityChemicalInjectionChamber;
|
||||
import mekanism.common.tile.TileEntityChemicalOxidizer;
|
||||
import mekanism.common.tile.TileEntityChemicalWasher;
|
||||
import mekanism.common.tile.TileEntityCombiner;
|
||||
import mekanism.common.tile.TileEntityCrusher;
|
||||
import mekanism.common.tile.TileEntityDigitalMiner;
|
||||
import mekanism.common.tile.TileEntityElectricChest;
|
||||
import mekanism.common.tile.TileEntityElectricPump;
|
||||
import mekanism.common.tile.TileEntityElectrolyticSeparator;
|
||||
import mekanism.common.tile.TileEntityEliteFactory;
|
||||
import mekanism.common.tile.TileEntityEnergizedSmelter;
|
||||
import mekanism.common.tile.TileEntityEnrichmentChamber;
|
||||
import mekanism.common.tile.TileEntityEntangledBlock;
|
||||
import mekanism.common.tile.TileEntityFactory;
|
||||
import mekanism.common.tile.TileEntityFluidicPlenisher;
|
||||
import mekanism.common.tile.TileEntityLaser;
|
||||
import mekanism.common.tile.TileEntityLaserAmplifier;
|
||||
import mekanism.common.tile.TileEntityLaserTractorBeam;
|
||||
import mekanism.common.tile.TileEntityLogisticalSorter;
|
||||
import mekanism.common.tile.TileEntityMetallurgicInfuser;
|
||||
import mekanism.common.tile.TileEntityOredictionificator;
|
||||
import mekanism.common.tile.TileEntityOsmiumCompressor;
|
||||
import mekanism.common.tile.TileEntityPRC;
|
||||
import mekanism.common.tile.TileEntityPortableTank;
|
||||
import mekanism.common.tile.TileEntityPrecisionSawmill;
|
||||
import mekanism.common.tile.TileEntityPurificationChamber;
|
||||
import mekanism.common.tile.TileEntityRotaryCondensentrator;
|
||||
import mekanism.common.tile.TileEntitySeismicVibrator;
|
||||
import mekanism.common.tile.TileEntitySolarNeutronActivator;
|
||||
import mekanism.common.tile.TileEntityTeleporter;
|
||||
import mekanism.common.util.LangUtils;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.properties.PropertyBool;
|
||||
import net.minecraft.block.properties.PropertyEnum;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.renderer.block.statemap.StateMapperBase;
|
||||
import net.minecraft.client.resources.model.ModelResourceLocation;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.EnumFacing.Plane;
|
||||
import net.minecraft.util.IStringSerializable;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import com.google.common.base.Predicate;
|
||||
import com.google.common.base.Predicates;
|
||||
|
||||
public class BlockStateMachine extends BlockStateFacing
|
||||
{
|
||||
public static final PropertyBool activeProperty = PropertyBool.create("active");
|
||||
|
||||
public BlockStateMachine(BlockMachine block, PropertyEnum typeProperty)
|
||||
{
|
||||
super(block, typeProperty, activeProperty);
|
||||
}
|
||||
|
||||
public static final Predicate<EnumFacing> never = Predicates.<EnumFacing>alwaysFalse();
|
||||
public static final Predicate<EnumFacing> always = Predicates.<EnumFacing>alwaysTrue();
|
||||
|
||||
public static enum MachineBlock
|
||||
{
|
||||
MACHINE_BLOCK_1,
|
||||
MACHINE_BLOCK_2,
|
||||
MACHINE_BLOCK_3;
|
||||
|
||||
PropertyEnum<MachineType> machineTypeProperty;
|
||||
|
||||
public PropertyEnum<MachineType> getProperty()
|
||||
{
|
||||
if(machineTypeProperty == null)
|
||||
{
|
||||
machineTypeProperty = PropertyEnum.create("machineType", MachineType.class, new MachineBlockPredicate(this));
|
||||
}
|
||||
|
||||
return machineTypeProperty;
|
||||
}
|
||||
|
||||
public Block getBlock()
|
||||
{
|
||||
switch(this)
|
||||
{
|
||||
case MACHINE_BLOCK_1:
|
||||
return MekanismBlocks.MachineBlock;
|
||||
case MACHINE_BLOCK_2:
|
||||
return MekanismBlocks.MachineBlock2;
|
||||
case MACHINE_BLOCK_3:
|
||||
return MekanismBlocks.MachineBlock3;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static enum MachineType implements IStringSerializable
|
||||
{
|
||||
ENRICHMENT_CHAMBER(MachineBlock.MACHINE_BLOCK_1, 0, "EnrichmentChamber", 3, TileEntityEnrichmentChamber.class, true, false, true, Plane.HORIZONTAL, true),
|
||||
OSMIUM_COMPRESSOR(MachineBlock.MACHINE_BLOCK_1, 1, "OsmiumCompressor", 4, TileEntityOsmiumCompressor.class, true, false, true, Plane.HORIZONTAL, true),
|
||||
COMBINER(MachineBlock.MACHINE_BLOCK_1, 2, "Combiner", 5, TileEntityCombiner.class, true, false, true, Plane.HORIZONTAL, true),
|
||||
CRUSHER(MachineBlock.MACHINE_BLOCK_1, 3, "Crusher", 6, TileEntityCrusher.class, true, false, true, Plane.HORIZONTAL, true),
|
||||
DIGITAL_MINER(MachineBlock.MACHINE_BLOCK_1, 4, "DigitalMiner", 2, TileEntityDigitalMiner.class, true, true, true, Plane.HORIZONTAL, true),
|
||||
BASIC_FACTORY(MachineBlock.MACHINE_BLOCK_1, 5, "Factory", 11, TileEntityFactory.class, true, false, true, Plane.HORIZONTAL, true),
|
||||
ADVANCED_FACTORY(MachineBlock.MACHINE_BLOCK_1, 6, "Factory", 11, TileEntityAdvancedFactory.class, true, false, true, Plane.HORIZONTAL, true),
|
||||
ELITE_FACTORY(MachineBlock.MACHINE_BLOCK_1, 7, "Factory", 11, TileEntityEliteFactory.class, true, false, true, Plane.HORIZONTAL, true),
|
||||
METALLURGIC_INFUSER(MachineBlock.MACHINE_BLOCK_1, 8, "MetallurgicInfuser", 12, TileEntityMetallurgicInfuser.class, true, true, true, Plane.HORIZONTAL, false),
|
||||
PURIFICATION_CHAMBER(MachineBlock.MACHINE_BLOCK_1, 9, "PurificationChamber", 15, TileEntityPurificationChamber.class, true, false, true, Plane.HORIZONTAL, true),
|
||||
ENERGIZED_SMELTER(MachineBlock.MACHINE_BLOCK_1, 10, "EnergizedSmelter", 16, TileEntityEnergizedSmelter.class, true, false, true, Plane.HORIZONTAL, true),
|
||||
TELEPORTER(MachineBlock.MACHINE_BLOCK_1, 11, "Teleporter", 13, TileEntityTeleporter.class, true, false, false, never, false),
|
||||
ELECTRIC_PUMP(MachineBlock.MACHINE_BLOCK_1, 12, "ElectricPump", 17, TileEntityElectricPump.class, true, true, false, Plane.HORIZONTAL, false),
|
||||
ELECTRIC_CHEST(MachineBlock.MACHINE_BLOCK_1, 13, "ElectricChest", -1, TileEntityElectricChest.class, true, true, false, Plane.HORIZONTAL, false),
|
||||
CHARGEPAD(MachineBlock.MACHINE_BLOCK_1, 14, "Chargepad", -1, TileEntityChargepad.class, true, true, false, Plane.HORIZONTAL, false),
|
||||
LOGISTICAL_SORTER(MachineBlock.MACHINE_BLOCK_1, 15, "LogisticalSorter", -1, TileEntityLogisticalSorter.class, false, true, false, Plane.HORIZONTAL, true),
|
||||
ROTARY_CONDENSENTRATOR(MachineBlock.MACHINE_BLOCK_2, 0, "RotaryCondensentrator", 7, TileEntityRotaryCondensentrator.class, true, true, false, Plane.HORIZONTAL, false),
|
||||
CHEMICAL_OXIDIZER(MachineBlock.MACHINE_BLOCK_2, 1, "ChemicalOxidizer", 29, TileEntityChemicalOxidizer.class, true, true, true, Plane.HORIZONTAL, true),
|
||||
CHEMICAL_INFUSER(MachineBlock.MACHINE_BLOCK_2, 2, "ChemicalInfuser", 30, TileEntityChemicalInfuser.class, true, true, false, Plane.HORIZONTAL, true),
|
||||
CHEMICAL_INJECTION_CHAMBER(MachineBlock.MACHINE_BLOCK_2, 3, "ChemicalInjectionChamber", 31, TileEntityChemicalInjectionChamber.class, true, false, true, Plane.HORIZONTAL, true),
|
||||
ELECTROLYTIC_SEPARATOR(MachineBlock.MACHINE_BLOCK_2, 4, "ElectrolyticSeparator", 32, TileEntityElectrolyticSeparator.class, true, true, false, Plane.HORIZONTAL, true),
|
||||
PRECISION_SAWMILL(MachineBlock.MACHINE_BLOCK_2, 5, "PrecisionSawmill", 34, TileEntityPrecisionSawmill.class, true, false, true, Plane.HORIZONTAL, true),
|
||||
CHEMICAL_DISSOLUTION_CHAMBER(MachineBlock.MACHINE_BLOCK_2, 6, "ChemicalDissolutionChamber", 35, TileEntityChemicalDissolutionChamber.class, true, true, true, Plane.HORIZONTAL, true),
|
||||
CHEMICAL_WASHER(MachineBlock.MACHINE_BLOCK_2, 7, "ChemicalWasher", 36, TileEntityChemicalWasher.class, true, true, false, Plane.HORIZONTAL, true),
|
||||
CHEMICAL_CRYSTALLIZER(MachineBlock.MACHINE_BLOCK_2, 8, "ChemicalCrystallizer", 37, TileEntityChemicalCrystallizer.class, true, true, true, Plane.HORIZONTAL, true),
|
||||
SEISMIC_VIBRATOR(MachineBlock.MACHINE_BLOCK_2, 9, "SeismicVibrator", 39, TileEntitySeismicVibrator.class, true, true, false, Plane.HORIZONTAL, true),
|
||||
PRESSURIZED_REACTION_CHAMBER(MachineBlock.MACHINE_BLOCK_2, 10, "PressurizedReactionChamber", 40, TileEntityPRC.class, true, true, false, Plane.HORIZONTAL, true),
|
||||
PORTABLE_TANK(MachineBlock.MACHINE_BLOCK_2, 11, "PortableTank", 41, TileEntityPortableTank.class, false, true, false, never, true),
|
||||
FLUIDIC_PLENISHER(MachineBlock.MACHINE_BLOCK_2, 12, "FluidicPlenisher", 42, TileEntityFluidicPlenisher.class, true, true, false, Plane.HORIZONTAL, true),
|
||||
LASER(MachineBlock.MACHINE_BLOCK_2, 13, "Laser", -1, TileEntityLaser.class, true, true, false, always, false),
|
||||
LASER_AMPLIFIER(MachineBlock.MACHINE_BLOCK_2, 14, "LaserAmplifier", 44, TileEntityLaserAmplifier.class, false, true, false, always, true),
|
||||
LASER_TRACTOR_BEAM(MachineBlock.MACHINE_BLOCK_2, 15, "LaserTractorBeam", 45, TileEntityLaserTractorBeam.class, false, true, false, always, true),
|
||||
ENTANGLED_BLOCK(MachineBlock.MACHINE_BLOCK_3, 0, "EntangledBlock", 46, TileEntityEntangledBlock.class, true, false, false, Plane.HORIZONTAL, true),
|
||||
SOLAR_NEUTRON_ACTIVATOR(MachineBlock.MACHINE_BLOCK_3, 1, "SolarNeutronActivator", 47, TileEntitySolarNeutronActivator.class, false, true, false, Plane.HORIZONTAL, true),
|
||||
AMBIENT_ACCUMULATOR(MachineBlock.MACHINE_BLOCK_3, 2, "AmbientAccumulator", 48, TileEntityAmbientAccumulator.class, true, false, false, never, true),
|
||||
OREDICTIONIFICATOR(MachineBlock.MACHINE_BLOCK_3, 3, "Oredictionificator", 52, TileEntityOredictionificator.class, false, false, false, Plane.HORIZONTAL, true);
|
||||
|
||||
public MachineBlock typeBlock;
|
||||
public int meta;
|
||||
public String machineName;
|
||||
public int guiId;
|
||||
public double baseEnergy;
|
||||
public Class<? extends TileEntity> tileEntityClass;
|
||||
public boolean isElectric;
|
||||
public boolean hasModel;
|
||||
public boolean supportsUpgrades;
|
||||
public Collection<ShapedMekanismRecipe> machineRecipes = new HashSet<ShapedMekanismRecipe>();
|
||||
public Predicate<EnumFacing> facingPredicate;
|
||||
public boolean activable;
|
||||
|
||||
private MachineType(MachineBlock block, int i, String s, int j, Class<? extends TileEntity> tileClass, boolean electric, boolean model, boolean upgrades, Predicate<EnumFacing> predicate, boolean hasActiveTexture)
|
||||
{
|
||||
typeBlock = block;
|
||||
meta = i;
|
||||
machineName = s;
|
||||
guiId = j;
|
||||
tileEntityClass = tileClass;
|
||||
isElectric = electric;
|
||||
hasModel = model;
|
||||
supportsUpgrades = upgrades;
|
||||
facingPredicate = predicate;
|
||||
activable = hasActiveTexture;
|
||||
}
|
||||
|
||||
public boolean isEnabled()
|
||||
{
|
||||
return machines.isEnabled(this.machineName);
|
||||
}
|
||||
|
||||
public void addRecipes(Collection<ShapedMekanismRecipe> recipes)
|
||||
{
|
||||
machineRecipes.addAll(recipes);
|
||||
}
|
||||
|
||||
public void addRecipe(ShapedMekanismRecipe recipe)
|
||||
{
|
||||
machineRecipes.add(recipe);
|
||||
}
|
||||
|
||||
public Collection<ShapedMekanismRecipe> getRecipes()
|
||||
{
|
||||
return machineRecipes;
|
||||
}
|
||||
|
||||
public static List<MachineType> getValidMachines()
|
||||
{
|
||||
List<MachineType> ret = new ArrayList<MachineType>();
|
||||
|
||||
for(MachineType type : MachineType.values())
|
||||
{
|
||||
if(type != ENTANGLED_BLOCK && type != AMBIENT_ACCUMULATOR)
|
||||
{
|
||||
ret.add(type);
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
public static MachineType get(Block block, int meta)
|
||||
{
|
||||
if(block instanceof BlockMachine)
|
||||
{
|
||||
return get(((BlockMachine)block).getMachineBlock(), meta);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public static MachineType get(MachineBlock block, int meta)
|
||||
{
|
||||
for(MachineType type : values())
|
||||
{
|
||||
if(type.meta == meta && type.typeBlock == block)
|
||||
{
|
||||
return type;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public TileEntity create()
|
||||
{
|
||||
try {
|
||||
return tileEntityClass.newInstance();
|
||||
} catch(Exception e) {
|
||||
Mekanism.logger.error("Unable to indirectly create tile entity.");
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/** Used for getting the base energy storage. */
|
||||
public double getUsage()
|
||||
{
|
||||
switch(this)
|
||||
{
|
||||
case ENRICHMENT_CHAMBER:
|
||||
return usage.enrichmentChamberUsage;
|
||||
case OSMIUM_COMPRESSOR:
|
||||
return usage.osmiumCompressorUsage;
|
||||
case COMBINER:
|
||||
return usage.combinerUsage;
|
||||
case CRUSHER:
|
||||
return usage.crusherUsage;
|
||||
case DIGITAL_MINER:
|
||||
return usage.digitalMinerUsage;
|
||||
case BASIC_FACTORY:
|
||||
return usage.factoryUsage * 3;
|
||||
case ADVANCED_FACTORY:
|
||||
return usage.factoryUsage * 5;
|
||||
case ELITE_FACTORY:
|
||||
return usage.factoryUsage * 7;
|
||||
case METALLURGIC_INFUSER:
|
||||
return usage.metallurgicInfuserUsage;
|
||||
case PURIFICATION_CHAMBER:
|
||||
return usage.purificationChamberUsage;
|
||||
case ENERGIZED_SMELTER:
|
||||
return usage.energizedSmelterUsage;
|
||||
case TELEPORTER:
|
||||
return 12500;
|
||||
case ELECTRIC_PUMP:
|
||||
return usage.electricPumpUsage;
|
||||
case ELECTRIC_CHEST:
|
||||
return 30;
|
||||
case CHARGEPAD:
|
||||
return 25;
|
||||
case LOGISTICAL_SORTER:
|
||||
return 0;
|
||||
case ROTARY_CONDENSENTRATOR:
|
||||
return usage.rotaryCondensentratorUsage;
|
||||
case CHEMICAL_OXIDIZER:
|
||||
return usage.oxidationChamberUsage;
|
||||
case CHEMICAL_INFUSER:
|
||||
return usage.chemicalInfuserUsage;
|
||||
case CHEMICAL_INJECTION_CHAMBER:
|
||||
return usage.chemicalInjectionChamberUsage;
|
||||
case ELECTROLYTIC_SEPARATOR:
|
||||
return general.FROM_H2 * 2;
|
||||
case PRECISION_SAWMILL:
|
||||
return usage.precisionSawmillUsage;
|
||||
case CHEMICAL_DISSOLUTION_CHAMBER:
|
||||
return usage.chemicalDissolutionChamberUsage;
|
||||
case CHEMICAL_WASHER:
|
||||
return usage.chemicalWasherUsage;
|
||||
case CHEMICAL_CRYSTALLIZER:
|
||||
return usage.chemicalCrystallizerUsage;
|
||||
case SEISMIC_VIBRATOR:
|
||||
return usage.seismicVibratorUsage;
|
||||
case PRESSURIZED_REACTION_CHAMBER:
|
||||
return usage.pressurizedReactionBaseUsage;
|
||||
case PORTABLE_TANK:
|
||||
return 0;
|
||||
case FLUIDIC_PLENISHER:
|
||||
return usage.fluidicPlenisherUsage;
|
||||
case LASER:
|
||||
return usage.laserUsage;
|
||||
case LASER_AMPLIFIER:
|
||||
return 0;
|
||||
case LASER_TRACTOR_BEAM:
|
||||
return 0;
|
||||
case ENTANGLED_BLOCK:
|
||||
return 0;
|
||||
case SOLAR_NEUTRON_ACTIVATOR:
|
||||
return 0;
|
||||
case AMBIENT_ACCUMULATOR:
|
||||
return 0;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
public static void updateAllUsages()
|
||||
{
|
||||
for(MachineType type : values())
|
||||
{
|
||||
type.updateUsage();
|
||||
}
|
||||
}
|
||||
|
||||
public void updateUsage()
|
||||
{
|
||||
baseEnergy = 400 * getUsage();
|
||||
}
|
||||
|
||||
public String getDescription()
|
||||
{
|
||||
return LangUtils.localize("tooltip." + machineName);
|
||||
}
|
||||
|
||||
public ItemStack getStack()
|
||||
{
|
||||
return new ItemStack(typeBlock.getBlock(), 1, meta);
|
||||
}
|
||||
|
||||
public static MachineType get(ItemStack stack)
|
||||
{
|
||||
return get(Block.getBlockFromItem(stack.getItem()), stack.getItemDamage());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName()
|
||||
{
|
||||
return name().toLowerCase();
|
||||
}
|
||||
|
||||
public boolean canRotateTo(EnumFacing side)
|
||||
{
|
||||
return facingPredicate.apply(side);
|
||||
}
|
||||
|
||||
public boolean hasRotations()
|
||||
{
|
||||
return !facingPredicate.equals(Predicates.alwaysFalse());
|
||||
}
|
||||
|
||||
public boolean hasActiveTexture()
|
||||
{
|
||||
return activable;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static class MachineBlockPredicate implements Predicate<MachineType>
|
||||
{
|
||||
public MachineBlock machineBlock;
|
||||
|
||||
public MachineBlockPredicate(MachineBlock type)
|
||||
{
|
||||
machineBlock = type;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(MachineType input)
|
||||
{
|
||||
return input.typeBlock == machineBlock;
|
||||
}
|
||||
}
|
||||
|
||||
public static class MachineBlockStateMapper extends StateMapperBase
|
||||
{
|
||||
@Override
|
||||
protected ModelResourceLocation getModelResourceLocation(IBlockState state)
|
||||
{
|
||||
BlockMachine block = (BlockMachine)state.getBlock();
|
||||
MachineType type = state.getValue(block.getProperty());
|
||||
StringBuilder builder = new StringBuilder();
|
||||
if(type.hasRotations())
|
||||
{
|
||||
EnumFacing facing = state.getValue(facingProperty);
|
||||
if(type.canRotateTo(facing))
|
||||
{
|
||||
builder.append(facingProperty.getName());
|
||||
builder.append("=");
|
||||
builder.append(facing.getName());
|
||||
}
|
||||
else
|
||||
{
|
||||
return new ModelResourceLocation("builtin/missing", "missing");
|
||||
}
|
||||
}
|
||||
if(type.hasActiveTexture())
|
||||
{
|
||||
String active = state.getValue(activeProperty) ? "active" : "inactive";
|
||||
if(builder.length() > 0)
|
||||
{
|
||||
builder.append(",");
|
||||
}
|
||||
builder.append(active);
|
||||
}
|
||||
|
||||
if(builder.length() == 0)
|
||||
{
|
||||
builder.append("normal");
|
||||
}
|
||||
|
||||
ResourceLocation baseLocation = new ResourceLocation("mekanism", type.getName());
|
||||
return new ModelResourceLocation(baseLocation, builder.toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package mekanism.common.block.states;
|
||||
|
||||
import mekanism.common.MekanismBlocks;
|
||||
import mekanism.common.block.BlockOre;
|
||||
|
||||
import net.minecraft.block.properties.PropertyEnum;
|
||||
import net.minecraft.block.state.BlockState;
|
||||
import net.minecraft.util.IStringSerializable;
|
||||
|
||||
/**
|
||||
* Created by ben on 23/12/14.
|
||||
*/
|
||||
public class BlockStateOre extends BlockState
|
||||
{
|
||||
public static final PropertyEnum typeProperty = PropertyEnum.create("type", EnumOreType.class);
|
||||
|
||||
public BlockStateOre(BlockOre block)
|
||||
{
|
||||
super(block, typeProperty);
|
||||
}
|
||||
|
||||
public static enum EnumOreType implements IStringSerializable
|
||||
{
|
||||
OSMIUM,
|
||||
COPPER,
|
||||
TIN;
|
||||
|
||||
@Override
|
||||
public String getName()
|
||||
{
|
||||
return name().toLowerCase();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package mekanism.common.block.states;
|
||||
|
||||
import mekanism.api.EnumColor;
|
||||
import mekanism.common.MekanismBlocks;
|
||||
import mekanism.common.block.BlockPlastic;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.properties.PropertyDirection;
|
||||
import net.minecraft.block.properties.PropertyEnum;
|
||||
import net.minecraft.block.state.BlockState;
|
||||
import net.minecraft.item.EnumDyeColor;
|
||||
import net.minecraft.util.IStringSerializable;
|
||||
|
||||
public class BlockStatePlastic extends BlockState
|
||||
{
|
||||
public static PropertyEnum colorProperty = PropertyEnum.create("color", EnumDyeColor.class);
|
||||
public static PropertyEnum typeProperty = PropertyEnum.create("type", PlasticBlockType.class);
|
||||
|
||||
public BlockStatePlastic(BlockPlastic block)
|
||||
{
|
||||
super(block, colorProperty, typeProperty);
|
||||
}
|
||||
|
||||
public static enum PlasticBlockType implements IStringSerializable
|
||||
{
|
||||
PLASTIC,
|
||||
SLICK,
|
||||
GLOW,
|
||||
REINFORCED,
|
||||
ROAD;
|
||||
|
||||
@Override
|
||||
public String getName()
|
||||
{
|
||||
return name().toLowerCase();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
package mekanism.common.inventory.container;
|
||||
|
||||
import mekanism.common.base.IElectricChest;
|
||||
import mekanism.common.block.BlockMachine.MachineType;
|
||||
import mekanism.common.block.states.BlockStateMachine;
|
||||
import mekanism.common.inventory.slot.SlotElectricChest;
|
||||
import mekanism.common.inventory.slot.SlotEnergy.SlotDischarge;
|
||||
import mekanism.common.tile.TileEntityElectricChest;
|
||||
@@ -170,7 +170,7 @@ public class ContainerElectricChest extends Container
|
||||
ItemStack itemStack = player.inventory.getStackInSlot(destSlot);
|
||||
if(itemStack != null && itemStack.getItem() instanceof IElectricChest)
|
||||
{
|
||||
if(MachineType.get(itemStack) == MachineType.ELECTRIC_CHEST)
|
||||
if(BlockStateMachine.MachineType.get(itemStack) == BlockStateMachine.MachineType.ELECTRIC_CHEST)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package mekanism.common.inventory.slot;
|
||||
|
||||
import mekanism.common.base.IElectricChest;
|
||||
import mekanism.common.block.BlockMachine.MachineType;
|
||||
import mekanism.common.block.states.BlockStateMachine;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
@@ -27,7 +27,7 @@ public class SlotElectricChest extends Slot
|
||||
|
||||
if(itemstack.getItem() instanceof IElectricChest)
|
||||
{
|
||||
if(MachineType.get(itemstack) == MachineType.ELECTRIC_CHEST)
|
||||
if(BlockStateMachine.MachineType.get(itemstack) == BlockStateMachine.MachineType.ELECTRIC_CHEST)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -22,7 +22,8 @@ import mekanism.common.Tier.BaseTier;
|
||||
import mekanism.common.Upgrade;
|
||||
import mekanism.common.base.*;
|
||||
import mekanism.common.base.IRedstoneControl.RedstoneControl;
|
||||
import mekanism.common.block.BlockMachine.MachineType;
|
||||
import mekanism.common.block.states.BlockStateMachine.MachineType;
|
||||
import mekanism.common.block.states.BlockStateMachine;
|
||||
import mekanism.common.integration.IC2ItemManager;
|
||||
import mekanism.common.inventory.InventoryElectricChest;
|
||||
import mekanism.common.network.PacketElectricChest.ElectricChestMessage;
|
||||
@@ -126,9 +127,9 @@ public class ItemBlockMachine extends ItemBlock implements IEnergizedItem, ISpec
|
||||
@Override
|
||||
public String getUnlocalizedName(ItemStack itemstack)
|
||||
{
|
||||
if(MachineType.get(itemstack) != null)
|
||||
if(BlockStateMachine.MachineType.get(itemstack) != null)
|
||||
{
|
||||
return getUnlocalizedName() + "." + MachineType.get(itemstack).name;
|
||||
return getUnlocalizedName() + "." + BlockStateMachine.MachineType.get(itemstack).machineName;
|
||||
}
|
||||
|
||||
return "null";
|
||||
@@ -137,11 +138,11 @@ public class ItemBlockMachine extends ItemBlock implements IEnergizedItem, ISpec
|
||||
@Override
|
||||
public String getItemStackDisplayName(ItemStack itemstack)
|
||||
{
|
||||
MachineType type = MachineType.get(itemstack);
|
||||
MachineType type = BlockStateMachine.MachineType.get(itemstack);
|
||||
|
||||
if(type == MachineType.BASIC_FACTORY || type == MachineType.ADVANCED_FACTORY || type == MachineType.ELITE_FACTORY)
|
||||
if(type == BlockStateMachine.MachineType.BASIC_FACTORY || type == BlockStateMachine.MachineType.ADVANCED_FACTORY || type == BlockStateMachine.MachineType.ELITE_FACTORY)
|
||||
{
|
||||
BaseTier tier = type == MachineType.BASIC_FACTORY ? BaseTier.BASIC : (type == MachineType.ADVANCED_FACTORY ? BaseTier.ADVANCED : BaseTier.ELITE);
|
||||
BaseTier tier = type == BlockStateMachine.MachineType.BASIC_FACTORY ? BaseTier.BASIC : (type == BlockStateMachine.MachineType.ADVANCED_FACTORY ? BaseTier.ADVANCED : BaseTier.ELITE);
|
||||
|
||||
if(StatCollector.canTranslate("tile." + tier.getName() + RecipeType.values()[getRecipeType(itemstack)].getUnlocalizedName() + "Factory"))
|
||||
{
|
||||
@@ -158,11 +159,11 @@ public class ItemBlockMachine extends ItemBlock implements IEnergizedItem, ISpec
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(ItemStack itemstack, EntityPlayer entityplayer, List<String> list, boolean flag)
|
||||
{
|
||||
MachineType type = MachineType.get(itemstack);
|
||||
MachineType type = BlockStateMachine.MachineType.get(itemstack);
|
||||
|
||||
if(!MekKeyHandler.getIsKeyPressed(MekanismKeyHandler.sneakKey))
|
||||
{
|
||||
if(type == MachineType.PORTABLE_TANK)
|
||||
if(type == BlockStateMachine.MachineType.PORTABLE_TANK)
|
||||
{
|
||||
FluidStack fluidStack = getFluidStack(itemstack);
|
||||
|
||||
@@ -177,18 +178,18 @@ public class ItemBlockMachine extends ItemBlock implements IEnergizedItem, ISpec
|
||||
}
|
||||
else if(!MekKeyHandler.getIsKeyPressed(MekanismKeyHandler.modeSwitchKey))
|
||||
{
|
||||
if(type == MachineType.BASIC_FACTORY || type == MachineType.ADVANCED_FACTORY || type == MachineType.ELITE_FACTORY)
|
||||
if(type == BlockStateMachine.MachineType.BASIC_FACTORY || type == BlockStateMachine.MachineType.ADVANCED_FACTORY || type == BlockStateMachine.MachineType.ELITE_FACTORY)
|
||||
{
|
||||
list.add(EnumColor.INDIGO + LangUtils.localize("tooltip.recipeType") + ": " + EnumColor.GREY + RecipeType.values()[getRecipeType(itemstack)].getLocalizedName());
|
||||
}
|
||||
|
||||
if(type == MachineType.ELECTRIC_CHEST)
|
||||
if(type == BlockStateMachine.MachineType.ELECTRIC_CHEST)
|
||||
{
|
||||
list.add(EnumColor.INDIGO + LangUtils.localize("tooltip.auth") + ": " + EnumColor.GREY + LangUtils.transYesNo(getAuthenticated(itemstack)));
|
||||
list.add(EnumColor.INDIGO + LangUtils.localize("tooltip.locked") + ": " + EnumColor.GREY + LangUtils.transYesNo(getLocked(itemstack)));
|
||||
}
|
||||
|
||||
if(type == MachineType.PORTABLE_TANK)
|
||||
if(type == BlockStateMachine.MachineType.PORTABLE_TANK)
|
||||
{
|
||||
list.add(EnumColor.INDIGO + LangUtils.localize("tooltip.portableTank.bucketMode") + ": " + EnumColor.GREY + LangUtils.transYesNo(getBucketMode(itemstack)));
|
||||
}
|
||||
@@ -198,7 +199,7 @@ public class ItemBlockMachine extends ItemBlock implements IEnergizedItem, ISpec
|
||||
list.add(EnumColor.BRIGHT_GREEN + LangUtils.localize("tooltip.storedEnergy") + ": " + EnumColor.GREY + MekanismUtils.getEnergyDisplay(getEnergy(itemstack)));
|
||||
}
|
||||
|
||||
if(hasTank(itemstack) && type != MachineType.PORTABLE_TANK)
|
||||
if(hasTank(itemstack) && type != BlockStateMachine.MachineType.PORTABLE_TANK)
|
||||
{
|
||||
FluidStack fluidStack = getFluidStack(itemstack);
|
||||
|
||||
@@ -208,7 +209,7 @@ public class ItemBlockMachine extends ItemBlock implements IEnergizedItem, ISpec
|
||||
}
|
||||
}
|
||||
|
||||
if(type != MachineType.CHARGEPAD && type != MachineType.LOGISTICAL_SORTER)
|
||||
if(type != BlockStateMachine.MachineType.CHARGEPAD && type != BlockStateMachine.MachineType.LOGISTICAL_SORTER)
|
||||
{
|
||||
list.add(EnumColor.AQUA + LangUtils.localize("tooltip.inventory") + ": " + EnumColor.GREY + LangUtils.transYesNo(getInventory(itemstack) != null && getInventory(itemstack).tagCount() != 0));
|
||||
}
|
||||
@@ -231,9 +232,9 @@ public class ItemBlockMachine extends ItemBlock implements IEnergizedItem, ISpec
|
||||
@Override
|
||||
public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
MachineType type = MachineType.get(stack);
|
||||
MachineType type = BlockStateMachine.MachineType.get(stack);
|
||||
|
||||
if(type == MachineType.PORTABLE_TANK && getBucketMode(stack))
|
||||
if(type == BlockStateMachine.MachineType.PORTABLE_TANK && getBucketMode(stack))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -246,9 +247,9 @@ public class ItemBlockMachine extends ItemBlock implements IEnergizedItem, ISpec
|
||||
{
|
||||
boolean place = true;
|
||||
|
||||
MachineType type = MachineType.get(stack);
|
||||
MachineType type = BlockStateMachine.MachineType.get(stack);
|
||||
|
||||
if(type == MachineType.DIGITAL_MINER)
|
||||
if(type == BlockStateMachine.MachineType.DIGITAL_MINER)
|
||||
{
|
||||
for(int xPos = -1; xPos <= +1; xPos++)
|
||||
{
|
||||
@@ -267,7 +268,7 @@ public class ItemBlockMachine extends ItemBlock implements IEnergizedItem, ISpec
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(type == MachineType.SOLAR_NEUTRON_ACTIVATOR)
|
||||
else if(type == BlockStateMachine.MachineType.SOLAR_NEUTRON_ACTIVATOR)
|
||||
{
|
||||
if(pos.getY()+1 > 255 || !world.getBlockState(pos.up()).getBlock().isReplaceable(world, pos.up()))
|
||||
{
|
||||
@@ -385,9 +386,9 @@ public class ItemBlockMachine extends ItemBlock implements IEnergizedItem, ISpec
|
||||
@Override
|
||||
public void onUpdate(ItemStack itemstack, World world, Entity entity, int i, boolean flag)
|
||||
{
|
||||
MachineType type = MachineType.get(itemstack);
|
||||
MachineType type = BlockStateMachine.MachineType.get(itemstack);
|
||||
|
||||
if(type == MachineType.ELECTRIC_CHEST)
|
||||
if(type == BlockStateMachine.MachineType.ELECTRIC_CHEST)
|
||||
{
|
||||
if(world != null && !world.isRemote)
|
||||
{
|
||||
@@ -434,7 +435,7 @@ public class ItemBlockMachine extends ItemBlock implements IEnergizedItem, ISpec
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(type == MachineType.PORTABLE_TANK)
|
||||
else if(type == BlockStateMachine.MachineType.PORTABLE_TANK)
|
||||
{
|
||||
if(world != null && !world.isRemote)
|
||||
{
|
||||
@@ -497,9 +498,9 @@ public class ItemBlockMachine extends ItemBlock implements IEnergizedItem, ISpec
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer entityplayer)
|
||||
{
|
||||
MachineType type = MachineType.get(itemstack);
|
||||
MachineType type = BlockStateMachine.MachineType.get(itemstack);
|
||||
|
||||
if(MachineType.get(itemstack) == MachineType.ELECTRIC_CHEST)
|
||||
if(BlockStateMachine.MachineType.get(itemstack) == BlockStateMachine.MachineType.ELECTRIC_CHEST)
|
||||
{
|
||||
if(!world.isRemote)
|
||||
{
|
||||
@@ -517,7 +518,7 @@ public class ItemBlockMachine extends ItemBlock implements IEnergizedItem, ISpec
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(type == MachineType.PORTABLE_TANK && getBucketMode(itemstack))
|
||||
else if(type == BlockStateMachine.MachineType.PORTABLE_TANK && getBucketMode(itemstack))
|
||||
{
|
||||
MovingObjectPosition pos = getMovingObjectPositionFromPlayer(world, entityplayer, !entityplayer.isSneaking());
|
||||
|
||||
@@ -705,9 +706,9 @@ public class ItemBlockMachine extends ItemBlock implements IEnergizedItem, ISpec
|
||||
return false;
|
||||
}
|
||||
|
||||
MachineType type = MachineType.get((ItemStack)data[0]);
|
||||
MachineType type = BlockStateMachine.MachineType.get((ItemStack)data[0]);
|
||||
|
||||
return type == MachineType.ELECTRIC_PUMP || type == MachineType.PORTABLE_TANK || type == MachineType.FLUIDIC_PLENISHER;
|
||||
return type == BlockStateMachine.MachineType.ELECTRIC_PUMP || type == BlockStateMachine.MachineType.PORTABLE_TANK || type == BlockStateMachine.MachineType.FLUIDIC_PLENISHER;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -841,7 +842,7 @@ public class ItemBlockMachine extends ItemBlock implements IEnergizedItem, ISpec
|
||||
@Override
|
||||
public double getEnergy(ItemStack itemStack)
|
||||
{
|
||||
if(itemStack.getTagCompound() == null || !MachineType.get(itemStack).isElectric)
|
||||
if(itemStack.getTagCompound() == null || !BlockStateMachine.MachineType.get(itemStack).isElectric)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
@@ -852,7 +853,7 @@ public class ItemBlockMachine extends ItemBlock implements IEnergizedItem, ISpec
|
||||
@Override
|
||||
public void setEnergy(ItemStack itemStack, double amount)
|
||||
{
|
||||
if(!MachineType.get(itemStack).isElectric)
|
||||
if(!BlockStateMachine.MachineType.get(itemStack).isElectric)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -869,7 +870,7 @@ public class ItemBlockMachine extends ItemBlock implements IEnergizedItem, ISpec
|
||||
@Override
|
||||
public double getMaxEnergy(ItemStack itemStack)
|
||||
{
|
||||
return MekanismUtils.getMaxEnergy(itemStack, MachineType.get(Block.getBlockFromItem(itemStack.getItem()), itemStack.getItemDamage()).baseEnergy);
|
||||
return MekanismUtils.getMaxEnergy(itemStack, BlockStateMachine.MachineType.get(Block.getBlockFromItem(itemStack.getItem()), itemStack.getItemDamage()).baseEnergy);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -881,7 +882,7 @@ public class ItemBlockMachine extends ItemBlock implements IEnergizedItem, ISpec
|
||||
@Override
|
||||
public boolean canReceive(ItemStack itemStack)
|
||||
{
|
||||
return MachineType.get(itemStack).isElectric;
|
||||
return BlockStateMachine.MachineType.get(itemStack).isElectric;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -982,7 +983,7 @@ public class ItemBlockMachine extends ItemBlock implements IEnergizedItem, ISpec
|
||||
@Override
|
||||
public int fill(ItemStack container, FluidStack resource, boolean doFill)
|
||||
{
|
||||
if(MachineType.get(container) == MachineType.PORTABLE_TANK && resource != null)
|
||||
if(BlockStateMachine.MachineType.get(container) == BlockStateMachine.MachineType.PORTABLE_TANK && resource != null)
|
||||
{
|
||||
FluidStack stored = getFluidStack(container);
|
||||
int toFill;
|
||||
@@ -1015,7 +1016,7 @@ public class ItemBlockMachine extends ItemBlock implements IEnergizedItem, ISpec
|
||||
@Override
|
||||
public FluidStack drain(ItemStack container, int maxDrain, boolean doDrain)
|
||||
{
|
||||
if(MachineType.get(container) == MachineType.PORTABLE_TANK)
|
||||
if(BlockStateMachine.MachineType.get(container) == BlockStateMachine.MachineType.PORTABLE_TANK)
|
||||
{
|
||||
FluidStack stored = getFluidStack(container);
|
||||
|
||||
|
||||
@@ -8,7 +8,8 @@ import mekanism.api.util.UnitDisplayUtils.EnergyType;
|
||||
import mekanism.common.Mekanism;
|
||||
import mekanism.common.Tier;
|
||||
import mekanism.common.base.IModule;
|
||||
import mekanism.common.block.BlockMachine.MachineType;
|
||||
import mekanism.common.block.states.BlockStateMachine.MachineType;
|
||||
import mekanism.common.block.states.BlockStateMachine;
|
||||
import mekanism.common.network.PacketConfigSync.ConfigSyncMessage;
|
||||
import net.minecraftforge.fml.common.network.simpleimpl.IMessage;
|
||||
import net.minecraftforge.fml.common.network.simpleimpl.IMessageHandler;
|
||||
@@ -63,9 +64,9 @@ public class PacketConfigSync implements IMessageHandler<ConfigSyncMessage, IMes
|
||||
dataStream.writeInt(general.maxScubaGas);
|
||||
dataStream.writeInt(general.maxFlamethrowerGas);
|
||||
|
||||
for(MachineType type : MachineType.getValidMachines())
|
||||
for(MachineType type : BlockStateMachine.MachineType.getValidMachines())
|
||||
{
|
||||
dataStream.writeBoolean(machines.isEnabled(type.name));
|
||||
dataStream.writeBoolean(machines.isEnabled(type.machineName));
|
||||
}
|
||||
|
||||
dataStream.writeDouble(usage.enrichmentChamberUsage);
|
||||
@@ -140,9 +141,9 @@ public class PacketConfigSync implements IMessageHandler<ConfigSyncMessage, IMes
|
||||
general.maxScubaGas = dataStream.readInt();
|
||||
general.maxFlamethrowerGas = dataStream.readInt();
|
||||
|
||||
for(MachineType type : MachineType.getValidMachines())
|
||||
for(MachineType type : BlockStateMachine.MachineType.getValidMachines())
|
||||
{
|
||||
machines.setEntry(type.name, dataStream.readBoolean());
|
||||
machines.setEntry(type.machineName, dataStream.readBoolean());
|
||||
}
|
||||
|
||||
usage.enrichmentChamberUsage = dataStream.readDouble();
|
||||
|
||||
@@ -5,7 +5,7 @@ import mekanism.api.energy.IEnergizedItem;
|
||||
import mekanism.common.Mekanism;
|
||||
import mekanism.common.PacketHandler;
|
||||
import mekanism.common.base.IElectricChest;
|
||||
import mekanism.common.block.BlockMachine.MachineType;
|
||||
import mekanism.common.block.states.BlockStateMachine;
|
||||
import mekanism.common.inventory.InventoryElectricChest;
|
||||
import mekanism.common.network.PacketElectricChest.ElectricChestMessage;
|
||||
import mekanism.common.tile.TileEntityElectricChest;
|
||||
@@ -45,7 +45,7 @@ public class PacketElectricChest implements IMessageHandler<ElectricChestMessage
|
||||
else {
|
||||
ItemStack stack = player.getCurrentEquippedItem();
|
||||
|
||||
if(stack != null && stack.getItem() instanceof IElectricChest && MachineType.get(stack) == MachineType.ELECTRIC_CHEST)
|
||||
if(stack != null && stack.getItem() instanceof IElectricChest && BlockStateMachine.MachineType.get(stack) == BlockStateMachine.MachineType.ELECTRIC_CHEST)
|
||||
{
|
||||
if(message.useEnergy)
|
||||
{
|
||||
@@ -82,7 +82,7 @@ public class PacketElectricChest implements IMessageHandler<ElectricChestMessage
|
||||
else {
|
||||
ItemStack stack = player.getCurrentEquippedItem();
|
||||
|
||||
if(stack != null && stack.getItem() instanceof IElectricChest && MachineType.get(stack) == MachineType.ELECTRIC_CHEST)
|
||||
if(stack != null && stack.getItem() instanceof IElectricChest && BlockStateMachine.MachineType.get(stack) == BlockStateMachine.MachineType.ELECTRIC_CHEST)
|
||||
{
|
||||
((IElectricChest)stack.getItem()).setPassword(stack, message.password);
|
||||
((IElectricChest)stack.getItem()).setAuthenticated(stack, true);
|
||||
@@ -105,7 +105,7 @@ public class PacketElectricChest implements IMessageHandler<ElectricChestMessage
|
||||
else {
|
||||
ItemStack stack = player.getCurrentEquippedItem();
|
||||
|
||||
if(stack != null && stack.getItem() instanceof IElectricChest && MachineType.get(stack) == MachineType.ELECTRIC_CHEST)
|
||||
if(stack != null && stack.getItem() instanceof IElectricChest && BlockStateMachine.MachineType.get(stack) == BlockStateMachine.MachineType.ELECTRIC_CHEST)
|
||||
{
|
||||
((IElectricChest)stack.getItem()).setLocked(stack, message.locked);
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ import mekanism.api.gas.Gas;
|
||||
import mekanism.api.gas.GasStack;
|
||||
import mekanism.api.infuse.InfuseType;
|
||||
import mekanism.api.util.StackUtils;
|
||||
import mekanism.common.block.BlockMachine.MachineType;
|
||||
import mekanism.common.block.states.BlockStateMachine.MachineType;
|
||||
import mekanism.common.recipe.inputs.*;
|
||||
import mekanism.common.recipe.machines.*;
|
||||
import mekanism.common.recipe.outputs.*;
|
||||
@@ -503,25 +503,25 @@ public final class RecipeHandler
|
||||
|
||||
public static enum Recipe
|
||||
{
|
||||
ENERGIZED_SMELTER(MachineType.ENERGIZED_SMELTER.name, ItemStackInput.class, ItemStackOutput.class, SmeltingRecipe.class),
|
||||
ENRICHMENT_CHAMBER(MachineType.ENRICHMENT_CHAMBER.name, ItemStackInput.class, ItemStackOutput.class, EnrichmentRecipe.class),
|
||||
OSMIUM_COMPRESSOR(MachineType.OSMIUM_COMPRESSOR.name, AdvancedMachineInput.class, ItemStackOutput.class, OsmiumCompressorRecipe.class),
|
||||
COMBINER(MachineType.COMBINER.name, AdvancedMachineInput.class, ItemStackOutput.class, CombinerRecipe.class),
|
||||
CRUSHER(MachineType.CRUSHER.name, ItemStackInput.class, ItemStackOutput.class, CrusherRecipe.class),
|
||||
PURIFICATION_CHAMBER(MachineType.PURIFICATION_CHAMBER.name, AdvancedMachineInput.class, ItemStackOutput.class, PurificationRecipe.class),
|
||||
METALLURGIC_INFUSER(MachineType.METALLURGIC_INFUSER.name, InfusionInput.class, ItemStackOutput.class, MetallurgicInfuserRecipe.class),
|
||||
CHEMICAL_INFUSER(MachineType.CHEMICAL_INFUSER.name, ChemicalPairInput.class, GasOutput.class, ChemicalInfuserRecipe.class),
|
||||
CHEMICAL_OXIDIZER(MachineType.CHEMICAL_OXIDIZER.name, ItemStackInput.class, GasOutput.class, OxidationRecipe.class),
|
||||
CHEMICAL_INJECTION_CHAMBER(MachineType.CHEMICAL_INJECTION_CHAMBER.name, AdvancedMachineInput.class, ItemStackOutput.class, InjectionRecipe.class),
|
||||
ELECTROLYTIC_SEPARATOR(MachineType.ELECTROLYTIC_SEPARATOR.name, FluidInput.class, ChemicalPairOutput.class, SeparatorRecipe.class),
|
||||
PRECISION_SAWMILL(MachineType.PRECISION_SAWMILL.name, ItemStackInput.class, ChanceOutput.class, SawmillRecipe.class),
|
||||
CHEMICAL_DISSOLUTION_CHAMBER(MachineType.CHEMICAL_DISSOLUTION_CHAMBER.name, ItemStackInput.class, GasOutput.class, DissolutionRecipe.class),
|
||||
CHEMICAL_WASHER(MachineType.CHEMICAL_WASHER.name, GasInput.class, GasOutput.class, WasherRecipe.class),
|
||||
CHEMICAL_CRYSTALLIZER(MachineType.CHEMICAL_CRYSTALLIZER.name, GasInput.class, ItemStackOutput.class, CrystallizerRecipe.class),
|
||||
PRESSURIZED_REACTION_CHAMBER(MachineType.PRESSURIZED_REACTION_CHAMBER.name, PressurizedInput.class, PressurizedOutput.class, PressurizedRecipe.class),
|
||||
AMBIENT_ACCUMULATOR(MachineType.AMBIENT_ACCUMULATOR.name, IntegerInput.class, GasOutput.class, AmbientGasRecipe.class),
|
||||
ENERGIZED_SMELTER(MachineType.ENERGIZED_SMELTER.machineName, ItemStackInput.class, ItemStackOutput.class, SmeltingRecipe.class),
|
||||
ENRICHMENT_CHAMBER(MachineType.ENRICHMENT_CHAMBER.machineName, ItemStackInput.class, ItemStackOutput.class, EnrichmentRecipe.class),
|
||||
OSMIUM_COMPRESSOR(MachineType.OSMIUM_COMPRESSOR.machineName, AdvancedMachineInput.class, ItemStackOutput.class, OsmiumCompressorRecipe.class),
|
||||
COMBINER(MachineType.COMBINER.machineName, AdvancedMachineInput.class, ItemStackOutput.class, CombinerRecipe.class),
|
||||
CRUSHER(MachineType.CRUSHER.machineName, ItemStackInput.class, ItemStackOutput.class, CrusherRecipe.class),
|
||||
PURIFICATION_CHAMBER(MachineType.PURIFICATION_CHAMBER.machineName, AdvancedMachineInput.class, ItemStackOutput.class, PurificationRecipe.class),
|
||||
METALLURGIC_INFUSER(MachineType.METALLURGIC_INFUSER.machineName, InfusionInput.class, ItemStackOutput.class, MetallurgicInfuserRecipe.class),
|
||||
CHEMICAL_INFUSER(MachineType.CHEMICAL_INFUSER.machineName, ChemicalPairInput.class, GasOutput.class, ChemicalInfuserRecipe.class),
|
||||
CHEMICAL_OXIDIZER(MachineType.CHEMICAL_OXIDIZER.machineName, ItemStackInput.class, GasOutput.class, OxidationRecipe.class),
|
||||
CHEMICAL_INJECTION_CHAMBER(MachineType.CHEMICAL_INJECTION_CHAMBER.machineName, AdvancedMachineInput.class, ItemStackOutput.class, InjectionRecipe.class),
|
||||
ELECTROLYTIC_SEPARATOR(MachineType.ELECTROLYTIC_SEPARATOR.machineName, FluidInput.class, ChemicalPairOutput.class, SeparatorRecipe.class),
|
||||
PRECISION_SAWMILL(MachineType.PRECISION_SAWMILL.machineName, ItemStackInput.class, ChanceOutput.class, SawmillRecipe.class),
|
||||
CHEMICAL_DISSOLUTION_CHAMBER(MachineType.CHEMICAL_DISSOLUTION_CHAMBER.machineName, ItemStackInput.class, GasOutput.class, DissolutionRecipe.class),
|
||||
CHEMICAL_WASHER(MachineType.CHEMICAL_WASHER.machineName, GasInput.class, GasOutput.class, WasherRecipe.class),
|
||||
CHEMICAL_CRYSTALLIZER(MachineType.CHEMICAL_CRYSTALLIZER.machineName, GasInput.class, ItemStackOutput.class, CrystallizerRecipe.class),
|
||||
PRESSURIZED_REACTION_CHAMBER(MachineType.PRESSURIZED_REACTION_CHAMBER.machineName, PressurizedInput.class, PressurizedOutput.class, PressurizedRecipe.class),
|
||||
AMBIENT_ACCUMULATOR(MachineType.AMBIENT_ACCUMULATOR.machineName, IntegerInput.class, GasOutput.class, AmbientGasRecipe.class),
|
||||
SOLAR_EVAPORATION_PLANT("SolarEvaporationPlant", FluidInput.class, FluidOutput.class, SolarEvaporationRecipe.class),
|
||||
SOLAR_NEUTRON_ACTIVATOR(MachineType.SOLAR_NEUTRON_ACTIVATOR.name, GasInput.class, GasOutput.class, SolarNeutronRecipe.class);
|
||||
SOLAR_NEUTRON_ACTIVATOR(MachineType.SOLAR_NEUTRON_ACTIVATOR.machineName, GasInput.class, GasOutput.class, SolarNeutronRecipe.class);
|
||||
|
||||
private HashMap recipes;
|
||||
private String recipeName;
|
||||
|
||||
@@ -4,7 +4,7 @@ import mekanism.api.EnumColor;
|
||||
import mekanism.api.transmitters.TransmissionType;
|
||||
import mekanism.common.SideData;
|
||||
import mekanism.common.Tier.FactoryTier;
|
||||
import mekanism.common.block.BlockMachine.MachineType;
|
||||
import mekanism.common.block.states.BlockStateMachine;
|
||||
import mekanism.common.tile.component.TileComponentConfig;
|
||||
import mekanism.common.tile.component.TileComponentEjector;
|
||||
import mekanism.common.tile.component.TileComponentUpgrade;
|
||||
@@ -14,7 +14,7 @@ public class TileEntityAdvancedFactory extends TileEntityFactory
|
||||
{
|
||||
public TileEntityAdvancedFactory()
|
||||
{
|
||||
super(FactoryTier.ADVANCED, MachineType.ADVANCED_FACTORY);
|
||||
super(FactoryTier.ADVANCED, BlockStateMachine.MachineType.ADVANCED_FACTORY);
|
||||
|
||||
configComponent = new TileComponentConfig(this, TransmissionType.ITEM, TransmissionType.ENERGY, TransmissionType.GAS);
|
||||
|
||||
|
||||
@@ -14,7 +14,8 @@ import mekanism.common.Mekanism;
|
||||
import mekanism.common.base.IChunkLoadHandler;
|
||||
import mekanism.common.base.ITileComponent;
|
||||
import mekanism.common.base.ITileNetwork;
|
||||
import mekanism.common.block.BlockMachine.MachineType;
|
||||
import mekanism.common.block.states.BlockStateMachine.MachineType;
|
||||
import mekanism.common.block.states.BlockStateMachine;
|
||||
import mekanism.common.network.PacketDataRequest.DataRequestMessage;
|
||||
import mekanism.common.network.PacketTileEntity.TileEntityMessage;
|
||||
import mekanism.common.util.MekanismUtils;
|
||||
@@ -25,7 +26,6 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.ITickable;
|
||||
import net.minecraftforge.fml.common.Optional.Interface;
|
||||
import net.minecraftforge.fml.common.Optional.Method;
|
||||
|
||||
@@ -56,11 +56,11 @@ public abstract class TileEntityBasicBlock extends TileEntity implements IWrench
|
||||
{
|
||||
if(!worldObj.isRemote && general.destroyDisabledBlocks)
|
||||
{
|
||||
MachineType type = MachineType.get(getBlockType(), getBlockMetadata());
|
||||
MachineType type = BlockStateMachine.MachineType.get(getBlockType(), getBlockMetadata());
|
||||
|
||||
if(type != null && !type.isEnabled())
|
||||
{
|
||||
Mekanism.logger.info("[Mekanism] Destroying machine of type '" + type.name + "' at coords " + Coord4D.get(this) + " as according to config.");
|
||||
Mekanism.logger.info("[Mekanism] Destroying machine of type '" + type.machineName + "' at coords " + Coord4D.get(this) + " as according to config.");
|
||||
worldObj.setBlockToAir(getPos());
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ import mekanism.api.Range4D;
|
||||
import mekanism.api.energy.EnergizedItemManager;
|
||||
import mekanism.api.energy.IEnergizedItem;
|
||||
import mekanism.common.Mekanism;
|
||||
import mekanism.common.block.BlockMachine.MachineType;
|
||||
import mekanism.common.block.states.BlockStateMachine;
|
||||
import mekanism.common.entity.EntityRobit;
|
||||
import mekanism.common.network.PacketTileEntity.TileEntityMessage;
|
||||
import mekanism.common.util.MekanismUtils;
|
||||
@@ -21,10 +21,8 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.EnumParticleTypes;
|
||||
import net.minecraft.util.IChatComponent;
|
||||
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
@@ -45,7 +43,7 @@ public class TileEntityChargepad extends TileEntityNoisyElectricBlock
|
||||
|
||||
public TileEntityChargepad()
|
||||
{
|
||||
super("machine.chargepad", "Chargepad", MachineType.CHARGEPAD.baseEnergy);
|
||||
super("machine.chargepad", "Chargepad", BlockStateMachine.MachineType.CHARGEPAD.baseEnergy);
|
||||
inventory = new ItemStack[0];
|
||||
}
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ import mekanism.common.Mekanism;
|
||||
import mekanism.common.SideData;
|
||||
import mekanism.common.Upgrade;
|
||||
import mekanism.common.base.*;
|
||||
import mekanism.common.block.BlockMachine.MachineType;
|
||||
import mekanism.common.block.states.BlockStateMachine;
|
||||
import mekanism.common.network.PacketTileEntity.TileEntityMessage;
|
||||
import mekanism.common.recipe.RecipeHandler;
|
||||
import mekanism.common.recipe.inputs.GasInput;
|
||||
@@ -24,9 +24,7 @@ import mekanism.common.util.InventoryUtils;
|
||||
import mekanism.common.util.MekanismUtils;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.IChatComponent;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
@@ -70,7 +68,7 @@ public class TileEntityChemicalCrystallizer extends TileEntityNoisyElectricBlock
|
||||
|
||||
public TileEntityChemicalCrystallizer()
|
||||
{
|
||||
super("machine.crystallizer", "ChemicalCrystallizer", MachineType.CHEMICAL_CRYSTALLIZER.baseEnergy);
|
||||
super("machine.crystallizer", "ChemicalCrystallizer", BlockStateMachine.MachineType.CHEMICAL_CRYSTALLIZER.baseEnergy);
|
||||
|
||||
configComponent = new TileComponentConfig(this, TransmissionType.ITEM, TransmissionType.ENERGY, TransmissionType.GAS);
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ import mekanism.common.base.ITankManager;
|
||||
import mekanism.common.base.IRedstoneControl;
|
||||
import mekanism.common.base.ISustainedData;
|
||||
import mekanism.common.base.IUpgradeTile;
|
||||
import mekanism.common.block.BlockMachine.MachineType;
|
||||
import mekanism.common.block.states.BlockStateMachine;
|
||||
import mekanism.common.network.PacketTileEntity.TileEntityMessage;
|
||||
import mekanism.common.recipe.RecipeHandler;
|
||||
import mekanism.common.recipe.inputs.ItemStackInput;
|
||||
@@ -35,9 +35,7 @@ import mekanism.common.util.StatUtils;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.IChatComponent;
|
||||
|
||||
public class TileEntityChemicalDissolutionChamber extends TileEntityNoisyElectricBlock implements ITubeConnection, IRedstoneControl, IGasHandler, IUpgradeTile, ISustainedData, ITankManager
|
||||
{
|
||||
@@ -80,7 +78,7 @@ public class TileEntityChemicalDissolutionChamber extends TileEntityNoisyElectri
|
||||
|
||||
public TileEntityChemicalDissolutionChamber()
|
||||
{
|
||||
super("machine.dissolution", "ChemicalDissolutionChamber", MachineType.CHEMICAL_DISSOLUTION_CHAMBER.baseEnergy);
|
||||
super("machine.dissolution", "ChemicalDissolutionChamber", BlockStateMachine.MachineType.CHEMICAL_DISSOLUTION_CHAMBER.baseEnergy);
|
||||
inventory = new ItemStack[5];
|
||||
}
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ import mekanism.common.base.ITankManager;
|
||||
import mekanism.common.base.IRedstoneControl;
|
||||
import mekanism.common.base.ISustainedData;
|
||||
import mekanism.common.base.IUpgradeTile;
|
||||
import mekanism.common.block.BlockMachine.MachineType;
|
||||
import mekanism.common.block.states.BlockStateMachine;
|
||||
import mekanism.common.network.PacketTileEntity.TileEntityMessage;
|
||||
import mekanism.common.recipe.RecipeHandler;
|
||||
import mekanism.common.recipe.inputs.ChemicalPairInput;
|
||||
@@ -38,7 +38,6 @@ import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.EnumFacing.Axis;
|
||||
import net.minecraft.util.IChatComponent;
|
||||
|
||||
public class TileEntityChemicalInfuser extends TileEntityNoisyElectricBlock implements IGasHandler, ITubeConnection, IRedstoneControl, ISustainedData, IUpgradeTile, IUpgradeInfoHandler, ITankManager
|
||||
{
|
||||
@@ -73,7 +72,7 @@ public class TileEntityChemicalInfuser extends TileEntityNoisyElectricBlock impl
|
||||
|
||||
public TileEntityChemicalInfuser()
|
||||
{
|
||||
super("machine.cheminfuser", "ChemicalInfuser", MachineType.CHEMICAL_INFUSER.baseEnergy);
|
||||
super("machine.cheminfuser", "ChemicalInfuser", BlockStateMachine.MachineType.CHEMICAL_INFUSER.baseEnergy);
|
||||
inventory = new ItemStack[5];
|
||||
}
|
||||
|
||||
|
||||
@@ -8,28 +8,24 @@ import mekanism.api.gas.Gas;
|
||||
import mekanism.api.gas.GasRegistry;
|
||||
import mekanism.api.gas.GasStack;
|
||||
import mekanism.api.gas.GasTransmission;
|
||||
import mekanism.api.gas.IGasHandler;
|
||||
import mekanism.api.gas.IGasItem;
|
||||
import mekanism.api.gas.ITubeConnection;
|
||||
import mekanism.api.transmitters.TransmissionType;
|
||||
import mekanism.common.MekanismBlocks;
|
||||
import mekanism.common.SideData;
|
||||
import mekanism.common.block.BlockMachine.MachineType;
|
||||
import mekanism.common.block.states.BlockStateMachine;
|
||||
import mekanism.common.recipe.RecipeHandler.Recipe;
|
||||
import mekanism.common.recipe.machines.InjectionRecipe;
|
||||
import mekanism.common.util.InventoryUtils;
|
||||
import mekanism.common.util.MekanismUtils;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.IChatComponent;
|
||||
|
||||
public class TileEntityChemicalInjectionChamber extends TileEntityAdvancedElectricMachine<InjectionRecipe>
|
||||
{
|
||||
public TileEntityChemicalInjectionChamber()
|
||||
{
|
||||
super("injection", "ChemicalInjectionChamber", usage.chemicalInjectionChamberUsage, 1, 200, MachineType.CHEMICAL_INJECTION_CHAMBER.baseEnergy);
|
||||
super("injection", "ChemicalInjectionChamber", usage.chemicalInjectionChamberUsage, 1, 200, BlockStateMachine.MachineType.CHEMICAL_INJECTION_CHAMBER.baseEnergy);
|
||||
|
||||
configComponent.addSupported(TransmissionType.GAS);
|
||||
configComponent.addOutput(TransmissionType.GAS, new SideData("None", EnumColor.GREY, InventoryUtils.EMPTY));
|
||||
|
||||
@@ -20,7 +20,7 @@ import mekanism.common.base.ITankManager;
|
||||
import mekanism.common.base.IRedstoneControl;
|
||||
import mekanism.common.base.ISustainedData;
|
||||
import mekanism.common.base.IUpgradeTile;
|
||||
import mekanism.common.block.BlockMachine.MachineType;
|
||||
import mekanism.common.block.states.BlockStateMachine;
|
||||
import mekanism.common.network.PacketTileEntity.TileEntityMessage;
|
||||
import mekanism.common.recipe.RecipeHandler;
|
||||
import mekanism.common.recipe.inputs.ItemStackInput;
|
||||
@@ -32,10 +32,8 @@ import mekanism.common.util.MekanismUtils;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.EnumFacing.Axis;
|
||||
import net.minecraft.util.IChatComponent;
|
||||
|
||||
public class TileEntityChemicalOxidizer extends TileEntityNoisyElectricBlock implements ITubeConnection, IRedstoneControl, IUpgradeTile, ISustainedData, ITankManager
|
||||
{
|
||||
@@ -71,7 +69,7 @@ public class TileEntityChemicalOxidizer extends TileEntityNoisyElectricBlock imp
|
||||
|
||||
public TileEntityChemicalOxidizer()
|
||||
{
|
||||
super("machine.oxidizer", "ChemicalOxidizer", MachineType.CHEMICAL_OXIDIZER.baseEnergy);
|
||||
super("machine.oxidizer", "ChemicalOxidizer", BlockStateMachine.MachineType.CHEMICAL_OXIDIZER.baseEnergy);
|
||||
inventory = new ItemStack[4];
|
||||
}
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ import mekanism.common.base.IRedstoneControl;
|
||||
import mekanism.common.base.ISustainedData;
|
||||
import mekanism.common.base.ITankManager;
|
||||
import mekanism.common.base.IUpgradeTile;
|
||||
import mekanism.common.block.BlockMachine.MachineType;
|
||||
import mekanism.common.block.states.BlockStateMachine;
|
||||
import mekanism.common.network.PacketTileEntity.TileEntityMessage;
|
||||
import mekanism.common.recipe.RecipeHandler;
|
||||
import mekanism.common.recipe.inputs.GasInput;
|
||||
@@ -22,10 +22,8 @@ import mekanism.common.util.*;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.EnumFacing.Axis;
|
||||
import net.minecraft.util.IChatComponent;
|
||||
import net.minecraftforge.fluids.*;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -67,7 +65,7 @@ public class TileEntityChemicalWasher extends TileEntityNoisyElectricBlock imple
|
||||
|
||||
public TileEntityChemicalWasher()
|
||||
{
|
||||
super("machine.washer", "ChemicalWasher", MachineType.CHEMICAL_WASHER.baseEnergy);
|
||||
super("machine.washer", "ChemicalWasher", BlockStateMachine.MachineType.CHEMICAL_WASHER.baseEnergy);
|
||||
inventory = new ItemStack[5];
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ import mekanism.api.MekanismConfig.usage;
|
||||
import mekanism.api.gas.Gas;
|
||||
import mekanism.api.gas.GasRegistry;
|
||||
import mekanism.api.gas.GasStack;
|
||||
import mekanism.common.block.BlockMachine.MachineType;
|
||||
import mekanism.common.block.states.BlockStateMachine;
|
||||
import mekanism.common.recipe.RecipeHandler.Recipe;
|
||||
import mekanism.common.recipe.machines.CombinerRecipe;
|
||||
|
||||
@@ -14,14 +14,12 @@ import net.minecraft.block.Block;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
import net.minecraft.util.IChatComponent;
|
||||
|
||||
public class TileEntityCombiner extends TileEntityAdvancedElectricMachine<CombinerRecipe>
|
||||
{
|
||||
public TileEntityCombiner()
|
||||
{
|
||||
super("combiner", "Combiner", usage.combinerUsage, 1, 200, MachineType.COMBINER.baseEnergy);
|
||||
super("combiner", "Combiner", usage.combinerUsage, 1, 200, BlockStateMachine.MachineType.COMBINER.baseEnergy);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -3,7 +3,7 @@ package mekanism.common.tile;
|
||||
import java.util.Map;
|
||||
|
||||
import mekanism.api.MekanismConfig.usage;
|
||||
import mekanism.common.block.BlockMachine.MachineType;
|
||||
import mekanism.common.block.states.BlockStateMachine;
|
||||
import mekanism.common.recipe.RecipeHandler.Recipe;
|
||||
import mekanism.common.recipe.machines.CrusherRecipe;
|
||||
|
||||
@@ -14,7 +14,7 @@ public class TileEntityCrusher extends TileEntityElectricMachine<CrusherRecipe>
|
||||
{
|
||||
public TileEntityCrusher()
|
||||
{
|
||||
super("crusher", "Crusher", usage.crusherUsage, 200, MachineType.CRUSHER.baseEnergy);
|
||||
super("crusher", "Crusher", usage.crusherUsage, 200, BlockStateMachine.MachineType.CRUSHER.baseEnergy);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -11,7 +11,7 @@ import mekanism.common.HashList;
|
||||
import mekanism.common.Mekanism;
|
||||
import mekanism.common.Upgrade;
|
||||
import mekanism.common.base.*;
|
||||
import mekanism.common.block.BlockMachine.MachineType;
|
||||
import mekanism.common.block.states.BlockStateMachine;
|
||||
import mekanism.common.content.miner.MItemStackFilter;
|
||||
import mekanism.common.content.miner.MOreDictFilter;
|
||||
import mekanism.common.content.miner.MinerFilter;
|
||||
@@ -104,7 +104,7 @@ public class TileEntityDigitalMiner extends TileEntityElectricBlock implements I
|
||||
|
||||
public TileEntityDigitalMiner()
|
||||
{
|
||||
super("DigitalMiner", MachineType.DIGITAL_MINER.baseEnergy);
|
||||
super("DigitalMiner", BlockStateMachine.MachineType.DIGITAL_MINER.baseEnergy);
|
||||
inventory = new ItemStack[29];
|
||||
radius = 10;
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ import mekanism.common.Mekanism;
|
||||
import mekanism.common.Upgrade;
|
||||
import mekanism.common.Upgrade.IUpgradeInfoHandler;
|
||||
import mekanism.common.base.*;
|
||||
import mekanism.common.block.BlockMachine.MachineType;
|
||||
import mekanism.common.block.states.BlockStateMachine;
|
||||
import mekanism.common.integration.IComputerIntegration;
|
||||
import mekanism.common.network.PacketTileEntity.TileEntityMessage;
|
||||
import mekanism.common.recipe.RecipeHandler;
|
||||
@@ -84,7 +84,7 @@ public class TileEntityElectrolyticSeparator extends TileEntityElectricBlock imp
|
||||
|
||||
public TileEntityElectrolyticSeparator()
|
||||
{
|
||||
super("ElectrolyticSeparator", MachineType.ELECTROLYTIC_SEPARATOR.baseEnergy);
|
||||
super("ElectrolyticSeparator", BlockStateMachine.MachineType.ELECTROLYTIC_SEPARATOR.baseEnergy);
|
||||
inventory = new ItemStack[5];
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import mekanism.api.EnumColor;
|
||||
import mekanism.api.transmitters.TransmissionType;
|
||||
import mekanism.common.SideData;
|
||||
import mekanism.common.Tier.FactoryTier;
|
||||
import mekanism.common.block.BlockMachine.MachineType;
|
||||
import mekanism.common.block.states.BlockStateMachine;
|
||||
import mekanism.common.tile.component.TileComponentConfig;
|
||||
import mekanism.common.tile.component.TileComponentEjector;
|
||||
import mekanism.common.tile.component.TileComponentUpgrade;
|
||||
@@ -14,7 +14,7 @@ public class TileEntityEliteFactory extends TileEntityFactory
|
||||
{
|
||||
public TileEntityEliteFactory()
|
||||
{
|
||||
super(FactoryTier.ELITE, MachineType.ELITE_FACTORY);
|
||||
super(FactoryTier.ELITE, BlockStateMachine.MachineType.ELITE_FACTORY);
|
||||
|
||||
configComponent = new TileComponentConfig(this, TransmissionType.ITEM, TransmissionType.ENERGY, TransmissionType.GAS);
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ package mekanism.common.tile;
|
||||
import java.util.Map;
|
||||
|
||||
import mekanism.api.MekanismConfig.usage;
|
||||
import mekanism.common.block.BlockMachine.MachineType;
|
||||
import mekanism.common.block.states.BlockStateMachine;
|
||||
import mekanism.common.recipe.RecipeHandler.Recipe;
|
||||
import mekanism.common.recipe.inputs.ItemStackInput;
|
||||
import mekanism.common.recipe.machines.SmeltingRecipe;
|
||||
@@ -12,7 +12,7 @@ public class TileEntityEnergizedSmelter extends TileEntityElectricMachine<Smelti
|
||||
{
|
||||
public TileEntityEnergizedSmelter()
|
||||
{
|
||||
super("smelter", "EnergizedSmelter", usage.energizedSmelterUsage, 200, MachineType.ENERGIZED_SMELTER.baseEnergy);
|
||||
super("smelter", "EnergizedSmelter", usage.energizedSmelterUsage, 200, BlockStateMachine.MachineType.ENERGIZED_SMELTER.baseEnergy);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -3,7 +3,7 @@ package mekanism.common.tile;
|
||||
import java.util.Map;
|
||||
|
||||
import mekanism.api.MekanismConfig.usage;
|
||||
import mekanism.common.block.BlockMachine.MachineType;
|
||||
import mekanism.common.block.states.BlockStateMachine;
|
||||
import mekanism.common.recipe.RecipeHandler.Recipe;
|
||||
import mekanism.common.recipe.machines.EnrichmentRecipe;
|
||||
|
||||
@@ -14,7 +14,7 @@ public class TileEntityEnrichmentChamber extends TileEntityElectricMachine<Enric
|
||||
{
|
||||
public TileEntityEnrichmentChamber()
|
||||
{
|
||||
super("enrichment", "EnrichmentChamber", usage.enrichmentChamberUsage, 200, MachineType.ENRICHMENT_CHAMBER.baseEnergy);
|
||||
super("enrichment", "EnrichmentChamber", usage.enrichmentChamberUsage, 200, BlockStateMachine.MachineType.ENRICHMENT_CHAMBER.baseEnergy);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -33,7 +33,8 @@ import mekanism.common.base.IRedstoneControl;
|
||||
import mekanism.common.base.ISideConfiguration;
|
||||
import mekanism.common.base.IUpgradeTile;
|
||||
import mekanism.common.base.SoundWrapper;
|
||||
import mekanism.common.block.BlockMachine.MachineType;
|
||||
import mekanism.common.block.states.BlockStateMachine.MachineType;
|
||||
import mekanism.common.block.states.BlockStateMachine;
|
||||
import mekanism.common.integration.IComputerIntegration;
|
||||
import mekanism.common.network.PacketTileEntity.TileEntityMessage;
|
||||
import mekanism.common.recipe.machines.AdvancedMachineRecipe;
|
||||
@@ -49,7 +50,6 @@ import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraftforge.client.model.obj.OBJModel;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
@@ -117,7 +117,7 @@ public class TileEntityFactory extends TileEntityNoisyElectricBlock implements I
|
||||
|
||||
public TileEntityFactory()
|
||||
{
|
||||
this(FactoryTier.BASIC, MachineType.BASIC_FACTORY);
|
||||
this(FactoryTier.BASIC, BlockStateMachine.MachineType.BASIC_FACTORY);
|
||||
|
||||
configComponent = new TileComponentConfig(this, TransmissionType.ITEM, TransmissionType.ENERGY, TransmissionType.GAS);
|
||||
|
||||
@@ -142,7 +142,7 @@ public class TileEntityFactory extends TileEntityNoisyElectricBlock implements I
|
||||
|
||||
public TileEntityFactory(FactoryTier type, MachineType machine)
|
||||
{
|
||||
super("null", machine.name, machine.baseEnergy);
|
||||
super("null", machine.machineName, machine.baseEnergy);
|
||||
|
||||
tier = type;
|
||||
inventory = new ItemStack[5+type.processes*2];
|
||||
|
||||
@@ -6,7 +6,7 @@ import mekanism.api.EnumColor;
|
||||
import mekanism.api.IConfigurable;
|
||||
import mekanism.api.MekanismConfig.usage;
|
||||
import mekanism.common.base.ISustainedTank;
|
||||
import mekanism.common.block.BlockMachine.MachineType;
|
||||
import mekanism.common.block.states.BlockStateMachine;
|
||||
import mekanism.common.integration.IComputerIntegration;
|
||||
import mekanism.common.util.*;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
@@ -38,7 +38,7 @@ public class TileEntityFluidicPlenisher extends TileEntityElectricBlock implemen
|
||||
|
||||
public TileEntityFluidicPlenisher()
|
||||
{
|
||||
super("FluidicPlenisher", MachineType.FLUIDIC_PLENISHER.baseEnergy);
|
||||
super("FluidicPlenisher", BlockStateMachine.MachineType.FLUIDIC_PLENISHER.baseEnergy);
|
||||
inventory = new ItemStack[3];
|
||||
}
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ import mekanism.api.Range4D;
|
||||
import mekanism.common.HashList;
|
||||
import mekanism.common.Mekanism;
|
||||
import mekanism.common.base.*;
|
||||
import mekanism.common.block.BlockMachine.MachineType;
|
||||
import mekanism.common.block.states.BlockStateMachine;
|
||||
import mekanism.common.content.transporter.Finder.FirstFinder;
|
||||
import mekanism.common.content.transporter.*;
|
||||
import mekanism.common.network.PacketTileEntity.TileEntityMessage;
|
||||
@@ -22,7 +22,6 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.client.model.obj.OBJModel;
|
||||
import net.minecraftforge.common.util.Constants.NBT;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
|
||||
@@ -55,7 +54,7 @@ public class TileEntityLogisticalSorter extends TileEntityElectricBlock implemen
|
||||
|
||||
public TileEntityLogisticalSorter()
|
||||
{
|
||||
super("LogisticalSorter", MachineType.LOGISTICAL_SORTER.baseEnergy);
|
||||
super("LogisticalSorter", BlockStateMachine.MachineType.LOGISTICAL_SORTER.baseEnergy);
|
||||
inventory = new ItemStack[1];
|
||||
doAutoSync = false;
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ import mekanism.common.base.IEjector;
|
||||
import mekanism.common.base.IRedstoneControl;
|
||||
import mekanism.common.base.ISideConfiguration;
|
||||
import mekanism.common.base.IUpgradeTile;
|
||||
import mekanism.common.block.BlockMachine.MachineType;
|
||||
import mekanism.common.block.states.BlockStateMachine;
|
||||
import mekanism.common.integration.IComputerIntegration;
|
||||
import mekanism.common.network.PacketTileEntity.TileEntityMessage;
|
||||
import mekanism.common.recipe.RecipeHandler;
|
||||
@@ -76,7 +76,7 @@ public class TileEntityMetallurgicInfuser extends TileEntityNoisyElectricBlock i
|
||||
|
||||
public TileEntityMetallurgicInfuser()
|
||||
{
|
||||
super("machine.metalinfuser", "MetallurgicInfuser", MachineType.METALLURGIC_INFUSER.baseEnergy);
|
||||
super("machine.metalinfuser", "MetallurgicInfuser", BlockStateMachine.MachineType.METALLURGIC_INFUSER.baseEnergy);
|
||||
|
||||
configComponent = new TileComponentConfig(this, TransmissionType.ITEM, TransmissionType.ENERGY);
|
||||
|
||||
|
||||
@@ -9,20 +9,14 @@ import java.util.List;
|
||||
import mekanism.api.Coord4D;
|
||||
import mekanism.api.IFilterAccess;
|
||||
import mekanism.api.Range4D;
|
||||
import mekanism.api.infuse.InfuseRegistry;
|
||||
import mekanism.common.HashList;
|
||||
import mekanism.common.Mekanism;
|
||||
import mekanism.common.MekanismItems;
|
||||
import mekanism.common.OreDictCache;
|
||||
import mekanism.common.PacketHandler;
|
||||
import mekanism.common.base.IRedstoneControl;
|
||||
import mekanism.common.base.ISustainedData;
|
||||
import mekanism.common.block.BlockMachine.MachineType;
|
||||
import mekanism.common.block.states.BlockStateMachine;
|
||||
import mekanism.common.network.PacketTileEntity.TileEntityMessage;
|
||||
import mekanism.common.recipe.RecipeHandler;
|
||||
import mekanism.common.recipe.RecipeHandler.Recipe;
|
||||
import mekanism.common.recipe.inputs.InfusionInput;
|
||||
import mekanism.common.util.ChargeUtils;
|
||||
import mekanism.common.util.InventoryUtils;
|
||||
import mekanism.common.util.MekanismUtils;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
@@ -48,7 +42,7 @@ public class TileEntityOredictionificator extends TileEntityContainerBlock imple
|
||||
|
||||
public TileEntityOredictionificator()
|
||||
{
|
||||
super(MachineType.OREDICTIONIFICATOR.name);
|
||||
super(BlockStateMachine.MachineType.OREDICTIONIFICATOR.machineName);
|
||||
|
||||
inventory = new ItemStack[2];
|
||||
doAutoSync = false;
|
||||
|
||||
@@ -6,9 +6,8 @@ import mekanism.api.MekanismConfig.usage;
|
||||
import mekanism.api.gas.Gas;
|
||||
import mekanism.api.gas.GasRegistry;
|
||||
import mekanism.api.gas.GasStack;
|
||||
import mekanism.common.block.BlockMachine.MachineType;
|
||||
import mekanism.common.block.states.BlockStateMachine;
|
||||
import mekanism.common.recipe.RecipeHandler.Recipe;
|
||||
import mekanism.common.recipe.inputs.AdvancedMachineInput;
|
||||
import mekanism.common.recipe.machines.OsmiumCompressorRecipe;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -18,7 +17,7 @@ public class TileEntityOsmiumCompressor extends TileEntityAdvancedElectricMachin
|
||||
{
|
||||
public TileEntityOsmiumCompressor()
|
||||
{
|
||||
super("compressor", "OsmiumCompressor", usage.osmiumCompressorUsage, 1, 200, MachineType.OSMIUM_COMPRESSOR.baseEnergy);
|
||||
super("compressor", "OsmiumCompressor", usage.osmiumCompressorUsage, 1, 200, BlockStateMachine.MachineType.OSMIUM_COMPRESSOR.baseEnergy);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -9,7 +9,7 @@ import mekanism.common.SideData;
|
||||
import mekanism.common.Upgrade;
|
||||
import mekanism.common.base.ISustainedData;
|
||||
import mekanism.common.base.ITankManager;
|
||||
import mekanism.common.block.BlockMachine.MachineType;
|
||||
import mekanism.common.block.states.BlockStateMachine;
|
||||
import mekanism.common.item.ItemUpgrade;
|
||||
import mekanism.common.recipe.RecipeHandler;
|
||||
import mekanism.common.recipe.inputs.PressurizedInput;
|
||||
@@ -40,7 +40,7 @@ public class TileEntityPRC extends TileEntityBasicMachine<PressurizedInput, Pres
|
||||
|
||||
public TileEntityPRC()
|
||||
{
|
||||
super("prc", MachineType.PRESSURIZED_REACTION_CHAMBER.name, new ResourceLocation("mekanism", "gui/GuiPRC.png"), usage.pressurizedReactionBaseUsage, 100, MachineType.PRESSURIZED_REACTION_CHAMBER.baseEnergy);
|
||||
super("prc", BlockStateMachine.MachineType.PRESSURIZED_REACTION_CHAMBER.machineName, new ResourceLocation("mekanism", "gui/GuiPRC.png"), usage.pressurizedReactionBaseUsage, 100, BlockStateMachine.MachineType.PRESSURIZED_REACTION_CHAMBER.baseEnergy);
|
||||
|
||||
configComponent = new TileComponentConfig(this, TransmissionType.ITEM, TransmissionType.ENERGY, TransmissionType.FLUID, TransmissionType.GAS);
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ package mekanism.common.tile;
|
||||
import java.util.Map;
|
||||
|
||||
import mekanism.api.MekanismConfig.usage;
|
||||
import mekanism.common.block.BlockMachine.MachineType;
|
||||
import mekanism.common.block.states.BlockStateMachine;
|
||||
import mekanism.common.recipe.RecipeHandler.Recipe;
|
||||
import mekanism.common.recipe.inputs.ItemStackInput;
|
||||
import mekanism.common.recipe.machines.SawmillRecipe;
|
||||
@@ -17,7 +17,7 @@ public class TileEntityPrecisionSawmill extends TileEntityChanceMachine<SawmillR
|
||||
{
|
||||
public TileEntityPrecisionSawmill()
|
||||
{
|
||||
super("sawmill", "PrecisionSawmill", MekanismUtils.getResource(ResourceType.GUI, "GuiBasicMachine.png"), usage.precisionSawmillUsage, 200, MachineType.PRECISION_SAWMILL.baseEnergy);
|
||||
super("sawmill", "PrecisionSawmill", MekanismUtils.getResource(ResourceType.GUI, "GuiBasicMachine.png"), usage.precisionSawmillUsage, 200, BlockStateMachine.MachineType.PRECISION_SAWMILL.baseEnergy);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -7,11 +7,9 @@ import mekanism.api.gas.Gas;
|
||||
import mekanism.api.gas.GasRegistry;
|
||||
import mekanism.api.gas.GasStack;
|
||||
import mekanism.api.gas.GasTransmission;
|
||||
import mekanism.api.gas.IGasHandler;
|
||||
import mekanism.api.gas.IGasItem;
|
||||
import mekanism.api.gas.ITubeConnection;
|
||||
import mekanism.common.MekanismBlocks;
|
||||
import mekanism.common.block.BlockMachine.MachineType;
|
||||
import mekanism.common.block.states.BlockStateMachine;
|
||||
import mekanism.common.recipe.RecipeHandler.Recipe;
|
||||
import mekanism.common.recipe.machines.PurificationRecipe;
|
||||
|
||||
@@ -24,7 +22,7 @@ public class TileEntityPurificationChamber extends TileEntityAdvancedElectricMac
|
||||
{
|
||||
public TileEntityPurificationChamber()
|
||||
{
|
||||
super("purification", "PurificationChamber", usage.purificationChamberUsage, 1, 200, MachineType.PURIFICATION_CHAMBER.baseEnergy);
|
||||
super("purification", "PurificationChamber", usage.purificationChamberUsage, 1, 200, BlockStateMachine.MachineType.PURIFICATION_CHAMBER.baseEnergy);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -23,7 +23,7 @@ import mekanism.common.base.ITankManager;
|
||||
import mekanism.common.base.IRedstoneControl;
|
||||
import mekanism.common.base.ISustainedData;
|
||||
import mekanism.common.base.IUpgradeTile;
|
||||
import mekanism.common.block.BlockMachine.MachineType;
|
||||
import mekanism.common.block.states.BlockStateMachine;
|
||||
import mekanism.common.network.PacketTileEntity.TileEntityMessage;
|
||||
import mekanism.common.tile.component.TileComponentUpgrade;
|
||||
import mekanism.common.util.ChargeUtils;
|
||||
@@ -80,7 +80,7 @@ public class TileEntityRotaryCondensentrator extends TileEntityElectricBlock imp
|
||||
|
||||
public TileEntityRotaryCondensentrator()
|
||||
{
|
||||
super("RotaryCondensentrator", MachineType.ROTARY_CONDENSENTRATOR.baseEnergy);
|
||||
super("RotaryCondensentrator", BlockStateMachine.MachineType.ROTARY_CONDENSENTRATOR.baseEnergy);
|
||||
inventory = new ItemStack[6];
|
||||
}
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ import mekanism.api.Range4D;
|
||||
import mekanism.common.Mekanism;
|
||||
import mekanism.common.base.IActiveState;
|
||||
import mekanism.common.base.IRedstoneControl;
|
||||
import mekanism.common.block.BlockMachine.MachineType;
|
||||
import mekanism.common.block.states.BlockStateMachine;
|
||||
import mekanism.common.network.PacketTileEntity.TileEntityMessage;
|
||||
import mekanism.common.util.ChargeUtils;
|
||||
import mekanism.common.util.MekanismUtils;
|
||||
@@ -35,7 +35,7 @@ public class TileEntitySeismicVibrator extends TileEntityElectricBlock implement
|
||||
|
||||
public TileEntitySeismicVibrator()
|
||||
{
|
||||
super("SeismicVibrator", MachineType.SEISMIC_VIBRATOR.baseEnergy);
|
||||
super("SeismicVibrator", BlockStateMachine.MachineType.SEISMIC_VIBRATOR.baseEnergy);
|
||||
|
||||
inventory = new ItemStack[1];
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ import mekanism.api.Coord4D;
|
||||
import mekanism.common.Mekanism;
|
||||
import mekanism.common.MekanismBlocks;
|
||||
import mekanism.common.PacketHandler;
|
||||
import mekanism.common.block.BlockMachine.MachineType;
|
||||
import mekanism.common.block.states.BlockStateMachine;
|
||||
import mekanism.common.chunkloading.IChunkLoader;
|
||||
import mekanism.common.frequency.Frequency;
|
||||
import mekanism.common.frequency.FrequencyManager;
|
||||
@@ -69,7 +69,7 @@ public class TileEntityTeleporter extends TileEntityElectricBlock implements ICo
|
||||
|
||||
public TileEntityTeleporter()
|
||||
{
|
||||
super("Teleporter", MachineType.TELEPORTER.baseEnergy);
|
||||
super("Teleporter", BlockStateMachine.MachineType.TELEPORTER.baseEnergy);
|
||||
inventory = new ItemStack[1];
|
||||
}
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ import mekanism.api.gas.IGasItem;
|
||||
import mekanism.common.Upgrade;
|
||||
import mekanism.common.base.IEnergyCube;
|
||||
import mekanism.common.base.IFactory;
|
||||
import mekanism.common.block.BlockMachine.MachineType;
|
||||
import mekanism.common.block.states.BlockStateMachine;
|
||||
import mekanism.common.item.ItemBlockBasic;
|
||||
import mekanism.common.recipe.ShapedMekanismRecipe;
|
||||
import mekanism.common.recipe.ShapelessMekanismRecipe;
|
||||
@@ -104,7 +104,7 @@ public class RecipeUtils
|
||||
|
||||
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;
|
||||
return BlockStateMachine.MachineType.get(stack) == BlockStateMachine.MachineType.BASIC_FACTORY || BlockStateMachine.MachineType.get(stack) == BlockStateMachine.MachineType.ADVANCED_FACTORY || BlockStateMachine.MachineType.get(stack) == BlockStateMachine.MachineType.ELITE_FACTORY;
|
||||
}
|
||||
|
||||
public static ItemStack getCraftingResult(InventoryCrafting inv, ItemStack toReturn)
|
||||
@@ -168,7 +168,7 @@ public class RecipeUtils
|
||||
}
|
||||
}
|
||||
|
||||
if(MachineType.get(toReturn) != null && MachineType.get(toReturn).supportsUpgrades)
|
||||
if(BlockStateMachine.MachineType.get(toReturn) != null && BlockStateMachine.MachineType.get(toReturn).supportsUpgrades)
|
||||
{
|
||||
Map<Upgrade, Integer> upgrades = new HashMap<Upgrade, Integer>();
|
||||
|
||||
@@ -176,7 +176,7 @@ public class RecipeUtils
|
||||
{
|
||||
ItemStack itemstack = inv.getStackInSlot(i);
|
||||
|
||||
if(itemstack != null && MachineType.get(itemstack) != null && MachineType.get(itemstack).supportsUpgrades)
|
||||
if(itemstack != null && BlockStateMachine.MachineType.get(itemstack) != null && BlockStateMachine.MachineType.get(itemstack).supportsUpgrades)
|
||||
{
|
||||
Map<Upgrade, Integer> stackMap = Upgrade.buildMap(itemstack.getTagCompound());
|
||||
|
||||
|
||||
Reference in new issue
Block a user