Auto Format code
This commit is contained in:
parent
112b1657cf
commit
796df6c055
503 changed files with 12260 additions and 16291 deletions
|
@ -2,9 +2,9 @@ package techreborn.client.container;
|
|||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IContainerListener;
|
||||
import reborncore.client.gui.BaseSlot;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import reborncore.client.gui.BaseSlot;
|
||||
import reborncore.common.container.RebornContainer;
|
||||
import techreborn.tiles.TileAesu;
|
||||
|
||||
|
|
|
@ -2,14 +2,13 @@ package techreborn.client.container;
|
|||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IContainerListener;
|
||||
import reborncore.client.gui.BaseSlot;
|
||||
import net.minecraft.inventory.SlotFurnaceFuel;
|
||||
import reborncore.client.gui.BaseSlot;
|
||||
import reborncore.client.gui.SlotOutput;
|
||||
import reborncore.common.container.RebornContainer;
|
||||
import techreborn.tiles.TileAlloyFurnace;
|
||||
|
||||
public class ContainerAlloyFurnace extends RebornContainer
|
||||
{
|
||||
public class ContainerAlloyFurnace extends RebornContainer {
|
||||
|
||||
public int tickTime;
|
||||
EntityPlayer player;
|
||||
|
@ -17,8 +16,8 @@ public class ContainerAlloyFurnace extends RebornContainer
|
|||
int currentItemBurnTime;
|
||||
int burnTime;
|
||||
int cookTime;
|
||||
public ContainerAlloyFurnace(TileAlloyFurnace tileAlloyfurnace, EntityPlayer player)
|
||||
{
|
||||
|
||||
public ContainerAlloyFurnace(TileAlloyFurnace tileAlloyfurnace, EntityPlayer player) {
|
||||
tile = tileAlloyfurnace;
|
||||
this.player = player;
|
||||
|
||||
|
@ -32,29 +31,24 @@ public class ContainerAlloyFurnace extends RebornContainer
|
|||
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 3; ++i)
|
||||
{
|
||||
for (int j = 0; j < 9; ++j)
|
||||
{
|
||||
for (i = 0; i < 3; ++i) {
|
||||
for (int j = 0; j < 9; ++j) {
|
||||
this.addSlotToContainer(new BaseSlot(player.inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < 9; ++i)
|
||||
{
|
||||
for (i = 0; i < 9; ++i) {
|
||||
this.addSlotToContainer(new BaseSlot(player.inventory, i, 8 + i * 18, 142));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer player)
|
||||
{
|
||||
public boolean canInteractWith(EntityPlayer player) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addListener(IContainerListener crafting)
|
||||
{
|
||||
public void addListener(IContainerListener crafting) {
|
||||
super.addListener(crafting);
|
||||
crafting.sendProgressBarUpdate(this, 0, tile.currentItemBurnTime);
|
||||
crafting.sendProgressBarUpdate(this, 1, tile.burnTime);
|
||||
|
@ -62,21 +56,16 @@ public class ContainerAlloyFurnace extends RebornContainer
|
|||
}
|
||||
|
||||
@Override
|
||||
public void detectAndSendChanges()
|
||||
{
|
||||
for (int i = 0; i < this.listeners.size(); i++)
|
||||
{
|
||||
public void detectAndSendChanges() {
|
||||
for (int i = 0; i < this.listeners.size(); i++) {
|
||||
IContainerListener crafting = this.listeners.get(i);
|
||||
if (this.currentItemBurnTime != tile.currentItemBurnTime)
|
||||
{
|
||||
if (this.currentItemBurnTime != tile.currentItemBurnTime) {
|
||||
crafting.sendProgressBarUpdate(this, 0, tile.currentItemBurnTime);
|
||||
}
|
||||
if (this.burnTime != tile.burnTime)
|
||||
{
|
||||
if (this.burnTime != tile.burnTime) {
|
||||
crafting.sendProgressBarUpdate(this, 1, tile.burnTime);
|
||||
}
|
||||
if (this.cookTime != tile.cookTime)
|
||||
{
|
||||
if (this.cookTime != tile.cookTime) {
|
||||
crafting.sendProgressBarUpdate(this, 2, tile.cookTime);
|
||||
}
|
||||
}
|
||||
|
@ -84,17 +73,13 @@ public class ContainerAlloyFurnace extends RebornContainer
|
|||
}
|
||||
|
||||
@Override
|
||||
public void updateProgressBar(int id, int value)
|
||||
{
|
||||
public void updateProgressBar(int id, int value) {
|
||||
super.updateProgressBar(id, value);
|
||||
if (id == 0)
|
||||
{
|
||||
if (id == 0) {
|
||||
this.currentItemBurnTime = value;
|
||||
} else if (id == 1)
|
||||
{
|
||||
} else if (id == 1) {
|
||||
this.burnTime = value;
|
||||
} else if (id == 2)
|
||||
{
|
||||
} else if (id == 2) {
|
||||
this.cookTime = value;
|
||||
}
|
||||
this.tile.currentItemBurnTime = this.currentItemBurnTime;
|
||||
|
|
|
@ -13,16 +13,14 @@ import techreborn.tiles.TileAlloySmelter;
|
|||
import javax.annotation.Nullable;
|
||||
import java.util.List;
|
||||
|
||||
public class ContainerAlloySmelter extends ContainerCrafting implements IContainerLayout<TileAlloySmelter>
|
||||
{
|
||||
public class ContainerAlloySmelter extends ContainerCrafting implements IContainerLayout<TileAlloySmelter> {
|
||||
|
||||
public int tickTime;
|
||||
EntityPlayer player;
|
||||
TileAlloySmelter tile;
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer player)
|
||||
{
|
||||
public boolean canInteractWith(EntityPlayer player) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -47,16 +45,13 @@ public class ContainerAlloySmelter extends ContainerCrafting implements IContain
|
|||
public void addPlayerSlots() {
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 3; ++i)
|
||||
{
|
||||
for (int j = 0; j < 9; ++j)
|
||||
{
|
||||
for (i = 0; i < 3; ++i) {
|
||||
for (int j = 0; j < 9; ++j) {
|
||||
this.addSlotToContainer(new BaseSlot(player.inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < 9; ++i)
|
||||
{
|
||||
for (i = 0; i < 9; ++i) {
|
||||
this.addSlotToContainer(new BaseSlot(player.inventory, i, 8 + i * 18, 142));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,21 +7,18 @@ import reborncore.client.gui.BaseSlot;
|
|||
import reborncore.client.gui.SlotOutput;
|
||||
import techreborn.api.gui.SlotUpgrade;
|
||||
import techreborn.tiles.TileAssemblingMachine;
|
||||
import techreborn.tiles.teir1.TileGrinder;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.List;
|
||||
|
||||
public class ContainerAssemblingMachine extends ContainerCrafting implements IContainerLayout<TileAssemblingMachine>
|
||||
{
|
||||
public class ContainerAssemblingMachine extends ContainerCrafting implements IContainerLayout<TileAssemblingMachine> {
|
||||
|
||||
public int tickTime;
|
||||
EntityPlayer player;
|
||||
TileAssemblingMachine tile;
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer player)
|
||||
{
|
||||
public boolean canInteractWith(EntityPlayer player) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -45,16 +42,13 @@ public class ContainerAssemblingMachine extends ContainerCrafting implements ICo
|
|||
public void addPlayerSlots() {
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 3; ++i)
|
||||
{
|
||||
for (int j = 0; j < 9; ++j)
|
||||
{
|
||||
for (i = 0; i < 3; ++i) {
|
||||
for (int j = 0; j < 9; ++j) {
|
||||
this.addSlotToContainer(new BaseSlot(player.inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < 9; ++i)
|
||||
{
|
||||
for (i = 0; i < 9; ++i) {
|
||||
this.addSlotToContainer(new BaseSlot(player.inventory, i, 8 + i * 18, 142));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,15 +2,14 @@ package techreborn.client.container;
|
|||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IContainerListener;
|
||||
import reborncore.client.gui.BaseSlot;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import reborncore.client.gui.BaseSlot;
|
||||
import reborncore.client.gui.SlotCharge;
|
||||
import reborncore.common.container.RebornContainer;
|
||||
import techreborn.tiles.storage.TileBatBox;
|
||||
|
||||
public class ContainerBatbox extends RebornContainer
|
||||
{
|
||||
public class ContainerBatbox extends RebornContainer {
|
||||
|
||||
public int burnTime = 0;
|
||||
public int totalBurnTime = 0;
|
||||
|
@ -19,24 +18,20 @@ public class ContainerBatbox extends RebornContainer
|
|||
EntityPlayer player;
|
||||
TileBatBox tile;
|
||||
|
||||
public ContainerBatbox(TileBatBox tile, EntityPlayer player)
|
||||
{
|
||||
public ContainerBatbox(TileBatBox tile, EntityPlayer player) {
|
||||
super();
|
||||
this.tile = tile;
|
||||
this.player = player;
|
||||
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 3; ++i)
|
||||
{
|
||||
for (int j = 0; j < 9; ++j)
|
||||
{
|
||||
for (i = 0; i < 3; ++i) {
|
||||
for (int j = 0; j < 9; ++j) {
|
||||
this.addSlotToContainer(new BaseSlot(player.inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < 9; ++i)
|
||||
{
|
||||
for (i = 0; i < 9; ++i) {
|
||||
this.addSlotToContainer(new BaseSlot(player.inventory, i, 8 + i * 18, 142));
|
||||
}
|
||||
|
||||
|
@ -45,51 +40,41 @@ public class ContainerBatbox extends RebornContainer
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer player)
|
||||
{
|
||||
public boolean canInteractWith(EntityPlayer player) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void detectAndSendChanges()
|
||||
{
|
||||
public void detectAndSendChanges() {
|
||||
super.detectAndSendChanges();
|
||||
for (int i = 0; i < this.listeners.size(); i++)
|
||||
{
|
||||
for (int i = 0; i < this.listeners.size(); i++) {
|
||||
IContainerListener IContainerListener = this.listeners.get(i);
|
||||
if (this.energy != (int) tile.getEnergy())
|
||||
{
|
||||
if (this.energy != (int) tile.getEnergy()) {
|
||||
IContainerListener.sendProgressBarUpdate(this, 2, (int) tile.getEnergy());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addListener(IContainerListener crafting)
|
||||
{
|
||||
public void addListener(IContainerListener crafting) {
|
||||
super.addListener(crafting);
|
||||
crafting.sendProgressBarUpdate(this, 2, (int) tile.getEnergy());
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void updateProgressBar(int id, int value)
|
||||
{
|
||||
if (id == 0)
|
||||
{
|
||||
public void updateProgressBar(int id, int value) {
|
||||
if (id == 0) {
|
||||
this.burnTime = value;
|
||||
} else if (id == 1)
|
||||
{
|
||||
} else if (id == 1) {
|
||||
this.totalBurnTime = value;
|
||||
} else if (id == 2)
|
||||
{
|
||||
} else if (id == 2) {
|
||||
this.energy = value;
|
||||
}
|
||||
this.tile.setEnergy(energy);
|
||||
}
|
||||
|
||||
public int getScaledBurnTime(int i)
|
||||
{
|
||||
public int getScaledBurnTime(int i) {
|
||||
return (int) (((float) burnTime / (float) totalBurnTime) * i);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,79 +6,67 @@ import reborncore.client.gui.BaseSlot;
|
|||
import reborncore.client.gui.SlotOutput;
|
||||
import techreborn.tiles.multiblock.TileBlastFurnace;
|
||||
|
||||
public class ContainerBlastFurnace extends ContainerCrafting
|
||||
{
|
||||
public class ContainerBlastFurnace extends ContainerCrafting {
|
||||
|
||||
public int heat;
|
||||
public int tickTime;
|
||||
EntityPlayer player;
|
||||
TileBlastFurnace tile;
|
||||
|
||||
public ContainerBlastFurnace(TileBlastFurnace tileblastfurnace, EntityPlayer player)
|
||||
{
|
||||
public ContainerBlastFurnace(TileBlastFurnace tileblastfurnace, EntityPlayer player) {
|
||||
super(tileblastfurnace.crafter);
|
||||
tile = tileblastfurnace;
|
||||
this.player = player;
|
||||
|
||||
// input
|
||||
this.addSlotToContainer(new BaseSlot(tileblastfurnace.inventory, 0, 40, 25));// Input
|
||||
// 1
|
||||
// 1
|
||||
this.addSlotToContainer(new BaseSlot(tileblastfurnace.inventory, 1, 40, 43));// Input
|
||||
// 2
|
||||
// 2
|
||||
// outputs
|
||||
this.addSlotToContainer(new SlotOutput(tileblastfurnace.inventory, 2, 100, 35));// Output
|
||||
// 1
|
||||
// 1
|
||||
this.addSlotToContainer(new SlotOutput(tileblastfurnace.inventory, 3, 118, 35));// Output
|
||||
// 2
|
||||
// 2
|
||||
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 3; ++i)
|
||||
{
|
||||
for (int j = 0; j < 9; ++j)
|
||||
{
|
||||
for (i = 0; i < 3; ++i) {
|
||||
for (int j = 0; j < 9; ++j) {
|
||||
this.addSlotToContainer(new BaseSlot(player.inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < 9; ++i)
|
||||
{
|
||||
for (i = 0; i < 9; ++i) {
|
||||
this.addSlotToContainer(new BaseSlot(player.inventory, i, 8 + i * 18, 142));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer player)
|
||||
{
|
||||
public boolean canInteractWith(EntityPlayer player) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void detectAndSendChanges()
|
||||
{
|
||||
public void detectAndSendChanges() {
|
||||
super.detectAndSendChanges();
|
||||
for (int i = 0; i < this.listeners.size(); i++)
|
||||
{
|
||||
for (int i = 0; i < this.listeners.size(); i++) {
|
||||
IContainerListener IContainerListener = this.listeners.get(i);
|
||||
if (this.heat != tile.getHeat())
|
||||
{
|
||||
if (this.heat != tile.getHeat()) {
|
||||
IContainerListener.sendProgressBarUpdate(this, 10, tile.getHeat());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addListener(IContainerListener crafting)
|
||||
{
|
||||
public void addListener(IContainerListener crafting) {
|
||||
super.addListener(crafting);
|
||||
crafting.sendProgressBarUpdate(this, 10, tile.getHeat());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateProgressBar(int id, int value)
|
||||
{
|
||||
if (id == 10)
|
||||
{
|
||||
public void updateProgressBar(int id, int value) {
|
||||
if (id == 10) {
|
||||
this.heat = value;
|
||||
}
|
||||
super.updateProgressBar(id, value);
|
||||
|
|
|
@ -11,16 +11,14 @@ import techreborn.tiles.TileCentrifuge;
|
|||
import javax.annotation.Nullable;
|
||||
import java.util.List;
|
||||
|
||||
public class ContainerCentrifuge extends ContainerCrafting implements IContainerLayout<TileCentrifuge>
|
||||
{
|
||||
public class ContainerCentrifuge extends ContainerCrafting implements IContainerLayout<TileCentrifuge> {
|
||||
|
||||
public int tickTime;
|
||||
EntityPlayer player;
|
||||
TileCentrifuge tile;
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer player)
|
||||
{
|
||||
public boolean canInteractWith(EntityPlayer player) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -47,16 +45,13 @@ public class ContainerCentrifuge extends ContainerCrafting implements IContainer
|
|||
public void addPlayerSlots() {
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 3; ++i)
|
||||
{
|
||||
for (int j = 0; j < 9; ++j)
|
||||
{
|
||||
for (i = 0; i < 3; ++i) {
|
||||
for (int j = 0; j < 9; ++j) {
|
||||
this.addSlotToContainer(new BaseSlot(player.inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < 9; ++i)
|
||||
{
|
||||
for (i = 0; i < 9; ++i) {
|
||||
this.addSlotToContainer(new BaseSlot(player.inventory, i, 8 + i * 18, 142));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,20 +1,19 @@
|
|||
package techreborn.client.container;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
//import reborncore.client.gui.BaseSlot;
|
||||
import reborncore.client.gui.BaseSlot;
|
||||
import reborncore.common.container.RebornContainer;
|
||||
import techreborn.tiles.TileChargeBench;
|
||||
|
||||
public class ContainerChargeBench extends RebornContainer
|
||||
{
|
||||
//import reborncore.client.gui.BaseSlot;
|
||||
|
||||
public class ContainerChargeBench extends RebornContainer {
|
||||
|
||||
public int tickTime;
|
||||
EntityPlayer player;
|
||||
TileChargeBench tile;
|
||||
|
||||
public ContainerChargeBench(TileChargeBench tileChargeBench, EntityPlayer player)
|
||||
{
|
||||
public ContainerChargeBench(TileChargeBench tileChargeBench, EntityPlayer player) {
|
||||
tile = tileChargeBench;
|
||||
this.player = player;
|
||||
|
||||
|
@ -27,23 +26,19 @@ public class ContainerChargeBench extends RebornContainer
|
|||
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 3; ++i)
|
||||
{
|
||||
for (int j = 0; j < 9; ++j)
|
||||
{
|
||||
for (i = 0; i < 3; ++i) {
|
||||
for (int j = 0; j < 9; ++j) {
|
||||
this.addSlotToContainer(new BaseSlot(player.inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < 9; ++i)
|
||||
{
|
||||
for (i = 0; i < 9; ++i) {
|
||||
this.addSlotToContainer(new BaseSlot(player.inventory, i, 8 + i * 18, 142));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer player)
|
||||
{
|
||||
public boolean canInteractWith(EntityPlayer player) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -6,15 +6,13 @@ import reborncore.client.gui.SlotOutput;
|
|||
import techreborn.api.gui.SlotUpgrade;
|
||||
import techreborn.tiles.TileChemicalReactor;
|
||||
|
||||
public class ContainerChemicalReactor extends ContainerCrafting
|
||||
{
|
||||
public class ContainerChemicalReactor extends ContainerCrafting {
|
||||
|
||||
public int tickTime;
|
||||
EntityPlayer player;
|
||||
TileChemicalReactor tile;
|
||||
|
||||
public ContainerChemicalReactor(TileChemicalReactor tilechemicalReactor, EntityPlayer player)
|
||||
{
|
||||
public ContainerChemicalReactor(TileChemicalReactor tilechemicalReactor, EntityPlayer player) {
|
||||
super(tilechemicalReactor.crafter);
|
||||
tile = tilechemicalReactor;
|
||||
this.player = player;
|
||||
|
@ -34,23 +32,19 @@ public class ContainerChemicalReactor extends ContainerCrafting
|
|||
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 3; ++i)
|
||||
{
|
||||
for (int j = 0; j < 9; ++j)
|
||||
{
|
||||
for (i = 0; i < 3; ++i) {
|
||||
for (int j = 0; j < 9; ++j) {
|
||||
this.addSlotToContainer(new BaseSlot(player.inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < 9; ++i)
|
||||
{
|
||||
for (i = 0; i < 9; ++i) {
|
||||
this.addSlotToContainer(new BaseSlot(player.inventory, i, 8 + i * 18, 142));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer player)
|
||||
{
|
||||
public boolean canInteractWith(EntityPlayer player) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -5,35 +5,29 @@ import reborncore.client.gui.BaseSlot;
|
|||
import reborncore.common.container.RebornContainer;
|
||||
import techreborn.tiles.TileChunkLoader;
|
||||
|
||||
public class ContainerChunkloader extends RebornContainer
|
||||
{
|
||||
public class ContainerChunkloader extends RebornContainer {
|
||||
|
||||
EntityPlayer player;
|
||||
|
||||
public ContainerChunkloader(TileChunkLoader tilechunkloader, EntityPlayer player)
|
||||
{
|
||||
public ContainerChunkloader(TileChunkLoader tilechunkloader, EntityPlayer player) {
|
||||
this.player = player;
|
||||
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 3; ++i)
|
||||
{
|
||||
for (int j = 0; j < 9; ++j)
|
||||
{
|
||||
for (i = 0; i < 3; ++i) {
|
||||
for (int j = 0; j < 9; ++j) {
|
||||
this.addSlotToContainer(new BaseSlot(player.inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < 9; ++i)
|
||||
{
|
||||
for (i = 0; i < 9; ++i) {
|
||||
this.addSlotToContainer(new BaseSlot(player.inventory, i, 8 + i * 18, 142));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer p_75145_1_)
|
||||
{
|
||||
public boolean canInteractWith(EntityPlayer p_75145_1_) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -6,15 +6,13 @@ import reborncore.client.gui.SlotOutput;
|
|||
import techreborn.api.gui.SlotUpgrade;
|
||||
import techreborn.tiles.teir1.TileCompressor;
|
||||
|
||||
public class ContainerCompressor extends ContainerCrafting
|
||||
{
|
||||
public class ContainerCompressor extends ContainerCrafting {
|
||||
|
||||
public int connectionStatus;
|
||||
EntityPlayer player;
|
||||
TileCompressor tile;
|
||||
|
||||
public ContainerCompressor(TileCompressor tileGrinder, EntityPlayer player)
|
||||
{
|
||||
public ContainerCompressor(TileCompressor tileGrinder, EntityPlayer player) {
|
||||
super(tileGrinder.crafter);
|
||||
tile = tileGrinder;
|
||||
this.player = player;
|
||||
|
@ -31,23 +29,19 @@ public class ContainerCompressor extends ContainerCrafting
|
|||
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 3; ++i)
|
||||
{
|
||||
for (int j = 0; j < 9; ++j)
|
||||
{
|
||||
for (i = 0; i < 3; ++i) {
|
||||
for (int j = 0; j < 9; ++j) {
|
||||
this.addSlotToContainer(new BaseSlot(player.inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < 9; ++i)
|
||||
{
|
||||
for (i = 0; i < 9; ++i) {
|
||||
this.addSlotToContainer(new BaseSlot(player.inventory, i, 8 + i * 18, 142));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer p_75145_1_)
|
||||
{
|
||||
public boolean canInteractWith(EntityPlayer p_75145_1_) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,12 +3,10 @@ package techreborn.client.container;
|
|||
import net.minecraft.inventory.IContainerListener;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import reborncore.api.tile.IContainerLayout;
|
||||
import reborncore.common.container.RebornContainer;
|
||||
import reborncore.common.recipes.RecipeCrafter;
|
||||
|
||||
public abstract class ContainerCrafting extends RebornContainer
|
||||
{
|
||||
public abstract class ContainerCrafting extends RebornContainer {
|
||||
|
||||
RecipeCrafter crafter;
|
||||
|
||||
|
@ -16,8 +14,7 @@ public abstract class ContainerCrafting extends RebornContainer
|
|||
int currentNeededTicks = 0;
|
||||
int energy;
|
||||
|
||||
public ContainerCrafting(RecipeCrafter crafter)
|
||||
{
|
||||
public ContainerCrafting(RecipeCrafter crafter) {
|
||||
this();
|
||||
this.crafter = crafter;
|
||||
}
|
||||
|
@ -30,30 +27,24 @@ public abstract class ContainerCrafting extends RebornContainer
|
|||
}
|
||||
|
||||
@Override
|
||||
public void detectAndSendChanges()
|
||||
{
|
||||
public void detectAndSendChanges() {
|
||||
super.detectAndSendChanges();
|
||||
for (int i = 0; i < this.listeners.size(); i++)
|
||||
{
|
||||
for (int i = 0; i < this.listeners.size(); i++) {
|
||||
IContainerListener IContainerListener = this.listeners.get(i);
|
||||
if (this.currentTickTime != crafter.currentTickTime || crafter.currentTickTime == -1)
|
||||
{
|
||||
if (this.currentTickTime != crafter.currentTickTime || crafter.currentTickTime == -1) {
|
||||
IContainerListener.sendProgressBarUpdate(this, 0, crafter.currentTickTime);
|
||||
}
|
||||
if (this.currentNeededTicks != crafter.currentNeededTicks)
|
||||
{
|
||||
if (this.currentNeededTicks != crafter.currentNeededTicks) {
|
||||
IContainerListener.sendProgressBarUpdate(this, 1, crafter.currentNeededTicks);
|
||||
}
|
||||
if (this.energy != (int) crafter.energy.getEnergy())
|
||||
{
|
||||
if (this.energy != (int) crafter.energy.getEnergy()) {
|
||||
IContainerListener.sendProgressBarUpdate(this, 2, (int) crafter.energy.getEnergy());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addListener(IContainerListener crafting)
|
||||
{
|
||||
public void addListener(IContainerListener crafting) {
|
||||
super.addListener(crafting);
|
||||
crafting.sendProgressBarUpdate(this, 0, crafter.currentTickTime);
|
||||
crafting.sendProgressBarUpdate(this, 1, crafter.currentNeededTicks);
|
||||
|
@ -62,20 +53,15 @@ public abstract class ContainerCrafting extends RebornContainer
|
|||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void updateProgressBar(int id, int value)
|
||||
{
|
||||
if (id == 0)
|
||||
{
|
||||
public void updateProgressBar(int id, int value) {
|
||||
if (id == 0) {
|
||||
this.currentTickTime = value;
|
||||
if (this.currentTickTime == -1)
|
||||
{
|
||||
if (this.currentTickTime == -1) {
|
||||
this.currentTickTime = 0;
|
||||
}
|
||||
} else if (id == 1)
|
||||
{
|
||||
} else if (id == 1) {
|
||||
this.currentNeededTicks = value;
|
||||
} else if (id == 2)
|
||||
{
|
||||
} else if (id == 2) {
|
||||
this.energy = value;
|
||||
}
|
||||
this.crafter.currentTickTime = currentTickTime;
|
||||
|
|
|
@ -1,48 +1,41 @@
|
|||
package techreborn.client.container;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import reborncore.client.gui.BaseSlot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import reborncore.client.gui.BaseSlot;
|
||||
import reborncore.client.gui.SlotFilteredVoid;
|
||||
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;
|
||||
|
||||
public ContainerDestructoPack(EntityPlayer player)
|
||||
{
|
||||
public ContainerDestructoPack(EntityPlayer player) {
|
||||
this.player = player;
|
||||
inv = new Inventory(1, "destructopack", 64, null);
|
||||
buildContainer();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer arg0)
|
||||
{
|
||||
public boolean canInteractWith(EntityPlayer arg0) {
|
||||
return true;
|
||||
}
|
||||
|
||||
private void buildContainer()
|
||||
{
|
||||
private void buildContainer() {
|
||||
this.addSlotToContainer(
|
||||
new SlotFilteredVoid(inv, 0, 80, 36, new ItemStack[] { new ItemStack(ModItems.parts, 1, 37) }));
|
||||
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)
|
||||
{
|
||||
for (i = 0; i < 3; ++i) {
|
||||
for (int j = 0; j < 9; ++j) {
|
||||
this.addSlotToContainer(new BaseSlot(player.inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < 9; ++i)
|
||||
{
|
||||
for (i = 0; i < 9; ++i) {
|
||||
this.addSlotToContainer(new BaseSlot(player.inventory, i, 8 + i * 18, 142));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,23 +2,21 @@ package techreborn.client.container;
|
|||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IContainerListener;
|
||||
import reborncore.client.gui.BaseSlot;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import reborncore.client.gui.BaseSlot;
|
||||
import reborncore.client.gui.SlotFake;
|
||||
import reborncore.client.gui.SlotOutput;
|
||||
import reborncore.common.container.RebornContainer;
|
||||
import techreborn.tiles.generator.TileDieselGenerator;
|
||||
|
||||
public class ContainerDieselGenerator extends RebornContainer
|
||||
{
|
||||
public class ContainerDieselGenerator extends RebornContainer {
|
||||
public TileDieselGenerator tiledieselGenerator;
|
||||
public EntityPlayer player;
|
||||
public int energy;
|
||||
public int fluid;
|
||||
|
||||
public ContainerDieselGenerator(TileDieselGenerator tiledieselGenerator, EntityPlayer player)
|
||||
{
|
||||
public ContainerDieselGenerator(TileDieselGenerator tiledieselGenerator, EntityPlayer player) {
|
||||
super();
|
||||
this.tiledieselGenerator = tiledieselGenerator;
|
||||
this.player = player;
|
||||
|
@ -29,47 +27,38 @@ public class ContainerDieselGenerator extends RebornContainer
|
|||
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 3; ++i)
|
||||
{
|
||||
for (int j = 0; j < 9; ++j)
|
||||
{
|
||||
for (i = 0; i < 3; ++i) {
|
||||
for (int j = 0; j < 9; ++j) {
|
||||
this.addSlotToContainer(new BaseSlot(player.inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < 9; ++i)
|
||||
{
|
||||
for (i = 0; i < 9; ++i) {
|
||||
this.addSlotToContainer(new BaseSlot(player.inventory, i, 8 + i * 18, 142));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer player)
|
||||
{
|
||||
public boolean canInteractWith(EntityPlayer player) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void detectAndSendChanges()
|
||||
{
|
||||
public void detectAndSendChanges() {
|
||||
super.detectAndSendChanges();
|
||||
for (int i = 0; i < this.listeners.size(); i++)
|
||||
{
|
||||
for (int i = 0; i < this.listeners.size(); i++) {
|
||||
IContainerListener IContainerListener = this.listeners.get(i);
|
||||
if (this.energy != (int) tiledieselGenerator.getEnergy())
|
||||
{
|
||||
if (this.energy != (int) tiledieselGenerator.getEnergy()) {
|
||||
IContainerListener.sendProgressBarUpdate(this, 0, (int) tiledieselGenerator.getEnergy());
|
||||
}
|
||||
if (this.fluid != tiledieselGenerator.tank.getFluidAmount())
|
||||
{
|
||||
if (this.fluid != tiledieselGenerator.tank.getFluidAmount()) {
|
||||
IContainerListener.sendProgressBarUpdate(this, 1, tiledieselGenerator.tank.getFluidAmount());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addListener(IContainerListener crafting)
|
||||
{
|
||||
public void addListener(IContainerListener crafting) {
|
||||
super.addListener(crafting);
|
||||
crafting.sendProgressBarUpdate(this, 0, (int) tiledieselGenerator.getEnergy());
|
||||
crafting.sendProgressBarUpdate(this, 1, tiledieselGenerator.tank.getFluidAmount());
|
||||
|
@ -77,13 +66,10 @@ public class ContainerDieselGenerator extends RebornContainer
|
|||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void updateProgressBar(int id, int value)
|
||||
{
|
||||
if (id == 0)
|
||||
{
|
||||
public void updateProgressBar(int id, int value) {
|
||||
if (id == 0) {
|
||||
this.energy = value;
|
||||
} else if (id == 1)
|
||||
{
|
||||
} else if (id == 1) {
|
||||
this.fluid = value;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,13 +7,11 @@ import reborncore.client.gui.SlotOutput;
|
|||
import reborncore.common.container.RebornContainer;
|
||||
import techreborn.tiles.TileDigitalChest;
|
||||
|
||||
public class ContainerDigitalChest extends RebornContainer
|
||||
{
|
||||
public class ContainerDigitalChest extends RebornContainer {
|
||||
public TileDigitalChest tileDigitalChest;
|
||||
public EntityPlayer player;
|
||||
|
||||
public ContainerDigitalChest(TileDigitalChest tileDigitalChest, EntityPlayer player)
|
||||
{
|
||||
public ContainerDigitalChest(TileDigitalChest tileDigitalChest, EntityPlayer player) {
|
||||
super();
|
||||
this.tileDigitalChest = tileDigitalChest;
|
||||
this.player = player;
|
||||
|
@ -24,23 +22,19 @@ public class ContainerDigitalChest extends RebornContainer
|
|||
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 3; ++i)
|
||||
{
|
||||
for (int j = 0; j < 9; ++j)
|
||||
{
|
||||
for (i = 0; i < 3; ++i) {
|
||||
for (int j = 0; j < 9; ++j) {
|
||||
this.addSlotToContainer(new BaseSlot(player.inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < 9; ++i)
|
||||
{
|
||||
for (i = 0; i < 9; ++i) {
|
||||
this.addSlotToContainer(new BaseSlot(player.inventory, i, 8 + i * 18, 142));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer player)
|
||||
{
|
||||
public boolean canInteractWith(EntityPlayer player) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,23 +1,21 @@
|
|||
package techreborn.client.container;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import reborncore.client.gui.BaseSlot;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import reborncore.client.gui.BaseSlot;
|
||||
import reborncore.client.gui.SlotOutput;
|
||||
import reborncore.common.container.RebornContainer;
|
||||
import techreborn.api.gui.SlotUpgrade;
|
||||
import techreborn.tiles.teir1.TileElectricFurnace;
|
||||
|
||||
public class ContainerElectricFurnace extends RebornContainer
|
||||
{
|
||||
public class ContainerElectricFurnace extends RebornContainer {
|
||||
|
||||
public int connectionStatus;
|
||||
EntityPlayer player;
|
||||
TileElectricFurnace tile;
|
||||
|
||||
public ContainerElectricFurnace(TileElectricFurnace tileGrinder, EntityPlayer player)
|
||||
{
|
||||
public ContainerElectricFurnace(TileElectricFurnace tileGrinder, EntityPlayer player) {
|
||||
super();
|
||||
tile = tileGrinder;
|
||||
this.player = player;
|
||||
|
@ -34,32 +32,26 @@ public class ContainerElectricFurnace extends RebornContainer
|
|||
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 3; ++i)
|
||||
{
|
||||
for (int j = 0; j < 9; ++j)
|
||||
{
|
||||
for (i = 0; i < 3; ++i) {
|
||||
for (int j = 0; j < 9; ++j) {
|
||||
this.addSlotToContainer(new BaseSlot(player.inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < 9; ++i)
|
||||
{
|
||||
for (i = 0; i < 9; ++i) {
|
||||
this.addSlotToContainer(new BaseSlot(player.inventory, i, 8 + i * 18, 142));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer p_75145_1_)
|
||||
{
|
||||
public boolean canInteractWith(EntityPlayer p_75145_1_) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void updateProgressBar(int id, int value)
|
||||
{
|
||||
if (id == 10)
|
||||
{
|
||||
public void updateProgressBar(int id, int value) {
|
||||
if (id == 10) {
|
||||
this.connectionStatus = value;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,9 +1,5 @@
|
|||
package techreborn.client.container;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import reborncore.api.tile.IContainerLayout;
|
||||
|
@ -13,17 +9,17 @@ import reborncore.client.gui.SlotOutput;
|
|||
import techreborn.api.gui.SlotUpgrade;
|
||||
import techreborn.tiles.teir1.TileExtractor;
|
||||
|
||||
public class ContainerExtractor extends ContainerCrafting implements IContainerLayout<TileExtractor>
|
||||
{
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.List;
|
||||
|
||||
public class ContainerExtractor extends ContainerCrafting implements IContainerLayout<TileExtractor> {
|
||||
|
||||
public int connectionStatus;
|
||||
EntityPlayer player;
|
||||
TileExtractor tileExtractor;
|
||||
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer p_75145_1_)
|
||||
{
|
||||
public boolean canInteractWith(EntityPlayer p_75145_1_) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -38,23 +34,20 @@ public class ContainerExtractor extends ContainerCrafting implements IContainerL
|
|||
this.addSlotToContainer(new SlotUpgrade(tileExtractor.inventory, 2, 152, 8));
|
||||
this.addSlotToContainer(new SlotUpgrade(tileExtractor.inventory, 3, 152, 26));
|
||||
this.addSlotToContainer(new SlotUpgrade(tileExtractor.inventory, 4, 152, 44));
|
||||
this.addSlotToContainer(new SlotUpgrade(tileExtractor.inventory, 5, 152, 62));
|
||||
this.addSlotToContainer(new SlotUpgrade(tileExtractor.inventory, 5, 152, 62));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addPlayerSlots() {
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 3; ++i)
|
||||
{
|
||||
for (int j = 0; j < 9; ++j)
|
||||
{
|
||||
for (i = 0; i < 3; ++i) {
|
||||
for (int j = 0; j < 9; ++j) {
|
||||
this.addSlotToContainer(new BaseSlot(player.inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < 9; ++i)
|
||||
{
|
||||
for (i = 0; i < 9; ++i) {
|
||||
this.addSlotToContainer(new BaseSlot(player.inventory, i, 8 + i * 18, 142));
|
||||
}
|
||||
}
|
||||
|
@ -73,7 +66,7 @@ public class ContainerExtractor extends ContainerCrafting implements IContainerL
|
|||
@Override
|
||||
public void setPlayer(EntityPlayer player) {
|
||||
this.player = player;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -2,15 +2,14 @@ package techreborn.client.container;
|
|||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IContainerListener;
|
||||
import reborncore.client.gui.BaseSlot;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import reborncore.client.gui.BaseSlot;
|
||||
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;
|
||||
|
@ -20,8 +19,7 @@ public class ContainerFusionReactor extends RebornContainer
|
|||
|
||||
TileEntityFusionController fusionController;
|
||||
|
||||
public ContainerFusionReactor(TileEntityFusionController tileEntityFusionController, EntityPlayer player)
|
||||
{
|
||||
public ContainerFusionReactor(TileEntityFusionController tileEntityFusionController, EntityPlayer player) {
|
||||
super();
|
||||
this.fusionController = tileEntityFusionController;
|
||||
|
||||
|
@ -31,60 +29,48 @@ public class ContainerFusionReactor extends RebornContainer
|
|||
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 3; ++i)
|
||||
{
|
||||
for (int j = 0; j < 9; ++j)
|
||||
{
|
||||
for (i = 0; i < 3; ++i) {
|
||||
for (int j = 0; j < 9; ++j) {
|
||||
this.addSlotToContainer(new BaseSlot(player.inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < 9; ++i)
|
||||
{
|
||||
for (i = 0; i < 9; ++i) {
|
||||
this.addSlotToContainer(new BaseSlot(player.inventory, i, 8 + i * 18, 142));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer player)
|
||||
{
|
||||
public boolean canInteractWith(EntityPlayer player) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void detectAndSendChanges()
|
||||
{
|
||||
public void detectAndSendChanges() {
|
||||
super.detectAndSendChanges();
|
||||
for (int i = 0; i < this.listeners.size(); i++)
|
||||
{
|
||||
for (int i = 0; i < this.listeners.size(); i++) {
|
||||
IContainerListener IContainerListener = this.listeners.get(i);
|
||||
if (this.coilStatus != fusionController.coilStatus)
|
||||
{
|
||||
if (this.coilStatus != fusionController.coilStatus) {
|
||||
IContainerListener.sendProgressBarUpdate(this, 0, fusionController.coilStatus);
|
||||
}
|
||||
if (this.energy != (int) fusionController.getEnergy())
|
||||
{
|
||||
if (this.energy != (int) fusionController.getEnergy()) {
|
||||
IContainerListener.sendProgressBarUpdate(this, 1, (int) fusionController.getEnergy());
|
||||
}
|
||||
if (this.tickTime != fusionController.crafingTickTime)
|
||||
{
|
||||
if (this.tickTime != fusionController.crafingTickTime) {
|
||||
IContainerListener.sendProgressBarUpdate(this, 2, fusionController.crafingTickTime);
|
||||
}
|
||||
if (this.finalTickTime != fusionController.finalTickTime)
|
||||
{
|
||||
if (this.finalTickTime != fusionController.finalTickTime) {
|
||||
IContainerListener.sendProgressBarUpdate(this, 3, fusionController.finalTickTime);
|
||||
}
|
||||
if (this.neededEU != fusionController.neededPower)
|
||||
{
|
||||
if (this.neededEU != fusionController.neededPower) {
|
||||
IContainerListener.sendProgressBarUpdate(this, 4, fusionController.neededPower);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addListener(IContainerListener crafting)
|
||||
{
|
||||
public void addListener(IContainerListener crafting) {
|
||||
super.addListener(crafting);
|
||||
crafting.sendProgressBarUpdate(this, 0, fusionController.coilStatus);
|
||||
crafting.sendProgressBarUpdate(this, 1, (int) fusionController.getEnergy());
|
||||
|
@ -95,41 +81,31 @@ public class ContainerFusionReactor extends RebornContainer
|
|||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void updateProgressBar(int id, int value)
|
||||
{
|
||||
if (id == 0)
|
||||
{
|
||||
public void updateProgressBar(int id, int value) {
|
||||
if (id == 0) {
|
||||
this.coilStatus = value;
|
||||
} else if (id == 1)
|
||||
{
|
||||
} else if (id == 1) {
|
||||
this.energy = value;
|
||||
} else if (id == 2)
|
||||
{
|
||||
} else if (id == 2) {
|
||||
this.tickTime = value;
|
||||
} else if (id == 3)
|
||||
{
|
||||
} else if (id == 3) {
|
||||
this.finalTickTime = value;
|
||||
} else if (id == 4)
|
||||
{
|
||||
} else if (id == 4) {
|
||||
this.neededEU = value;
|
||||
}
|
||||
if (tickTime == -1)
|
||||
{
|
||||
if (tickTime == -1) {
|
||||
tickTime = 0;
|
||||
}
|
||||
if (finalTickTime == -1)
|
||||
{
|
||||
if (finalTickTime == -1) {
|
||||
finalTickTime = 0;
|
||||
}
|
||||
if (neededEU == -1)
|
||||
{
|
||||
if (neededEU == -1) {
|
||||
neededEU = 0;
|
||||
}
|
||||
}
|
||||
|
||||
public int getProgressScaled()
|
||||
{
|
||||
public int getProgressScaled() {
|
||||
return Math.max(0, Math.min(24,
|
||||
(this.tickTime > 0 ? 1 : 0) + this.tickTime * 24 / (this.finalTickTime < 1 ? 1 : this.finalTickTime)));
|
||||
(this.tickTime > 0 ? 1 : 0) + this.tickTime * 24 / (this.finalTickTime < 1 ? 1 : this.finalTickTime)));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,13 +7,11 @@ import reborncore.client.gui.SlotOutput;
|
|||
import reborncore.common.container.RebornContainer;
|
||||
import techreborn.tiles.generator.TileGasTurbine;
|
||||
|
||||
public class ContainerGasTurbine extends RebornContainer
|
||||
{
|
||||
public class ContainerGasTurbine extends RebornContainer {
|
||||
public TileGasTurbine tileGasTurbine;
|
||||
public EntityPlayer player;
|
||||
|
||||
public ContainerGasTurbine(TileGasTurbine tileGasTurbine, EntityPlayer player)
|
||||
{
|
||||
public ContainerGasTurbine(TileGasTurbine tileGasTurbine, EntityPlayer player) {
|
||||
super();
|
||||
this.tileGasTurbine = tileGasTurbine;
|
||||
this.player = player;
|
||||
|
@ -24,23 +22,19 @@ public class ContainerGasTurbine extends RebornContainer
|
|||
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 3; ++i)
|
||||
{
|
||||
for (int j = 0; j < 9; ++j)
|
||||
{
|
||||
for (i = 0; i < 3; ++i) {
|
||||
for (int j = 0; j < 9; ++j) {
|
||||
this.addSlotToContainer(new BaseSlot(player.inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < 9; ++i)
|
||||
{
|
||||
for (i = 0; i < 9; ++i) {
|
||||
this.addSlotToContainer(new BaseSlot(player.inventory, i, 8 + i * 18, 142));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer player)
|
||||
{
|
||||
public boolean canInteractWith(EntityPlayer player) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,16 +2,15 @@ package techreborn.client.container;
|
|||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IContainerListener;
|
||||
import reborncore.client.gui.BaseSlot;
|
||||
import net.minecraft.inventory.SlotFurnaceFuel;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import reborncore.client.gui.BaseSlot;
|
||||
import reborncore.client.gui.SlotCharge;
|
||||
import reborncore.common.container.RebornContainer;
|
||||
import techreborn.tiles.generator.TileGenerator;
|
||||
|
||||
public class ContainerGenerator extends RebornContainer
|
||||
{
|
||||
public class ContainerGenerator extends RebornContainer {
|
||||
|
||||
public int burnTime = 0;
|
||||
public int totalBurnTime = 0;
|
||||
|
@ -20,8 +19,7 @@ public class ContainerGenerator extends RebornContainer
|
|||
EntityPlayer player;
|
||||
TileGenerator tile;
|
||||
|
||||
public ContainerGenerator(TileGenerator tile, EntityPlayer player)
|
||||
{
|
||||
public ContainerGenerator(TileGenerator tile, EntityPlayer player) {
|
||||
super();
|
||||
this.tile = tile;
|
||||
this.player = player;
|
||||
|
@ -33,51 +31,41 @@ public class ContainerGenerator extends RebornContainer
|
|||
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 3; ++i)
|
||||
{
|
||||
for (int j = 0; j < 9; ++j)
|
||||
{
|
||||
for (i = 0; i < 3; ++i) {
|
||||
for (int j = 0; j < 9; ++j) {
|
||||
this.addSlotToContainer(new BaseSlot(player.inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < 9; ++i)
|
||||
{
|
||||
for (i = 0; i < 9; ++i) {
|
||||
this.addSlotToContainer(new BaseSlot(player.inventory, i, 8 + i * 18, 142));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer player)
|
||||
{
|
||||
public boolean canInteractWith(EntityPlayer player) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void detectAndSendChanges()
|
||||
{
|
||||
public void detectAndSendChanges() {
|
||||
super.detectAndSendChanges();
|
||||
for (int i = 0; i < this.listeners.size(); i++)
|
||||
{
|
||||
for (int i = 0; i < this.listeners.size(); i++) {
|
||||
IContainerListener IContainerListener = this.listeners.get(i);
|
||||
if (this.burnTime != tile.burnTime)
|
||||
{
|
||||
if (this.burnTime != tile.burnTime) {
|
||||
IContainerListener.sendProgressBarUpdate(this, 0, tile.burnTime);
|
||||
}
|
||||
if (this.totalBurnTime != tile.totalBurnTime)
|
||||
{
|
||||
if (this.totalBurnTime != tile.totalBurnTime) {
|
||||
IContainerListener.sendProgressBarUpdate(this, 1, tile.totalBurnTime);
|
||||
}
|
||||
if (this.energy != (int) tile.getEnergy())
|
||||
{
|
||||
if (this.energy != (int) tile.getEnergy()) {
|
||||
IContainerListener.sendProgressBarUpdate(this, 2, (int) tile.getEnergy());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addListener(IContainerListener crafting)
|
||||
{
|
||||
public void addListener(IContainerListener crafting) {
|
||||
super.addListener(crafting);
|
||||
crafting.sendProgressBarUpdate(this, 0, tile.burnTime);
|
||||
crafting.sendProgressBarUpdate(this, 1, tile.totalBurnTime);
|
||||
|
@ -86,23 +74,18 @@ public class ContainerGenerator extends RebornContainer
|
|||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void updateProgressBar(int id, int value)
|
||||
{
|
||||
if (id == 0)
|
||||
{
|
||||
public void updateProgressBar(int id, int value) {
|
||||
if (id == 0) {
|
||||
this.burnTime = value;
|
||||
} else if (id == 1)
|
||||
{
|
||||
} else if (id == 1) {
|
||||
this.totalBurnTime = value;
|
||||
} else if (id == 2)
|
||||
{
|
||||
} else if (id == 2) {
|
||||
this.energy = value;
|
||||
}
|
||||
this.tile.setEnergy(energy);
|
||||
}
|
||||
|
||||
public int getScaledBurnTime(int i)
|
||||
{
|
||||
public int getScaledBurnTime(int i) {
|
||||
return (int) (((float) burnTime / (float) totalBurnTime) * i);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,33 +1,28 @@
|
|||
package techreborn.client.container;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import reborncore.api.tile.IContainerLayout;
|
||||
import reborncore.client.gui.BaseSlot;
|
||||
import reborncore.client.gui.SlotInput;
|
||||
import reborncore.client.gui.SlotOutput;
|
||||
import reborncore.common.recipes.RecipeCrafter;
|
||||
import techreborn.api.gui.SlotUpgrade;
|
||||
import techreborn.tiles.teir1.TileGrinder;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.List;
|
||||
|
||||
public class ContainerGrinder extends ContainerCrafting implements IContainerLayout<TileGrinder>
|
||||
{
|
||||
public class ContainerGrinder extends ContainerCrafting implements IContainerLayout<TileGrinder> {
|
||||
|
||||
public int connectionStatus;
|
||||
EntityPlayer player;
|
||||
TileGrinder tile;
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer p_75145_1_)
|
||||
{
|
||||
public boolean canInteractWith(EntityPlayer p_75145_1_) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void addInventorySlots() {
|
||||
// input
|
||||
|
@ -45,16 +40,13 @@ public class ContainerGrinder extends ContainerCrafting implements IContainerLay
|
|||
public void addPlayerSlots() {
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 3; ++i)
|
||||
{
|
||||
for (int j = 0; j < 9; ++j)
|
||||
{
|
||||
for (i = 0; i < 3; ++i) {
|
||||
for (int j = 0; j < 9; ++j) {
|
||||
this.addSlotToContainer(new BaseSlot(player.inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < 9; ++i)
|
||||
{
|
||||
for (i = 0; i < 9; ++i) {
|
||||
this.addSlotToContainer(new BaseSlot(player.inventory, i, 8 + i * 18, 142));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,9 +2,9 @@ package techreborn.client.container;
|
|||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IContainerListener;
|
||||
import reborncore.client.gui.BaseSlot;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import reborncore.client.gui.BaseSlot;
|
||||
import reborncore.common.container.RebornContainer;
|
||||
import techreborn.tiles.idsu.TileIDSU;
|
||||
|
||||
|
|
|
@ -2,22 +2,20 @@ package techreborn.client.container;
|
|||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IContainerListener;
|
||||
import reborncore.client.gui.BaseSlot;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import reborncore.client.gui.BaseSlot;
|
||||
import reborncore.client.gui.SlotOutput;
|
||||
import techreborn.tiles.multiblock.TileImplosionCompressor;
|
||||
|
||||
public class ContainerImplosionCompressor extends ContainerCrafting
|
||||
{
|
||||
public class ContainerImplosionCompressor extends ContainerCrafting {
|
||||
|
||||
public int tickTime;
|
||||
public int multIBlockState = 0;
|
||||
EntityPlayer player;
|
||||
TileImplosionCompressor tile;
|
||||
|
||||
public ContainerImplosionCompressor(TileImplosionCompressor tilecompressor, EntityPlayer player)
|
||||
{
|
||||
public ContainerImplosionCompressor(TileImplosionCompressor tilecompressor, EntityPlayer player) {
|
||||
super(tilecompressor.crafter);
|
||||
tile = tilecompressor;
|
||||
this.player = player;
|
||||
|
@ -31,59 +29,48 @@ public class ContainerImplosionCompressor extends ContainerCrafting
|
|||
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 3; ++i)
|
||||
{
|
||||
for (int j = 0; j < 9; ++j)
|
||||
{
|
||||
for (i = 0; i < 3; ++i) {
|
||||
for (int j = 0; j < 9; ++j) {
|
||||
this.addSlotToContainer(new BaseSlot(player.inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < 9; ++i)
|
||||
{
|
||||
for (i = 0; i < 9; ++i) {
|
||||
this.addSlotToContainer(new BaseSlot(player.inventory, i, 8 + i * 18, 142));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer p_75145_1_)
|
||||
{
|
||||
public boolean canInteractWith(EntityPlayer p_75145_1_) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void detectAndSendChanges()
|
||||
{
|
||||
public void detectAndSendChanges() {
|
||||
super.detectAndSendChanges();
|
||||
for (int i = 0; i < this.listeners.size(); i++)
|
||||
{
|
||||
for (int i = 0; i < this.listeners.size(); i++) {
|
||||
IContainerListener IContainerListener = this.listeners.get(i);
|
||||
if (this.multIBlockState != getMultIBlockStateint())
|
||||
{
|
||||
if (this.multIBlockState != getMultIBlockStateint()) {
|
||||
IContainerListener.sendProgressBarUpdate(this, 3, getMultIBlockStateint());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addListener(IContainerListener crafting)
|
||||
{
|
||||
public void addListener(IContainerListener crafting) {
|
||||
super.addListener(crafting);
|
||||
crafting.sendProgressBarUpdate(this, 3, getMultIBlockStateint());
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void updateProgressBar(int id, int value)
|
||||
{
|
||||
if (id == 3)
|
||||
{
|
||||
public void updateProgressBar(int id, int value) {
|
||||
if (id == 3) {
|
||||
this.multIBlockState = value;
|
||||
}
|
||||
}
|
||||
|
||||
public int getMultIBlockStateint()
|
||||
{
|
||||
public int getMultIBlockStateint() {
|
||||
return tile.getMutliBlock() ? 1 : 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -5,15 +5,13 @@ import reborncore.client.gui.BaseSlot;
|
|||
import reborncore.client.gui.SlotOutput;
|
||||
import techreborn.tiles.TileIndustrialElectrolyzer;
|
||||
|
||||
public class ContainerIndustrialElectrolyzer extends ContainerCrafting
|
||||
{
|
||||
public class ContainerIndustrialElectrolyzer extends ContainerCrafting {
|
||||
|
||||
public int tickTime;
|
||||
EntityPlayer player;
|
||||
TileIndustrialElectrolyzer tile;
|
||||
|
||||
public ContainerIndustrialElectrolyzer(TileIndustrialElectrolyzer electrolyzer, EntityPlayer player)
|
||||
{
|
||||
public ContainerIndustrialElectrolyzer(TileIndustrialElectrolyzer electrolyzer, EntityPlayer player) {
|
||||
super(electrolyzer.crafter);
|
||||
tile = electrolyzer;
|
||||
this.player = player;
|
||||
|
@ -31,23 +29,19 @@ public class ContainerIndustrialElectrolyzer extends ContainerCrafting
|
|||
this.addSlotToContainer(new BaseSlot(electrolyzer.inventory, 6, 18, 51));
|
||||
|
||||
int i;
|
||||
for (i = 0; i < 3; ++i)
|
||||
{
|
||||
for (int j = 0; j < 9; ++j)
|
||||
{
|
||||
for (i = 0; i < 3; ++i) {
|
||||
for (int j = 0; j < 9; ++j) {
|
||||
this.addSlotToContainer(new BaseSlot(player.inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < 9; ++i)
|
||||
{
|
||||
for (i = 0; i < 9; ++i) {
|
||||
this.addSlotToContainer(new BaseSlot(player.inventory, i, 8 + i * 18, 142));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer player)
|
||||
{
|
||||
public boolean canInteractWith(EntityPlayer player) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,49 +1,45 @@
|
|||
package techreborn.client.container;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IContainerListener;
|
||||
import reborncore.client.gui.BaseSlot;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import reborncore.client.gui.SlotOutput;
|
||||
import techreborn.tiles.multiblock.TileIndustrialGrinder;
|
||||
|
||||
public class ContainerIndustrialGrinder extends ContainerCrafting {
|
||||
|
||||
EntityPlayer player;
|
||||
TileIndustrialGrinder tile;
|
||||
EntityPlayer player;
|
||||
TileIndustrialGrinder tile;
|
||||
|
||||
public ContainerIndustrialGrinder(TileIndustrialGrinder tileGrinder, EntityPlayer player) {
|
||||
super(tileGrinder.getRecipeCrafter());
|
||||
tile = tileGrinder;
|
||||
this.player = player;
|
||||
public ContainerIndustrialGrinder(TileIndustrialGrinder tileGrinder, EntityPlayer player) {
|
||||
super(tileGrinder.getRecipeCrafter());
|
||||
tile = tileGrinder;
|
||||
this.player = player;
|
||||
|
||||
// input
|
||||
this.addSlotToContainer(new BaseSlot(tileGrinder.inventory, 0, 32, 26));
|
||||
this.addSlotToContainer(new BaseSlot(tileGrinder.inventory, 1, 32, 44));
|
||||
// input
|
||||
this.addSlotToContainer(new BaseSlot(tileGrinder.inventory, 0, 32, 26));
|
||||
this.addSlotToContainer(new BaseSlot(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));
|
||||
|
||||
for (int i = 0; i < 3; ++i) {
|
||||
for (int j = 0; j < 9; ++j) {
|
||||
this.addSlotToContainer(new BaseSlot(player.inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < 3; ++i) {
|
||||
for (int j = 0; j < 9; ++j) {
|
||||
this.addSlotToContainer(new BaseSlot(player.inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < 9; ++i) {
|
||||
this.addSlotToContainer(new BaseSlot(player.inventory, i, 8 + i * 18, 142));
|
||||
}
|
||||
for (int i = 0; i < 9; ++i) {
|
||||
this.addSlotToContainer(new BaseSlot(player.inventory, i, 8 + i * 18, 142));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer player) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer player) {
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -8,39 +8,36 @@ import techreborn.tiles.multiblock.TileIndustrialSawmill;
|
|||
|
||||
public class ContainerIndustrialSawmill extends RebornContainer {
|
||||
|
||||
public int tickTime;
|
||||
EntityPlayer player;
|
||||
TileIndustrialSawmill tile;
|
||||
public int tickTime;
|
||||
EntityPlayer player;
|
||||
TileIndustrialSawmill tile;
|
||||
|
||||
public ContainerIndustrialSawmill(TileIndustrialSawmill tileIndustrialSawmill, EntityPlayer player) {
|
||||
tile = tileIndustrialSawmill;
|
||||
this.player = player;
|
||||
public ContainerIndustrialSawmill(TileIndustrialSawmill tileIndustrialSawmill, EntityPlayer player) {
|
||||
tile = tileIndustrialSawmill;
|
||||
this.player = player;
|
||||
|
||||
// input
|
||||
this.addSlotToContainer(new BaseSlot(tileIndustrialSawmill.inventory, 0, 32, 26));
|
||||
this.addSlotToContainer(new BaseSlot(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 BaseSlot(tileIndustrialSawmill.inventory, 0, 32, 26));
|
||||
this.addSlotToContainer(new BaseSlot(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));
|
||||
|
||||
for (int i = 0; i < 3; ++i) {
|
||||
for (int j = 0; j < 9; ++j) {
|
||||
this.addSlotToContainer(new BaseSlot(player.inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < 3; ++i) {
|
||||
for (int j = 0; j < 9; ++j) {
|
||||
this.addSlotToContainer(new BaseSlot(player.inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < 9; ++i) {
|
||||
this.addSlotToContainer(new BaseSlot(player.inventory, i, 8 + i * 18, 142));
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < 9; ++i) {
|
||||
this.addSlotToContainer(new BaseSlot(player.inventory, i, 8 + i * 18, 142));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer player) {
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer player) {
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,23 +1,21 @@
|
|||
package techreborn.client.container;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import reborncore.client.gui.BaseSlot;
|
||||
import net.minecraft.inventory.SlotFurnaceFuel;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import reborncore.client.gui.BaseSlot;
|
||||
import reborncore.client.gui.SlotOutput;
|
||||
import reborncore.common.container.RebornContainer;
|
||||
import techreborn.tiles.TileIronFurnace;
|
||||
|
||||
public class ContainerIronFurnace extends RebornContainer
|
||||
{
|
||||
public class ContainerIronFurnace extends RebornContainer {
|
||||
|
||||
public int connectionStatus;
|
||||
EntityPlayer player;
|
||||
TileIronFurnace tile;
|
||||
|
||||
public ContainerIronFurnace(TileIronFurnace tileGrinder, EntityPlayer player)
|
||||
{
|
||||
public ContainerIronFurnace(TileIronFurnace tileGrinder, EntityPlayer player) {
|
||||
super();
|
||||
tile = tileGrinder;
|
||||
this.player = player;
|
||||
|
@ -30,32 +28,26 @@ public class ContainerIronFurnace extends RebornContainer
|
|||
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 3; ++i)
|
||||
{
|
||||
for (int j = 0; j < 9; ++j)
|
||||
{
|
||||
for (i = 0; i < 3; ++i) {
|
||||
for (int j = 0; j < 9; ++j) {
|
||||
this.addSlotToContainer(new BaseSlot(player.inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < 9; ++i)
|
||||
{
|
||||
for (i = 0; i < 9; ++i) {
|
||||
this.addSlotToContainer(new BaseSlot(player.inventory, i, 8 + i * 18, 142));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer player)
|
||||
{
|
||||
public boolean canInteractWith(EntityPlayer player) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void updateProgressBar(int id, int value)
|
||||
{
|
||||
if (id == 10)
|
||||
{
|
||||
public void updateProgressBar(int id, int value) {
|
||||
if (id == 10) {
|
||||
this.connectionStatus = value;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,9 +2,9 @@ package techreborn.client.container;
|
|||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IContainerListener;
|
||||
import reborncore.client.gui.BaseSlot;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import reborncore.client.gui.BaseSlot;
|
||||
import reborncore.common.container.RebornContainer;
|
||||
import techreborn.config.ConfigTechReborn;
|
||||
import techreborn.tiles.lesu.TileLesu;
|
||||
|
|
|
@ -7,17 +7,15 @@ package techreborn.client.container;
|
|||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.EntityEquipmentSlot;
|
||||
import net.minecraft.inventory.IContainerListener;
|
||||
import reborncore.client.gui.BaseSlot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import reborncore.client.gui.BaseSlot;
|
||||
import reborncore.client.gui.SlotCharge;
|
||||
import reborncore.common.container.RebornContainer;
|
||||
import techreborn.tiles.storage.TileMFE;
|
||||
|
||||
|
||||
public class ContainerMFE extends RebornContainer
|
||||
{
|
||||
public class ContainerMFE extends RebornContainer {
|
||||
|
||||
public int burnTime = 0;
|
||||
public int totalBurnTime = 0;
|
||||
|
@ -25,37 +23,32 @@ public class ContainerMFE extends RebornContainer
|
|||
public int tickTime;
|
||||
EntityPlayer player;
|
||||
TileMFE tile;
|
||||
private static final EntityEquipmentSlot[] equipmentSlots = new EntityEquipmentSlot[] {EntityEquipmentSlot.HEAD, EntityEquipmentSlot.CHEST, EntityEquipmentSlot.LEGS, EntityEquipmentSlot.FEET};
|
||||
public ContainerMFE(TileMFE tile, EntityPlayer player)
|
||||
{
|
||||
private static final EntityEquipmentSlot[] equipmentSlots = new EntityEquipmentSlot[] { EntityEquipmentSlot.HEAD, EntityEquipmentSlot.CHEST, EntityEquipmentSlot.LEGS, EntityEquipmentSlot.FEET };
|
||||
|
||||
public ContainerMFE(TileMFE tile, EntityPlayer player) {
|
||||
super();
|
||||
this.tile = tile;
|
||||
this.player = player;
|
||||
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 3; ++i)
|
||||
{
|
||||
for (int j = 0; j < 9; ++j)
|
||||
{
|
||||
for (i = 0; i < 3; ++i) {
|
||||
for (int j = 0; j < 9; ++j) {
|
||||
this.addSlotToContainer(new BaseSlot(player.inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < 9; ++i)
|
||||
{
|
||||
for (i = 0; i < 9; ++i) {
|
||||
this.addSlotToContainer(new BaseSlot(player.inventory, i, 8 + i * 18, 142));
|
||||
}
|
||||
for (int k = 0; k < 4; k++)
|
||||
{
|
||||
for (int k = 0; k < 4; k++) {
|
||||
final EntityEquipmentSlot slot = equipmentSlots[k];
|
||||
addSlotToContainer(new BaseSlot(player.inventory, player.inventory.getSizeInventory() - 2 - k, 44, 6 + k * 19)
|
||||
{
|
||||
addSlotToContainer(new BaseSlot(player.inventory, player.inventory.getSizeInventory() - 2 - k, 44, 6 + k * 19) {
|
||||
@Override
|
||||
public int getSlotStackLimit() { return 1; }
|
||||
|
||||
@Override
|
||||
public boolean isItemValid(ItemStack stack)
|
||||
{
|
||||
public boolean isItemValid(ItemStack stack) {
|
||||
return stack != null && stack.getItem().isValidArmor(stack, slot, player);
|
||||
}
|
||||
});
|
||||
|
@ -65,51 +58,41 @@ public class ContainerMFE extends RebornContainer
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer player)
|
||||
{
|
||||
public boolean canInteractWith(EntityPlayer player) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void detectAndSendChanges()
|
||||
{
|
||||
public void detectAndSendChanges() {
|
||||
super.detectAndSendChanges();
|
||||
for (int i = 0; i < this.listeners.size(); i++)
|
||||
{
|
||||
for (int i = 0; i < this.listeners.size(); i++) {
|
||||
IContainerListener IContainerListener = this.listeners.get(i);
|
||||
if (this.energy != (int) tile.getEnergy())
|
||||
{
|
||||
if (this.energy != (int) tile.getEnergy()) {
|
||||
IContainerListener.sendProgressBarUpdate(this, 2, (int) tile.getEnergy());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addListener(IContainerListener crafting)
|
||||
{
|
||||
public void addListener(IContainerListener crafting) {
|
||||
super.addListener(crafting);
|
||||
crafting.sendProgressBarUpdate(this, 2, (int) tile.getEnergy());
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void updateProgressBar(int id, int value)
|
||||
{
|
||||
if (id == 0)
|
||||
{
|
||||
public void updateProgressBar(int id, int value) {
|
||||
if (id == 0) {
|
||||
this.burnTime = value;
|
||||
} else if (id == 1)
|
||||
{
|
||||
} else if (id == 1) {
|
||||
this.totalBurnTime = value;
|
||||
} else if (id == 2)
|
||||
{
|
||||
} else if (id == 2) {
|
||||
this.energy = value;
|
||||
}
|
||||
this.tile.setEnergy(energy);
|
||||
}
|
||||
|
||||
public int getScaledBurnTime(int i)
|
||||
{
|
||||
public int getScaledBurnTime(int i) {
|
||||
return (int) (((float) burnTime / (float) totalBurnTime) * i);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,16 +3,15 @@ package techreborn.client.container;
|
|||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.EntityEquipmentSlot;
|
||||
import net.minecraft.inventory.IContainerListener;
|
||||
import reborncore.client.gui.BaseSlot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import reborncore.client.gui.BaseSlot;
|
||||
import reborncore.client.gui.SlotCharge;
|
||||
import reborncore.common.container.RebornContainer;
|
||||
import techreborn.tiles.storage.TileMFSU;
|
||||
|
||||
public class ContainerMFSU extends RebornContainer
|
||||
{
|
||||
public class ContainerMFSU extends RebornContainer {
|
||||
|
||||
public int burnTime = 0;
|
||||
public int totalBurnTime = 0;
|
||||
|
@ -20,37 +19,32 @@ public class ContainerMFSU extends RebornContainer
|
|||
public int tickTime;
|
||||
EntityPlayer player;
|
||||
TileMFSU tile;
|
||||
private static final EntityEquipmentSlot[] equipmentSlots = new EntityEquipmentSlot[] {EntityEquipmentSlot.HEAD, EntityEquipmentSlot.CHEST, EntityEquipmentSlot.LEGS, EntityEquipmentSlot.FEET};
|
||||
public ContainerMFSU(TileMFSU tile, EntityPlayer player)
|
||||
{
|
||||
private static final EntityEquipmentSlot[] equipmentSlots = new EntityEquipmentSlot[] { EntityEquipmentSlot.HEAD, EntityEquipmentSlot.CHEST, EntityEquipmentSlot.LEGS, EntityEquipmentSlot.FEET };
|
||||
|
||||
public ContainerMFSU(TileMFSU tile, EntityPlayer player) {
|
||||
super();
|
||||
this.tile = tile;
|
||||
this.player = player;
|
||||
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 3; ++i)
|
||||
{
|
||||
for (int j = 0; j < 9; ++j)
|
||||
{
|
||||
for (i = 0; i < 3; ++i) {
|
||||
for (int j = 0; j < 9; ++j) {
|
||||
this.addSlotToContainer(new BaseSlot(player.inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < 9; ++i)
|
||||
{
|
||||
for (i = 0; i < 9; ++i) {
|
||||
this.addSlotToContainer(new BaseSlot(player.inventory, i, 8 + i * 18, 142));
|
||||
}
|
||||
for (int k = 0; k < 4; k++)
|
||||
{
|
||||
for (int k = 0; k < 4; k++) {
|
||||
final EntityEquipmentSlot slot = equipmentSlots[k];
|
||||
addSlotToContainer(new BaseSlot(player.inventory, player.inventory.getSizeInventory() - 2 - k, 44, 6 + k * 19)
|
||||
{
|
||||
addSlotToContainer(new BaseSlot(player.inventory, player.inventory.getSizeInventory() - 2 - k, 44, 6 + k * 19) {
|
||||
@Override
|
||||
public int getSlotStackLimit() { return 1; }
|
||||
|
||||
@Override
|
||||
public boolean isItemValid(ItemStack stack)
|
||||
{
|
||||
public boolean isItemValid(ItemStack stack) {
|
||||
return stack != null && stack.getItem().isValidArmor(stack, slot, player);
|
||||
}
|
||||
});
|
||||
|
@ -60,51 +54,41 @@ public class ContainerMFSU extends RebornContainer
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer player)
|
||||
{
|
||||
public boolean canInteractWith(EntityPlayer player) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void detectAndSendChanges()
|
||||
{
|
||||
public void detectAndSendChanges() {
|
||||
super.detectAndSendChanges();
|
||||
for (int i = 0; i < this.listeners.size(); i++)
|
||||
{
|
||||
for (int i = 0; i < this.listeners.size(); i++) {
|
||||
IContainerListener IContainerListener = this.listeners.get(i);
|
||||
if (this.energy != (int) tile.getEnergy())
|
||||
{
|
||||
if (this.energy != (int) tile.getEnergy()) {
|
||||
IContainerListener.sendProgressBarUpdate(this, 2, (int) tile.getEnergy());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addListener(IContainerListener crafting)
|
||||
{
|
||||
public void addListener(IContainerListener crafting) {
|
||||
super.addListener(crafting);
|
||||
crafting.sendProgressBarUpdate(this, 2, (int) tile.getEnergy());
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void updateProgressBar(int id, int value)
|
||||
{
|
||||
if (id == 0)
|
||||
{
|
||||
public void updateProgressBar(int id, int value) {
|
||||
if (id == 0) {
|
||||
this.burnTime = value;
|
||||
} else if (id == 1)
|
||||
{
|
||||
} else if (id == 1) {
|
||||
this.totalBurnTime = value;
|
||||
} else if (id == 2)
|
||||
{
|
||||
} else if (id == 2) {
|
||||
this.energy = value;
|
||||
}
|
||||
this.tile.setEnergy(energy);
|
||||
}
|
||||
|
||||
public int getScaledBurnTime(int i)
|
||||
{
|
||||
public int getScaledBurnTime(int i) {
|
||||
return (int) (((float) burnTime / (float) totalBurnTime) * i);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,22 +2,20 @@ package techreborn.client.container;
|
|||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IContainerListener;
|
||||
import reborncore.client.gui.BaseSlot;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import reborncore.client.gui.BaseSlot;
|
||||
import reborncore.client.gui.SlotOutput;
|
||||
import reborncore.common.container.RebornContainer;
|
||||
import techreborn.tiles.TileMatterFabricator;
|
||||
|
||||
public class ContainerMatterFabricator extends RebornContainer
|
||||
{
|
||||
public class ContainerMatterFabricator extends RebornContainer {
|
||||
|
||||
public int progressTime;
|
||||
EntityPlayer player;
|
||||
TileMatterFabricator tile;
|
||||
|
||||
public ContainerMatterFabricator(TileMatterFabricator tileMatterfab, EntityPlayer player)
|
||||
{
|
||||
public ContainerMatterFabricator(TileMatterFabricator tileMatterfab, EntityPlayer player) {
|
||||
tile = tileMatterfab;
|
||||
this.player = player;
|
||||
|
||||
|
@ -34,61 +32,49 @@ public class ContainerMatterFabricator extends RebornContainer
|
|||
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 3; ++i)
|
||||
{
|
||||
for (int j = 0; j < 9; ++j)
|
||||
{
|
||||
for (i = 0; i < 3; ++i) {
|
||||
for (int j = 0; j < 9; ++j) {
|
||||
this.addSlotToContainer(new BaseSlot(player.inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < 9; ++i)
|
||||
{
|
||||
for (i = 0; i < 9; ++i) {
|
||||
this.addSlotToContainer(new BaseSlot(player.inventory, i, 8 + i * 18, 142));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer p_75145_1_)
|
||||
{
|
||||
public boolean canInteractWith(EntityPlayer p_75145_1_) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void detectAndSendChanges()
|
||||
{
|
||||
public void detectAndSendChanges() {
|
||||
super.detectAndSendChanges();
|
||||
for (int i = 0; i < this.listeners.size(); i++)
|
||||
{
|
||||
for (int i = 0; i < this.listeners.size(); i++) {
|
||||
IContainerListener IContainerListener = this.listeners.get(i);
|
||||
if (this.progressTime != tile.progresstime)
|
||||
{
|
||||
if (this.progressTime != tile.progresstime) {
|
||||
IContainerListener.sendProgressBarUpdate(this, 0, tile.progresstime);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addListener(IContainerListener crafting)
|
||||
{
|
||||
public void addListener(IContainerListener crafting) {
|
||||
super.addListener(crafting);
|
||||
crafting.sendProgressBarUpdate(this, 0, tile.progresstime);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void updateProgressBar(int id, int value)
|
||||
{
|
||||
if (id == 0)
|
||||
{
|
||||
public void updateProgressBar(int id, int value) {
|
||||
if (id == 0) {
|
||||
this.progressTime = value;
|
||||
}
|
||||
}
|
||||
|
||||
public int getProgressScaled(int scale)
|
||||
{
|
||||
if (progressTime != 0)
|
||||
{
|
||||
public int getProgressScaled(int scale) {
|
||||
if (progressTime != 0) {
|
||||
return progressTime * scale / tile.maxProgresstime();
|
||||
}
|
||||
return 0;
|
||||
|
|
|
@ -3,19 +3,16 @@ 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;
|
||||
|
||||
public ContainerPda(EntityPlayer player)
|
||||
{
|
||||
public ContainerPda(EntityPlayer player) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer player)
|
||||
{
|
||||
public boolean canInteractWith(EntityPlayer player) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -7,13 +7,11 @@ import reborncore.client.gui.SlotOutput;
|
|||
import reborncore.common.container.RebornContainer;
|
||||
import techreborn.tiles.TileQuantumChest;
|
||||
|
||||
public class ContainerQuantumChest extends RebornContainer
|
||||
{
|
||||
public class ContainerQuantumChest extends RebornContainer {
|
||||
public TileQuantumChest tileQuantumChest;
|
||||
public EntityPlayer player;
|
||||
|
||||
public ContainerQuantumChest(TileQuantumChest tileQuantumChest, EntityPlayer player)
|
||||
{
|
||||
public ContainerQuantumChest(TileQuantumChest tileQuantumChest, EntityPlayer player) {
|
||||
super();
|
||||
this.tileQuantumChest = tileQuantumChest;
|
||||
this.player = player;
|
||||
|
@ -24,23 +22,19 @@ public class ContainerQuantumChest extends RebornContainer
|
|||
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 3; ++i)
|
||||
{
|
||||
for (int j = 0; j < 9; ++j)
|
||||
{
|
||||
for (i = 0; i < 3; ++i) {
|
||||
for (int j = 0; j < 9; ++j) {
|
||||
this.addSlotToContainer(new BaseSlot(player.inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < 9; ++i)
|
||||
{
|
||||
for (i = 0; i < 9; ++i) {
|
||||
this.addSlotToContainer(new BaseSlot(player.inventory, i, 8 + i * 18, 142));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer player)
|
||||
{
|
||||
public boolean canInteractWith(EntityPlayer player) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -8,13 +8,11 @@ import reborncore.client.gui.SlotOutput;
|
|||
import reborncore.common.container.RebornContainer;
|
||||
import techreborn.tiles.TileQuantumTank;
|
||||
|
||||
public class ContainerQuantumTank extends RebornContainer
|
||||
{
|
||||
public class ContainerQuantumTank extends RebornContainer {
|
||||
public TileQuantumTank tileQuantumTank;
|
||||
public EntityPlayer player;
|
||||
|
||||
public ContainerQuantumTank(TileQuantumTank tileQuantumTank, EntityPlayer player)
|
||||
{
|
||||
public ContainerQuantumTank(TileQuantumTank tileQuantumTank, EntityPlayer player) {
|
||||
super();
|
||||
this.tileQuantumTank = tileQuantumTank;
|
||||
this.player = player;
|
||||
|
@ -25,23 +23,19 @@ public class ContainerQuantumTank extends RebornContainer
|
|||
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 3; ++i)
|
||||
{
|
||||
for (int j = 0; j < 9; ++j)
|
||||
{
|
||||
for (i = 0; i < 3; ++i) {
|
||||
for (int j = 0; j < 9; ++j) {
|
||||
this.addSlotToContainer(new BaseSlot(player.inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < 9; ++i)
|
||||
{
|
||||
for (i = 0; i < 9; ++i) {
|
||||
this.addSlotToContainer(new BaseSlot(player.inventory, i, 8 + i * 18, 142));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer player)
|
||||
{
|
||||
public boolean canInteractWith(EntityPlayer player) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,23 +1,21 @@
|
|||
package techreborn.client.container;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import reborncore.client.gui.BaseSlot;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import reborncore.client.gui.BaseSlot;
|
||||
import reborncore.client.gui.SlotOutput;
|
||||
import reborncore.common.container.RebornContainer;
|
||||
import techreborn.api.gui.SlotUpgrade;
|
||||
import techreborn.tiles.teir1.TileRecycler;
|
||||
|
||||
public class ContainerRecycler extends RebornContainer
|
||||
{
|
||||
public class ContainerRecycler extends RebornContainer {
|
||||
|
||||
public int connectionStatus;
|
||||
EntityPlayer player;
|
||||
TileRecycler tile;
|
||||
|
||||
public ContainerRecycler(TileRecycler tileGrinder, EntityPlayer player)
|
||||
{
|
||||
public ContainerRecycler(TileRecycler tileGrinder, EntityPlayer player) {
|
||||
super();
|
||||
tile = tileGrinder;
|
||||
this.player = player;
|
||||
|
@ -34,32 +32,26 @@ public class ContainerRecycler extends RebornContainer
|
|||
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 3; ++i)
|
||||
{
|
||||
for (int j = 0; j < 9; ++j)
|
||||
{
|
||||
for (i = 0; i < 3; ++i) {
|
||||
for (int j = 0; j < 9; ++j) {
|
||||
this.addSlotToContainer(new BaseSlot(player.inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < 9; ++i)
|
||||
{
|
||||
for (i = 0; i < 9; ++i) {
|
||||
this.addSlotToContainer(new BaseSlot(player.inventory, i, 8 + i * 18, 142));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer p_75145_1_)
|
||||
{
|
||||
public boolean canInteractWith(EntityPlayer p_75145_1_) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void updateProgressBar(int id, int value)
|
||||
{
|
||||
if (id == 10)
|
||||
{
|
||||
public void updateProgressBar(int id, int value) {
|
||||
if (id == 10) {
|
||||
this.connectionStatus = value;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,15 +3,14 @@ package techreborn.client.container;
|
|||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IContainerListener;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import reborncore.client.gui.BaseSlot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import reborncore.client.gui.BaseSlot;
|
||||
import reborncore.client.gui.SlotOutput;
|
||||
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;
|
||||
|
@ -19,17 +18,14 @@ public class ContainerRollingMachine extends RebornContainer
|
|||
int burnTime;
|
||||
int energy;
|
||||
|
||||
public ContainerRollingMachine(TileRollingMachine tileRollingmachine, EntityPlayer 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++)
|
||||
{
|
||||
for (int l = 0; l < 3; l++) {
|
||||
for (int k1 = 0; k1 < 3; k1++) {
|
||||
this.addSlotToContainer(
|
||||
new BaseSlot(tileRollingmachine.craftMatrix, k1 + l * 3, 30 + k1 * 18, 17 + l * 18));
|
||||
new BaseSlot(tileRollingmachine.craftMatrix, k1 + l * 3, 30 + k1 * 18, 17 + l * 18));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -40,36 +36,30 @@ public class ContainerRollingMachine extends RebornContainer
|
|||
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 3; ++i)
|
||||
{
|
||||
for (int j = 0; j < 9; ++j)
|
||||
{
|
||||
for (i = 0; i < 3; ++i) {
|
||||
for (int j = 0; j < 9; ++j) {
|
||||
this.addSlotToContainer(new BaseSlot(player.inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < 9; ++i)
|
||||
{
|
||||
for (i = 0; i < 9; ++i) {
|
||||
this.addSlotToContainer(new BaseSlot(player.inventory, i, 8 + i * 18, 142));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer player)
|
||||
{
|
||||
public boolean canInteractWith(EntityPlayer player) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public final void onCraftMatrixChanged(IInventory inv)
|
||||
{
|
||||
public final void onCraftMatrixChanged(IInventory inv) {
|
||||
ItemStack output = RollingMachineRecipe.instance.findMatchingRecipe(tile.craftMatrix, tile.getWorld());
|
||||
tile.inventory.setInventorySlotContents(1, output);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addListener(IContainerListener crafting)
|
||||
{
|
||||
public void addListener(IContainerListener crafting) {
|
||||
super.addListener(crafting);
|
||||
crafting.sendProgressBarUpdate(this, 0, tile.runTime);
|
||||
crafting.sendProgressBarUpdate(this, 1, tile.tickTime);
|
||||
|
@ -77,21 +67,16 @@ public class ContainerRollingMachine extends RebornContainer
|
|||
}
|
||||
|
||||
@Override
|
||||
public void detectAndSendChanges()
|
||||
{
|
||||
for (int i = 0; i < this.listeners.size(); i++)
|
||||
{
|
||||
public void detectAndSendChanges() {
|
||||
for (int i = 0; i < this.listeners.size(); i++) {
|
||||
IContainerListener crafting = this.listeners.get(i);
|
||||
if (this.currentItemBurnTime != tile.runTime)
|
||||
{
|
||||
if (this.currentItemBurnTime != tile.runTime) {
|
||||
crafting.sendProgressBarUpdate(this, 0, tile.runTime);
|
||||
}
|
||||
if (this.burnTime != tile.tickTime || tile.tickTime == -1)
|
||||
{
|
||||
if (this.burnTime != tile.tickTime || tile.tickTime == -1) {
|
||||
crafting.sendProgressBarUpdate(this, 1, tile.tickTime);
|
||||
}
|
||||
if (this.energy != (int) tile.getEnergy())
|
||||
{
|
||||
if (this.energy != (int) tile.getEnergy()) {
|
||||
crafting.sendProgressBarUpdate(this, 2, (int) tile.getEnergy());
|
||||
}
|
||||
}
|
||||
|
@ -99,32 +84,25 @@ public class ContainerRollingMachine extends RebornContainer
|
|||
}
|
||||
|
||||
@Override
|
||||
public void updateProgressBar(int id, int value)
|
||||
{
|
||||
public void updateProgressBar(int id, int value) {
|
||||
super.updateProgressBar(id, value);
|
||||
if (id == 0)
|
||||
{
|
||||
if (id == 0) {
|
||||
this.currentItemBurnTime = value;
|
||||
} else if (id == 1)
|
||||
{
|
||||
} else if (id == 1) {
|
||||
this.burnTime = value;
|
||||
} else if (id == 2)
|
||||
{
|
||||
} else if (id == 2) {
|
||||
this.energy = value;
|
||||
}
|
||||
this.tile.runTime = this.currentItemBurnTime;
|
||||
if (this.burnTime == -1)
|
||||
{
|
||||
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)
|
||||
{
|
||||
public int getBurnTimeRemainingScaled(int scale) {
|
||||
if (burnTime == 0 || this.currentItemBurnTime == 0) {
|
||||
return 0;
|
||||
}
|
||||
return this.burnTime * scale / this.currentItemBurnTime;
|
||||
|
|
|
@ -1,23 +1,21 @@
|
|||
package techreborn.client.container;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import reborncore.client.gui.BaseSlot;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import reborncore.client.gui.BaseSlot;
|
||||
import reborncore.client.gui.SlotOutput;
|
||||
import reborncore.common.container.RebornContainer;
|
||||
import techreborn.api.gui.SlotUpgrade;
|
||||
import techreborn.tiles.TileScrapboxinator;
|
||||
|
||||
public class ContainerScrapboxinator extends RebornContainer
|
||||
{
|
||||
public class ContainerScrapboxinator extends RebornContainer {
|
||||
|
||||
public int connectionStatus;
|
||||
EntityPlayer player;
|
||||
TileScrapboxinator tile;
|
||||
|
||||
public ContainerScrapboxinator(TileScrapboxinator tileScrapboxinator, EntityPlayer player)
|
||||
{
|
||||
public ContainerScrapboxinator(TileScrapboxinator tileScrapboxinator, EntityPlayer player) {
|
||||
super();
|
||||
tile = tileScrapboxinator;
|
||||
this.player = player;
|
||||
|
@ -34,32 +32,26 @@ public class ContainerScrapboxinator extends RebornContainer
|
|||
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 3; ++i)
|
||||
{
|
||||
for (int j = 0; j < 9; ++j)
|
||||
{
|
||||
for (i = 0; i < 3; ++i) {
|
||||
for (int j = 0; j < 9; ++j) {
|
||||
this.addSlotToContainer(new BaseSlot(player.inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < 9; ++i)
|
||||
{
|
||||
for (i = 0; i < 9; ++i) {
|
||||
this.addSlotToContainer(new BaseSlot(player.inventory, i, 8 + i * 18, 142));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer p_75145_1_)
|
||||
{
|
||||
public boolean canInteractWith(EntityPlayer p_75145_1_) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void updateProgressBar(int id, int value)
|
||||
{
|
||||
if (id == 10)
|
||||
{
|
||||
public void updateProgressBar(int id, int value) {
|
||||
if (id == 10) {
|
||||
this.connectionStatus = value;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,13 +7,11 @@ import reborncore.client.gui.SlotOutput;
|
|||
import reborncore.common.container.RebornContainer;
|
||||
import techreborn.tiles.generator.TileSemifluidGenerator;
|
||||
|
||||
public class ContainerSemifluidGenerator extends RebornContainer
|
||||
{
|
||||
public class ContainerSemifluidGenerator extends RebornContainer {
|
||||
public TileSemifluidGenerator tileSemifluidGenerator;
|
||||
public EntityPlayer player;
|
||||
|
||||
public ContainerSemifluidGenerator(TileSemifluidGenerator tileSemifluidGenerator, EntityPlayer player)
|
||||
{
|
||||
public ContainerSemifluidGenerator(TileSemifluidGenerator tileSemifluidGenerator, EntityPlayer player) {
|
||||
super();
|
||||
this.tileSemifluidGenerator = tileSemifluidGenerator;
|
||||
this.player = player;
|
||||
|
@ -24,23 +22,19 @@ public class ContainerSemifluidGenerator extends RebornContainer
|
|||
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 3; ++i)
|
||||
{
|
||||
for (int j = 0; j < 9; ++j)
|
||||
{
|
||||
for (i = 0; i < 3; ++i) {
|
||||
for (int j = 0; j < 9; ++j) {
|
||||
this.addSlotToContainer(new BaseSlot(player.inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < 9; ++i)
|
||||
{
|
||||
for (i = 0; i < 9; ++i) {
|
||||
this.addSlotToContainer(new BaseSlot(player.inventory, i, 8 + i * 18, 142));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer player)
|
||||
{
|
||||
public boolean canInteractWith(EntityPlayer player) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,13 +8,11 @@ import reborncore.client.gui.SlotOutput;
|
|||
import reborncore.common.container.RebornContainer;
|
||||
import techreborn.tiles.generator.TileThermalGenerator;
|
||||
|
||||
public class ContainerThermalGenerator extends RebornContainer
|
||||
{
|
||||
public class ContainerThermalGenerator extends RebornContainer {
|
||||
public TileThermalGenerator tileThermalGenerator;
|
||||
public EntityPlayer player;
|
||||
|
||||
public ContainerThermalGenerator(TileThermalGenerator tileThermalGenerator, EntityPlayer player)
|
||||
{
|
||||
public ContainerThermalGenerator(TileThermalGenerator tileThermalGenerator, EntityPlayer player) {
|
||||
super();
|
||||
this.tileThermalGenerator = tileThermalGenerator;
|
||||
this.player = player;
|
||||
|
@ -25,23 +23,19 @@ public class ContainerThermalGenerator extends RebornContainer
|
|||
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 3; ++i)
|
||||
{
|
||||
for (int j = 0; j < 9; ++j)
|
||||
{
|
||||
for (i = 0; i < 3; ++i) {
|
||||
for (int j = 0; j < 9; ++j) {
|
||||
this.addSlotToContainer(new BaseSlot(player.inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < 9; ++i)
|
||||
{
|
||||
for (i = 0; i < 9; ++i) {
|
||||
this.addSlotToContainer(new BaseSlot(player.inventory, i, 8 + i * 18, 142));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer player)
|
||||
{
|
||||
public boolean canInteractWith(EntityPlayer player) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,43 +1,40 @@
|
|||
package techreborn.client.container;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IContainerListener;
|
||||
import reborncore.client.gui.BaseSlot;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import reborncore.client.gui.SlotOutput;
|
||||
import techreborn.tiles.multiblock.TileVacuumFreezer;
|
||||
|
||||
public class ContainerVacuumFreezer extends ContainerCrafting {
|
||||
|
||||
EntityPlayer player;
|
||||
TileVacuumFreezer tile;
|
||||
EntityPlayer player;
|
||||
TileVacuumFreezer tile;
|
||||
|
||||
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 BaseSlot(tileAlloysmelter.inventory, 0, 56, 34));
|
||||
// outputs
|
||||
this.addSlotToContainer(new SlotOutput(tileAlloysmelter.inventory, 1, 116, 35));
|
||||
// input
|
||||
this.addSlotToContainer(new BaseSlot(tileAlloysmelter.inventory, 0, 56, 34));
|
||||
// outputs
|
||||
this.addSlotToContainer(new SlotOutput(tileAlloysmelter.inventory, 1, 116, 35));
|
||||
|
||||
for (int i = 0; i < 3; ++i) {
|
||||
for (int j = 0; j < 9; ++j) {
|
||||
this.addSlotToContainer(new BaseSlot(player.inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < 3; ++i) {
|
||||
for (int j = 0; j < 9; ++j) {
|
||||
this.addSlotToContainer(new BaseSlot(player.inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < 9; ++i) {
|
||||
this.addSlotToContainer(new BaseSlot(player.inventory, i, 8 + i * 18, 142));
|
||||
}
|
||||
for (int i = 0; i < 9; ++i) {
|
||||
this.addSlotToContainer(new BaseSlot(player.inventory, i, 8 + i * 18, 142));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer player) {
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer player) {
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,25 +1,21 @@
|
|||
package techreborn.client.container;
|
||||
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import reborncore.client.gui.BaseSlot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import reborncore.client.gui.BaseSlot;
|
||||
import techreborn.init.ModItems;
|
||||
|
||||
public class SlotScrapbox extends BaseSlot
|
||||
{
|
||||
public class SlotScrapbox extends BaseSlot {
|
||||
|
||||
public SlotScrapbox(IInventory par1iInventory, int par2, int par3, int par4)
|
||||
{
|
||||
public SlotScrapbox(IInventory par1iInventory, int par2, int par3, int par4) {
|
||||
super(par1iInventory, par2, par3, par4);
|
||||
}
|
||||
|
||||
public boolean isItemValid(ItemStack par1ItemStack)
|
||||
{
|
||||
public boolean isItemValid(ItemStack par1ItemStack) {
|
||||
return par1ItemStack.getItem() == ModItems.scrapBox;
|
||||
}
|
||||
|
||||
public int getSlotStackLimit()
|
||||
{
|
||||
public int getSlotStackLimit() {
|
||||
return 64;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue