diff options
author | Spottedleaf <[email protected]> | 2022-09-26 01:02:51 -0700 |
---|---|---|
committer | GitHub <[email protected]> | 2022-09-26 01:02:51 -0700 |
commit | 01a13871deefa50e186a10b63f71c5e0459e7d30 (patch) | |
tree | caf7056fa3ad155645b2dec6046b13841eb5d4a2 /patches/server/0061-Add-configurable-portal-search-radius.patch | |
parent | abe53a7eb477664aba5f32ff22d81f11ed48a44d (diff) | |
download | Paper-01a13871deefa50e186a10b63f71c5e0459e7d30.tar.gz Paper-01a13871deefa50e186a10b63f71c5e0459e7d30.zip |
Rewrite chunk system (#8177)
Patch documentation to come
Issues with the old system that are fixed now:
- World generation does not scale with cpu cores effectively.
- Relies on the main thread for scheduling and maintaining chunk state, dropping chunk load/generate rates at lower tps.
- Unreliable prioritisation of chunk gen/load calls that block the main thread.
- Shutdown logic is utterly unreliable, as it has to wait for all chunks to unload - is it guaranteed that the chunk system is in a state on shutdown that it can reliably do this? Watchdog shutdown also typically failed due to thread checks, which is now resolved.
- Saving of data is not unified (i.e can save chunk data without saving entity data, poses problems for desync if shutdown is really abnormal.
- Entities are not loaded with chunks. This caused quite a bit of headache for Chunk#getEntities API, but now the new chunk system loads entities with chunks so that they are ready whenever the chunk loads in. Effectively brings the behavior back to 1.16 era, but still storing entities in their own separate regionfiles.
The above list is not complete. The patch documentation will complete it.
New chunk system hard relies on starlight and dataconverter, and most importantly the new concurrent utilities in ConcurrentUtil.
Some of the old async chunk i/o interface (i.e the old file io thread reroutes _some_ calls to the new file io thread) is kept for plugin compat reasons. It will be removed in the next major version of minecraft.
The old legacy chunk system patches have been moved to the removed folder in case we need them again.
Diffstat (limited to 'patches/server/0061-Add-configurable-portal-search-radius.patch')
-rw-r--r-- | patches/server/0061-Add-configurable-portal-search-radius.patch | 38 |
1 files changed, 0 insertions, 38 deletions
diff --git a/patches/server/0061-Add-configurable-portal-search-radius.patch b/patches/server/0061-Add-configurable-portal-search-radius.patch deleted file mode 100644 index 14632c6848..0000000000 --- a/patches/server/0061-Add-configurable-portal-search-radius.patch +++ /dev/null @@ -1,38 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Joseph Hirschfeld <[email protected]> -Date: Thu, 3 Mar 2016 02:46:17 -0600 -Subject: [PATCH] Add configurable portal search radius - - -diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index f9f0cb28811e3a14bf4b5005050920b4992f868b..4b5babb9fa755ba2897fc633c8eba30cfd220ea0 100644 ---- a/src/main/java/net/minecraft/world/entity/Entity.java -+++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -2951,7 +2951,13 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { - 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, new PositionImpl(blockposition.getX(), blockposition.getY(), blockposition.getZ()), PlayerTeleportEvent.TeleportCause.NETHER_PORTAL, flag2 ? 16 : 128, 16); -+ // Paper start -+ int portalSearchRadius = destination.paperConfig().environment.portalSearchRadius; -+ if (level.paperConfig().environment.portalSearchVanillaDimensionScaling && flag2) { // == THE_NETHER -+ portalSearchRadius = (int) (portalSearchRadius / destination.dimensionType().coordinateScale()); -+ } -+ // Paper end -+ CraftPortalEvent event = this.callPortalEvent(this, destination, new PositionImpl(blockposition.getX(), blockposition.getY(), blockposition.getZ()), PlayerTeleportEvent.TeleportCause.NETHER_PORTAL, portalSearchRadius, destination.paperConfig().environment.portalCreateRadius); // Paper start - configurable portal radius - if (event == null) { - return null; - } -diff --git a/src/main/java/net/minecraft/world/level/portal/PortalForcer.java b/src/main/java/net/minecraft/world/level/portal/PortalForcer.java -index bb05ea288432ece497957c3503c3435655ce8997..7aa6181237eaec1df2ed2fdcd3b1137dfe89ce69 100644 ---- a/src/main/java/net/minecraft/world/level/portal/PortalForcer.java -+++ b/src/main/java/net/minecraft/world/level/portal/PortalForcer.java -@@ -43,7 +43,7 @@ public class PortalForcer { - - public Optional<BlockUtil.FoundRectangle> findPortalAround(BlockPos pos, boolean destIsNether, WorldBorder worldBorder) { - // CraftBukkit start -- return this.findPortalAround(pos, worldBorder, destIsNether ? 16 : 128); // Search Radius -+ return this.findPortalAround(pos, worldBorder, destIsNether ? level.paperConfig().environment.portalCreateRadius : level.paperConfig().environment.portalSearchRadius); // Search Radius // Paper - search Radius - } - - public Optional<BlockUtil.FoundRectangle> findPortalAround(BlockPos blockposition, WorldBorder worldborder, int i) { |