Commit graph

3501 commits

Author SHA1 Message Date
Aikar
69b80568e9 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
47ff1783bc 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
79562c8f7a 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
9e5220a4bb Add ItemStackRecipeChoice Draft API
This is based on Spigots Draft API. This is subject to change

Allows creating recipes that must match isSimilar to full item stack.
2018-09-13 21:41:19 -04:00
Aikar
716d4d5751 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:55:31 -04:00
Zach Brown
9ff95e76f7 Update branch name for GitHub version checking 2018-09-13 12:17:01 -04:00
Aikar
1729151c19 Missed a case where fish could load chunks 2018-09-12 21:58:38 -04:00
Aikar
f8f640518e 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
eef452ee12 Prevent fish from loading/generating chunks 2018-09-12 21:25:02 -04:00
Aikar
75ad3eecdc Prevent mob spawning from loading chunks 2018-09-12 21:18:31 -04:00
Aikar
e0374d0ada Fix pathfinding NPE - Fixes #1435 2018-09-12 21:17:59 -04:00
Aikar
8565cb00e3 [CI-SKIP] Use papermc.io domain and add info for plugin devs 2018-09-11 19:50:07 -04:00
Aikar
0b5eace455 ensure world is set for pathfinders 2018-09-11 19:10:14 -04:00
Zach Brown
da68155e24 [CI-SKIP] Add note on 1.12.2 status to CONTRIBUTING.md 2018-09-11 18:11:28 -04:00
Zach Brown
f9d11c8af7 Merge branch 'master' into pre/1.13 2018-09-11 17:48:17 -04:00
Zach Brown
463e6dac06 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
Automated
a65e0f129c [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:
381fba2c SPIGOT-4314: Ability to change item in frame without playing sound

CraftBukkit Changes:
1cead628 SPIGOT-4363: Bad colours in leather armor
953e1d60 SPIGOT-4314: Ability to change item in frame without playing sound
2018-09-11 07:11:35 -04:00
Automated
4c357ab281 [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:
b6bf6aa3 Add option to suppress normal output of 'makePatches' so it only outputs when a patch is changed or created.
2018-09-11 06:41:40 -04:00
Aikar
36848f4949 Prevent pathfinding and zombie AI from loading chunks 2018-09-11 00:07:19 -04:00
Aikar
0631cf3192 Prevent fluids from loading chunks - major performance boost 2018-09-10 23:38:16 -04:00
Aikar
6711724fae 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 22:38:42 -04:00
Aikar
b86056bae2 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
14d6ee0495 Rename some methods per discussion in channel 2018-09-09 21:45:54 -04:00
Automated
6bf933b48c [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:
022b8c35 SPIGOT-4361: BlockFadeEvent for regular coral
2018-09-09 18:46:43 -04:00
Zach Brown
366d300450 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:51:25 -04:00
Aikar
c5811952b4 [CI-SKIP] adjust test server memory flags 2018-09-09 16:59:33 -04:00
Aikar
d039f43117 Forgot to rebuild patches after I fixed things in upstream update 2018-09-09 15:29:22 -04:00
Aikar
2041815962 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
Aikar
cc238c61a0 You can use EntityPathfindEvent to cancel new pathfinds from overriding your current 2018-09-09 14:48:32 -04:00
Rick
e730505bf0 Fix view distance API (#1419) 2018-09-09 20:38:27 +02:00
Aikar
75d51d6f9f getextPointIndex was not needing to be boxed/nullable 2018-09-09 14:36:51 -04:00
Aikar
0ae2903d8a 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 12:58:47 -04:00
BillyGalbreath
d28aadb2bd 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 11:53:23 -05:00
Aikar
f848af3df4 Merge branch 'master' into pre/1.13
* master:
  Remove no longer needed tests due to last change
2018-09-09 01:14:52 -04:00
Aikar
e0c865681c Remove no longer needed tests due to last change 2018-09-09 01:14:18 -04:00
Aikar
ae158dbbc8 Merge branch 'master' into pre/1.13
* master:
  Remove deadlock risk in firing async events
2018-09-09 01:06:44 -04:00
Aikar
68b25624d8 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:29 -04:00
chickeneer
938a3d5c70 Fix invalid data types for particles and fix colors in the ParticleBuilder (#1422)
* Fix invalid data types for particles and fix colors in the ParticleBuilder
2018-09-08 18:52:56 -05:00
Zach Brown
09ca94cb13 Merge branch 'master' into pre/1.13 2018-09-08 19:12:58 -04:00
Zach Brown
2d541bf948 Update again so the dumb bot stops breaking things 2018-09-07 23:51:16 -04:00
Automated
97de438dd2 [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
4ff931a021 Improve death events (#1362)
* Improve death events

This adds the ability to cancel the events and to specify the sound.
2018-09-08 02:14:48 +02:00
Automated
21bbd524c5 [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
3d3333ff23 Fix #1420 (#1421) 2018-09-07 19:03:38 -05:00
Automated
6850b5e98d [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:
228a5cd5 Remove vanilla command ambiguity warning
2018-09-07 06:59:30 -04:00
Automated
5bfec7de13 [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:
12bbe1d1 SPIGOT-4350: Expand EntityTeleportEvent to /teleport command

CraftBukkit Changes:
0ddd67b0 SPIGOT-4350: Expand EntityTeleportEvent to /teleport command
2018-09-07 06:39:38 -04:00
Aikar
5ae4306581 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
3d0c4bd860 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
Automated
602aa8b021 [Auto] Updated Upstream (Bukkit)
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:
3278a727 Add a #getLootTable() method to LootTables enum
2018-09-04 07:09:29 -04:00
Automated
1492b5ec46 [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:
c88ae6b1 SPIGOT-4342: Fix PlayerMoveEvent from pitch/yaw incorrect
2018-09-04 07:04:38 -04:00