mirror of
https://github.com/GTNewHorizons/Binnie.git
synced 2026-11-17 19:15:24 +00:00
Move some craftguis
This commit is contained in:
1 parent
fff40b966d
commit
49d80c847e
57 files changed
+114
-99
No files matched your search
@@ -0,0 +1,40 @@
|
||||
package binnie.extratrees.kitchen.craftgui;
|
||||
|
||||
import binnie.craftgui.core.IWidget;
|
||||
import binnie.craftgui.core.geometry.IArea;
|
||||
import binnie.craftgui.events.EventMouse;
|
||||
import binnie.craftgui.minecraft.Window;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
public class ControlTankSlot extends ControlSlotFluid {
|
||||
int tankID;
|
||||
|
||||
public ControlTankSlot(final IWidget parent, final int x, final int y, final int i) {
|
||||
super(parent, x, y, null);
|
||||
this.tankID = 0;
|
||||
this.tankID = i;
|
||||
this.addSelfEventHandler(new EventMouse.Down.Handler() {
|
||||
@Override
|
||||
public void onEvent(final EventMouse.Down event) {
|
||||
if (event.getButton() == 0) {
|
||||
final NBTTagCompound nbt = new NBTTagCompound();
|
||||
nbt.setByte("id", (byte) ControlTankSlot.this.tankID);
|
||||
Window.get(ControlTankSlot.this.getWidget()).sendClientAction("tank-click", nbt);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdateClient() {
|
||||
this.fluidStack = Window.get(this).getContainer().getTankInfo(this.tankID).liquid;
|
||||
final int height = 16 * (((this.fluidStack == null) ? 0 : this.fluidStack.amount) / 1000);
|
||||
this.itemDisplay.setCroppedZone(this.itemDisplay, new IArea(0, 16 - height, 16, 16));
|
||||
super.onUpdateClient();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRenderBackground(int guiWidth, int guiHeight) {
|
||||
super.onRenderBackground(guiWidth, guiHeight);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user