changes in 1.16 require to re-register commands after datapack reload. May affect extensions with custom CMs - doubt there is any.
This commit is contained in:
1 parent
c94ba6a021
commit
d6845487ce
2 files changed
+7
-3
No files matched your search
@@ -80,6 +80,11 @@ public class CarpetServer // static for now - easier to handle all around the co
|
|||||||
|
|
||||||
public static void registerCarpetCommands(CommandDispatcher<ServerCommandSource> dispatcher)
|
public static void registerCarpetCommands(CommandDispatcher<ServerCommandSource> dispatcher)
|
||||||
{
|
{
|
||||||
|
settingsManager.registerCommand(dispatcher);
|
||||||
|
extensions.forEach(e -> {
|
||||||
|
SettingsManager sm = e.customSettingsManager();
|
||||||
|
if (sm != null) sm.registerCommand(dispatcher);
|
||||||
|
});
|
||||||
TickCommand.register(dispatcher);
|
TickCommand.register(dispatcher);
|
||||||
ProfileCommand.register(dispatcher);
|
ProfileCommand.register(dispatcher);
|
||||||
CounterCommand.register(dispatcher);
|
CounterCommand.register(dispatcher);
|
||||||
@@ -100,6 +105,7 @@ public class CarpetServer // static for now - easier to handle all around the co
|
|||||||
|
|
||||||
if (FabricLoader.getInstance().isDevelopmentEnvironment())
|
if (FabricLoader.getInstance().isDevelopmentEnvironment())
|
||||||
TestCommand.register(dispatcher);
|
TestCommand.register(dispatcher);
|
||||||
|
// todo 1.16 - re-registerer apps if that's a reload operation.
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void onPlayerLoggedIn(ServerPlayerEntity player)
|
public static void onPlayerLoggedIn(ServerPlayerEntity player)
|
||||||
|
|||||||
@@ -76,8 +76,6 @@ public class SettingsManager
|
|||||||
{
|
{
|
||||||
this.server = server;
|
this.server = server;
|
||||||
loadConfigurationFromConf();
|
loadConfigurationFromConf();
|
||||||
registerCommand(server.getCommandManager().getDispatcher());
|
|
||||||
notifyPlayersCommandsChanged();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void detachServer()
|
public void detachServer()
|
||||||
@@ -359,7 +357,7 @@ public class SettingsManager
|
|||||||
return rule;
|
return rule;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void registerCommand(CommandDispatcher<ServerCommandSource> dispatcher)
|
public void registerCommand(CommandDispatcher<ServerCommandSource> dispatcher)
|
||||||
{
|
{
|
||||||
if (dispatcher.getRoot().getChildren().stream().anyMatch(node -> node.getName().equalsIgnoreCase(identifier)))
|
if (dispatcher.getRoot().getChildren().stream().anyMatch(node -> node.getName().equalsIgnoreCase(identifier)))
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in new issue
Block a user