Class GuiFluidTank
java.lang.Object
codechicken.lib.gui.modular.lib.geometry.ConstrainedGeometry<GuiFluidTank>
codechicken.lib.gui.modular.elements.GuiElement<GuiFluidTank>
codechicken.lib.gui.modular.elements.GuiFluidTank
- All Implemented Interfaces:
BackgroundRender,ElementEvents,GuiParent<GuiFluidTank>,TooltipHandler<GuiFluidTank>
When implementing this tank, you must specify the tank capacity in mb,
And then you have two options for specifying the tank contents.
You can set the fluid and the amount stored,
Or you can provide a
FluidStack
Created by brandon3055 on 11/09/2023
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsFields inherited from class codechicken.lib.gui.modular.elements.GuiElement
hoverTime, initialized -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic BiFunction<net.neoforged.neoforge.fluids.FluidStack, Long, List<net.minecraft.network.chat.Component>> static intgetColour(net.minecraft.world.level.material.Fluid fluid) static intgetColour(net.neoforged.neoforge.fluids.FluidStack fluidStack) net.neoforged.neoforge.fluids.FluidStackstatic @Nullable net.minecraft.client.renderer.texture.TextureAtlasSpritegetStillTexture(net.minecraft.world.level.material.Fluid fluid) static @Nullable net.minecraft.client.renderer.texture.TextureAtlasSpritegetStillTexture(net.neoforged.neoforge.fluids.FluidStack stack) voidrenderBackground(GuiRender render, double mouseX, double mouseY, float partialTicks) Used to render content behind this elements child elements.setCapacity(long capacity) Sets the capacity of this tank in milli-buckets.setCapacity(Supplier<Long> capacity) Supply the capacity of this tank in milli-buckets.setDrawGauge(boolean drawGauge) Enable the built-in fluid gauge lines.setFluidStack(Supplier<net.neoforged.neoforge.fluids.FluidStack> fluidStack) Allows you to supply the current stored fluid stack.setFluidStack(net.neoforged.neoforge.fluids.FluidStack fluidStack) Allows you to set the current stored fluid stack.setGaugeColour(int gaugeColour) Sets the colour of the built-in fluid gauge linessetToolTipFormatter(BiFunction<net.neoforged.neoforge.fluids.FluidStack, Long, List<net.minecraft.network.chat.Component>> toolTipFormatter) Install a custom formatter to control how the fluid tool tip renders.Sets the tank window texture, Will be tiled to fit the tank size.static GuiFluidTank.FluidTanksimpleTank(@NotNull GuiParent<?> parent) Creates a simple tank using a simple slot as a background to make it look nice.Methods inherited from class codechicken.lib.gui.modular.elements.GuiElement
addChild, addJeiDropTargets, addJeiExclusions, adoptChild, applyQueuedChildUpdates, blockMouseEvents, blockMouseOver, bringChildToForeground, font, getChildren, getCombinedElementDepth, getJeiDropConsumer, getModularGui, getParent, getTooltip, getTooltipDelay, hoverTime, initElement, isDescendantOf, isEnabled, isJeiDropTarget, isJeiExcluded, isMouseOver, isOpaque, isRemoved, isTooltipEnabled, jeiExclude, mc, onScreenInit, removeChild, render, renderChild, renderOverlay, scaledScreenHeight, scaledScreenWidth, sendChildToBackground, sendChildToIndex, setEnabled, setEnabled, setEnableToolTip, setJeiDropTarget, setJeiExcluded, setOpaque, setRenderCull, setTooltip, setTooltipDelay, setZStacking, showToolTip, tick, toString, updateMouseOver, updateScreenData, zStackingMethods inherited from class codechicken.lib.gui.modular.lib.geometry.ConstrainedGeometry
addBoundsToRect, clearConstraints, clearGeometryCache, constrain, get, getChildBounds, getEnclosingRect, getParent, getPosition, getRectangle, placeInside, placeInside, placeOutside, placeOutside, setHeight, setPos, setSize, setWidth, setXPos, setYPos, strictMode, validate, xCenter, xMax, xMin, xSize, yCenter, yMax, yMin, ySizeMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface codechicken.lib.gui.modular.lib.BackgroundRender
getBackgroundDepthMethods inherited from interface codechicken.lib.gui.modular.lib.ElementEvents
charTyped, charTyped, keyPressed, keyPressed, keyReleased, keyReleased, mouseClicked, mouseClicked, mouseMoved, mouseReleased, mouseReleased, mouseScrolled, mouseScrolledMethods inherited from interface codechicken.lib.gui.modular.lib.geometry.GuiParent
addChild, getValueMethods inherited from interface codechicken.lib.gui.modular.lib.TooltipHandler
renderTooltip, setTooltip, setTooltip, setTooltip, setTooltipSingle, setTooltipSingle
-
Field Details
-
DEFAULT_WINDOW
-
-
Constructor Details
-
GuiFluidTank
-
-
Method Details
-
simpleTank
Creates a simple tank using a simple slot as a background to make it look nice. -
setCapacity
Sets the capacity of this tank in milli-buckets. -
setCapacity
Supply the capacity of this tank in milli-buckets. -
setFluidStack
Allows you to set the current stored fluid stack. -
setFluidStack
Allows you to supply the current stored fluid stack. -
setToolTipFormatter
public GuiFluidTank setToolTipFormatter(BiFunction<net.neoforged.neoforge.fluids.FluidStack, Long, List<net.minecraft.network.chat.Component>> toolTipFormatter) Install a custom formatter to control how the fluid tool tip renders. -
setWindow
Sets the tank window texture, Will be tiled to fit the tank size.- Parameters:
window- New window texture or null for no window texture.
-
setDrawGauge
Enable the built-in fluid gauge lines. -
setGaugeColour
Sets the colour of the built-in fluid gauge lines -
getCapacity
-
getFluidStack
public net.neoforged.neoforge.fluids.FluidStack getFluidStack() -
renderBackground
Description copied from interface:BackgroundRenderUsed to render content behind this elements child elements. When rendering element content, always use thePoseStackavailable via the providedGuiRenderWhere applicable, always use push/pop to ensure the stack is returned to its original state after your rendering is complete.- Specified by:
renderBackgroundin interfaceBackgroundRender- Parameters:
render- Contains gui context information as well as essential render methods/utils including the PoseStack.
-
defaultFormatter
public static BiFunction<net.neoforged.neoforge.fluids.FluidStack,Long, defaultFormatter()List<net.minecraft.network.chat.Component>> -
getColour
public static int getColour(net.neoforged.neoforge.fluids.FluidStack fluidStack) -
getColour
public static int getColour(net.minecraft.world.level.material.Fluid fluid) -
getStillTexture
@Nullable public static @Nullable net.minecraft.client.renderer.texture.TextureAtlasSprite getStillTexture(net.neoforged.neoforge.fluids.FluidStack stack) -
getStillTexture
@Nullable public static @Nullable net.minecraft.client.renderer.texture.TextureAtlasSprite getStillTexture(net.minecraft.world.level.material.Fluid fluid)
-