-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🎨 change creative tab format in preparation for porting
Signed-off-by: LocusAzzurro <[email protected]>
- Loading branch information
1 parent
7834c8b
commit 3a03899
Showing
5 changed files
with
492 additions
and
438 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
src/main/java/com/voxelutopia/ultramarine/data/ModCreativeTab.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package com.voxelutopia.ultramarine.data; | ||
|
||
import net.minecraft.world.item.CreativeModeTab; | ||
import net.minecraft.world.item.Item; | ||
import net.minecraftforge.registries.RegistryObject; | ||
|
||
import java.util.HashSet; | ||
import java.util.Map; | ||
import java.util.Set; | ||
|
||
public enum ModCreativeTab { | ||
MATERIALS(CreativeTabDefinitions.MATERIALS), | ||
TOOLS(CreativeTabDefinitions.TOOLS), | ||
BUILDING_BLOCKS(CreativeTabDefinitions.BUILDING_BLOCKS), | ||
DECORATIVE_BLOCKS(CreativeTabDefinitions.DECORATIVE_BLOCKS), | ||
DECORATIONS(CreativeTabDefinitions.DECORATIONS), | ||
FURNITURE(CreativeTabDefinitions.FURNITURE), | ||
WINDOWS_AND_DOORS(CreativeTabDefinitions.WINDOWS_AND_DOORS), | ||
LAMPS(CreativeTabDefinitions.LAMPS); | ||
|
||
final CreativeModeTab tab; | ||
|
||
static final Map<ModCreativeTab, Set<RegistryObject<Item>>> itemSets = Map.of( | ||
MATERIALS, new HashSet<>(), | ||
TOOLS, new HashSet<>(), | ||
BUILDING_BLOCKS, new HashSet<>(), | ||
DECORATIVE_BLOCKS, new HashSet<>(), | ||
DECORATIONS, new HashSet<>(), | ||
FURNITURE, new HashSet<>(), | ||
WINDOWS_AND_DOORS, new HashSet<>(), | ||
LAMPS, new HashSet<>() | ||
); | ||
ModCreativeTab(CreativeModeTab tab){ | ||
this.tab = tab; | ||
} | ||
|
||
public CreativeModeTab getTab() { | ||
return tab; | ||
} | ||
|
||
public static void putItemInSet(RegistryObject<Item> item, ModCreativeTab tab){ | ||
itemSets.get(tab).add(item); | ||
} | ||
} |
Oops, something went wrong.