3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-11-15 04:20:04 +01:00
Commit graph

3211 Commits

Autor SHA1 Nachricht Datum
Aikar
de977253d9
Re-add toggle for light queue, bump queue time
there is apparently bugs with relighting, so turning toggle back on

also bumped the max time threshold to reduce risk of starving the queue

allows it to violate TPS some, but at cost of better light data

also fixed some chunk neighbor checks
2018-09-25 23:37:01 -04:00
Zach Brown
c1cd6183f5
Update 1.12.2 distribution info just in case 2018-09-24 21:03:09 -04:00
Zach Brown
69c8e71723
Allow zero revive health when it matches maxHealth
Apparently a zero max health attribute is perfectly fine in vanilla and
our own revive handling code appears to handle the case fine, even when
EntityDeathEvent is cancelled. So we should allow it to avoid issues
when these mobs are killed.
2018-09-24 20:54:43 -04:00
Aikar
9759652bfb
Backport light queue changes from 1.13 2018-09-23 20:45:32 -04:00
BillyGalbreath
e0a25a9b99
Fix NPE race condition in ServerListPingEvent
Fixes GH-1473

If a ping is responded to prior to the server sample being populated
(pre-tick as an example) it can result in an NPE.
2018-09-23 00:05:54 -04:00
Aikar
4909d1366c
Sync Player Position to Vehicles
Player Positions could become desynced with their vehicle resulting
in chunk conflicts about which chunk the entity should really be in.
2018-09-21 11:40:46 -04:00
Aikar
15712119ad
Optimize Region File Cache
CraftBukkit added synchronization to read and write methods. This adds
much more contention on this object for accessing region files, as
the entire read and write of NBT data is now a blocking operation.

This causes issues when something then simply needs to check if a chunk exists
on the main thread, causing a block...

However, this synchronization was unnecessary, because there is already
enough synchronization done to keep things safe

1) Obtaining a Region File: Those methods are still static synchronized.
   Meaning we can safely obtain a Region File concurrently.

2) RegionFile data access: Methods reading and manipulating data from
   a region file are also marked synchronized, ensuring that no 2 processes
   are reading or writing data at the same time.

3) Checking a region file for chunkExists: getOffset is also synchronized
   ensuring that even if a chunk is currently being written, it will be safe.

By removing these synchronizations, we reduce the locking to only
when data is being write or read.

GZIP compression and NBT Buffer creation will no longer be part of the
synchronized context, reducing lock times.

Ultimately: This brings us back to Vanilla, which has had no indication of region file loss.
2018-09-16 14:26:30 -04:00
Aikar
ec58c208b3
Performance & Concurrency Improvements to Permissions
Modifying of permissions was only half protected, enabling concurrency
issues to occur if permissions were modified async.

While no plugin really should be doing that, modifying operations
are not heavily called, so they are safe to add synchronization to.

Now, all modification API's will be synchronized ensuring safety.

Additionally, hasPermission was victim to a common java newbie mistake
of calling if (containsKey(k)) return get(k), resulting in 2 map lookups.

Optimized it to simply be a single get call cutting permission map
lookups in half.
2018-09-13 20:59:32 -04:00
Zach Brown
cce3635569
Update branch for github version checking 2018-09-13 12:06:16 -04:00
Zach Brown
b380338244
Ensure entity is always dying before Death Event
Prior to this it was possible for plugins to put the server into a never
ending recursive loop until it eventually killed itself.

Fixes GH-1432
2018-09-11 17:38:57 -04:00
Aikar
6793fee387
Remove no longer needed tests due to last change 2018-09-09 01:14:18 -04:00
Aikar
5228a4f24c
Remove deadlock risk in firing async events
The PluginManager incorrectly used synchronization on firing any event
that was marked as synchronous.

This synchronized did not even protect any concurrency risk as
handlers were already thread safe in terms of mutations during event
dispatch.

The way it was used, has commonly led to deadlocks on the server,
which results in a hard crash.

