Fix lots of issues

This commit is contained in:
Prospector 2016-03-28 19:47:00 -07:00
parent 620bbfc1df
commit cec54aa0c8
16 changed files with 1009 additions and 1461 deletions

View file

@ -123,7 +123,7 @@ public class GuiHandler implements IGuiHandler
(TileIndustrialElectrolyzer) world.getTileEntity(new BlockPos(x, y, z)), player);
} else if (ID == aesuID)
{
return new ContainerAesu((TileAesu) world.getTileEntity(new BlockPos(x, y, z)), player);
return new ContainerAESU((TileAesu) world.getTileEntity(new BlockPos(x, y, z)), player);
} else if (ID == alloyFurnaceID)
{
return new ContainerAlloyFurnace((TileAlloyFurnace) world.getTileEntity(new BlockPos(x, y, z)), player);
@ -143,7 +143,7 @@ public class GuiHandler implements IGuiHandler
return new ContainerDestructoPack(player);
} else if (ID == lesuID)
{
return new ContainerLesu((TileLesu) world.getTileEntity(new BlockPos(x, y, z)), player);
return new ContainerLESU((TileLesu) world.getTileEntity(new BlockPos(x, y, z)), player);
} else if (ID == idsuID)
{
return new ContainerIDSU((TileIDSU) world.getTileEntity(new BlockPos(x, y, z)), player);
@ -252,7 +252,7 @@ public class GuiHandler implements IGuiHandler
(TileIndustrialElectrolyzer) world.getTileEntity(new BlockPos(x, y, z)));
} else if (ID == aesuID)
{
return new GuiAesu(player, (TileAesu) world.getTileEntity(new BlockPos(x, y, z)));
return new GuiAESU(player, (TileAesu) world.getTileEntity(new BlockPos(x, y, z)));
} else if (ID == alloyFurnaceID)
{
return new GuiAlloyFurnace(player, (TileAlloyFurnace) world.getTileEntity(new BlockPos(x, y, z)));
@ -270,7 +270,7 @@ public class GuiHandler implements IGuiHandler
return new GuiDestructoPack(new ContainerDestructoPack(player));
} else if (ID == lesuID)
{
return new GuiLesu(player, (TileLesu) world.getTileEntity(new BlockPos(x, y, z)));
return new GuiLESU(player, (TileLesu) world.getTileEntity(new BlockPos(x, y, z)));
} else if (ID == idsuID)
{
return new GuiIDSU(player, (TileIDSU) world.getTileEntity(new BlockPos(x, y, z)));

View file

@ -8,66 +8,55 @@ import net.minecraftforge.fml.relauncher.SideOnly;
import reborncore.common.container.RebornContainer;
import techreborn.tiles.TileAesu;
public class ContainerAesu extends RebornContainer
{
public class ContainerAESU extends RebornContainer {
public int euOut;
public int storedEu;
public int euChange;
EntityPlayer player;
TileAesu tile;
public ContainerAesu(TileAesu tileaesu, EntityPlayer player)
{
public ContainerAESU(TileAesu tileaesu, EntityPlayer player) {
tile = tileaesu;
this.player = player;
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, 115 + i * 18));
}
}
for (i = 0; i < 9; ++i)
{
for (i = 0; i < 9; ++i) {
this.addSlotToContainer(new Slot(player.inventory, i, 8 + i * 18, 173));
}
}
@Override
public boolean canInteractWith(EntityPlayer player)
{
public boolean canInteractWith(EntityPlayer player) {
return true;
}
@Override
public void detectAndSendChanges()
{
public void detectAndSendChanges() {
super.detectAndSendChanges();
for (int i = 0; i < this.crafters.size(); i++)
{
for (int i = 0; i < this.crafters.size(); i++) {
ICrafting icrafting = (ICrafting) this.crafters.get(i);
if (this.euOut != tile.getMaxOutput())
{
if (this.euOut != tile.getMaxOutput()) {
icrafting.sendProgressBarUpdate(this, 0, (int) tile.getMaxOutput());
}
if (this.storedEu != tile.getEnergy())
{
if (this.storedEu != tile.getEnergy()) {
icrafting.sendProgressBarUpdate(this, 1, (int) tile.getEnergy());
}
if (this.euChange != tile.getEuChange() && tile.getEuChange() != -1)
{
if (this.euChange != tile.getEuChange() && tile.getEuChange() != -1) {
icrafting.sendProgressBarUpdate(this, 2, (int) tile.getEuChange());
}
}
}
@Override
public void onCraftGuiOpened(ICrafting crafting)
{
public void onCraftGuiOpened(ICrafting crafting) {
super.onCraftGuiOpened(crafting);
crafting.sendProgressBarUpdate(this, 0, (int) tile.getMaxOutput());
crafting.sendProgressBarUpdate(this, 1, (int) tile.getEnergy());
@ -76,16 +65,12 @@ public class ContainerAesu extends RebornContainer
@SideOnly(Side.CLIENT)
@Override
public void updateProgressBar(int id, int value)
{
if (id == 0)
{
public void updateProgressBar(int id, int value) {
if (id == 0) {
this.euOut = value;
} else if (id == 1)
{
} else if (id == 1) {
this.storedEu = value;
} else if (id == 2)
{
} else if (id == 2) {
this.euChange = value;
}
}

View file

@ -8,8 +8,7 @@ import net.minecraftforge.fml.relauncher.SideOnly;
import reborncore.common.container.RebornContainer;
import techreborn.tiles.idsu.TileIDSU;
public class ContainerIDSU extends RebornContainer
{
public class ContainerIDSU extends RebornContainer {
public int euOut;
public int storedEu;
@ -17,58 +16,48 @@ public class ContainerIDSU extends RebornContainer
public int channel;
EntityPlayer player;
TileIDSU tile;
public ContainerIDSU(TileIDSU tileIDSU, EntityPlayer player)
{
public ContainerIDSU(TileIDSU tileIDSU, EntityPlayer player) {
tile = tileIDSU;
this.player = player;
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, 115 + 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, 173));
}
}
@Override
public boolean canInteractWith(EntityPlayer player)
{
public boolean canInteractWith(EntityPlayer player) {
return true;
}
@Override
public void detectAndSendChanges()
{
public void detectAndSendChanges() {
super.detectAndSendChanges();
for (int i = 0; i < this.crafters.size(); i++)
{
for (int i = 0; i < this.crafters.size(); i++) {
ICrafting icrafting = (ICrafting) this.crafters.get(i);
if (this.euOut != tile.output)
{
if (this.euOut != tile.output) {
icrafting.sendProgressBarUpdate(this, 0, tile.output);
}
if (this.storedEu != (int) tile.getEnergy())
{
if (this.storedEu != (int) tile.getEnergy()) {
icrafting.sendProgressBarUpdate(this, 1, (int) tile.getEnergy());
}
if (this.euChange != tile.getEuChange() && tile.getEuChange() != -1)
{
if (this.euChange != tile.getEuChange() && tile.getEuChange() != -1) {
icrafting.sendProgressBarUpdate(this, 2, (int) tile.getEuChange());
}
}
}
@Override
public void onCraftGuiOpened(ICrafting crafting)
{
public void onCraftGuiOpened(ICrafting crafting) {
super.onCraftGuiOpened(crafting);
crafting.sendProgressBarUpdate(this, 0, tile.output);
crafting.sendProgressBarUpdate(this, 1, (int) tile.getEnergy());
@ -77,19 +66,14 @@ public class ContainerIDSU extends RebornContainer
@SideOnly(Side.CLIENT)
@Override
public void updateProgressBar(int id, int value)
{
if (id == 0)
{
public void updateProgressBar(int id, int value) {
if (id == 0) {
this.euOut = value;
} else if (id == 1)
{
} else if (id == 1) {
this.storedEu = value;
} else if (id == 2)
{
} else if (id == 2) {
this.euChange = value;
} else if (id == 3)
{
} else if (id == 3) {
this.channel = value;
}
}

View file

@ -9,8 +9,7 @@ import reborncore.common.container.RebornContainer;
import techreborn.config.ConfigTechReborn;
import techreborn.tiles.lesu.TileLesu;
public class ContainerLesu extends RebornContainer
{
public class ContainerLESU extends RebornContainer {
public int euOut;
public int storedEu;
@ -19,8 +18,8 @@ public class ContainerLesu extends RebornContainer
public double euStorage;
EntityPlayer player;
TileLesu tile;
public ContainerLesu(TileLesu tileaesu, EntityPlayer player)
{
public ContainerLESU(TileLesu tileaesu, EntityPlayer player) {
tile = tileaesu;
this.player = player;
@ -30,55 +29,44 @@ public class ContainerLesu extends RebornContainer
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, 115 + 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, 173));
}
}
@Override
public boolean canInteractWith(EntityPlayer player)
{
public boolean canInteractWith(EntityPlayer player) {
return true;
}
@Override
public void detectAndSendChanges()
{
public void detectAndSendChanges() {
super.detectAndSendChanges();
for (int i = 0; i < this.crafters.size(); i++)
{
for (int i = 0; i < this.crafters.size(); i++) {
ICrafting icrafting = (ICrafting) this.crafters.get(i);
if (this.euOut != tile.getMaxOutput())
{
if (this.euOut != tile.getMaxOutput()) {
icrafting.sendProgressBarUpdate(this, 0, (int) tile.getMaxOutput());
}
if (this.storedEu != tile.getEnergy())
{
if (this.storedEu != tile.getEnergy()) {
icrafting.sendProgressBarUpdate(this, 1, (int) tile.getEnergy());
}
if (this.euChange != tile.getEuChange() && tile.getEuChange() != -1)
{
if (this.euChange != tile.getEuChange() && tile.getEuChange() != -1) {
icrafting.sendProgressBarUpdate(this, 2, (int) tile.getEuChange());
}
if (this.connectedBlocks != tile.connectedBlocks)
{
if (this.connectedBlocks != tile.connectedBlocks) {
icrafting.sendProgressBarUpdate(this, 3, tile.connectedBlocks);
}
}
}
@Override
public void onCraftGuiOpened(ICrafting crafting)
{
public void onCraftGuiOpened(ICrafting crafting) {
super.onCraftGuiOpened(crafting);
crafting.sendProgressBarUpdate(this, 0, (int) tile.getMaxOutput());
crafting.sendProgressBarUpdate(this, 1, (int) tile.getEnergy());
@ -88,22 +76,16 @@ public class ContainerLesu extends RebornContainer
@SideOnly(Side.CLIENT)
@Override
public void updateProgressBar(int id, int value)
{
if (id == 0)
{
public void updateProgressBar(int id, int value) {
if (id == 0) {
this.euOut = value;
} else if (id == 1)
{
} else if (id == 1) {
this.storedEu = value;
} else if (id == 2)
{
} else if (id == 2) {
this.euChange = value;
} else if (id == 3)
{
} else if (id == 3) {
this.connectedBlocks = value;
} else if (id == 4)
{
} else if (id == 4) {
this.euStorage = value;
}
this.euStorage = ((connectedBlocks + 1) * ConfigTechReborn.LesuStoragePerBlock);

View file

@ -8,29 +8,29 @@ import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.translation.I18n;
import reborncore.common.packets.PacketHandler;
import reborncore.common.powerSystem.PowerSystem;
import techreborn.client.container.ContainerAesu;
import techreborn.client.container.ContainerAESU;
import techreborn.packets.PacketAesu;
import techreborn.tiles.TileAesu;
import java.awt.*;
import java.io.IOException;
public class GuiAesu extends GuiContainer
public class GuiAESU extends GuiContainer
{
private static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/aesu.png");
TileAesu aesu;
ContainerAesu containerAesu;
ContainerAESU containerAesu;
public GuiAesu(EntityPlayer player, TileAesu tileaesu)
public GuiAESU(EntityPlayer player, TileAesu tileaesu)
{
super(new ContainerAesu(tileaesu, player));
super(new ContainerAESU(tileaesu, player));
this.xSize = 176;
this.ySize = 197;
aesu = tileaesu;
this.containerAesu = (ContainerAesu) this.inventorySlots;
this.containerAesu = (ContainerAESU) this.inventorySlots;
}
@Override

View file

@ -28,7 +28,7 @@ public class GuiIDSU extends GuiContainer
{
super(new ContainerIDSU(tileIDSU, player));
this.xSize = 176;
this.ySize = 165;
this.ySize = 197;
idsu = tileIDSU;
this.containerIDSU = (ContainerIDSU) this.inventorySlots;
}

View file

@ -8,25 +8,25 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.translation.I18n;
import reborncore.common.powerSystem.PowerSystem;
import techreborn.client.container.ContainerLesu;
import techreborn.client.container.ContainerLESU;
import techreborn.tiles.lesu.TileLesu;
public class GuiLesu extends GuiContainer
public class GuiLESU extends GuiContainer
{
private static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/aesu.png");
TileLesu aesu;
ContainerLesu containerLesu;
ContainerLESU containerLesu;
public GuiLesu(EntityPlayer player, TileLesu tileaesu)
public GuiLESU(EntityPlayer player, TileLesu tileaesu)
{
super(new ContainerLesu(tileaesu, player));
super(new ContainerLESU(tileaesu, player));
this.xSize = 176;
this.ySize = 165;
this.ySize = 197;
aesu = tileaesu;
this.containerLesu = (ContainerLesu) this.inventorySlots;
this.containerLesu = (ContainerLESU) this.inventorySlots;
}
@Override