diff --git a/forge/src/main/java/net/blay09/mods/hardcorerevival/ForgeHardcoreRevival.java b/forge/src/main/java/net/blay09/mods/hardcorerevival/ForgeHardcoreRevival.java index 0f730f5..3d704e9 100644 --- a/forge/src/main/java/net/blay09/mods/hardcorerevival/ForgeHardcoreRevival.java +++ b/forge/src/main/java/net/blay09/mods/hardcorerevival/ForgeHardcoreRevival.java @@ -49,7 +49,7 @@ private void registerCapabilities(RegisterCapabilitiesEvent event) { private void attachEntityCapabilities(AttachCapabilitiesEvent event) { if (event.getObject() instanceof Player) { - event.addCapability(new ResourceLocation(HardcoreRevival.MOD_ID, "entity_data"), new ICapabilityProvider() { + event.addCapability(ResourceLocation.fromNamespaceAndPath(HardcoreRevival.MOD_ID, "entity_data"), new ICapabilityProvider() { private LazyOptional revival; private LazyOptional getRevivalCapabilityInstance() { diff --git a/forge/src/main/java/net/blay09/mods/hardcorerevival/compat/MrCrayfishsGunModAddon.java b/forge/src/main/java/net/blay09/mods/hardcorerevival/compat/MrCrayfishsGunModAddon.java index 5d53aa6..4ccba17 100644 --- a/forge/src/main/java/net/blay09/mods/hardcorerevival/compat/MrCrayfishsGunModAddon.java +++ b/forge/src/main/java/net/blay09/mods/hardcorerevival/compat/MrCrayfishsGunModAddon.java @@ -11,7 +11,7 @@ import java.util.Objects; public class MrCrayfishsGunModAddon { - private final ResourceLocation PISTOL = new ResourceLocation("cgm:pistol"); + private final ResourceLocation PISTOL = ResourceLocation.fromNamespaceAndPath("cgm", "pistol"); public MrCrayfishsGunModAddon() { MinecraftForge.EVENT_BUS.register(this); diff --git a/neoforge/src/main/java/net/blay09/mods/hardcorerevival/NeoForgeHardcoreRevival.java b/neoforge/src/main/java/net/blay09/mods/hardcorerevival/NeoForgeHardcoreRevival.java index 84441fb..2826595 100644 --- a/neoforge/src/main/java/net/blay09/mods/hardcorerevival/NeoForgeHardcoreRevival.java +++ b/neoforge/src/main/java/net/blay09/mods/hardcorerevival/NeoForgeHardcoreRevival.java @@ -1,17 +1,13 @@ package net.blay09.mods.hardcorerevival; import net.blay09.mods.balm.api.Balm; -import net.blay09.mods.balm.api.client.BalmClient; import net.blay09.mods.balm.neoforge.NeoForgeLoadContext; import net.blay09.mods.balm.neoforge.provider.NeoForgeBalmProviders; import net.blay09.mods.hardcorerevival.capability.HardcoreRevivalData; import net.blay09.mods.hardcorerevival.capability.HardcoreRevivalDataImpl; -import net.blay09.mods.hardcorerevival.client.HardcoreRevivalClient; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.entity.EntityType; -import net.neoforged.api.distmarker.Dist; import net.neoforged.bus.api.IEventBus; -import net.neoforged.fml.DistExecutor; import net.neoforged.fml.common.Mod; import net.neoforged.neoforge.capabilities.EntityCapability; import net.neoforged.neoforge.capabilities.RegisterCapabilitiesEvent; @@ -19,13 +15,12 @@ @Mod(HardcoreRevival.MOD_ID) public class NeoForgeHardcoreRevival { - private final EntityCapability hardcoreRevivalDataCapability = EntityCapability.createVoid(new ResourceLocation(HardcoreRevival.MOD_ID, + private final EntityCapability hardcoreRevivalDataCapability = EntityCapability.createVoid(ResourceLocation.fromNamespaceAndPath(HardcoreRevival.MOD_ID, "entity_data"), HardcoreRevivalData.class); public NeoForgeHardcoreRevival(IEventBus eventBus) { final var context = new NeoForgeLoadContext(eventBus); Balm.initialize(HardcoreRevival.MOD_ID, context, HardcoreRevival::initialize); - DistExecutor.runWhenOn(Dist.CLIENT, () -> () -> BalmClient.initialize(HardcoreRevival.MOD_ID, context, HardcoreRevivalClient::initialize)); eventBus.addListener(this::registerCapabilities); diff --git a/neoforge/src/main/java/net/blay09/mods/hardcorerevival/client/NeoForgeHardcoreRevivalClient.java b/neoforge/src/main/java/net/blay09/mods/hardcorerevival/client/NeoForgeHardcoreRevivalClient.java new file mode 100644 index 0000000..1df83a3 --- /dev/null +++ b/neoforge/src/main/java/net/blay09/mods/hardcorerevival/client/NeoForgeHardcoreRevivalClient.java @@ -0,0 +1,17 @@ +package net.blay09.mods.hardcorerevival.client; + +import net.blay09.mods.balm.api.client.BalmClient; +import net.blay09.mods.balm.neoforge.NeoForgeLoadContext; +import net.blay09.mods.hardcorerevival.HardcoreRevival; +import net.neoforged.api.distmarker.Dist; +import net.neoforged.bus.api.IEventBus; +import net.neoforged.fml.common.Mod; + +@Mod(value = HardcoreRevival.MOD_ID, dist = Dist.CLIENT) +public class NeoForgeHardcoreRevivalClient { + + public NeoForgeHardcoreRevivalClient(IEventBus eventBus) { + final var context = new NeoForgeLoadContext(eventBus); + BalmClient.initialize(HardcoreRevival.MOD_ID, context, HardcoreRevivalClient::initialize); + } +}