diff --git a/build-data/paper.at b/build-data/paper.at index 66e6e8c5ed..235ae06d79 100644 --- a/build-data/paper.at +++ b/build-data/paper.at @@ -141,6 +141,7 @@ public net.minecraft.world.entity.Entity isInBubbleColumn()Z # Allow delegation to vanilla chunk gen public org.bukkit.craftbukkit.generator.CustomChunkGenerator delegate +private-f org.bukkit.craftbukkit.generator.CraftChunkData sections # Optimize redstone algorithm public net.minecraft.world.level.block.RedStoneWireBlock shouldSignal diff --git a/patches/server/Allow-delegation-to-vanilla-chunk-gen.patch b/patches/server/Allow-delegation-to-vanilla-chunk-gen.patch index c19158c6c2..c0619c0421 100644 --- a/patches/server/Allow-delegation-to-vanilla-chunk-gen.patch +++ b/patches/server/Allow-delegation-to-vanilla-chunk-gen.patch @@ -45,15 +45,6 @@ diff --git a/src/main/java/org/bukkit/craftbukkit/generator/CraftChunkData.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/craftbukkit/generator/CraftChunkData.java +++ b/src/main/java/org/bukkit/craftbukkit/generator/CraftChunkData.java -@@ -0,0 +0,0 @@ import org.bukkit.material.MaterialData; - public final class CraftChunkData implements ChunkGenerator.ChunkData { - private final int minHeight; - private final int maxHeight; -- private final LevelChunkSection[] sections; -+ private LevelChunkSection[] sections; // Paper - remove final - private Set tiles; - private World world; // Paper - Anti-Xray - Add parameters - @@ -0,0 +0,0 @@ public final class CraftChunkData implements ChunkGenerator.ChunkData { return this.sections; } diff --git a/patches/server/Anti-Xray.patch b/patches/server/Anti-Xray.patch index a714327613..d4418e55a0 100644 --- a/patches/server/Anti-Xray.patch +++ b/patches/server/Anti-Xray.patch @@ -1431,9 +1431,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/org/bukkit/craftbukkit/generator/CraftChunkData.java +++ b/src/main/java/org/bukkit/craftbukkit/generator/CraftChunkData.java @@ -0,0 +0,0 @@ public final class CraftChunkData implements ChunkGenerator.ChunkData { - private final int maxHeight; - private final LevelChunkSection[] sections; + private LevelChunkSection[] sections; private Set tiles; + private final Set lights = new HashSet<>(); + private World world; // Paper - Anti-Xray - Add parameters public CraftChunkData(World world) { diff --git a/patches/server/Make-schedule-command-per-world.patch b/patches/server/Make-schedule-command-per-world.patch index 4c5b15bfd2..e6c0d235cd 100644 --- a/patches/server/Make-schedule-command-per-world.patch +++ b/patches/server/Make-schedule-command-per-world.patch @@ -9,29 +9,20 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/net/minecraft/server/commands/ScheduleCommand.java +++ b/src/main/java/net/minecraft/server/commands/ScheduleCommand.java @@ -0,0 +0,0 @@ public class ScheduleCommand { - return new TranslatableComponent("commands.schedule.cleared.failure", eventName); + return new TranslatableComponent("commands.schedule.cleared.failure", new Object[]{object}); }); - private static final SuggestionProvider SUGGEST_SCHEDULE = (context, builder) -> { -- return SharedSuggestionProvider.suggest(context.getSource().getServer().getWorldData().overworldData().getScheduledEvents().getEventsIds(), builder); -+ return SharedSuggestionProvider.suggest(context.getSource().getLevel().serverLevelData.overworldData().getScheduledEvents().getEventsIds(), builder); // Paper + private static final SuggestionProvider 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 }; - public static void register(CommandDispatcher dispatcher) { -@@ -0,0 +0,0 @@ public class ScheduleCommand { - } else { - long l = source.getLevel().getGameTime() + (long)time; - ResourceLocation resourceLocation = function.getFirst(); -- TimerQueue timerQueue = source.getServer().getWorldData().overworldData().getScheduledEvents(); -+ TimerQueue timerQueue = source.getLevel().serverLevelData.getScheduledEvents(); // Paper - function.getSecond().ifLeft((functionx) -> { - String string = resourceLocation.toString(); - if (replace) { + public ScheduleCommand() {} @@ -0,0 +0,0 @@ public class ScheduleCommand { } 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 + if (i == 0) { - throw ERROR_CANT_REMOVE.create(eventName); - } else { + throw ScheduleCommand.ERROR_CANT_REMOVE.create(eventName); diff --git a/work/CraftBukkit b/work/CraftBukkit index 0abf420c4b..64d149a5a9 160000 --- a/work/CraftBukkit +++ b/work/CraftBukkit @@ -1 +1 @@ -Subproject commit 0abf420c4b7f12a0c5a3c2116a73c78643711a05 +Subproject commit 64d149a5a9dfae226b8fb968b67238d819baaeb6