Skip to content

Commit fe5b0bb

Browse files
authored
Fix
1 parent ab7dca4 commit fe5b0bb

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/main/resources/neoforge-1.20.6/templates/modbase/variableslist.java.ftl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff 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 -->

0 commit comments

Comments
 (0)