mirror of
https://github.com/Creators-of-Create/Create.git
synced 2024-12-20 05:43:46 +01:00
3d68bec18a
- All Items are now using registrate
- Blockzapper now renders an outline around its affected area
- Ported rainbow debug ™️
- Reworked the custom item model/renderer system
- Schematics now preview their structure again
- SuperByteBuffers now support being rendered into non-BufferBuilders
63 lines
1.3 KiB
Java
63 lines
1.3 KiB
Java
package com.simibubi.create.content;
|
|
|
|
import com.simibubi.create.Create;
|
|
import com.simibubi.create.foundation.item.ItemDescription.Palette;
|
|
|
|
import net.minecraft.block.Block;
|
|
import net.minecraft.item.BlockItem;
|
|
import net.minecraft.item.Item;
|
|
import net.minecraft.item.ItemStack;
|
|
|
|
public enum AllSections {
|
|
|
|
/** Create's kinetic mechanisms */
|
|
KINETICS(Palette.Red),
|
|
|
|
/** Item transport and other Utility */
|
|
LOGISTICS(Palette.Yellow),
|
|
|
|
/** Helpful gadgets and other shenanigans */
|
|
CURIOSITIES(Palette.Purple),
|
|
|
|
/** Tools for strucuture movement and replication */
|
|
SCHEMATICS(Palette.Blue),
|
|
|
|
/** Decorative blocks */
|
|
PALETTES(Palette.Green),
|
|
|
|
/** Base materials, ingredients and tools */
|
|
MATERIALS(Palette.Green),
|
|
|
|
/** Fallback section */
|
|
UNASSIGNED(Palette.Gray)
|
|
|
|
;
|
|
|
|
private Palette tooltipPalette;
|
|
|
|
private AllSections(Palette tooltipPalette) {
|
|
this.tooltipPalette = tooltipPalette;
|
|
}
|
|
|
|
public Palette getTooltipPalette() {
|
|
return tooltipPalette;
|
|
}
|
|
|
|
public static AllSections of(ItemStack stack) {
|
|
Item item = stack.getItem();
|
|
if (item instanceof BlockItem)
|
|
return ofBlock(((BlockItem) item).getBlock());
|
|
return ofItem(item);
|
|
}
|
|
|
|
static AllSections ofItem(Item item) {
|
|
return Create.registrate()
|
|
.getSection(item);
|
|
}
|
|
|
|
static AllSections ofBlock(Block block) {
|
|
return Create.registrate()
|
|
.getSection(block);
|
|
}
|
|
|
|
}
|