Commit Graph

162 Commits

Author SHA1 Message Date
Aikar
ce270e1412
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:
b2f1908c SPIGOT-5783: Add helpful info to UnknownDependencyException
e4f46260 SPIGOT-2623: Add EntityEquipment methods to get/set ItemStacks by slot.
529a9a69 SPIGOT-5751: Clarify behaviour of block drop-related API methods

CraftBukkit Changes:
8ea9b138 Remove outdated build delay.
ffc2b251 Revert "#675: Fix redirected CommandNodes sometimes not being properly redirected"
cb701f6b #675: Fix redirected CommandNodes sometimes not being properly redirected
c9d7c16b SPIGOT-2623: Add EntityEquipment methods to get/set ItemStacks by slot.
fad2494a #673: Fix Craftworld#isChunkLoaded
8637ec00 SPIGOT-5751: Made breakNaturally and getDrops returns the correct item if no argument is given

Spigot Changes:
a99063f7 Rebuild patches

Fixes #3602
2020-06-23 04:40:03 -04:00
Aikar
b2d81e21c5
Improve Chunk Prioritization and Internal Scheduler
In previous MC versions, we had a rather simple internal scheduler
for delayed tasks that would just keep pushing task back until desired
tick was reached.

The method it called to schedule the task changed behavior in 1.14, and now
this scheduler is not working nowhere near what it was supposed to be doing.

This was causing long delayed task to eat up CPU (In Oversleep for example)

Rewrite this to just use the CraftScheduler for scheduling delayed tasks.

Once this was fixed, it became quite clear the code that delayed ticket
additions for chunks based on distance was clearly not right, as it was
tested on the previous broken logic.

So the ticket delay process has been vastly revamped to be even smarter.
Chunks behind the player can load slower than the chunks in front of the player.
We also can delay ticket adding until one of its neighbors has loaded, as
this lets us get a smoother spiral out for the chunks (minus frustum intent).

Additionally on frustum previous commit inadvertently broke frustum trying to
fix an issue when the real fix lied elsewhere, so restore chunk priority so
it works again.
2020-06-09 03:17:25 -04:00
Aikar
a4fe910f57
Fix sounds when using worldedit regen command
Locks dimension manager to the first world its used with.

WE is creating a temp world and the world ref on that manager
is getting changed to the temp world.

This would of also caused a memory leak of that temp world too.
2020-06-02 01:29:18 -04:00
Aikar
70ad51a80c
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

My recent work on serialization is now in CraftBukkit so was able to drop the patch and Paper
is now consistent with upstream.

Bukkit Changes:
e2699636 Move API notes to more obvious location

CraftBukkit Changes:
1b2830a3 SPIGOT-4441: Fix serializing Components to and from Legacy
2020-06-02 01:29:18 -04:00
Aikar
b0b54e4ef3
Optimize Villager Pathfinding - Massive Villager Improvement
This change reimplements the entire BehaviorFindPosition method to
get rid of all of the streams, and implement the logic in a more sane way.

We keep vanilla behavior 100% the same with this change, just wrote more
optimal, as we can abort iterating POI's as soon as we find a match....

One slight change is that Minecraft adds a random delay before a POI is
attempted again. I've increased the amount of that delay based on the distance
to said POI, so farther POI's will not be attempted as often.

Additionally, we spiral out, so we favor local POI's before we ever favor farther POI's.

We also try to pathfind 1 POI at a time instead of collecting multiple POI's then tossing them
all to the pathfinder, so that once we get a match we can return before even looking at other
POI's.

This benefits us in that ideally, a villager will constantly find the near POI's and
not even try to pathfind to the farther POI. Trying to pathfind to distant POI's is
what causes significant lag.

Other improvements here is to stop spamming the POI manager with empty nullables.
Vanilla used them to represent if they needed to load POI data off disk or not.

Well, we load POI data async on chunk load, so we have it, and we surely do not ever
want to load POI data sync either for unloaded chunks!

So this massively reduces object count in the POI hashmaps, resulting in less hash collions,
and also less memory use.

Additionally, unemployed villagers were using significant time due to major ineffeciency in
the code rebuilding data that is static every single invocation for every POI type...

So we cache that and only rebuild it if professions change, which should be never unless
a plugin manipulates and adds custom professions, which it will handle by rebuilding.
2020-05-27 01:35:36 -04:00
Aikar
21f9efa2ca
Improve implementation of chunk leak clean to not run as often 2020-05-25 21:42:53 -04:00
Aikar
210a32f26f
Unload leaked Cached Chunks
Due to some complexity in mojangs complicated chain of juggling
whether or not a chunk should be unloaded when the last ticket is
removed, many chunks are remaining around in the cache.

