More work on logic adapter

This commit is contained in:
Aidan C. Brady 2015-03-29 14:47:09 -04:00
parent 78ed108904
commit 0f54c21cf2
4 changed files with 60 additions and 3 deletions

View file

@ -1,7 +1,5 @@
package mekanism.generators.client;
import mekanism.api.MekanismConfig.client;
import mekanism.common.Mekanism;
import mekanism.generators.client.gui.GuiBioGenerator;
import mekanism.generators.client.gui.GuiGasGenerator;
import mekanism.generators.client.gui.GuiHeatGenerator;
@ -9,6 +7,7 @@ import mekanism.generators.client.gui.GuiNeutronCapture;
import mekanism.generators.client.gui.GuiReactorController;
import mekanism.generators.client.gui.GuiReactorFuel;
import mekanism.generators.client.gui.GuiReactorHeat;
import mekanism.generators.client.gui.GuiReactorLogicAdapter;
import mekanism.generators.client.gui.GuiReactorStats;
import mekanism.generators.client.gui.GuiSolarGenerator;
import mekanism.generators.client.gui.GuiWindTurbine;
@ -27,6 +26,7 @@ import mekanism.generators.common.tile.TileEntityHeatGenerator;
import mekanism.generators.common.tile.TileEntitySolarGenerator;
import mekanism.generators.common.tile.TileEntityWindTurbine;
import mekanism.generators.common.tile.reactor.TileEntityReactorController;
import mekanism.generators.common.tile.reactor.TileEntityReactorLogicAdapter;
import mekanism.generators.common.tile.reactor.TileEntityReactorNeutronCapture;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.entity.player.EntityPlayer;
@ -88,6 +88,8 @@ public class GeneratorsClientProxy extends GeneratorsCommonProxy
return new GuiReactorStats(player.inventory, (TileEntityReactorController)tileEntity);
case 14:
return new GuiNeutronCapture(player.inventory, (TileEntityReactorNeutronCapture)tileEntity);
case 15:
return new GuiReactorLogicAdapter(player.inventory, (TileEntityReactorLogicAdapter)tileEntity);
}
return null;

View file

@ -0,0 +1,46 @@
package mekanism.generators.client.gui;
import mekanism.client.gui.GuiMekanism;
import mekanism.common.inventory.container.ContainerNull;
import mekanism.common.util.MekanismUtils;
import mekanism.common.util.MekanismUtils.ResourceType;
import mekanism.generators.common.tile.reactor.TileEntityReactorLogicAdapter;
import net.minecraft.entity.player.InventoryPlayer;
import org.lwjgl.opengl.GL11;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class GuiReactorLogicAdapter extends GuiMekanism
{
public TileEntityReactorLogicAdapter tileEntity;
public GuiReactorLogicAdapter(InventoryPlayer inventory, final TileEntityReactorLogicAdapter tentity)
{
super(new ContainerNull(inventory.player, tentity));
tileEntity = tentity;
}
@Override
protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY)
{
fontRendererObj.drawString(tileEntity.getInventoryName(), 46, 6, 0x404040);
super.drawGuiContainerForegroundLayer(mouseX, mouseY);
}
@Override
protected void drawGuiContainerBackgroundLayer(float partialTick, int mouseX, int mouseY)
{
mc.renderEngine.bindTexture(MekanismUtils.getResource(ResourceType.GUI, "GuiReactorLogicAdapter.png"));
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
int guiWidth = (width - xSize) / 2;
int guiHeight = (height - ySize) / 2;
drawTexturedModalRect(guiWidth, guiHeight, 0, 0, xSize, ySize);
super.drawGuiContainerBackgroundLayer(partialTick, mouseX, mouseY);
}
}

View file

@ -146,6 +146,9 @@ public class MekanismGenerators implements IModule
CraftingManager.getInstance().getRecipeList().add(new MekanismRecipe(new ItemStack(GeneratorsBlocks.ReactorGlass, 2, 1), new Object[] {
" I ", "ILI", " I ", Character.valueOf('I'), new ItemStack(GeneratorsBlocks.ReactorGlass, 1, 0), Character.valueOf('L'), "blockRedstone"
}));
CraftingManager.getInstance().getRecipeList().add(new MekanismRecipe(new ItemStack(GeneratorsBlocks.Reactor, 1, 4), new Object[] {
" R ", "RFR", " R ", Character.valueOf('R'), "dustRedstone", Character.valueOf('R'), new ItemStack(GeneratorsBlocks.Reactor, 1, 1)
}));
FuelHandler.addGas(GasRegistry.getGas("ethene"), general.ETHENE_BURN_TIME, general.FROM_H2 + generators.bioGeneration * 2 * general.ETHENE_BURN_TIME); //1mB hydrogen + 2*bioFuel/tick*200ticks/100mB * 20x efficiency bonus
}

View file

@ -19,6 +19,12 @@ public class TileEntityReactorLogicAdapter extends TileEntityReactorBlock implem
public boolean activeCooled;
public TileEntityReactorLogicAdapter()
{
super();
fullName = "ReactorLogicAdapter";
}
@Override
public boolean isFrame()
{
@ -79,7 +85,7 @@ public class TileEntityReactorLogicAdapter extends TileEntityReactorBlock implem
}
else if(type == 1)
{
int index = dataStream.readInt();
logicType = ReactorLogic.values()[dataStream.readInt()];
}
return;