Commit Graph
36 Commits
Author SHA1 Message Date
Spottedleaf 6ba2828aeb Prevent light queue overfill when no players are online 2021-04-01 16:33:36 +01:00
Spottedleaf 94d3dceaa9 Fix ghost blocks in ticking view distance
Fixes #4298.

Tuinity patch:
https://github.com/Spottedleaf/Tuinity/blob/576e2cc1af2bb0b9768da2b11871044801d63099/patches/server/0047-Fix-ghost-blocks-in-ticking-view-distance.patch
2020-11-01 16:28:55 +01:00
Spottedleaf cccb35da1a Reduce blockpos allocation from pathfinding 2020-10-11 19:51:10 -04:00
Spottedleaf ae00aa1ee4 Retain block place order when capturing blockstates
Fixes twisted vines not connecting properly when grown via
bonemeal by a player.

In general, look at making this logic more robust (i.e properly handling
cases where a captured entry is overriden) - but for now this will do.
2020-10-11 19:32:08 -04:00
Spottedleaf 016ecf57ac Improve inlinig for some hot IBlockData methods 2020-10-11 19:18:27 -04:00
Spottedleaf cb129f90fa Optimise getType calls
Remove the map lookup for converting from Block->Bukkit Material
2020-10-11 18:52:57 -04:00
Spottedleaf 32aa63f5ed Fix for large move vectors crashing server
Check movement distance also based on current position.
2020-10-11 18:48:05 -04:00
Spottedleaf 46fb6bf239 Fix off by one error for scheduling block ticks (#4014)
Co-authored-by: Spottedleaf <Spottedleaf@users.noreply.github.com>

Fixes #4015
2020-07-27 22:19:11 -07:00
SpottedleafandSpottedleaf b6aced22de Tighten logic for handling target tick times in tick scheduler (#4010)
No longer rely on world time as plugins like to screw it up.

Add a new flag -Dpaper.ticklist-max-tick-delay= that
will automatically drop any tick entries that have a delay
exceeding the specified amount. This is only useful
for cleaning up a world that has been corrupted by
certain blocks having a huge tick delay.

Aimed at resolving #3251

Also fix an issue with some rails connecting incorrectly
that I found when testing.

Co-authored-by: Spottedleaf <Spottedleaf@users.noreply.github.com>
2020-07-27 20:05:27 -07:00
SpottedleafandSpottedleaf 1b248d842f [1.16] Do not sync load POI data (#3996)
Co-authored-by: Spottedleaf <Spottedleaf@users.noreply.github.com>
2020-07-24 20:28:57 -07:00
SpottedleafandSpottedleaf 254605cdae Improve per player mob spawning (#3971)
Co-authored-by: Spottedleaf <Spottedleaf@users.noreply.github.com>
2020-07-23 11:10:46 -07:00
Spottedleaf 9813f8a38f Fix AdvancementDataPlayer leak due from quitting early in login
Move the criterion storage to the AdvancementDataPlayer object
itself, so the criterion object stores no references - and thus
needs no cleanup.

Fixes #3050
2020-07-22 02:10:13 -04:00
SpottedleafandSpottedleaf 0580766485 Move range check for block placing up (#3917)
Co-authored-by: Spottedleaf <Spottedleaf@users.noreply.github.com>
2020-07-15 19:38:53 -07:00
Spottedleaf c9d30bb9c0 Fix erroneuous entity count reporting in timings 2020-07-14 11:58:55 +01:00
SpottedleafandSpottedleaf cf3f29c3ac Fix piston physics inconsistency (fix tnt dupers) (#3544)
Co-authored-by: Spottedleaf <Spottedleaf@users.noreply.github.com>
2020-06-12 00:30:30 -07:00
Spottedleaf 4347fa1b85 Ensure chunk gen tasks return to main thread before completing futures 2020-06-10 23:24:35 -04:00
SpottedleafandSpottedleaf db127b6f9c Cleanup async chunks (#3456)
Co-authored-by: Spottedleaf <Spottedleaf@users.noreply.github.com>
2020-05-28 16:34:58 -07:00
Spottedleaf aff206ef81 Optimize WorldBorder collision checks and air
Port part of leafs changes from Tuinity, will worry about rest later with larger changes coming
2020-05-10 22:49:58 -04:00
Spottedleaf f410ec4423 Revert loaded entity list (#3304) 2020-05-06 09:31:29 -07:00
Spottedleaf 0f2383acc0 Move another NetworkManager util into the inner class (#3303)
Those poor souls running outdated ProtocolLib.
2020-05-06 08:07:51 -07:00
SpottedleafandSpottedleaf f1b980c22f Make loaded entity list logic more consistent (#3301)
When adding/removing to a chunk, we need to also look at
editing the loaded entity list.

Co-authored-by: Spottedleaf <Spottedleaf@users.noreply.github.com>
2020-05-06 07:57:18 -07:00
SpottedleafandSpottedleaf d77bc736a0 Improve async login (#3189)
Add helper functions to ChunkProviderServer to make this easier
for other uses

Co-authored-by: Spottedleaf <Spottedleaf@users.noreply.github.com>
2020-04-19 10:58:02 -07:00
Spottedleaf b415ceb617 Optimize ChunkProviderServer's chunk level checking helper methods
These can be hot functions (i.e entity ticking and block ticking),
so inline where possible, and avoid the abstraction of the
Either class.
2020-04-16 20:47:15 -07:00
Spottedleaf 973a5271c3 Port 04-Util.patch from Tuinity (#3136) 2020-04-12 22:34:18 -07:00
Spottedleaf cd7e99804b Multiple memory and performance optimizations (removing streams) 2020-04-12 18:31:14 -04:00
Spottedleaf f654174059 Remove streams from Mob AI System
The streams hurt performance and allocate tons of garbage, so
replace them with the standard iterator.

Also optimise the stream.anyMatch statement to move to a bitset
where we can replace the call with a single bitwise operation.
2020-04-11 20:15:22 -04:00
Spottedleaf de4c48dac9 My patches are under MIT (#3130)
* My patches are under MIT

Remove ambiguity between my patches on Tuinity and here.
2020-04-10 22:48:34 -07:00
Spottedleaf 6778f7c55f Handle chunk unloading during block tick 2020-03-30 05:07:04 +01:00
Spottedleaf 98ce7f6c2e performance: Improve Activation Range entity iteration
Faster Entity iteration using the chunks full entity list and array access.

Faster chunk lookups skipping the cache, as the pattern of access was not suitable
for cache usage (each request will likely blow cache)

This reduces the cost of Entity Activation Range's initial marking.
2020-03-29 22:41:33 -04:00
Spottedleaf 368ecbd5b4 Fix memory leak in TickListServer (#3068)
Only occurred when entries were scheduled with huge tick delays

Add two flags to debug excessive tick delays:
-Dpaper.ticklist-warn-on-excessive-delay=true (false by default)
and -Dpaper.ticklist-excessive-delay-threshold=ticks which
sets the excessive tick delay to the specified ticks (defaults to
60 * 20 ticks, aka 60 seconds)
2020-03-25 12:56:18 -07:00
SpottedleafandSpottedleaf 93c88ab706 Timings changes (#3044)
* Timings changes

- Increment entity tick count only when an entity ticks
- Remove chunk inhabited timer
- Try finally entity timings

* Add activated entity ticks

Co-authored-by: Spottedleaf <Spottedleaf@users.noreply.github.com>
2020-03-18 23:03:32 -07:00
Spottedleaf 86437303b3 Indicate ticking status in entity list command (#2856) 2020-03-18 05:38:24 -07:00
Spottedleaf e106f34e74 Optimise Chunk#getFluid (#2860)
Removing the try catch and generally reducing ops should make it
faster on its own, however removing the try catch makes it
easier to inline due to code size
2020-03-18 05:21:35 -07:00
Spottedleaf 00fb9ccbd3 Optimise ticklistserver (#2957) 2020-03-18 05:17:28 -07:00
Spottedleaf ff52e956ad Heavily optimise random block ticking (#2914)
* Optimise random block ticking

Massive performance improvement for random block ticking.
The performance increase comes from the fact that the vast
majority of attempted block ticks (~95% in my testing) fail
because the randomly selected block is not tickable.

Now only tickable blocks are targeted, however this means that
the maximum number of block ticks occurs per chunk. However,
not all chunks are going to be targeted. The percent chance
of a chunk being targeted is based on how many tickable blocks
are in the chunk.
This means that while block ticks are spread out less, the
total number of blocks ticked per world tick remains the same.
Therefore, the chance of a random tickable block being ticked
remains the same.
2020-02-12 05:49:53 -08:00
Spottedleaf 062bacbad1 Lag compensate eating (#2861)
When the server is lagging, players will wait longer when eating.
Change to also use a time check instead if it passes.
2020-02-06 19:06:52 -08:00