These chunks are never being targetted for unload because they are
vastly out of view distance range and have no reason to be looked at.

This is a huge issue for performance because we have to iterate these
chunks EVERY TICK... This is what's been leading to high SELF time in
Ticking Chunks timings/profiler results.

We will now detect these chunks in that iteration, and automatically
add it to the unload queue when the chunk is found without any tickets.
2020-05-25 11:12:22 -04:00
Aikar
10502558e9
Workaround for some hacky environments that mess up things
2 people had issues where some plugin is doing some reallly insane NMS hackery
that created invalid worlds, which caused some errors...

Really don't understand what in the world they did, but putting in a dumb guard that
shouldn't even be necessary to just not send the sound effect rather than erroring.
2020-05-23 22:27:37 -04:00
Aikar
64cfcf3e4b
Optimize sending packets to nearby locations (sounds/effects)
Instead of using the entire world or player list, use the distance
maps to only iterate players who are even seeing the chunk the packet
is originating from.

This will drastically cut down on packet sending cost for worlds with
lots of players in them.

Closes #3437
2020-05-23 17:17:14 -04:00
Aikar
7c001d64a5
More Improvements to Chunks
Fixed issues where urgent and prioritized chunks didn't actually
always get their priority boosted correctly....

Properly deprioritize non ticking chunks.
Limit recursion on watchdog prints to stop flooding as much
Remove neighbor priorities from watchdog to reduce information
reduce synchronization duration so that watch dog won't block main should main actually wake up
probably fixed a deadlock risk in watchdog printing also that was leading to crashes
fixed chunk holder enqueues not being processed correctly
added async catchers in some locations that should not be ran async

Fixed upstream bug where VITAL callbacks that must run on main actually could
sometimes run on the server thread pool causing alot of these nasty bugs we've seen lately!

This build will provide massive improvements to stability as well as even faster
sync chunk load/gens now that priority is correctly set.

Fixes #3435
2020-05-22 23:52:56 -04:00
Aikar
18c686576b
Optimize performance of object pool
synchronized arraydeque ends up still being way faster.
Kinda shocked how much that strategy was using, it wasn't really
that complicated... but oh well, this is even simpler and not
seeing blocked threads show up at all in profiling because
the lock is held for such a short amount of time.

also because most uses are on either server thread pool or chunk load pool.

Also optimize the pooling of nibbles to not register Cleaner's
for Light Engine directed usages, as we know we are properly
controlling clean up there, so we don't need to rely on GC.

This will return them to the pool manually, saving a lot of Cleaners.

Closes #3417
2020-05-20 21:45:43 -04:00
Aikar
614a664bd3
Implement Chunk Priority / Urgency System for Chunks
Mark chunks that are blocking main thread for world generation as urgent

Implements a general priority system so that chunks that are sorted in
the generator queues can prioritize certain chunks over another.

Urgent chunks will jump to the front of the line, ensuring that a
sync chunk load on an ungenerated chunk does not lag the server for
a long period of time if the servers generator queues are filled with
lots of chunks already.

This massively reduces the lag spikes from sync chunk gens.

Then we further prioritize loading order so nearby chunks have higher
priority than distant chunks, reducing the pressure a high no tick
view distance holds on you.

Chunks in front of the player have higher priority, to help with
fast traveling players keep up with their movement.

This commit also improves single core cpu scenarios in that we will
now automatically disable Async Chunks as well as Minecrafts thread
pool.

It is never recommended to use async chunks on a single CPU as context
switching will be slower than just running it all on main.

This also bumps the number of server worker threads by default too.
Mojang does not utilize the workers in an effecient manner, resulting
in them using barely any sustained CPU.

So give it more workers so more chunks can be processed concurrently

This change also improves urgent chunk loading, so players flying into
unloaded chunks will hurt a little bit less (but still hurt)

Ping #3395 #3363 (Not marking as closed, we need to make prevent moving work)
2020-05-19 04:09:37 -04:00
Aikar
897dd2c840
Foundational work for Future Memory usage improvements
This commit doesn't do much on its own, but adds a new Java Cleaner API
that lets us hook into Garbage Collector events to reclaim pooled objects and
return them to the pool.

Adds framework for Network Packets to know when a packet has finished dispatching
to get an idea when a packet is done sending to players.

Rewrites PooledObjects impl to properly respect max pool size and remove
almost all risk of contention.

Bumps the Paper Async Task Queue to use 2 threads, and properly shuts it down on shutdown.
2020-05-16 21:38:19 -04:00
JellySquid
d454bbd5e1
Implement JellySquid's Entity Collision optimisations patch
This patch replaces the vanilla collision code for both block and entity collisions with faster implementations by JellySquid, used originally in her Lithium mod.

