Skip to content

Commit

Permalink
staffs in creative tabs
Browse files Browse the repository at this point in the history
  • Loading branch information
Lyof429 committed May 5, 2024
1 parent 84abdf8 commit 1355bc8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 2 additions & 4 deletions src/main/java/net/lyof/sortilege/item/ModItemGroups.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,8 @@ public static void register() {
entries.add(ModItems.LIMITITE);
});
ItemGroupEvents.modifyEntriesEvent(ItemGroups.COMBAT).register(entries -> {
Sortilege.log(ModItems.STAFFS);
for (Pair<String, ModJsonConfigs.StaffInfo> staff : ModJsonConfigs.STAFFS) {
Sortilege.log(staff.getFirst());
}
for (Item staff : ModItems.STAFFS)
entries.add(staff);
});
}
}
6 changes: 4 additions & 2 deletions src/main/java/net/lyof/sortilege/item/ModItems.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,20 @@
import net.minecraft.registry.Registries;
import net.minecraft.registry.Registry;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class ModItems {
public static Map<String, Item> STAFFS = new HashMap<>();
public static List<Item> STAFFS = new ArrayList<>();

public static void register() {
for (Pair<String, ModJsonConfigs.StaffInfo> pair : ModJsonConfigs.STAFFS) {
String id = pair.getFirst();
ModJsonConfigs.StaffInfo staff = pair.getSecond();
if (FabricLoader.getInstance().isModLoaded(staff.dependency))
STAFFS.put(id, register(id, new StaffItem(staff, new FabricItemSettings().maxCount(1))));
STAFFS.add(register(id, new StaffItem(staff, new FabricItemSettings().maxCount(1))));
}
}

Expand Down

0 comments on commit 1355bc8

Please sign in to comment.