Package com.minecolonies.core.client.gui
Class ColorPalette
java.lang.Object
com.minecolonies.core.client.gui.ColorPalette
A custom "widget" of sorts that lays out minecraft's DyeColors as buttons to choose from.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceA custom function to call when the color has been changed.static interfaceUsed as a function processor to add the widgets to the screenclass -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic intprotected List<ColorPalette.PaletteButton>static final net.minecraft.world.item.DyeColor[]protected net.minecraft.world.item.DyeColor -
Constructor Summary
ConstructorsConstructorDescriptionColorPalette(int x, int y, int col, ColorPalette.IWidgetAdder adder) ColorPalette(net.minecraft.client.gui.screens.Screen gui, ColorPalette.IWidgetAdder adder) A more generic form of the constructor -
Method Summary
Modifier and TypeMethodDescriptionnet.minecraft.world.item.DyeColorvoidsetSelected(net.minecraft.world.item.DyeColor selected)
-
Field Details
-
DYES
public static final net.minecraft.world.item.DyeColor[] DYES -
BUTTON_SIZE
public static int BUTTON_SIZE -
buttons
-
selected
protected net.minecraft.world.item.DyeColor selected -
onchange
-
-
Constructor Details
-
ColorPalette
- Parameters:
x- the x position of the top left buttony- the y position of the top left buttoncol- the number of columns to sort this palette intoadder- a function to add each button to the calling screen. Call with this::addButton if unsure.
-
ColorPalette
A more generic form of the constructor- Parameters:
gui- the screen to interact with this color paletteadder- the function to add the buttons. Likely this::addButton from a Screen
-
-
Method Details
-
getSelected
public net.minecraft.world.item.DyeColor getSelected() -
setSelected
public void setSelected(net.minecraft.world.item.DyeColor selected)
-