Auto formatted, and cleaned imports
This commit is contained in:
parent
c001231216
commit
8e7d6b011e
64 changed files with 2268 additions and 2587 deletions
|
@ -1,24 +1,12 @@
|
|||
package techreborn.client;
|
||||
|
||||
|
||||
import cpw.mods.fml.common.network.IGuiHandler;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.world.World;
|
||||
import techreborn.client.container.ContainerCentrifuge;
|
||||
import techreborn.client.container.ContainerQuantumChest;
|
||||
import techreborn.client.container.ContainerQuantumTank;
|
||||
import techreborn.client.container.ContainerRollingMachine;
|
||||
import techreborn.client.container.ContainerThermalGenerator;
|
||||
import techreborn.client.gui.GuiCentrifuge;
|
||||
import techreborn.client.gui.GuiQuantumChest;
|
||||
import techreborn.client.gui.GuiQuantumTank;
|
||||
import techreborn.client.gui.GuiRollingMachine;
|
||||
import techreborn.client.gui.GuiThermalGenerator;
|
||||
import techreborn.tiles.TileCentrifuge;
|
||||
import techreborn.tiles.TileQuantumChest;
|
||||
import techreborn.tiles.TileQuantumTank;
|
||||
import techreborn.tiles.TileRollingMachine;
|
||||
import techreborn.tiles.TileThermalGenerator;
|
||||
import cpw.mods.fml.common.network.IGuiHandler;
|
||||
import techreborn.client.container.*;
|
||||
import techreborn.client.gui.*;
|
||||
import techreborn.tiles.*;
|
||||
|
||||
public class GuiHandler implements IGuiHandler {
|
||||
|
||||
|
@ -26,20 +14,20 @@ public class GuiHandler implements IGuiHandler {
|
|||
public static final int quantumTankID = 1;
|
||||
public static final int quantumChestID = 2;
|
||||
public static final int centrifugeID = 3;
|
||||
public static final int rollingMachineID =4;
|
||||
public static final int rollingMachineID = 4;
|
||||
|
||||
|
||||
@Override
|
||||
public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
if(ID == thermalGeneratorID){
|
||||
if (ID == thermalGeneratorID) {
|
||||
return new ContainerThermalGenerator((TileThermalGenerator) world.getTileEntity(x, y, z), player);
|
||||
} else if(ID == quantumTankID){
|
||||
} else if (ID == quantumTankID) {
|
||||
return new ContainerQuantumTank((TileQuantumTank) world.getTileEntity(x, y, z), player);
|
||||
} else if(ID == quantumChestID){
|
||||
} else if (ID == quantumChestID) {
|
||||
return new ContainerQuantumChest((TileQuantumChest) world.getTileEntity(x, y, z), player);
|
||||
} else if(ID == centrifugeID){
|
||||
} else if (ID == centrifugeID) {
|
||||
return new ContainerCentrifuge((TileCentrifuge) world.getTileEntity(x, y, z), player);
|
||||
} else if(ID == rollingMachineID){
|
||||
} else if (ID == rollingMachineID) {
|
||||
return new ContainerRollingMachine((TileRollingMachine) world.getTileEntity(x, y, z), player);
|
||||
}
|
||||
|
||||
|
@ -48,16 +36,16 @@ public class GuiHandler implements IGuiHandler {
|
|||
|
||||
@Override
|
||||
public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
if(ID == thermalGeneratorID){
|
||||
return new GuiThermalGenerator(player, (TileThermalGenerator)world.getTileEntity(x, y, z));
|
||||
} else if(ID == quantumTankID){
|
||||
return new GuiQuantumTank(player, (TileQuantumTank)world.getTileEntity(x, y, z));
|
||||
} else if(ID == quantumChestID){
|
||||
return new GuiQuantumChest(player, (TileQuantumChest)world.getTileEntity(x, y, z));
|
||||
} else if(ID == centrifugeID){
|
||||
return new GuiCentrifuge(player, (TileCentrifuge)world.getTileEntity(x, y, z));
|
||||
} else if(ID == rollingMachineID){
|
||||
return new GuiRollingMachine(player, (TileRollingMachine)world.getTileEntity(x, y, z));
|
||||
if (ID == thermalGeneratorID) {
|
||||
return new GuiThermalGenerator(player, (TileThermalGenerator) world.getTileEntity(x, y, z));
|
||||
} else if (ID == quantumTankID) {
|
||||
return new GuiQuantumTank(player, (TileQuantumTank) world.getTileEntity(x, y, z));
|
||||
} else if (ID == quantumChestID) {
|
||||
return new GuiQuantumChest(player, (TileQuantumChest) world.getTileEntity(x, y, z));
|
||||
} else if (ID == centrifugeID) {
|
||||
return new GuiCentrifuge(player, (TileCentrifuge) world.getTileEntity(x, y, z));
|
||||
} else if (ID == rollingMachineID) {
|
||||
return new GuiRollingMachine(player, (TileRollingMachine) world.getTileEntity(x, y, z));
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
|
|
@ -6,14 +6,14 @@ import techreborn.init.ModBlocks;
|
|||
|
||||
public class TechRebornCreativeTab extends CreativeTabs {
|
||||
|
||||
public static TechRebornCreativeTab instance = new TechRebornCreativeTab();
|
||||
public static TechRebornCreativeTab instance = new TechRebornCreativeTab();
|
||||
|
||||
public TechRebornCreativeTab() {
|
||||
super("techreborn");
|
||||
}
|
||||
public TechRebornCreativeTab() {
|
||||
super("techreborn");
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getTabIconItem() {
|
||||
return Item.getItemFromBlock(ModBlocks.thermalGenerator);
|
||||
}
|
||||
@Override
|
||||
public Item getTabIconItem() {
|
||||
return Item.getItemFromBlock(ModBlocks.thermalGenerator);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,7 +14,7 @@ public class ContainerCentrifuge extends TechRebornContainer {
|
|||
|
||||
public int tickTime;
|
||||
|
||||
public ContainerCentrifuge(TileCentrifuge tileCentrifuge, EntityPlayer player){
|
||||
public ContainerCentrifuge(TileCentrifuge tileCentrifuge, EntityPlayer player) {
|
||||
tile = tileCentrifuge;
|
||||
this.player = player;
|
||||
|
||||
|
@ -58,7 +58,7 @@ public class ContainerCentrifuge extends TechRebornContainer {
|
|||
public void detectAndSendChanges() {
|
||||
super.detectAndSendChanges();
|
||||
for (int i = 0; i < this.crafters.size(); ++i) {
|
||||
ICrafting icrafting = (ICrafting)this.crafters.get(i);
|
||||
ICrafting icrafting = (ICrafting) this.crafters.get(i);
|
||||
if (this.tickTime != this.tile.tickTime) {
|
||||
icrafting.sendProgressBarUpdate(this, 0, this.tile.tickTime);
|
||||
}
|
||||
|
|
|
@ -21,16 +21,13 @@ public class ContainerQuantumTank extends TechRebornContainer {
|
|||
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 3; ++i)
|
||||
{
|
||||
for (int j = 0; j < 9; ++j)
|
||||
{
|
||||
for (i = 0; i < 3; ++i) {
|
||||
for (int j = 0; j < 9; ++j) {
|
||||
this.addSlotToContainer(new Slot(player.inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < 9; ++i)
|
||||
{
|
||||
for (i = 0; i < 9; ++i) {
|
||||
this.addSlotToContainer(new Slot(player.inventory, i, 8 + i * 18, 142));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,50 +1,49 @@
|
|||
package techreborn.client.container;
|
||||
|
||||
import techreborn.client.SlotOutput;
|
||||
import techreborn.tiles.TileCentrifuge;
|
||||
import techreborn.tiles.TileRollingMachine;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import techreborn.client.SlotOutput;
|
||||
import techreborn.tiles.TileRollingMachine;
|
||||
|
||||
public class ContainerRollingMachine extends TechRebornContainer{
|
||||
|
||||
EntityPlayer player;
|
||||
TileRollingMachine tile;
|
||||
|
||||
public ContainerRollingMachine(TileRollingMachine tileRollingmachine, EntityPlayer player){
|
||||
tile = tileRollingmachine;
|
||||
this.player = player;
|
||||
public class ContainerRollingMachine extends TechRebornContainer {
|
||||
|
||||
//input
|
||||
this.addSlotToContainer(new Slot(tileRollingmachine.inventory, 0, 30, 17));
|
||||
this.addSlotToContainer(new Slot(tileRollingmachine.inventory, 1, 30, 35));
|
||||
this.addSlotToContainer(new Slot(tileRollingmachine.inventory, 2, 30, 53));
|
||||
this.addSlotToContainer(new Slot(tileRollingmachine.inventory, 3, 48, 17));
|
||||
this.addSlotToContainer(new Slot(tileRollingmachine.inventory, 4, 48, 35));
|
||||
this.addSlotToContainer(new Slot(tileRollingmachine.inventory, 5, 48, 53));
|
||||
this.addSlotToContainer(new Slot(tileRollingmachine.inventory, 6, 66, 17));
|
||||
this.addSlotToContainer(new Slot(tileRollingmachine.inventory, 7, 66, 35));
|
||||
this.addSlotToContainer(new Slot(tileRollingmachine.inventory, 8, 66, 53));
|
||||
//outputs
|
||||
this.addSlotToContainer(new SlotOutput(tileRollingmachine.inventory, 9, 124, 35));
|
||||
EntityPlayer player;
|
||||
TileRollingMachine tile;
|
||||
|
||||
public ContainerRollingMachine(TileRollingMachine tileRollingmachine, EntityPlayer player) {
|
||||
tile = tileRollingmachine;
|
||||
this.player = player;
|
||||
|
||||
//input
|
||||
this.addSlotToContainer(new Slot(tileRollingmachine.inventory, 0, 30, 17));
|
||||
this.addSlotToContainer(new Slot(tileRollingmachine.inventory, 1, 30, 35));
|
||||
this.addSlotToContainer(new Slot(tileRollingmachine.inventory, 2, 30, 53));
|
||||
this.addSlotToContainer(new Slot(tileRollingmachine.inventory, 3, 48, 17));
|
||||
this.addSlotToContainer(new Slot(tileRollingmachine.inventory, 4, 48, 35));
|
||||
this.addSlotToContainer(new Slot(tileRollingmachine.inventory, 5, 48, 53));
|
||||
this.addSlotToContainer(new Slot(tileRollingmachine.inventory, 6, 66, 17));
|
||||
this.addSlotToContainer(new Slot(tileRollingmachine.inventory, 7, 66, 35));
|
||||
this.addSlotToContainer(new Slot(tileRollingmachine.inventory, 8, 66, 53));
|
||||
//outputs
|
||||
this.addSlotToContainer(new SlotOutput(tileRollingmachine.inventory, 9, 124, 35));
|
||||
|
||||
|
||||
int i;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 3; ++i) {
|
||||
for (int j = 0; j < 9; ++j) {
|
||||
this.addSlotToContainer(new Slot(player.inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
|
||||
}
|
||||
}
|
||||
for (i = 0; i < 3; ++i) {
|
||||
for (int j = 0; j < 9; ++j) {
|
||||
this.addSlotToContainer(new Slot(player.inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < 9; ++i) {
|
||||
this.addSlotToContainer(new Slot(player.inventory, i, 8 + i * 18, 142));
|
||||
}
|
||||
}
|
||||
for (i = 0; i < 9; ++i) {
|
||||
this.addSlotToContainer(new Slot(player.inventory, i, 8 + i * 18, 142));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer player) {
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer player) {
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -21,16 +21,13 @@ public class ContainerThermalGenerator extends TechRebornContainer {
|
|||
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 3; ++i)
|
||||
{
|
||||
for (int j = 0; j < 9; ++j)
|
||||
{
|
||||
for (i = 0; i < 3; ++i) {
|
||||
for (int j = 0; j < 9; ++j) {
|
||||
this.addSlotToContainer(new Slot(player.inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < 9; ++i)
|
||||
{
|
||||
for (i = 0; i < 9; ++i) {
|
||||
this.addSlotToContainer(new Slot(player.inventory, i, 8 + i * 18, 142));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -28,8 +28,7 @@ public class GuiCentrifuge extends GuiContainer {
|
|||
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
|
||||
}
|
||||
|
||||
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_)
|
||||
{
|
||||
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
|
||||
this.fontRendererObj.drawString("Centrifuge", 110, 6, 4210752);
|
||||
this.fontRendererObj.drawString(I18n.format("container.inventory", new Object[0]), 8, this.ySize - 96 + 2, 4210752);
|
||||
this.fontRendererObj.drawString(centrifuge.tickTime + " " + centrifuge.isRunning, 110, this.ySize - 96 + 2, 4210752);
|
||||
|
|
|
@ -26,15 +26,14 @@ public class GuiQuantumChest extends GuiContainer {
|
|||
this.mc.getTextureManager().bindTexture(texture);
|
||||
int k = (this.width - this.xSize) / 2;
|
||||
int l = (this.height - this.ySize) / 2;
|
||||
this.drawTexturedModalRect(k, l , 0, 0, this.xSize, this.ySize);
|
||||
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
|
||||
}
|
||||
|
||||
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_)
|
||||
{
|
||||
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
|
||||
this.fontRendererObj.drawString("Quantum Chest", 8, 6, 4210752);
|
||||
this.fontRendererObj.drawString(I18n.format("container.inventory", new Object[0]), 8, this.ySize - 96 + 2, 4210752);
|
||||
this.fontRendererObj.drawString("Amount", 10, 20, 16448255);
|
||||
if(tile.storedItem != null)
|
||||
if (tile.storedItem != null)
|
||||
this.fontRendererObj.drawString(tile.storedItem.stackSize + "", 10, 30, 16448255);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -25,11 +25,10 @@ public class GuiQuantumTank extends GuiContainer {
|
|||
this.mc.getTextureManager().bindTexture(texture);
|
||||
int k = (this.width - this.xSize) / 2;
|
||||
int l = (this.height - this.ySize) / 2;
|
||||
this.drawTexturedModalRect(k, l , 0, 0, this.xSize, this.ySize);
|
||||
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
|
||||
}
|
||||
|
||||
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_)
|
||||
{
|
||||
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
|
||||
this.fontRendererObj.drawString("Quantum Tank", 8, 6, 4210752);
|
||||
this.fontRendererObj.drawString(I18n.format("container.inventory", new Object[0]), 8, this.ySize - 96 + 2, 4210752);
|
||||
this.fontRendererObj.drawString("Liquid Amount", 10, 20, 16448255);
|
||||
|
|
|
@ -1,33 +1,29 @@
|
|||
package techreborn.client.gui;
|
||||
|
||||
import techreborn.client.container.ContainerCentrifuge;
|
||||
import techreborn.client.container.ContainerRollingMachine;
|
||||
import techreborn.tiles.TileCentrifuge;
|
||||
import techreborn.tiles.TileRollingMachine;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import techreborn.client.container.ContainerRollingMachine;
|
||||
import techreborn.tiles.TileRollingMachine;
|
||||
|
||||
public class GuiRollingMachine extends GuiContainer{
|
||||
|
||||
private static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/rollingmachine.png");
|
||||
TileRollingMachine rollingMachine;
|
||||
|
||||
public GuiRollingMachine(EntityPlayer player, TileRollingMachine tileRollingmachine)
|
||||
{
|
||||
public class GuiRollingMachine extends GuiContainer {
|
||||
|
||||
private static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/rollingmachine.png");
|
||||
TileRollingMachine rollingMachine;
|
||||
|
||||
public GuiRollingMachine(EntityPlayer player, TileRollingMachine tileRollingmachine) {
|
||||
super(new ContainerRollingMachine(tileRollingmachine, player));
|
||||
this.xSize = 176;
|
||||
this.ySize = 167;
|
||||
rollingMachine = tileRollingmachine;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_)
|
||||
{
|
||||
this.mc.getTextureManager().bindTexture(texture);
|
||||
int k = (this.width - this.xSize) / 2;
|
||||
int l = (this.height - this.ySize) / 2;
|
||||
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
|
||||
}
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
|
||||
this.mc.getTextureManager().bindTexture(texture);
|
||||
int k = (this.width - this.xSize) / 2;
|
||||
int l = (this.height - this.ySize) / 2;
|
||||
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -25,11 +25,10 @@ public class GuiThermalGenerator extends GuiContainer {
|
|||
this.mc.getTextureManager().bindTexture(texture);
|
||||
int k = (this.width - this.xSize) / 2;
|
||||
int l = (this.height - this.ySize) / 2;
|
||||
this.drawTexturedModalRect(k, l , 0, 0, this.xSize, this.ySize);
|
||||
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
|
||||
}
|
||||
|
||||
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_)
|
||||
{
|
||||
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
|
||||
this.fontRendererObj.drawString("Thermal Generator", 8, 6, 4210752);
|
||||
this.fontRendererObj.drawString(I18n.format("container.inventory", new Object[0]), 8, this.ySize - 96 + 2, 4210752);
|
||||
this.fontRendererObj.drawString("Liquid Amount", 10, 20, 16448255);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue