From 0288b1c43d792af7cdd6e05b58dbeed0c39506be Mon Sep 17 00:00:00 2001 From: Michael Hillcox Date: Sat, 24 Sep 2022 17:12:29 +0100 Subject: [PATCH] fix: OnDatapackSyncEvent not being fired do to missing static --- .../avaritia/init/handler/SingularityRegistryHandler.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/java/nova/committee/avaritia/init/handler/SingularityRegistryHandler.java b/src/main/java/nova/committee/avaritia/init/handler/SingularityRegistryHandler.java index 10fd0e3a..6a66c665 100644 --- a/src/main/java/nova/committee/avaritia/init/handler/SingularityRegistryHandler.java +++ b/src/main/java/nova/committee/avaritia/init/handler/SingularityRegistryHandler.java @@ -14,6 +14,7 @@ import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.loading.FMLPaths; import net.minecraftforge.network.PacketDistributor; +import nova.committee.avaritia.Avaritia; import nova.committee.avaritia.Static; import nova.committee.avaritia.common.item.singularity.Singularity; import nova.committee.avaritia.common.net.SyncSingularitiesPacket; @@ -37,7 +38,7 @@ * Date: 2022/4/2 12:35 * Version: 1.0 */ -@Mod.EventBusSubscriber(bus = Mod.EventBusSubscriber.Bus.FORGE) +@Mod.EventBusSubscriber public class SingularityRegistryHandler { private static final SingularityRegistryHandler INSTANCE = new SingularityRegistryHandler(); private static final Gson GSON = (new GsonBuilder()).setPrettyPrinting().create(); @@ -49,8 +50,8 @@ public static SingularityRegistryHandler getInstance() { } @SubscribeEvent - public void onDatapackSync(OnDatapackSyncEvent event) { - var message = new SyncSingularitiesPacket(this.getSingularities()); + public static void onDatapackSync(OnDatapackSyncEvent event) { + var message = new SyncSingularitiesPacket(SingularityRegistryHandler.getInstance().getSingularities()); var player = event.getPlayer(); if (player != null) {