diff --git a/implementations/forge-1.16.2/src/main/java/de/bluecolored/bluemap/forge/ForgeMod.java b/implementations/forge-1.16.2/src/main/java/de/bluecolored/bluemap/forge/ForgeMod.java index ba5ae327..280c0091 100644 --- a/implementations/forge-1.16.2/src/main/java/de/bluecolored/bluemap/forge/ForgeMod.java +++ b/implementations/forge-1.16.2/src/main/java/de/bluecolored/bluemap/forge/ForgeMod.java @@ -43,6 +43,7 @@ import net.minecraft.util.registry.Registry; import net.minecraft.world.World; import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.event.RegisterCommandsEvent; import net.minecraftforge.event.TickEvent.ServerTickEvent; import net.minecraftforge.event.entity.player.PlayerEvent.PlayerLoggedInEvent; import net.minecraftforge.event.entity.player.PlayerEvent.PlayerLoggedOutEvent; @@ -99,9 +100,12 @@ public ForgeMod() { @SubscribeEvent public void onServerStarting(FMLServerStartingEvent event) { this.serverInstance = event.getServer(); + } + @SubscribeEvent + public void onRegisterCommands(RegisterCommandsEvent event) { //register commands - new Commands<>(pluginInstance, event.getServer().getCommandManager().getDispatcher(), forgeSource -> + new Commands<>(pluginInstance, event.getDispatcher(), forgeSource -> new ForgeCommandSource(this, pluginInstance, forgeSource) ); } diff --git a/implementations/forge-1.17.1/src/main/java/de/bluecolored/bluemap/forge/ForgeMod.java b/implementations/forge-1.17.1/src/main/java/de/bluecolored/bluemap/forge/ForgeMod.java index b157b422..8d1407cf 100644 --- a/implementations/forge-1.17.1/src/main/java/de/bluecolored/bluemap/forge/ForgeMod.java +++ b/implementations/forge-1.17.1/src/main/java/de/bluecolored/bluemap/forge/ForgeMod.java @@ -43,6 +43,7 @@ import net.minecraft.server.level.ServerPlayer; import net.minecraft.world.level.Level; import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.event.RegisterCommandsEvent; import net.minecraftforge.event.TickEvent.ServerTickEvent; import net.minecraftforge.event.entity.player.PlayerEvent.PlayerLoggedInEvent; import net.minecraftforge.event.entity.player.PlayerEvent.PlayerLoggedOutEvent; @@ -98,9 +99,12 @@ public ForgeMod() { @SubscribeEvent public void onServerStarting(FMLServerStartingEvent event) { this.serverInstance = event.getServer(); + } + @SubscribeEvent + public void onRegisterCommands(RegisterCommandsEvent event) { //register commands - new Commands<>(pluginInstance, event.getServer().getCommands().getDispatcher(), forgeSource -> + new Commands<>(pluginInstance, event.getDispatcher(), forgeSource -> new ForgeCommandSource(this, pluginInstance, forgeSource) ); } diff --git a/implementations/forge-1.18.1/src/main/java/de/bluecolored/bluemap/forge/ForgeMod.java b/implementations/forge-1.18.1/src/main/java/de/bluecolored/bluemap/forge/ForgeMod.java index dfa28786..20f11050 100644 --- a/implementations/forge-1.18.1/src/main/java/de/bluecolored/bluemap/forge/ForgeMod.java +++ b/implementations/forge-1.18.1/src/main/java/de/bluecolored/bluemap/forge/ForgeMod.java @@ -43,6 +43,7 @@ import net.minecraft.server.level.ServerPlayer; import net.minecraft.world.level.Level; import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.event.RegisterCommandsEvent; import net.minecraftforge.event.TickEvent.ServerTickEvent; import net.minecraftforge.event.entity.player.PlayerEvent.PlayerLoggedInEvent; import net.minecraftforge.event.entity.player.PlayerEvent.PlayerLoggedOutEvent; @@ -98,9 +99,12 @@ public ForgeMod() { @SubscribeEvent public void onServerStarting(ServerStartingEvent event) { this.serverInstance = event.getServer(); + } + @SubscribeEvent + public void onRegisterCommands(RegisterCommandsEvent event) { //register commands - new Commands<>(pluginInstance, event.getServer().getCommands().getDispatcher(), forgeSource -> + new Commands<>(pluginInstance, event.getDispatcher(), forgeSource -> new ForgeCommandSource(this, pluginInstance, forgeSource) ); } diff --git a/implementations/forge-1.19.1/src/main/java/de/bluecolored/bluemap/forge/ForgeMod.java b/implementations/forge-1.19.1/src/main/java/de/bluecolored/bluemap/forge/ForgeMod.java index 04e3c698..e45a043b 100644 --- a/implementations/forge-1.19.1/src/main/java/de/bluecolored/bluemap/forge/ForgeMod.java +++ b/implementations/forge-1.19.1/src/main/java/de/bluecolored/bluemap/forge/ForgeMod.java @@ -43,6 +43,7 @@ import net.minecraft.server.level.ServerPlayer; import net.minecraft.world.level.Level; import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.event.RegisterCommandsEvent; import net.minecraftforge.event.TickEvent.ServerTickEvent; import net.minecraftforge.event.entity.player.PlayerEvent.PlayerLoggedInEvent; import net.minecraftforge.event.entity.player.PlayerEvent.PlayerLoggedOutEvent; @@ -98,9 +99,12 @@ public ForgeMod() { @SubscribeEvent public void onServerStarting(ServerStartingEvent event) { this.serverInstance = event.getServer(); + } + @SubscribeEvent + public void onRegisterCommands(RegisterCommandsEvent event) { //register commands - new Commands<>(pluginInstance, event.getServer().getCommands().getDispatcher(), forgeSource -> + new Commands<>(pluginInstance, event.getDispatcher(), forgeSource -> new ForgeCommandSource(this, pluginInstance, forgeSource) ); } diff --git a/implementations/forge-1.19/src/main/java/de/bluecolored/bluemap/forge/ForgeMod.java b/implementations/forge-1.19/src/main/java/de/bluecolored/bluemap/forge/ForgeMod.java index daa1a6b3..6a94e82c 100644 --- a/implementations/forge-1.19/src/main/java/de/bluecolored/bluemap/forge/ForgeMod.java +++ b/implementations/forge-1.19/src/main/java/de/bluecolored/bluemap/forge/ForgeMod.java @@ -43,6 +43,7 @@ import net.minecraft.server.level.ServerPlayer; import net.minecraft.world.level.Level; import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.event.RegisterCommandsEvent; import net.minecraftforge.event.TickEvent.ServerTickEvent; import net.minecraftforge.event.entity.player.PlayerEvent.PlayerLoggedInEvent; import net.minecraftforge.event.entity.player.PlayerEvent.PlayerLoggedOutEvent; @@ -98,9 +99,12 @@ public ForgeMod() { @SubscribeEvent public void onServerStarting(ServerStartingEvent event) { this.serverInstance = event.getServer(); + } + @SubscribeEvent + public void onRegisterCommands(RegisterCommandsEvent event) { //register commands - new Commands<>(pluginInstance, event.getServer().getCommands().getDispatcher(), forgeSource -> + new Commands<>(pluginInstance, event.getDispatcher(), forgeSource -> new ForgeCommandSource(this, pluginInstance, forgeSource) ); }