mirror of
https://github.com/GTNewHorizons/Binnie.git
synced 2026-11-21 04:32:24 +00:00
Update buildscript & spotlessApply
This commit is contained in:
1 parent
e4329e2b8f
commit
8683a345c3
818 files changed
+51123
-49403
No files matched your search
@@ -13,53 +13,56 @@ import binnie.core.craftgui.resource.minecraft.CraftGUITexture;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
public class ControlSlotFluid extends Control implements ITooltip {
|
||||
protected ControlFluidDisplay itemDisplay;
|
||||
protected FluidStack fluidStack;
|
||||
protected ControlFluidDisplay itemDisplay;
|
||||
protected FluidStack fluidStack;
|
||||
|
||||
public ControlSlotFluid(IWidget parent, int x, int y, FluidStack fluid) {
|
||||
this(parent, x, y, 18, fluid);
|
||||
}
|
||||
public ControlSlotFluid(IWidget parent, int x, int y, FluidStack fluid) {
|
||||
this(parent, x, y, 18, fluid);
|
||||
}
|
||||
|
||||
public ControlSlotFluid(IWidget parent, int x, int y, int size, FluidStack fluid) {
|
||||
super(parent, x, y, size, size);
|
||||
addAttribute(WidgetAttribute.MOUSE_OVER);
|
||||
itemDisplay = new ControlFluidDisplay(this, 1.0f, 1.0f, size - 2);
|
||||
fluidStack = fluid;
|
||||
addSelfEventHandler(new EventWidget.ChangeSize.Handler() {
|
||||
@Override
|
||||
public void onEvent(EventWidget.ChangeSize event) {
|
||||
if (itemDisplay != null) {
|
||||
itemDisplay.setSize(getSize().sub(new IPoint(2.0f, 2.0f)));
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
public ControlSlotFluid(IWidget parent, int x, int y, int size, FluidStack fluid) {
|
||||
super(parent, x, y, size, size);
|
||||
addAttribute(WidgetAttribute.MOUSE_OVER);
|
||||
itemDisplay = new ControlFluidDisplay(this, 1.0f, 1.0f, size - 2);
|
||||
fluidStack = fluid;
|
||||
addSelfEventHandler(new EventWidget.ChangeSize.Handler() {
|
||||
@Override
|
||||
public void onEvent(EventWidget.ChangeSize event) {
|
||||
if (itemDisplay != null) {
|
||||
itemDisplay.setSize(getSize().sub(new IPoint(2.0f, 2.0f)));
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRenderBackground() {
|
||||
int size = (int) getSize().x();
|
||||
CraftGUI.render.texture(CraftGUITexture.Slot, getArea());
|
||||
if (getSuperParent().getMousedOverWidget() == this) {
|
||||
CraftGUI.render.gradientRect(new IArea(new IPoint(1.0f, 1.0f), getArea().size().sub(new IPoint(2.0f, 2.0f))), 0x80ffffff, 0x80ffffff);
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void onRenderBackground() {
|
||||
int size = (int) getSize().x();
|
||||
CraftGUI.render.texture(CraftGUITexture.Slot, getArea());
|
||||
if (getSuperParent().getMousedOverWidget() == this) {
|
||||
CraftGUI.render.gradientRect(
|
||||
new IArea(new IPoint(1.0f, 1.0f), getArea().size().sub(new IPoint(2.0f, 2.0f))),
|
||||
0x80ffffff,
|
||||
0x80ffffff);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdateClient() {
|
||||
super.onUpdateClient();
|
||||
itemDisplay.setItemStack(getFluidStack());
|
||||
}
|
||||
@Override
|
||||
public void onUpdateClient() {
|
||||
super.onUpdateClient();
|
||||
itemDisplay.setItemStack(getFluidStack());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getTooltip(Tooltip tooltip) {
|
||||
FluidStack item = getFluidStack();
|
||||
if (item == null) {
|
||||
return;
|
||||
}
|
||||
tooltip.add(item.getFluid().getLocalizedName());
|
||||
}
|
||||
@Override
|
||||
public void getTooltip(Tooltip tooltip) {
|
||||
FluidStack item = getFluidStack();
|
||||
if (item == null) {
|
||||
return;
|
||||
}
|
||||
tooltip.add(item.getFluid().getLocalizedName());
|
||||
}
|
||||
|
||||
public FluidStack getFluidStack() {
|
||||
return fluidStack;
|
||||
}
|
||||
public FluidStack getFluidStack() {
|
||||
return fluidStack;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user