From ac320235a27a6d3ff0d8e660a1222792f4acd5e8 Mon Sep 17 00:00:00 2001 From: Flanks255 <32142731+Flanks255@users.noreply.github.com> Date: Mon, 22 Jul 2024 16:22:30 -0500 Subject: [PATCH] Go Go Deferred Register... --- .../mod/ActuallyAdditions.java | 8 ++- .../mod/material/ArmorMaterials.java | 70 ++++++++----------- 2 files changed, 34 insertions(+), 44 deletions(-) diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/ActuallyAdditions.java b/src/main/java/de/ellpeck/actuallyadditions/mod/ActuallyAdditions.java index 57b9908c9..c7c09cf2a 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/ActuallyAdditions.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/ActuallyAdditions.java @@ -36,6 +36,7 @@ import de.ellpeck.actuallyadditions.mod.inventory.ActuallyContainers; import de.ellpeck.actuallyadditions.mod.items.ActuallyItems; import de.ellpeck.actuallyadditions.mod.items.Worm; import de.ellpeck.actuallyadditions.mod.lootmodifier.ActuallyLootModifiers; +import de.ellpeck.actuallyadditions.mod.material.ArmorMaterials; import de.ellpeck.actuallyadditions.mod.misc.apiimpl.LaserRelayConnectionHandler; import de.ellpeck.actuallyadditions.mod.misc.apiimpl.MethodHandler; import de.ellpeck.actuallyadditions.mod.network.PacketHandler; @@ -118,6 +119,7 @@ public class ActuallyAdditions { ActuallyComponents.init(eventBus); ActuallyLootModifiers.init(eventBus); ActuallyContainers.CONTAINERS.register(eventBus); + ArmorMaterials.init(eventBus); ENTITIES.register(eventBus); CONDITION_CODECS.register(eventBus); BIOME_MODIFIER_SERIALIZERS.register(eventBus); @@ -139,10 +141,10 @@ public class ActuallyAdditions { eventBus.addListener(this::setup); if (dist.isClient()) { - eventBus.addListener(ActuallyAdditionsClient::setup); + eventBus.addListener(ActuallyAdditionsClient::setup); eventBus.addListener(ActuallyAdditionsClient::setupMenus); - eventBus.addListener(ActuallyAdditionsClient::setupSpecialRenders); - eventBus.addListener(ActuallyAdditionsClient::registerParticleFactories); + eventBus.addListener(ActuallyAdditionsClient::setupSpecialRenders); + eventBus.addListener(ActuallyAdditionsClient::registerParticleFactories); eventBus.register(new ClientRegistryHandler()); } IFarmerBehavior.initBehaviors(); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/material/ArmorMaterials.java b/src/main/java/de/ellpeck/actuallyadditions/mod/material/ArmorMaterials.java index 54241ff65..863ed2e36 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/material/ArmorMaterials.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/material/ArmorMaterials.java @@ -5,23 +5,29 @@ import net.minecraft.Util; import net.minecraft.core.Holder; import net.minecraft.core.Registry; import net.minecraft.core.registries.BuiltInRegistries; +import net.minecraft.core.registries.Registries; import net.minecraft.resources.ResourceLocation; import net.minecraft.sounds.SoundEvent; import net.minecraft.sounds.SoundEvents; import net.minecraft.world.item.ArmorItem; import net.minecraft.world.item.ArmorMaterial; import net.minecraft.world.item.crafting.Ingredient; +import net.neoforged.bus.api.IEventBus; +import net.neoforged.neoforge.registries.DeferredHolder; +import net.neoforged.neoforge.registries.DeferredRegister; import java.util.EnumMap; import java.util.List; +import java.util.Map; import java.util.function.Supplier; /** * Complete copy paste from {@link net.minecraft.world.item.ArmorMaterial} *
- * todo validate all values refect correctly
+ * //TODO validate all values refect correctly
*/
public class ArmorMaterials {
+ public static final DeferredRegister