diff --git a/build-data/paper.at b/build-data/paper.at index 1417e2a6ce..2790d40943 100644 --- a/build-data/paper.at +++ b/build-data/paper.at @@ -259,3 +259,6 @@ public net.minecraft.world.level.block.state.BlockBehaviour hasCollision # add per world spawn limits public net.minecraft.world.level.NaturalSpawner SPAWNING_CATEGORIES + +# Optimize isValidLocation +public net.minecraft.world.level.chunk.LevelChunkSection states diff --git a/patches/unapplied/api/Add-BaseComponent-sendMessage-methods-to-CommandSend.patch b/patches/api/Add-BaseComponent-sendMessage-methods-to-CommandSend.patch similarity index 100% rename from patches/unapplied/api/Add-BaseComponent-sendMessage-methods-to-CommandSend.patch rename to patches/api/Add-BaseComponent-sendMessage-methods-to-CommandSend.patch diff --git a/patches/unapplied/api/Add-BeaconEffectEvent.patch b/patches/api/Add-BeaconEffectEvent.patch similarity index 100% rename from patches/unapplied/api/Add-BeaconEffectEvent.patch rename to patches/api/Add-BeaconEffectEvent.patch diff --git a/patches/unapplied/api/Add-MetadataStoreBase.removeAll-Plugin.patch b/patches/api/Add-MetadataStoreBase.removeAll-Plugin.patch similarity index 100% rename from patches/unapplied/api/Add-MetadataStoreBase.removeAll-Plugin.patch rename to patches/api/Add-MetadataStoreBase.removeAll-Plugin.patch diff --git a/patches/unapplied/api/Add-PlayerInitialSpawnEvent.patch b/patches/api/Add-PlayerInitialSpawnEvent.patch similarity index 100% rename from patches/unapplied/api/Add-PlayerInitialSpawnEvent.patch rename to patches/api/Add-PlayerInitialSpawnEvent.patch diff --git a/patches/unapplied/api/Add-PlayerLocaleChangeEvent.patch b/patches/api/Add-PlayerLocaleChangeEvent.patch similarity index 100% rename from patches/unapplied/api/Add-PlayerLocaleChangeEvent.patch rename to patches/api/Add-PlayerLocaleChangeEvent.patch diff --git a/patches/unapplied/api/Add-a-call-helper-to-Event.patch b/patches/api/Add-a-call-helper-to-Event.patch similarity index 100% rename from patches/unapplied/api/Add-a-call-helper-to-Event.patch rename to patches/api/Add-a-call-helper-to-Event.patch diff --git a/patches/unapplied/api/Add-command-to-reload-permissions.yml-and-require-co.patch b/patches/api/Add-command-to-reload-permissions.yml-and-require-co.patch similarity index 100% rename from patches/unapplied/api/Add-command-to-reload-permissions.yml-and-require-co.patch rename to patches/api/Add-command-to-reload-permissions.yml-and-require-co.patch diff --git a/patches/unapplied/api/Add-exception-reporting-event.patch b/patches/api/Add-exception-reporting-event.patch similarity index 100% rename from patches/unapplied/api/Add-exception-reporting-event.patch rename to patches/api/Add-exception-reporting-event.patch diff --git a/patches/unapplied/api/Add-getTPS-method.patch b/patches/api/Add-getTPS-method.patch similarity index 100% rename from patches/unapplied/api/Add-getTPS-method.patch rename to patches/api/Add-getTPS-method.patch diff --git a/patches/unapplied/api/Add-methods-for-working-with-arrows-stuck-in-living-.patch b/patches/api/Add-methods-for-working-with-arrows-stuck-in-living-.patch similarity index 100% rename from patches/unapplied/api/Add-methods-for-working-with-arrows-stuck-in-living-.patch rename to patches/api/Add-methods-for-working-with-arrows-stuck-in-living-.patch diff --git a/patches/unapplied/api/Add-sender-name-to-commands.yml-replacement.patch b/patches/api/Add-sender-name-to-commands.yml-replacement.patch similarity index 100% rename from patches/unapplied/api/Add-sender-name-to-commands.yml-replacement.patch rename to patches/api/Add-sender-name-to-commands.yml-replacement.patch diff --git a/patches/unapplied/api/Add-view-distance-API.patch b/patches/api/Add-view-distance-API.patch similarity index 100% rename from patches/unapplied/api/Add-view-distance-API.patch rename to patches/api/Add-view-distance-API.patch diff --git a/patches/unapplied/api/Automatically-disable-plugins-that-fail-to-load.patch b/patches/api/Automatically-disable-plugins-that-fail-to-load.patch similarity index 100% rename from patches/unapplied/api/Automatically-disable-plugins-that-fail-to-load.patch rename to patches/api/Automatically-disable-plugins-that-fail-to-load.patch diff --git a/patches/unapplied/api/Complete-resource-pack-API.patch b/patches/api/Complete-resource-pack-API.patch similarity index 100% rename from patches/unapplied/api/Complete-resource-pack-API.patch rename to patches/api/Complete-resource-pack-API.patch diff --git a/patches/unapplied/api/Custom-replacement-for-eaten-items.patch b/patches/api/Custom-replacement-for-eaten-items.patch similarity index 100% rename from patches/unapplied/api/Custom-replacement-for-eaten-items.patch rename to patches/api/Custom-replacement-for-eaten-items.patch diff --git a/patches/unapplied/api/Entity-AddTo-RemoveFrom-World-Events.patch b/patches/api/Entity-AddTo-RemoveFrom-World-Events.patch similarity index 100% rename from patches/unapplied/api/Entity-AddTo-RemoveFrom-World-Events.patch rename to patches/api/Entity-AddTo-RemoveFrom-World-Events.patch diff --git a/patches/unapplied/api/Entity-Origin-API.patch b/patches/api/Entity-Origin-API.patch similarity index 100% rename from patches/unapplied/api/Entity-Origin-API.patch rename to patches/api/Entity-Origin-API.patch diff --git a/patches/unapplied/api/EntityPathfindEvent.patch b/patches/api/EntityPathfindEvent.patch similarity index 100% rename from patches/unapplied/api/EntityPathfindEvent.patch rename to patches/api/EntityPathfindEvent.patch diff --git a/patches/unapplied/api/Expose-server-CommandMap.patch b/patches/api/Expose-server-CommandMap.patch similarity index 100% rename from patches/unapplied/api/Expose-server-CommandMap.patch rename to patches/api/Expose-server-CommandMap.patch diff --git a/patches/unapplied/api/Fix-ServerListPingEvent-flagging-as-Async.patch b/patches/api/Fix-ServerListPingEvent-flagging-as-Async.patch similarity index 100% rename from patches/unapplied/api/Fix-ServerListPingEvent-flagging-as-Async.patch rename to patches/api/Fix-ServerListPingEvent-flagging-as-Async.patch diff --git a/patches/unapplied/api/Graduate-bungeecord-chat-API-from-spigot-subclasses.patch b/patches/api/Graduate-bungeecord-chat-API-from-spigot-subclasses.patch similarity index 100% rename from patches/unapplied/api/Graduate-bungeecord-chat-API-from-spigot-subclasses.patch rename to patches/api/Graduate-bungeecord-chat-API-from-spigot-subclasses.patch diff --git a/patches/unapplied/api/Player-Tab-List-and-Title-APIs.patch b/patches/api/Player-Tab-List-and-Title-APIs.patch similarity index 100% rename from patches/unapplied/api/Player-Tab-List-and-Title-APIs.patch rename to patches/api/Player-Tab-List-and-Title-APIs.patch diff --git a/patches/unapplied/api/Reduce-thread-synchronization-in-MetadataStoreBase.patch b/patches/api/Reduce-thread-synchronization-in-MetadataStoreBase.patch similarity index 100% rename from patches/unapplied/api/Reduce-thread-synchronization-in-MetadataStoreBase.patch rename to patches/api/Reduce-thread-synchronization-in-MetadataStoreBase.patch diff --git a/patches/unapplied/api/Use-ASM-for-event-executors.patch b/patches/api/Use-ASM-for-event-executors.patch similarity index 100% rename from patches/unapplied/api/Use-ASM-for-event-executors.patch rename to patches/api/Use-ASM-for-event-executors.patch diff --git a/patches/unapplied/server/Add-BeaconEffectEvent.patch b/patches/server/Add-BeaconEffectEvent.patch similarity index 100% rename from patches/unapplied/server/Add-BeaconEffectEvent.patch rename to patches/server/Add-BeaconEffectEvent.patch diff --git a/patches/unapplied/server/Add-PlayerInitialSpawnEvent.patch b/patches/server/Add-PlayerInitialSpawnEvent.patch similarity index 97% rename from patches/unapplied/server/Add-PlayerInitialSpawnEvent.patch rename to patches/server/Add-PlayerInitialSpawnEvent.patch index 0355dabd20..2c3379fed5 100644 --- a/patches/unapplied/server/Add-PlayerInitialSpawnEvent.patch +++ b/patches/server/Add-PlayerInitialSpawnEvent.patch @@ -23,7 +23,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 Location loc = ev.getSpawnLocation(); @@ -0,0 +0,0 @@ public abstract class PlayerList { - player.setLevel(worldserver1); + player.spawnIn(worldserver1); player.gameMode.setLevel((ServerLevel) player.level); - player.absMoveTo(loc.getX(), loc.getY(), loc.getZ(), loc.getYaw(), loc.getPitch()); + // Paper start - set raw so we aren't fully joined to the world (not added to chunk or world) diff --git a/patches/unapplied/server/Add-World-Util-Methods.patch b/patches/server/Add-World-Util-Methods.patch similarity index 100% rename from patches/unapplied/server/Add-World-Util-Methods.patch rename to patches/server/Add-World-Util-Methods.patch diff --git a/patches/unapplied/server/Add-configurable-portal-search-radius.patch b/patches/server/Add-configurable-portal-search-radius.patch similarity index 81% rename from patches/unapplied/server/Add-configurable-portal-search-radius.patch rename to patches/server/Add-configurable-portal-search-radius.patch index d833b08182..3a824b89b7 100644 --- a/patches/unapplied/server/Add-configurable-portal-search-radius.patch +++ b/patches/server/Add-configurable-portal-search-radius.patch @@ -26,9 +26,9 @@ diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/jav index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n - double d4 = DimensionType.getTeleportationScale(this.level.dimensionType(), destination.dimensionType()); - BlockPos blockposition = new BlockPos(Mth.clamp(this.getX() * d4, d0, d2), this.getY(), Mth.clamp(this.getZ() * d4, d1, d3)); +@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i + double d0 = DimensionType.getTeleportationScale(this.level.dimensionType(), destination.dimensionType()); + BlockPos blockposition = worldborder.clampToBounds(this.getX() * d0, this.getY(), this.getZ() * d0); // CraftBukkit start - CraftPortalEvent event = this.callPortalEvent(this, destination, blockposition, PlayerTeleportEvent.TeleportCause.NETHER_PORTAL, flag2 ? 16 : 128, 16); + // Paper start @@ -47,10 +47,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 +++ b/src/main/java/net/minecraft/world/level/portal/PortalForcer.java @@ -0,0 +0,0 @@ public class PortalForcer { - public Optional findPortalAround(BlockPos destPos, boolean destIsNether) { + public Optional findPortalAround(BlockPos blockposition, boolean destIsNether, WorldBorder worldborder) { // CraftBukkit start -- return this.findPortal(destPos, destIsNether ? 16 : 128); // Search Radius -+ return this.findPortal(destPos, destIsNether ? level.paperConfig.portalCreateRadius : level.paperConfig.portalSearchRadius); // Search Radius // Paper - search Radius +- return this.findPortalAround(blockposition, worldborder, destIsNether ? 16 : 128); // Search Radius ++ return this.findPortalAround(blockposition, worldborder, destIsNether ? level.paperConfig.portalCreateRadius : level.paperConfig.portalSearchRadius); // Search Radius // Paper - search Radius } - public Optional findPortal(BlockPos blockposition, int i) { + public Optional findPortalAround(BlockPos blockposition, WorldBorder worldborder, int i) { diff --git a/patches/unapplied/server/Add-exception-reporting-event.patch b/patches/server/Add-exception-reporting-event.patch similarity index 98% rename from patches/unapplied/server/Add-exception-reporting-event.patch rename to patches/server/Add-exception-reporting-event.patch index 1b361229ee..4bf1838c1a 100644 --- a/patches/unapplied/server/Add-exception-reporting-event.patch +++ b/patches/server/Add-exception-reporting-event.patch @@ -143,7 +143,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } } @@ -0,0 +0,0 @@ public final class NaturalSpawner { - entity = biomesettingsmobs_c.type.create((Level) world.getLevel()); + entity = biomesettingsmobs_c.type.create(world.getLevel()); } catch (Exception exception) { NaturalSpawner.LOGGER.warn("Failed to create mob", exception); + com.destroystokyo.paper.exception.ServerInternalException.reportInternalException(exception); // Paper @@ -160,9 +160,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 import com.google.common.collect.ImmutableList; +import com.destroystokyo.paper.exception.ServerInternalException; import com.google.common.collect.Maps; - import com.google.common.collect.Sets; import com.google.common.collect.UnmodifiableIterator; -@@ -0,0 +0,0 @@ public class LevelChunk implements ChunkAccess { + import it.unimi.dsi.fastutil.ints.Int2ObjectMap; +@@ -0,0 +0,0 @@ public class LevelChunk extends ChunkAccess { this.removeBlockEntity(blockEntity.getBlockPos()); // Paper end } else { @@ -182,7 +182,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 // CraftBukkit end } } -@@ -0,0 +0,0 @@ public class LevelChunk implements ChunkAccess { +@@ -0,0 +0,0 @@ public class LevelChunk extends ChunkAccess { // Paper start - Prevent tile entity and entity crashes final String msg = String.format("BlockEntity threw exception at %s:%s,%s,%s", LevelChunk.this.getLevel().getWorld().getName(), this.getPos().getX(), this.getPos().getY(), this.getPos().getZ()); net.minecraft.server.MinecraftServer.LOGGER.error(msg, throwable); diff --git a/patches/unapplied/server/Add-methods-for-working-with-arrows-stuck-in-living-.patch b/patches/server/Add-methods-for-working-with-arrows-stuck-in-living-.patch similarity index 100% rename from patches/unapplied/server/Add-methods-for-working-with-arrows-stuck-in-living-.patch rename to patches/server/Add-methods-for-working-with-arrows-stuck-in-living-.patch diff --git a/patches/unapplied/server/Add-velocity-warnings.patch b/patches/server/Add-velocity-warnings.patch similarity index 100% rename from patches/unapplied/server/Add-velocity-warnings.patch rename to patches/server/Add-velocity-warnings.patch diff --git a/patches/unapplied/server/All-chunks-are-slime-spawn-chunks-toggle.patch b/patches/server/All-chunks-are-slime-spawn-chunks-toggle.patch similarity index 100% rename from patches/unapplied/server/All-chunks-are-slime-spawn-chunks-toggle.patch rename to patches/server/All-chunks-are-slime-spawn-chunks-toggle.patch diff --git a/patches/unapplied/server/Allow-Reloading-of-Custom-Permissions.patch b/patches/server/Allow-Reloading-of-Custom-Permissions.patch similarity index 100% rename from patches/unapplied/server/Allow-Reloading-of-Custom-Permissions.patch rename to patches/server/Allow-Reloading-of-Custom-Permissions.patch diff --git a/patches/unapplied/server/Always-tick-falling-blocks.patch b/patches/server/Always-tick-falling-blocks.patch similarity index 100% rename from patches/unapplied/server/Always-tick-falling-blocks.patch rename to patches/server/Always-tick-falling-blocks.patch diff --git a/patches/unapplied/server/Be-a-bit-more-informative-in-maxHealth-exception.patch b/patches/server/Be-a-bit-more-informative-in-maxHealth-exception.patch similarity index 100% rename from patches/unapplied/server/Be-a-bit-more-informative-in-maxHealth-exception.patch rename to patches/server/Be-a-bit-more-informative-in-maxHealth-exception.patch diff --git a/patches/unapplied/server/Check-online-mode-before-converting-and-renaming-pla.patch b/patches/server/Check-online-mode-before-converting-and-renaming-pla.patch similarity index 100% rename from patches/unapplied/server/Check-online-mode-before-converting-and-renaming-pla.patch rename to patches/server/Check-online-mode-before-converting-and-renaming-pla.patch diff --git a/patches/unapplied/server/Chunk-Save-Reattempt.patch b/patches/server/Chunk-Save-Reattempt.patch similarity index 84% rename from patches/unapplied/server/Chunk-Save-Reattempt.patch rename to patches/server/Chunk-Save-Reattempt.patch index 4896724473..ad86739e08 100644 --- a/patches/unapplied/server/Chunk-Save-Reattempt.patch +++ b/patches/server/Chunk-Save-Reattempt.patch @@ -22,18 +22,10 @@ diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileSto index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java +++ b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java -@@ -0,0 +0,0 @@ import java.io.IOException; - import javax.annotation.Nullable; - import net.minecraft.nbt.CompoundTag; - import net.minecraft.nbt.NbtIo; -+import net.minecraft.server.MinecraftServer; - import net.minecraft.util.ExceptionCollector; - import net.minecraft.world.level.ChunkPos; - @@ -0,0 +0,0 @@ public class RegionFileStorage implements AutoCloseable { protected void write(ChunkPos pos, @Nullable CompoundTag nbt) throws IOException { - RegionFile regionfile = this.getFile(pos, false); // CraftBukkit + RegionFile regionfile = this.getRegionFile(pos, false); // CraftBukkit + int attempts = 0; Exception laste = null; while (attempts++ < 5) { try { // Paper if (nbt == null) { @@ -51,7 +43,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + + if (laste != null) { + com.destroystokyo.paper.exception.ServerInternalException.reportInternalException(laste); -+ MinecraftServer.LOGGER.error("Failed to save chunk", laste); ++ net.minecraft.server.MinecraftServer.LOGGER.error("Failed to save chunk", laste); + } + // Paper end } diff --git a/patches/unapplied/server/Complete-resource-pack-API.patch b/patches/server/Complete-resource-pack-API.patch similarity index 100% rename from patches/unapplied/server/Complete-resource-pack-API.patch rename to patches/server/Complete-resource-pack-API.patch diff --git a/patches/unapplied/server/Configurable-Chunk-Inhabited-Time.patch b/patches/server/Configurable-Chunk-Inhabited-Time.patch similarity index 80% rename from patches/unapplied/server/Configurable-Chunk-Inhabited-Time.patch rename to patches/server/Configurable-Chunk-Inhabited-Time.patch index b12a8bf6ac..95a932460d 100644 --- a/patches/unapplied/server/Configurable-Chunk-Inhabited-Time.patch +++ b/patches/server/Configurable-Chunk-Inhabited-Time.patch @@ -33,12 +33,17 @@ diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java +++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java -@@ -0,0 +0,0 @@ public class LevelChunk implements ChunkAccess { - - @Override - public long getInhabitedTime() { -- return this.inhabitedTime; -+ return this.level.paperConfig.fixedInhabitedTime < 0 ? this.inhabitedTime : this.level.paperConfig.fixedInhabitedTime; // Paper +@@ -0,0 +0,0 @@ public class LevelChunk extends ChunkAccess { + return new ChunkAccess.TicksToSave(this.blockTicks, this.fluidTicks); } ++ // Paper start ++ @Override ++ public long getInhabitedTime() { ++ return this.level.paperConfig.fixedInhabitedTime < 0 ? super.getInhabitedTime() : this.level.paperConfig.fixedInhabitedTime; ++ } ++ // Paper end ++ @Override + public GameEventDispatcher getEventDispatcher(int ySectionCoord) { + return (GameEventDispatcher) this.gameEventDispatcherSections.computeIfAbsent(ySectionCoord, (j) -> { diff --git a/patches/unapplied/server/Configurable-Disabling-Cat-Chest-Detection.patch b/patches/server/Configurable-Disabling-Cat-Chest-Detection.patch similarity index 100% rename from patches/unapplied/server/Configurable-Disabling-Cat-Chest-Detection.patch rename to patches/server/Configurable-Disabling-Cat-Chest-Detection.patch diff --git a/patches/unapplied/server/Configurable-Non-Player-Arrow-Despawn-Rate.patch b/patches/server/Configurable-Non-Player-Arrow-Despawn-Rate.patch similarity index 100% rename from patches/unapplied/server/Configurable-Non-Player-Arrow-Despawn-Rate.patch rename to patches/server/Configurable-Non-Player-Arrow-Despawn-Rate.patch diff --git a/patches/unapplied/server/Configurable-container-update-tick-rate.patch b/patches/server/Configurable-container-update-tick-rate.patch similarity index 100% rename from patches/unapplied/server/Configurable-container-update-tick-rate.patch rename to patches/server/Configurable-container-update-tick-rate.patch diff --git a/patches/unapplied/server/Configurable-end-credits.patch b/patches/server/Configurable-end-credits.patch similarity index 100% rename from patches/unapplied/server/Configurable-end-credits.patch rename to patches/server/Configurable-end-credits.patch diff --git a/patches/unapplied/server/Configurable-inter-world-teleportation-safety.patch b/patches/server/Configurable-inter-world-teleportation-safety.patch similarity index 91% rename from patches/unapplied/server/Configurable-inter-world-teleportation-safety.patch rename to patches/server/Configurable-inter-world-teleportation-safety.patch index 71f421ed4f..0362fa83ab 100644 --- a/patches/unapplied/server/Configurable-inter-world-teleportation-safety.patch +++ b/patches/server/Configurable-inter-world-teleportation-safety.patch @@ -37,8 +37,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 if (fromWorld == toWorld) { entity.connection.teleport(to); } else { -- server.getHandle().moveToWorld(entity, toWorld, true, to, true); -+ server.getHandle().moveToWorld(entity, toWorld, true, to, !toWorld.paperConfig.disableTeleportationSuffocationCheck); // Paper +- server.getHandle().respawn(entity, toWorld, true, to, true); ++ server.getHandle().respawn(entity, toWorld, true, to, !toWorld.paperConfig.disableTeleportationSuffocationCheck); // Paper } return true; } diff --git a/patches/unapplied/server/Configurable-mob-spawner-tick-rate.patch b/patches/server/Configurable-mob-spawner-tick-rate.patch similarity index 93% rename from patches/unapplied/server/Configurable-mob-spawner-tick-rate.patch rename to patches/server/Configurable-mob-spawner-tick-rate.patch index 38176a6528..d8b46cc5a0 100644 --- a/patches/unapplied/server/Configurable-mob-spawner-tick-rate.patch +++ b/patches/server/Configurable-mob-spawner-tick-rate.patch @@ -23,13 +23,13 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/net/minecraft/world/level/BaseSpawner.java +++ b/src/main/java/net/minecraft/world/level/BaseSpawner.java @@ -0,0 +0,0 @@ public abstract class BaseSpawner { - public int requiredPlayerRange; - public int spawnRange; - private final Random random; + public int requiredPlayerRange = 16; + public int spawnRange = 4; + private final Random random = new Random(); + private int tickDelay = 0; // Paper - public BaseSpawner() { - this.spawnPotentials = BaseSpawner.EMPTY_POTENTIALS; + public BaseSpawner() {} + @@ -0,0 +0,0 @@ public abstract class BaseSpawner { } diff --git a/patches/unapplied/server/Configurable-spawn-chances-for-skeleton-horses.patch b/patches/server/Configurable-spawn-chances-for-skeleton-horses.patch similarity index 97% rename from patches/unapplied/server/Configurable-spawn-chances-for-skeleton-horses.patch rename to patches/server/Configurable-spawn-chances-for-skeleton-horses.patch index 1a294ac7bd..4ccb62ea85 100644 --- a/patches/unapplied/server/Configurable-spawn-chances-for-skeleton-horses.patch +++ b/patches/server/Configurable-spawn-chances-for-skeleton-horses.patch @@ -33,4 +33,4 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + boolean flag1 = this.getGameRules().getBoolean(GameRules.RULE_DOMOBSPAWNING) && this.random.nextDouble() < (double) difficultydamagescaler.getEffectiveDifficulty() * paperConfig.skeleHorseSpawnChance && !this.getBlockState(blockposition.below()).is(Blocks.LIGHTNING_ROD); // Paper if (flag1) { - SkeletonHorse entityhorseskeleton = (SkeletonHorse) EntityType.SKELETON_HORSE.create((Level) this); + SkeletonHorse entityhorseskeleton = (SkeletonHorse) EntityType.SKELETON_HORSE.create(this); diff --git a/patches/unapplied/server/Configurable-top-of-nether-void-damage.patch b/patches/server/Configurable-top-of-nether-void-damage.patch similarity index 98% rename from patches/unapplied/server/Configurable-top-of-nether-void-damage.patch rename to patches/server/Configurable-top-of-nether-void-damage.patch index dc61a73a04..725db0f7cd 100644 --- a/patches/unapplied/server/Configurable-top-of-nether-void-damage.patch +++ b/patches/server/Configurable-top-of-nether-void-damage.patch @@ -32,7 +32,7 @@ diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/jav index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n +@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i } public void checkOutOfWorld() { diff --git a/patches/unapplied/server/Custom-replacement-for-eaten-items.patch b/patches/server/Custom-replacement-for-eaten-items.patch similarity index 100% rename from patches/unapplied/server/Custom-replacement-for-eaten-items.patch rename to patches/server/Custom-replacement-for-eaten-items.patch diff --git a/patches/unapplied/server/Default-loading-permissions.yml-before-plugins.patch b/patches/server/Default-loading-permissions.yml-before-plugins.patch similarity index 100% rename from patches/unapplied/server/Default-loading-permissions.yml-before-plugins.patch rename to patches/server/Default-loading-permissions.yml-before-plugins.patch diff --git a/patches/unapplied/server/Disable-Scoreboards-for-non-players-by-default.patch b/patches/server/Disable-Scoreboards-for-non-players-by-default.patch similarity index 98% rename from patches/unapplied/server/Disable-Scoreboards-for-non-players-by-default.patch rename to patches/server/Disable-Scoreboards-for-non-players-by-default.patch index e09dcbbd0b..3141fb2e3d 100644 --- a/patches/unapplied/server/Disable-Scoreboards-for-non-players-by-default.patch +++ b/patches/server/Disable-Scoreboards-for-non-players-by-default.patch @@ -28,7 +28,7 @@ diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/jav index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n +@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i @Nullable public Team getTeam() { diff --git a/patches/unapplied/server/Disable-explosion-knockback.patch b/patches/server/Disable-explosion-knockback.patch similarity index 100% rename from patches/unapplied/server/Disable-explosion-knockback.patch rename to patches/server/Disable-explosion-knockback.patch diff --git a/patches/unapplied/server/Disable-ice-and-snow.patch b/patches/server/Disable-ice-and-snow.patch similarity index 100% rename from patches/unapplied/server/Disable-ice-and-snow.patch rename to patches/server/Disable-ice-and-snow.patch diff --git a/patches/unapplied/server/Disable-spigot-tick-limiters.patch b/patches/server/Disable-spigot-tick-limiters.patch similarity index 100% rename from patches/unapplied/server/Disable-spigot-tick-limiters.patch rename to patches/server/Disable-spigot-tick-limiters.patch diff --git a/patches/unapplied/server/Disable-thunder.patch b/patches/server/Disable-thunder.patch similarity index 100% rename from patches/unapplied/server/Disable-thunder.patch rename to patches/server/Disable-thunder.patch diff --git a/patches/unapplied/server/Don-t-nest-if-we-don-t-need-to-when-cerealising-text.patch b/patches/server/Don-t-nest-if-we-don-t-need-to-when-cerealising-text.patch similarity index 100% rename from patches/unapplied/server/Don-t-nest-if-we-don-t-need-to-when-cerealising-text.patch rename to patches/server/Don-t-nest-if-we-don-t-need-to-when-cerealising-text.patch diff --git a/patches/unapplied/server/Ensure-commands-are-not-ran-async.patch b/patches/server/Ensure-commands-are-not-ran-async.patch similarity index 100% rename from patches/unapplied/server/Ensure-commands-are-not-ran-async.patch rename to patches/server/Ensure-commands-are-not-ran-async.patch diff --git a/patches/unapplied/server/Ensure-inv-drag-is-in-bounds.patch b/patches/server/Ensure-inv-drag-is-in-bounds.patch similarity index 100% rename from patches/unapplied/server/Ensure-inv-drag-is-in-bounds.patch rename to patches/server/Ensure-inv-drag-is-in-bounds.patch diff --git a/patches/unapplied/server/Entity-AddTo-RemoveFrom-World-Events.patch b/patches/server/Entity-AddTo-RemoveFrom-World-Events.patch similarity index 100% rename from patches/unapplied/server/Entity-AddTo-RemoveFrom-World-Events.patch rename to patches/server/Entity-AddTo-RemoveFrom-World-Events.patch diff --git a/patches/unapplied/server/Entity-Origin-API.patch b/patches/server/Entity-Origin-API.patch similarity index 97% rename from patches/unapplied/server/Entity-Origin-API.patch rename to patches/server/Entity-Origin-API.patch index deeebb9698..a86493e95d 100644 --- a/patches/unapplied/server/Entity-Origin-API.patch +++ b/patches/server/Entity-Origin-API.patch @@ -28,7 +28,7 @@ diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/jav index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n +@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i public org.bukkit.projectiles.ProjectileSource projectileSource; // For projectiles only public boolean forceExplosionKnockback; // SPIGOT-949 public boolean persistentInvisibility = false; @@ -56,7 +56,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 // Spigot start public final org.spigotmc.ActivationRange.ActivationType activationType = org.spigotmc.ActivationRange.initializeEntityActivationType(this); public final boolean defaultActivationState; -@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n +@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i this.bukkitEntity.storeBukkitValues(nbt); } // CraftBukkit end @@ -72,7 +72,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 return nbt; } catch (Throwable throwable) { CrashReport crashreport = CrashReport.forThrowable(throwable, "Saving entity NBT"); -@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n +@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i } // CraftBukkit end @@ -111,7 +111,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + // Paper end } - public Level getLevel() { + public void setHurtsEntities(float fallHurtAmount, int fallHurtMax) { diff --git a/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java b/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java diff --git a/patches/unapplied/server/EntityPathfindEvent.patch b/patches/server/EntityPathfindEvent.patch similarity index 100% rename from patches/unapplied/server/EntityPathfindEvent.patch rename to patches/server/EntityPathfindEvent.patch diff --git a/patches/unapplied/server/Expose-server-CommandMap.patch b/patches/server/Expose-server-CommandMap.patch similarity index 100% rename from patches/unapplied/server/Expose-server-CommandMap.patch rename to patches/server/Expose-server-CommandMap.patch diff --git a/patches/unapplied/server/Fix-lag-from-explosions-processing-dead-entities.patch b/patches/server/Fix-lag-from-explosions-processing-dead-entities.patch similarity index 100% rename from patches/unapplied/server/Fix-lag-from-explosions-processing-dead-entities.patch rename to patches/server/Fix-lag-from-explosions-processing-dead-entities.patch diff --git a/patches/unapplied/server/Further-improve-server-tick-loop.patch b/patches/server/Further-improve-server-tick-loop.patch similarity index 100% rename from patches/unapplied/server/Further-improve-server-tick-loop.patch rename to patches/server/Further-improve-server-tick-loop.patch diff --git a/patches/unapplied/server/Handle-Item-Meta-Inconsistencies.patch b/patches/server/Handle-Item-Meta-Inconsistencies.patch similarity index 96% rename from patches/unapplied/server/Handle-Item-Meta-Inconsistencies.patch rename to patches/server/Handle-Item-Meta-Inconsistencies.patch index 727d88f187..c9afeb790d 100644 --- a/patches/unapplied/server/Handle-Item-Meta-Inconsistencies.patch +++ b/patches/server/Handle-Item-Meta-Inconsistencies.patch @@ -29,7 +29,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 +import java.util.Comparator; import java.util.Locale; import java.util.Map.Entry; - import java.util.Objects; + import java.util.Optional; @@ -0,0 +0,0 @@ public final class ItemStack { return this.getItem().getTooltipImage(this); } @@ -56,16 +56,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } @@ -0,0 +0,0 @@ public final class ItemStack { // CraftBukkit start - make defensive copy as this data may be coming from the save thread - this.tag = (CompoundTag) nbttagcompound.getCompound("tag").copy(); + this.tag = nbttagcompound.getCompound("tag").copy(); // CraftBukkit end + this.processEnchantOrder(this.tag); // Paper this.getItem().verifyTagAfterLoad(this.tag); } -@@ -0,0 +0,0 @@ public final class ItemStack { - // Paper end - public void setTag(@Nullable CompoundTag tag) { - this.tag = tag; + processEnchantOrder(this.tag); // Paper if (this.getItem().canBeDepleted()) { this.setDamageValue(this.getDamageValue()); @@ -214,9 +210,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 import com.google.common.collect.Lists; import com.google.common.collect.Multimap; import com.google.common.collect.SetMultimap; -@@ -0,0 +0,0 @@ import java.lang.reflect.InvocationTargetException; - import java.util.ArrayList; +@@ -0,0 +0,0 @@ import java.util.ArrayList; import java.util.Arrays; + import java.util.Base64; import java.util.Collection; +import java.util.Comparator; // Paper import java.util.EnumSet; @@ -243,8 +239,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 private static final CraftPersistentDataTypeRegistry DATA_TYPE_REGISTRY = new CraftPersistentDataTypeRegistry(); private CompoundTag internalTag; -- private final Map unhandledTags = new HashMap(); -+ private final Map unhandledTags = new TreeMap<>(); // Paper +- final Map unhandledTags = new HashMap(); // Visible for testing only ++ final Map unhandledTags = new TreeMap(); // Visible for testing only // Paper private CraftPersistentDataContainer persistentDataContainer = new CraftPersistentDataContainer(CraftMetaItem.DATA_TYPE_REGISTRY); private int version = CraftMagicNumbers.INSTANCE.getDataVersion(); // Internal use only diff --git a/patches/unapplied/server/Implement-PlayerLocaleChangeEvent.patch b/patches/server/Implement-PlayerLocaleChangeEvent.patch similarity index 92% rename from patches/unapplied/server/Implement-PlayerLocaleChangeEvent.patch rename to patches/server/Implement-PlayerLocaleChangeEvent.patch index 63c0f2b359..e7351cdc7c 100644 --- a/patches/unapplied/server/Implement-PlayerLocaleChangeEvent.patch +++ b/patches/server/Implement-PlayerLocaleChangeEvent.patch @@ -25,7 +25,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + if (this.locale == null || !this.locale.equals(packet.language)) { // Paper - check for null PlayerLocaleChangeEvent event = new PlayerLocaleChangeEvent(this.getBukkitEntity(), packet.language); this.server.server.getPluginManager().callEvent(event); -+ new com.destroystokyo.paper.event.player.PlayerLocaleChangeEvent(this.getBukkitEntity(), this.locale, packet.language).callEvent(); // Paper ++ this.server.server.getPluginManager().callEvent(new com.destroystokyo.paper.event.player.PlayerLocaleChangeEvent(this.getBukkitEntity(), this.locale, packet.language)); // Paper } this.locale = packet.language; // Paper start diff --git a/patches/unapplied/server/Only-process-BlockPhysicsEvent-if-a-plugin-has-a-lis.patch b/patches/server/Only-process-BlockPhysicsEvent-if-a-plugin-has-a-lis.patch similarity index 100% rename from patches/unapplied/server/Only-process-BlockPhysicsEvent-if-a-plugin-has-a-lis.patch rename to patches/server/Only-process-BlockPhysicsEvent-if-a-plugin-has-a-lis.patch diff --git a/patches/unapplied/server/Only-refresh-abilities-if-needed.patch b/patches/server/Only-refresh-abilities-if-needed.patch similarity index 100% rename from patches/unapplied/server/Only-refresh-abilities-if-needed.patch rename to patches/server/Only-refresh-abilities-if-needed.patch diff --git a/patches/unapplied/server/Optimize-explosions.patch b/patches/server/Optimize-explosions.patch similarity index 100% rename from patches/unapplied/server/Optimize-explosions.patch rename to patches/server/Optimize-explosions.patch diff --git a/patches/unapplied/server/Optimize-isValidLocation-getType-and-getBlockData-fo.patch b/patches/server/Optimize-isValidLocation-getType-and-getBlockData-fo.patch similarity index 75% rename from patches/unapplied/server/Optimize-isValidLocation-getType-and-getBlockData-fo.patch rename to patches/server/Optimize-isValidLocation-getType-and-getBlockData-fo.patch index 731ed0c46d..91d26a6630 100644 --- a/patches/unapplied/server/Optimize-isValidLocation-getType-and-getBlockData-fo.patch +++ b/patches/server/Optimize-isValidLocation-getType-and-getBlockData-fo.patch @@ -17,8 +17,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/net/minecraft/core/Vec3i.java +++ b/src/main/java/net/minecraft/core/Vec3i.java @@ -0,0 +0,0 @@ public class Vec3i implements Comparable { - private int y; - private int z; + return CODEC.flatXmap(checkOffsetAxes(maxAbsValue), checkOffsetAxes(maxAbsValue)); + } + // Paper start + public boolean isValidLocation(net.minecraft.world.level.LevelHeightAccessor levelHeightAccessor) { @@ -49,20 +49,20 @@ diff --git a/src/main/java/net/minecraft/world/level/chunk/ChunkAccess.java b/sr index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/level/chunk/ChunkAccess.java +++ b/src/main/java/net/minecraft/world/level/chunk/ChunkAccess.java -@@ -0,0 +0,0 @@ public interface ChunkAccess extends BlockGetter, FeatureAccess { +@@ -0,0 +0,0 @@ public abstract class ChunkAccess implements BlockGetter, BiomeManager.NoiseBiom return GameEventDispatcher.NOOP; } -+ BlockState getType(final int x, final int y, final int z); // Paper ++ public abstract BlockState getType(final int x, final int y, final int z); // Paper @Nullable - BlockState setBlockState(BlockPos pos, BlockState state, boolean moved); + public abstract BlockState setBlockState(BlockPos pos, BlockState state, boolean moved); diff --git a/src/main/java/net/minecraft/world/level/chunk/EmptyLevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/EmptyLevelChunk.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/level/chunk/EmptyLevelChunk.java +++ b/src/main/java/net/minecraft/world/level/chunk/EmptyLevelChunk.java @@ -0,0 +0,0 @@ public class EmptyLevelChunk extends LevelChunk { - super(world, pos, new EmptyLevelChunk.EmptyChunkBiomeContainer(world)); + super(world, pos); } + // Paper start @@ -93,8 +93,8 @@ diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java +++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java -@@ -0,0 +0,0 @@ public class LevelChunk implements ChunkAccess { - return this.sections; +@@ -0,0 +0,0 @@ public class LevelChunk extends ChunkAccess { + }); } + // Paper start - Optimize getBlockData to reduce instructions @@ -131,44 +131,18 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 +++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunkSection.java @@ -0,0 +0,0 @@ public class LevelChunkSection { public static final int SECTION_SIZE = 4096; - public static final Palette GLOBAL_BLOCKSTATE_PALETTE = new GlobalPalette<>(Block.BLOCK_STATE_REGISTRY, Blocks.AIR.defaultBlockState()); + public static final int BIOME_CONTAINER_BITS = 2; private final int bottomBlockY; - private short nonEmptyBlockCount; + short nonEmptyBlockCount; // Paper - package-private private short tickingBlockCount; private short tickingFluidCount; -- private final PalettedContainer states; -+ final PalettedContainer states; // Paper - package-private - - public LevelChunkSection(int yOffset) { - this(yOffset, (short)0, (short)0, (short)0); -@@ -0,0 +0,0 @@ public class LevelChunkSection { - } - - public BlockState getBlockState(int x, int y, int z) { -- return this.states.get(x, y, z); -+ return this.states.get(y << 8 | z << 4 | x); // Paper - inline - } - - public FluidState getFluidState(int x, int y, int z) { -diff --git a/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java b/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java -+++ b/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java -@@ -0,0 +0,0 @@ public class PalettedContainer implements PaletteResize { - } - - public T get(int x, int y, int z) { -- return this.get(getIndex(x, y, z)); -+ return this.get(y << 8 | z << 4 | x); // Paper - inline - } - - protected T get(int index) { + public final PalettedContainer states; diff --git a/src/main/java/net/minecraft/world/level/chunk/ProtoChunk.java b/src/main/java/net/minecraft/world/level/chunk/ProtoChunk.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/level/chunk/ProtoChunk.java +++ b/src/main/java/net/minecraft/world/level/chunk/ProtoChunk.java -@@ -0,0 +0,0 @@ public class ProtoChunk implements ChunkAccess { +@@ -0,0 +0,0 @@ public class ProtoChunk extends ChunkAccess { @Override public BlockState getBlockState(BlockPos pos) { @@ -181,10 +155,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + if (this.isOutsideBuildHeight(y)) { return Blocks.VOID_AIR.defaultBlockState(); } else { -- LevelChunkSection levelChunkSection = this.getSections()[this.getSectionIndex(i)]; -- return LevelChunkSection.isEmpty(levelChunkSection) ? Blocks.AIR.defaultBlockState() : levelChunkSection.getBlockState(pos.getX() & 15, i & 15, pos.getZ() & 15); -+ LevelChunkSection chunksection = this.getSections()[this.getSectionIndex(y)]; -+ return chunksection == LevelChunk.EMPTY_SECTION || chunksection.isEmpty() ? Blocks.AIR.defaultBlockState() : chunksection.getBlockState(x & 15, y & 15, z & 15); +- LevelChunkSection levelChunkSection = this.getSection(this.getSectionIndex(i)); +- return levelChunkSection.hasOnlyAir() ? Blocks.AIR.defaultBlockState() : levelChunkSection.getBlockState(pos.getX() & 15, i & 15, pos.getZ() & 15); ++ LevelChunkSection levelChunkSection = this.getSections()[this.getSectionIndex(y)]; ++ return levelChunkSection.hasOnlyAir() ? Blocks.AIR.defaultBlockState() : levelChunkSection.getBlockState(x & 15, y & 15, z & 15); } } + // Paper end diff --git a/patches/unapplied/server/Per-Player-View-Distance-API-placeholders.patch b/patches/server/Per-Player-View-Distance-API-placeholders.patch similarity index 50% rename from patches/unapplied/server/Per-Player-View-Distance-API-placeholders.patch rename to patches/server/Per-Player-View-Distance-API-placeholders.patch index d9bd18fa55..8652b8ebf3 100644 --- a/patches/unapplied/server/Per-Player-View-Distance-API-placeholders.patch +++ b/patches/server/Per-Player-View-Distance-API-placeholders.patch @@ -19,6 +19,42 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 private static final Logger LOGGER = LogManager.getLogger(); private static final int NEUTRAL_MOB_DEATH_NOTIFICATION_RADII_XZ = 32; private static final int NEUTRAL_MOB_DEATH_NOTIFICATION_RADII_Y = 10; +diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java ++++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +@@ -0,0 +0,0 @@ public class CraftWorld extends CraftRegionAccessor implements World { + public int getSimulationDistance() { + return world.spigotConfig.simulationDistance; + } ++ ++ @Override ++ public void setViewDistance(int viewDistance) { ++ throw new UnsupportedOperationException(); //TODO ++ } ++ ++ @Override ++ public int getNoTickViewDistance() { ++ throw new UnsupportedOperationException(); //TODO ++ } ++ ++ @Override ++ public void setNoTickViewDistance(int viewDistance) { ++ throw new UnsupportedOperationException(); //TODO ++ } ++ ++ @Override ++ public int getSendViewDistance() { ++ throw new UnsupportedOperationException(); //TODO ++ } ++ ++ @Override ++ public void setSendViewDistance(int viewDistance) { ++ throw new UnsupportedOperationException(); //TODO ++ } + // Spigot end + + // Spigot start diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -36,6 +72,26 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + @Override + public void setViewDistance(int viewDistance) { + throw new NotImplementedException("Per-Player View Distance APIs need further understanding to properly implement (There are per world view distances though!)"); // TODO ++ } ++ ++ @Override ++ public int getNoTickViewDistance() { ++ throw new NotImplementedException("Per-Player View Distance APIs need further understanding to properly implement (There are per world view distances though!)"); // TODO ++ } ++ ++ @Override ++ public void setNoTickViewDistance(int viewDistance) { ++ throw new NotImplementedException("Per-Player View Distance APIs need further understanding to properly implement (There are per world view distances though!)"); // TODO ++ } ++ ++ @Override ++ public int getSendViewDistance() { ++ throw new NotImplementedException("Per-Player View Distance APIs need further understanding to properly implement (There are per world view distances though!)"); // TODO ++ } ++ ++ @Override ++ public void setSendViewDistance(int viewDistance) { ++ throw new NotImplementedException("Per-Player View Distance APIs need further understanding to properly implement (There are per world view distances though!)"); // TODO + } // Paper end diff --git a/patches/unapplied/server/Player-Tab-List-and-Title-APIs.patch b/patches/server/Player-Tab-List-and-Title-APIs.patch similarity index 100% rename from patches/unapplied/server/Player-Tab-List-and-Title-APIs.patch rename to patches/server/Player-Tab-List-and-Title-APIs.patch diff --git a/patches/unapplied/server/Prevent-tile-entity-and-entity-crashes.patch b/patches/server/Prevent-tile-entity-and-entity-crashes.patch similarity index 96% rename from patches/unapplied/server/Prevent-tile-entity-and-entity-crashes.patch rename to patches/server/Prevent-tile-entity-and-entity-crashes.patch index 0fcfa5b359..e26c705af6 100644 --- a/patches/unapplied/server/Prevent-tile-entity-and-entity-crashes.patch +++ b/patches/server/Prevent-tile-entity-and-entity-crashes.patch @@ -29,7 +29,7 @@ diff --git a/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.ja index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java +++ b/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java -@@ -0,0 +0,0 @@ public abstract class BlockEntity implements net.minecraft.server.KeyedObject { +@@ -0,0 +0,0 @@ public abstract class BlockEntity implements io.papermc.paper.util.KeyedObject { return minecraftkey + " // " + this.getClass().getCanonicalName(); }); if (this.level != null) { @@ -47,7 +47,7 @@ diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java +++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java -@@ -0,0 +0,0 @@ public class LevelChunk implements ChunkAccess { +@@ -0,0 +0,0 @@ public class LevelChunk extends ChunkAccess { gameprofilerfiller.pop(); } catch (Throwable throwable) { diff --git a/patches/unapplied/server/Remove-Metadata-on-reload.patch b/patches/server/Remove-Metadata-on-reload.patch similarity index 100% rename from patches/unapplied/server/Remove-Metadata-on-reload.patch rename to patches/server/Remove-Metadata-on-reload.patch diff --git a/patches/unapplied/server/Use-UserCache-for-player-heads.patch b/patches/server/Use-UserCache-for-player-heads.patch similarity index 100% rename from patches/unapplied/server/Use-UserCache-for-player-heads.patch rename to patches/server/Use-UserCache-for-player-heads.patch diff --git a/patches/unapplied/server/Use-a-Shared-Random-for-Entities.patch b/patches/server/Use-a-Shared-Random-for-Entities.patch similarity index 97% rename from patches/unapplied/server/Use-a-Shared-Random-for-Entities.patch rename to patches/server/Use-a-Shared-Random-for-Entities.patch index f5ed6f69a2..351a6d9819 100644 --- a/patches/unapplied/server/Use-a-Shared-Random-for-Entities.patch +++ b/patches/server/Use-a-Shared-Random-for-Entities.patch @@ -9,7 +9,7 @@ diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/jav index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n +@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i return tag.contains("Bukkit.updateLevel") && tag.getInt("Bukkit.updateLevel") >= level; } @@ -31,7 +31,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 private CraftEntity bukkitEntity; public CraftEntity getBukkitEntity() { -@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n +@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i this.bb = Entity.INITIAL_AABB; this.stuckSpeedMultiplier = Vec3.ZERO; this.nextStep = 1.0F; diff --git a/patches/unapplied/server/handle-NaN-health-absorb-values-and-repair-bad-data.patch b/patches/server/handle-NaN-health-absorb-values-and-repair-bad-data.patch similarity index 100% rename from patches/unapplied/server/handle-NaN-health-absorb-values-and-repair-bad-data.patch rename to patches/server/handle-NaN-health-absorb-values-and-repair-bad-data.patch