mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-29 15:49:00 +01:00
Make schedule command per-world
This commit is contained in:
parent
3daa3905f0
commit
0faa210781
1 changed files with 18 additions and 0 deletions
|
@ -1,5 +1,14 @@
|
|||
--- a/net/minecraft/server/commands/ScheduleCommand.java
|
||||
+++ b/net/minecraft/server/commands/ScheduleCommand.java
|
||||
@@ -33,7 +33,7 @@
|
||||
});
|
||||
private static final SimpleCommandExceptionType ERROR_MACRO = new SimpleCommandExceptionType(Component.translatableEscape("commands.schedule.macro"));
|
||||
private static final SuggestionProvider<CommandSourceStack> SUGGEST_SCHEDULE = (commandcontext, suggestionsbuilder) -> {
|
||||
- return SharedSuggestionProvider.suggest((Iterable) ((CommandSourceStack) commandcontext.getSource()).getServer().getWorldData().overworldData().getScheduledEvents().getEventsIds(), suggestionsbuilder);
|
||||
+ return SharedSuggestionProvider.suggest((Iterable) ((net.minecraft.commands.CommandSourceStack) commandcontext.getSource()).getLevel().serverLevelData.getScheduledEvents().getEventsIds(), suggestionsbuilder); // Paper - Make schedule command per-world
|
||||
};
|
||||
|
||||
public ScheduleCommand() {}
|
||||
@@ -58,7 +58,7 @@
|
||||
} else {
|
||||
long j = source.getLevel().getGameTime() + (long) time;
|
||||
|
@ -9,3 +18,12 @@
|
|||
Optional<net.minecraft.commands.functions.CommandFunction<CommandSourceStack>> optional = ((Either) function.getSecond()).left();
|
||||
String s;
|
||||
|
||||
@@ -93,7 +93,7 @@
|
||||
}
|
||||
|
||||
private static int remove(CommandSourceStack source, String eventName) throws CommandSyntaxException {
|
||||
- int i = source.getServer().getWorldData().overworldData().getScheduledEvents().remove(eventName);
|
||||
+ int i = source.getLevel().serverLevelData.getScheduledEvents().remove(eventName); // Paper - Make schedule command per-world
|
||||
|
||||
if (i == 0) {
|
||||
throw ScheduleCommand.ERROR_CANT_REMOVE.create(eventName);
|
||||
|
|
Loading…
Reference in a new issue