Skip to content

Commit

Permalink
REGISTRY
Browse files Browse the repository at this point in the history
  • Loading branch information
Hummel009 committed Feb 18, 2024
1 parent 0546425 commit a085740
Show file tree
Hide file tree
Showing 17 changed files with 460 additions and 487 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,18 @@

@SuppressWarnings("WeakerAccess")
public class ItemGroups {
private static final DeferredRegister<CreativeModeTab> CREATIVE_TABS = DeferredRegister.create(Registries.CREATIVE_MODE_TAB, "legendarium");
public static final DeferredRegister<CreativeModeTab> REGISTRY = DeferredRegister.create(Registries.CREATIVE_MODE_TAB, "legendarium");

public static final RegistryObject<CreativeModeTab> TAB_ARTIFACTS = CREATIVE_TABS.register("artifacts", () -> CreativeModeTab.builder().title(Component.translatable("itemGroup.legendarium.artifacts")).icon(() -> new ItemStack(Items.WEAPON_FARAMIR.get())).displayItems((enabledFlags, populator) -> {
for (var item : Items.CONTENT) {
populator.accept(item);
public static final RegistryObject<CreativeModeTab> TAB_ARTIFACTS = REGISTRY.register("artifacts", () -> CreativeModeTab.builder().title(Component.translatable("itemGroup.legendarium.artifacts")).icon(() -> new ItemStack(Items.WEAPON_FARAMIR.get())).displayItems((enabledFlags, populator) -> {
for (var item : Items.REGISTRY.getEntries()) {
populator.accept(item.get());
}
}).build());

private ItemGroups() {
}

public static void register(IEventBus modEventBus) {
CREATIVE_TABS.register(modEventBus);
REGISTRY.register(modEventBus);
}
}
117 changes: 56 additions & 61 deletions appForge/src/main/java/com/github/hummel/legendarium/init/Items.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,75 +8,70 @@
import net.minecraftforge.registries.ForgeRegistries;
import net.minecraftforge.registries.RegistryObject;

import java.util.ArrayList;
import java.util.Collection;

@SuppressWarnings("WeakerAccess")
public class Items {
public static final Collection<Item> CONTENT = new ArrayList<>();

private static final DeferredRegister<Item> ITEMS = DeferredRegister.create(ForgeRegistries.ITEMS, "legendarium");
public static final DeferredRegister<Item> REGISTRY = DeferredRegister.create(ForgeRegistries.ITEMS, "legendarium");

public static final RegistryObject<Item> WEAPON_ACHARN = ITEMS.register("weapon_acharn", ItemColdWeapon::new);
public static final RegistryObject<Item> WEAPON_AEGLOS = ITEMS.register("weapon_aeglos", ItemColdWeapon::new);
public static final RegistryObject<Item> WEAPON_ALATAR = ITEMS.register("weapon_alatar", ItemColdWeapon::new);
public static final RegistryObject<Item> WEAPON_ANGRIST = ITEMS.register("weapon_angrist", ItemColdWeapon::new);
public static final RegistryObject<Item> WEAPON_ANGUIREL = ITEMS.register("weapon_anguirel", ItemColdWeapon::new);
public static final RegistryObject<Item> WEAPON_ARANRUTH = ITEMS.register("weapon_aranruth", ItemColdWeapon::new);
public static final RegistryObject<Item> WEAPON_AZOG = ITEMS.register("weapon_azog", ItemColdWeapon::new);
public static final RegistryObject<Item> WEAPON_BALIN = ITEMS.register("weapon_balin", ItemColdWeapon::new);
public static final RegistryObject<Item> WEAPON_BARAZANTHUAL = ITEMS.register("weapon_barazanthual", ItemColdWeapon::new);
public static final RegistryObject<Item> WEAPON_BOLG = ITEMS.register("weapon_bolg", ItemColdWeapon::new);
public static final RegistryObject<Item> WEAPON_BOROMIR = ITEMS.register("weapon_boromir", ItemColdWeapon::new);
public static final RegistryObject<Item> WEAPON_CELEBORN = ITEMS.register("weapon_celeborn", ItemColdWeapon::new);
public static final RegistryObject<Item> WEAPON_DAGMOR = ITEMS.register("weapon_dagmor", ItemColdWeapon::new);
public static final RegistryObject<Item> WEAPON_DAIN = ITEMS.register("weapon_dain", ItemColdWeapon::new);
public static final RegistryObject<Item> WEAPON_DENETHOR = ITEMS.register("weapon_denethor", ItemColdWeapon::new);
public static final RegistryObject<Item> WEAPON_DORI = ITEMS.register("weapon_dori", ItemColdWeapon::new);
public static final RegistryObject<Item> WEAPON_DRAMBORLEG = ITEMS.register("weapon_dramborleg", ItemColdWeapon::new);
public static final RegistryObject<Item> WEAPON_DURIN = ITEMS.register("weapon_durin", ItemColdWeapon::new);
public static final RegistryObject<Item> WEAPON_DWALIN = ITEMS.register("weapon_dwalin", ItemColdWeapon::new);
public static final RegistryObject<Item> WEAPON_EOTHAIN = ITEMS.register("weapon_eothain", ItemColdWeapon::new);
public static final RegistryObject<Item> WEAPON_EOWYN = ITEMS.register("weapon_eowyn", ItemColdWeapon::new);
public static final RegistryObject<Item> WEAPON_FARAMIR = ITEMS.register("weapon_faramir", ItemColdWeapon::new);
public static final RegistryObject<Item> WEAPON_GAMLING = ITEMS.register("weapon_gamling", ItemColdWeapon::new);
public static final RegistryObject<Item> WEAPON_GIMLI = ITEMS.register("weapon_gimli", ItemColdWeapon::new);
public static final RegistryObject<Item> WEAPON_GIRION = ITEMS.register("weapon_girion", ItemColdWeapon::new);
public static final RegistryObject<Item> WEAPON_GOBLINKING = ITEMS.register("weapon_goblinking", ItemColdWeapon::new);
public static final RegistryObject<Item> WEAPON_GORBAG = ITEMS.register("weapon_gorbag", ItemColdWeapon::new);
public static final RegistryObject<Item> WEAPON_GOTHMOG = ITEMS.register("weapon_gothmog", ItemColdWeapon::new);
public static final RegistryObject<Item> WEAPON_GRIMA = ITEMS.register("weapon_grima", ItemColdWeapon::new);
public static final RegistryObject<Item> WEAPON_GURTHANG = ITEMS.register("weapon_gurthang", ItemColdWeapon::new);
public static final RegistryObject<Item> WEAPON_GUTHWINE = ITEMS.register("weapon_guthwine", ItemColdWeapon::new);
public static final RegistryObject<Item> WEAPON_HADHAFANG = ITEMS.register("weapon_hadhafang", ItemColdWeapon::new);
public static final RegistryObject<Item> WEAPON_HERUGRIM = ITEMS.register("weapon_herugrim", ItemColdWeapon::new);
public static final RegistryObject<Item> WEAPON_KHAMUL = ITEMS.register("weapon_khamul", ItemColdWeapon::new);
public static final RegistryObject<Item> WEAPON_KILI = ITEMS.register("weapon_kili", ItemColdWeapon::new);
public static final RegistryObject<Item> WEAPON_LEGOLAS = ITEMS.register("weapon_legolas", ItemColdWeapon::new);
public static final RegistryObject<Item> WEAPON_MELKOR = ITEMS.register("weapon_melkor", ItemColdWeapon::new);
public static final RegistryObject<Item> WEAPON_MOUTHOFSAURON = ITEMS.register("weapon_mouthofsauron", ItemColdWeapon::new);
public static final RegistryObject<Item> WEAPON_NARCIL = ITEMS.register("weapon_narcil", ItemColdWeapon::new);
public static final RegistryObject<Item> WEAPON_NAZGUL = ITEMS.register("weapon_nazgul", ItemColdWeapon::new);
public static final RegistryObject<Item> WEAPON_ORCRIST = ITEMS.register("weapon_orcrist", ItemColdWeapon::new);
public static final RegistryObject<Item> WEAPON_PALLANDO = ITEMS.register("weapon_pallando", ItemColdWeapon::new);
public static final RegistryObject<Item> WEAPON_RADAGAST = ITEMS.register("weapon_radagast", ItemColdWeapon::new);
public static final RegistryObject<Item> WEAPON_SARUMAN = ITEMS.register("weapon_saruman", ItemColdWeapon::new);
public static final RegistryObject<Item> WEAPON_SHAGRAT = ITEMS.register("weapon_shagrat", ItemColdWeapon::new);
public static final RegistryObject<Item> WEAPON_THORIN = ITEMS.register("weapon_thorin", ItemColdWeapon::new);
public static final RegistryObject<Item> WEAPON_THORONDUN = ITEMS.register("weapon_thorondun", ItemColdWeapon::new);
public static final RegistryObject<Item> WEAPON_THRAIN = ITEMS.register("weapon_thrain", ItemColdWeapon::new);
public static final RegistryObject<Item> WEAPON_THRANDUIL = ITEMS.register("weapon_thranduil", ItemColdWeapon::new);
public static final RegistryObject<Item> WEAPON_THROR = ITEMS.register("weapon_thror", ItemColdWeapon::new);
public static final RegistryObject<Item> WEAPON_URFAEL = ITEMS.register("weapon_urfael", ItemColdWeapon::new);
public static final RegistryObject<Item> WEAPON_WITCHKING = ITEMS.register("weapon_witchking", ItemColdWeapon::new);
public static final RegistryObject<Item> WEAPON_ACHARN = REGISTRY.register("weapon_acharn", ItemColdWeapon::new);
public static final RegistryObject<Item> WEAPON_AEGLOS = REGISTRY.register("weapon_aeglos", ItemColdWeapon::new);
public static final RegistryObject<Item> WEAPON_ALATAR = REGISTRY.register("weapon_alatar", ItemColdWeapon::new);
public static final RegistryObject<Item> WEAPON_ANGRIST = REGISTRY.register("weapon_angrist", ItemColdWeapon::new);
public static final RegistryObject<Item> WEAPON_ANGUIREL = REGISTRY.register("weapon_anguirel", ItemColdWeapon::new);
public static final RegistryObject<Item> WEAPON_ARANRUTH = REGISTRY.register("weapon_aranruth", ItemColdWeapon::new);
public static final RegistryObject<Item> WEAPON_AZOG = REGISTRY.register("weapon_azog", ItemColdWeapon::new);
public static final RegistryObject<Item> WEAPON_BALIN = REGISTRY.register("weapon_balin", ItemColdWeapon::new);
public static final RegistryObject<Item> WEAPON_BARAZANTHUAL = REGISTRY.register("weapon_barazanthual", ItemColdWeapon::new);
public static final RegistryObject<Item> WEAPON_BOLG = REGISTRY.register("weapon_bolg", ItemColdWeapon::new);
public static final RegistryObject<Item> WEAPON_BOROMIR = REGISTRY.register("weapon_boromir", ItemColdWeapon::new);
public static final RegistryObject<Item> WEAPON_CELEBORN = REGISTRY.register("weapon_celeborn", ItemColdWeapon::new);
public static final RegistryObject<Item> WEAPON_DAGMOR = REGISTRY.register("weapon_dagmor", ItemColdWeapon::new);
public static final RegistryObject<Item> WEAPON_DAIN = REGISTRY.register("weapon_dain", ItemColdWeapon::new);
public static final RegistryObject<Item> WEAPON_DENETHOR = REGISTRY.register("weapon_denethor", ItemColdWeapon::new);
public static final RegistryObject<Item> WEAPON_DORI = REGISTRY.register("weapon_dori", ItemColdWeapon::new);
public static final RegistryObject<Item> WEAPON_DRAMBORLEG = REGISTRY.register("weapon_dramborleg", ItemColdWeapon::new);
public static final RegistryObject<Item> WEAPON_DURIN = REGISTRY.register("weapon_durin", ItemColdWeapon::new);
public static final RegistryObject<Item> WEAPON_DWALIN = REGISTRY.register("weapon_dwalin", ItemColdWeapon::new);
public static final RegistryObject<Item> WEAPON_EOTHAIN = REGISTRY.register("weapon_eothain", ItemColdWeapon::new);
public static final RegistryObject<Item> WEAPON_EOWYN = REGISTRY.register("weapon_eowyn", ItemColdWeapon::new);
public static final RegistryObject<Item> WEAPON_FARAMIR = REGISTRY.register("weapon_faramir", ItemColdWeapon::new);
public static final RegistryObject<Item> WEAPON_GAMLING = REGISTRY.register("weapon_gamling", ItemColdWeapon::new);
public static final RegistryObject<Item> WEAPON_GIMLI = REGISTRY.register("weapon_gimli", ItemColdWeapon::new);
public static final RegistryObject<Item> WEAPON_GIRION = REGISTRY.register("weapon_girion", ItemColdWeapon::new);
public static final RegistryObject<Item> WEAPON_GOBLINKING = REGISTRY.register("weapon_goblinking", ItemColdWeapon::new);
public static final RegistryObject<Item> WEAPON_GORBAG = REGISTRY.register("weapon_gorbag", ItemColdWeapon::new);
public static final RegistryObject<Item> WEAPON_GOTHMOG = REGISTRY.register("weapon_gothmog", ItemColdWeapon::new);
public static final RegistryObject<Item> WEAPON_GRIMA = REGISTRY.register("weapon_grima", ItemColdWeapon::new);
public static final RegistryObject<Item> WEAPON_GURTHANG = REGISTRY.register("weapon_gurthang", ItemColdWeapon::new);
public static final RegistryObject<Item> WEAPON_GUTHWINE = REGISTRY.register("weapon_guthwine", ItemColdWeapon::new);
public static final RegistryObject<Item> WEAPON_HADHAFANG = REGISTRY.register("weapon_hadhafang", ItemColdWeapon::new);
public static final RegistryObject<Item> WEAPON_HERUGRIM = REGISTRY.register("weapon_herugrim", ItemColdWeapon::new);
public static final RegistryObject<Item> WEAPON_KHAMUL = REGISTRY.register("weapon_khamul", ItemColdWeapon::new);
public static final RegistryObject<Item> WEAPON_KILI = REGISTRY.register("weapon_kili", ItemColdWeapon::new);
public static final RegistryObject<Item> WEAPON_LEGOLAS = REGISTRY.register("weapon_legolas", ItemColdWeapon::new);
public static final RegistryObject<Item> WEAPON_MELKOR = REGISTRY.register("weapon_melkor", ItemColdWeapon::new);
public static final RegistryObject<Item> WEAPON_MOUTHOFSAURON = REGISTRY.register("weapon_mouthofsauron", ItemColdWeapon::new);
public static final RegistryObject<Item> WEAPON_NARCIL = REGISTRY.register("weapon_narcil", ItemColdWeapon::new);
public static final RegistryObject<Item> WEAPON_NAZGUL = REGISTRY.register("weapon_nazgul", ItemColdWeapon::new);
public static final RegistryObject<Item> WEAPON_ORCRIST = REGISTRY.register("weapon_orcrist", ItemColdWeapon::new);
public static final RegistryObject<Item> WEAPON_PALLANDO = REGISTRY.register("weapon_pallando", ItemColdWeapon::new);
public static final RegistryObject<Item> WEAPON_RADAGAST = REGISTRY.register("weapon_radagast", ItemColdWeapon::new);
public static final RegistryObject<Item> WEAPON_SARUMAN = REGISTRY.register("weapon_saruman", ItemColdWeapon::new);
public static final RegistryObject<Item> WEAPON_SHAGRAT = REGISTRY.register("weapon_shagrat", ItemColdWeapon::new);
public static final RegistryObject<Item> WEAPON_THORIN = REGISTRY.register("weapon_thorin", ItemColdWeapon::new);
public static final RegistryObject<Item> WEAPON_THORONDUN = REGISTRY.register("weapon_thorondun", ItemColdWeapon::new);
public static final RegistryObject<Item> WEAPON_THRAIN = REGISTRY.register("weapon_thrain", ItemColdWeapon::new);
public static final RegistryObject<Item> WEAPON_THRANDUIL = REGISTRY.register("weapon_thranduil", ItemColdWeapon::new);
public static final RegistryObject<Item> WEAPON_THROR = REGISTRY.register("weapon_thror", ItemColdWeapon::new);
public static final RegistryObject<Item> WEAPON_URFAEL = REGISTRY.register("weapon_urfael", ItemColdWeapon::new);
public static final RegistryObject<Item> WEAPON_WITCHKING = REGISTRY.register("weapon_witchking", ItemColdWeapon::new);

public static final RegistryObject<Item> ARKENSTONE = ITEMS.register("arkenstone", ItemGem::new);
public static final RegistryObject<Item> SILMARIL = ITEMS.register("silmaril", ItemGem::new);
public static final RegistryObject<Item> ARKENSTONE = REGISTRY.register("arkenstone", ItemGem::new);
public static final RegistryObject<Item> SILMARIL = REGISTRY.register("silmaril", ItemGem::new);

private Items() {
}

public static void register(IEventBus modEventBus) {
ITEMS.register(modEventBus);
REGISTRY.register(modEventBus);
}
}
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
package com.github.hummel.legendarium.item;

import com.github.hummel.legendarium.init.Items;
import net.minecraft.world.item.SwordItem;
import net.minecraft.world.item.Tiers;

public class ItemColdWeapon extends SwordItem {
public ItemColdWeapon() {
super(Tiers.DIAMOND, 3, -2.4f, new Properties());
Items.CONTENT.add(this);
}
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
package com.github.hummel.legendarium.item;

import com.github.hummel.legendarium.init.Items;
import net.minecraft.world.item.Item;

public class ItemGem extends Item {
public ItemGem() {
super(new Properties().stacksTo(1));
Items.CONTENT.add(this);
}
}
Loading

0 comments on commit a085740

Please sign in to comment.