1
0
mirror of https://github.com/lucko/LuckPerms.git synced 2025-08-22 22:22:56 +02:00

Add workaround for Forge eventbus limitation

This commit is contained in:
Luck
2025-06-19 19:09:40 +01:00
parent 0af1038d81
commit 8d9c5bf401

View File

@@ -37,6 +37,7 @@ import net.minecraft.commands.Commands;
import net.minecraft.commands.arguments.EntityArgument;
import net.minecraft.server.level.ServerPlayer;
import net.minecraftforge.event.RegisterCommandsEvent;
import net.minecraftforge.event.server.ServerStartedEvent;
import net.minecraftforge.eventbus.api.listener.SubscribeEvent;
import java.util.List;
@@ -65,6 +66,12 @@ public class ForgeCommandExecutor extends BrigadierCommandExecutor<CommandSource
}
}
// not used - workaround for the idiotic Forge limitation that requires listeners using the @SubscribeEvent annotation to have at least two listener methods
@SubscribeEvent
public void onServerStarted(ServerStartedEvent event) {
}
@Override
public Sender getSender(CommandSourceStack source) {
return this.plugin.getSenderFactory().wrap(source);