2014-05-02 21:31:20 +02:00
|
|
|
/*******************************************************************************
|
2014-08-07 08:29:25 +02:00
|
|
|
* Copyright (c) 2011-2014 SirSengir.
|
|
|
|
|
* All rights reserved. This program and the accompanying materials
|
|
|
|
|
* are made available under the terms of the GNU Lesser Public License v3
|
|
|
|
|
* which accompanies this distribution, and is available at
|
2014-08-07 02:56:58 -07:00
|
|
|
* http://www.gnu.org/licenses/lgpl-3.0.txt
|
2014-05-02 21:31:20 +02:00
|
|
|
*
|
2014-08-07 08:29:25 +02:00
|
|
|
* Various Contributors including, but not limited to:
|
|
|
|
|
* SirSengir (original work), CovertJaguar, Player, Binnie, MysteriousAges
|
2014-05-02 21:31:20 +02:00
|
|
|
******************************************************************************/
|
|
|
|
|
package forestry.energy.gui;
|
|
|
|
|
|
|
|
|
|
import forestry.core.gui.ContainerForestry;
|
|
|
|
|
import forestry.core.gui.slots.SlotClosed;
|
|
|
|
|
import forestry.energy.gadgets.EngineCopper;
|
2014-12-15 08:15:21 -08:00
|
|
|
import net.minecraft.entity.player.InventoryPlayer;
|
|
|
|
|
import net.minecraft.inventory.ICrafting;
|
|
|
|
|
import net.minecraft.inventory.Slot;
|
2014-05-02 21:31:20 +02:00
|
|
|
|
|
|
|
|
public class ContainerEngineCopper extends ContainerForestry {
|
2014-11-30 17:19:16 -08:00
|
|
|
|
2014-11-30 17:59:31 -08:00
|
|
|
protected final EngineCopper engine;
|
2014-05-02 21:31:20 +02:00
|
|
|
|
|
|
|
|
public ContainerEngineCopper(InventoryPlayer player, EngineCopper tile) {
|
|
|
|
|
super(tile);
|
|
|
|
|
|
|
|
|
|
this.engine = tile;
|
|
|
|
|
this.addSlot(new Slot(tile, 0, 44, 46));
|
|
|
|
|
|
|
|
|
|
this.addSlot(new SlotClosed(tile, 1, 98, 35));
|
|
|
|
|
this.addSlot(new SlotClosed(tile, 2, 98, 53));
|
|
|
|
|
this.addSlot(new SlotClosed(tile, 3, 116, 35));
|
|
|
|
|
this.addSlot(new SlotClosed(tile, 4, 116, 53));
|
|
|
|
|
|
2014-11-30 17:19:16 -08:00
|
|
|
for (int i = 0; i < 3; ++i) {
|
|
|
|
|
for (int j = 0; j < 9; ++j) {
|
2014-05-02 21:31:20 +02:00
|
|
|
this.addSlot(new Slot(player, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
|
2014-11-30 17:19:16 -08:00
|
|
|
}
|
|
|
|
|
}
|
2014-05-02 21:31:20 +02:00
|
|
|
|
2014-11-30 17:19:16 -08:00
|
|
|
for (int i = 0; i < 9; ++i) {
|
2014-05-02 21:31:20 +02:00
|
|
|
this.addSlot(new Slot(player, i, 8 + i * 18, 142));
|
2014-11-30 17:19:16 -08:00
|
|
|
}
|
2014-05-02 21:31:20 +02:00
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void updateProgressBar(int i, int j) {
|
|
|
|
|
if (engine != null)
|
|
|
|
|
engine.getGUINetworkData(i, j);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void detectAndSendChanges() {
|
|
|
|
|
super.detectAndSendChanges();
|
|
|
|
|
|
2014-11-30 17:19:16 -08:00
|
|
|
for (Object crafter : crafters) {
|
|
|
|
|
engine.sendGUINetworkData(this, (ICrafting) crafter);
|
|
|
|
|
}
|
2014-05-02 21:31:20 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|