mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-08-10 17:55:44 +00:00
Merge pull request #3029 from TheVitya2127/deimos
New Centrifuge and Mixer GUI and Hello Gamma
This commit is contained in:
commit
5c0bdff858
@ -20,7 +20,7 @@ public class CentrifugeRecipeHandler extends NEIUniversalHandler {
|
||||
@Override
|
||||
public void loadTransferRects() {
|
||||
super.loadTransferRects();
|
||||
transferRectsGui.add(new RecipeTransferRect(new Rectangle(56, 0, 80, 38), "ntmCentrifuge"));
|
||||
transferRectsGui.add(new RecipeTransferRect(new Rectangle(63, 7, 80, 38), "ntmCentrifuge"));
|
||||
guiGui.add(GUIMachineCentrifuge.class);
|
||||
RecipeTransferRectHandler.registerRectsToGuis(guiGui, transferRectsGui);
|
||||
}
|
||||
|
||||
@ -20,7 +20,7 @@ public class MixerHandler extends NEIUniversalHandler {
|
||||
@Override
|
||||
public void loadTransferRects() {
|
||||
super.loadTransferRects();
|
||||
transferRectsGui.add(new RecipeTransferRect(new Rectangle(57, 25, 52, 44), "ntmMixer"));
|
||||
transferRectsGui.add(new RecipeTransferRect(new Rectangle(66, 20, 52, 44), "ntmMixer"));
|
||||
guiGui.add(GUIMixer.class);
|
||||
RecipeTransferRectHandler.registerRectsToGuis(guiGui, transferRectsGui);
|
||||
}
|
||||
|
||||
@ -162,7 +162,7 @@ public class RefineryRecipeHandler extends TemplateRecipeHandler implements ICom
|
||||
guiGui = new LinkedList<Class<? extends GuiContainer>>();
|
||||
|
||||
transferRects.add(new RecipeTransferRect(new Rectangle(138 - 1 - 36 - 27, 23, 36, 18), "refinery"));
|
||||
transferRectsGui.add(new RecipeTransferRect(new Rectangle(48, 5, 31, 101), "refinery"));
|
||||
transferRectsGui.add(new RecipeTransferRect(new Rectangle(34, 34, 14, 34), "refinery"));
|
||||
guiGui.add(GUIMachineRefinery.class);
|
||||
RecipeTransferRectHandler.registerRectsToGuis(getRecipeTransferRectGuis(), transferRects);
|
||||
RecipeTransferRectHandler.registerRectsToGuis(guiGui, transferRectsGui);
|
||||
|
||||
@ -15,29 +15,33 @@ import net.minecraft.item.ItemStack;
|
||||
|
||||
public class ContainerCentrifuge extends Container {
|
||||
|
||||
private TileEntityMachineCentrifuge diFurnace;
|
||||
private TileEntityMachineCentrifuge centrifuge;
|
||||
|
||||
public ContainerCentrifuge(InventoryPlayer invPlayer, TileEntityMachineCentrifuge tedf) {
|
||||
|
||||
diFurnace = tedf;
|
||||
this.centrifuge = tedf;
|
||||
|
||||
this.addSlotToContainer(new Slot(tedf, 0, 36, 50));
|
||||
this.addSlotToContainer(new Slot(tedf, 1, 9, 50));
|
||||
this.addSlotToContainer(new SlotCraftingOutput(invPlayer.player, tedf, 2, 63, 50));
|
||||
this.addSlotToContainer(new SlotCraftingOutput(invPlayer.player, tedf, 3, 83, 50));
|
||||
this.addSlotToContainer(new SlotCraftingOutput(invPlayer.player, tedf, 4, 103, 50));
|
||||
this.addSlotToContainer(new SlotCraftingOutput(invPlayer.player, tedf, 5, 123, 50));
|
||||
this.addSlotToContainer(new SlotUpgrade(tedf, 6, 149, 22));
|
||||
this.addSlotToContainer(new SlotUpgrade(tedf, 7, 149, 40));
|
||||
// Input
|
||||
this.addSlotToContainer(new Slot(tedf, 0, 44, 57));
|
||||
// Battery
|
||||
this.addSlotToContainer(new Slot(tedf, 1, 8, 57));
|
||||
// Outputs
|
||||
this.addSlotToContainer(new SlotCraftingOutput(invPlayer.player, tedf, 2, 70, 57));
|
||||
this.addSlotToContainer(new SlotCraftingOutput(invPlayer.player, tedf, 3, 90, 57));
|
||||
this.addSlotToContainer(new SlotCraftingOutput(invPlayer.player, tedf, 4, 110, 57));
|
||||
this.addSlotToContainer(new SlotCraftingOutput(invPlayer.player, tedf, 5, 130, 57));
|
||||
// Upgrades
|
||||
this.addSlotToContainer(new SlotUpgrade(tedf, 6, 156, 31));
|
||||
this.addSlotToContainer(new SlotUpgrade(tedf, 7, 156, 49));
|
||||
|
||||
for(int i = 0; i < 3; i++) {
|
||||
for(int j = 0; j < 9; j++) {
|
||||
this.addSlotToContainer(new Slot(invPlayer, j + i * 9 + 9, 8 + j * 18, 104 + i * 18));
|
||||
this.addSlotToContainer(new Slot(invPlayer, j + i * 9 + 9, 11 + j * 18, 107 + i * 18));
|
||||
}
|
||||
}
|
||||
|
||||
for(int i = 0; i < 9; i++) {
|
||||
this.addSlotToContainer(new Slot(invPlayer, i, 8 + i * 18, 162));
|
||||
this.addSlotToContainer(new Slot(invPlayer, i, 11 + i * 18, 165));
|
||||
}
|
||||
}
|
||||
|
||||
@ -83,7 +87,7 @@ public class ContainerCentrifuge extends Container {
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer player) {
|
||||
return diFurnace.isUseableByPlayer(player);
|
||||
return centrifuge.isUseableByPlayer(player);
|
||||
}
|
||||
|
||||
}
|
||||
@ -19,40 +19,40 @@ public class ContainerMachineRefinery extends Container {
|
||||
testNuke = tedf;
|
||||
|
||||
//Battery
|
||||
this.addSlotToContainer(new Slot(tedf, 0, 186, 72));
|
||||
this.addSlotToContainer(new Slot(tedf, 0, 158, 108));
|
||||
//Canister Input
|
||||
this.addSlotToContainer(new Slot(tedf, 1, 8, 99));
|
||||
this.addSlotToContainer(new Slot(tedf, 1, 12, 90));
|
||||
//Canister Output
|
||||
this.addSlotToContainer(new SlotTakeOnly(tedf, 2, 8, 119));
|
||||
this.addSlotToContainer(new SlotTakeOnly(tedf, 2, 12, 108));
|
||||
//Heavy Oil Input
|
||||
this.addSlotToContainer(new Slot(tedf, 3, 86, 99));
|
||||
this.addSlotToContainer(new Slot(tedf, 3, 64, 90));
|
||||
//Heavy Oil Output
|
||||
this.addSlotToContainer(new SlotTakeOnly(tedf, 4, 86, 119));
|
||||
this.addSlotToContainer(new SlotTakeOnly(tedf, 4, 64, 108));
|
||||
//Naphtha Input
|
||||
this.addSlotToContainer(new Slot(tedf, 5, 106, 99));
|
||||
this.addSlotToContainer(new Slot(tedf, 5, 82, 90));
|
||||
//Naphtha Output
|
||||
this.addSlotToContainer(new SlotTakeOnly(tedf, 6, 106, 119));
|
||||
this.addSlotToContainer(new SlotTakeOnly(tedf, 6, 82, 108));
|
||||
//Light Oil Input
|
||||
this.addSlotToContainer(new Slot(tedf, 7, 126, 99));
|
||||
this.addSlotToContainer(new Slot(tedf, 7, 100, 90));
|
||||
//Light Oil Output
|
||||
this.addSlotToContainer(new SlotTakeOnly(tedf, 8, 126, 119));
|
||||
this.addSlotToContainer(new SlotTakeOnly(tedf, 8, 100, 108));
|
||||
//Petroleum Input
|
||||
this.addSlotToContainer(new Slot(tedf, 9, 146, 99));
|
||||
this.addSlotToContainer(new Slot(tedf, 9, 118, 90));
|
||||
//Petroleum Output
|
||||
this.addSlotToContainer(new SlotTakeOnly(tedf, 10, 146, 119));
|
||||
this.addSlotToContainer(new SlotTakeOnly(tedf, 10, 118, 108));
|
||||
//Sulfur Output
|
||||
this.addSlotToContainer(new SlotTakeOnly(tedf, 11, 58, 119));
|
||||
this.addSlotToContainer(new SlotTakeOnly(tedf, 11, 38, 90));
|
||||
//Fluid ID
|
||||
this.addSlotToContainer(new Slot(tedf, 12, 186, 106));
|
||||
this.addSlotToContainer(new Slot(tedf, 12, 38, 108));
|
||||
|
||||
for(int i = 0; i < 3; i++) {
|
||||
for(int j = 0; j < 9; j++) {
|
||||
this.addSlotToContainer(new Slot(invPlayer, j + i * 9 + 9, 8 + j * 18, 150 + i * 18));
|
||||
this.addSlotToContainer(new Slot(invPlayer, j + i * 9 + 9, 11 + j * 18, 158 + i * 18));
|
||||
}
|
||||
}
|
||||
|
||||
for(int i = 0; i < 9; i++) {
|
||||
this.addSlotToContainer(new Slot(invPlayer, i, 8 + i * 18, 208));
|
||||
this.addSlotToContainer(new Slot(invPlayer, i, 11 + i * 18, 216));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -19,14 +19,14 @@ public class ContainerMixer extends Container {
|
||||
this.mixer = mixer;
|
||||
|
||||
// Battery
|
||||
this.addSlotToContainer(new Slot(mixer, 0, 23, 77));
|
||||
this.addSlotToContainer(new Slot(mixer, 0, 12, 72));
|
||||
// Item Input
|
||||
this.addSlotToContainer(new Slot(mixer, 1, 43, 77));
|
||||
this.addSlotToContainer(new Slot(mixer, 1, 52, 72));
|
||||
// Fluid ID
|
||||
this.addSlotToContainer(new Slot(mixer, 2, 117, 77));
|
||||
this.addSlotToContainer(new Slot(mixer, 2, 126, 72));
|
||||
// Upgrades
|
||||
this.addSlotToContainer(new Slot(mixer, 3, 137, 24));
|
||||
this.addSlotToContainer(new Slot(mixer, 4, 137, 42));
|
||||
this.addSlotToContainer(new Slot(mixer, 3, 148, 18));
|
||||
this.addSlotToContainer(new Slot(mixer, 4, 148, 36));
|
||||
|
||||
for(int i = 0; i < 3; i++) {
|
||||
for(int j = 0; j < 9; j++) {
|
||||
|
||||
@ -5,6 +5,7 @@ import org.lwjgl.opengl.GL11;
|
||||
import com.hbm.inventory.container.ContainerCentrifuge;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineCentrifuge;
|
||||
import com.hbm.util.i18n.I18nUtil;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
@ -18,25 +19,32 @@ public class GUIMachineCentrifuge extends GuiInfoContainer {
|
||||
|
||||
public GUIMachineCentrifuge(InventoryPlayer invPlayer, TileEntityMachineCentrifuge tedf) {
|
||||
super(new ContainerCentrifuge(invPlayer, tedf));
|
||||
centrifuge = tedf;
|
||||
|
||||
this.xSize = 176;
|
||||
this.ySize = 186;
|
||||
this.centrifuge = tedf;
|
||||
this.xSize = 182;
|
||||
this.ySize = 189;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawScreen(int mouseX, int mouseY, float f) {
|
||||
super.drawScreen(mouseX, mouseY, f);
|
||||
|
||||
this.drawElectricityInfo(this, mouseX, mouseY, guiLeft + 9, guiTop + 13, 16, 34, centrifuge.power, centrifuge.maxPower);
|
||||
this.drawElectricityInfo(this, mouseX, mouseY, guiLeft + 8, guiTop + 18, 16, 37, centrifuge.power, centrifuge.maxPower);
|
||||
|
||||
String[] upgradeText = new String[4];
|
||||
upgradeText[0] = I18nUtil.resolveKey("desc.gui.upgrade");
|
||||
upgradeText[1] = I18nUtil.resolveKey("desc.gui.upgrade.speed");
|
||||
upgradeText[2] = I18nUtil.resolveKey("desc.gui.upgrade.power");
|
||||
upgradeText[3] = I18nUtil.resolveKey("desc.gui.upgrade.overdrive");
|
||||
this.drawCustomInfoStat(mouseX, mouseY, guiLeft + 160, guiTop + 16, 8, 8, mouseX, mouseY, upgradeText);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerForegroundLayer( int i, int j) {
|
||||
//String name = this.centrifuge.hasCustomInventoryName() ? this.centrifuge.getInventoryName() : I18n.format(this.centrifuge.getInventoryName());
|
||||
String name = this.centrifuge.hasCustomInventoryName() ? this.centrifuge.getInventoryName() : I18n.format(this.centrifuge.getInventoryName());
|
||||
|
||||
//this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752);
|
||||
this.fontRendererObj.drawString(I18n.format("container.inventory"), 8, this.ySize - 96 + 2, 4210752);
|
||||
this.fontRendererObj.drawString(name, this.xSize / 2 + 36 / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 0xffffff);
|
||||
this.fontRendererObj.drawString(I18n.format("container.inventory"), 11, this.ySize - 96 + 2, 4210752);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -46,8 +54,8 @@ public class GUIMachineCentrifuge extends GuiInfoContainer {
|
||||
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
|
||||
|
||||
if(centrifuge.hasPower()) {
|
||||
int i1 = (int) centrifuge.getPowerRemainingScaled(35);
|
||||
drawTexturedModalRect(guiLeft + 9, guiTop + 48 - i1, 176, 35 - i1, 16, i1);
|
||||
int i1 = (int) centrifuge.getPowerRemainingScaled(37);
|
||||
drawTexturedModalRect(guiLeft + 8, guiTop + 55 - i1, 182, 37 - i1, 16, i1);
|
||||
}
|
||||
|
||||
if(centrifuge.isProcessing()) {
|
||||
@ -55,11 +63,13 @@ public class GUIMachineCentrifuge extends GuiInfoContainer {
|
||||
|
||||
for(int i = 0; i < 4; i++) {
|
||||
int h = Math.min(p, 36);
|
||||
drawTexturedModalRect(guiLeft + 65 + i * 20, guiTop + 50 - h, 176, 71 - h, 12, h);
|
||||
drawTexturedModalRect(guiLeft + 72 + i * 20, guiTop + 57 - h, 182, 73 - h, 12, h);
|
||||
p -= h;
|
||||
if(p <= 0)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
this.drawInfoPanel(guiLeft + 160, guiTop + 16, 8, 8, 8);
|
||||
}
|
||||
}
|
||||
|
||||
@ -26,53 +26,47 @@ public class GUIMachineRefinery extends GuiInfoContainer {
|
||||
super(new ContainerMachineRefinery(invPlayer, tedf));
|
||||
refinery = tedf;
|
||||
|
||||
this.xSize = 210;
|
||||
this.ySize = 231;
|
||||
this.xSize = 182;
|
||||
this.ySize = 240;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawScreen(int mouseX, int mouseY, float f) {
|
||||
super.drawScreen(mouseX, mouseY, f);
|
||||
|
||||
refinery.tanks[0].renderTankInfo(this, mouseX, mouseY, guiLeft + 30, guiTop + 27, 21, 104); // Render tooltip for column.
|
||||
refinery.tanks[1].renderTankInfo(this, mouseX, mouseY, guiLeft + 86, guiTop + 42, 16, 52);
|
||||
refinery.tanks[2].renderTankInfo(this, mouseX, mouseY, guiLeft + 106, guiTop + 42, 16, 52);
|
||||
refinery.tanks[3].renderTankInfo(this, mouseX, mouseY, guiLeft + 126, guiTop + 42, 16, 52);
|
||||
refinery.tanks[4].renderTankInfo(this, mouseX, mouseY, guiLeft + 146, guiTop + 42, 16, 52);
|
||||
this.drawElectricityInfo(this, mouseX, mouseY, guiLeft + 186, guiTop + 18, 16, 52, refinery.power, refinery.maxPower);
|
||||
refinery.tanks[0].renderTankInfo(this, mouseX, mouseY, guiLeft + 12, guiTop + 17, 16, 70); // Render tooltip for column.
|
||||
refinery.tanks[1].renderTankInfo(this, mouseX, mouseY, guiLeft + 64, guiTop + 35, 16, 52);
|
||||
refinery.tanks[2].renderTankInfo(this, mouseX, mouseY, guiLeft + 82, guiTop + 35, 16, 52);
|
||||
refinery.tanks[3].renderTankInfo(this, mouseX, mouseY, guiLeft + 100, guiTop + 35, 16, 52);
|
||||
refinery.tanks[4].renderTankInfo(this, mouseX, mouseY, guiLeft + 118, guiTop + 35, 16, 52);
|
||||
this.drawElectricityInfo(this, mouseX, mouseY, guiLeft + 158, guiTop + 18, 16, 88, refinery.power, refinery.maxPower);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerForegroundLayer(int i, int j) {
|
||||
String name = this.refinery.hasCustomInventoryName() ? this.refinery.getInventoryName() : I18n.format(this.refinery.getInventoryName());
|
||||
|
||||
this.fontRendererObj.drawString(name, this.xSize / 2 - 34/2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752);
|
||||
this.fontRendererObj.drawString(I18n.format("container.inventory"), 8, this.ySize - 96 + 4, 4210752);
|
||||
this.fontRendererObj.drawString(name, this.xSize / 2 - 36 / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752);
|
||||
this.fontRendererObj.drawString(I18n.format("container.inventory"), 11, this.ySize - 96 + 2, 4210752);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
|
||||
func_146110_a(guiLeft, guiTop, 0, 0, xSize, ySize, 350, 256);
|
||||
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
|
||||
|
||||
// power
|
||||
int j = (int)refinery.getPowerScaled(50);
|
||||
func_146110_a(guiLeft + 186, guiTop + 69 - j, 210, 52 - j, 16, j, 350, 256);
|
||||
int j = (int)refinery.getPowerScaled(88);
|
||||
drawTexturedModalRect(guiLeft + 158, guiTop + 106 - j, 182, 88 - j, 16, j);
|
||||
|
||||
OpenGlHelper.glBlendFunc(770, 771, 1, 0); // default
|
||||
|
||||
// input tank
|
||||
FluidTank inputOil = refinery.tanks[0];
|
||||
if (inputOil.getFill() != 0) {
|
||||
|
||||
int targetHeight = inputOil.getFill() * 101 / inputOil.getMaxFill();
|
||||
Color color = new Color(inputOil.getTankType().getColor());
|
||||
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glColor4f(color.getRed() / 255F, color.getGreen() / 255F, color.getBlue() / 255F, 1F);
|
||||
func_146110_a(guiLeft + 33, guiTop + 130 - targetHeight, 226, 101 - targetHeight, 16, targetHeight, 350, 256);
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
refinery.tanks[0].renderTank(guiLeft + 12, guiTop + 88, this.zLevel, 16, 70);
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
|
||||
}
|
||||
|
||||
// fucking kgjhgdfjgdhjfg
|
||||
@ -84,10 +78,10 @@ public class GUIMachineRefinery extends GuiInfoContainer {
|
||||
RefineryRecipe recipe = RefineryRecipes.getRefinery(inputOil.getTankType());
|
||||
|
||||
if(recipe == null) {
|
||||
func_146110_a(guiLeft + 52, guiTop + 63, 247, 1, 33, 48, 350, 256);
|
||||
func_146110_a(guiLeft + 52, guiTop + 32, 247, 50, 66, 52, 350, 256);
|
||||
func_146110_a(guiLeft + 52, guiTop + 24, 247, 145, 86, 35, 350, 256);
|
||||
func_146110_a(guiLeft + 36, guiTop + 16, 211, 119, 122, 25, 350, 256);
|
||||
func_146110_a(guiLeft + 30, guiTop + 30, 0, 248, 43, 4, 256, 256);
|
||||
func_146110_a(guiLeft + 30, guiTop + 26, 0, 240, 61, 8, 256, 256);
|
||||
func_146110_a(guiLeft + 30, guiTop + 22, 61, 240, 79, 12, 256, 256);
|
||||
func_146110_a(guiLeft + 30, guiTop + 18, 140, 240, 97, 16, 256, 256);
|
||||
} else {
|
||||
|
||||
// Heavy Oil Products
|
||||
@ -95,31 +89,31 @@ public class GUIMachineRefinery extends GuiInfoContainer {
|
||||
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glColor4f(color.getRed() / 255F, color.getGreen() / 255F, color.getBlue() / 255F, 1F);
|
||||
func_146110_a(guiLeft + 52, guiTop + 63, 247, 1, 33, 48, 350, 256);
|
||||
func_146110_a(guiLeft + 30, guiTop + 30, 0, 248, 43, 4, 256, 256);
|
||||
|
||||
// Naphtha Oil Products
|
||||
color = new Color(recipe.outputs[1].type.getColor());
|
||||
GL11.glColor4f(color.getRed() / 255F, color.getGreen() / 255F, color.getBlue() / 255F, 1F);
|
||||
func_146110_a(guiLeft + 52, guiTop + 32, 247, 50, 66, 52, 350, 256);
|
||||
func_146110_a(guiLeft + 30, guiTop + 26, 0, 240, 61, 8, 256, 256);
|
||||
|
||||
// Light Oil Products
|
||||
color = new Color(recipe.outputs[2].type.getColor());
|
||||
GL11.glColor4f(color.getRed() / 255F, color.getGreen() / 255F, color.getBlue() / 255F, 1F);
|
||||
func_146110_a(guiLeft + 52, guiTop + 24, 247, 145, 86, 35, 350, 256);
|
||||
func_146110_a(guiLeft + 30, guiTop + 22, 61, 240, 79, 12, 256, 256);
|
||||
|
||||
// Gaseous Products
|
||||
color = new Color(recipe.outputs[3].type.getColor());
|
||||
GL11.glColor4f(color.getRed() / 255F, color.getGreen() / 255F, color.getBlue() / 255F, 1F);
|
||||
func_146110_a(guiLeft + 36, guiTop + 16, 211, 119, 122, 25, 350, 256);
|
||||
func_146110_a(guiLeft + 30, guiTop + 18, 140, 240, 97, 16, 256, 256);
|
||||
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
GL11.glColor4f(1F, 1F, 1F, 1F);
|
||||
}
|
||||
|
||||
// output tanks
|
||||
refinery.tanks[1].renderTank(guiLeft + 86, guiTop + 95, this.zLevel, 16, 52);
|
||||
refinery.tanks[2].renderTank(guiLeft + 106, guiTop + 95, this.zLevel, 16, 52);
|
||||
refinery.tanks[3].renderTank(guiLeft + 126, guiTop + 95, this.zLevel, 16, 52);
|
||||
refinery.tanks[4].renderTank(guiLeft + 146, guiTop + 95, this.zLevel, 16, 52);
|
||||
refinery.tanks[1].renderTank(guiLeft + 64, guiTop + 88, this.zLevel, 16, 52);
|
||||
refinery.tanks[2].renderTank(guiLeft + 82, guiTop + 88, this.zLevel, 16, 52);
|
||||
refinery.tanks[3].renderTank(guiLeft + 100, guiTop + 88, this.zLevel, 16, 52);
|
||||
refinery.tanks[4].renderTank(guiLeft + 118, guiTop + 88, this.zLevel, 16, 52);
|
||||
}
|
||||
}
|
||||
|
||||
@ -12,6 +12,7 @@ import com.hbm.lib.RefStrings;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.packet.toserver.NBTControlPacket;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineMixer;
|
||||
import com.hbm.util.i18n.I18nUtil;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.audio.PositionedSoundRecord;
|
||||
@ -28,8 +29,8 @@ public class GUIMixer extends GuiInfoContainer {
|
||||
|
||||
public GUIMixer(InventoryPlayer player, TileEntityMachineMixer mixer) {
|
||||
super(new ContainerMixer(player, mixer));
|
||||
this.mixer = mixer;
|
||||
|
||||
this.mixer = mixer;
|
||||
this.xSize = 176;
|
||||
this.ySize = 204;
|
||||
}
|
||||
@ -38,7 +39,14 @@ public class GUIMixer extends GuiInfoContainer {
|
||||
public void drawScreen(int x, int y, float interp) {
|
||||
super.drawScreen(x, y, interp);
|
||||
|
||||
this.drawElectricityInfo(this, x, y, guiLeft + 23, guiTop + 23, 16, 52, mixer.getPower(), mixer.getMaxPower());
|
||||
this.drawElectricityInfo(this, x, y, guiLeft + 12, guiTop + 18, 16, 52, mixer.getPower(), mixer.getMaxPower());
|
||||
|
||||
String[] upgradeText = new String[4];
|
||||
upgradeText[0] = I18nUtil.resolveKey("desc.gui.upgrade");
|
||||
upgradeText[1] = I18nUtil.resolveKey("desc.gui.upgrade.speed");
|
||||
upgradeText[2] = I18nUtil.resolveKey("desc.gui.upgrade.power");
|
||||
upgradeText[3] = I18nUtil.resolveKey("desc.gui.upgrade.overdrive");
|
||||
this.drawCustomInfoStat(x, y, guiLeft + 152, guiTop + 55, 8, 8, x, y, upgradeText);
|
||||
|
||||
MixerRecipe[] recipes = MixerRecipes.getOutput(mixer.tanks[2].getTankType());
|
||||
|
||||
@ -50,19 +58,19 @@ public class GUIMixer extends GuiInfoContainer {
|
||||
if(recipe.input2 != null) label.add("-" + recipe.input2.type.getLocalizedName());
|
||||
if(recipe.solidInput != null) label.add("-" + recipe.solidInput.extractForCyclingDisplay(20).getDisplayName());
|
||||
label.add(EnumChatFormatting.RED + "Click to change!");
|
||||
this.drawCustomInfoStat(x, y, guiLeft + 62, guiTop + 22, 12, 12, x, y, label);
|
||||
this.drawCustomInfoStat(x, y, guiLeft + 71, guiTop + 17, 12, 12, x, y, label);
|
||||
}
|
||||
|
||||
mixer.tanks[0].renderTankInfo(this, x, y, guiLeft + 43, guiTop + 23, 7, 52);
|
||||
mixer.tanks[1].renderTankInfo(this, x, y, guiLeft + 52, guiTop + 23, 7, 52);
|
||||
mixer.tanks[2].renderTankInfo(this, x, y, guiLeft + 117, guiTop + 23, 16, 52);
|
||||
mixer.tanks[0].renderTankInfo(this, x, y, guiLeft + 52, guiTop + 18, 7, 52);
|
||||
mixer.tanks[1].renderTankInfo(this, x, y, guiLeft + 61, guiTop + 18, 7, 52);
|
||||
mixer.tanks[2].renderTankInfo(this, x, y, guiLeft + 126, guiTop + 18, 16, 52);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void mouseClicked(int x, int y, int i) {
|
||||
super.mouseClicked(x, y, i);
|
||||
|
||||
if(guiLeft + 62 <= x && guiLeft + 62 + 12 > x && guiTop + 22 < y && guiTop + 22 + 12 >= y) {
|
||||
if(guiLeft + 71 <= x && guiLeft + 71 + 12 > x && guiTop + 17 < y && guiTop + 17 + 12 >= y) {
|
||||
|
||||
mc.getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F));
|
||||
NBTTagCompound data = new NBTTagCompound();
|
||||
@ -73,9 +81,9 @@ public class GUIMixer extends GuiInfoContainer {
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerForegroundLayer( int i, int j) {
|
||||
|
||||
String name = this.mixer.hasCustomInventoryName() ? this.mixer.getInventoryName() : I18n.format(this.mixer.getInventoryName());
|
||||
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752);
|
||||
|
||||
this.fontRendererObj.drawString(name, this.xSize / 2 + 40 / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752);
|
||||
this.fontRendererObj.drawString(I18n.format("container.inventory"), 8, this.ySize - 96 + 2, 4210752);
|
||||
}
|
||||
|
||||
@ -85,16 +93,18 @@ public class GUIMixer extends GuiInfoContainer {
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
|
||||
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
|
||||
|
||||
int i = (int) (mixer.getPower() * 53 / mixer.getMaxPower());
|
||||
drawTexturedModalRect(guiLeft + 23, guiTop + 75 - i, 176, 52 - i, 16, i);
|
||||
int i = (int) (mixer.getPower() * 52 / mixer.getMaxPower());
|
||||
drawTexturedModalRect(guiLeft + 12, guiTop + 70 - i, 176, 52 - i, 16, i);
|
||||
|
||||
if(mixer.processTime > 0 && mixer.progress > 0) {
|
||||
int j = mixer.progress * 53 / mixer.processTime;
|
||||
drawTexturedModalRect(guiLeft + 62, guiTop + 36, 192, 0, j, 44);
|
||||
int j = mixer.progress * 52 / mixer.processTime;
|
||||
drawTexturedModalRect(guiLeft + 71, guiTop + 31, 192, 0, j, 44);
|
||||
}
|
||||
|
||||
mixer.tanks[0].renderTank(guiLeft + 43, guiTop + 75, this.zLevel, 7, 52);
|
||||
mixer.tanks[1].renderTank(guiLeft + 52, guiTop + 75, this.zLevel, 7, 52);
|
||||
mixer.tanks[2].renderTank(guiLeft + 117, guiTop + 75, this.zLevel, 16, 52);
|
||||
mixer.tanks[0].renderTank(guiLeft + 52, guiTop + 70, this.zLevel, 7, 52);
|
||||
mixer.tanks[1].renderTank(guiLeft + 61, guiTop + 70, this.zLevel, 7, 52);
|
||||
mixer.tanks[2].renderTank(guiLeft + 126, guiTop + 70, this.zLevel, 16, 52);
|
||||
|
||||
this.drawInfoPanel(guiLeft + 152, guiTop + 55, 8, 8, 8);
|
||||
}
|
||||
}
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.7 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 3.2 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 8.4 KiB After Width: | Height: | Size: 3.9 KiB |
Loading…
x
Reference in New Issue
Block a user