Added code formatter

This commit is contained in:
modmuss50 2016-03-24 00:39:26 +00:00
parent 710f9c04e7
commit b9448d5d90
444 changed files with 32383 additions and 26254 deletions

View file

@ -7,88 +7,101 @@ import reborncore.client.gui.SlotOutput;
import reborncore.common.container.RebornContainer;
import techreborn.tiles.TileAlloyFurnace;
public class ContainerAlloyFurnace extends RebornContainer {
public class ContainerAlloyFurnace extends RebornContainer
{
EntityPlayer player;
EntityPlayer player;
TileAlloyFurnace tile;
TileAlloyFurnace tile;
@Override
public boolean canInteractWith(EntityPlayer player) {
return true;
}
@Override
public boolean canInteractWith(EntityPlayer player)
{
return true;
}
public int tickTime;
public int tickTime;
public ContainerAlloyFurnace(TileAlloyFurnace tileAlloyfurnace,
EntityPlayer player) {
tile = tileAlloyfurnace;
this.player = player;
public ContainerAlloyFurnace(TileAlloyFurnace tileAlloyfurnace, EntityPlayer player)
{
tile = tileAlloyfurnace;
this.player = player;
// input
this.addSlotToContainer(new Slot(tileAlloyfurnace.inventory, 0, 47, 17));
this.addSlotToContainer(new Slot(tileAlloyfurnace.inventory, 1, 65, 17));
// outputs
this.addSlotToContainer(new SlotOutput(tileAlloyfurnace.inventory, 2, 116, 35));
// Fuel
this.addSlotToContainer(new Slot(tileAlloyfurnace.inventory, 3, 56, 53));
// input
this.addSlotToContainer(new Slot(tileAlloyfurnace.inventory, 0, 47, 17));
this.addSlotToContainer(new Slot(tileAlloyfurnace.inventory, 1, 65, 17));
// outputs
this.addSlotToContainer(new SlotOutput(tileAlloyfurnace.inventory, 2, 116, 35));
// Fuel
this.addSlotToContainer(new Slot(tileAlloyfurnace.inventory, 3, 56, 53));
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));
}
}
int currentItemBurnTime;
int burnTime;
int cookTime;
int currentItemBurnTime;
int burnTime;
int cookTime;
@Override
public void onCraftGuiOpened(ICrafting crafting) {
super.onCraftGuiOpened(crafting);
crafting.sendProgressBarUpdate(this, 0, tile.currentItemBurnTime);
crafting.sendProgressBarUpdate(this, 1, tile.burnTime);
crafting.sendProgressBarUpdate(this, 2, tile.cookTime);
}
@Override
public void onCraftGuiOpened(ICrafting crafting)
{
super.onCraftGuiOpened(crafting);
crafting.sendProgressBarUpdate(this, 0, tile.currentItemBurnTime);
crafting.sendProgressBarUpdate(this, 1, tile.burnTime);
crafting.sendProgressBarUpdate(this, 2, tile.cookTime);
}
@Override
public void detectAndSendChanges() {
for (int i = 0; i < this.crafters.size(); i++) {
ICrafting crafting = (ICrafting) this.crafters.get(i);
if (this.currentItemBurnTime != tile.currentItemBurnTime) {
crafting.sendProgressBarUpdate(this, 0, tile.currentItemBurnTime);
}
if (this.burnTime != tile.burnTime) {
crafting.sendProgressBarUpdate(this, 1, tile.burnTime);
}
if (this.cookTime != tile.cookTime) {
crafting.sendProgressBarUpdate(this, 2, tile.cookTime);
}
}
super.detectAndSendChanges();
}
@Override
public void detectAndSendChanges()
{
for (int i = 0; i < this.crafters.size(); i++)
{
ICrafting crafting = (ICrafting) this.crafters.get(i);
if (this.currentItemBurnTime != tile.currentItemBurnTime)
{
crafting.sendProgressBarUpdate(this, 0, tile.currentItemBurnTime);
}
if (this.burnTime != tile.burnTime)
{
crafting.sendProgressBarUpdate(this, 1, tile.burnTime);
}
if (this.cookTime != tile.cookTime)
{
crafting.sendProgressBarUpdate(this, 2, tile.cookTime);
}
}
super.detectAndSendChanges();
}
@Override
public void updateProgressBar(int id, int value) {
super.updateProgressBar(id, value);
if (id == 0) {
this.currentItemBurnTime = value;
} else if (id == 1) {
this.burnTime = value;
} else if (id == 2) {
this.cookTime = value;
}
this.tile.currentItemBurnTime = this.currentItemBurnTime;
this.tile.burnTime = this.burnTime;
this.tile.cookTime = this.cookTime;
}
@Override
public void updateProgressBar(int id, int value)
{
super.updateProgressBar(id, value);
if (id == 0)
{
this.currentItemBurnTime = value;
} else if (id == 1)
{
this.burnTime = value;
} else if (id == 2)
{
this.cookTime = value;
}
this.tile.currentItemBurnTime = this.currentItemBurnTime;
this.tile.burnTime = this.burnTime;
this.tile.cookTime = this.cookTime;
}
}

View file

@ -6,52 +6,54 @@ import reborncore.client.gui.SlotOutput;
import techreborn.api.SlotUpgrade;
import techreborn.tiles.TileAlloySmelter;
public class ContainerAlloySmelter extends ContainerCrafting {
public class ContainerAlloySmelter extends ContainerCrafting
{
EntityPlayer player;
EntityPlayer player;
TileAlloySmelter tile;
TileAlloySmelter tile;
@Override
public boolean canInteractWith(EntityPlayer player) {
return true;
}
@Override
public boolean canInteractWith(EntityPlayer player)
{
return true;
}
public int tickTime;
public int tickTime;
public ContainerAlloySmelter(TileAlloySmelter tileAlloysmelter,
EntityPlayer player) {
super(tileAlloysmelter.crafter);
tile = tileAlloysmelter;
this.player = player;
public ContainerAlloySmelter(TileAlloySmelter tileAlloysmelter, EntityPlayer player)
{
super(tileAlloysmelter.crafter);
tile = tileAlloysmelter;
this.player = player;
// input
this.addSlotToContainer(new Slot(tileAlloysmelter.inventory, 0, 47, 17));
this.addSlotToContainer(new Slot(tileAlloysmelter.inventory, 1, 65, 17));
// outputs
this.addSlotToContainer(new SlotOutput(tileAlloysmelter.inventory, 2, 116, 35));
// battery
this.addSlotToContainer(new Slot(tileAlloysmelter.inventory, 3, 56, 53));
// upgrades
this.addSlotToContainer(new SlotUpgrade(tileAlloysmelter.inventory, 4, 152, 8));
this.addSlotToContainer(new SlotUpgrade(tileAlloysmelter.inventory, 5, 152, 26));
this.addSlotToContainer(new SlotUpgrade(tileAlloysmelter.inventory, 6, 152, 44));
this.addSlotToContainer(new SlotUpgrade(tileAlloysmelter.inventory, 7, 152, 62));
// input
this.addSlotToContainer(new Slot(tileAlloysmelter.inventory, 0, 47, 17));
this.addSlotToContainer(new Slot(tileAlloysmelter.inventory, 1, 65, 17));
// outputs
this.addSlotToContainer(new SlotOutput(tileAlloysmelter.inventory, 2, 116, 35));
// battery
this.addSlotToContainer(new Slot(tileAlloysmelter.inventory, 3, 56, 53));
// upgrades
this.addSlotToContainer(new SlotUpgrade(tileAlloysmelter.inventory, 4, 152, 8));
this.addSlotToContainer(new SlotUpgrade(tileAlloysmelter.inventory, 5, 152, 26));
this.addSlotToContainer(new SlotUpgrade(tileAlloysmelter.inventory, 6, 152, 44));
this.addSlotToContainer(new SlotUpgrade(tileAlloysmelter.inventory, 7, 152, 62));
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));
}
}
}

View file

@ -6,51 +6,54 @@ import reborncore.client.gui.SlotOutput;
import techreborn.api.SlotUpgrade;
import techreborn.tiles.TileAssemblingMachine;
public class ContainerAssemblingMachine extends ContainerCrafting {
public class ContainerAssemblingMachine extends ContainerCrafting
{
EntityPlayer player;
EntityPlayer player;
TileAssemblingMachine tile;
TileAssemblingMachine tile;
@Override
public boolean canInteractWith(EntityPlayer player) {
return true;
}
@Override
public boolean canInteractWith(EntityPlayer player)
{
return true;
}
public int tickTime;
public int tickTime;
public ContainerAssemblingMachine(TileAssemblingMachine tileAssemblingMachine,
EntityPlayer player) {
super(tileAssemblingMachine.crafter);
tile = tileAssemblingMachine;
this.player = player;
public ContainerAssemblingMachine(TileAssemblingMachine tileAssemblingMachine, EntityPlayer player)
{
super(tileAssemblingMachine.crafter);
tile = tileAssemblingMachine;
this.player = player;
// input
this.addSlotToContainer(new Slot(tileAssemblingMachine.inventory, 0, 47, 17));
this.addSlotToContainer(new Slot(tileAssemblingMachine.inventory, 1, 65, 17));
// outputs
this.addSlotToContainer(new SlotOutput(tileAssemblingMachine.inventory, 2, 116, 35));
// power
this.addSlotToContainer(new Slot(tileAssemblingMachine.inventory, 3, 56, 53));
// upgrades
this.addSlotToContainer(new SlotUpgrade(tileAssemblingMachine.inventory, 4, 152, 8));
this.addSlotToContainer(new SlotUpgrade(tileAssemblingMachine.inventory, 5, 152, 26));
this.addSlotToContainer(new SlotUpgrade(tileAssemblingMachine.inventory, 6, 152, 44));
this.addSlotToContainer(new SlotUpgrade(tileAssemblingMachine.inventory, 7, 152, 62));
// input
this.addSlotToContainer(new Slot(tileAssemblingMachine.inventory, 0, 47, 17));
this.addSlotToContainer(new Slot(tileAssemblingMachine.inventory, 1, 65, 17));
// outputs
this.addSlotToContainer(new SlotOutput(tileAssemblingMachine.inventory, 2, 116, 35));
// power
this.addSlotToContainer(new Slot(tileAssemblingMachine.inventory, 3, 56, 53));
// upgrades
this.addSlotToContainer(new SlotUpgrade(tileAssemblingMachine.inventory, 4, 152, 8));
this.addSlotToContainer(new SlotUpgrade(tileAssemblingMachine.inventory, 5, 152, 26));
this.addSlotToContainer(new SlotUpgrade(tileAssemblingMachine.inventory, 6, 152, 44));
this.addSlotToContainer(new SlotUpgrade(tileAssemblingMachine.inventory, 7, 152, 62));
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));
}
}
}

View file

