geforkt von Mirrors/Paper
Make schedule command per-world
Dieser Commit ist enthalten in:
Ursprung
3daa3905f0
Commit
0faa210781
@ -1,5 +1,14 @@
|
|||||||
--- a/net/minecraft/server/commands/ScheduleCommand.java
|
--- a/net/minecraft/server/commands/ScheduleCommand.java
|
||||||
+++ b/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 @@
|
@@ -58,7 +58,7 @@
|
||||||
} else {
|
} else {
|
||||||
long j = source.getLevel().getGameTime() + (long) time;
|
long j = source.getLevel().getGameTime() + (long) time;
|
||||||
@ -9,3 +18,12 @@
|
|||||||
Optional<net.minecraft.commands.functions.CommandFunction<CommandSourceStack>> optional = ((Either) function.getSecond()).left();
|
Optional<net.minecraft.commands.functions.CommandFunction<CommandSourceStack>> optional = ((Either) function.getSecond()).left();
|
||||||
String s;
|
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);
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren