mirror of
https://github.com/BlueMap-Minecraft/BlueMap.git
synced 2024-11-24 19:46:29 +01:00
Register forge-commands on the correct event
This commit is contained in:
parent
35cbdf67d6
commit
3c866b317d
@ -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)
|
||||
);
|
||||
}
|
||||
|
@ -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)
|
||||
);
|
||||
}
|
||||
|
@ -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)
|
||||
);
|
||||
}
|
||||
|
@ -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)
|
||||
);
|
||||
}
|
||||
|
@ -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)
|
||||
);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user