Convert VacuumFreezer and ImplosionCompressor

This commit is contained in:
Ourten 2017-01-08 16:01:24 +01:00
parent ea98e4a8a0
commit b5881e2102
6 changed files with 57 additions and 161 deletions

View file

@ -1,77 +0,0 @@
package techreborn.client.container;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IContainerListener;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import reborncore.client.gui.slots.BaseSlot;
import reborncore.client.gui.slots.SlotOutput;
import techreborn.tiles.multiblock.TileImplosionCompressor;
public class ContainerImplosionCompressor extends ContainerCrafting {
public int tickTime;
public int multIBlockState = 0;
EntityPlayer player;
TileImplosionCompressor tile;
public ContainerImplosionCompressor(TileImplosionCompressor tilecompressor, EntityPlayer player) {
super(tilecompressor.crafter);
tile = tilecompressor;
this.player = player;
// input
this.addSlotToContainer(new BaseSlot(tilecompressor.inventory, 0, 37, 26));
this.addSlotToContainer(new BaseSlot(tilecompressor.inventory, 1, 37, 44));
// outputs
this.addSlotToContainer(new SlotOutput(tilecompressor.inventory, 2, 93, 35));
this.addSlotToContainer(new SlotOutput(tilecompressor.inventory, 3, 111, 35));
int i;
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) {
this.addSlotToContainer(new BaseSlot(player.inventory, i, 8 + i * 18, 142));
}
}
@Override
public boolean canInteractWith(EntityPlayer p_75145_1_) {
return true;
}
@Override
public void detectAndSendChanges() {
super.detectAndSendChanges();
for (int i = 0; i < this.listeners.size(); i++) {
IContainerListener IContainerListener = this.listeners.get(i);
if (this.multIBlockState != getMultIBlockStateint()) {
IContainerListener.sendProgressBarUpdate(this, 3, getMultIBlockStateint());
}
}
}
@Override
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) {
this.multIBlockState = value;
}
}
public int getMultIBlockStateint() {
return tile.getMutliBlock() ? 1 : 0;
}
}

View file

@ -1,40 +0,0 @@
package techreborn.client.container;
import net.minecraft.entity.player.EntityPlayer;
import reborncore.client.gui.slots.BaseSlot;
import reborncore.client.gui.slots.SlotOutput;
import techreborn.tiles.multiblock.TileVacuumFreezer;
public class ContainerVacuumFreezer extends ContainerCrafting {
EntityPlayer player;
TileVacuumFreezer tile;
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));
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));
}
}
@Override
public boolean canInteractWith(EntityPlayer player) {
return true;
}
}