Commit Graph

1673 Commits

Author SHA1 Message Date
Aikar
e45b853e60
Optimize some light chunk access
light calculations repeatedly looks up the same chunk while going
down on the Y access. Pass the chunk to it to skip many round trips
to the map lookup process.

while the gains arent as big since we have last access cache, it
should hopefully avoid many callstacks of depth and improve inlining,
as well as avoids entering a synchronized code block.

The avoiding of entering synchronized section is the main goal here.
2018-10-02 21:55:30 -04:00
Aikar
97b9ce8476
[CI-SKIP] [Auto] Rebuild Patches
A recent commit has been made that caused patches to be out of order, rebuilding
2018-10-02 10:26:35 -04:00
BillyGalbreath
31a99db328 Dont strip explicit leading color codes in chat components (#1512) 2018-10-02 10:21:12 -04:00
Aikar
920bf4680b
[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:
68588dac SPIGOT-4405: Chunk generation problem
2018-10-02 09:06:52 -04:00
Shane Freeder
9038677c89
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:
c71bb9ca Add PlayerRecipeDiscoverEvent and methods to (un/)discover recipes

CraftBukkit Changes:
7a2f4867 Implement PlayerRecipeDiscoverEvent and methods to (un/)discover recipes
2018-10-02 11:01:56 +01:00
Shane Freeder
eaa2c39183
Configurable connection throttle kick message (Closes #1515) 2018-10-02 10:39:49 +01:00
Shane Freeder
3fc712a78f
Fix custom flying kick message 2018-10-02 10:39:49 +01:00
Shane Freeder
f1a92f03db
Cleanup tab completion
During testing, I could not find any case of TabCompleteEvent firing,
however, upon reinspection of the code, and additional testing, this
appears to work fine without any changes on our part.
2018-10-02 10:37:37 +01:00
Aikar
6371b4581d
Fix Async Chunk Load Callback if chunk was already loaded
Fixes ACL API mainly, but might fix other smaller things too

Also improved the high priority check if the chunk was already marked done
2018-10-01 01:00:09 -04:00
Aikar
48b1b0aac5
Optimize Spare Chunk loads to be removed faster
this has technically been a longer standing problem, but if an async
chunk loads after a chunk has been removed from the chunk map, it would
be treated as any other spare chunk and kept loaded until Chunk GC kicks in.

This fixes that, but also obsoletes ChunkGC in that anytime we load a spare
chunk (a chunk outside of any players view distance), we will immediately
mark it for unload.

This should reduce the amount of spare chunks loaded on a server.
2018-09-30 20:34:05 -04:00
BillyGalbreath
c81736fd60 Fix cancelled lootables (#1510) 2018-09-29 21:57:59 -04:00
Zach Brown
d9363f2979
Fix slime pathfinding when loaded from NBT
GH-1507

The canWander property is initialized to true by default, however when
loaded from NBT, if the key doesn't exist the property will be set to
false. The correct solution is to ensure the key exists before setting
the property.
2018-09-29 16:06:26 -04:00
Aikar
9285b9cf1c
Fix village check
obf helper was in an unimported file, so just going to skip helper here
2018-09-29 12:20:29 -04:00
Aikar
c64503c66f
Fix Village Loading Doors fix, add config option, hopefully fix farms
The patch was previously applied wrong, and still caused chunk loads.

Now, we will prevent it again, but also added a config option to
disable this optimization.

However, I also updated it so that doors are not removed if the chunk
the door is in is unloaded, so this should avoid breaking farms.

Fixes #1506
2018-09-29 12:03:11 -04:00
Aikar
08bb5b49d2
Fix Sending Chunks to Client - Fixes #1504
Vanilla has some screwy logic that doesn't send a chunk until
it has been post processed. This is an issue as post processing
doesn't occur until all neighbor chunks have been loaded.

This can reduce view distance while generating terrain, but also
cause bugs where chunks are never sent to the client.

This fix always sends chunks to the client, and simply updates
the client anytime post processing is triggered with the new chunk data.
2018-09-29 01:22:21 -04:00
Aikar
590c2f96eb
Fix bug in async load order priority
accidently had priority inverted!

This will greatly improve visual chunk load speeds
2018-09-28 23:12:16 -04:00
Aikar
0c9bb9b7ae
Don't recheck type after setting a block
The server does a "Did my update succeed" check after setting
a blocks data to a chunk.

However, writes can not fail outside of a hard error or a
a race condition from multiple threads writing, which is
not something that should ever occur on the server.

So this check is pointless, as if it did occur, the server would
be having data corruption issues anyways.

This provides a small boost to all setType calls.
2018-09-28 22:40:04 -04:00
Aikar
f02b4d200e
Fix issues with entity loss due to unloaded chunks
Vanilla has risk of losing entities by causing them to be
removed from all chunks if they try to move into an unloaded chunk.

This pretty much means high chance this entity will be lost in this scenario.

There is another case that adding an entity to the world can fail if
the chunk isn't loaded.

Lots of the server is designed around addEntity never expecting to fail for these reasons,
nor is it really logical.

This change ensures the chunks are always loaded when entities are
added to the world, or a valid entity moves between chunks.

Hopefully will fix issues #1496 and #1434
2018-09-28 22:39:20 -04:00
Aikar
cd6a5f3b51
Remove Water optimization from the Light Optimizations
case was found where it could cause light to become incorrect

But we still get to optimize out any same block updates which reduces light operations
2018-09-28 22:37:43 -04:00
Aikar
c75015c1a4
Remove the "Entity already removed" warning unless debug entities is on 2018-09-28 22:37:33 -04:00
Aikar
de4487435d
Optimize Light Recalculations
The server triggers light recalculations even if the new block
is the same as the old block. At this time, BlockData Properties
do not impact light calculations.

So the only way light should change, is if the block itself
changes from 1 block to another.

Additionally, as of 1.13, water now only blocks 1 light level
instead of 3, meaning that light level decreasing is the same as air.

This means, transitions between water and air also do not need
to recalculate light, which saves a TON of updates caused by
fluids flowing.
2018-09-28 21:30:03 -04:00
BillyGalbreath
3482df728f Fix turtle lag (for real this time) (#1503)
Amends #1502, to further fix #1501
2018-09-28 21:27:40 -04:00
Aikar
b62dfa0bf9
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:
39ce5d3a SPIGOT-4399: ItemMeta.equals broken with AttributeModifiers

CraftBukkit Changes:
1cf8b5dc SPIGOT-4400: Populators running on existing chunks
116cb9a1 SPIGOT-4399: Add attribute modifier equality test
5ee1c18a SPIGOT-4398: Set ASM7_EXPERIMENTAL flag
2018-09-28 19:31:59 -04:00
BillyGalbreath
afeb77bc88 Fix turtle lag (#1502)
Fix #1501

I just added a condition check to not start a new pathfinder goal if the turtle already has one set.

Needs more testing.

![Timings Comparison](https://i.imgur.com/p9eJQSo.png)
2018-09-28 13:58:06 -04:00
Aikar
515f2e7beb
Ignore Dimension NBT field in Entity data
Minecraft is trying to set Dimension Objects based on a Dimension ID

Dimension ID's for custom worlds are dynamically allocate dand not guaranteed
consistent.

This removes checking the NBT data, as the Entity will always have its
DimensionManager set to the world it is being placed into.

This fixes corrupt entities breaking chunk saving in custom worlds.
2018-09-27 00:11:50 -04:00
Aikar
2365b308c8
Updated Upstream (Bukkit/CraftBukkit/Spigot)
Upstream has released updates that appears to apply and compile correctly.

This update has been tested to ensure that World Conversion still occurs correctly.

Bukkit Changes:
0812ce2c SPIGOT-4397: isChunkGenerated API

CraftBukkit Changes:
4824655c SPIGOT-4398: Upgrade to ASM 6.2.1 for better Java 11 support
eea43870 MC-134115: Fix issues converting tile entities
1a7f2d10 SPIGOT-4397: isChunkGenerated API
40aed54d SPIGOT-4396: Improve vehicle movement

Spigot Changes:
f6a273b1 Rebuild patches
2018-09-26 22:35:46 -04:00
Daniel Ennis
c5fbde9f17
Async Chunk Loading and Generation (#1397)
This restores Asynchronous Chunk Loading to 1.13, as well as adds Asynchronous Chunk Generation..

This provides a massive boost to server performance and should bring 1.13 back closer to 1.12 performance levels for pre generated worlds.

World Generation will now be faster overall than 1.12 since 1.12 did not have async generation.


**DONATE:**
Lots of effort has went into making this happen. Want to say thanks and donate? 

https://donate.emc.gs/AsyncChunks
2018-09-26 18:21:44 -04:00
Aikar
5cdfbda4e4
Re-enable light queue toggle, optimize neighbor checks, add max queue time
light queue is actually buggy, so re-enabling the config.

however, if anyone is ok with the buggy behavior, made the max time lost due to
light queue configurable.

We want to get to making the ligth queue default if we can make it work perfectly.

also applying neighbor optimizations to use the faster method for light checks.
2018-09-26 00:57:59 -04:00
BillyGalbreath
e1ba203df8 Honor EntityAgeable#ageLock (#1481)
* test

* Obfuscation helper

* Fix #1459
2018-09-25 10:54:06 -04:00
Brokkonaut
e8e994656b Avoid dimension id collisions (#1487)
getDimensionId() returns the dimension id - 1. So without this patch
we would reuse an existing dimension id, if some other dimension was
unloaded before.

In Spigot this is nearly invisible because DimensionManager has no equals(),
so dimension id collisions just create 2 worlds with the same dimension.

The PaperWorldMap (Added in
https://github.com/PaperMC/Paper/blob/master/Spigot-Server-Patches/0376-Optimize-Server-World-Map.patch ) changes this - Now the dimension is overwritten if there is some collision,
what causes players to teleport to incorrect worlds, World checks will no longer work
and many more evil things.
2018-09-25 10:53:52 -04:00
Aikar
917d582441
[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:
b9620fd9 API to generate filled explorer maps

CraftBukkit Changes:
c1ecaa2f API to generate filled explorer maps
2018-09-24 05:41:32 -04:00
Aikar
6cd928f83e
[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:
6f57bf95 SPIGOT-4391: Sign editable API

CraftBukkit Changes:
5cffeca2 SPIGOT-4391: Sign editable API
2018-09-24 01:06:42 -04:00
Aikar
61709368af
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:
dcb43ef8 MC-136886: locate command loads chunks without needing to.

Spigot Changes:
f823ac54 Rebuild patches
2018-09-23 21:29:00 -04:00
Zach Brown
7a57f23710
Make bad custom name resolution more specific
Avoids interfering with other places in vanilla where these issues
are tolerated and expected.
2018-09-23 20:10:24 -04:00
Kyle Wood
5d7bf5d57a Enable experimental ASM support for Java 11 plugins (#1480)
JEP 181 brings a new bytecode format for nest mates. ASM API 7 supports
this, but API 7 is still experimental. Attempting to load a Java 11
class that contains nest mates will cause an
UnsupportedOperationException, as API 6 can't handle them. This doesn't
really require any changes to the rest of the code, since this is just
related to ASM's visitor.

We want to use the stable API 6 for all other plugins, only using the
experimental API when required, so we check the class version first.

This should be removed as soon as ASM API 7 is stable.
2018-09-23 15:00:46 -04:00
Aikar
9787753c4f
[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:
fc10dec5 Don't throw error on invalid data in CraftMetaItem.
2018-09-23 05:06:41 -04:00
BillyGalbreath
003c0e0766
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-22 23:55:30 -04:00
Mark Vainomaa
3491f5542e Create API for CanPlaceOn and CanDestroy NBT tags (#1015) 2018-09-22 23:30:54 -04:00
BillyGalbreath
df72ca1321 Expose attack cooldown methods for Player (#1412) 2018-09-22 23:03:53 -04:00
BillyGalbreath
fedb0c07ae Add creative-arrow-despawn-rate (#1411)
* Add creative-arrow-despawn-rate
2018-09-22 22:48:30 -04:00
BillyGalbreath
844687a91c Add obfuscation helper (aikar's request) (#1468) 2018-09-22 22:28:16 -04:00
Zach Brown
e62f3ae259
Return null if we get a ParseException in IChatBaseComponent
Fixes GH-1471, GH-1474

As a result, data that no longer parses correctly will not crash the server
instead just logging the exception and continuing (and in most cases should
fix the data)

Player data is fixed pretty much immediately but some block data (like
Shulkers) may need to be modified in-game in order for it to re-save
properly

No more crashing though.
2018-09-22 15:58:13 -04:00
Senmori
042e018bb1
Apply Spigot PR 493 - Fixes #1469 2018-09-22 12:58:57 -04:00
Aikar
1556158be3
Fix bug in last commit 2018-09-22 12:28:38 -04:00
Aikar
e07e0cb3ca
Improve Light Queue and force enable it for all
There is no reason for the light queue to even be an option. This
enables the light queue for everyone.

This also improves the "can we still tick" time logic to always
check before running a light operation.

previously, we always executed at least 10 on the first world
(but not other worlds...), but we are seeing light take up some
heavy time, so improving that for now.

I've now also improved recheck gaps logic to happen at the end of all single block updates

This also prevents multiple gap checks, as previously if a tick skipped
the gaps check, the next tick would end up re-adding the entry again,
resulting in multiple gap checks.

This now just sets a marker "We need to recheck gaps" and will only occur
once.

This also should reduce chunk loads, as previously, we checked if
the neighbor chunks were loaded for the gap check, however those
neighbor chunks might of unloaded before the light queue operation
actually ran. Now, the neighbor chunk is done when the gap check
is being done, so it should avoid loading chunks.

Fixes #1466
Fixes #1431
2018-09-22 12:09:12 -04:00
Aikar
b6c3d89496
Revert "All generated chunks should be loadable" - Fixes #1470
This reverts commit 60b1ed9c76.
2018-09-22 11:33:30 -04:00
Aikar
0b3afe6c97
[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:
4db9e3dc Add API to locate structures

CraftBukkit Changes:
65bb2d0f Increase expiration time to 10 days
88a5346f Add API to locate structures.

Spigot Changes:
68acb93f Rebuild patches
2018-09-22 03:16:43 -04:00
Aikar
1db10a30db
Improve synchronization on ExpiringMap 2018-09-21 21:43:50 -04:00
Aikar
60b1ed9c76
All generated chunks should be loadable
Some chunks that need conversion may fail the loadChunks pass, and
end up entering the world gen code to finish processing.

We solved this on the API level before, but this needs to apply to
all chunk loads when gen=false
2018-09-21 16:59:47 -04:00
Aikar
7438edc9a1
Rework Async Chunks API in prep for merge, add utility
This adds a new Future based, Consumer<Chunk> based, and ability
to control whether or not to generate to the Async Chunk API.

Until Async Chunks merges, these API's are still synchronous, but
this commit will allow plugins to start using the API's in use
with the Async Chunks beta.
2018-09-21 16:56:08 -04:00
Aikar
fd1bd5223a
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:37:38 -04:00
Aikar
f02ab90a19
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:
cbb4fc16 SPIGOT-1916: Attribute modifiers for ItemStacks

CraftBukkit Changes:
8164f4b2 SPIGOT-1916: Attribute modifiers for ItemStacks

Spigot Changes:
38536abd Rebuild patches
2018-09-21 11:29:17 -04:00
Aikar
fba19f5f30
MC-134115: Fix Double Chest Chunk Conversion Error
A bug with double chest conversion would lead to data
loss from chunks if they crossed chunk boundries.

This fixes the issue.

It should now be safe to upgrade worlds to 1.13.1
2018-09-20 19:13:29 -04:00
Aikar
1b8f425949
Fix concurrency issues with ExpiringMap 2018-09-20 11:43:32 -04:00
Aikar
a7e90f01fe
[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:
26c89277 SPIGOT-4385: Clearer error for invalid generator-settings
2018-09-19 04:36:38 -04:00
Max Lee
1e66b061fa Add a separate PreSpawnerSpawnEvent (#1455)
This event extends the PreCreatureSpawnEvent and includes the position
of the spawner that spawned the entitiy. (similarly to how the
SpawnerSpawnEvent contains the spawner's BlockState).

This one doesn't include the state though as getting the block and
generating that snapshot is a bit wasteful.
2018-09-18 19:34:11 -04:00
Aikar
0d54dc2025
Make a copy for worldloadevent to avoid como's - fixes #1453
If you try to load a world inresponse to another world loading,
a concurrent modification exception will throw.

This avoids that by making a defensive copy of the list for the server init stage.

you might  want to do this if you want to guarantee your world loads
immediately after the vanilla worlds before another plugin has a chance
to load worlds during POST_WORLD plugin stage.
2018-09-18 19:33:43 -04:00
Aikar
5ef5f3b67b
Optimize Server World Map
Minecraft moved worlds to a hashmap in 1.13.1.
This creates inconsistent order for iteration of the map.

This patch restores World management to be back as an Array.

.values() will allow us to iterate as it was pre 1.13.1 by
ArrayList, giving consistent ordering and effecient iteration performance.

KeySet and EntrySet iteration is proxied to the List iterator,
and should retain manipulation behavior but nothing should be doing that.

Getting a World by dimension ID is now back a constant time operation.

Hopefully no other plugins try to mess with this map, as we are only handling
known NMS used methods, but we can add more if naughty plugins are found later.

Multiverse was tested with this and no breakage.
2018-09-18 01:34:44 -04:00
Aikar
db8ecff805
Support Overriding World Seeds - Closes #350
Allows you to add to paper.yml

seed-overrides:
  world_name: some seed value

This will ignore every where a seed is set/created/loaded and force
a world to use the specified seed.

This seed will end up being saved to the world data file, so it is
a permanent change in that it won't go back if you remove it from paper.yml
2018-09-17 23:38:17 -04:00
Aikar
3aaba8c301
Use BigDecimal to improve accracy of TPS results - long live 20 TPS!
It's always been commonly said to 'ignore' that TPS was '19.X', that
it was fine.

I suspect that the inaccuracy of floating point math resulted in us
losing precision over time, making it difficult to actually get back to 20,
as you know the fun 0.1 + 0.1 ... 9 more times != 1 problem.

BigDecimal supports working with doubles with higher precision.

This change makes it so our RollingAverage class maintains all of the data
using BigDecimal and using BigDecimal arithematic operations.

This ensures we have extremely high precision, enabling us to
actually be able print '20 TPS' when TPS is perfect.
2018-09-17 22:32:37 -04:00
Brokkonaut
2b349bb02b The disconnect on packet spam must be called sync (#1452)
And it was called twice, probably forgotten in the patch.
2018-09-17 22:04:47 -04:00
Aikar
fcc2e46edd
Ensure mobs don't spawn out of world border
this is originally what I thought #1333 was, but wasn't, but this is still valid fix
2018-09-17 21:50:02 -04:00
Tassu
03c8b8ec27 Implement furnace cook speed multiplier API. (#1437)
Adds methods `Furnace#getCookSpeedMultiplier()` and
`Furnace#setCookSpeedMultiplier(double)`.

This PR is basically 3516ae34ef for 1.13.

A test plugin may be found [here](https://gist.github.com/supertassu/fade0cce946261732c6299e1ec89290e).
2018-09-17 18:53:27 -04:00
Aikar
f95ffce1af
[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:
4b9a93ec Add BatToggleSleepEvent

CraftBukkit Changes:
a222e4a2 Implement BatToggleSleepEvent
2018-09-17 03:06:34 -04:00
Aikar
32c9917149
[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:
79ada744 SPIGOT-4382: Fix damage_absorbed statistic
2018-09-17 02:46:39 -04:00
Aikar
e1056b7187 I dedicate this to Billy, the one and true dolphin rider
Fixes a data fixer bug
2018-09-17 00:41:20 -04:00
Aikar
9860c9c694
more improvements to expiring map stuff 2018-09-16 03:21:52 -04:00
Aikar
80ee619035
prevent crashes on expiring map desync, dont spam logs 2018-09-16 03:00:28 -04:00
Aikar
d5da5375a6
Override some more methods in ExpiringMap to ensure fix
Seen some warnings of leak still being detected.

I'm not sure what's missing, so I'm adding nearly everything.
2018-09-16 01:04:40 -04:00
Aikar
b6760850b8
fix bug in last bug fix, recursion! 2018-09-16 00:26:32 -04:00
Aikar
2c3e7e48fc
Fix major memory leaks in ExpiringMap
computeIfAbsent would leak as the entry
was never registered into the ttl map

This fixes that ,as well as redesigns cleaning to
not run on every manipulation, and instead to run clean
once per tick per expiring map.
2018-09-16 00:01:48 -04:00
Aikar
30785b9132
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:
94b8708a SPIGOT-4373: Item display colours are white by default
61668436 SPIGOT-4378: Fix mistakenly included code
2018-09-15 19:13:40 -04:00
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