mirror of
https://github.com/GTNewHorizons/Binnie.git
synced 2026-11-19 03:49:07 +00:00
* Removed unused Honey Crystal * Removed unfinished kitchen machines Removed Alcohol * Removed unused items * Removed unused PNGs * Fix README.md
41 lines
1.2 KiB
Java
41 lines
1.2 KiB
Java
package binnie.extratrees.craftgui;
|
|
|
|
import binnie.core.craftgui.IWidget;
|
|
import binnie.core.craftgui.events.EventMouse;
|
|
import binnie.core.craftgui.geometry.IArea;
|
|
import binnie.core.craftgui.minecraft.Window;
|
|
import net.minecraft.nbt.NBTTagCompound;
|
|
|
|
public class ControlTankSlot extends ControlSlotFluid {
|
|
protected int tankID;
|
|
|
|
public ControlTankSlot(IWidget parent, int x, int y, int i) {
|
|
super(parent, x, y, null);
|
|
tankID = 0;
|
|
tankID = i;
|
|
addSelfEventHandler(new EventMouse.Down.Handler() {
|
|
@Override
|
|
public void onEvent(EventMouse.Down event) {
|
|
if (event.getButton() == 0) {
|
|
NBTTagCompound nbt = new NBTTagCompound();
|
|
nbt.setByte("id", (byte) tankID);
|
|
Window.get(getWidget()).sendClientAction("tank-click", nbt);
|
|
}
|
|
}
|
|
});
|
|
}
|
|
|
|
@Override
|
|
public void onUpdateClient() {
|
|
fluidStack = Window.get(this).getContainer().getTankInfo(tankID).liquid;
|
|
int height = (int) (16.0f * (((fluidStack == null) ? 0 : fluidStack.amount) / 1000.0f));
|
|
itemDisplay.setCroppedZone(itemDisplay, new IArea(0.0f, 16 - height, 16.0f, 16.0f));
|
|
super.onUpdateClient();
|
|
}
|
|
|
|
@Override
|
|
public void onRenderBackground() {
|
|
super.onRenderBackground();
|
|
}
|
|
}
|