2020-05-23 14:02:38 +02:00
|
|
|
package com.simibubi.create.content;
|
2020-05-02 18:07:46 +02:00
|
|
|
|
|
|
|
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;
|
|
|
|
|
2020-05-23 14:02:38 +02:00
|
|
|
public enum AllSections {
|
2020-05-02 18:07:46 +02:00
|
|
|
|
|
|
|
/** Create's kinetic mechanisms */
|
|
|
|
KINETICS(Palette.Red),
|
|
|
|
|
|
|
|
/** Item transport and other Utility */
|
|
|
|
LOGISTICS(Palette.Yellow),
|
|
|
|
|
|
|
|
/** Tools for strucuture movement and replication */
|
|
|
|
SCHEMATICS(Palette.Blue),
|
|
|
|
|
|
|
|
/** Decorative blocks */
|
|
|
|
PALETTES(Palette.Green),
|
2021-05-04 03:50:17 +02:00
|
|
|
|
|
|
|
/** Helpful gadgets and other shenanigans */
|
|
|
|
CURIOSITIES(Palette.Purple),
|
2020-05-02 18:07:46 +02:00
|
|
|
|
|
|
|
/** Base materials, ingredients and tools */
|
|
|
|
MATERIALS(Palette.Green),
|
2021-04-08 19:22:11 +02:00
|
|
|
|
2020-05-02 18:07:46 +02:00
|
|
|
/** Fallback section */
|
|
|
|
UNASSIGNED(Palette.Gray)
|
|
|
|
|
|
|
|
;
|
|
|
|
|
|
|
|
private Palette tooltipPalette;
|
|
|
|
|
2020-05-23 14:02:38 +02:00
|
|
|
private AllSections(Palette tooltipPalette) {
|
2020-05-02 18:07:46 +02:00
|
|
|
this.tooltipPalette = tooltipPalette;
|
|
|
|
}
|
|
|
|
|
|
|
|
public Palette getTooltipPalette() {
|
|
|
|
return tooltipPalette;
|
|
|
|
}
|
|
|
|
|
2020-05-23 14:02:38 +02:00
|
|
|
public static AllSections of(ItemStack stack) {
|
2020-05-02 18:07:46 +02:00
|
|
|
Item item = stack.getItem();
|
|
|
|
if (item instanceof BlockItem)
|
|
|
|
return ofBlock(((BlockItem) item).getBlock());
|
|
|
|
return ofItem(item);
|
|
|
|
}
|
|
|
|
|
2020-05-23 14:02:38 +02:00
|
|
|
static AllSections ofItem(Item item) {
|
2020-05-28 01:29:26 +02:00
|
|
|
return Create.registrate()
|
|
|
|
.getSection(item);
|
2020-05-02 18:07:46 +02:00
|
|
|
}
|
|
|
|
|
2020-05-23 14:02:38 +02:00
|
|
|
static AllSections ofBlock(Block block) {
|
2020-05-28 01:29:26 +02:00
|
|
|
return Create.registrate()
|
|
|
|
.getSection(block);
|
2020-05-02 18:07:46 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|