This change removes the synchronize and adds some protection around enable/disable
2018-09-09 01:04:59 -04:00
Max Lee
4e30b91d4e Improve death events (#1362)
* Improve death events

This adds the ability to cancel the events and to specify the sound.
2018-09-07 20:14:48 -04:00
Gergely Sarkozi
2d45ec855f Cached, local-class-supporting task names (#1409)
Fixes issue #1177 

`MapMaker#weakKeys()` makes the `Map` use identity comparison for the keys, while also enabling the automatical removal of dropped classes from the cache.

The changes are the same as in #1399, except now the original patch is modified instead of a new one being created.
2018-09-03 10:04:50 -04:00
Aikar
2ae60bd203
Pull the last upstream updates 2018-08-31 11:51:41 -04:00
Shane Freeder
cd5da239f8
Fixup AsyncTabCompletionEvent handling 2018-08-28 22:12:21 +01:00
cakoyo
a1e9cd39d2 Add source block to BlockPhysicsEvent (#1364)
Resolves #1275 

For plants, the source block is itself, because the `changed` type is itself.
2018-08-24 10:38:31 -04:00
Aikar
0ade5595ad
[CI-SKIP] Ensure symlink process never fails build
not sure if this is source of #1365, but doesn't hurt to make
this a non fatal error if the symlink command fails.
2018-08-23 21:51:13 -04:00
Christopher White
6c32ee4a5c Add isChunkGenerated API (#1363)
Resolves #1329
2018-08-22 21:13:03 -04:00
Aikar
1218b4aae6
Fix some false positive warnings printing that shouldnt be
reduces some log spam
2018-08-20 20:20:40 -04:00
Aikar
c775246c69
Fix false positive on Chunk Entity slice messages #1302
Update links too
2018-08-20 00:54:03 -04:00
Aikar
66733df5f9
add World#getLocationAtKey for Block Key API
For when you don't want to actually load the block
2018-08-19 11:50:40 -04:00
Zach Brown
ce750d7618
Don't iterate twice - Fixes GH-1346 2018-08-18 03:58:53 -05:00
Mystiflow
51e29fb2a1 Send nearby packets from world list instead of server list (#1196) 2018-08-17 18:05:00 -04:00
searchndstroy
af57a5fed5 Allow Blocks to be accessed via a long key (#1335)
The key can be retrieved via methods Location#toBlockKey() and
Block#getBlockKey()

World provides lookup for blocks by long key via method World#getBlockAtKey(long)

The formatting for the key is as follows:

10 bit y|27 bit z|27 bit x

The y value is considered unsigned while z and x are considered two's complement

Y range: [0, 1023]
X, Z range: [-67 108 864, 67 108 863]


Checked encoding and decoding via https://gist.github.com/Spottedleaf/74f4e241012ca2fa67d8f1c7e8e34722
2018-08-17 17:55:01 -04:00
searchndstroy
9c4490bda4 Optimize BlockPosition helper methods (#1339)
Resolves #1338
2018-08-17 17:51:56 -04:00
searchndstroy
3f883badab Fix watchdog restarting on short timeout (#1344) 2018-08-17 12:09:08 -04:00
Shane Freeder
4f4a4fc100
Cleanup javadoc warnings 2018-08-17 04:02:03 +01:00
Aikar
6e2711d666
Fix bug in last patch 2018-08-16 17:52:24 -04:00
Aikar
0645364ee5
Ensure chunks are always loaded on hard position sets
Player Movement, Entity Creation and Teleportation move
entities with a very "You are here, no debate" change, making
the server register them as there, regardless if that chunk was
loaded or not.

It appears possible that with hack clients and lag, a player
may be able to move fast enough to move into an unloaded
chunk and get into a buggy state.

To prevent this, we will ensure a chunk is always loaded,
guaranteeing that the entity will be properly registered
into its new home comfortably.

Closes #1316
2018-08-16 17:46:38 -04:00
Aikar
dc428860cf
Improve Watchdog Early Warning Feature - Closes #1319
1) Don't kick in until server has started (the full crash will still kick in before full start)
2) Delay reporting until 10 seconds, then print every 5
3) Make the intervals configurable
4) Make it able to be disabled by setting every interval to <= 0
2018-08-16 17:30:26 -04:00
kashike
edb9d18aed Allow disabling armour stand ticking 2018-08-15 01:29:41 -07:00
Aikar
4c1a7f1265
Provide Chunk Coordinates as a Long API
Allows you to easily access the chunks X/z as a long, and a method
to look up by the long key too.
2018-08-14 18:43:17 -04:00
chickeneer
bd1d0bf426 Add a force option to the ParticleBuilder API (#1322)
Particle packets contain a boolean which marks the particle to either force or show normal to the receiver.
Spigot has been sending all particles with the force boolean which overrides client particle settings.

Related changes in this commit;
- Add a force option to the ParticleBuilder API, which defaults to true to keep spigot consistent with existing api.
- Add a new spawnParticle method to support this mode as a parameter. Of course kept existing api methods the same so as to not break them.

Let me know if changes are needed.
2018-08-14 01:42:31 -04:00
Aikar
2900e7fa79
Use a Queue for Queueing Commands
Lists are bad as Queues mmmkay.
2018-08-12 02:34:34 -04:00
prplz
895a4dcafc
Fix custom permissions reloading (#1325) 2018-08-11 09:39:53 -04:00
egg82
6ef9abeec2 Use ConcurrentHashMap in JsonList & Optimize (#471) (#1309)
* [CI-SKIP] add .editorconfig for base code style settings

* * Created patch 0349 (fixes #471)

* * Made requested modifications

* * Made requested modifications (x2)

* * Made recommended changes (x3)

* * Moved ConcurrentMap return values to Map as no functions specific to ConcurrentMap were used (backing map is still ConcurrentMap)
* Removed ConcurrentMap import
2018-08-11 08:46:46 -04:00
miclebrick
b369e70970
Add 5 second short dumps to watchdog (#1314) 2018-08-08 15:58:02 -05:00
Aikar
e861035fc4
[CI-SKIP] add .editorconfig for base code style settings 2018-08-07 01:14:22 -04:00
Aikar
28caff2299
Undo a mistaken chunk registration change - Closes #1302
I misinterpreted some code as a risk of entity loss, but now
after deeper study, I see how that code was used more and why
it was adding entities to chunks that they shouldn't have been
in during a world transfer process.
2018-08-04 12:53:38 -04:00
Aikar
b78002eeba
Fix ItemStack.removeEnchantment returning wrong value 2018-08-04 01:13:10 -04:00
Aikar
aea67db7a0
make dupe uuid saferegen delete range configurable
also ensure we never process already valid entities. this shouldnt be possible as of recent
commits as we made the entity slice array safer, but doesn't hurt for this logic to be safe too
incase that patch got dropped in a future version by accident/necessarily
2018-08-04 00:26:56 -04:00
Aikar
444ce86194
Entity add to world fixes - #1223
1) Chunk Registration might kill an entity, don't add it to the world if it did!

2) By default, entities are added to the world per slice iteration.
This opens risk of the slices being manipulated during chunk add if an
EntityAddToWorldEvent spawns an entity into this chunk.
Fix this by differing entity add to world for all entities at the same time

3) If a duplicate entity is attempted to add to the world of an entity, and
the original entity is dead, overwrite it as the logic does for unloaod queued entities.

Should hopefully finish up issues with #1223
2018-08-03 23:02:44 -04:00
Aikar
b3eb265ab5
Fix logic bug in negative XP bug fix - Closes #1169 2018-08-03 20:59:35 -04:00
Mark Vainomaa
22b2bf6270 Fix "MC-135506: Experience should save as Integers" still saving as short" (#1301) 2018-08-03 09:25:21 -04:00
Aikar
3c61083c72
fix missing | on dupe uuid patch 2018-08-03 08:51:29 -04:00
Aikar
f4f8a3be2d
fix missed break statement and enum check on dupe uuid resolve 2018-08-03 01:32:00 -04:00
Aikar
38af7610e3
MC-135506: Experience should save as Integers
A large orb will lose its EXP value if it went over 32k due to short truncation.
2018-08-03 00:07:02 -04:00
Aikar
56b92ff216
Fix EXP orb merging causing values to go negative - Closes #1169 2018-08-03 00:06:20 -04:00
Aikar
17dca0a0fe
Add "Safe Regen" Duplicate UUID resolver and make default
After witnessing behavior of the regeneration logs, its clear that Vanilla
has had bugs with saving duplicate entities for a while....

Some entities are saved in multiple chunks, and now we are bringing those duplicates
out that use to never surface.

This mode will analyze if the entity appears to be a duplicate (near the other dupe uuid)
and delete the entity instead.

This should reduce regenerations to entities that are nowhere near each other, and
therefore more likely to be subject to real UUID collisions due to our
previous bug, and therefor should survive the chunk load.
2018-08-02 23:25:37 -04:00