File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
src/main/resources/neoforge-1.20.6/templates/modbase Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -31,8 +31,9 @@ import net.minecraft.nbt.Tag;
3131 </#if >
3232 }
3333
34- <#if w.hasVariablesOfScope("PLAYER_LIFETIME") || w.hasVariablesOfScope("PLAYER_PERSISTENT") >
35- @EventBusSubscriber public static class EventBusVariableHandlers {
34+ <#if w.hasVariablesOfScope("GLOBAL_WORLD") || w.hasVariablesOfScope("GLOBAL_MAP") || w.hasVariablesOfScope("PLAYER_LIFETIME") || w.hasVariablesOfScope("PLAYER_PERSISTENT") >
35+ @Mod.EventBusSubscriber public static class EventBusVariableHandlers {
36+ <#if w.hasVariablesOfScope("PLAYER_LIFETIME") || w.hasVariablesOfScope("PLAYER_PERSISTENT") >
3637 @SubscribeEvent public static void onPlayerLoggedInSyncPlayerVariables(PlayerEvent.PlayerLoggedInEvent event) {
3738 if (event.getEntity() instanceof ServerPlayer player)
3839 PacketDistributor.sendToPlayer(player, new PlayerVariablesSyncMessage(player.getData(PLAYER_VARIABLES)));
@@ -109,8 +110,8 @@ import net.minecraft.nbt.Tag;
109110 }
110111 }
111112 }
112- }
113- </# if >
113+ </# if >
114+ }
114115
115116 <#if w.hasVariablesOfScope("GLOBAL_WORLD") || w.hasVariablesOfScope("GLOBAL_MAP") >
116117 public static class WorldVariables extends SavedData {
@@ -336,6 +337,5 @@ import net.minecraft.nbt.Tag;
336337
337338 }
338339 </#if >
339-
340340}
341- <#-- @formatter:on -->
341+ <#-- @formatter:on -->
You can’t perform that action at this time.
0 commit comments