Optimizes Full Block voxel collisions, and removes streams from Entity collisions

Original code by JellySquid, licensed under GNU Lesser General Public License v3.0
you can find the original code on https://github.com/jellysquid3/lithium-fabric/tree/1.15.x/fabric (Yarn mappings)

Ported by
Co-authored-by: Zoutelande <54509836+Zoutelande@users.noreply.github.com>

Touched up by Aikar to keep previous paper optimizations
2020-05-09 19:19:18 -04:00
Aikar
ceb824dbde
Fix ChunkCache .getXIfLoaded to use the local chunks in the cache
It was calling back out to world for it, we already have them.

Also use the nocache method for building the chunk cache too.
2020-05-09 14:58:08 -04:00
Aikar
03c9bb05c1
Optimize NibbleArray to use pooled buffers
Massively reduces memory allocation of 2048 byte buffers by using
an object pool for these.
2020-05-07 01:32:02 -04:00
Aikar
5ca5f131bb
Rebuild all patches using the new rebuild pattern 2020-05-06 05:48:49 -04:00
stonar96
8f9df2ed43
Anti Xray cleanup
Undo the accidental renaming of a method in 0aad8bf
Aikar wanted to rename DataPalette#getDataBits(T object) to getOrCreateIdFor
in 0aad8bf but he also accidentally renamed
ChunkPacketInfo#getDataBitsIndex(int chunkSectionIndex) to
getOrCreateIdForIndex.

Remove chunk-edge-mode and chunk loading entirely from Anti-Xray
The chunk-edge-mode is broken since several versions.
Loading chunk neighbors for chunk edge obfuscation isn't needed anymore.
Unlike in previous versions, these are under normal circumstances already loaded
at the time we need them (plugins for example can bypass this).

Use the modified methods and constructors everywhere
Anti-Xray provides support for the default nms methods and constructors,
which where modified by Anti-Xray to avoid breaking stuff (plugins)
which somehow uses these methods.
However, the modified versions of those methods and constructors should be used
where possible.
2020-05-06 04:35:20 -04:00
Spottedleaf
b4e629a283
Use distance map to optimise entity tracker / Misc Utils
Use the distance map to find candidate players for tracking.

This also ports a few utility changes from Tuinity
2020-05-06 03:47:24 -04:00
Aikar
57dd397155
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:
b999860d SPIGOT-2304: Add LootGenerateEvent

CraftBukkit Changes:
77fd87e4 SPIGOT-2304: Implement LootGenerateEvent
a1a705ee SPIGOT-5566: Doused campfires & fires should call EntityChangeBlockEvent
41712edd SPIGOT-5707: PersistentDataHolder not Persistent on API dropped Item
2020-05-01 18:03:57 -04:00
Aikar
cb15cfa4f8
Improve Async Login so pending connections dont get exposed
We still keep vanilla process of waiting for existing session to be removed before logging in
by storing a separate map of pending.

