Auto Format code
This commit is contained in:
parent
112b1657cf
commit
796df6c055
503 changed files with 12260 additions and 16291 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue