Commit graph

1551 commits

Author SHA1 Message Date
Aikar
90fd694c4c
Fix loop risk in mob spawning around unloaded chunks
When a mob was about to load a chunk to try to spawn in, we did not
increment the attempt counter, resulting in it being stuck in the mob
spawn loop for a long time and hanging servers.
2018-09-15 13:46:01 -04:00
Aikar
10848b4104
Concurrency and Performance Improvements to DataFixers
Found some more unsafe operations in DataFixers.

Also replaced quite a few bad uses of Map.containsKey

containsKey is a common newbie mistake that "reads" cleaner, but
results in double the performance cost of all map operations as
containsKey in MOST cases where null values are not used is identical to get() == null

Considering how deep datafixers go in call stacks, with tons of map lookups,
this micro optimization could provide some gains.

Additionally, many of the containsKey/get/put style operations were
also a concurrency risk, resulting in multiple computation/insertions.
2018-09-15 13:22:14 -04:00
Aikar
f956f185c8
Updated Upstream (Bukkit/CraftBukkit/Spigot)
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:
47b9cf30 SPIGOT-4372: LightningStrikeEvent cause API
a9ceda75 Include the plugin channel name in the exception message

CraftBukkit Changes:
a4bdecff SPIGOT-4372: LightningStrikeEvent cause API
34caaf6d SPIGOT-4371: Trident damaged when event cancelled
97315374 SPIGOT-4369: Handle cancelled trident event
bf1c8273 SPIGOT-4370: Remove vehicle if its passenger spawn event was cancelled

Spigot Changes:
6b015b4b SPIGOT-4370: Remove vehicle if its passenger spawn event was cancelled
2018-09-15 12:10:26 -04:00
Aikar
b606122b85
MC-136886: Don't load chunks looking for features - Fixes #1438
I'm sure a few servers have crashed due to this.
2018-09-13 22:36:38 -04:00
Aikar
e0cf98b1ed
Missed a case where fish could load chunks 2018-09-12 21:58:38 -04:00
Aikar
94171733dd
Optimize Biome Mob Lookups for Mob Spawning
Uses an EnumMap as well as a Set paired List for O(1) contains calls
2018-09-12 21:50:34 -04:00
Aikar
c6409382b8
Prevent fish from loading/generating chunks 2018-09-12 21:25:02 -04:00
Aikar
6e203e64cc
Prevent mob spawning from loading chunks 2018-09-12 21:18:31 -04:00
Aikar
fd84aa5c42
Fix pathfinding NPE - Fixes #1435 2018-09-12 21:17:59 -04:00
Aikar
bd4280b9ec
ensure world is set for pathfinders 2018-09-11 19:10:14 -04:00
Zach Brown
9fe29f979c
Merge branch 'master' into pre/1.13 2018-09-11 17:48:17 -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
c563327fa2
Prevent pathfinding and zombie AI from loading chunks 2018-09-11 00:07:19 -04:00
Aikar
87d59fdab4
Prevent fluids from loading chunks - major performance boost 2018-09-10 23:38:16 -04:00
Aikar
2dd8623548
Updated Upstream (CraftBukkit/Spigot)
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:
7033f180 Hoist out synchronisation from ChunkRegionLoader

Spigot Changes:
500ff5d4 Rebuild patches

Additional Paper changes:
Fixed Versioned World Folders to not synchronize on ChunkRegionLoader
Optimized Save Queue even more to use a Long2ObjectOpenHashmap for save map
Add World#getXIfLoaded to IWorldReader to expose it to more places
2018-09-10 23:14:02 -04:00
Aikar
cf1fe85b04
Mob Pathfinding API
Adds an API to allow plugins to instruct a Mob to Pathfind to a Location or Entity

This does not do anything to stop other AI rules from changing the location, so
it is still up to the plugin to control that or override after another goal changed
the location.
2018-09-09 21:50:12 -04:00
Aikar
b3a9fc3bf9
Rename some methods per discussion in channel 2018-09-09 21:45:54 -04:00
Zach Brown
efc0babe91
Stop using transaction id in tab completions
Fixes GH-1417, GH-1424 (probably).

There are other issues in this area, including just how much a mess it
is but we will get to those when we get to those.
2018-09-09 17:52:48 -04:00
Aikar
7c11dbee6d
Forgot to rebuild patches after I fixed things in upstream update 2018-09-09 15:29:22 -04:00
Aikar
6d41af029c
Updated Upstream (Bukkit/CraftBukkit/Spigot)
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:
3e2858f6 SPIGOT-4352: MoistureChangeEvent
5466e281 Add BlockDispenseArmorEvent

CraftBukkit Changes:
3123a069 SPIGOT-4352: MoistureChangeEvent
226db0ea Add BlockDispenseArmorEvent
cd367fa4 Fix bad thread safety in ChunkRegionLoader
3f5ca5f2 SPIGOT-4355: Improve cancelling VehicleEnterEvent

Spigot Changes:
145a37ae Rebuild patches
3f2423cc Rebuild patches
2018-09-09 15:26:56 -04:00
Rick
0305af2c14 Fix view distance API (#1419) 2018-09-09 14:38:27 -04:00
Aikar
05edb779e0
getextPointIndex was not needing to be boxed/nullable 2018-09-09 14:36:51 -04:00
Aikar
16efbae731
Mob Pathfinding API
Adds an API to allow plugins to instruct a Mob to Pathfind to a Location or Entity

This does not do anything to stop other AI rules from changing the location, so
it is still up to the plugin to control that or override after another goal changed
the location.
2018-09-09 14:31:08 -04:00
BillyGalbreath
c755f90933 Allow chests to be placed with NBT (#1425)
This restores vanilla behavior of allowing placed chests to retain any Block Entity Tag data.

Upstream added filtering to chests, breaking vanilla behavior, and preventing use of loot table chests as a reward mechanism.

Upon review, we can find no security risk in allowing players to place a chest with NBT data, as Spawn Eggs, Minecarts, command blocks etc all have their own checks.

Additionally, survival mode players, non op players can not create these items anyways. If a player has Creative or Op, they already have high levels of access.

Plus, Chests aren't the only inventory that could have free form items, so this filter was insufficient anyways.
2018-09-09 12:53:23 -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
Zach Brown
1bce77696d
Merge branch 'master' into pre/1.13 2018-09-08 19:12:58 -04:00
Aikar
d617f95f05
[Auto] 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:
310dc809 Add ServerLoadEvent

CraftBukkit Changes:
19d654bd Add ServerLoadEvent
2018-09-07 23:49:37 -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
Aikar
2571276390
[CI-SKIP] [Auto] Rebuild Patches
A recent commit has been made that caused patches to be out of order, rebuilding
2018-09-07 20:06:35 -04:00
BillyGalbreath
0e749a05b2 Fix #1420 (#1421) 2018-09-07 20:03:38 -04:00
Aikar
62b2a5e05e
Updated Upstream (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

CraftBukkit Changes:
632449b6 SPIGOT-4349: End portal has wrong TeleportCause
3eb8af23 SPIGOT-4348: Use online player for setting skull owner if possible
2018-09-06 22:08:35 -04:00
Zach Brown
fb9e60b238
MC-2025 - Save entity AABB to prevent fp wobble
This work is largely a result of the analysis done on the Mojang issue
tracker. See patch header for additional information.
2018-09-04 19:18:06 -04:00
Aikar
2e8340addd
Fix yet another issue with concurrency with datafixers 2018-09-04 01:50:14 -04:00
Aikar
39042c4a36
Fix another case of concurrency issue in data fixers 2018-09-04 00:02:38 -04:00
Aikar
d01d2d8cc5
Fix concurrency issues in DataFixers
We are seeing issues with DataFixers being not thread safe in async chunks
and even in some spigot packet sending code.

There are a few more global objects that are mutated that need to
be synchronized to be safe for use over multiple threads.

There may be more cases, but these are extremely obvious ones.
2018-09-03 22:36:41 -04:00
BillyGalbreath
997190c3e0 Add ray tracing methods to LivingEntity (#1410)
This method will return the Block a player is looking at while taking into consideration the AABB of each block in the path.

For example, you can look through the 1/4 space of air in a Stair block and get the block behind it instead of the Stair block you are looking past.
2018-09-03 19:59:54 -04:00
Aikar
6a3ee6dd09 Check that phantom spawned uuid is set for save/load
Fixes #1408

Spawn eggs wont have a player set
2018-09-03 15:22:41 -04:00
Aikar
d37d04a52f
[CI-SKIP] [Auto] Rebuild Patches
A recent commit has been made that caused patches to be out of order, rebuilding
2018-09-03 12:31:32 -04:00
Aikar
28557509c5
Remove Pass World Tile Entities patch
Some things break from this, while this was trying to fix other things
since the thing this patch tried to fix still had problems and required
yet another fix, just going to remove this patch.
2018-09-03 12:23:25 -04:00
Aikar
bafdbdcac7 fix typo in patch file 2018-09-03 10:38:28 -04:00
Aikar
47476b7bc8 Merge remote-tracking branch 'origin/master' into pre/1.13 2018-09-03 10:32:30 -04:00
Aikar
33bdd20193
[CI-SKIP] [Auto] Rebuild Patches
A recent commit has been made that caused patches to be out of order, rebuilding
2018-09-03 10:11:35 -04:00
willies952002
b55b3af9e1 Add Force-Loaded Chunk API (#1387) 2018-09-03 10:05:55 -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
222147db5d
[Auto] Updated Upstream (Bukkit/CraftBukkit/Spigot)
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:
8ab814cd Add getFacing method to get the current cardinal direction an entity is facing.

CraftBukkit Changes:
ee5efeb0 Add getFacing method to get the current cardinal direction an entity is facing.

Spigot Changes:
0ede7d0e Rebuild patches
2018-09-03 04:14:40 -04:00
Spottedleaf
6e9c306655 Make CraftWorld#loadChunk(int, int, false) load unconverted chunks (#1407) 2018-09-02 23:40:14 -04:00
Aikar
77c6e3c530
[Auto] Updated Upstream (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

CraftBukkit Changes:
3037eb3e BlockSpreadEvent for Kelp
6cf60193 SPIGOT-4340: Improve client bug workaround
2018-09-02 21:44:27 -04:00
Shane Freeder
a5dc62d4b7
fix newlines in spigot tab list API
Spigots implementation around the header/footer strips newlines from the
header/footer, this patch allows the tab list header/footer to retain newlines.
2018-09-01 11:33:50 +01:00
Shane Freeder
4a3222542d
fix paper tab list API 2018-09-01 11:23:11 +01:00
Aikar
0aad8bfc1c
Updated Upstream (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

CraftBukkit Changes:
dc69d2b3 Fix unbound shaped recipe ingredients
2018-09-01 00:30:04 -04:00