also fire the callback using executor incase further recursion causes any trouble
2020-04-24 05:48:51 -04:00
Spottedleaf
f29c7ebd84
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 13:58:02 -04:00
Aikar
f26362afa4
Load Spawn Chunks Asynchronously and Spiral Out
Ensures absolute center is first in priority
Speeds up server startup
2020-04-19 06:01:07 -04:00
Spottedleaf
e6d395cc83
Port 04-Util.patch from Tuinity (#3136) 2020-04-13 01:34:18 -04:00
Spottedleaf
09a942155f
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
Aikar
2f34301581
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:
7361a62e SPIGOT-5641: Add Block.getDrops(ItemStack, Entity)
1dc91b15 Add specific notes about what is not API
2b05ef88 #484: Allow statistics to be accessed for offline players

CraftBukkit Changes:
f7d6ad53 SPIGOT-5603: Use LootContext#lootingModifier in CraftLootTable
5838285d SPIGOT-5657: BlockPlaceEvent not cancelling for tripwire hooks
f325b9be SPIGOT-5641: Add Block.getDrops(ItemStack, Entity)
e25a2272 Fix some formatting in CraftHumanEntity
498540e0 Add Merchant slot delegate
b2de47d5 SPIGOT-5621: Add missing container types for opening InventoryView
aa3a2f27 #645: Allow statistics to be accessed for offline players
2122c0b1 #649: CraftBell should implement Bell
2020-04-08 03:49:15 -04:00
Aikar
e4d10a6d67
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:
122289ff Add FaceAttachable interface to handle Grindstone facing in common with Switches
a6db750e SPIGOT-5647: ZombieVillager entity should have getVillagerType()

CraftBukkit Changes:
bbe3d58e SPIGOT-5650: Lectern.setPage(int) causes a NullPointerException
3075579f Add FaceAttachable interface to handle Grindstone facing in common with Switches
95bd4238 SPIGOT-5647: ZombieVillager entity should have getVillagerType()
4d975ac3 SPIGOT-5617: setBlockData does not work when NotPlayEvent is called by redstone current
2020-04-02 17:09:17 -04:00
Spottedleaf
c23ebb780d
Optimise ticklistserver (#2957) 2020-03-18 12:17:28 +00:00
Shane Freeder
b16fd5c3a3
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:
6148fca7 SPIGOT-5484: Add more spawn tick settings

CraftBukkit Changes:
fc249340 SPIGOT-5484: Add more spawn tick settings

Spigot Changes:
6de3d4be Rebuild patches
2020-03-10 11:01:21 +00:00
Shane Freeder
2e44dc1ae3
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:
7f61a252 #640: Fix chunk load/unload callbacks for chunk load cancellations
2020-03-07 08:47:53 +00:00
Shane Freeder
9946cef8c5
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:
f52c70ab Fix incorrect nullability in MultipleFacing
6af4c0b2 SPIGOT-5311: Add API to get/set item associated with throwable projectiles
97aeae56 Add set/isAware to disable Vanilla AI components of a Mob

CraftBukkit Changes:
fba9f487 Improve legacy conversion of some materials that changed post flattening
b1ba8749 Move Bukkit.Aware loading/saving to correct location
f7cdb53c SPIGOT-5311: Add API to get/set item associated with throwable projectiles
689f429c #634: Cross platform patch scripts
ab85433d Add set/isAware to disable Vanilla AI components of a Mob

Spigot Changes:
8faa8b45 Rebuild patches
2020-02-21 17:52:20 +00:00
Shane Freeder
859f1296fe
Remove entities from per-chunk list (Fixes #2918) 2020-01-31 16:09:56 +00:00
Shane Freeder
b21010e7e3
Remove chunks after calling ChunkUnloadEvent (Fixes #2919) 2020-01-30 16:57:46 +00:00
Spottedleaf
01b965e0fd
Fix getChunkAtIfCachedImmediately (#2915) 2020-01-29 01:26:07 +00:00
Shane Freeder
5792c8626a
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:
93e39ce1 Clarify documentation regarding getMaterial with legacyName = true
c3aeaea0 Improve dependency tracker
14c9d275 Add support for transitive depends in load access warning
c8afe560 SPIGOT-5526: Add EntityEnterBlockEvent
6bb6f07d SPIGOT-5548: Show error that hints towards plugins misusing reflection
ed75537d SPIGOT-5546: Fix bad depend access using wrong provider in message
4e4c0ee9 Fix buggy classloader warning triggering for all classes
89586a4c Print warning when loading classes from depends that have not been specified
d4fe9680 Fix bug where disablePlugin could remove ConfigurationSerializable classes from other plugins
85e683b7 Add additional checkstyle checks
612fd8e1 Correct max page count in BookMeta docs
fa8a9781 Correct max title length in BookMeta docs

CraftBukkit Changes:
ab13a117 SPIGOT-5550: Cancelled ProjectileLaunchEvent still plays sound for eggs
44016b1d SPIGOT-5538: Using javaw to run GUI prints input error
e653ae76 SPIGOT-5526: Call EntityEnterBlockEvent for bees trying to enter hives
6515ea49 SPIGOT-5537: Bee nests generated by growing trees near flower have no bees
d82b3149 Remove unused CraftWorld.getId method
10763a88 Change some block == AIR checks to isAir to catch CAVE_AIR

Spigot Changes:
f2c1cd15 Rebuild patches
bcd458ad Reformat patches
2020-01-28 19:43:57 +00:00
Spottedleaf
d16a5d8813 Performance patches prerequisite (#2802)
Prereq changes for the coming storm of performance patches.
Includes optimising incremental saving
2020-01-27 18:16:53 -06:00
Spottedleaf
19de9af63c 1.15.2 update (#2887)
Functional GUI fix added by billygalbreath
2020-01-21 20:02:07 -06:00
Shane Freeder
8e972bf5aa
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:
bf1fa3e3 Update to Minecraft 1.15.1

CraftBukkit Changes:
30a1b691 Update to Minecraft 1.15.1
e2790ae2 Remove outdated build delay.

Spigot Changes:
2ee05fef Update to Minecraft 1.15.1
2019-12-17 22:39:07 +00:00
Shane Freeder
c034be8a82
Remove debug statement and rebuild patches properly 2019-12-13 16:29:51 +00:00
Zach Brown
4565495711
More compile fixes 2019-12-12 21:29:45 -06:00
Shane Freeder
b0dc983f21
More progression on patches 2019-12-12 21:01:16 +00:00
MiniDigger
d8a0622602 Compile fixes (#2732) 2019-12-12 18:45:00 +00:00
Shane Freeder
a308619d28
Work on server patches 2019-12-11 00:56:03 +00:00
Spottedleaf
fe7ef7b5d6 Do not schedule to main for getChunkImmediately type calls (#2362)
They are MT-Safe already. These changes reduce deadlock chances
given these calls are used in Entity#isValid(), and plugins
check this in packet handling...
2019-07-26 02:36:26 +01:00
Spottedleaf
9fe63a1673 Update to 1.14.4 (#2333) 2019-07-19 23:01:24 -05:00
Shane Freeder
73983e4c16
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:
3dc4cdcd Update to Minecraft 1.14.3-pre4
88b25a8c SPIGOT-5098: Add a method to allow colored sign changes
6d913552 Update to Minecraft 1.14.3-pre4

CraftBukkit Changes:
f1f33559 Update to Minecraft 1.14.3
8a3d3f49 SPIGOT-5098: Add a method to allow colored sign changes
533290e2 SPIGOT-5100: Console warning from pig zombie targeting
6dde4b9f SPIGOT-5094: Allow opening merchant for wandering traders and hide the xp bar for custom merchants
9af90077 SPIGOT-5097: Bukkit.clearRecipes() no longer working
38fa220f Fix setting game rules via the API
fe3930ce Update to Minecraft 1.14.3-pre4
da071ec5 Remove outdated build delay.

Spigot Changes:
4d2f30f1 Update to Minecraft 1.14.3
f16400e3 Update to Minecraft 1.14.3-pre4
2019-06-25 03:46:54 +01:00
Spottedleaf
5c7081fecc Update upstream & fix some chunk related issues (#2177)
* 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:
45690fe9 SPIGOT-5047: Correct slot types for 1.14 inventories

CraftBukkit Changes:
4090d01f SPIGOT-5047: Correct slot types for 1.14 inventories
e8c08362 SPIGOT-5046: World#getLoadedChunks returning inaccessible cached chunks.
d445af3b SPIGOT-5067: Add item meta for 1.14 spawn eggs

* Bring Chunk load checks in-line with spigot

As of the last upstream merge spigot now checks ticket level status
when returning loaded chunks for a world from api. Now our checks
will respect that decision.

* Fix spawn ticket levels

Vanilla would keep the inner chunks of spawn available for ticking,
however my changes made all chunks non-ticking. Resolve by changing
ticket levels for spawn chunks inside the border to respect this
behavior.


* Make World#getChunkIfLoadedImmediately return only entity ticking chunks

Mojang appears to be using chunks with level > 33 (non-ticking chunks)
as cached chunks and not actually loaded chunks.

* Bring all loaded checks in line with spigot

Loaded chunks must be at least border  chunks, or level <= 33
2019-06-14 03:27:40 +01:00
Shane Freeder
ec405a6bea
Fix async calls to getChunkAtIfLoadedImmediately 2019-06-11 04:17:39 +01:00
Spottedleaf
1c68c72b1f Improve chunk loaded checks 2019-06-11 02:37:37 +01:00
Spottedleaf
2f782a6652 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:
17543ecf SPIGOT-5035: Error Using Virtual Merchant GUI
0fc6922b SPIGOT-5028: Villager#setVillagerExperience() doesn't work
bdbdbe44 SPIGOT-5024: Fox error - Unknown target reason
2019-06-06 16:56:51 +01:00
Spottedleaf
5dc46cd3b2 Move getTypeIfLoaded and friends to IBlockAccess (#2077) 2019-05-27 01:14:14 -05:00
Spottedleaf
90141ff411 Handle gen flag for placeholder getChunkAtAsync (#2079)
Also fix a loadChunk call in heightmap api
2019-05-27 00:17:12 -05:00
Zach Brown
7fe6e643d1
Check property exists before playing chest close sound
There is an artificial delay added to chest close sounds (of 10 ticks)
to make them "feel" more true to vanilla. The problem is that because of
this delay it is possible for the block to be removed by the time the
sound plays.

With 1.14 in the state it is the timing necessary to encounter this
issue has increased.

The correct fix is to just return early if the property checked for in
the TileEntityChest sound method does not exist for the block at the
current location.

Fixes GH-2074
2019-05-26 23:42:39 -05:00
Shane Freeder
d627cfa110
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:
17da3420 Fix reading custom persistent entity data
83783357 SPIGOT-4980: Shields will not be put on cooldown when hit with an axe
8d0f3722 SPIGOT-4752: Fixed inconsistency between isChunkLoaded and chunk load/unload events
3f9f31c3 SPIGOT-4982: Armor disappearing while breaking the armor stand
2019-05-26 02:56:30 +01:00
Zach Brown
d84080e6d1
MC 1.14.1 2019-05-13 21:20:58 -05:00
Shane Freeder
026210202b
Fix MCUtils and other calls to postTaskOnMain
Method changed changed it's role to providing a TickTask object which
isn't automatically scheduled onto the server
2019-05-10 18:42:33 +01:00
Spottedleaf
e9439e7655 It compiles 2019-05-06 12:30:27 -07:00
Spottedleaf
eeb2ecd789 Update Upstream 2019-05-05 19:58:04 -07:00
Spottedleaf
cb24079b77 More compile error fixes 2019-05-05 17:57:14 -07:00
Spottedleaf
87759ffbb4 Fix some compile errors 2019-05-05 16:24:37 -07:00
Spottedleaf
027575df7f Fix some issues on the list 2019-05-05 14:39:51 -07:00
Spottedleaf
096e29ccfe Shove decompile fixes into the proper patch 2019-05-05 11:09:29 -07:00
Shane Freeder
7e6db27085 Aim towards real 1.14 2019-04-25 07:53:51 +01:00
Shane Freeder
a64c1a03c9 More work towards 1.14 pre5 2019-04-24 02:00:24 +01:00
Shane Freeder
6c3f04049d Initial work on 1.14 pre-5 2019-04-23 10:35:52 +01:00
Shane Freeder
fb25dc17c6 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:
da08d022 SPIGOT-4700: Add PlayerFishEvent.State.REEL_IN
0cef14e4 Remove draft API from selectEntities

CraftBukkit Changes:
a46fdbc6 Remove outdated build delay.
3697519b SPIGOT-4708: Fix ExactChoice recipes neglecting material
9ead7009 SPIGOT-4677: Add minecraft.admin.command_feedback permission
c3749a23 Remove the Damage tag from items when it is 0.
f74c7b95 SPIGOT-4706: Can't interact with active item
494eef45 Mention requirement of JIRA ticket for bug fixes
51d62dec SPIGOT-4702: Exception when middle clicking certain slots
be557e69 SPIGOT-4700: Add PlayerFishEvent.State.REEL_IN
2019-04-22 22:36:14 +01:00
Aikar
be067fea11
PlayerDeathEvent#getItemsToKeep
Exposes a mutable array on items a player should keep on death.

This allows a cleaner method to implement "Keep certain items on death"
than how plugins currently do it in that it never removes them in first
place, so its safe if the player logs out/server is shutdown before respawn.

Example Usage: https://gist.github.com/aikar/5bb202de6057a051a950ce1f29feb0b4
2019-03-28 01:12:38 -04:00
Aikar
458aa79f63
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:
451bd74e Use gson for decoding version command

CraftBukkit Changes:
51100db8 SPIGOT-4678: Fix placing signs in certain circumstances
2019-03-24 12:33:39 -04:00
Aikar
17b58d00d8
Unwrap Event Exceptions
This was a useless exception wrapper that ends up making
stack traces harder to read as well as the JVM cutting off
the important parts

Nothing catches this exception, so its safe to just get rid
of it and let the REAL exception bubble down
2019-02-23 12:17:41 -05:00
Shane Freeder
c608a94ff7
Use OBFHELPER in previous commit 2019-01-06 17:48:24 +00:00
Shane Freeder
f4e3b4e439
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:
5b680f0b Note maximum objective score length in documentation

CraftBukkit Changes:
5932f8a7 Load default world spawn areas in consistent order
3a5dc78f Fix confusing migration message appearing on fresh server
516a408f Remove redundant CraftBukkit change for secondary world data
73a2c749 Process conversation input on the main thread.
100c3f07 Cap Objective Score Length
6e842759 Cross World Entity Teleportation
7deba1c6 Check for blank OfflinePlayer Names
f2746a5e Descriptive kick reasons instead of Nope!
b0212308 Cap Channel Registrations
a610dcd8 Identify CraftScheduler threads with useful names

Spigot Changes:
19c3c5a5 Rebuild patches
2019-01-06 17:15:21 +00:00
Shane Freeder
b68b282439
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

Warning: this commit contains more mapping changes from upstream, As always, ensure that you
have working backups and test this build before deployment; Developers working on paper will,
yet again, need to delete their work/Minecraft/1.13.2 folder

Bukkit Changes:
7fca5fd4 SPIGOT-4558: Preserve user order in the face of copied defaults in configurations
15c9b1eb Ignore spurious slot IDs sent by client, e.g. in enchanting tables
5d2a10c5 SPIGOT-3747: Add API for force loaded chunks
d6dd2bb3 SPIGOT-3538: Add getHitBlockFace for ProjectileHitEvent
771db4aa SPIGOT-794: Call EntityPlaceEvent for Minecart placement
55462509 Add InventoryView#getSlotType
2f3ce5b6 Remove EntityTransformEvent and CustomItemTagContainer from draft API
f04ad7b6 Make ProjectileLaunchEvent extend EntitySpawnEvent
ccb85808 Define EntitySpawnEvent
b8cc3ebe Add PlayerItemDamageEvent
184a495d Ease ClassLoader Deadlocks Where Possible
11ac4728 Expand Boolean Prompt Values in Conversation API
aae62d51 Added getAllSessionData() to the Conversation API.
9290ff91 Add InventoryView#getInventory API
995e530f Add API to get / set base arrow damage

CraftBukkit Changes:
c4a67eed SPIGOT-4556: Fix plugins closing inventory during drop events
5be2ddcb Replace version constants with methods to prevent compiler inlining
a5b9c7b3 Use API method to create offset command completions
2bc7d1df SPIGOT-3747: Add API for force loaded chunks
a408f375 SPIGOT-3538: Add getHitBlockFace for ProjectileHitEvent
b54b9409 SPIGOT-2864: Make Arrow / Item setTicksLived behave like FallingBlock
79ded7a8 SPIGOT-1811: Death message not shown on respawn screen
b4a4f15d SPIGOT-943: InventoryCloseEvent called on death regardless of open inventory
0afed592 SPIGOT-794: Call EntityPlaceEvent for Minecart placement
2b2d084a Add InventoryView#getSlotType
01a9959a Do not use deprecated ItemSpawnEvent constructor
9642498d SPIGOT-4547: Call EntitySpawnEvent as general spawn fallback event
963f4a5f Add PlayerItemDamageEvent
63db0445 Add API to get / set base arrow damage
531c25d7 Add CraftMagicNumbers.MAPPINGS_VERSION for use by NMS plugins
d05c8b14 Mappings Update
bd36e200 SPIGOT-4551: Ignore invalid attribute modifier slots

Spigot Changes:
518206a1 Remove redundant trove depend
1959ad21 MC-11211,SPIGOT-4552: Fix placing double slabs at y = 255
29ab5e43 SPIGOT-3661: Allow arguments in restart-script
7cc46316 SPIGOT-852: Growth modifiers for beetroots, potatoes, carrots
82e117e1 Squelch "fatal: Resolve operation not in progress" message
0a1a68e7 Mappings Update & Patch Rebuild
2019-01-01 03:29:51 +00:00
Shane Freeder
0318e62b45
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:
0969eedc Clarify furnace burn time behaviour as per SPIGOT-844
16453bfd SPIGOT-4503: Add API to insert complete ItemStack into Jukebox

CraftBukkit Changes:
dff66dfc Reduce copying of positions from block states
91cae6ef SPIGOT-4387: Durability looping from cancelled BlockPlaceEvent
24c5e68c SPIGOT-4493: Allow burnt out furnaces to remain lit like Vanilla whilst retaining SPIGOT-844 API
bc943daf Fix Jukebox API not synchronizing playing data with state
fe89a8c1 SPIGOT-4503: Add API to insert complete ItemStack into Jukebox
fc102494 Make CraftBlockState use BlockPosition
89ab4887 SPIGOT-4543: Jukebox playing calls should not use legacy data
6ff5a64c SPIGOT-4541: Cancelled bucket events require inventory update
2018-12-23 17:04:13 +00:00
Shane Freeder
3496f2d7e4
Updated Upstream (Bukkit/CraftBukkit/Spigot)
Developers!: You will need to clean up your work/Minecraft/1.13.2 folder for this

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:
b850a822 SPIGOT-4526: Add conversion time API for Zombie & subclasses

CraftBukkit Changes:
38cf676e SPIGOT-4534: CreatureSpawnEvent not being called for CHUNK_GEN
b446cb5d SPIGOT-4527: Fix sponges with waterlogged blocks
6ec8ea5c SPIGOT-4526: Add conversion time API for Zombie & subclasses
c64fe508 Mappings Update
a3c2ec03 Fix missing ServerListPingEvent call for legacy pings

Spigot Changes:
1dc156ce Rebuild patches
140f654d Mappings Update
2018-12-17 05:19:39 +00:00
Shane Freeder
1387cff4e8
Update for Minecraft 1.13.2 2018-10-23 00:16:21 +01:00
BillyGalbreath
8c7f0e79ce Add more Witch API (#1564) 2018-10-18 23:24:09 -04:00
Aikar
459987d69f
More improvements to activation range, improve turtles
improved the water code so that immunity wont trigger if the entity
has the water pathfinder system active, so this improves support
for all entities that know how to behave in water.

Merged 2 EAR patches together, and removed an MCUtil method that
doesnt have a purpose anymore
2018-10-04 23:18:46 -04:00
Aikar
a4df5ddee7
Report errors correctly from FutureTasks
Anything that posts something to main thread was not
correctly reporting their errors to the logger, passing the
ExecutionExcetion instead of the cause. This resolves that,
as well as patches some simple cases of System.nanoTime where mojang
had used a LongSupplier to use a different method on client.
2018-10-04 01:45:11 -04:00
Zach Brown
10209bfbd8
Do not allow null in CanPlaceDestroy NBT API
Fixes GH-1523
2018-10-02 22:54:38 -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
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
Aikar
d089acb3bd
Switch to using ForgeFlower for Paper Only mc-dev imports
ForgeFlower is better than Spigots FernFlower at decompiling the source.

However, in order to maintain the CraftBukkit patches, we must keep
using spigots for the primary.

However, for any file that we import on top of Spigots imported files
there is nothing stopping us from using better decompiled files.

So these changes will use ForgeFlower to maintain a better set of
decomped files, so anything we add on top of Paper can start off
in a better spot.
2018-08-31 23:47:57 -04:00
Zach Brown
9ac7577de3
Update upstream CB 2018-08-27 11:07:22 -04:00
Aikar
835bc39b03
Paper 1.13.1 Update
Updated Upstream (Bukkit/CraftBukkit/Spigot)

Bukkit Changes:
2dcc44dc SPIGOT-4307: Fix hacky API for banners on shields
e0fc6572 SPIGOT-4309: Add "forced" display of particles
efeeab2f Add index to README.md for easier navigation
f502bc6f Update to Minecraft 1.13.1

CraftBukkit Changes:
d0bb0a1d Fix some tests randomly failing
997d378d Fix client stall in specific teleportation scenarios
b3dc2366 SPIGOT-4307: Fix hacky API for banners on shields
2a271162 SPIGOT-4301: Fix more invalid enchants
5d0d83bb SPIGOT-4309: Add "forced" display of particles
a6772578 Add additional tests for CraftBlockData
ce1af0c3 Update to Minecraft 1.13.1

Spigot Changes:
2440e189 Rebuild patches
4ecffced Update to Minecraft 1.13.1
2018-08-26 20:51:39 -04:00
stonar96
bd232d80da 1.13: Readd Anti-Xray (#1366)
* Decompile fixes for ProtoChunk and DataPaletteBlock

* Do changes

* final change

* more changes

* First Anti-Xray build

* Fixes and cleanups

* Cleanups and renamings

* Cleanups renamings and move OBFHELPERs to 0004-MC-Utils.patch

* Implement obfuscation for newly generated chunks

* Implement chunk edge mode

* Implement block updates

* Cleanups

* Rebuild patches
2018-08-25 22:37:58 -04:00
Aikar
716db7fb5e
[CI-SKIP] Re-add getBukkitEntity methods to child classes
Helps with development to not need to cast as much...

No clue why upstream makes some of the decisions they do....
2018-08-04 17:03:53 -04:00
Aikar
6b00d856be
Upstream update 2018-08-03 01:04:28 -04:00
Shane Freeder
8808629550
Update B/CB/S 2018-07-26 16:20:37 +01:00
Brokkonaut
af561492ab Fix broken block iteration (#1269)
Fixes https://github.com/PaperMC/Paper/issues/1259 and generation of the end pillars
2018-07-24 21:39:30 -04:00
Aikar
9a17bddf12
Update upstream 2018-07-23 19:41:14 -04:00
Shane Freeder
aad194a32e
Update B/CB/S 2018-07-23 09:44:57 +01:00
Aikar
b801b4baa8
Fix Chest open/close animations 2018-07-22 19:39:56 -04:00
Aikar
4dd6ddb86b
Re-add block inlining - Closes #1229
Also reordered MC Utils to be higher up
2018-07-22 18:46:13 -04:00
Zach Brown
5e2784e941
Switch to a bStats based Metrics system 2017-03-25 00:22:02 -05:00
Aikar
067c5c3f70 Fix String based Action Bar to use ChatComponent to handle proper escaping 2016-12-29 08:29:09 -05:00
Zach Brown
33163525f3
Update Paper to MC 1.11.1 2016-12-20 17:45:00 -06:00
Zach Brown
f9f1a2e97e
Cleanup obfuscation helper comment format 2016-07-28 19:09:54 -05:00
Aikar
0973e46de1 Update upstream 2016-06-22 22:18:41 -04:00
Techcable
bf40dd5557
Make entities look for hoppers
Cherry-pick of PR GH-319
2016-06-18 01:06:44 -05:00
Zach Brown
c442e96eb9
Update to Minecraft 1.10 2016-06-08 23:42:46 -05:00