mirror of
https://github.com/Thorfusion/Mekanism-Community-Edition.git
synced 2026-11-25 22:34:21 +00:00
Merge branch 'v9' into 1.8.9
Forgot to complete the merge so some weird stuff might have ended up in the patch. Oops.
This commit is contained in:
commit
25d0b7441b
35 files changed
+439
-256
No files matched your search
@@ -131,6 +131,11 @@ public class MekanismConfig
|
||||
|
||||
public static int windGenerationMinY;
|
||||
public static int windGenerationMaxY;
|
||||
|
||||
public static int turbineBladesPerCoil;
|
||||
public static double turbineBaseEnergyPerSteam;
|
||||
public static double turbineVentGasFlow;
|
||||
public static double turbineDisperserGasFlow;
|
||||
}
|
||||
|
||||
public static class tools
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package mekanism.api.infuse;
|
||||
|
||||
import mekanism.common.Resource;
|
||||
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
@@ -13,29 +15,29 @@ public final class InfuseType
|
||||
/** The name of this infusion */
|
||||
public String name;
|
||||
|
||||
/** The location of this infuse's GUI texture */
|
||||
public ResourceLocation texture;
|
||||
|
||||
/** The infuse's GUI texture X offset. */
|
||||
public int texX;
|
||||
|
||||
/** The infuse's GUI texture Y offset. */
|
||||
public int texY;
|
||||
/** This infuse GUI's icon */
|
||||
public ResourceLocation icon;
|
||||
|
||||
/** The location of this infuse GUI's icon */
|
||||
public String textureLocation;
|
||||
|
||||
/** The unlocalized name of this type. */
|
||||
public String unlocalizedName;
|
||||
|
||||
public InfuseType(String s, ResourceLocation location, int x, int y)
|
||||
public InfuseType(String s, String tex)
|
||||
{
|
||||
name = s;
|
||||
texture = location;
|
||||
texX = x;
|
||||
texY = y;
|
||||
textureLocation = tex;
|
||||
}
|
||||
|
||||
public void setIcon(ResourceLocation i)
|
||||
{
|
||||
icon = i;
|
||||
}
|
||||
|
||||
public InfuseType setUnlocalizedName(String name)
|
||||
{
|
||||
unlocalizedName = name;
|
||||
unlocalizedName = "infuse." + name;
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
package mekanism.client.gui;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import mekanism.api.gas.GasStack;
|
||||
import mekanism.api.Coord4D;
|
||||
import mekanism.api.util.ListUtils;
|
||||
import mekanism.client.gui.element.GuiEnergyInfo;
|
||||
import mekanism.client.gui.element.GuiEnergyInfo.IInfoHandler;
|
||||
@@ -13,13 +14,21 @@ import mekanism.client.gui.element.GuiSortingTab;
|
||||
import mekanism.client.gui.element.GuiTransporterConfigTab;
|
||||
import mekanism.client.gui.element.GuiUpgradeTab;
|
||||
import mekanism.client.render.MekanismRenderer;
|
||||
import mekanism.client.sound.SoundHandler;
|
||||
import mekanism.common.Mekanism;
|
||||
import mekanism.common.Tier.FactoryTier;
|
||||
import mekanism.common.base.IFactory.RecipeType;
|
||||
import mekanism.common.inventory.container.ContainerFactory;
|
||||
import mekanism.common.item.ItemGaugeDropper;
|
||||
import mekanism.common.network.PacketTileEntity.TileEntityMessage;
|
||||
import mekanism.common.tile.TileEntityFactory;
|
||||
import mekanism.common.util.LangUtils;
|
||||
import mekanism.common.util.MekanismUtils;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
|
||||
import org.lwjgl.input.Keyboard;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
@@ -69,7 +78,14 @@ public class GuiFactory extends GuiMekanism
|
||||
|
||||
if(xAxis >= 8 && xAxis <= 168 && yAxis >= 78 && yAxis <= 83)
|
||||
{
|
||||
drawCreativeTabHoveringText(tileEntity.gasTank.getGas() != null ? tileEntity.gasTank.getGas().getGas().getLocalizedName() + ": " + tileEntity.gasTank.getStored() : LangUtils.localize("gui.none"), xAxis, yAxis);
|
||||
if(tileEntity.recipeType.usesFuel())
|
||||
{
|
||||
drawCreativeTabHoveringText(tileEntity.gasTank.getGas() != null ? tileEntity.gasTank.getGas().getGas().getLocalizedName() + ": " + tileEntity.gasTank.getStored() : LangUtils.localize("gui.none"), xAxis, yAxis);
|
||||
}
|
||||
else if(tileEntity.recipeType == RecipeType.INFUSING)
|
||||
{
|
||||
drawCreativeTabHoveringText(tileEntity.infuseStored.type != null ? tileEntity.infuseStored.type.getLocalizedName() + ": " + tileEntity.infuseStored.amount : LangUtils.localize("gui.empty"), xAxis, yAxis);
|
||||
}
|
||||
}
|
||||
|
||||
super.drawGuiContainerForegroundLayer(mouseX, mouseY);
|
||||
@@ -92,48 +108,40 @@ public class GuiFactory extends GuiMekanism
|
||||
displayInt = tileEntity.getScaledEnergyLevel(52);
|
||||
drawTexturedModalRect(guiWidth + 165, guiHeight + 17 + 52 - displayInt, 176, 52 - displayInt, 4, displayInt);
|
||||
|
||||
if(tileEntity.tier == FactoryTier.BASIC)
|
||||
int xOffset = tileEntity.tier == FactoryTier.BASIC ? 59 : (tileEntity.tier == FactoryTier.ADVANCED ?
|
||||
39 : 33);
|
||||
int xDistance = tileEntity.tier == FactoryTier.BASIC ? 38 : (tileEntity.tier == FactoryTier.ADVANCED ?
|
||||
26 : 19);
|
||||
|
||||
for(int i = 0; i < tileEntity.tier.processes; i++)
|
||||
{
|
||||
for(int i = 0; i < tileEntity.tier.processes; i++)
|
||||
{
|
||||
int xPos = 59 + (i*38);
|
||||
int xPos = xOffset + (i*xDistance);
|
||||
|
||||
displayInt = tileEntity.getScaledProgress(20, i);
|
||||
drawTexturedModalRect(guiWidth + xPos, guiHeight + 33, 176, 52, 8, displayInt);
|
||||
}
|
||||
}
|
||||
else if(tileEntity.tier == FactoryTier.ADVANCED)
|
||||
{
|
||||
for(int i = 0; i < tileEntity.tier.processes; i++)
|
||||
{
|
||||
int xPos = 39 + (i*26);
|
||||
|
||||
displayInt = tileEntity.getScaledProgress(20, i);
|
||||
drawTexturedModalRect(guiWidth + xPos, guiHeight + 33, 176, 52, 8, displayInt);
|
||||
}
|
||||
}
|
||||
else if(tileEntity.tier == FactoryTier.ELITE)
|
||||
{
|
||||
for(int i = 0; i < tileEntity.tier.processes; i++)
|
||||
{
|
||||
int xPos = 33 + (i*19);
|
||||
|
||||
displayInt = tileEntity.getScaledProgress(20, i);
|
||||
drawTexturedModalRect(guiWidth + xPos, guiHeight + 33, 176, 52, 8, displayInt);
|
||||
}
|
||||
displayInt = tileEntity.getScaledProgress(20, i);
|
||||
drawTexturedModalRect(guiWidth + xPos, guiHeight + 33, 176, 52, 8, displayInt);
|
||||
}
|
||||
|
||||
if(tileEntity.getScaledGasLevel(160) > 0)
|
||||
if(tileEntity.recipeType.usesFuel())
|
||||
{
|
||||
displayGauge(8, 78, tileEntity.getScaledGasLevel(160), 5, tileEntity.gasTank.getGas());
|
||||
if(tileEntity.getScaledGasLevel(160) > 0)
|
||||
{
|
||||
displayGauge(8, 78, tileEntity.getScaledGasLevel(160), 5, tileEntity.gasTank.getGas().getGas().getIcon());
|
||||
}
|
||||
}
|
||||
else if(tileEntity.recipeType == RecipeType.INFUSING)
|
||||
{
|
||||
if(tileEntity.getScaledInfuseLevel(160) > 0)
|
||||
{
|
||||
displayGauge(8, 78, tileEntity.getScaledInfuseLevel(160), 5, tileEntity.infuseStored.type.icon);
|
||||
}
|
||||
}
|
||||
|
||||
super.drawGuiContainerBackgroundLayer(partialTick, mouseX, mouseY);
|
||||
}
|
||||
|
||||
public void displayGauge(int xPos, int yPos, int sizeX, int sizeY, GasStack gas)
|
||||
public void displayGauge(int xPos, int yPos, int sizeX, int sizeY, IIcon icon)
|
||||
{
|
||||
if(gas == null)
|
||||
if(icon == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -142,6 +150,32 @@ public class GuiFactory extends GuiMekanism
|
||||
int guiHeight = (height - ySize) / 2;
|
||||
|
||||
mc.renderEngine.bindTexture(MekanismRenderer.getBlocksTexture());
|
||||
drawTexturedModelRectFromIcon(guiWidth + xPos, guiHeight + yPos, gas.getGas().getIcon(), sizeX, sizeY);
|
||||
drawTexturedModelRectFromIcon(guiWidth + xPos, guiHeight + yPos, icon, sizeX, sizeY);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void mouseClicked(int x, int y, int button)
|
||||
{
|
||||
super.mouseClicked(x, y, button);
|
||||
|
||||
if(button == 0 || Keyboard.isKeyDown(Keyboard.KEY_LSHIFT))
|
||||
{
|
||||
int xAxis = (x - (width - xSize) / 2);
|
||||
int yAxis = (y - (height - ySize) / 2);
|
||||
|
||||
if(xAxis > 8 && xAxis < 168 && yAxis > 78 && yAxis < 83)
|
||||
{
|
||||
ItemStack stack = mc.thePlayer.inventory.getItemStack();
|
||||
|
||||
if(stack != null && stack.getItem() instanceof ItemGaugeDropper)
|
||||
{
|
||||
ArrayList data = new ArrayList();
|
||||
data.add(1);
|
||||
|
||||
Mekanism.packetHandler.sendToServer(new TileEntityMessage(Coord4D.get(tileEntity), data));
|
||||
SoundHandler.playSound("gui.button.press");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -9,15 +9,16 @@ import mekanism.client.gui.element.GuiEnergyInfo;
|
||||
import mekanism.client.gui.element.GuiEnergyInfo.IInfoHandler;
|
||||
import mekanism.client.gui.element.GuiPowerBar;
|
||||
import mekanism.client.gui.element.GuiProgress;
|
||||
import mekanism.client.gui.element.GuiRedstoneControl;
|
||||
import mekanism.client.gui.element.GuiProgress.IProgressInfoHandler;
|
||||
import mekanism.client.gui.element.GuiProgress.ProgressBar;
|
||||
import mekanism.client.gui.element.GuiRedstoneControl;
|
||||
import mekanism.client.gui.element.GuiSideConfigurationTab;
|
||||
import mekanism.client.gui.element.GuiSlot;
|
||||
import mekanism.client.gui.element.GuiSlot.SlotOverlay;
|
||||
import mekanism.client.gui.element.GuiSlot.SlotType;
|
||||
import mekanism.client.gui.element.GuiTransporterConfigTab;
|
||||
import mekanism.client.gui.element.GuiUpgradeTab;
|
||||
import mekanism.client.render.MekanismRenderer;
|
||||
import mekanism.client.sound.SoundHandler;
|
||||
import mekanism.common.Mekanism;
|
||||
import mekanism.common.inventory.container.ContainerMetallurgicInfuser;
|
||||
@@ -100,9 +101,9 @@ public class GuiMetallurgicInfuser extends GuiMekanism
|
||||
|
||||
if(tileEntity.infuseStored.type != null)
|
||||
{
|
||||
mc.renderEngine.bindTexture(MekanismRenderer.getBlocksTexture());
|
||||
int displayInt = tileEntity.getScaledInfuseLevel(52);
|
||||
mc.renderEngine.bindTexture(tileEntity.infuseStored.type.texture);
|
||||
drawTexturedModalRect(guiWidth + 7, guiHeight + 17 + 52 - displayInt, tileEntity.infuseStored.type.texX, tileEntity.infuseStored.type.texY + 52 - displayInt, 4, displayInt);
|
||||
drawTexturedRectFromIcon(guiWidth + 7, guiHeight + 17 + 52 - displayInt, tileEntity.infuseStored.type.icon, 4, displayInt);
|
||||
}
|
||||
|
||||
super.drawGuiContainerBackgroundLayer(partialTick, mouseX, mouseY);
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
package mekanism.client.nei;
|
||||
|
||||
import java.awt.*;
|
||||
import static codechicken.lib.gui.GuiDraw.changeTexture;
|
||||
import static codechicken.lib.gui.GuiDraw.drawTexturedModalRect;
|
||||
|
||||
import java.awt.Rectangle;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
@@ -12,13 +15,14 @@ import mekanism.api.infuse.InfuseType;
|
||||
import mekanism.client.gui.GuiMetallurgicInfuser;
|
||||
import mekanism.client.gui.element.GuiElement;
|
||||
import mekanism.client.gui.element.GuiPowerBar;
|
||||
import mekanism.client.gui.element.GuiProgress;
|
||||
import mekanism.client.gui.element.GuiSlot;
|
||||
import mekanism.client.gui.element.GuiPowerBar.IPowerInfoHandler;
|
||||
import mekanism.client.gui.element.GuiProgress;
|
||||
import mekanism.client.gui.element.GuiProgress.IProgressInfoHandler;
|
||||
import mekanism.client.gui.element.GuiProgress.ProgressBar;
|
||||
import mekanism.client.gui.element.GuiSlot;
|
||||
import mekanism.client.gui.element.GuiSlot.SlotOverlay;
|
||||
import mekanism.client.gui.element.GuiSlot.SlotType;
|
||||
import mekanism.client.render.MekanismRenderer;
|
||||
import mekanism.common.recipe.RecipeHandler.Recipe;
|
||||
import mekanism.common.recipe.machines.MetallurgicInfuserRecipe;
|
||||
import mekanism.common.util.LangUtils;
|
||||
@@ -31,8 +35,6 @@ import org.lwjgl.opengl.GL11;
|
||||
import codechicken.nei.NEIServerUtils;
|
||||
import codechicken.nei.PositionedStack;
|
||||
import codechicken.nei.recipe.TemplateRecipeHandler;
|
||||
import static codechicken.lib.gui.GuiDraw.changeTexture;
|
||||
import static codechicken.lib.gui.GuiDraw.drawTexturedModalRect;
|
||||
|
||||
public class MetallurgicInfuserRecipeHandler extends BaseRecipeHandler
|
||||
{
|
||||
@@ -132,8 +134,9 @@ public class MetallurgicInfuserRecipeHandler extends BaseRecipeHandler
|
||||
float f = ticksPassed >= 20 && ticksPassed < 40 ? (ticksPassed - 20) % 20 / 20.0F : 1.0F;
|
||||
if(ticksPassed < 20) f = 0.0F;
|
||||
|
||||
changeTexture(type.texture);
|
||||
drawProgressBar(2, 2, type.texX, type.texY, 4, 52, f, 3);
|
||||
int display = (int)(52F*f);
|
||||
changeTexture(MekanismRenderer.getBlocksTexture());
|
||||
drawTexturedRectFromIcon(2, 2+52-display, type.icon, 4, display);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -10,6 +10,8 @@ import mekanism.api.EnumColor;
|
||||
import mekanism.api.gas.Gas;
|
||||
import mekanism.api.gas.GasRegistry;
|
||||
import mekanism.api.gas.OreGas;
|
||||
import mekanism.api.infuse.InfuseRegistry;
|
||||
import mekanism.api.infuse.InfuseType;
|
||||
import mekanism.api.transmitters.TransmissionType;
|
||||
import mekanism.client.render.tileentity.RenderConfigurableMachine;
|
||||
import mekanism.client.render.tileentity.RenderDynamicTank;
|
||||
|
||||
@@ -1,42 +0,0 @@
|
||||
package mekanism.common;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public final class ItemAttacher
|
||||
{
|
||||
private static final List<ItemStack> attachable = new ArrayList<ItemStack>();
|
||||
|
||||
static
|
||||
{
|
||||
attachable.add(new ItemStack(Blocks.lever));
|
||||
|
||||
/*TODO put this back
|
||||
for(TransmitterType type : TransmitterType.values())
|
||||
{
|
||||
attachable.add(new ItemStack(MekanismItems.PartTransmitter, 1, type.ordinal()));
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
public static boolean canAttach(ItemStack itemStack)
|
||||
{
|
||||
if(itemStack == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
for(ItemStack stack : attachable)
|
||||
{
|
||||
if(stack.isItemEqual(itemStack))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -81,7 +81,6 @@ import mekanism.common.tile.TileEntitySolarEvaporationValve;
|
||||
import mekanism.common.tile.TileEntityThermoelectricBoiler;
|
||||
import mekanism.common.tile.TileEntityThermoelectricValve;
|
||||
import mekanism.common.util.MekanismUtils;
|
||||
import mekanism.common.util.MekanismUtils.ResourceType;
|
||||
import mekanism.common.voice.VoiceServerManager;
|
||||
import mekanism.common.world.GenHandler;
|
||||
import net.minecraft.entity.EnumCreatureType;
|
||||
@@ -1196,13 +1195,13 @@ public class Mekanism
|
||||
MekanismBlocks.register();
|
||||
|
||||
//Register infuses
|
||||
InfuseRegistry.registerInfuseType(new InfuseType("CARBON", MekanismUtils.getResource(ResourceType.INFUSE, "Infusions.png"), 0, 0).setUnlocalizedName("infuse.carbon"));
|
||||
InfuseRegistry.registerInfuseType(new InfuseType("TIN", MekanismUtils.getResource(ResourceType.INFUSE, "Infusions.png"), 4, 0).setUnlocalizedName("infuse.tin"));
|
||||
InfuseRegistry.registerInfuseType(new InfuseType("DIAMOND", MekanismUtils.getResource(ResourceType.INFUSE, "Infusions.png"), 8, 0).setUnlocalizedName("infuse.diamond"));
|
||||
InfuseRegistry.registerInfuseType(new InfuseType("REDSTONE", MekanismUtils.getResource(ResourceType.INFUSE, "Infusions.png"), 16, 0).setUnlocalizedName("infuse.redstone"));
|
||||
InfuseRegistry.registerInfuseType(new InfuseType("FUNGI", MekanismUtils.getResource(ResourceType.INFUSE, "Infusions.png"), 20, 0).setUnlocalizedName("infuse.fungi"));
|
||||
InfuseRegistry.registerInfuseType(new InfuseType("BIO", MekanismUtils.getResource(ResourceType.INFUSE, "Infusions.png"), 12, 0).setUnlocalizedName("infuse.bio"));
|
||||
InfuseRegistry.registerInfuseType(new InfuseType("OBSIDIAN", MekanismUtils.getResource(ResourceType.INFUSE, "Infusions.png"), 24, 0).setUnlocalizedName("infuse.obsidian"));
|
||||
InfuseRegistry.registerInfuseType(new InfuseType("CARBON", "mekanism:infuse/Carbon").setUnlocalizedName("carbon"));
|
||||
InfuseRegistry.registerInfuseType(new InfuseType("TIN", "mekanism:infuse/Tin").setUnlocalizedName("tin"));
|
||||
InfuseRegistry.registerInfuseType(new InfuseType("DIAMOND", "mekanism:infuse/Diamond").setUnlocalizedName("diamond"));
|
||||
InfuseRegistry.registerInfuseType(new InfuseType("REDSTONE", "mekanism:infuse/Redstone").setUnlocalizedName("redstone"));
|
||||
InfuseRegistry.registerInfuseType(new InfuseType("FUNGI", "mekanism:infuse/Fungi").setUnlocalizedName("fungi"));
|
||||
InfuseRegistry.registerInfuseType(new InfuseType("BIO", "mekanism:infuse/Bio").setUnlocalizedName("bio"));
|
||||
InfuseRegistry.registerInfuseType(new InfuseType("OBSIDIAN", "mekanism:infuse/Obsidian").setUnlocalizedName("obsidian"));
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
|
||||
@@ -5,15 +5,16 @@ import java.util.Map;
|
||||
import mekanism.api.gas.Gas;
|
||||
import mekanism.api.gas.GasStack;
|
||||
import mekanism.api.util.StackUtils;
|
||||
import mekanism.common.block.states.BlockStateMachine.MachineType;
|
||||
import mekanism.common.block.states.BlockStateMachine;
|
||||
import mekanism.common.InfuseStorage;
|
||||
import mekanism.common.recipe.RecipeHandler;
|
||||
import mekanism.common.recipe.RecipeHandler.Recipe;
|
||||
import mekanism.common.recipe.inputs.AdvancedMachineInput;
|
||||
import mekanism.common.recipe.inputs.InfusionInput;
|
||||
import mekanism.common.recipe.inputs.ItemStackInput;
|
||||
import mekanism.common.recipe.machines.AdvancedMachineRecipe;
|
||||
import mekanism.common.recipe.machines.BasicMachineRecipe;
|
||||
import mekanism.common.recipe.machines.MachineRecipe;
|
||||
import mekanism.common.recipe.machines.MetallurgicInfuserRecipe;
|
||||
import mekanism.common.tile.TileEntityAdvancedElectricMachine;
|
||||
import mekanism.common.util.LangUtils;
|
||||
import net.minecraft.block.Block;
|
||||
@@ -21,6 +22,8 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import static mekanism.common.block.states.BlockStateMachine.MachineType;
|
||||
|
||||
/**
|
||||
* Internal interface for managing various Factory types.
|
||||
* @author AidanBrady
|
||||
@@ -44,13 +47,14 @@ public interface IFactory
|
||||
|
||||
public static enum RecipeType
|
||||
{
|
||||
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);
|
||||
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),
|
||||
INFUSING("Infusing", "metalinfuser", MachineType.METALLURGIC_INFUSER.getStack(), false, false, Recipe.METALLURGIC_INFUSER);
|
||||
|
||||
private String name;
|
||||
private ResourceLocation sound;
|
||||
@@ -79,13 +83,27 @@ public interface IFactory
|
||||
{
|
||||
return getRecipe(new AdvancedMachineInput(input, gas));
|
||||
}
|
||||
|
||||
public MetallurgicInfuserRecipe getRecipe(InfusionInput input)
|
||||
{
|
||||
return RecipeHandler.getMetallurgicInfuserRecipe(input);
|
||||
}
|
||||
|
||||
public MetallurgicInfuserRecipe getRecipe(ItemStack input, InfuseStorage storage)
|
||||
{
|
||||
return getRecipe(new InfusionInput(storage, input));
|
||||
}
|
||||
|
||||
public MachineRecipe getAnyRecipe(ItemStack slotStack, Gas gasType)
|
||||
public MachineRecipe getAnyRecipe(ItemStack slotStack, Gas gasType, InfuseStorage infuse)
|
||||
{
|
||||
if(usesFuel())
|
||||
{
|
||||
return getRecipe(slotStack, gasType);
|
||||
}
|
||||
else if(this == INFUSING)
|
||||
{
|
||||
return getRecipe(slotStack, infuse);
|
||||
}
|
||||
|
||||
return getRecipe(slotStack);
|
||||
}
|
||||
@@ -169,7 +187,7 @@ public interface IFactory
|
||||
{
|
||||
if(cacheTile == null)
|
||||
{
|
||||
MachineType type = BlockStateMachine.MachineType.get(Block.getBlockFromItem(getStack().getItem()), getStack().getItemDamage());
|
||||
MachineType type = MachineType.get(Block.getBlockFromItem(getStack().getItem()), getStack().getItemDamage());
|
||||
cacheTile = (TileEntityAdvancedElectricMachine)type.create();
|
||||
}
|
||||
|
||||
|
||||
@@ -5,7 +5,6 @@ import java.util.Random;
|
||||
|
||||
import mekanism.api.energy.IEnergizedItem;
|
||||
import mekanism.api.energy.IStrictEnergyStorage;
|
||||
import mekanism.common.ItemAttacher;
|
||||
import mekanism.common.Mekanism;
|
||||
import mekanism.common.Tier.BaseTier;
|
||||
import mekanism.common.base.IActiveState;
|
||||
@@ -486,14 +485,6 @@ public abstract class BlockBasic extends Block//TODO? implements IBlockCTM, ICus
|
||||
|
||||
if(getBasicBlock() == BasicBlock.BASIC_BLOCK_1)
|
||||
{
|
||||
if(metadata != 6)
|
||||
{
|
||||
if(ItemAttacher.canAttach(entityplayer.getCurrentEquippedItem()))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if(metadata == 2)
|
||||
{
|
||||
if(entityplayer.isSneaking())
|
||||
|
||||
@@ -4,7 +4,6 @@ import buildcraft.api.tools.IToolWrench;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import mekanism.api.energy.IEnergizedItem;
|
||||
import mekanism.common.ItemAttacher;
|
||||
import mekanism.common.Mekanism;
|
||||
import mekanism.common.MekanismBlocks;
|
||||
import mekanism.common.Tier.EnergyCubeTier;
|
||||
@@ -32,10 +31,10 @@ import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import buildcraft.api.tools.IToolWrench;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
/**
|
||||
* Block class for handling multiple energy cube block IDs.
|
||||
@@ -142,11 +141,6 @@ public class BlockEnergyCube extends BlockContainer
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer entityplayer, EnumFacing side, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
if(ItemAttacher.canAttach(entityplayer.getCurrentEquippedItem()))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if(world.isRemote)
|
||||
{
|
||||
return true;
|
||||
|
||||
@@ -3,14 +3,12 @@ package mekanism.common.block;
|
||||
import java.util.Random;
|
||||
|
||||
import mekanism.api.gas.IGasItem;
|
||||
import mekanism.common.ItemAttacher;
|
||||
import mekanism.common.Mekanism;
|
||||
import mekanism.common.MekanismBlocks;
|
||||
import mekanism.common.base.ISustainedInventory;
|
||||
import mekanism.common.tile.TileEntityBasicBlock;
|
||||
import mekanism.common.tile.TileEntityGasTank;
|
||||
import mekanism.common.util.MekanismUtils;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
@@ -26,12 +24,14 @@ import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraftforge.fml.common.ModAPIManager;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import buildcraft.api.tools.IToolWrench;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import buildcraft.api.tools.IToolWrench;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class BlockGasTank extends BlockContainer
|
||||
{
|
||||
@@ -90,11 +90,6 @@ public class BlockGasTank extends BlockContainer
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer entityplayer, EnumFacing side, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
if(ItemAttacher.canAttach(entityplayer.getCurrentEquippedItem()))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if(world.isRemote)
|
||||
{
|
||||
return true;
|
||||
|
||||
@@ -9,7 +9,6 @@ import mekanism.api.MekanismConfig.client;
|
||||
import mekanism.api.MekanismConfig.general;
|
||||
import mekanism.api.energy.IEnergizedItem;
|
||||
import mekanism.api.energy.IStrictEnergyStorage;
|
||||
import mekanism.common.ItemAttacher;
|
||||
import mekanism.common.Mekanism;
|
||||
import mekanism.common.base.IActiveState;
|
||||
import mekanism.common.base.IBoundingBlock;
|
||||
@@ -564,11 +563,6 @@ public abstract class BlockMachine extends BlockContainer implements ISpecialBou
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer entityplayer, EnumFacing side, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
if(ItemAttacher.canAttach(entityplayer.getCurrentEquippedItem()))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if(world.isRemote)
|
||||
{
|
||||
return true;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package mekanism.common.inventory.container;
|
||||
|
||||
import mekanism.api.infuse.InfuseRegistry;
|
||||
import mekanism.common.Tier;
|
||||
import mekanism.common.Tier.FactoryTier;
|
||||
import mekanism.common.base.IFactory.RecipeType;
|
||||
@@ -8,7 +9,6 @@ import mekanism.common.inventory.slot.SlotOutput;
|
||||
import mekanism.common.item.ItemBlockMachine;
|
||||
import mekanism.common.tile.TileEntityFactory;
|
||||
import mekanism.common.util.ChargeUtils;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
@@ -143,7 +143,7 @@ public class ContainerFactory extends Container
|
||||
return null;
|
||||
}
|
||||
}
|
||||
else if(tileEntity.recipeType.getAnyRecipe(slotStack, tileEntity.gasTank.getGasType()) != null)
|
||||
else if(tileEntity.recipeType.getAnyRecipe(slotStack, tileEntity.gasTank.getGasType(), tileEntity.infuseStored) != null)
|
||||
{
|
||||
if(!isInputSlot(slotID))
|
||||
{
|
||||
@@ -192,6 +192,25 @@ public class ContainerFactory extends Container
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(tileEntity.recipeType == RecipeType.INFUSING)
|
||||
{
|
||||
if(InfuseRegistry.getObject(slotStack) != null && (tileEntity.infuseStored.type == null || tileEntity.infuseStored.type == InfuseRegistry.getObject(slotStack).type))
|
||||
{
|
||||
if(slotID > tileEntity.inventory.length-1)
|
||||
{
|
||||
if(!mergeItemStack(slotStack, 3, 4, false))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if(!mergeItemStack(slotStack, tileEntity.inventory.length-1, inventorySlots.size(), true))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
int slotEnd = tileEntity.inventory.length-1;
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@ import mekanism.common.tile.TileEntityAdvancedElectricMachine;
|
||||
import mekanism.common.tile.TileEntityBasicBlock;
|
||||
import mekanism.common.tile.TileEntityElectricMachine;
|
||||
import mekanism.common.tile.TileEntityFactory;
|
||||
import mekanism.common.tile.TileEntityMetallurgicInfuser;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
@@ -97,6 +98,17 @@ public class ItemFactoryInstaller extends ItemMekanism
|
||||
stack.stackSize = 0;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
else if(tile instanceof TileEntityMetallurgicInfuser)
|
||||
{
|
||||
((TileEntityMetallurgicInfuser)tile).upgrade(type);
|
||||
|
||||
if(!player.capabilities.isCreativeMode)
|
||||
{
|
||||
stack.stackSize = 0;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,6 @@ package mekanism.common.recipe.machines;
|
||||
import mekanism.common.InfuseStorage;
|
||||
import mekanism.common.recipe.inputs.InfusionInput;
|
||||
import mekanism.common.recipe.outputs.ItemStackOutput;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class MetallurgicInfuserRecipe extends MachineRecipe<InfusionInput, ItemStackOutput, MetallurgicInfuserRecipe>
|
||||
@@ -18,9 +17,9 @@ public class MetallurgicInfuserRecipe extends MachineRecipe<InfusionInput, ItemS
|
||||
this(input, new ItemStackOutput(output));
|
||||
}
|
||||
|
||||
public boolean canOperate(ItemStack[] inventory, InfuseStorage infuse)
|
||||
public boolean canOperate(ItemStack[] inventory, int inputIndex, int outputIndex, InfuseStorage infuse)
|
||||
{
|
||||
return getInput().use(inventory, 2, infuse, false) && getOutput().applyOutputs(inventory, 3, false);
|
||||
return getInput().use(inventory, inputIndex, infuse, false) && getOutput().applyOutputs(inventory, outputIndex, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -29,11 +28,11 @@ public class MetallurgicInfuserRecipe extends MachineRecipe<InfusionInput, ItemS
|
||||
return new MetallurgicInfuserRecipe(getInput(), getOutput());
|
||||
}
|
||||
|
||||
public void output(ItemStack[] inventory, InfuseStorage infuseStored)
|
||||
public void output(ItemStack[] inventory, int inputIndex, int outputIndex, InfuseStorage infuseStored)
|
||||
{
|
||||
if(getInput().use(inventory, 2, infuseStored, true))
|
||||
if(getInput().use(inventory, inputIndex, infuseStored, true))
|
||||
{
|
||||
getOutput().applyOutputs(inventory, 3, true);
|
||||
getOutput().applyOutputs(inventory, outputIndex, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4,22 +4,18 @@ import io.netty.buffer.ByteBuf;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import mekanism.api.Coord4D;
|
||||
import mekanism.api.EnumColor;
|
||||
import mekanism.api.Range4D;
|
||||
import mekanism.api.gas.Gas;
|
||||
import mekanism.api.gas.GasStack;
|
||||
import mekanism.api.gas.GasTank;
|
||||
import mekanism.api.gas.IGasHandler;
|
||||
import mekanism.api.gas.ITubeConnection;
|
||||
import mekanism.api.transmitters.TransmissionType;
|
||||
import mekanism.common.Mekanism;
|
||||
import mekanism.common.MekanismBlocks;
|
||||
import mekanism.common.MekanismItems;
|
||||
import mekanism.common.SideData;
|
||||
import mekanism.common.Upgrade;
|
||||
import mekanism.common.base.IFactory.RecipeType;
|
||||
import mekanism.common.network.PacketTileEntity.TileEntityMessage;
|
||||
import mekanism.common.recipe.RecipeHandler;
|
||||
import mekanism.common.recipe.inputs.AdvancedMachineInput;
|
||||
import mekanism.common.recipe.machines.AdvancedMachineRecipe;
|
||||
@@ -108,7 +104,6 @@ public abstract class TileEntityAdvancedElectricMachine<RECIPE extends AdvancedM
|
||||
|
||||
//Electric
|
||||
factory.electricityStored = electricityStored;
|
||||
factory.ic2Registered = ic2Registered;
|
||||
|
||||
//Noisy
|
||||
factory.soundURL = soundURL;
|
||||
@@ -144,7 +139,6 @@ public abstract class TileEntityAdvancedElectricMachine<RECIPE extends AdvancedM
|
||||
factory.upgraded = true;
|
||||
|
||||
factory.markDirty();
|
||||
Mekanism.packetHandler.sendToReceivers(new TileEntityMessage(Coord4D.get(factory), factory.getNetworkedData(new ArrayList())), new Range4D(Coord4D.get(factory)));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,10 +1,16 @@
|
||||
package mekanism.common.tile;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import mekanism.api.Coord4D;
|
||||
import mekanism.api.EnumColor;
|
||||
import mekanism.api.Range4D;
|
||||
import mekanism.api.transmitters.TransmissionType;
|
||||
import mekanism.common.*;
|
||||
import mekanism.common.Mekanism;
|
||||
import mekanism.common.MekanismBlocks;
|
||||
import mekanism.common.MekanismItems;
|
||||
import mekanism.common.SideData;
|
||||
import mekanism.common.Upgrade;
|
||||
import mekanism.common.base.IFactory.RecipeType;
|
||||
import mekanism.common.network.PacketTileEntity.TileEntityMessage;
|
||||
import mekanism.common.recipe.RecipeHandler;
|
||||
@@ -21,8 +27,6 @@ import mekanism.common.util.MekanismUtils.ResourceType;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
public abstract class TileEntityElectricMachine<RECIPE extends BasicMachineRecipe<RECIPE>> extends TileEntityBasicMachine<ItemStackInput, ItemStackOutput, RECIPE>
|
||||
{
|
||||
/**
|
||||
@@ -73,7 +77,6 @@ public abstract class TileEntityElectricMachine<RECIPE extends BasicMachineRecip
|
||||
|
||||
//Electric
|
||||
factory.electricityStored = electricityStored;
|
||||
factory.ic2Registered = ic2Registered;
|
||||
|
||||
//Noisy
|
||||
factory.soundURL = soundURL;
|
||||
@@ -105,7 +108,6 @@ public abstract class TileEntityElectricMachine<RECIPE extends BasicMachineRecip
|
||||
factory.upgraded = true;
|
||||
|
||||
factory.markDirty();
|
||||
Mekanism.packetHandler.sendToReceivers(new TileEntityMessage(Coord4D.get(factory), factory.getNetworkedData(new ArrayList())), new Range4D(Coord4D.get(factory)));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -18,12 +18,16 @@ import mekanism.api.gas.GasTransmission;
|
||||
import mekanism.api.gas.IGasHandler;
|
||||
import mekanism.api.gas.IGasItem;
|
||||
import mekanism.api.gas.ITubeConnection;
|
||||
import mekanism.api.infuse.InfuseObject;
|
||||
import mekanism.api.infuse.InfuseRegistry;
|
||||
import mekanism.api.transmitters.TransmissionType;
|
||||
import mekanism.api.util.StackUtils;
|
||||
import mekanism.client.HolidayManager;
|
||||
import mekanism.common.InfuseStorage;
|
||||
import mekanism.common.Mekanism;
|
||||
import mekanism.common.MekanismBlocks;
|
||||
import mekanism.common.MekanismItems;
|
||||
import mekanism.common.PacketHandler;
|
||||
import mekanism.common.SideData;
|
||||
import mekanism.common.Tier.FactoryTier;
|
||||
import mekanism.common.Upgrade;
|
||||
@@ -37,8 +41,12 @@ 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.RecipeHandler;
|
||||
import mekanism.common.recipe.RecipeHandler.Recipe;
|
||||
import mekanism.common.recipe.inputs.InfusionInput;
|
||||
import mekanism.common.recipe.machines.AdvancedMachineRecipe;
|
||||
import mekanism.common.recipe.machines.BasicMachineRecipe;
|
||||
import mekanism.common.recipe.machines.MetallurgicInfuserRecipe;
|
||||
import mekanism.common.tile.component.TileComponentConfig;
|
||||
import mekanism.common.tile.component.TileComponentEjector;
|
||||
import mekanism.common.tile.component.TileComponentUpgrade;
|
||||
@@ -60,6 +68,10 @@ public class TileEntityFactory extends TileEntityNoisyElectricBlock implements I
|
||||
|
||||
/** An int[] used to track all current operations' progress. */
|
||||
public int[] progress;
|
||||
|
||||
public int BASE_MAX_INFUSE = 1000;
|
||||
|
||||
public int maxInfuse = BASE_MAX_INFUSE;
|
||||
|
||||
/** How many ticks it takes, by default, to run an operation. */
|
||||
public int BASE_TICKS_REQUIRED = 200;
|
||||
@@ -95,6 +107,9 @@ public class TileEntityFactory extends TileEntityNoisyElectricBlock implements I
|
||||
|
||||
/** This machine's recipe type. */
|
||||
public RecipeType recipeType = RecipeType.SMELTING;
|
||||
|
||||
/** The amount of infuse this machine has stored. */
|
||||
public InfuseStorage infuseStored = new InfuseStorage();
|
||||
|
||||
/** This machine's previous amount of energy. */
|
||||
public double prevEnergy;
|
||||
@@ -150,6 +165,7 @@ public class TileEntityFactory extends TileEntityNoisyElectricBlock implements I
|
||||
isActive = false;
|
||||
|
||||
gasTank = new GasTank(TileEntityAdvancedElectricMachine.MAX_GAS*tier.processes);
|
||||
maxInfuse = BASE_MAX_INFUSE*tier.processes;
|
||||
}
|
||||
|
||||
public void upgrade()
|
||||
@@ -169,7 +185,6 @@ public class TileEntityFactory extends TileEntityNoisyElectricBlock implements I
|
||||
|
||||
//Electric
|
||||
factory.electricityStored = electricityStored;
|
||||
factory.ic2Registered = ic2Registered;
|
||||
|
||||
//Noisy
|
||||
factory.soundURL = soundURL;
|
||||
@@ -368,6 +383,12 @@ public class TileEntityFactory extends TileEntityNoisyElectricBlock implements I
|
||||
setActive(false);
|
||||
}
|
||||
}
|
||||
|
||||
if(infuseStored.amount <= 0)
|
||||
{
|
||||
infuseStored.amount = 0;
|
||||
infuseStored.type = null;
|
||||
}
|
||||
|
||||
prevEnergy = getEnergy();
|
||||
}
|
||||
@@ -464,33 +485,58 @@ public class TileEntityFactory extends TileEntityNoisyElectricBlock implements I
|
||||
|
||||
public void handleSecondaryFuel()
|
||||
{
|
||||
if(inventory[4] != null && recipeType.usesFuel() && gasTank.getNeeded() > 0)
|
||||
if(inventory[4] != null)
|
||||
{
|
||||
if(inventory[4].getItem() instanceof IGasItem)
|
||||
if(recipeType.usesFuel() && gasTank.getNeeded() > 0)
|
||||
{
|
||||
GasStack gas = ((IGasItem)inventory[4].getItem()).getGas(inventory[4]);
|
||||
|
||||
if(gas != null && recipeType.isValidGas(gas.getGas()))
|
||||
if(inventory[4].getItem() instanceof IGasItem)
|
||||
{
|
||||
GasStack removed = GasTransmission.removeGas(inventory[4], gasTank.getGasType(), gasTank.getNeeded());
|
||||
gasTank.receive(removed, true);
|
||||
GasStack gas = ((IGasItem)inventory[4].getItem()).getGas(inventory[4]);
|
||||
|
||||
if(gas != null && recipeType.isValidGas(gas.getGas()))
|
||||
{
|
||||
GasStack removed = GasTransmission.removeGas(inventory[4], gasTank.getGasType(), gasTank.getNeeded());
|
||||
gasTank.receive(removed, true);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
GasStack stack = recipeType.getItemGas(inventory[4]);
|
||||
int gasNeeded = gasTank.getNeeded();
|
||||
|
||||
if(stack != null && stack.amount <= gasNeeded)
|
||||
{
|
||||
gasTank.receive(stack, true);
|
||||
|
||||
inventory[4].stackSize--;
|
||||
|
||||
if(inventory[4].stackSize == 0)
|
||||
|
||||
GasStack stack = recipeType.getItemGas(inventory[4]);
|
||||
int gasNeeded = gasTank.getNeeded();
|
||||
|
||||
if(stack != null && stack.amount <= gasNeeded)
|
||||
{
|
||||
inventory[4] = null;
|
||||
gasTank.receive(stack, true);
|
||||
|
||||
inventory[4].stackSize--;
|
||||
|
||||
if(inventory[4].stackSize == 0)
|
||||
{
|
||||
inventory[4] = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(recipeType == RecipeType.INFUSING)
|
||||
{
|
||||
if(InfuseRegistry.getObject(inventory[4]) != null)
|
||||
{
|
||||
InfuseObject infuse = InfuseRegistry.getObject(inventory[4]);
|
||||
|
||||
if(infuseStored.type == null || infuseStored.type == infuse.type)
|
||||
{
|
||||
if(infuseStored.amount + infuse.stored <= maxInfuse)
|
||||
{
|
||||
infuseStored.amount += infuse.stored;
|
||||
infuseStored.type = infuse.type;
|
||||
inventory[4].stackSize--;
|
||||
|
||||
if(inventory[4].stackSize <= 0)
|
||||
{
|
||||
inventory[4] = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -535,7 +581,7 @@ public class TileEntityFactory extends TileEntityNoisyElectricBlock implements I
|
||||
}
|
||||
else if(slotID >= 5 && slotID <= 7)
|
||||
{
|
||||
return recipeType.getAnyRecipe(itemstack, gasTank.getGasType()) != null;
|
||||
return recipeType.getAnyRecipe(itemstack, gasTank.getGasType(), infuseStored) != null;
|
||||
}
|
||||
}
|
||||
else if(tier == FactoryTier.ADVANCED)
|
||||
@@ -546,7 +592,7 @@ public class TileEntityFactory extends TileEntityNoisyElectricBlock implements I
|
||||
}
|
||||
else if(slotID >= 5 && slotID <= 9)
|
||||
{
|
||||
return recipeType.getAnyRecipe(itemstack, gasTank.getGasType()) != null;
|
||||
return recipeType.getAnyRecipe(itemstack, gasTank.getGasType(), infuseStored) != null;
|
||||
}
|
||||
}
|
||||
else if(tier == FactoryTier.ELITE)
|
||||
@@ -557,7 +603,7 @@ public class TileEntityFactory extends TileEntityNoisyElectricBlock implements I
|
||||
}
|
||||
else if(slotID >= 5 && slotID <= 11)
|
||||
{
|
||||
return recipeType.getAnyRecipe(itemstack, gasTank.getGasType()) != null;
|
||||
return recipeType.getAnyRecipe(itemstack, gasTank.getGasType(), infuseStored) != null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -571,7 +617,31 @@ public class TileEntityFactory extends TileEntityNoisyElectricBlock implements I
|
||||
}
|
||||
else if(slotID == 4)
|
||||
{
|
||||
return recipeType.getItemGas(itemstack) != null;
|
||||
if(recipeType.usesFuel())
|
||||
{
|
||||
return recipeType.getItemGas(itemstack) != null;
|
||||
}
|
||||
else if(recipeType == RecipeType.INFUSING)
|
||||
{
|
||||
if(infuseStored.type != null)
|
||||
{
|
||||
if(RecipeHandler.getMetallurgicInfuserRecipe(new InfusionInput(infuseStored, itemstack)) != null)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else {
|
||||
for(Object obj : Recipe.METALLURGIC_INFUSER.get().keySet())
|
||||
{
|
||||
InfusionInput input = (InfusionInput)obj;
|
||||
|
||||
if(input.inputStack.isItemEqual(itemstack))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
@@ -581,6 +651,11 @@ public class TileEntityFactory extends TileEntityNoisyElectricBlock implements I
|
||||
{
|
||||
return progress[process]*i / ticksRequired;
|
||||
}
|
||||
|
||||
public int getScaledInfuseLevel(int i)
|
||||
{
|
||||
return infuseStored.amount * i / maxInfuse;
|
||||
}
|
||||
|
||||
public int getScaledGasLevel(int i)
|
||||
{
|
||||
@@ -606,6 +681,19 @@ public class TileEntityFactory extends TileEntityNoisyElectricBlock implements I
|
||||
return recipe != null && recipe.canOperate(inventory, inputSlot, outputSlot, gasTank, secondaryEnergyThisTick);
|
||||
|
||||
}
|
||||
|
||||
if(recipeType == RecipeType.INFUSING)
|
||||
{
|
||||
InfusionInput input = new InfusionInput(infuseStored, inventory[inputSlot]);
|
||||
MetallurgicInfuserRecipe recipe = RecipeHandler.getMetallurgicInfuserRecipe(input);
|
||||
|
||||
if(recipe == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return recipe.canOperate(inventory, inputSlot, outputSlot, infuseStored);
|
||||
}
|
||||
|
||||
BasicMachineRecipe<?> recipe = recipeType.getRecipe(inventory[inputSlot]);
|
||||
|
||||
@@ -626,6 +714,13 @@ public class TileEntityFactory extends TileEntityNoisyElectricBlock implements I
|
||||
|
||||
recipe.operate(inventory, inputSlot, outputSlot, gasTank, secondaryEnergyThisTick);
|
||||
}
|
||||
else if(recipeType == RecipeType.INFUSING)
|
||||
{
|
||||
InfusionInput input = new InfusionInput(infuseStored, inventory[inputSlot]);
|
||||
MetallurgicInfuserRecipe recipe = RecipeHandler.getMetallurgicInfuserRecipe(input);
|
||||
|
||||
recipe.output(inventory, inputSlot, outputSlot, infuseStored);
|
||||
}
|
||||
else {
|
||||
BasicMachineRecipe<?> recipe = recipeType.getRecipe(inventory[inputSlot]);
|
||||
|
||||
@@ -647,6 +742,12 @@ public class TileEntityFactory extends TileEntityNoisyElectricBlock implements I
|
||||
{
|
||||
sorting = !sorting;
|
||||
}
|
||||
else if(type == 1)
|
||||
{
|
||||
gasTank.setGas(null);
|
||||
infuseStored.amount = 0;
|
||||
infuseStored.type = null;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -667,6 +768,8 @@ public class TileEntityFactory extends TileEntityNoisyElectricBlock implements I
|
||||
controlType = RedstoneControl.values()[dataStream.readInt()];
|
||||
sorting = dataStream.readBoolean();
|
||||
upgraded = dataStream.readBoolean();
|
||||
infuseStored.amount = dataStream.readInt();
|
||||
infuseStored.type = InfuseRegistry.get(PacketHandler.readString(dataStream));
|
||||
|
||||
for(int i = 0; i < tier.processes; i++)
|
||||
{
|
||||
@@ -714,6 +817,8 @@ public class TileEntityFactory extends TileEntityNoisyElectricBlock implements I
|
||||
recipeTicks = nbtTags.getInteger("recipeTicks");
|
||||
controlType = RedstoneControl.values()[nbtTags.getInteger("controlType")];
|
||||
sorting = nbtTags.getBoolean("sorting");
|
||||
infuseStored.amount = nbtTags.getInteger("infuseStored");
|
||||
infuseStored.type = InfuseRegistry.get(nbtTags.getString("type"));
|
||||
|
||||
for(int i = 0; i < tier.processes; i++)
|
||||
{
|
||||
@@ -733,6 +838,15 @@ public class TileEntityFactory extends TileEntityNoisyElectricBlock implements I
|
||||
nbtTags.setInteger("recipeTicks", recipeTicks);
|
||||
nbtTags.setInteger("controlType", controlType.ordinal());
|
||||
nbtTags.setBoolean("sorting", sorting);
|
||||
nbtTags.setInteger("infuseStored", infuseStored.amount);
|
||||
|
||||
if(infuseStored.type != null)
|
||||
{
|
||||
nbtTags.setString("type", infuseStored.type.name);
|
||||
}
|
||||
else {
|
||||
nbtTags.setString("type", "null");
|
||||
}
|
||||
|
||||
for(int i = 0; i < tier.processes; i++)
|
||||
{
|
||||
@@ -753,6 +867,16 @@ public class TileEntityFactory extends TileEntityNoisyElectricBlock implements I
|
||||
data.add(controlType);
|
||||
data.add(sorting);
|
||||
data.add(upgraded);
|
||||
data.add(infuseStored.amount);
|
||||
|
||||
if(infuseStored.type != null)
|
||||
{
|
||||
data.add(infuseStored.type.name);
|
||||
}
|
||||
else {
|
||||
data.add("null");
|
||||
}
|
||||
|
||||
data.add(progress);
|
||||
|
||||
if(gasTank.getGas() != null)
|
||||
|
||||
@@ -15,11 +15,13 @@ import mekanism.api.infuse.InfuseRegistry;
|
||||
import mekanism.api.transmitters.TransmissionType;
|
||||
import mekanism.common.InfuseStorage;
|
||||
import mekanism.common.Mekanism;
|
||||
import mekanism.common.MekanismBlocks;
|
||||
import mekanism.common.MekanismItems;
|
||||
import mekanism.common.PacketHandler;
|
||||
import mekanism.common.SideData;
|
||||
import mekanism.common.Upgrade;
|
||||
import mekanism.common.base.IEjector;
|
||||
import mekanism.common.base.IFactory.RecipeType;
|
||||
import mekanism.common.base.IRedstoneControl;
|
||||
import mekanism.common.base.ISideConfiguration;
|
||||
import mekanism.common.base.IUpgradeTile;
|
||||
@@ -193,6 +195,61 @@ public class TileEntityMetallurgicInfuser extends TileEntityNoisyElectricBlock i
|
||||
}
|
||||
}
|
||||
|
||||
public void upgrade(RecipeType type)
|
||||
{
|
||||
worldObj.setBlockToAir(xCoord, yCoord, zCoord);
|
||||
worldObj.setBlock(xCoord, yCoord, zCoord, MekanismBlocks.MachineBlock, 5, 3);
|
||||
|
||||
TileEntityFactory factory = (TileEntityFactory)worldObj.getTileEntity(xCoord, yCoord, zCoord);
|
||||
|
||||
//Basic
|
||||
factory.facing = facing;
|
||||
factory.clientFacing = clientFacing;
|
||||
factory.ticker = ticker;
|
||||
factory.redstone = redstone;
|
||||
factory.redstoneLastTick = redstoneLastTick;
|
||||
factory.doAutoSync = doAutoSync;
|
||||
|
||||
//Electric
|
||||
factory.electricityStored = electricityStored;
|
||||
|
||||
//Noisy
|
||||
factory.soundURL = soundURL;
|
||||
|
||||
//Machine
|
||||
factory.progress[0] = operatingTicks;
|
||||
factory.clientActive = clientActive;
|
||||
factory.isActive = isActive;
|
||||
factory.updateDelay = updateDelay;
|
||||
factory.controlType = controlType;
|
||||
factory.prevEnergy = prevEnergy;
|
||||
factory.upgradeComponent.readFrom(upgradeComponent);
|
||||
factory.upgradeComponent.setUpgradeSlot(0);
|
||||
factory.ejectorComponent.readFrom(ejectorComponent);
|
||||
factory.ejectorComponent.setOutputData(TransmissionType.ITEM, factory.configComponent.getOutputs(TransmissionType.ITEM).get(4));
|
||||
factory.recipeType = type;
|
||||
factory.upgradeComponent.setSupported(Upgrade.GAS, type.fuelEnergyUpgrades());
|
||||
|
||||
//Infuser
|
||||
factory.infuseStored.amount = infuseStored.amount;
|
||||
factory.infuseStored.type = infuseStored.type;
|
||||
|
||||
factory.inventory[5] = inventory[2];
|
||||
factory.inventory[1] = inventory[4];
|
||||
factory.inventory[5+3] = inventory[3];
|
||||
factory.inventory[0] = inventory[0];
|
||||
factory.inventory[4] = inventory[1];
|
||||
|
||||
for(Upgrade upgrade : factory.upgradeComponent.getSupportedTypes())
|
||||
{
|
||||
factory.recalculateUpgradables(upgrade);
|
||||
}
|
||||
|
||||
factory.upgraded = true;
|
||||
|
||||
factory.markDirty();
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumSet<EnumFacing> getConsumingSides()
|
||||
{
|
||||
@@ -265,7 +322,7 @@ public class TileEntityMetallurgicInfuser extends TileEntityNoisyElectricBlock i
|
||||
|
||||
public void operate(MetallurgicInfuserRecipe recipe)
|
||||
{
|
||||
recipe.output(inventory, infuseStored);
|
||||
recipe.output(inventory, 2, 3, infuseStored);
|
||||
|
||||
markDirty();
|
||||
ejectorComponent.outputItems();
|
||||
@@ -273,7 +330,7 @@ public class TileEntityMetallurgicInfuser extends TileEntityNoisyElectricBlock i
|
||||
|
||||
public boolean canOperate(MetallurgicInfuserRecipe recipe)
|
||||
{
|
||||
return recipe != null && recipe.canOperate(inventory, infuseStored);
|
||||
return recipe != null && recipe.canOperate(inventory, 2, 3, infuseStored);
|
||||
}
|
||||
|
||||
public int getScaledInfuseLevel(int i)
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package mekanism.generators.client.gui;
|
||||
|
||||
import mekanism.api.MekanismConfig.generators;
|
||||
import mekanism.client.gui.GuiMekanism;
|
||||
import mekanism.client.gui.element.GuiPowerBar;
|
||||
import mekanism.client.gui.element.GuiRateBar;
|
||||
@@ -42,8 +43,8 @@ public class GuiIndustrialTurbine extends GuiMekanism
|
||||
@Override
|
||||
public double getLevel()
|
||||
{
|
||||
double rate = tileEntity.structure.lowerVolume*(tileEntity.structure.clientDispersers*TileEntityTurbineCasing.DISPERSER_GAS_FLOW);
|
||||
rate = Math.min(rate, tileEntity.structure.vents*TileEntityTurbineCasing.VENT_GAS_FLOW);
|
||||
double rate = tileEntity.structure.lowerVolume*(tileEntity.structure.clientDispersers*generators.turbineDisperserGasFlow);
|
||||
rate = Math.min(rate, tileEntity.structure.vents*generators.turbineVentGasFlow);
|
||||
|
||||
return (double)tileEntity.structure.lastSteamInput/rate;
|
||||
}
|
||||
@@ -58,10 +59,10 @@ public class GuiIndustrialTurbine extends GuiMekanism
|
||||
|
||||
fontRendererObj.drawString(tileEntity.getInventoryName(), (xSize/2)-(fontRendererObj.getStringWidth(tileEntity.getInventoryName())/2), 5, 0x404040);
|
||||
|
||||
double energyMultiplier = TileEntityTurbineCasing.ENERGY_PER_STEAM*Math.min(tileEntity.structure.blades, tileEntity.structure.coils*TileEntityTurbineCasing.BLADE_TO_COIL_RATIO);
|
||||
double energyMultiplier = generators.turbineBaseEnergyPerSteam*Math.min(tileEntity.structure.blades, tileEntity.structure.coils*generators.turbineBladesPerCoil);
|
||||
|
||||
double rate = tileEntity.structure.lowerVolume*(tileEntity.structure.clientDispersers*TileEntityTurbineCasing.DISPERSER_GAS_FLOW);
|
||||
rate = Math.min(rate, tileEntity.structure.vents*TileEntityTurbineCasing.VENT_GAS_FLOW);
|
||||
double rate = tileEntity.structure.lowerVolume*(tileEntity.structure.clientDispersers*generators.turbineDisperserGasFlow);
|
||||
rate = Math.min(rate, tileEntity.structure.vents*generators.turbineVentGasFlow);
|
||||
|
||||
renderScaledText(LangUtils.localize("gui.production") + ": " + MekanismUtils.getEnergyDisplay(tileEntity.structure.clientFlow*energyMultiplier), 53, 26, 0x00CD00, 106);
|
||||
renderScaledText(LangUtils.localize("gui.flowRate") + ": " + tileEntity.structure.clientFlow + " mB/t", 53, 35, 0x00CD00, 106);
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package mekanism.generators.client.gui;
|
||||
|
||||
import mekanism.api.EnumColor;
|
||||
import mekanism.api.MekanismConfig.generators;
|
||||
import mekanism.client.gui.GuiMekanism;
|
||||
import mekanism.common.inventory.container.ContainerNull;
|
||||
import mekanism.common.util.LangUtils;
|
||||
@@ -41,10 +42,10 @@ public class GuiTurbineStats extends GuiMekanism
|
||||
|
||||
fontRendererObj.drawString(LangUtils.localize("gui.tankVolume") + ": " + tileEntity.structure.lowerVolume, 8, 26, 0x404040);
|
||||
|
||||
boolean dispersersLimiting = tileEntity.structure.lowerVolume*tileEntity.structure.clientDispersers*TileEntityTurbineCasing.DISPERSER_GAS_FLOW <
|
||||
tileEntity.structure.vents*TileEntityTurbineCasing.VENT_GAS_FLOW;
|
||||
boolean ventsLimiting = tileEntity.structure.lowerVolume*tileEntity.structure.clientDispersers*TileEntityTurbineCasing.DISPERSER_GAS_FLOW >
|
||||
tileEntity.structure.vents*TileEntityTurbineCasing.VENT_GAS_FLOW;
|
||||
boolean dispersersLimiting = tileEntity.structure.lowerVolume*tileEntity.structure.clientDispersers*generators.turbineDisperserGasFlow <
|
||||
tileEntity.structure.vents*generators.turbineVentGasFlow;
|
||||
boolean ventsLimiting = tileEntity.structure.lowerVolume*tileEntity.structure.clientDispersers*generators.turbineDisperserGasFlow >
|
||||
tileEntity.structure.vents*generators.turbineVentGasFlow;
|
||||
|
||||
fontRendererObj.drawString(LangUtils.localize("gui.steamFlow"), 8, 40, 0x797979);
|
||||
fontRendererObj.drawString(LangUtils.localize("gui.dispersers") + ": " + tileEntity.structure.clientDispersers + (dispersersLimiting ? limiting : ""), 14, 49, 0x404040);
|
||||
@@ -57,9 +58,9 @@ public class GuiTurbineStats extends GuiMekanism
|
||||
fontRendererObj.drawString(LangUtils.localize("gui.blades") + ": " + tileEntity.structure.blades + (bladesLimiting ? limiting : ""), 14, 81, 0x404040);
|
||||
fontRendererObj.drawString(LangUtils.localize("gui.coils") + ": " + tileEntity.structure.coils + (coilsLimiting ? limiting : ""), 14, 90, 0x404040);
|
||||
|
||||
double energyMultiplier = TileEntityTurbineCasing.ENERGY_PER_STEAM*Math.min(tileEntity.structure.blades, tileEntity.structure.coils*TileEntityTurbineCasing.BLADE_TO_COIL_RATIO);
|
||||
double rate = tileEntity.structure.lowerVolume*(tileEntity.structure.clientDispersers*TileEntityTurbineCasing.DISPERSER_GAS_FLOW);
|
||||
rate = Math.min(rate, tileEntity.structure.vents*TileEntityTurbineCasing.VENT_GAS_FLOW);
|
||||
double energyMultiplier = generators.turbineBaseEnergyPerSteam*Math.min(tileEntity.structure.blades, tileEntity.structure.coils*generators.turbineBladesPerCoil);
|
||||
double rate = tileEntity.structure.lowerVolume*(tileEntity.structure.clientDispersers*generators.turbineDisperserGasFlow);
|
||||
rate = Math.min(rate, tileEntity.structure.vents*generators.turbineVentGasFlow);
|
||||
|
||||
fontRendererObj.drawString(LangUtils.localize("gui.maxProduction") + ": " + MekanismUtils.getEnergyDisplay(rate*energyMultiplier), 8, 104, 0x404040);
|
||||
|
||||
|
||||
@@ -92,14 +92,19 @@ public class GeneratorsCommonProxy implements IGuiProvider
|
||||
*/
|
||||
public void loadConfiguration()
|
||||
{
|
||||
generators.advancedSolarGeneration = Mekanism.configuration.get("generation", "AdvancedSolarGeneration", 300D).getDouble(300D);
|
||||
generators.bioGeneration = Mekanism.configuration.get("generation", "BioGeneration", 350D).getDouble(350D);
|
||||
generators.heatGeneration = Mekanism.configuration.get("generation", "HeatGeneration", 150D).getDouble(150D);
|
||||
generators.heatGenerationLava = Mekanism.configuration.get("generation", "HeatGenerationLava", 5D).getDouble(5D);
|
||||
generators.heatGenerationNether = Mekanism.configuration.get("generation", "HeatGenerationNether", 100D).getDouble(100D);
|
||||
generators.solarGeneration = Mekanism.configuration.get("generation", "SolarGeneration", 50D).getDouble(50D);
|
||||
generators.advancedSolarGeneration = Mekanism.configuration.get("generation", "AdvancedSolarGeneration", 300D).getDouble();
|
||||
generators.bioGeneration = Mekanism.configuration.get("generation", "BioGeneration", 350D).getDouble();
|
||||
generators.heatGeneration = Mekanism.configuration.get("generation", "HeatGeneration", 150D).getDouble();
|
||||
generators.heatGenerationLava = Mekanism.configuration.get("generation", "HeatGenerationLava", 5D).getDouble();
|
||||
generators.heatGenerationNether = Mekanism.configuration.get("generation", "HeatGenerationNether", 100D).getDouble();
|
||||
generators.solarGeneration = Mekanism.configuration.get("generation", "SolarGeneration", 50D).getDouble();
|
||||
|
||||
loadWindConfiguration();
|
||||
|
||||
generators.turbineBladesPerCoil = Mekanism.configuration.get("generation", "TurbineBladesPerCoil", 4).getInt();
|
||||
generators.turbineBaseEnergyPerSteam = Mekanism.configuration.get("generation", "TurbineBaseEnergyPerSteam", 10D).getDouble();
|
||||
generators.turbineVentGasFlow = Mekanism.configuration.get("generation", "TurbineVentGasFlow", 16000D).getDouble();
|
||||
generators.turbineDisperserGasFlow = Mekanism.configuration.get("generation", "TurbineDisperserGasFlow", 640D).getDouble();
|
||||
|
||||
if(Mekanism.configuration.hasChanged())
|
||||
{
|
||||
@@ -109,24 +114,12 @@ public class GeneratorsCommonProxy implements IGuiProvider
|
||||
|
||||
private void loadWindConfiguration()
|
||||
{
|
||||
if(Mekanism.configuration.hasKey("generation", "WindGeneration"))
|
||||
{
|
||||
//Migrate the old wind generation config
|
||||
final double legacyWindGeneration = Mekanism.configuration.get("generation", "WindGeneration", 60D).getDouble(60D);
|
||||
final double windGenerationMax = legacyWindGeneration * 8D;
|
||||
Mekanism.configuration.getCategory("generation").remove("WindGeneration");
|
||||
|
||||
generators.windGenerationMin = Mekanism.configuration.get("generation", "WindGenerationMin", legacyWindGeneration).getDouble(legacyWindGeneration);
|
||||
generators.windGenerationMax = Mekanism.configuration.get("generation", "WindGenerationMax", windGenerationMax).getDouble(windGenerationMax);
|
||||
}
|
||||
else {
|
||||
generators.windGenerationMin = Mekanism.configuration.get("generation", "WindGenerationMin", 60D).getDouble(60D);
|
||||
generators.windGenerationMax = Mekanism.configuration.get("generation", "WindGenerationMax", 480D).getDouble(480D);
|
||||
}
|
||||
generators.windGenerationMin = Mekanism.configuration.get("generation", "WindGenerationMin", 60D).getDouble();
|
||||
generators.windGenerationMax = Mekanism.configuration.get("generation", "WindGenerationMax", 480D).getDouble();
|
||||
|
||||
//Ensure max > min to avoid division by zero later
|
||||
final int minY = Mekanism.configuration.get("generation", "WindGenerationMinY", 24).getInt(24);
|
||||
final int maxY = Mekanism.configuration.get("generation", "WindGenerationMaxY", 255).getInt(255);
|
||||
final int minY = Mekanism.configuration.get("generation", "WindGenerationMinY", 24).getInt();
|
||||
final int maxY = Mekanism.configuration.get("generation", "WindGenerationMaxY", 255).getInt();
|
||||
|
||||
generators.windGenerationMinY = minY;
|
||||
generators.windGenerationMaxY = Math.max(minY + 1, maxY);
|
||||
|
||||
@@ -7,7 +7,6 @@ import java.util.Random;
|
||||
import mekanism.api.MekanismConfig.general;
|
||||
import mekanism.api.energy.IEnergizedItem;
|
||||
import mekanism.common.CTMData;
|
||||
import mekanism.common.ItemAttacher;
|
||||
import mekanism.common.Mekanism;
|
||||
import mekanism.common.base.IActiveState;
|
||||
import mekanism.common.base.IBlockCTM;
|
||||
@@ -415,11 +414,6 @@ public class BlockGenerator extends BlockContainer implements ISpecialBounds, IB
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer entityplayer, int side, float playerX, float playerY, float playerZ)
|
||||
{
|
||||
if(ItemAttacher.canAttach(entityplayer.getCurrentEquippedItem()))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if(world.isRemote)
|
||||
{
|
||||
return true;
|
||||
|
||||
@@ -5,7 +5,6 @@ import java.util.List;
|
||||
|
||||
import mekanism.api.Coord4D;
|
||||
import mekanism.common.CTMData;
|
||||
import mekanism.common.ItemAttacher;
|
||||
import mekanism.common.Mekanism;
|
||||
import mekanism.common.base.IBlockCTM;
|
||||
import mekanism.common.tile.TileEntityBasicBlock;
|
||||
@@ -159,11 +158,6 @@ public class BlockReactor extends BlockContainer implements IBlockCTM
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer entityplayer, int facing, float playerX, float playerY, float playerZ)
|
||||
{
|
||||
if(ItemAttacher.canAttach(entityplayer.getCurrentEquippedItem()))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if(world.isRemote)
|
||||
{
|
||||
return true;
|
||||
|
||||
@@ -5,6 +5,7 @@ import io.netty.buffer.ByteBuf;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import mekanism.api.Coord4D;
|
||||
import mekanism.api.MekanismConfig.generators;
|
||||
import mekanism.api.Range4D;
|
||||
import mekanism.api.energy.IStrictEnergyStorage;
|
||||
import mekanism.common.Mekanism;
|
||||
@@ -26,11 +27,6 @@ import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
public class TileEntityTurbineCasing extends TileEntityMultiblock<SynchronizedTurbineData> implements IStrictEnergyStorage
|
||||
{
|
||||
public static final double DISPERSER_GAS_FLOW = 640;
|
||||
public static final double VENT_GAS_FLOW = 16000;
|
||||
public static final double ENERGY_PER_STEAM = 10;
|
||||
public static final double BLADE_TO_COIL_RATIO = 4;
|
||||
|
||||
public float prevScale;
|
||||
|
||||
public TileEntityTurbineCasing()
|
||||
@@ -82,9 +78,9 @@ public class TileEntityTurbineCasing extends TileEntityMultiblock<SynchronizedTu
|
||||
|
||||
if(stored > 0 && getEnergy() < structure.getEnergyCapacity())
|
||||
{
|
||||
double energyMultiplier = ENERGY_PER_STEAM*Math.min(structure.blades, structure.coils*BLADE_TO_COIL_RATIO);
|
||||
double rate = structure.lowerVolume*(structure.getDispersers()*DISPERSER_GAS_FLOW);
|
||||
rate = Math.min(rate, structure.vents*VENT_GAS_FLOW);
|
||||
double energyMultiplier = generators.turbineBaseEnergyPerSteam*Math.min(structure.blades, structure.coils*generators.turbineBladesPerCoil);
|
||||
double rate = structure.lowerVolume*(structure.getDispersers()*generators.turbineDisperserGasFlow);
|
||||
rate = Math.min(rate, structure.vents*generators.turbineVentGasFlow);
|
||||
|
||||
double origRate = rate;
|
||||
|
||||
|
||||
Reference in new issue
Block a user