-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement optional per player mobspawning #2171
Implement optional per player mobspawning #2171
Conversation
Upstream has released updates that appears to apply and compile correctly. This update has not been tested by PaperMC and as with ANY update, please do your own testing CraftBukkit Changes: 9e95da1 SPIGOT-5052: PlayerPortalEvent not called when nether is disabled 28ea3fd SPIGOT-5062: end_portal on an non-default end world crashes the server 4a07dc6 SPIGOT-5058: ClassCastException when getting InventoryHolder of lectern when it's destroyed
* Updated Upstream (Bukkit/CraftBukkit) Upstream has released updates that appears to apply and compile correctly. This update has not been tested by PaperMC and as with ANY update, please do your own testing Bukkit Changes: 45690fe9 SPIGOT-5047: Correct slot types for 1.14 inventories CraftBukkit Changes: 4090d01 SPIGOT-5047: Correct slot types for 1.14 inventories e8c0836 SPIGOT-5046: World#getLoadedChunks returning inaccessible cached chunks. d445af3 SPIGOT-5067: Add item meta for 1.14 spawn eggs * Bring Chunk load checks in-line with spigot As of the last upstream merge spigot now checks ticket level status when returning loaded chunks for a world from api. Now our checks will respect that decision. * Fix spawn ticket levels Vanilla would keep the inner chunks of spawn available for ticking, however my changes made all chunks non-ticking. Resolve by changing ticket levels for spawn chunks inside the border to respect this behavior. * Make World#getChunkIfLoadedImmediately return only entity ticking chunks Mojang appears to be using chunks with level > 33 (non-ticking chunks) as cached chunks and not actually loaded chunks. * Bring all loaded checks in line with spigot Loaded chunks must be at least border chunks, or level <= 33
Used so that server owners can tell what types of chunks are loaded without requiring to use a tool to analyse a debug report
…eCreatureSpawnEvent and PreSpawnerSpawnEvent
2076e01
to
a22b29c
Compare
5204edc
to
2625657
Compare
👍 I've been using this patch for a while on my server and most players are happy with it. |
Spigot-Server-Patches/0402-implement-optional-per-player-mob-spawns.patch
Outdated
Show resolved
Hide resolved
Spigot-Server-Patches/0402-implement-optional-per-player-mob-spawns.patch
Outdated
Show resolved
Hide resolved
Spigot-Server-Patches/0402-implement-optional-per-player-mob-spawns.patch
Outdated
Show resolved
Hide resolved
Looks like this patch needs to be updated for 1.14.3. |
merge upstream 1.14.3
Updated for 1.14.3 |
Instead use `l(true)` for future compatability where `l()` may be called in other places.
Adds a distance map where players are tracked to coordinates in which they are close to. The class contains a validatePlayer() method which was used for testing. The class uses pooled hash tables to reduce object churning, and was tested via the following: https://gist.github.com/Spottedleaf/a93bb7a8993d6ce142d3efc5932bf573 With the distance map, looking up players in a specific location will be approximately constant time, which makes this patch scale much better with more players, at the cost of some performance at lower playercounts.
|
Fix teleportation
@electronicboy please merge this. Since the phantom block fix, this is the last thing to make 1.14 better than 1.13. |
Spigot-Server-Patches/0408-implement-optional-per-player-mob-spawns.patch
Outdated
Show resolved
Hide resolved
Only thing that gets me is the usage of view distance vs the min(mob spawn range, view distance) that the server does to determine where it should try to spawn? |
Spigot-Server-Patches/0412-implement-optional-per-player-mob-spawns.patch
Show resolved
Hide resolved
@electronicboy It's supposed to emulate single player mob spawning so it should count all the mobs that a player can render in their area just like in single player |
I have mob-spawn-range on 4, should I make that higher if I enable this patch or keep it as it is? |
You can keep it as is. |
Note this Patch essentially reimplements #2127 if disabled.
Implements requests from #245 and #1653.
If enabled, the chunks(with range taken from spigot.yml's mob-spawn-range) around players who have the sufficient amount of mobs of a type (limit taken from bukkit.yml's mob limits), will not have chunks around them eligible to spawn mobs of the same type. Additionally the global limit is ignored (although in most circumstances the number of mobs will be the same if mob-spawn-range is 8).
Benefits include more balanced/fair mob spawning, a player on the other side of the world will not be able to affect mob spawning to other players, etc. Essentially makes mob spawning behave as each player was in single player and so it includes all the additional benefits that come with that.
It works by creating a map of player, entity type to counts which is recreated every tick and updated as mobs are spawned. For each potential chunk available for spawning, the map is queried with all the players in range to determine how many mobs should be spawned in the chunk.See below.