Skip to content

Commit

Permalink
fix: OnDatapackSyncEvent not being fired do to missing static
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelHillcox committed Sep 24, 2022
1 parent 6314278 commit 0288b1c
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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();
Expand All @@ -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) {
Expand Down

0 comments on commit 0288b1c

Please sign in to comment.