@ -3,82 +3,92 @@ package techreborn.client.container;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.ICrafting;
import net.minecraft.inventory.Slot;
import net.minecraft.inventory.SlotFurnaceFuel;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import reborncore.common.container.RebornContainer;
import techreborn.tiles.generator.TileGenerator;
import techreborn.tiles.storage.TileBatBox;
public class ContainerBatbox extends RebornContainer {
public class ContainerBatbox extends RebornContainer
{
EntityPlayer player;
EntityPlayer player;
TileBatBox tile;
TileBatBox tile;
public int burnTime = 0;
public int totalBurnTime = 0;
public int energy;
public int burnTime = 0;
public int totalBurnTime = 0;
public int energy;
@Override
public boolean canInteractWith(EntityPlayer player) {
return true;
}
@Override
public boolean canInteractWith(EntityPlayer player)
{
return true;
}
public int tickTime;
public int tickTime;
public ContainerBatbox(TileBatBox tile, EntityPlayer player) {
super();
this.tile = tile;
this.player = player;
public ContainerBatbox(TileBatBox tile, EntityPlayer player)
{
super();
this.tile = tile;
this.player = player;
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 void detectAndSendChanges()
{
super.detectAndSendChanges();
for (int i = 0; i < this.crafters.size(); i++)
{
ICrafting icrafting = (ICrafting) this.crafters.get(i);
if (this.energy != (int) tile.getEnergy())
{
icrafting.sendProgressBarUpdate(this, 2, (int) tile.getEnergy());
}
}
}
@Override
public void detectAndSendChanges() {
super.detectAndSendChanges();
for (int i = 0; i < this.crafters.size(); i++) {
ICrafting icrafting = (ICrafting) this.crafters.get(i);
if (this.energy != (int) tile.getEnergy()) {
icrafting.sendProgressBarUpdate(this, 2, (int) tile.getEnergy());
}
}
}
@Override
public void onCraftGuiOpened(ICrafting crafting)
{
super.onCraftGuiOpened(crafting);
crafting.sendProgressBarUpdate(this, 2, (int) tile.getEnergy());
}
@Override
public void onCraftGuiOpened(ICrafting crafting) {
super.onCraftGuiOpened(crafting);
crafting.sendProgressBarUpdate(this, 2, (int) tile.getEnergy());
}
@SideOnly(Side.CLIENT)
@Override
public void updateProgressBar(int id, int value)
{
if (id == 0)
{
this.burnTime = value;
} else if (id == 1)
{
this.totalBurnTime = value;
} else if (id == 2)
{
this.energy = value;
}
this.tile.setEnergy(energy);
}
@SideOnly(Side.CLIENT)
@Override
public void updateProgressBar(int id, int value) {
if (id == 0) {
this.burnTime = value;
} else if (id == 1) {
this.totalBurnTime = value;
} else if (id == 2) {
this.energy = value;
}
this.tile.setEnergy(energy);
}
public int getScaledBurnTime(int i) {
return (int) (((float) burnTime / (float) totalBurnTime) * i);
}
public int getScaledBurnTime(int i)
{
return (int) (((float) burnTime / (float) totalBurnTime) * i);
}
}

View file

@ -6,71 +6,84 @@ import net.minecraft.inventory.Slot;
import reborncore.client.gui.SlotOutput;
import techreborn.tiles.TileBlastFurnace;
public class ContainerBlastFurnace extends ContainerCrafting {
public class ContainerBlastFurnace extends ContainerCrafting
{
EntityPlayer player;
EntityPlayer player;
TileBlastFurnace tile;
TileBlastFurnace tile;
public int heat;
public int heat;
@Override
public boolean canInteractWith(EntityPlayer player) {
return true;
}
@Override
public boolean canInteractWith(EntityPlayer player)
{
return true;
}
public int tickTime;
public int tickTime;
public ContainerBlastFurnace(TileBlastFurnace tileblastfurnace,
EntityPlayer player) {
super(tileblastfurnace.crafter);
tile = tileblastfurnace;
this.player = player;
public ContainerBlastFurnace(TileBlastFurnace tileblastfurnace, EntityPlayer player)
{
super(tileblastfurnace.crafter);
tile = tileblastfurnace;
this.player = player;
// input
this.addSlotToContainer(new Slot(tileblastfurnace.inventory, 0, 40, 25));//Input 1
this.addSlotToContainer(new Slot(tileblastfurnace.inventory, 1, 40, 43));//Input 2
// outputs
this.addSlotToContainer(new SlotOutput(tileblastfurnace.inventory, 2, 100, 35));//Output 1
this.addSlotToContainer(new SlotOutput(tileblastfurnace.inventory, 3, 118, 35));//Output 2
// input
this.addSlotToContainer(new Slot(tileblastfurnace.inventory, 0, 40, 25));// Input
// 1
this.addSlotToContainer(new Slot(tileblastfurnace.inventory, 1, 40, 43));// Input
// 2
// outputs
this.addSlotToContainer(new SlotOutput(tileblastfurnace.inventory, 2, 100, 35));// Output
// 1
this.addSlotToContainer(new SlotOutput(tileblastfurnace.inventory, 3, 118, 35));// Output
// 2
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 void detectAndSendChanges() {
super.detectAndSendChanges();
for (int i = 0; i < this.crafters.size(); i++) {
ICrafting icrafting = (ICrafting) this.crafters.get(i);
if (this.heat != tile.getHeat()) {
icrafting.sendProgressBarUpdate(this, 10, tile.getHeat());
}
}
}
@Override
public void detectAndSendChanges()
{
super.detectAndSendChanges();
for (int i = 0; i < this.crafters.size(); i++)
{
ICrafting icrafting = (ICrafting) this.crafters.get(i);
if (this.heat != tile.getHeat())
{
icrafting.sendProgressBarUpdate(this, 10, tile.getHeat());
}
}
}
@Override
public void onCraftGuiOpened(ICrafting crafting) {
super.onCraftGuiOpened(crafting);
crafting.sendProgressBarUpdate(this, 10, tile.getHeat());
}
@Override
public void onCraftGuiOpened(ICrafting crafting)
{
super.onCraftGuiOpened(crafting);
crafting.sendProgressBarUpdate(this, 10, tile.getHeat());
}
@Override
public void updateProgressBar(int id, int value) {
if (id == 10) {
this.heat = value;
}
super.updateProgressBar(id, value);
}
@Override
public void updateProgressBar(int id, int value)
{
if (id == 10)
{
this.heat = value;
}
super.updateProgressBar(id, value);
}
}

View file

@ -6,53 +6,57 @@ import reborncore.client.gui.SlotOutput;
import techreborn.api.SlotUpgrade;
import techreborn.tiles.TileCentrifuge;
public class ContainerCentrifuge extends ContainerCrafting {
public class ContainerCentrifuge extends ContainerCrafting
{
EntityPlayer player;
EntityPlayer player;
TileCentrifuge tile;
TileCentrifuge tile;
public int tickTime;
public int tickTime;
@Override
public boolean canInteractWith(EntityPlayer player) {
return true;
}
@Override
public boolean canInteractWith(EntityPlayer player)
{
return true;
}
public ContainerCentrifuge(TileCentrifuge tileCentrifuge, EntityPlayer player) {
super(tileCentrifuge.crafter);
tile = tileCentrifuge;
this.player = player;
public ContainerCentrifuge(TileCentrifuge tileCentrifuge, EntityPlayer player)
{
super(tileCentrifuge.crafter);
tile = tileCentrifuge;
this.player = player;
// input
this.addSlotToContainer(new Slot(tileCentrifuge.inventory, 0, 80, 35));
this.addSlotToContainer(new Slot(tileCentrifuge.inventory, 1, 50, 5));
// outputs
this.addSlotToContainer(new SlotOutput(tileCentrifuge.inventory, 2, 80, 5));
this.addSlotToContainer(new SlotOutput(tileCentrifuge.inventory, 3, 110, 35));
this.addSlotToContainer(new SlotOutput(tileCentrifuge.inventory, 4, 80, 65));
this.addSlotToContainer(new SlotOutput(tileCentrifuge.inventory, 5, 50, 35));
// battery
this.addSlotToContainer(new Slot(tileCentrifuge.inventory, 6, 8, 51));
// upgrades
this.addSlotToContainer(new SlotUpgrade(tileCentrifuge.inventory, 7, 152, 8));
this.addSlotToContainer(new SlotUpgrade(tileCentrifuge.inventory, 8, 152, 26));
this.addSlotToContainer(new SlotUpgrade(tileCentrifuge.inventory, 9, 152, 44));
this.addSlotToContainer(new SlotUpgrade(tileCentrifuge.inventory, 10, 152, 62));
// input
this.addSlotToContainer(new Slot(tileCentrifuge.inventory, 0, 80, 35));
this.addSlotToContainer(new Slot(tileCentrifuge.inventory, 1, 50, 5));
// outputs
this.addSlotToContainer(new SlotOutput(tileCentrifuge.inventory, 2, 80, 5));
this.addSlotToContainer(new SlotOutput(tileCentrifuge.inventory, 3, 110, 35));
this.addSlotToContainer(new SlotOutput(tileCentrifuge.inventory, 4, 80, 65));
this.addSlotToContainer(new SlotOutput(tileCentrifuge.inventory, 5, 50, 35));
// battery
this.addSlotToContainer(new Slot(tileCentrifuge.inventory, 6, 8, 51));
// upgrades
this.addSlotToContainer(new SlotUpgrade(tileCentrifuge.inventory, 7, 152, 8));
this.addSlotToContainer(new SlotUpgrade(tileCentrifuge.inventory, 8, 152, 26));
this.addSlotToContainer(new SlotUpgrade(tileCentrifuge.inventory, 9, 152, 44));
this.addSlotToContainer(new SlotUpgrade(tileCentrifuge.inventory, 10, 152, 62));
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));
}
}
}

View file

@ -5,41 +5,47 @@ import net.minecraft.inventory.Slot;
import reborncore.common.container.RebornContainer;
import techreborn.tiles.TileChargeBench;
public class ContainerChargeBench extends RebornContainer {
public class ContainerChargeBench extends RebornContainer
{
EntityPlayer player;
EntityPlayer player;
TileChargeBench tile;
TileChargeBench tile;
@Override
public boolean canInteractWith(EntityPlayer player) {
return true;
}
@Override
public boolean canInteractWith(EntityPlayer player)
{
return true;
}
public int tickTime;
public int tickTime;
public ContainerChargeBench(TileChargeBench tileChargeBench, EntityPlayer player) {
tile = tileChargeBench;
this.player = player;
public ContainerChargeBench(TileChargeBench tileChargeBench, EntityPlayer player)
{
tile = tileChargeBench;
this.player = player;
this.addSlotToContainer(new Slot(tileChargeBench.inventory, 0, 62, 21));
this.addSlotToContainer(new Slot(tileChargeBench.inventory, 1, 80, 21));
this.addSlotToContainer(new Slot(tileChargeBench.inventory, 2, 98, 21));
this.addSlotToContainer(new Slot(tileChargeBench.inventory, 3, 62, 39));
this.addSlotToContainer(new Slot(tileChargeBench.inventory, 4, 80, 39));
this.addSlotToContainer(new Slot(tileChargeBench.inventory, 5, 98, 39));
this.addSlotToContainer(new Slot(tileChargeBench.inventory, 0, 62, 21));
this.addSlotToContainer(new Slot(tileChargeBench.inventory, 1, 80, 21));
this.addSlotToContainer(new Slot(tileChargeBench.inventory, 2, 98, 21));
this.addSlotToContainer(new Slot(tileChargeBench.inventory, 3, 62, 39));
this.addSlotToContainer(new Slot(tileChargeBench.inventory, 4, 80, 39));
this.addSlotToContainer(new Slot(tileChargeBench.inventory, 5, 98, 39));
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));
}
}
}

View file

@ -6,51 +6,54 @@ import reborncore.client.gui.SlotOutput;
import techreborn.api.SlotUpgrade;
import techreborn.tiles.TileChemicalReactor;
public class ContainerChemicalReactor extends ContainerCrafting {
public class ContainerChemicalReactor extends ContainerCrafting
{
EntityPlayer player;
EntityPlayer player;
TileChemicalReactor tile;
TileChemicalReactor tile;
@Override
public boolean canInteractWith(EntityPlayer player) {
return true;
}
@Override
public boolean canInteractWith(EntityPlayer player)
{
return true;
}
public int tickTime;
public int tickTime;
public ContainerChemicalReactor(TileChemicalReactor tilechemicalReactor,
EntityPlayer player) {
super(tilechemicalReactor.crafter);
tile = tilechemicalReactor;
this.player = player;
public ContainerChemicalReactor(TileChemicalReactor tilechemicalReactor, EntityPlayer player)
{
super(tilechemicalReactor.crafter);
tile = tilechemicalReactor;
this.player = player;
// input
this.addSlotToContainer(new Slot(tilechemicalReactor.inventory, 0, 70, 21));
this.addSlotToContainer(new Slot(tilechemicalReactor.inventory, 1, 90, 21));
// outputs
this.addSlotToContainer(new SlotOutput(tilechemicalReactor.inventory, 2, 80, 51));
// battery
this.addSlotToContainer(new Slot(tilechemicalReactor.inventory, 3, 8, 51));
// upgrades
this.addSlotToContainer(new SlotUpgrade(tilechemicalReactor.inventory, 4, 152, 8));
this.addSlotToContainer(new SlotUpgrade(tilechemicalReactor.inventory, 5, 152, 26));
this.addSlotToContainer(new SlotUpgrade(tilechemicalReactor.inventory, 6, 152, 44));
this.addSlotToContainer(new SlotUpgrade(tilechemicalReactor.inventory, 7, 152, 62));
// input
this.addSlotToContainer(new Slot(tilechemicalReactor.inventory, 0, 70, 21));
this.addSlotToContainer(new Slot(tilechemicalReactor.inventory, 1, 90, 21));
// outputs
this.addSlotToContainer(new SlotOutput(tilechemicalReactor.inventory, 2, 80, 51));
// battery
this.addSlotToContainer(new Slot(tilechemicalReactor.inventory, 3, 8, 51));
// upgrades
this.addSlotToContainer(new SlotUpgrade(tilechemicalReactor.inventory, 4, 152, 8));
this.addSlotToContainer(new SlotUpgrade(tilechemicalReactor.inventory, 5, 152, 26));
this.addSlotToContainer(new SlotUpgrade(tilechemicalReactor.inventory, 6, 152, 44));
this.addSlotToContainer(new SlotUpgrade(tilechemicalReactor.inventory, 7, 152, 62));
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));
}
}
}

View file

@ -5,33 +5,36 @@ import net.minecraft.inventory.Slot;
import reborncore.common.container.RebornContainer;
import techreborn.tiles.TileChunkLoader;
public class ContainerChunkloader extends RebornContainer {
public class ContainerChunkloader extends RebornContainer
{
EntityPlayer player;
EntityPlayer player;
public ContainerChunkloader(TileChunkLoader tilechunkloader, EntityPlayer player)
{
this.player = player;
public ContainerChunkloader(TileChunkLoader tilechunkloader, EntityPlayer player) {
this.player = player;
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 p_75145_1_) {
return true;
}
@Override
public boolean canInteractWith(EntityPlayer p_75145_1_)
{
return true;
}
}

View file

@ -2,53 +2,54 @@ package techreborn.client.container;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Slot;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import reborncore.client.gui.SlotOutput;
import techreborn.api.SlotUpgrade;
import techreborn.tiles.teir1.TileCompressor;
public class ContainerCompressor extends ContainerCrafting {
public class ContainerCompressor extends ContainerCrafting
{
EntityPlayer player;
EntityPlayer player;
TileCompressor tile;
TileCompressor tile;
public int connectionStatus;
public int connectionStatus;
public ContainerCompressor(TileCompressor tileGrinder, EntityPlayer player) {
super(tileGrinder.crafter);
tile = tileGrinder;
this.player = player;
public ContainerCompressor(TileCompressor tileGrinder, EntityPlayer player)
{
super(tileGrinder.crafter);
tile = tileGrinder;
this.player = player;
// input
this.addSlotToContainer(new Slot(tileGrinder.inventory, 0, 56, 34));
this.addSlotToContainer(new SlotOutput(tileGrinder.inventory, 1, 116, 34));
// input
this.addSlotToContainer(new Slot(tileGrinder.inventory, 0, 56, 34));
this.addSlotToContainer(new SlotOutput(tileGrinder.inventory, 1, 116, 34));
// upgrades
this.addSlotToContainer(new SlotUpgrade(tileGrinder.inventory, 2, 152, 8));
this.addSlotToContainer(new SlotUpgrade(tileGrinder.inventory, 3, 152, 26));
this.addSlotToContainer(new SlotUpgrade(tileGrinder.inventory, 4, 152, 44));
this.addSlotToContainer(new SlotUpgrade(tileGrinder.inventory, 5, 152, 62));
// upgrades
this.addSlotToContainer(new SlotUpgrade(tileGrinder.inventory, 2, 152, 8));
this.addSlotToContainer(new SlotUpgrade(tileGrinder.inventory, 3, 152, 26));
this.addSlotToContainer(new SlotUpgrade(tileGrinder.inventory, 4, 152, 44));
this.addSlotToContainer(new SlotUpgrade(tileGrinder.inventory, 5, 152, 62));
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 p_75145_1_) {
return true;
}
@Override
public boolean canInteractWith(EntityPlayer p_75145_1_)
{
return true;
}
}

View file

@ -6,58 +6,71 @@ import net.minecraftforge.fml.relauncher.SideOnly;
import reborncore.common.container.RebornContainer;
import techreborn.api.recipe.RecipeCrafter;
public abstract class ContainerCrafting extends RebornContainer {
public abstract class ContainerCrafting extends RebornContainer
{
RecipeCrafter crafter;
RecipeCrafter crafter;
int currentTickTime = 0;
int currentNeededTicks = 0;
int energy;
int currentTickTime = 0;
int currentNeededTicks = 0;
int energy;
public ContainerCrafting(RecipeCrafter crafter) {
this.crafter = crafter;
}
public ContainerCrafting(RecipeCrafter crafter)
{
this.crafter = crafter;
}
@Override
public void detectAndSendChanges() {
super.detectAndSendChanges();
for (int i = 0; i < this.crafters.size(); i++) {
ICrafting icrafting = (ICrafting) this.crafters.get(i);
if (this.currentTickTime != crafter.currentTickTime || crafter.currentTickTime == -1) {
icrafting.sendProgressBarUpdate(this, 0, crafter.currentTickTime);
}
if (this.currentNeededTicks != crafter.currentNeededTicks) {
icrafting.sendProgressBarUpdate(this, 1, crafter.currentNeededTicks);
}
if (this.energy != (int) crafter.energy.getEnergy()) {
icrafting.sendProgressBarUpdate(this, 2, (int) crafter.energy.getEnergy());
}
}
}
@Override
public void detectAndSendChanges()
{
super.detectAndSendChanges();
for (int i = 0; i < this.crafters.size(); i++)
{
ICrafting icrafting = (ICrafting) this.crafters.get(i);
if (this.currentTickTime != crafter.currentTickTime || crafter.currentTickTime == -1)
{
icrafting.sendProgressBarUpdate(this, 0, crafter.currentTickTime);
}
if (this.currentNeededTicks != crafter.currentNeededTicks)
{
icrafting.sendProgressBarUpdate(this, 1, crafter.currentNeededTicks);
}
if (this.energy != (int) crafter.energy.getEnergy())
{
icrafting.sendProgressBarUpdate(this, 2, (int) crafter.energy.getEnergy());
}
}
}
@Override
public void onCraftGuiOpened(ICrafting crafting) {
super.onCraftGuiOpened(crafting);
crafting.sendProgressBarUpdate(this, 0, crafter.currentTickTime);
crafting.sendProgressBarUpdate(this, 1, crafter.currentNeededTicks);
crafting.sendProgressBarUpdate(this, 2, (int) crafter.energy.getEnergy());
}
@Override
public void onCraftGuiOpened(ICrafting crafting)
{
super.onCraftGuiOpened(crafting);
crafting.sendProgressBarUpdate(this, 0, crafter.currentTickTime);
crafting.sendProgressBarUpdate(this, 1, crafter.currentNeededTicks);
crafting.sendProgressBarUpdate(this, 2, (int) crafter.energy.getEnergy());
}
@SideOnly(Side.CLIENT)
@Override
public void updateProgressBar(int id, int value) {
if (id == 0) {
this.currentTickTime = value;
if(this.currentTickTime == -1){
this.currentTickTime = 0;
}
} else if (id == 1) {
this.currentNeededTicks = value;
} else if (id == 2) {
this.energy = value;
}
this.crafter.currentTickTime = currentTickTime;
this.crafter.currentNeededTicks = currentNeededTicks;
this.crafter.energy.setEnergy(energy);
}
@SideOnly(Side.CLIENT)
@Override
public void updateProgressBar(int id, int value)
{
if (id == 0)
{
this.currentTickTime = value;
if (this.currentTickTime == -1)
{
this.currentTickTime = 0;
}
} else if (id == 1)
{
this.currentNeededTicks = value;
} else if (id == 2)
{
this.energy = value;
}
this.crafter.currentTickTime = currentTickTime;
this.crafter.currentNeededTicks = currentNeededTicks;
this.crafter.energy.setEnergy(energy);
}
}

View file

@ -8,37 +8,42 @@ import reborncore.common.container.RebornContainer;
import reborncore.common.util.Inventory;
import techreborn.init.ModItems;
public class ContainerDestructoPack extends RebornContainer {
public class ContainerDestructoPack extends RebornContainer
{
private EntityPlayer player;
private Inventory inv;
private EntityPlayer player;
private Inventory inv;
public ContainerDestructoPack(EntityPlayer player) {
this.player = player;
inv = new Inventory(1, "destructopack", 64, null);
buildContainer();
}
public ContainerDestructoPack(EntityPlayer player)
{
this.player = player;
inv = new Inventory(1, "destructopack", 64, null);
buildContainer();
}
@Override
public boolean canInteractWith(EntityPlayer arg0) {
return true;
}
@Override
public boolean canInteractWith(EntityPlayer arg0)
{
return true;
}
private void buildContainer()
{
this.addSlotToContainer(
new SlotFilteredVoid(inv, 0, 80, 36, new ItemStack[] { new ItemStack(ModItems.parts, 1, 37) }));
int i;
private void buildContainer() {
this.addSlotToContainer(new SlotFilteredVoid(inv, 0, 80, 36, new ItemStack[]{new ItemStack(ModItems.parts, 1, 37)}));
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));
}
}
}

View file

@ -10,73 +10,81 @@ import reborncore.client.gui.SlotOutput;
import reborncore.common.container.RebornContainer;
import techreborn.tiles.generator.TileDieselGenerator;
public class ContainerDieselGenerator extends RebornContainer {
public TileDieselGenerator tiledieselGenerator;
public EntityPlayer player;
public int energy;
public int fluid;
public class ContainerDieselGenerator extends RebornContainer
{
public TileDieselGenerator tiledieselGenerator;
public EntityPlayer player;
public int energy;
public int fluid;
public ContainerDieselGenerator(TileDieselGenerator tiledieselGenerator,
EntityPlayer player) {
super();
this.tiledieselGenerator = tiledieselGenerator;
this.player = player;
public ContainerDieselGenerator(TileDieselGenerator tiledieselGenerator, EntityPlayer player)
{
super();
this.tiledieselGenerator = tiledieselGenerator;
this.player = player;
this.addSlotToContainer(new Slot(tiledieselGenerator.inventory, 0, 80,
17));
this.addSlotToContainer(new SlotOutput(tiledieselGenerator.inventory,
1, 80, 53));
this.addSlotToContainer(new SlotFake(tiledieselGenerator.inventory, 2,
59, 42, false, false, 1));
this.addSlotToContainer(new Slot(tiledieselGenerator.inventory, 0, 80, 17));
this.addSlotToContainer(new SlotOutput(tiledieselGenerator.inventory, 1, 80, 53));
this.addSlotToContainer(new SlotFake(tiledieselGenerator.inventory, 2, 59, 42, false, false, 1));
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;
}
@Override
public void detectAndSendChanges() {
super.detectAndSendChanges();
for (int i = 0; i < this.crafters.size(); i++) {
ICrafting icrafting = (ICrafting) this.crafters.get(i);
if (this.energy != (int) tiledieselGenerator.getEnergy()) {
icrafting.sendProgressBarUpdate(this, 0, (int) tiledieselGenerator.getEnergy());
}
if (this.fluid != tiledieselGenerator.tank.getFluidAmount()) {
icrafting.sendProgressBarUpdate(this, 1, tiledieselGenerator.tank.getFluidAmount());
}
}
}
@Override
public void detectAndSendChanges()
{
super.detectAndSendChanges();
for (int i = 0; i < this.crafters.size(); i++)
{
ICrafting icrafting = (ICrafting) this.crafters.get(i);
if (this.energy != (int) tiledieselGenerator.getEnergy())
{
icrafting.sendProgressBarUpdate(this, 0, (int) tiledieselGenerator.getEnergy());
}
if (this.fluid != tiledieselGenerator.tank.getFluidAmount())
{
icrafting.sendProgressBarUpdate(this, 1, tiledieselGenerator.tank.getFluidAmount());
}
}
}
@Override
public void onCraftGuiOpened(ICrafting crafting) {
super.onCraftGuiOpened(crafting);
crafting.sendProgressBarUpdate(this, 0, (int) tiledieselGenerator.getEnergy());
crafting.sendProgressBarUpdate(this, 1, tiledieselGenerator.tank.getFluidAmount());
}
@Override
public void onCraftGuiOpened(ICrafting crafting)
{
super.onCraftGuiOpened(crafting);
crafting.sendProgressBarUpdate(this, 0, (int) tiledieselGenerator.getEnergy());
crafting.sendProgressBarUpdate(this, 1, tiledieselGenerator.tank.getFluidAmount());
}
@SideOnly(Side.CLIENT)
@Override
public void updateProgressBar(int id, int value) {
if (id == 0) {
this.energy = value;
} else if (id == 1) {
this.fluid = value;
}
}
@SideOnly(Side.CLIENT)
@Override
public void updateProgressBar(int id, int value)
{
if (id == 0)
{
this.energy = value;
} else if (id == 1)
{
this.fluid = value;
}
}
}

View file

@ -7,40 +7,41 @@ import reborncore.client.gui.SlotOutput;
import reborncore.common.container.RebornContainer;
import techreborn.tiles.TileDigitalChest;
public class ContainerDigitalChest extends RebornContainer {
public TileDigitalChest tileDigitalChest;
public EntityPlayer player;
public class ContainerDigitalChest extends RebornContainer
{
public TileDigitalChest tileDigitalChest;
public EntityPlayer player;
public ContainerDigitalChest(TileDigitalChest tileDigitalChest,
EntityPlayer player) {
super();
this.tileDigitalChest = tileDigitalChest;
this.player = player;
public ContainerDigitalChest(TileDigitalChest tileDigitalChest, EntityPlayer player)
{
super();
this.tileDigitalChest = tileDigitalChest;
this.player = player;
this.addSlotToContainer(new Slot(tileDigitalChest.inventory, 0, 80, 17));
this.addSlotToContainer(new SlotOutput(tileDigitalChest.inventory, 1,
80, 53));
this.addSlotToContainer(new SlotFake(tileDigitalChest.inventory, 2, 59,
42, false, false, Integer.MAX_VALUE));
this.addSlotToContainer(new Slot(tileDigitalChest.inventory, 0, 80, 17));
this.addSlotToContainer(new SlotOutput(tileDigitalChest.inventory, 1, 80, 53));
this.addSlotToContainer(new SlotFake(tileDigitalChest.inventory, 2, 59, 42, false, false, Integer.MAX_VALUE));
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;
}
}

View file

@ -9,56 +9,61 @@ import reborncore.common.container.RebornContainer;
import techreborn.api.SlotUpgrade;
import techreborn.tiles.teir1.TileElectricFurnace;
public class ContainerElectricFurnace extends RebornContainer {
public class ContainerElectricFurnace extends RebornContainer
{
EntityPlayer player;
EntityPlayer player;
TileElectricFurnace tile;
TileElectricFurnace tile;
public int connectionStatus;
public int connectionStatus;
public ContainerElectricFurnace(TileElectricFurnace tileGrinder, EntityPlayer player) {
super();
tile = tileGrinder;
this.player = player;
public ContainerElectricFurnace(TileElectricFurnace tileGrinder, EntityPlayer player)
{
super();
tile = tileGrinder;
this.player = player;
// input
this.addSlotToContainer(new Slot(tileGrinder.inventory, 0, 56, 34));
this.addSlotToContainer(new SlotOutput(tileGrinder.inventory, 1, 116, 34));
// input
this.addSlotToContainer(new Slot(tileGrinder.inventory, 0, 56, 34));
this.addSlotToContainer(new SlotOutput(tileGrinder.inventory, 1, 116, 34));
// upgrades
this.addSlotToContainer(new SlotUpgrade(tileGrinder.inventory, 2, 152, 8));
this.addSlotToContainer(new SlotUpgrade(tileGrinder.inventory, 3, 152, 26));
this.addSlotToContainer(new SlotUpgrade(tileGrinder.inventory, 4, 152, 44));
this.addSlotToContainer(new SlotUpgrade(tileGrinder.inventory, 5, 152, 62));
// upgrades
this.addSlotToContainer(new SlotUpgrade(tileGrinder.inventory, 2, 152, 8));
this.addSlotToContainer(new SlotUpgrade(tileGrinder.inventory, 3, 152, 26));
this.addSlotToContainer(new SlotUpgrade(tileGrinder.inventory, 4, 152, 44));
this.addSlotToContainer(new SlotUpgrade(tileGrinder.inventory, 5, 152, 62));
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 p_75145_1_)
{
return true;
}
@Override
public boolean canInteractWith(EntityPlayer p_75145_1_) {
return true;
}
@SideOnly(Side.CLIENT)
@Override
public void updateProgressBar(int id, int value) {
if (id == 10) {
this.connectionStatus = value;
}
}
@SideOnly(Side.CLIENT)
@Override
public void updateProgressBar(int id, int value)
{
if (id == 10)
{
this.connectionStatus = value;
}
}
}

View file

@ -1,82 +1,82 @@
package techreborn.client.container;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.ICrafting;
import net.minecraft.inventory.Slot;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import reborncore.client.gui.SlotOutput;
import techreborn.api.SlotUpgrade;
import techreborn.tiles.teir1.TileExtractor;
public class ContainerExtractor extends ContainerCrafting {
public class ContainerExtractor extends ContainerCrafting
{
EntityPlayer player;
EntityPlayer player;
TileExtractor tile;
public int connectionStatus;
TileExtractor tile;
public ContainerExtractor(TileExtractor tileGrinder, EntityPlayer player) {
super(tileGrinder.crafter);
tile = tileGrinder;
this.player = player;
public int connectionStatus;
// input
this.addSlotToContainer(new Slot(tileGrinder.inventory, 0, 56, 34));
this.addSlotToContainer(new SlotOutput(tileGrinder.inventory, 1, 116, 34));
public ContainerExtractor(TileExtractor tileGrinder, EntityPlayer player)
{
super(tileGrinder.crafter);
tile = tileGrinder;
this.player = player;
// input
this.addSlotToContainer(new Slot(tileGrinder.inventory, 0, 56, 34));
this.addSlotToContainer(new SlotOutput(tileGrinder.inventory, 1, 116, 34));
// upgrades
this.addSlotToContainer(new SlotUpgrade(tileGrinder.inventory, 2, 152, 8));
this.addSlotToContainer(new SlotUpgrade(tileGrinder.inventory, 3, 152, 26));
this.addSlotToContainer(new SlotUpgrade(tileGrinder.inventory, 4, 152, 44));
this.addSlotToContainer(new SlotUpgrade(tileGrinder.inventory, 5, 152, 62));
// upgrades
this.addSlotToContainer(new SlotUpgrade(tileGrinder.inventory, 2, 152, 8));
this.addSlotToContainer(new SlotUpgrade(tileGrinder.inventory, 3, 152, 26));
this.addSlotToContainer(new SlotUpgrade(tileGrinder.inventory, 4, 152, 44));
this.addSlotToContainer(new SlotUpgrade(tileGrinder.inventory, 5, 152, 62));
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 p_75145_1_) {
return true;
}
// @Override
// public void onCraftGuiOpened(ICrafting crafting) {
// super.onCraftGuiOpened(crafting);
// crafting.sendProgressBarUpdate(this, 0, (int) tile.getProgressScaled(0));
// crafting.sendProgressBarUpdate(this, 2, (int) tile.getEnergy());
// }
//
// @SideOnly(Side.CLIENT)
// @Override
// public void updateProgressBar(int id, int value) {
// if (id == 0) {
// this.progress = value;
// }
// else if (id == 2) {
// this.energy = value;
// }
// this.tile.setEnergy(energy);
// }
@Override
public boolean canInteractWith(EntityPlayer p_75145_1_)
{
return true;
}
// @SideOnly(Side.CLIENT)
// @Override
// public void updateProgressBar(int id, int value) {
// if (id == 10) {
// this.connectionStatus = value;
// }
// }
// @Override
// public void onCraftGuiOpened(ICrafting crafting) {
// super.onCraftGuiOpened(crafting);
// crafting.sendProgressBarUpdate(this, 0, (int) tile.getProgressScaled(0));
// crafting.sendProgressBarUpdate(this, 2, (int) tile.getEnergy());
// }
//
// @SideOnly(Side.CLIENT)
// @Override
// public void updateProgressBar(int id, int value) {
// if (id == 0) {
// this.progress = value;
// }
// else if (id == 2) {
// this.energy = value;
// }
// this.tile.setEnergy(energy);
// }
// @SideOnly(Side.CLIENT)
// @Override
// public void updateProgressBar(int id, int value) {
// if (id == 10) {
// this.connectionStatus = value;
// }
// }
}

View file

@ -9,106 +9,127 @@ import reborncore.client.gui.SlotOutput;
import reborncore.common.container.RebornContainer;
import techreborn.tiles.fusionReactor.TileEntityFusionController;
public class ContainerFusionReactor extends RebornContainer
{
public class ContainerFusionReactor extends RebornContainer {
public int coilStatus;
public int energy;
public int tickTime;
public int finalTickTime;
public int neededEU;
public int coilStatus;
public int energy;
public int tickTime;
public int finalTickTime;
public int neededEU;
TileEntityFusionController fusionController;
TileEntityFusionController fusionController;
public ContainerFusionReactor(TileEntityFusionController tileEntityFusionController, EntityPlayer player)
{
super();
this.fusionController = tileEntityFusionController;
public ContainerFusionReactor(TileEntityFusionController tileEntityFusionController,
EntityPlayer player) {
super();
this.fusionController = tileEntityFusionController;
addSlotToContainer(new Slot(tileEntityFusionController, 0, 88, 17));
addSlotToContainer(new Slot(tileEntityFusionController, 1, 88, 53));
addSlotToContainer(new SlotOutput(tileEntityFusionController, 2, 148, 35));
addSlotToContainer(new Slot(tileEntityFusionController, 0, 88, 17));
addSlotToContainer(new Slot(tileEntityFusionController, 1, 88, 53));
addSlotToContainer(new SlotOutput(tileEntityFusionController, 2, 148, 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;
}
@Override
public void detectAndSendChanges()
{
super.detectAndSendChanges();
for (int i = 0; i < this.crafters.size(); i++)
{
ICrafting icrafting = (ICrafting) this.crafters.get(i);
if (this.coilStatus != fusionController.coilStatus)
{
icrafting.sendProgressBarUpdate(this, 0, fusionController.coilStatus);
}
if (this.energy != (int) fusionController.getEnergy())
{
icrafting.sendProgressBarUpdate(this, 1, (int) fusionController.getEnergy());
}
if (this.tickTime != fusionController.crafingTickTime)
{
icrafting.sendProgressBarUpdate(this, 2, fusionController.crafingTickTime);
}
if (this.finalTickTime != fusionController.finalTickTime)
{
icrafting.sendProgressBarUpdate(this, 3, fusionController.finalTickTime);
}
if (this.neededEU != fusionController.neededPower)
{
icrafting.sendProgressBarUpdate(this, 4, fusionController.neededPower);
}
}
}
@Override
public void detectAndSendChanges() {
super.detectAndSendChanges();
for (int i = 0; i < this.crafters.size(); i++) {
ICrafting icrafting = (ICrafting) this.crafters.get(i);
if (this.coilStatus != fusionController.coilStatus) {
icrafting.sendProgressBarUpdate(this, 0, fusionController.coilStatus);
}
if (this.energy != (int) fusionController.getEnergy()) {
icrafting.sendProgressBarUpdate(this, 1, (int) fusionController.getEnergy());
}
if (this.tickTime != fusionController.crafingTickTime) {
icrafting.sendProgressBarUpdate(this, 2, fusionController.crafingTickTime);
}
if (this.finalTickTime != fusionController.finalTickTime) {
icrafting.sendProgressBarUpdate(this, 3, fusionController.finalTickTime);
}
if (this.neededEU != fusionController.neededPower) {
icrafting.sendProgressBarUpdate(this, 4, fusionController.neededPower);
}
}
}
@Override
public void onCraftGuiOpened(ICrafting crafting)
{
super.onCraftGuiOpened(crafting);
crafting.sendProgressBarUpdate(this, 0, fusionController.coilStatus);
crafting.sendProgressBarUpdate(this, 1, (int) fusionController.getEnergy());
crafting.sendProgressBarUpdate(this, 2, fusionController.crafingTickTime);
crafting.sendProgressBarUpdate(this, 3, fusionController.finalTickTime);
crafting.sendProgressBarUpdate(this, 4, fusionController.neededPower);
}
@Override
public void onCraftGuiOpened(ICrafting crafting) {
super.onCraftGuiOpened(crafting);
crafting.sendProgressBarUpdate(this, 0, fusionController.coilStatus);
crafting.sendProgressBarUpdate(this, 1, (int) fusionController.getEnergy());
crafting.sendProgressBarUpdate(this, 2, fusionController.crafingTickTime);
crafting.sendProgressBarUpdate(this, 3, fusionController.finalTickTime);
crafting.sendProgressBarUpdate(this, 4, fusionController.neededPower);
}
@SideOnly(Side.CLIENT)
@Override
public void updateProgressBar(int id, int value)
{
if (id == 0)
{
this.coilStatus = value;
} else if (id == 1)
{
this.energy = value;
} else if (id == 2)
{
this.tickTime = value;
} else if (id == 3)
{
this.finalTickTime = value;
} else if (id == 4)
{
this.neededEU = value;
}
if (tickTime == -1)
{
tickTime = 0;
}
if (finalTickTime == -1)
{
finalTickTime = 0;
}
if (neededEU == -1)
{
neededEU = 0;
}
}
@SideOnly(Side.CLIENT)
@Override
public void updateProgressBar(int id, int value) {
if (id == 0) {
this.coilStatus = value;
} else if (id == 1) {
this.energy = value;
} else if(id == 2){
this.tickTime = value;
} else if(id == 3){
this.finalTickTime = value;
} else if(id == 4){
this.neededEU = value;
}
if(tickTime == -1){
tickTime = 0;
}
if(finalTickTime == -1){
finalTickTime = 0;
}
if(neededEU == -1){
neededEU = 0;
}
}
public int getProgressScaled(){
return Math.max(0, Math.min(24, (this.tickTime > 0 ? 1 : 0) + this.tickTime * 24 / (this.finalTickTime < 1 ? 1 : this.finalTickTime)));
}
public int getProgressScaled()
{
return Math.max(0, Math.min(24,
(this.tickTime > 0 ? 1 : 0) + this.tickTime * 24 / (this.finalTickTime < 1 ? 1 : this.finalTickTime)));
}
}

View file

@ -7,40 +7,40 @@ import reborncore.client.gui.SlotOutput;
import reborncore.common.container.RebornContainer;
import techreborn.tiles.generator.TileGasTurbine;
public class ContainerGasTurbine extends RebornContainer {
public TileGasTurbine tileGasTurbine;
public EntityPlayer player;
public class ContainerGasTurbine extends RebornContainer
{
public TileGasTurbine tileGasTurbine;
public EntityPlayer player;
public ContainerGasTurbine(TileGasTurbine tileGasTurbine,
EntityPlayer player) {
super();
this.tileGasTurbine = tileGasTurbine;
this.player = player;
public ContainerGasTurbine(TileGasTurbine tileGasTurbine, EntityPlayer player)
{
super();
this.tileGasTurbine = tileGasTurbine;
this.player = player;
this.addSlotToContainer(new Slot(tileGasTurbine.inventory, 0, 80,
17));
this.addSlotToContainer(new SlotOutput(tileGasTurbine.inventory,
1, 80, 53));
this.addSlotToContainer(new SlotFake(tileGasTurbine.inventory, 2,
59, 42, false, false, 1));
this.addSlotToContainer(new Slot(tileGasTurbine.inventory, 0, 80, 17));
this.addSlotToContainer(new SlotOutput(tileGasTurbine.inventory, 1, 80, 53));
this.addSlotToContainer(new SlotFake(tileGasTurbine.inventory, 2, 59, 42, false, false, 1));
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;
}
}

View file

@ -9,89 +9,103 @@ import net.minecraftforge.fml.relauncher.SideOnly;
import reborncore.common.container.RebornContainer;
import techreborn.tiles.generator.TileGenerator;
public class ContainerGenerator extends RebornContainer {
public class ContainerGenerator extends RebornContainer
{
EntityPlayer player;
EntityPlayer player;
TileGenerator tile;
TileGenerator tile;
public int burnTime = 0;
public int totalBurnTime = 0;
public int energy;
public int burnTime = 0;
public int totalBurnTime = 0;
public int energy;
@Override
public boolean canInteractWith(EntityPlayer player) {
return true;
}
@Override
public boolean canInteractWith(EntityPlayer player)
{
return true;
}
public int tickTime;
public int tickTime;
public ContainerGenerator(TileGenerator tile, EntityPlayer player) {
super();
this.tile = tile;
this.player = player;
public ContainerGenerator(TileGenerator tile, EntityPlayer player)
{
super();
this.tile = tile;
this.player = player;
// fuel
this.addSlotToContainer(new Slot(tile.inventory, 0, 80, 53));
// charge
this.addSlotToContainer(new SlotFurnaceFuel(tile.inventory, 1, 80, 17));
// fuel
this.addSlotToContainer(new Slot(tile.inventory, 0, 80, 53));
// charge
this.addSlotToContainer(new SlotFurnaceFuel(tile.inventory, 1, 80, 17));
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 void detectAndSendChanges()
{
super.detectAndSendChanges();
for (int i = 0; i < this.crafters.size(); i++)
{
ICrafting icrafting = (ICrafting) this.crafters.get(i);
if (this.burnTime != tile.burnTime)
{
icrafting.sendProgressBarUpdate(this, 0, tile.burnTime);
}
if (this.totalBurnTime != tile.totalBurnTime)
{
icrafting.sendProgressBarUpdate(this, 1, tile.totalBurnTime);
}
if (this.energy != (int) tile.getEnergy())
{
icrafting.sendProgressBarUpdate(this, 2, (int) tile.getEnergy());
}
}
}
@Override
public void detectAndSendChanges() {
super.detectAndSendChanges();
for (int i = 0; i < this.crafters.size(); i++) {
ICrafting icrafting = (ICrafting) this.crafters.get(i);
if (this.burnTime != tile.burnTime) {
icrafting.sendProgressBarUpdate(this, 0, tile.burnTime);
}
if (this.totalBurnTime != tile.totalBurnTime) {
icrafting.sendProgressBarUpdate(this, 1, tile.totalBurnTime);
}
if (this.energy != (int) tile.getEnergy()) {
icrafting.sendProgressBarUpdate(this, 2, (int) tile.getEnergy());
}
}
}
@Override
public void onCraftGuiOpened(ICrafting crafting)
{
super.onCraftGuiOpened(crafting);
crafting.sendProgressBarUpdate(this, 0, tile.burnTime);
crafting.sendProgressBarUpdate(this, 1, tile.totalBurnTime);
crafting.sendProgressBarUpdate(this, 2, (int) tile.getEnergy());
}
@Override
public void onCraftGuiOpened(ICrafting crafting) {
super.onCraftGuiOpened(crafting);
crafting.sendProgressBarUpdate(this, 0, tile.burnTime);
crafting.sendProgressBarUpdate(this, 1, tile.totalBurnTime);
crafting.sendProgressBarUpdate(this, 2, (int) tile.getEnergy());
}
@SideOnly(Side.CLIENT)
@Override
public void updateProgressBar(int id, int value)
{
if (id == 0)
{
this.burnTime = value;
} else if (id == 1)
{
this.totalBurnTime = value;
} else if (id == 2)
{
this.energy = value;
}
this.tile.setEnergy(energy);
}
@SideOnly(Side.CLIENT)
@Override
public void updateProgressBar(int id, int value) {
if (id == 0) {
this.burnTime = value;
} else if (id == 1) {
this.totalBurnTime = value;
} else if (id == 2) {
this.energy = value;
}
this.tile.setEnergy(energy);
}
public int getScaledBurnTime(int i) {
return (int) (((float) burnTime / (float) totalBurnTime) * i);
}
public int getScaledBurnTime(int i)
{
return (int) (((float) burnTime / (float) totalBurnTime) * i);
}
}

View file

@ -2,53 +2,54 @@ package techreborn.client.container;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Slot;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import reborncore.client.gui.SlotOutput;
import techreborn.api.SlotUpgrade;
import techreborn.tiles.teir1.TileGrinder;
public class ContainerGrinder extends ContainerCrafting {
public class ContainerGrinder extends ContainerCrafting
{
EntityPlayer player;
EntityPlayer player;
TileGrinder tile;
TileGrinder tile;
public int connectionStatus;
public int connectionStatus;
public ContainerGrinder(TileGrinder tileGrinder, EntityPlayer player) {
super(tileGrinder.crafter);
tile = tileGrinder;
this.player = player;
public ContainerGrinder(TileGrinder tileGrinder, EntityPlayer player)
{
super(tileGrinder.crafter);
tile = tileGrinder;
this.player = player;
// input
this.addSlotToContainer(new Slot(tileGrinder.inventory, 0, 56, 34));
this.addSlotToContainer(new SlotOutput(tileGrinder.inventory, 1, 116, 34));
// input
this.addSlotToContainer(new Slot(tileGrinder.inventory, 0, 56, 34));
this.addSlotToContainer(new SlotOutput(tileGrinder.inventory, 1, 116, 34));
// upgrades
this.addSlotToContainer(new SlotUpgrade(tileGrinder.inventory, 2, 152, 8));
this.addSlotToContainer(new SlotUpgrade(tileGrinder.inventory, 3, 152, 26));
this.addSlotToContainer(new SlotUpgrade(tileGrinder.inventory, 4, 152, 44));
this.addSlotToContainer(new SlotUpgrade(tileGrinder.inventory, 5, 152, 62));
// upgrades
this.addSlotToContainer(new SlotUpgrade(tileGrinder.inventory, 2, 152, 8));
this.addSlotToContainer(new SlotUpgrade(tileGrinder.inventory, 3, 152, 26));
this.addSlotToContainer(new SlotUpgrade(tileGrinder.inventory, 4, 152, 44));
this.addSlotToContainer(new SlotUpgrade(tileGrinder.inventory, 5, 152, 62));
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 p_75145_1_) {
return true;
}
@Override
public boolean canInteractWith(EntityPlayer p_75145_1_)
{
return true;
}
}

View file

@ -8,80 +8,93 @@ 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 {
EntityPlayer player;
EntityPlayer player;
TileIDSU tile;
TileIDSU tile;
@Override
public boolean canInteractWith(EntityPlayer player)
{
return true;
}
@Override
public boolean canInteractWith(EntityPlayer player) {
return true;
}
public int euOut;
public int storedEu;
public int euChange;
public int channel;
public int euOut;
public int storedEu;
public int euChange;
public int channel;
public ContainerIDSU(TileIDSU tileIDSU, EntityPlayer player)
{
tile = tileIDSU;
this.player = player;
public ContainerIDSU(TileIDSU tileIDSU,
EntityPlayer player) {
tile = tileIDSU;
this.player = player;
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 void detectAndSendChanges()
{
super.detectAndSendChanges();
for (int i = 0; i < this.crafters.size(); i++)
{
ICrafting icrafting = (ICrafting) this.crafters.get(i);
if (this.euOut != tile.output)
{
icrafting.sendProgressBarUpdate(this, 0, tile.output);
}
if (this.storedEu != (int) tile.getEnergy())
{
icrafting.sendProgressBarUpdate(this, 1, (int) tile.getEnergy());
}
if (this.euChange != tile.getEuChange() && tile.getEuChange() != -1)
{
icrafting.sendProgressBarUpdate(this, 2, (int) tile.getEuChange());
}
}
}
@Override
public void detectAndSendChanges() {
super.detectAndSendChanges();
for (int i = 0; i < this.crafters.size(); i++) {
ICrafting icrafting = (ICrafting) this.crafters.get(i);
if (this.euOut != tile.output) {
icrafting.sendProgressBarUpdate(this, 0, tile.output);
}
if (this.storedEu != (int) tile.getEnergy()) {
icrafting.sendProgressBarUpdate(this, 1, (int) tile.getEnergy());
}
if (this.euChange != tile.getEuChange() && tile.getEuChange() != -1) {
icrafting.sendProgressBarUpdate(this, 2, (int) tile.getEuChange());
}
}
}
@Override
public void onCraftGuiOpened(ICrafting crafting)
{
super.onCraftGuiOpened(crafting);
crafting.sendProgressBarUpdate(this, 0, tile.output);
crafting.sendProgressBarUpdate(this, 1, (int) tile.getEnergy());
crafting.sendProgressBarUpdate(this, 2, (int) tile.getEuChange());
}
@Override
public void onCraftGuiOpened(ICrafting crafting) {
super.onCraftGuiOpened(crafting);
crafting.sendProgressBarUpdate(this, 0, tile.output);
crafting.sendProgressBarUpdate(this, 1, (int) tile.getEnergy());
crafting.sendProgressBarUpdate(this, 2, (int) tile.getEuChange());
}
@SideOnly(Side.CLIENT)
@Override
public void updateProgressBar(int id, int value) {
if (id == 0) {
this.euOut = value;
} else if (id == 1) {
this.storedEu = value;
} else if (id == 2) {
this.euChange = value;
} else if (id == 3) {
this.channel = value;
}
}
@SideOnly(Side.CLIENT)
@Override
public void updateProgressBar(int id, int value)
{
if (id == 0)
{
this.euOut = value;
} else if (id == 1)
{
this.storedEu = value;
} else if (id == 2)
{
this.euChange = value;
} else if (id == 3)
{
this.channel = value;
}
}
}

View file

@ -8,77 +8,85 @@ import net.minecraftforge.fml.relauncher.SideOnly;
import reborncore.client.gui.SlotOutput;
import techreborn.tiles.TileImplosionCompressor;
public class ContainerImplosionCompressor extends ContainerCrafting {
public class ContainerImplosionCompressor extends ContainerCrafting
{
EntityPlayer player;
EntityPlayer player;
TileImplosionCompressor tile;
TileImplosionCompressor tile;
public int tickTime;
public int multIBlockState = 0;
public int tickTime;
public int multIBlockState = 0;
public ContainerImplosionCompressor(TileImplosionCompressor tilecompressor,
EntityPlayer player) {
super(tilecompressor.crafter);
tile = tilecompressor;
this.player = player;
public ContainerImplosionCompressor(TileImplosionCompressor tilecompressor, EntityPlayer player)
{
super(tilecompressor.crafter);
tile = tilecompressor;
this.player = player;
// input
this.addSlotToContainer(new Slot(tilecompressor.inventory, 0, 37, 26));
this.addSlotToContainer(new Slot(tilecompressor.inventory, 1, 37, 44));
// outputs
this.addSlotToContainer(new SlotOutput(tilecompressor.inventory, 2, 93, 35));
this.addSlotToContainer(new SlotOutput(tilecompressor.inventory, 3, 111, 35));
// input
this.addSlotToContainer(new Slot(tilecompressor.inventory, 0, 37, 26));
this.addSlotToContainer(new Slot(tilecompressor.inventory, 1, 37, 44));
// outputs
this.addSlotToContainer(new SlotOutput(tilecompressor.inventory, 2, 93, 35));
this.addSlotToContainer(new SlotOutput(tilecompressor.inventory, 3, 111, 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 p_75145_1_)
{
return true;
}
@Override
public boolean canInteractWith(EntityPlayer p_75145_1_) {
return true;
}
@Override
public void detectAndSendChanges()
{
super.detectAndSendChanges();
for (int i = 0; i < this.crafters.size(); i++)
{
ICrafting icrafting = (ICrafting) this.crafters.get(i);
if (this.multIBlockState != getMultIBlockStateint())
{
icrafting.sendProgressBarUpdate(this, 3, getMultIBlockStateint());
}
}
}
@Override
public void detectAndSendChanges() {
super.detectAndSendChanges();
for (int i = 0; i < this.crafters.size(); i++) {
ICrafting icrafting = (ICrafting) this.crafters.get(i);
if (this.multIBlockState != getMultIBlockStateint()) {
icrafting.sendProgressBarUpdate(this, 3, getMultIBlockStateint());
}
}
}
@Override
public void onCraftGuiOpened(ICrafting crafting)
{
super.onCraftGuiOpened(crafting);
crafting.sendProgressBarUpdate(this, 3, getMultIBlockStateint());
}
@Override
public void onCraftGuiOpened(ICrafting crafting) {
super.onCraftGuiOpened(crafting);
crafting.sendProgressBarUpdate(this, 3, getMultIBlockStateint());
}
@SideOnly(Side.CLIENT)
@Override
public void updateProgressBar(int id, int value) {
if (id == 3) {
this.multIBlockState = value;
}
}
public int getMultIBlockStateint(){
return tile.getMutliBlock() ? 1 : 0;
}
@SideOnly(Side.CLIENT)
@Override
public void updateProgressBar(int id, int value)
{
if (id == 3)
{
this.multIBlockState = value;
}
}
public int getMultIBlockStateint()
{
return tile.getMutliBlock() ? 1 : 0;
}
}

View file

@ -5,48 +5,52 @@ import net.minecraft.inventory.Slot;
import reborncore.client.gui.SlotOutput;
import techreborn.tiles.TileIndustrialElectrolyzer;
public class ContainerIndustrialElectrolyzer extends ContainerCrafting {
public class ContainerIndustrialElectrolyzer extends ContainerCrafting
{
EntityPlayer player;
EntityPlayer player;
TileIndustrialElectrolyzer tile;
TileIndustrialElectrolyzer tile;
@Override
public boolean canInteractWith(EntityPlayer player) {
return true;
}
@Override
public boolean canInteractWith(EntityPlayer player)
{
return true;
}
public int tickTime;
public int tickTime;
public ContainerIndustrialElectrolyzer(TileIndustrialElectrolyzer electrolyzer, EntityPlayer player) {
super(electrolyzer.crafter);
tile = electrolyzer;
this.player = player;
public ContainerIndustrialElectrolyzer(TileIndustrialElectrolyzer electrolyzer, EntityPlayer player)
{
super(electrolyzer.crafter);
tile = electrolyzer;
this.player = player;
// input
this.addSlotToContainer(new Slot(electrolyzer.inventory, 0, 80, 51));
this.addSlotToContainer(new Slot(electrolyzer.inventory, 1, 50, 51));
// outputs
this.addSlotToContainer(new SlotOutput(electrolyzer.inventory, 2, 50, 19));
this.addSlotToContainer(new SlotOutput(electrolyzer.inventory, 3, 70, 19));
this.addSlotToContainer(new SlotOutput(electrolyzer.inventory, 4, 90, 19));
this.addSlotToContainer(new SlotOutput(electrolyzer.inventory, 5, 110, 19));
// battery
this.addSlotToContainer(new Slot(electrolyzer.inventory, 6, 18, 51));
// input
this.addSlotToContainer(new Slot(electrolyzer.inventory, 0, 80, 51));
this.addSlotToContainer(new Slot(electrolyzer.inventory, 1, 50, 51));
// outputs
this.addSlotToContainer(new SlotOutput(electrolyzer.inventory, 2, 50, 19));
this.addSlotToContainer(new SlotOutput(electrolyzer.inventory, 3, 70, 19));
this.addSlotToContainer(new SlotOutput(electrolyzer.inventory, 4, 90, 19));
this.addSlotToContainer(new SlotOutput(electrolyzer.inventory, 5, 110, 19));
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));
}
}
// battery
this.addSlotToContainer(new Slot(electrolyzer.inventory, 6, 18, 51));
for (i = 0; i < 9; ++i) {
this.addSlotToContainer(new Slot(player.inventory, i, 8 + i * 18,
142));
}
}
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 < 9; ++i)
{
this.addSlotToContainer(new Slot(player.inventory, i, 8 + i * 18, 142));
}
}
}

View file

@ -8,74 +8,82 @@ import net.minecraftforge.fml.relauncher.SideOnly;
import reborncore.client.gui.SlotOutput;
import techreborn.tiles.TileIndustrialGrinder;
public class ContainerIndustrialGrinder extends ContainerCrafting {
public class ContainerIndustrialGrinder extends ContainerCrafting
{
EntityPlayer player;
EntityPlayer player;
TileIndustrialGrinder tile;
TileIndustrialGrinder tile;
public int connectionStatus;
public int connectionStatus;
public ContainerIndustrialGrinder(TileIndustrialGrinder tileGrinder,
EntityPlayer player) {
super(tileGrinder.crafter);
tile = tileGrinder;
this.player = player;
public ContainerIndustrialGrinder(TileIndustrialGrinder tileGrinder, EntityPlayer player)
{
super(tileGrinder.crafter);
tile = tileGrinder;
this.player = player;
// input
this.addSlotToContainer(new Slot(tileGrinder.inventory, 0, 32, 26));
this.addSlotToContainer(new Slot(tileGrinder.inventory, 1, 32, 44));
// input
this.addSlotToContainer(new Slot(tileGrinder.inventory, 0, 32, 26));
this.addSlotToContainer(new Slot(tileGrinder.inventory, 1, 32, 44));
// outputs
this.addSlotToContainer(new SlotOutput(tileGrinder.inventory, 2, 77, 35));
this.addSlotToContainer(new SlotOutput(tileGrinder.inventory, 3, 95, 35));
this.addSlotToContainer(new SlotOutput(tileGrinder.inventory, 4, 113, 35));
this.addSlotToContainer(new SlotOutput(tileGrinder.inventory, 5, 131, 35));
// outputs
this.addSlotToContainer(new SlotOutput(tileGrinder.inventory, 2, 77, 35));
this.addSlotToContainer(new SlotOutput(tileGrinder.inventory, 3, 95, 35));
this.addSlotToContainer(new SlotOutput(tileGrinder.inventory, 4, 113, 35));
this.addSlotToContainer(new SlotOutput(tileGrinder.inventory, 5, 131, 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 p_75145_1_)
{
return true;
}
@Override
public boolean canInteractWith(EntityPlayer p_75145_1_) {
return true;
}
@Override
public void detectAndSendChanges()
{
super.detectAndSendChanges();
for (int i = 0; i < this.crafters.size(); i++)
{
ICrafting icrafting = (ICrafting) this.crafters.get(i);
if (this.connectionStatus != tile.connectionStatus)
{
icrafting.sendProgressBarUpdate(this, 10, tile.connectionStatus);
}
}
}
@Override
public void detectAndSendChanges() {
super.detectAndSendChanges();
for (int i = 0; i < this.crafters.size(); i++) {
ICrafting icrafting = (ICrafting) this.crafters.get(i);
if (this.connectionStatus != tile.connectionStatus) {
icrafting.sendProgressBarUpdate(this, 10, tile.connectionStatus);
}
}
}
@Override
public void onCraftGuiOpened(ICrafting crafting)
{
super.onCraftGuiOpened(crafting);
crafting.sendProgressBarUpdate(this, 10, tile.connectionStatus);
}
@Override
public void onCraftGuiOpened(ICrafting crafting) {
super.onCraftGuiOpened(crafting);
crafting.sendProgressBarUpdate(this, 10, tile.connectionStatus);
}
@SideOnly(Side.CLIENT)
@Override
public void updateProgressBar(int id, int value) {
if (id == 10) {
this.connectionStatus = value;
}
}
@SideOnly(Side.CLIENT)
@Override
public void updateProgressBar(int id, int value)
{
if (id == 10)
{
this.connectionStatus = value;
}
}
}

View file

@ -5,47 +5,49 @@ import net.minecraft.inventory.Slot;
import reborncore.client.gui.SlotOutput;
import techreborn.tiles.TileIndustrialSawmill;
public class ContainerIndustrialSawmill extends ContainerCrafting {
public class ContainerIndustrialSawmill extends ContainerCrafting
{
EntityPlayer player;
EntityPlayer player;
TileIndustrialSawmill tile;
TileIndustrialSawmill tile;
@Override
public boolean canInteractWith(EntityPlayer player) {
return true;
}
@Override
public boolean canInteractWith(EntityPlayer player)
{
return true;
}
public int tickTime;
public int tickTime;
public ContainerIndustrialSawmill(TileIndustrialSawmill tileIndustrialSawmill,
EntityPlayer player) {
super(tileIndustrialSawmill.crafter);
tile = tileIndustrialSawmill;
this.player = player;
public ContainerIndustrialSawmill(TileIndustrialSawmill tileIndustrialSawmill, EntityPlayer player)
{
super(tileIndustrialSawmill.crafter);
tile = tileIndustrialSawmill;
this.player = player;
// input
this.addSlotToContainer(new Slot(tileIndustrialSawmill.inventory, 0, 32, 26));
this.addSlotToContainer(new Slot(tileIndustrialSawmill.inventory, 1, 32, 44));
// outputs
this.addSlotToContainer(new SlotOutput(tileIndustrialSawmill.inventory, 2, 84, 35));
this.addSlotToContainer(new SlotOutput(tileIndustrialSawmill.inventory, 3, 102, 35));
this.addSlotToContainer(new SlotOutput(tileIndustrialSawmill.inventory, 4, 120, 35));
// input
this.addSlotToContainer(new Slot(tileIndustrialSawmill.inventory, 0, 32, 26));
this.addSlotToContainer(new Slot(tileIndustrialSawmill.inventory, 1, 32, 44));
// outputs
this.addSlotToContainer(new SlotOutput(tileIndustrialSawmill.inventory, 2, 84, 35));
this.addSlotToContainer(new SlotOutput(tileIndustrialSawmill.inventory, 3, 102, 35));
this.addSlotToContainer(new SlotOutput(tileIndustrialSawmill.inventory, 4, 120, 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));
}
}
}

View file

@ -9,50 +9,56 @@ import reborncore.client.gui.SlotOutput;
import reborncore.common.container.RebornContainer;
import techreborn.tiles.TileIronFurnace;
public class ContainerIronFurnace extends RebornContainer {
public class ContainerIronFurnace extends RebornContainer
{
EntityPlayer player;
EntityPlayer player;
TileIronFurnace tile;
TileIronFurnace tile;
public int connectionStatus;
public int connectionStatus;
public ContainerIronFurnace(TileIronFurnace tileGrinder, EntityPlayer player) {
super();
tile = tileGrinder;
this.player = player;
public ContainerIronFurnace(TileIronFurnace tileGrinder, EntityPlayer player)
{
super();
tile = tileGrinder;
this.player = player;
// input
this.addSlotToContainer(new Slot(tileGrinder.inventory, 0, 56, 17));
this.addSlotToContainer(new SlotOutput(tileGrinder.inventory, 1, 116, 34));
//Fuel
this.addSlotToContainer(new SlotFurnaceFuel(tileGrinder.inventory, 2, 56, 53));
// input
this.addSlotToContainer(new Slot(tileGrinder.inventory, 0, 56, 17));
this.addSlotToContainer(new SlotOutput(tileGrinder.inventory, 1, 116, 34));
// Fuel
this.addSlotToContainer(new SlotFurnaceFuel(tileGrinder.inventory, 2, 56, 53));
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;
}
@SideOnly(Side.CLIENT)
@Override
public void updateProgressBar(int id, int value) {
if (id == 10) {
this.connectionStatus = value;
}
}
@SideOnly(Side.CLIENT)
@Override
public void updateProgressBar(int id, int value)
{
if (id == 10)
{
this.connectionStatus = value;
}
}
}

View file

@ -9,81 +9,91 @@ import reborncore.client.gui.SlotOutput;
import reborncore.common.container.RebornContainer;
import techreborn.tiles.TileMatterFabricator;
public class ContainerMatterFabricator extends RebornContainer {
public class ContainerMatterFabricator extends RebornContainer
{
EntityPlayer player;
EntityPlayer player;
TileMatterFabricator tile;
TileMatterFabricator tile;
public int progressTime;
public int progressTime;
public ContainerMatterFabricator(TileMatterFabricator tileMatterfab,
EntityPlayer player) {
tile = tileMatterfab;
this.player = player;
public ContainerMatterFabricator(TileMatterFabricator tileMatterfab, EntityPlayer player)
{
tile = tileMatterfab;
this.player = player;
// input
this.addSlotToContainer(new Slot(tileMatterfab.inventory, 0, 33, 17));
this.addSlotToContainer(new Slot(tileMatterfab.inventory, 1, 33, 35));
this.addSlotToContainer(new Slot(tileMatterfab.inventory, 2, 33, 53));
this.addSlotToContainer(new Slot(tileMatterfab.inventory, 3, 51, 17));
this.addSlotToContainer(new Slot(tileMatterfab.inventory, 4, 51, 35));
this.addSlotToContainer(new Slot(tileMatterfab.inventory, 5, 51, 53));
// input
this.addSlotToContainer(new Slot(tileMatterfab.inventory, 0, 33, 17));
this.addSlotToContainer(new Slot(tileMatterfab.inventory, 1, 33, 35));
this.addSlotToContainer(new Slot(tileMatterfab.inventory, 2, 33, 53));
this.addSlotToContainer(new Slot(tileMatterfab.inventory, 3, 51, 17));
this.addSlotToContainer(new Slot(tileMatterfab.inventory, 4, 51, 35));
this.addSlotToContainer(new Slot(tileMatterfab.inventory, 5, 51, 53));
// outputs
this.addSlotToContainer(new SlotOutput(tileMatterfab.inventory, 6,
116, 35));
// outputs
this.addSlotToContainer(new SlotOutput(tileMatterfab.inventory, 6, 116, 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 p_75145_1_) {
return true;
}
@Override
public boolean canInteractWith(EntityPlayer p_75145_1_)
{
return true;
}
@Override
public void detectAndSendChanges() {
super.detectAndSendChanges();
for (int i = 0; i < this.crafters.size(); i++) {
ICrafting icrafting = (ICrafting) this.crafters.get(i);
if (this.progressTime != tile.progresstime) {
icrafting.sendProgressBarUpdate(this, 0, tile.progresstime);
}
}
}
@Override
public void detectAndSendChanges()
{
super.detectAndSendChanges();
for (int i = 0; i < this.crafters.size(); i++)
{
ICrafting icrafting = (ICrafting) this.crafters.get(i);
if (this.progressTime != tile.progresstime)
{
icrafting.sendProgressBarUpdate(this, 0, tile.progresstime);
}
}
}
@Override
public void onCraftGuiOpened(ICrafting crafting) {
super.onCraftGuiOpened(crafting);
crafting.sendProgressBarUpdate(this, 0, tile.progresstime);
}
@Override
public void onCraftGuiOpened(ICrafting crafting)
{
super.onCraftGuiOpened(crafting);
crafting.sendProgressBarUpdate(this, 0, tile.progresstime);
}
@SideOnly(Side.CLIENT)
@Override
public void updateProgressBar(int id, int value) {
if (id == 0) {
this.progressTime = value;
}
}
@SideOnly(Side.CLIENT)
@Override
public void updateProgressBar(int id, int value)
{
if (id == 0)
{
this.progressTime = value;
}
}
public int getProgressScaled(int scale) {
if (progressTime != 0) {
return progressTime * scale / tile.maxProgresstime();
}
return 0;
}
public int getProgressScaled(int scale)
{
if (progressTime != 0)
{
return progressTime * scale / tile.maxProgresstime();
}
return 0;
}
}

View file

@ -3,17 +3,20 @@ package techreborn.client.container;
import net.minecraft.entity.player.EntityPlayer;
import reborncore.common.container.RebornContainer;
public class ContainerPda extends RebornContainer {
public class ContainerPda extends RebornContainer
{
EntityPlayer player;
EntityPlayer player;
public ContainerPda(EntityPlayer player) {
public ContainerPda(EntityPlayer player)
{
}
}
@Override
public boolean canInteractWith(EntityPlayer player) {
return true;
}
@Override
public boolean canInteractWith(EntityPlayer player)
{
return true;
}
}

View file

@ -7,40 +7,41 @@ import reborncore.client.gui.SlotOutput;
import reborncore.common.container.RebornContainer;
import techreborn.tiles.TileQuantumChest;
public class ContainerQuantumChest extends RebornContainer {
public TileQuantumChest tileQuantumChest;
public EntityPlayer player;
public class ContainerQuantumChest extends RebornContainer
{
public TileQuantumChest tileQuantumChest;
public EntityPlayer player;
public ContainerQuantumChest(TileQuantumChest tileQuantumChest,
EntityPlayer player) {
super();
this.tileQuantumChest = tileQuantumChest;
this.player = player;
public ContainerQuantumChest(TileQuantumChest tileQuantumChest, EntityPlayer player)
{
super();
this.tileQuantumChest = tileQuantumChest;
this.player = player;
this.addSlotToContainer(new Slot(tileQuantumChest.inventory, 0, 80, 17));
this.addSlotToContainer(new SlotOutput(tileQuantumChest.inventory, 1,
80, 53));
this.addSlotToContainer(new SlotFake(tileQuantumChest.inventory, 2, 59,
42, false, false, Integer.MAX_VALUE));
this.addSlotToContainer(new Slot(tileQuantumChest.inventory, 0, 80, 17));
this.addSlotToContainer(new SlotOutput(tileQuantumChest.inventory, 1, 80, 53));
this.addSlotToContainer(new SlotFake(tileQuantumChest.inventory, 2, 59, 42, false, false, Integer.MAX_VALUE));
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;
}
}

View file

@ -8,39 +8,40 @@ import reborncore.client.gui.SlotOutput;
import reborncore.common.container.RebornContainer;
import techreborn.tiles.TileQuantumTank;
public class ContainerQuantumTank extends RebornContainer {
public TileQuantumTank tileQuantumTank;
public EntityPlayer player;
public class ContainerQuantumTank extends RebornContainer
{
public TileQuantumTank tileQuantumTank;
public EntityPlayer player;
public ContainerQuantumTank(TileQuantumTank tileQuantumTank,
EntityPlayer player) {
super();
this.tileQuantumTank = tileQuantumTank;
this.player = player;
public ContainerQuantumTank(TileQuantumTank tileQuantumTank, EntityPlayer player)
{
super();
this.tileQuantumTank = tileQuantumTank;
this.player = player;
this.addSlotToContainer(new SlotFluid(tileQuantumTank.inventory, 0, 80, 17));
this.addSlotToContainer(new SlotOutput(tileQuantumTank.inventory, 1,
80, 53));
this.addSlotToContainer(new SlotFake(tileQuantumTank.inventory, 2, 59,
42, false, false, 1));
this.addSlotToContainer(new SlotFluid(tileQuantumTank.inventory, 0, 80, 17));
this.addSlotToContainer(new SlotOutput(tileQuantumTank.inventory, 1, 80, 53));
this.addSlotToContainer(new SlotFake(tileQuantumTank.inventory, 2, 59, 42, false, false, 1));
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;
}
}

View file

@ -9,55 +9,60 @@ import reborncore.common.container.RebornContainer;
import techreborn.api.SlotUpgrade;
import techreborn.tiles.teir1.TileRecycler;
public class ContainerRecycler extends RebornContainer {
public class ContainerRecycler extends RebornContainer
{
EntityPlayer player;
EntityPlayer player;
TileRecycler tile;
TileRecycler tile;
public int connectionStatus;
public int connectionStatus;
public ContainerRecycler(TileRecycler tileGrinder, EntityPlayer player) {
super();
tile = tileGrinder;
this.player = player;
public ContainerRecycler(TileRecycler tileGrinder, EntityPlayer player)
{
super();
tile = tileGrinder;
this.player = player;
// input
this.addSlotToContainer(new Slot(tileGrinder.inventory, 0, 56, 34));
this.addSlotToContainer(new SlotOutput(tileGrinder.inventory, 1, 116, 34));
// input
this.addSlotToContainer(new Slot(tileGrinder.inventory, 0, 56, 34));
this.addSlotToContainer(new SlotOutput(tileGrinder.inventory, 1, 116, 34));
// upgrades
this.addSlotToContainer(new SlotUpgrade(tileGrinder.inventory, 2, 152, 8));
this.addSlotToContainer(new SlotUpgrade(tileGrinder.inventory, 3, 152, 26));
this.addSlotToContainer(new SlotUpgrade(tileGrinder.inventory, 4, 152, 44));
this.addSlotToContainer(new SlotUpgrade(tileGrinder.inventory, 5, 152, 62));
// upgrades
this.addSlotToContainer(new SlotUpgrade(tileGrinder.inventory, 2, 152, 8));
this.addSlotToContainer(new SlotUpgrade(tileGrinder.inventory, 3, 152, 26));
this.addSlotToContainer(new SlotUpgrade(tileGrinder.inventory, 4, 152, 44));
this.addSlotToContainer(new SlotUpgrade(tileGrinder.inventory, 5, 152, 62));
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 p_75145_1_)
{
return true;
}
@Override
public boolean canInteractWith(EntityPlayer p_75145_1_) {
return true;
}
@SideOnly(Side.CLIENT)
@Override
public void updateProgressBar(int id, int value) {
if (id == 10) {
this.connectionStatus = value;
}
}
@SideOnly(Side.CLIENT)
@Override
public void updateProgressBar(int id, int value)
{
if (id == 10)
{
this.connectionStatus = value;
}
}
}

View file

@ -10,107 +10,125 @@ import reborncore.common.container.RebornContainer;
import techreborn.api.RollingMachineRecipe;
import techreborn.tiles.TileRollingMachine;
public class ContainerRollingMachine extends RebornContainer {
public class ContainerRollingMachine extends RebornContainer
{
EntityPlayer player;
TileRollingMachine tile;
EntityPlayer player;
TileRollingMachine tile;
public ContainerRollingMachine(TileRollingMachine tileRollingmachine, EntityPlayer player) {
tile = tileRollingmachine;
this.player = player;
public ContainerRollingMachine(TileRollingMachine tileRollingmachine, EntityPlayer player)
{
tile = tileRollingmachine;
this.player = player;
for (int l = 0; l < 3; l++) {
for (int k1 = 0; k1 < 3; k1++) {
this.addSlotToContainer(new Slot(
tileRollingmachine.craftMatrix, k1 + l * 3,
30 + k1 * 18, 17 + l * 18));
}
}
for (int l = 0; l < 3; l++)
{
for (int k1 = 0; k1 < 3; k1++)
{
this.addSlotToContainer(
new Slot(tileRollingmachine.craftMatrix, k1 + l * 3, 30 + k1 * 18, 17 + l * 18));
}
}
// output
this.addSlotToContainer(new SlotOutput(tileRollingmachine.inventory, 0, 124, 35));
// battery
this.addSlotToContainer(new Slot(tileRollingmachine.inventory, 2, 8, 51));
// output
this.addSlotToContainer(new SlotOutput(tileRollingmachine.inventory, 0, 124, 35));
// battery
this.addSlotToContainer(new Slot(tileRollingmachine.inventory, 2, 8, 51));
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;
}
@Override
public final void onCraftMatrixChanged(IInventory inv) {
ItemStack output = RollingMachineRecipe.instance.findMatchingRecipe(
tile.craftMatrix, tile.getWorld());
tile.inventory.setInventorySlotContents(1, output);
}
@Override
public final void onCraftMatrixChanged(IInventory inv)
{
ItemStack output = RollingMachineRecipe.instance.findMatchingRecipe(tile.craftMatrix, tile.getWorld());
tile.inventory.setInventorySlotContents(1, output);
}
int currentItemBurnTime;
int burnTime;
int energy;
int currentItemBurnTime;
int burnTime;
int energy;
@Override
public void onCraftGuiOpened(ICrafting crafting) {
super.onCraftGuiOpened(crafting);
crafting.sendProgressBarUpdate(this, 0, tile.runTime);
crafting.sendProgressBarUpdate(this, 1, tile.tickTime);
crafting.sendProgressBarUpdate(this, 2, (int) tile.getEnergy());
}
@Override
public void onCraftGuiOpened(ICrafting crafting)
{
super.onCraftGuiOpened(crafting);
crafting.sendProgressBarUpdate(this, 0, tile.runTime);
crafting.sendProgressBarUpdate(this, 1, tile.tickTime);
crafting.sendProgressBarUpdate(this, 2, (int) tile.getEnergy());
}
@Override
public void detectAndSendChanges() {
for (int i = 0; i < this.crafters.size(); i++) {
ICrafting crafting = (ICrafting) this.crafters.get(i);
if (this.currentItemBurnTime != tile.runTime) {
crafting.sendProgressBarUpdate(this, 0, tile.runTime);
}
if (this.burnTime != tile.tickTime || tile.tickTime == -1) {
crafting.sendProgressBarUpdate(this, 1, tile.tickTime);
}
if (this.energy != (int) tile.getEnergy()) {
crafting.sendProgressBarUpdate(this, 2, (int) tile.getEnergy());
}
}
super.detectAndSendChanges();
}
@Override
public void detectAndSendChanges()
{
for (int i = 0; i < this.crafters.size(); i++)
{
ICrafting crafting = (ICrafting) this.crafters.get(i);
if (this.currentItemBurnTime != tile.runTime)
{
crafting.sendProgressBarUpdate(this, 0, tile.runTime);
}
if (this.burnTime != tile.tickTime || tile.tickTime == -1)
{
crafting.sendProgressBarUpdate(this, 1, tile.tickTime);
}
if (this.energy != (int) tile.getEnergy())
{
crafting.sendProgressBarUpdate(this, 2, (int) tile.getEnergy());
}
}
super.detectAndSendChanges();
}
@Override
public void updateProgressBar(int id, int value) {
super.updateProgressBar(id, value);
if (id == 0) {
this.currentItemBurnTime = value;
} else if (id == 1) {
this.burnTime = value;
} else if (id == 2) {
this.energy = value;
}
this.tile.runTime = this.currentItemBurnTime;
if(this.burnTime == -1){
this.burnTime = 0;
}
this.tile.tickTime = this.burnTime;
this.tile.setEnergy(this.energy);
}
@Override
public void updateProgressBar(int id, int value)
{
super.updateProgressBar(id, value);
if (id == 0)
{
this.currentItemBurnTime = value;
} else if (id == 1)
{
this.burnTime = value;
} else if (id == 2)
{
this.energy = value;
}
this.tile.runTime = this.currentItemBurnTime;
if (this.burnTime == -1)
{
this.burnTime = 0;
}
this.tile.tickTime = this.burnTime;
this.tile.setEnergy(this.energy);
}
public int getBurnTimeRemainingScaled(int scale) {
if (burnTime == 0 || this.currentItemBurnTime == 0) {
return 0;
}
return this.burnTime * scale / this.currentItemBurnTime;
}
public int getBurnTimeRemainingScaled(int scale)
{
if (burnTime == 0 || this.currentItemBurnTime == 0)
{
return 0;
}
return this.burnTime * scale / this.currentItemBurnTime;
}
}

View file

@ -9,55 +9,60 @@ import reborncore.common.container.RebornContainer;
import techreborn.api.SlotUpgrade;
import techreborn.tiles.TileScrapboxinator;
public class ContainerScrapboxinator extends RebornContainer {
public class ContainerScrapboxinator extends RebornContainer
{
EntityPlayer player;
EntityPlayer player;
TileScrapboxinator tile;
TileScrapboxinator tile;
public int connectionStatus;
public int connectionStatus;
public ContainerScrapboxinator(TileScrapboxinator tileScrapboxinator, EntityPlayer player) {
super();
tile = tileScrapboxinator;
this.player = player;
public ContainerScrapboxinator(TileScrapboxinator tileScrapboxinator, EntityPlayer player)
{
super();
tile = tileScrapboxinator;
this.player = player;
// input
this.addSlotToContainer(new SlotScrapbox(tileScrapboxinator.inventory, 0, 56, 34));
this.addSlotToContainer(new SlotOutput(tileScrapboxinator.inventory, 1, 116, 34));
// input
this.addSlotToContainer(new SlotScrapbox(tileScrapboxinator.inventory, 0, 56, 34));
this.addSlotToContainer(new SlotOutput(tileScrapboxinator.inventory, 1, 116, 34));
// upgrades
this.addSlotToContainer(new SlotUpgrade(tileScrapboxinator.inventory, 2, 152, 8));
this.addSlotToContainer(new SlotUpgrade(tileScrapboxinator.inventory, 3, 152, 26));
this.addSlotToContainer(new SlotUpgrade(tileScrapboxinator.inventory, 4, 152, 44));
this.addSlotToContainer(new SlotUpgrade(tileScrapboxinator.inventory, 5, 152, 62));
// upgrades
this.addSlotToContainer(new SlotUpgrade(tileScrapboxinator.inventory, 2, 152, 8));
this.addSlotToContainer(new SlotUpgrade(tileScrapboxinator.inventory, 3, 152, 26));
this.addSlotToContainer(new SlotUpgrade(tileScrapboxinator.inventory, 4, 152, 44));
this.addSlotToContainer(new SlotUpgrade(tileScrapboxinator.inventory, 5, 152, 62));
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 p_75145_1_)
{
return true;
}
@Override
public boolean canInteractWith(EntityPlayer p_75145_1_) {
return true;
}
@SideOnly(Side.CLIENT)
@Override
public void updateProgressBar(int id, int value) {
if (id == 10) {
this.connectionStatus = value;
}
}
@SideOnly(Side.CLIENT)
@Override
public void updateProgressBar(int id, int value)
{
if (id == 10)
{
this.connectionStatus = value;
}
}
}

View file

@ -7,40 +7,40 @@ import reborncore.client.gui.SlotOutput;
import reborncore.common.container.RebornContainer;
import techreborn.tiles.generator.TileSemifluidGenerator;
public class ContainerSemifluidGenerator extends RebornContainer {
public TileSemifluidGenerator tileSemifluidGenerator;
public EntityPlayer player;
public class ContainerSemifluidGenerator extends RebornContainer
{
public TileSemifluidGenerator tileSemifluidGenerator;
public EntityPlayer player;
public ContainerSemifluidGenerator(TileSemifluidGenerator tileSemifluidGenerator,
EntityPlayer player) {
super();
this.tileSemifluidGenerator = tileSemifluidGenerator;
this.player = player;
public ContainerSemifluidGenerator(TileSemifluidGenerator tileSemifluidGenerator, EntityPlayer player)
{
super();
this.tileSemifluidGenerator = tileSemifluidGenerator;
this.player = player;
this.addSlotToContainer(new Slot(tileSemifluidGenerator.inventory, 0, 80,
17));
this.addSlotToContainer(new SlotOutput(tileSemifluidGenerator.inventory,
1, 80, 53));
this.addSlotToContainer(new SlotFake(tileSemifluidGenerator.inventory, 2,
59, 42, false, false, 1));
this.addSlotToContainer(new Slot(tileSemifluidGenerator.inventory, 0, 80, 17));
this.addSlotToContainer(new SlotOutput(tileSemifluidGenerator.inventory, 1, 80, 53));
this.addSlotToContainer(new SlotFake(tileSemifluidGenerator.inventory, 2, 59, 42, false, false, 1));
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;
}
}

View file

@ -8,40 +8,40 @@ import reborncore.client.gui.SlotOutput;
import reborncore.common.container.RebornContainer;
import techreborn.tiles.generator.TileThermalGenerator;
public class ContainerThermalGenerator extends RebornContainer {
public TileThermalGenerator tileThermalGenerator;
public EntityPlayer player;
public class ContainerThermalGenerator extends RebornContainer
{
public TileThermalGenerator tileThermalGenerator;
public EntityPlayer player;
public ContainerThermalGenerator(TileThermalGenerator tileThermalGenerator,
EntityPlayer player) {
super();
this.tileThermalGenerator = tileThermalGenerator;
this.player = player;
public ContainerThermalGenerator(TileThermalGenerator tileThermalGenerator, EntityPlayer player)
{
super();
this.tileThermalGenerator = tileThermalGenerator;
this.player = player;
this.addSlotToContainer(new SlotFluid(tileThermalGenerator.inventory, 0, 80,
17));
this.addSlotToContainer(new SlotOutput(tileThermalGenerator.inventory,
1, 80, 53));
this.addSlotToContainer(new SlotFake(tileThermalGenerator.inventory, 2,
59, 42, false, false, 1));
this.addSlotToContainer(new SlotFluid(tileThermalGenerator.inventory, 0, 80, 17));
this.addSlotToContainer(new SlotOutput(tileThermalGenerator.inventory, 1, 80, 53));
this.addSlotToContainer(new SlotFake(tileThermalGenerator.inventory, 2, 59, 42, false, false, 1));
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;
}
}

View file

@ -8,70 +8,79 @@ import net.minecraftforge.fml.relauncher.SideOnly;
import reborncore.client.gui.SlotOutput;
import techreborn.tiles.TileVacuumFreezer;
public class ContainerVacuumFreezer extends ContainerCrafting {
public class ContainerVacuumFreezer extends ContainerCrafting
{
EntityPlayer player;
EntityPlayer player;
TileVacuumFreezer tile;
TileVacuumFreezer tile;
@Override
public boolean canInteractWith(EntityPlayer player) {
return true;
}
@Override
public boolean canInteractWith(EntityPlayer player)
{
return true;
}
public int tickTime;
public int machineStatus;
public int tickTime;
public int machineStatus;
public ContainerVacuumFreezer(TileVacuumFreezer tileAlloysmelter,
EntityPlayer player) {
super(tileAlloysmelter.crafter);
tile = tileAlloysmelter;
this.player = player;
public ContainerVacuumFreezer(TileVacuumFreezer tileAlloysmelter, EntityPlayer player)
{
super(tileAlloysmelter.crafter);
tile = tileAlloysmelter;
this.player = player;
// input
this.addSlotToContainer(new Slot(tileAlloysmelter.inventory, 0, 56, 34));
// outputs
this.addSlotToContainer(new SlotOutput(tileAlloysmelter.inventory, 1, 116, 35));
// input
this.addSlotToContainer(new Slot(tileAlloysmelter.inventory, 0, 56, 34));
// outputs
this.addSlotToContainer(new SlotOutput(tileAlloysmelter.inventory, 1, 116, 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 void detectAndSendChanges() {
super.detectAndSendChanges();
for (int i = 0; i < this.crafters.size(); i++) {
ICrafting icrafting = (ICrafting) this.crafters.get(i);
if (this.machineStatus != tile.multiBlockStatus) {
icrafting.sendProgressBarUpdate(this, 3, tile.multiBlockStatus);
}
}
}
@Override
public void detectAndSendChanges()
{
super.detectAndSendChanges();
for (int i = 0; i < this.crafters.size(); i++)
{
ICrafting icrafting = (ICrafting) this.crafters.get(i);
if (this.machineStatus != tile.multiBlockStatus)
{
icrafting.sendProgressBarUpdate(this, 3, tile.multiBlockStatus);
}
}
}
@Override
public void onCraftGuiOpened(ICrafting crafting) {
super.onCraftGuiOpened(crafting);
crafting.sendProgressBarUpdate(this, 3, tile.multiBlockStatus);
}
@Override
public void onCraftGuiOpened(ICrafting crafting)
{
super.onCraftGuiOpened(crafting);
crafting.sendProgressBarUpdate(this, 3, tile.multiBlockStatus);
}
@SideOnly(Side.CLIENT)
@Override
public void updateProgressBar(int id, int value) {
super.updateProgressBar(id, value);
if (id == 3) {
machineStatus = value;
}
}
@SideOnly(Side.CLIENT)
@Override
public void updateProgressBar(int id, int value)
{
super.updateProgressBar(id, value);
if (id == 3)
{
machineStatus = value;
}
}
}

View file

@ -5,20 +5,25 @@ import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
import techreborn.init.ModItems;
public class SlotScrapbox extends Slot {
public class SlotScrapbox extends Slot
{
public SlotScrapbox(IInventory par1iInventory, int par2, int par3, int par4) {
super(par1iInventory, par2, par3, par4);
}
public SlotScrapbox(IInventory par1iInventory, int par2, int par3, int par4)
{
super(par1iInventory, par2, par3, par4);
}
public boolean isItemValid(ItemStack par1ItemStack) {
if(par1ItemStack.getItem()==ModItems.scrapBox){
return true;
}
return false;
}
public boolean isItemValid(ItemStack par1ItemStack)
{
if (par1ItemStack.getItem() == ModItems.scrapBox)
{
return true;
}
return false;
}
public int getSlotStackLimit() {
return 64;
}
public int getSlotStackLimit()
{
return 64;
}
}