Commit Graph

2907 Commits

Author SHA1 Message Date
Aikar fc917d1687
Optimize Hoppers - Major performance improvement
Removed streams from hoppers and also fixed a mistake in the logic.
When this patch was ported to 1.14/1.15, a line of code was put in
the wrong place which disabled a significant portion of the improvement.

Replaced usages of streams in isEmpty and itemstack checks
Replaced usage of streams in pulling loop
Replaced usage of streams in Lootable Inventory isEmpty() check
Only check for refilling Lootable Inventory when accessing first slot, not all

All of these in general were pretty significant hits, so this single commit
is going to cause tacos to magically appear in front of you every day.

🌮🌮🌮🌮🌮🌮🌮🌮🌮🌮🌮🌮🌮🌮🌮🌮🌮🌮🌮🌮🌮🌮🌮🌮🌮🌮🌮🌮🌮🌮🌮🌮🌮

Nom Nom Nom
If you hate taco's, you're not allowed to use this improvement.

Also ignore the renames, pulled a lot of PR's.
2020-05-11 03:42:32 -04:00
Omer Uddin 14ad77c692
Fix PotionEffect API Ignoring Icon bug
Fixes #3142
2020-05-11 00:44:27 -04:00
Omer Uddin eb3ce8a258
Fix EntityRaider picking up items when they shouldn't be able
Fixes #2205
2020-05-11 00:41:15 -04:00
Aikar 1ea9ada0da
Add a TELEPORT ticket when changing dimensions
This should fix any remaining issues around collision issues on
chunk edges when changing dimensions sending to Y 256
2020-05-11 00:19:40 -04:00
Aikar 8e9459eadc
Fix missing flag pass for isUrgent 2020-05-11 00:19:40 -04:00
Josh Roy 7befec4420
Potential bed api (#3339) 2020-05-11 00:19:04 -04:00
Spottedleaf 27945a6b1f
Optimize WorldBorder collision checks and air
Port part of leafs changes from Tuinity, will worry about rest later with larger changes coming
2020-05-10 22:52:20 -04:00
Aikar 55e17a8599
Wait for Async Tasks during shutdown
Server.reload() had this logic to give time for tasks to shutdown,
however shutdown did not...

Adds a 5 second grace period for any async tasks to finish and warns
if any are still running after that delay just as reload does.

Closes #3337
2020-05-10 22:17:55 -04:00
Aikar b59052566b
Ensure Entity AABB's are never invalid
If anything used setPositionRaw, it left potential for an AABB
to be left stale at their old location, which could cause massive
AABB boxes if movement ever then got called on the new position.

This guarantees any time we set the entities position, we also
update their AABB.
2020-05-10 22:14:47 -04:00
Aikar a054aa6f02
Properly remove Entities from current chunk
We store a reference to the chunk the entity is currently in, so use it
to more accurately unregister it in chunkCheck

Should maybe fix some entity loss issues.
2020-05-10 05:52:31 -04:00
Aikar c894ddfd38
Fix teleporting onto a chunk line
Obscure detail in that if you teleport right on a chunk line, it
adds +1 to your collision check and will check the unloaded neighbor.

but the call to load the chunk then returned null if it was pending unload, such
as the load we did in Player List

However we want gen=true for players here anyways, so use getType
2020-05-10 05:52:26 -04:00
Aikar 57d6cc0158
Send LOGIN protocol packets immediately - Fix disconnect during async prelogin 2020-05-10 03:12:05 -04:00
Aikar cd93e54df3
Don't use our modified chunk checks for collision in world gen
Fixes issues with errors in logs on generating chunks
2020-05-10 02:27:50 -04:00
Aikar b4003ef1ca
Allow loading entities current chunk if needed to fix collision checks
Having trouble reproducing this myself, but this should do it.
2020-05-10 01:04:45 -04:00
Aikar e5f6489602
Add Urgent API for Async Chunks API and use it for Async Teleport
This also cleans up the implementation of Async Chunks to get rid of most
Consumer callbacks and instead return futures.

This lets us propogate errors correctly up the future chain
(barring one isn't lost even deeper in the chain...)

So exceptions can now bubble to plugins using getChunkAtAsync
2020-05-10 00:57:03 -04:00
Aikar ad8e59dc79
Ensure chunks loaded on respawn for suffocation check 2020-05-09 21:13:30 -04:00
Aikar b1691e7b69
Remove some Streams usage in Entity Collision
While there is more down the collision system, remove some of the wrapping
Spliterator stuff as even this wrapper stream has shown up in profiling.

With other collision optimizations, we might also even avoid inner streams too.
2020-05-09 19:38:31 -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 8e85f841d8
Optimize Collision to not load chunks
The collision code takes an AABB and generates a cuboid of checks rather
than a cylinder, so at high velocity this can generate a lot of chunk checks.

Treat an unloaded chunk as a collision for entities, and also for players if
the "prevent moving into unloaded chunks" setting is enabled.

If that setting is not enabled, collisions will be ignored for players, since
movement will load only the chunk the player enters anyways and avoids loading
massive amounts of surrounding chunks due to large AABB lookups.

Fixes #3321
2020-05-09 19:19:08 -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 f6f9157bd4
Don't toString block unless actually showing the message
This is causing MASSIVE performance issues with hoppers and block states
in general.
2020-05-09 13:55:41 -04:00
Aikar ec8d7387ad
MC-183249: Don't generate Carving Masks BitSet unless needed
This was using SIGNIFICANT amounts of memory allocating many
long[]'s for BitSets for every ProtoChunk in the cache that had
been unloaded and reloaded.

This will result in a nice memory reduction.
2020-05-09 12:13:29 -04:00
Aikar 2d401d2dfb
Improve BlockPosition hashCode/equals
Actually showed up in profiling as decent time spent here...

Noticed y/z was missing its final that it use to have, when x had it. some how
must of got messed up on some update. though people suggest this shouldn't of
mattered anyways, but lets put it back for safety.

Added cache of hashcode, as well as optimized the hash code using larger primes.
Also stored the long value of the x/y/z so that for equals we can compare a single long,
as well as have that long value cached for .asLong()
2020-05-09 10:59:29 -04:00
Aikar 2572bd017c
Fix world unload toLowercase - Fixes #3326 2020-05-09 10:59:10 -04:00
virustotalop dda9680be5
Optimize brigadier child sorting performance
Use a TreeMap instead of a LinkedHashMap and then manually sorting

This will significantly reduce CPU usage on logging in and changing worlds.
2020-05-08 20:55:44 -04:00
Aikar a71a4ec215
Fix CraftServer.unloadWorld Leak
The dimension manager was still registered which leaked the entire World
2020-05-08 20:40:42 -04:00
Aikar f6fc0d4cd4
Don't create region files for chunk checks - mistake on upstream merge
Accidently handled a conflict wrong in a previous upstream merge and set wrong param.
2020-05-08 18:22:37 -04:00
Aikar cfed00cf54
Fix Light Command
This lets you run /paper fixlight <chunkRadius> (max 5) to automatically
fix all light data in the chunks.

Permission node is same "bukkit.command.paper"
2020-05-07 19:44:33 -04:00
Aikar a6ff84add7
Revert Nibble patch, causing issues still 2020-05-07 05:30:40 -04:00
Aikar f1a8eb7fda
Use a finalizer for light packet instead of onPacketDone
Sadly sharing packets is breaking the ability to do this :(

We can prob still do a little better than this but will save that
for another commit.
2020-05-07 01:58:23 -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 d0a528b1cb
Move delayed init down later in tick, improve accuracy of startup time
Now tracks the full startup time for "Done" message at end, as apparently
Vanillas was done in a place that skipped tracking a lot of code too.

This fixes an issue with ViaVersion
2020-05-06 21:24:43 -04:00
Aikar cc477e6abb
Force Plugins that use delayed tasks for init back in their place
Will now run those tasks just before we print "Done" so that startup
time is appropriately accounted for a plugin, as well as will no longer
trip the watchdog on startup.

Any plugin that tries to bypass this is just going to then trip watchdog
on Spigot too, so don't you dare.

Stop trying to cheat the delay your plugin added to startup time.

This isn't a behavior change because the first thing the tick does....
was run these tasks....

So it's just moving it slightly a few lines to be before a watchdog tick and
to account for it in "Done" time.

Fixes #3294
2020-05-06 20:18:31 -04:00
Aikar 597263fd55
Don't skip full player connection tick when dead
Still need to send keep alives and kick for idle

Fixes #3299
2020-05-06 19:30:47 -04:00
Spottedleaf e2c23475b5
Revert loaded entity list (#3304) 2020-05-06 11:31:29 -05:00
Spottedleaf fa87db6b91
Move another NetworkManager util into the inner class (#3303)
Those poor souls running outdated ProtocolLib.
2020-05-06 10:07:51 -05:00
Spottedleaf 841c7d1879
Make loaded entity list logic more consistent (#3301)
When adding/removing to a chunk, we need to also look at
editing the loaded entity list.

Co-authored-by: Spottedleaf <Spottedleaf@users.noreply.github.com>
2020-05-06 09:57:18 -05:00
Aikar 36f34f01c0
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:
da9ef3c5 #496: Add methods to get/set ItemStacks in EquipmentSlots
3abebc9f #492: Let Tameable extend Animals rather than Entity
941111a0 #495: Expose ItemStack and hand used in PlayerShearEntityEvent
4fe19cae #494: InventoryView - Add missing Brewing FUEL_TIME

CraftBukkit Changes:
933e9094 #664: Add methods to get/set ItemStacks in EquipmentSlots
18722312 #662: Expose ItemStack and hand used in PlayerShearEntityEvent
2020-05-06 06:05:22 -04:00
Aikar 5ca5f131bb
Rebuild all patches using the new rebuild pattern 2020-05-06 05:48:49 -04:00
Mariell Hoversholm 1ccff6fabb
Add villager reputation API 2020-05-06 05:48:06 -04:00
Aikar f37381ea8a
Optimize Network Manager to not need synchronization
Removes synchronization from sending packets
Makes normal packet sends no longer need to be wrapped and queued like it use to work.
Adds more packet queue immunities on top of keep alive to let the following scenarios go out
without delay:
  - Keep Alive
  - Chat
  - Kick
  - All of the packets during the Player Joined World event

Hoping that latter one helps join timeout issues more too for slow connections.

Removes processing packet queue off of main thread
  - for the few cases where it is allowed, order is not necessary nor
    should it even be happening concurrently in first place (handshaking/login/status)

Ensures packets sent asynchronously are dispatched on main thread

This helps ensure safety for ProtocolLib as packet listeners
are commonly accessing world state. This will allow you to schedule
a packet to be sent async, but itll be dispatched sync for packet
listeners to process.

This should solve some deadlock risks

This may provide a decent performance improvement because thread synchronization incurs a cache reset
so by avoiding ever entering a synchronized block, we get to avoid that, and packet sending is a really
hot activity.
2020-05-06 05:28:47 -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 878c66f116
No-Tick view distance implementation - Closes #3196
Implements world view distance getters/setters

Per-Player is absent due to difficulty of maintaining
the diff required to make it happen.
2020-05-06 03:50:52 -04:00
Spottedleaf b87743c1e0
Stop copy-on-write operations for updating light data
Causes huge memory allocations + gc issues
2020-05-06 03:48:56 -04:00
Spottedleaf 97a9c9724a
Optimize isOutsideRange to use distance maps
Use a distance map to find the players in range quickly
2020-05-06 03:48:18 -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
Spottedleaf d80d15174b
Optimize Entity Ticking to Loaded Chunks only
We retain a list of loaded entities specifically for this usage
2020-05-06 03:43:11 -04:00
MiniDigger 75e1e3b3e1 Mob Goal API 2020-05-05 18:05:27 +02:00
Aikar c7bc393a87
Revert "Don't flush packet queue off main thread"
This reverts commit 1abd2bd279.

Sadly not gonna work due to server pings
2020-05-04 04:50:08 -04:00
Aikar 1abd2bd279
Don't flush packet queue off main thread
Increases risk of deadlock if a plugin using protocollib sends a packet
async, and then a listener then reads world state, and main thread is then
blocked waiting for the queue to flush.

This will break out of the synchronized block when it jumps to the netty event loop.

See: https://gist.github.com/aikar/e7abb2ba7059149d0a91f7a226e98590
2020-05-04 03:07:04 -04:00
Aikar a4ed58a9ab
Clean up Direct Memory Region Files Fix for different Java versions
Java 9+ doesn't allow using the exposed cleanup method, but added
a new method on Unsafe to do it.

So have to detect java version and use the appropriate strategy.
2020-05-04 02:19:38 -04:00
Aikar 55e3501967
Set cap on JDK per-thread native byte buffer cache
See: https://www.evanjones.ca/java-bytebuffer-leak.html

This is potentially a source of lots of native memory usage.

We are clearly seeing native usage upwards to 1-4GB which doesn't make sense.

Region File usage fixed in previous patch should of tecnically only been somewhat
temporary until GC finally gets it some time later, but between all the various
plugins doing IO on various threads, this hidden detail of the JDK could be
keeping long lived large direct buffers in cache.

Set system properly at server startup if not set already to help protect from this.
2020-05-04 01:14:10 -04:00
Aikar b5101f4f97
Cleanup Region Files Direct Memory on close
Mojang was semi leaking native memory here by relying on finalizers
to clean up the direct memory.

Finalizers have no guarantee on when they will be ran, and since this is
old generation memory, it might be a while before its called.
2020-05-04 01:08:51 -04:00
Aikar 81e655d7fa
Optimize Voxel Shape Merging
This method shows up as super hot in profiler, and also a high "self" time.

Upon analyzing, it appears most usages of this method fall down to the final
else statement of the nasty ternary.

Upon even further analyzation, it appears then the majority of those have a
consistent list 1.... One with Infinity head and Tails.

First optimization is to detect these infinite states and immediately return that
VoxelShapeMergerList so we can avoid testing the rest for most cases.

Break the method into 2 to help the JVM promote inlining of this fast path.

Then it was also noticed that VoxelShapeMergerList constructor is also a hotspot
with a high self time...

Well, knowing that in most cases our list 1 is actualy the same value, it allows
us to know that with an infinite list1, the result on the merger is essentially
list2 as the final values.

This let us analyze the 2 potential states (Infinite with 2 sources or 4 sources)
and compute a deterministic result for the MergerList values.

Additionally, this lets us avoid even allocating new objects for this too, further
reducing memory usage.
2020-05-03 23:02:52 -04:00
Aikar ed9fc11fe3
Sync position on teleportation
We've seen many a cases where the "last good" x/y/z is desynced from
the x/y/z that is checked for moving too fast.

Theory is that when you have multiple movement packets queued up,
and the player is teleported after the first then the 2nd and 3rd come in,
it is triggering a massive movement velocity.

This will ensure that the servers position is synchronized anytime player is te

Fixes #3258
2020-05-03 15:29:53 -04:00
Aikar 9c326fceda
Nanothing to see here 2020-05-03 03:38:19 -04:00
Aikar 3e9fc24b66
Attempt to fix FastLogin maybe 2020-05-03 02:20:56 -04:00
Aikar 932e97f345
Rename to AsyncPlayerSendSuggestionsEvent to be consistent in naming
It was still technically read correctly in what it was doing, but
all our Player events begin with Player.

Nothing uses this event yet so safe to rename.

If you are some rapid adopter of this event, sorry :P
2020-05-02 15:29:03 -04:00
Aikar 0dd1907568
AsyncSendPlayerSuggestionsEvent Brigadier Event
Going to be used for ACF to be able to send Tooltips to client :)

This is after completions are calculated, to control what is sent to the client.
2020-05-02 14:17:17 -04:00
Aikar a9e20e5f62
Fix being kicked in survival for block picking - Fixes #3277 2020-05-02 13:32:03 -04:00
MiniDigger 4d20537e6e
Expose game version (#3274) 2020-05-02 04:56:08 -04:00
Aikar 85fb00152a
Validate PickItem Packet and kick for invalid - Fixes #3256 2020-05-02 03:10:26 -04:00
Aikar 5729bc716e
Special case Keep Alive packets from Anti Xray
If a server enables Anti Xray, packet sending can be delayed until the
chunk has been obfuscated, blocking the entire queue from going out.

On a busy server, considering Anti Xray can only operate on a single
thread, it is quite possible the obfuscation backlog can get quite behind
resulting in a delay of sending packets.

And logging in is a clear area where lots of chunks are going to be queued
for obfuscation....

We should probably special case a few more than this (such as chat),
but this will hopefully help the keep alive issues some people run into.
2020-05-02 01:01:50 -04:00
Spottedleaf a76b774070
Improved oversized chunk data packet handling
Now target all TE data, except for TE's that do not have
update packets.
2020-05-02 00:31:24 -04:00
Aikar a6f78170db
Use Vanilla Bed Search for non players (Villagers)
Should help #2959
2020-05-01 21:56:50 -04:00
Aikar 68fb98b50f
Fix 2 plugin specific issues with loot drop and pathfinders
Based on what that collection does, won't really cause any real issue for UC.
So let it silently be ignored.

Fixes #3269
Fixes #3255
2020-05-01 21:48:43 -04:00
Aikar 6e41f7b79a
Update Activation Range 2.0 with more villager controls
Now has separate configs to control Villager immunities a bit.

whether or not they wake up due to panic situations (raids)
and when should they wake up when work is available after being
inactive for so long, and for how long.

This work config may make the 'wake up inactive' feature for villagers
useless in most scenarios, but if there is a situation where the villager
does go without needing to work for a long period of time, it would kick
in then.

This also removes movement based immunities, so now villagers should only move
if they trigger a work immunity, panic immunity, or inactive wake up immunity.

Fixes #3263
2020-05-01 21:48:33 -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
MiniDigger 5ab48ad901
Fix commodore (#3264)
fixes #3262
2020-04-30 18:05:20 +01:00
Aikar 87e7ee7e79
Improve Async Login to avoid firing in middle of Entity Ticking
If a sync load was triggered, it would process pending join events,
causing them to be added to the world in the middle of the entity ticking
process.

This caused their add to be queued instead of immediate, causing
"Illegal Tracking" errors.

This schedules it to fire at the players next Connection Tick, which
is exactly where this entire process use to run anyways.

Also added missing tab complete and syntax for syncloadinfo debug command
2020-04-29 05:40:40 -04:00
Aikar 00d760a537
Fix build due to spigot changing the build timestamp process 2020-04-27 04:03:00 -04:00
Aikar 842e040c19
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:
220bc594 #486: Add method to get player's attack cooldown
21853d39 SPIGOT-5681: Increase max plugin channel size
5b972adc Improve build process
b55e58d9 Note which custom generator is missing required method

CraftBukkit Changes:
893ad93b #650: Add method to get player's attack cooldown
ef706b06 #655: Added support for the VM tag jansi.passthrough when processing messages sent to a ColouredConsoleSender.
e0cfb347 SPIGOT-5689: Fireball.setDirection increases velocity too much
94cb030f SPIGOT-5673: swingHand API does not show to self
b331a055 SPIGOT-5680: isChunkGenerated creates empty region files
e1335932 Improve build process
a8ec1d60 Add a couple of method null checks to CraftWorld
ce66f693 Misc checkstyle fixes
8bd0e9ab SPIGOT-5669: Fix Beehive.isSedated

Spigot Changes:
2040c4c4 SPIGOT-5677, MC-114796: Fix portals generating outside world border
ab8f6b5a Rebuild patches
e7dc2f53 Rebuild patches
2020-04-27 03:34:45 -04:00
nick c03260a280
Add getter and setter for villager's numberOfRestocksToday (#3231) 2020-04-27 02:13:41 -04:00
Aikar fe366fbe77
null check tracker for entity metadata update - Fixes #3070 2020-04-27 01:57:42 -04:00
Aikar fdf41b742d
Implement Brigadier Mojang API
This is the start of a new module for Paper to add support for API's
that interface Mojang API's directly.

This allows us to version properly by MC version incase Mojang makes any major breaking changes.

It also lets us separate Mojang API's from Paper-API so our downstream friends at Glowstone
will not have to worry about Mojang code.

Adds AsyncPlayerSendCommandsEvent
  - Allows modifying on a per command basis what command data they see.

Adds CommandRegisteredEvent
  - Allows manipulating the CommandNode to add more children/metadata for the client
2020-04-27 01:42:12 -04:00
Aikar e0ea2e0e14
Entity Activation Range 2.0! Major improvements to restoring behavior
Calling this 2.0 as it's a pretty major improvement with more knobs to twist.

This update fixes many things. The goal here is to restore vanilla behavior to some degree.
Instead of permanent inactive pools of animals, let them show some signs of life some....

Yes this may reduce performance compared to before, but I hope it is minimal. Got to find a balance.
Previous EAR logic really compromised vanilla behavior of mobs. This tries to restore it.

Changes:

1) All monsters are now classed as Monster. Mojang has an interface, we should use it.
   - This now includes Shulker, Slimes, see #2 for Phantom and Ghast
2) Villagers and Flying Monsters now have their own separate activation range configs.
   - Villagers will default to your Animals config
3) Added a bunch of more immunities
   - Brand new entities are immune for a few seconds
   - Entities that recently traveled by portal are immune for few seconds
   - Entities that are leashed to a player are immune
   - Ender Signals are immune
   - Entities that are jumping, climbing, dying (lol) are immune
   - Minecarts are now always immune to the movement restriction
4) Villagers immunity received major overhaul...
   - Now has many immunities for Villager activities to let them
     do their work then go back inactive
   - Such as interacting with doors and workstations should be more normal now
   - Raids will trigger immunities, in that villagers will run and hide when bell rings.
   - Raid should keep the entire village immune during the raid to keep gameplay mechanics
     You can disable raids by game rule if you dont want raids

Then the big one.....

Wake Up Inactive Entities:
One issue plagueing "farms" is that we no longer even let entities move now.
Entities become lifeless.

A new system has been introduced to wake up inactive entities every so often, to let
them stretch their legs, eat some food, play with each other and experience the good entity life.

Animals, Villagers, Monsters (Includes Pillagers), and Flying Monsters will now wake up every
so often after staying inactive for a very long. This grants them a temporary immunity, that
the goal is they will then find "stuff to do" by having a longer activity window.

How many to wake up, how often they wake up, and for how long they wake up are all configurable.

Current EAR Immunities really don't give some entities enough of a window to find work
to then keep them immune for the work to even start. This system should help that.

We will only wake up a few entities per tick on the first wave, restoring 1 per type per world per tick.

So say you have 10 monsters qualify for inactive wake up, all 8 will wake up on the first eligible tick,
and then the 9th will wake up on next tick, 10th on next tick.

If for 5 ticks no more inactive wake up, our buffer will have built back up to 5, and then 5 can go next needed tick.

This basically incrementally wakes them up, preventing too many from waking up in a single tick, to reduce impact to TPS.
2020-04-27 01:22:44 -04:00
Aikar 10396d28e1
Fix Tracking Range mismatch on Vehicle/Passenger checks
This was missing Entity Tracking Range support, creating different
values in this section vs normal section.

Concerned this might of caused some carnage on tracker if this code says
"Yes you should track this player 500 blocks away from you on a horse" and then
the other check uses the normal value.
2020-04-27 00:33:14 -04:00
Aikar 68994c64ec
Add a config to turn off Optimized TickList #3145
Set:

settings:
  - use-optimized-ticklist: false

If you are having issues with block updates and want to see if this fixes it.

Please report confirmations on #3145 ticket
2020-04-26 04:01:03 -04:00
Aikar d847d33684
Improve blocking players from opening inventories while sleeping
This is friendlier to plugins as far as the plugin is concerned,
the inventory did open and immediately closed.

We avoid sending the packet to client so they don't see the window
flash either.

If a plugin wants to avoid wasteful fake opens, they should check
that the player is not sleeping before opening the inventory.
2020-04-26 03:26:21 -04:00
Aikar ac4f6b5022
Clean up Timings and Async Chunk Configs
Renames a bunch of timings to be more appropriate for the new environment.

Many things dealt with sync loads which wasn't correct anymore.
adjusted timings to be a little bit more accurate here.

Also cleaned up old 1.13 async chunks configs so people won't keep
thinking they can change some of those configs when they can't.
2020-04-26 02:19:43 -04:00
Aikar fcf89e852e
Improve mid tick chunk loading, Fix Oversleep, other improvements
Process loads outside of any canSleep check. Original intent was to
only apply those restrictions to generations but realized I had some
checks higher up the call chain.

Reworked the back off strategy to just run every 1 millisecond per world,
and to apply the per tick limit to generations only.

This guarantees that your chunk will load with at most around 1ms delay.

Additionally, fire midTick processing in a few more places, notably the
oversleep section so we can keep processing loads here too which has
a large up to 50ms window...

Speaking of oversleep, we had a bug in our implementation changes for
Timings that caused oversleep to not sleep the correct amount.

Because we now moved it into the NEXT tick instead of THIS tick, the
value of nextTick had already been increased to +50ms, resulting in
the risk of sleeping more than it should, but, more importantly, this
caused every task that was trying to NOT run during oversleep to actually
run during oversleep.

This is now fixed.

Another small tweak is to the /tps command, to no longer show the star when
TPS is right at 20.

Due to ineffeciencies in the sleep precision, TPS is commonly 20.02.
This causes the star to show up almost constantly, so now only show it if
we actually hit a real "catchup".

This commit also improves the changes to the CallbackExecutor, in that
it now is also recursion safe.

It was possible that the executor could run tasks out of desired order
if the executor task scheduled more executor tasks.

We solve this by ensuring new additions do not enter the currently iterated queue.

Each depth level will have its own queue.

Fixes #3220
2020-04-26 01:14:52 -04:00
Spottedleaf ab36835ca0
Improve random ticking behaviour - Fixes #3181 2020-04-25 18:43:13 -04:00
Aikar a6ac47e502
Fix numerous item duplication issues and teleport issues
This notably fixes the newest "Donkey Dupe", but also fixes a lot
of dupe bugs in general around nether portals and entity world transfer

We also fix item duplication generically by anytime we clone an item
to drop it on the ground, destroy the source item.

This avoid an itemstack ever existing twice in the world state pre
clean up stage.

So even if something NEW comes up, it would be impossible to drop the
same item twice because the source was destroyed.

This should make us more forward proof on preventing dupes.

These dupes have been in for years at this point, they aren't new...
Everyone knows about them and are mitigating with plugins atm breaking gameplay.

so better to make it clear its fixed in the messaging.

I am submitting this to Mojang.
2020-04-25 16:38:14 -04:00
BillyGalbreath b7402f11c3
Add phantom creative and insomniac controls (#3222) 2020-04-25 16:33:18 -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
Aikar f275e9cb9c
Optimize Hoppers - Major Boost - Got2GoFast!
* Don't check for Entities with Inventories if the block above us is also occluding (not just Inventoried)
* Remove Streams from Item Suck In and restore restore 1.12 AABB checks which is simpler and no voxel allocations (was doing TWO Item Suck ins)
* Restore missing application of previous optimization to getEntities for Inventoried Entities from CullanP
* Use getChunkIfLoadedImmediately for getting loaded entities (faster/simpler, no risk of sync loads)
2020-04-24 03:01:17 -04:00
Aikar 0106485ccb
Improvements to watchdog changes
catch a thread death, fix invalid watchdog timeouts

<= 0 seconds will now change to 5 minutes.
2020-04-24 00:27:50 -04:00
Aikar 65934b1fec
Fix build for last commit. 5am commits are great 2020-04-23 04:53:20 -04:00
Aikar 3f4360296c
Don't process watchdog until server has fully started and ticked.
I think adjusting watchdog settings may of caused instant crashes.

Fixes #3209
2020-04-23 04:49:41 -04:00
Aikar 938bd97255
Don't fire BlockFade on worldgen threads - Fixes #3208
Caused a deadlock
2020-04-23 01:37:30 -04:00
Aikar 509a828e06
Fix loading spawn chunks when async chunks is off
I feel sorry for those who need to do this, and now feel sorry more
since back to slow startups again.

There is keep-spawn-loaded-range in paper.yml to reduce the range to
mitigate this if you must keep async chunks off.
2020-04-22 05:47:35 -04:00
Aikar 8a91bfd240
Improvements to async login
Bump chunk priority to ensure chunks load fast
Handle case where client disconnects before they even fire PlayerJoinEvent
  - no longer call PlayerQuitEvent or print quit message.
  - don't save the player data file if never joined. Nothing has changed.
    CraftBukkit has a bug here that if you do save it, you will lose
    any horse that the player logged off on because the horse hasn't
    been resummoned yet.
2020-04-22 05:40:06 -04:00
Ytnoos bf698865f7
Revert "Re-track players that dismount from other players" 2020-04-22 03:16:31 -04:00
Aikar 82b984184a
Fix some issues with async login as well another source of sync loads 2020-04-22 02:52:17 -04:00
Aikar aa241d2b64
Allow multiple callbacks to schedule for Callback Executor
ChunkMapDistance polls multiple entries for pendingChunkUpdates

Each of these have the potential to move a chunk in and out of
"Loaded" state, which will result in multiple callbacks being
needed within a single tick of ChunkMapDistance

Use an ArrayDeque to store this Queue
2020-04-21 03:55:31 -04:00
nossr50 a2064a4135
Add PlayerAttackEntityCooldownResetEvent
This event is called when processing a player's attack on an entity
right before their attack strength cd is reset, there are no existing
events that fire within this period of time so it was impossible to
capture the players attack strength via API prior to this commit.

The event is cancellable, which will just skip over the normal reset of
attack strength cd
2020-04-21 02:10:43 -04:00
Mariell Hoversholm f48d429968
Allow sleeping players to float
This change lets players who are in their bed have a position which is above
ground for a longer period of time. This is because of the server not setting
their position to the ground/exit location when entering the bed, resulting in
the server believing they're still in the air.
2020-04-20 23:15:55 -04:00
Omer Uddin eeb2f67db6
Fix Bed respawn deviating too far from vanilla (#3195) 2020-04-20 23:14:28 -04:00
2277 68a7b9fec8
Move player to spawn point if spawn in unloaded world
The code following this has better support for null worlds to move
them back to the world spawn.
2020-04-20 23:12:28 -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 9fd36824fc
Fix Citizens Player NPC tracking issue - Fixes #3186 2020-04-19 13:41:16 -04:00
Aikar 0e72de1c18
Fix Player Tracking issue during join process.
Because we moved entity registration to occur before the PlayerJoinEvent occurs,
We started tracking the entity too early before it was registered to the client.

So delay tracking until after list packets have been sent.
2020-04-19 06:46:48 -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
Aikar 54f762e2f7
Load Chunks for Login Asynchronously
No longer will trigger Synchronous Chunk Loads when a player logs
in to the server.

Will delay PlayerJoinEvent until the chunk has been loaded.

Should have massive performance benefits for larger servers with
lots of players logging in and out.
2020-04-19 04:35:01 -04:00
Aikar f2d1b6e549
Clean up duplicate PlayerInitialSpawnEvent
Confused on this one, as commit history says Spigots version is older
than our version, so i'm not sure how we ended up duplicating this when
the 2 events are 100% identical.

Subclass spigots event and rely on the inheritance system, and clean up
the duplicate event fires.

Fix Spigots setPosition to use setPositionRaw to avoid chunk load prematurely.
2020-04-19 04:34:43 -04:00
Aikar c2d022d7e7
Fix Longstanding Broken behavior of PlayerJoinEvent
For years, plugin developers have had to delay many things they do
inside of the PlayerJoinEvent by 1 tick to make it actually work.

This all boiled down to 1 reason why: The event fired before the
player was fully ready and joined to the world!

Additionally, if that player logged out on a vehicle, the event
fired before the vehicle was even loaded, so that plugins had no
access to the vehicle during this event either.

This change finally fixes this issue, fully preparing the player
into the world as a fully ready entity, vehicle included.

There should be no plugins that break because of this change, but might
improve consistency with other plugins instead.

For example, if 2 plugins listens to this event, and the first one
teleported the player in the event, then the 2nd plugin actually
would be getting a valid player!

This was very non deterministic. This change will ensure every plugin
receives a deterministic result, and should no longer require 1 tick
delays anymore.
2020-04-19 00:56:43 -04:00
AvrooVulcan d0a348b95e
Broadcast join messages to console 2020-04-19 00:52:35 -04:00
Aikar 1ef687a4a6
Don't crash if player is attempted to be removed from untracked chunk.
I suspect it deals with teleporting as it uses players current x/y/z

Fixes #2803
2020-04-18 16:03:30 -04:00
Spottedleaf c11668aca1
Make sure the chunk conversion task is executed immediately
Appending to the tail of the chunk tasks leaves a
window for the chunk to be moved to a
non-ticking status.

Additionally, use CB's callback executor so we
can ensure that we are not incorrectly
scheduling.
2020-04-18 13:00:17 -04:00
Aikar 26fb7cc35a
Fix Chunk Post Processing deadlock risk
See: https://gist.github.com/aikar/dd22bbd2a3d78a2fd3d92e95e9f28dc6

as part of post processing a chunk, we can call ChunkConverter.

ChunkConverter then kicks off major physics updates, and when blocks
that have connections across chunk boundries occur, a recursive risk
can occur where A updates a block that triggers a physics request.

That physics request may trigger a chunk request, that then enqueues
a task into the Mailbox ChunkTaskQueueSorter.

If anything requests that same chunk that is in the middle of conversion,
it's mailbox queue is going to be held up, so the subsequent chunk request
will be unable to proceed.

We delay post processing of Chunk.A() 1 "pass" by re stuffing it back into
the executor so that the mailbox ChunkQueue is now considered empty.

This successfully fixed a reoccurring and highly reproduceable crash
for heightmaps.
2020-04-18 04:44:35 -04:00
Shane Freeder ffecc4e264
Revert "Optimize entity list iteration requiring entities be in"
This reverts commit bc48a3172d.
2020-04-17 18:26:57 +01:00
Aikar 0a4286cc42
Prevent Fire from loading chunks
Had my server die from this twice already as it can cause a chain reaction.
2020-04-17 00:29:53 -04:00
MiniDigger 07915ea183
Add Player Client Options API (#2883) 2020-04-17 00:10:38 -04:00
Spottedleaf bc48a3172d
Optimize entity list iteration requiring entities be in
loaded chunks

We retain a list of loaded entities specifically for this usage
2020-04-16 23:59:15 -04:00
Spottedleaf 88092fef13
Optimize ChunkProviderServer's chunk level checking helper methods
These can be hot functions (i.e entity ticking and block ticking),
so inline where possible, and avoid the abstraction of the
Either class.
2020-04-16 23:47:15 -04:00
Aikar 01e8ce8d2d
Forced Watchdog Crash support and Improve Async Shutdown
If the request to shut down the server is received while we are in
a watchdog hang, immediately treat it as a crash and begin the shutdown
process. Shutdown process is now improved to also shutdown cleanly when
not using restart scripts either.

If a server is deadlocked, a server owner can send SIGHUP (or any other signal
the JVM understands to shut down as it currently does) and the watchdog
will no longer need to wait until the full timeout, allowing you to trigger
a close process and try to shut the server down gracefully, saving player and
world data.

Previously there was no way to trigger this outside of waiting for a full watchdog
timeout, which may be set to a really long time...

Additionally, fix everything to do with shutting the server down asynchronously.

Previously, nearly everything about the process was fragile and unsafe. Main might
not have actually been frozen, and might still be manipulating state.

Or, some reuest might ask main to do something in the shutdown but main is dead.

Or worse, other things might start closing down items such as the Console or Thread Pool
before we are fully shutdown.

This change tries to resolve all of these issues by moving everything into the stop
method and guaranteeing only one thread is stopping the server.

We then issue Thread Death to the main thread of another thread initiates the stop process.
We have to ensure Thread Death propagates correctly though to stop main completely.

This is to ensure that if main isn't truely stuck, it's not manipulating state we are trying to save.
2020-04-16 22:40:20 -04:00
Zach Brown fdb8fe7807
Be less strict with vanilla teleport command limits
Just limit to the same valid location check as BaseBlockPosition, no
reason to restrict to the world border.

Ref: GH-3165
2020-04-16 21:19:42 -05:00
Zach Brown 0f06d38062
Restrict vanilla teleport command to within worldborder
Fixes GH-3165
2020-04-16 20:11:44 -05:00
Aikar 24d93aafa2
Fix Optional null issue - Fixes #3155
Also check class loader cache before locking to speed up cached hits to avoid the lock

wasn't gonna make a unique build just for that but can lump it in here.
2020-04-16 03:57:02 -04:00
Spottedleaf eb71c5fa3b
Fix incorect timing of mspt
Move oversleep and all task execution back into the timed area...
2020-04-16 03:47:38 -04:00
Spottedleaf 1ca8043428
Optimise entity hard collision checking
Very few entities actually hard collide, so store them in their own
entity slices and provide a special getEntites type call just for them.
This reduces entity collision checking impact (in my testing) by 25%
for crammed entities (shove 130 cows into an 8x6 area in one chunk).
Less crammed entities are likely to show significantly less benefit.
Effectively, this patch optimises crammed entity situations.
2020-04-16 00:40:47 -04:00
Spottedleaf b67a423768
Don't run entity collision code if not needed
Will not run if max entity craming is disabled and
the max collisions per entity is less than or equal to 0
2020-04-16 00:40:34 -04:00
Spottedleaf bd9aa547d2
Optimise ArraySetSorted#removeIf
Remove iterator allocation and ensure the call is always O(n)
2020-04-16 00:21:32 -04:00
Aikar 81706e6268
Make the shutdown thread try to shutdown on main 2020-04-13 03:30:12 -04:00
Shane Freeder 8918245090
Prevent opening inventories when frozen 2020-04-13 07:33:46 +01:00
Spottedleaf e6d395cc83
Port 04-Util.patch from Tuinity (#3136) 2020-04-13 01:34:18 -04:00
Aikar 59453f6675
Fix incorrectly loading chunks on a cancelled interact event
A players previous block break location is held onto permanently, and if
an interact event is cancelled, the client sends a stop breaking block packet
This then tries to update client about that old location.

This old location might then be in a now unloaded chunk, and it caused it to load.

We now also clear reference to it once abort destroy block is ran to stop trying
to send updates about the old block anyways.
2020-04-12 23:56:29 -04:00
Aikar bdcc31caad
Let invalid positioned entities clean up previous chunk by the chunkCheck
I had did a few of the operations myself, which would have broken chunkCheck
from doing it itself, which would leave some state left in the original chunk
and thats not good....
2020-04-12 22:55:43 -04:00
Spottedleaf 92d2907d14
Multiple memory and performance optimizations (removing streams) 2020-04-12 19:34:56 -04:00
Aikar 748e6447e3
Improve the don't save entities patch per leafs feedback 2020-04-12 18:29:52 -04:00
Callahan c096fe19fa
Port 20w15a Villager AI optimizations 2020-04-12 16:56:59 -04:00
Aikar 832687de70
Restore preventing saving bad entities patch to full effect 2020-04-12 16:50:50 -04:00
Aikar df8eedeed0
Restore Optimize Pathfinding patch 2020-04-12 16:50:34 -04:00
Aikar 97b1cc361b
Allow shutting down server during a watchdog hang gracefully
If the request to shut down the server is received while we are in
a watchdog hang, immediately treat it as a crash and begin the shutdown
process. Shutdown process is now improved to also shutdown cleanly when
not using restart scripts either.

If a server is deadlocked, a server owner can send SIGUP (or any other signal
the JVM understands to shut down as it currently does) and the watchdog
will no longer need to wait until the full timeout, allowing you to trigger
a close process and try to shut the server down gracefully, saving player and
world data.

Previously there was no way to trigger this outside of waiting for a full watchdog
timeout, which may be set to a really long time...
2020-04-12 15:56:03 -04:00
Callahan 06044e2458
Async command map building
Reduces lag created on login and world change for sending the command map to client
2020-04-12 15:43:07 -04:00
DrHenchman a4f066ccea
Fix method profiler inbalance introduced in a2a9ffe (#3132)
Fixes #3131
2020-04-12 02:41:57 -04:00
Aikar c65dcad3eb
Don't delay chunk unloads during entity ticking
Leaf informed me this could cause ordering issues.

So, the risk if this occurring is lowered now anyways, but if an
entity causes a sync chunk load, it could process an unload...

We will tackle the problem better in a future commit

Also fixed another async-chunks=false issue
2020-04-12 00:42:28 -04:00
Aikar bc17ce69d4
Delay unsafe actions until after entity ticking is done - Fixes #3114
This will help prevent many cases of unregistering entities during entity ticking

Currently delays Chunk Unloads and Async Chunk load callbacks

Also dropped mid ticking chunk tasks during entity ticking to reduce this risk
2020-04-11 23:22:40 -04:00
Aikar e12c51d9bc
Use better variable for isStopping() API
Previous method only worked for a normal shutdown, and didn't include
when the server enters a closing state due to watchdog crashes

This is the correct variable to detect the server is in the middle of shutdown process
2020-04-11 23:21:33 -04:00
Aikar 586ee2bb11
Remove patch for MC-111480, fixed in 1.14
We were now starting entities at ID 2
2020-04-11 20:39:21 -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 bb5c294ecf
Fix Disabling Asynchronous Chunks
This fix is for the few people who are using such low end systems that
asynchronous chunk loading hurts them rather than helping.

The previous build made paper crash if you turned off async chunks, and
this fixes that issue.
2020-04-11 17:15:41 -04:00
Aikar 089d83568b
Implement Chunk Priority / Urgency System for World Gen
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.

This is also a precursor to my next improvement to prioritize chunks
in front of the player (Frustum Priorization)
2020-04-11 04:46:21 -04:00
Aikar fce69af70c
Use dedicated thread for main thread blocking chunk loads
In most cases, this change won't benefit much. However, there
exists the possibility that your Chunk Task threads are all busy
doing super slow work such as converting chunks.

If this occurs, the main thread blocking tasks, even at highest priority,
has to wait for some thread to become available.

This change gives us a waiting thread used only for main thread blocking
tasks, as well as an increased thread priority level, so that the OS
will give priority to this thread over the other threads.

This is more about guarantees, and won't be any real performanc boost
to anyone who has low or fast activity on their chunk tasks anyways.

But not all of us force upgrade our worlds, and this can be a life saver.

also reordered some patches because multiple PR's were merged.
2020-04-11 04:46:13 -04:00
BillyGalbreath 588b62e47b
Add tick times API and /mspt command (#3102) 2020-04-11 01:52:17 -04:00
Josh Roy 11de41c777
Add API MinecraftServer#isStopping (#3129) 2020-04-11 01:51:35 -04:00
Aikar 0ed6da7ab2
Fix issues with 167 causing crashes due to missing chunks - Fixes #3122
Forgot to flip the pending boolean back to false, causing it to copy
empty data on the next tick if nothing else triggered a load.

haven't managed to actually reproduce the crash others got, but did
verify that the bad copy was occurring erasing the data.

also fixed a bug with chunk load callback not executing before
another one was scheduled.
2020-04-10 14:11:46 -04:00
Aikar 23ee0a8a88
Fix issue with 0,0 chunks causing crash 2020-04-09 23:02:17 -04:00
Aikar bc8fafb206
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:
183139d4 SPIGOT-5665: Improve loading spawn egg NBT
dec5df26 SPIGOT-5667: Can't add recipe without (vanilla) datapack

Spigot Changes:
ae72bf43 SPIGOT-5666: Customizable End City Seed
2020-04-09 21:33:10 -04:00
Aikar ebbca5cedb
Drowned is a RangedEntity (fixes API for Drowned to support Ranged) 2020-04-09 21:33:03 -04:00
Aikar 83b03eee04
Don't move existing players to world spawn
This can cause a nasty server lag the spawn chunks are not kept loaded
or they aren't finished loading yet, or if the world spawn radius is
larger than the keep loaded range.

By skipping this, we avoid potential for a large spike on server start.
2020-04-09 21:22:21 -04:00
Aikar 3b3e38fd01
Fix issue with loading chunk during ticking chunks issue
Also speed up performance of copying pending/updating to visible by
directly copying the internal array data instead of putAll
2020-04-09 20:45:46 -04:00
Aikar ab74bb4514
Speed up processing of chunk loads and generation
Credit to Spotted for the idea

A lot of the new chunk system requires constant back and forth the main thread
to handle priority scheduling and ensuring conflicting tasks do not run at the
same time.

The issue is, these queues are only checked at either:

A) Sync Chunk Loads
B) End of Tick while sleeping

This results in generating chunks sitting waiting for a full tick to
complete before it will even start the next unit of work to do.

Additionally, this also delays loading of chunks until this same timing.

We will now periodically poll the chunk task queues throughout the tick,
looking for work to do.
We do this in a fair method that considers all worlds, not just the one being
ticked, so that each world can get 1 task procesed each before the next pass.

We also cap the throughput of these task processes to 1 per world per 0.1ms or
200 max per tick, to ensure that high volume of tasks do not overload the current
tick time.

In a view distance of 15, chunk loading performance was visually faster on the client.

Flying at high speed in spectator mode was able to keep up with chunk loading (as long as they are already generated)
2020-04-09 02:25:18 -04:00
Aikar f5dd491fce
Increase Light Queue Size
Wiz mentioned that large WorldEdit operations cause light to run on
main thread. The queue was small, set to 5.. this bumps it to 20
but makes it configurable per-world.

The main risk of increasing this higher is during shutdown, some
queued light updates may be lost because mojang did not flush the
light engine on shutdown...

The queue size only puts a cap on max loss, doesn't solve that problem.

Don't touch this unless you know you have a problem and ok with the risk.
2020-04-09 02:25:09 -04:00
Aikar 9ab693487f
Don't load chunks when attempting to unload a chunk
Big Brain Logic
2020-04-08 21:13:48 -04:00
Aikar 38c626229d
Improve Optimize Memory use logic to make iterator safer and fix bad plugins like P2
Accessing world state async is bad mkay. But we know you didn't do it city <3
2020-04-08 21:07:59 -04:00
Aikar d33ba160a4
Fix incorrect keyword use on visibleChunksClone 2020-04-08 04:12:48 -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 a65831bd69
Optimize PlayerChunkMap memory use for visibleChunks
No longer clones visible chunks which is causing massive memory
allocation issues, likely the source of Humongous Objects on large servers.

Instead we just synchronize, clear and rebuild, reusing the same object buffers
as before with only 2 small objects created (FastIterator/MapEntry)

This should result in siginificant memory use reduction and improved GC behavior.
2020-04-08 03:09:05 -04:00
Aikar 6c39a59ae7
Use entity.dead instead of entity.die()
Fixes #3096
2020-04-04 21:09:27 -04:00
Aikar 2c37d2ebee
Restore accidently reverted item in water fix 2020-04-02 23:12:21 -04:00
Aikar cfaf32cf66
Dead Player's shouldn't be able to move
This fixes a lot of game state issues where packets were delayed for processing
due to 1.15's new queue but processed while dead.
2020-04-02 19:42:20 -04:00
Aikar 16287d01e2
Don't tick dead players
Causes sync chunk loads and who knows what all else.
This is safe because Spectators are skipped in unloaded chunks too in vanilla.
2020-04-02 17:19:44 -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
Aikar c867045d3c
And that's why hand editing patch files in nano is risky.... make it compile 2020-04-02 03:58:46 -04:00
Aikar c2d7876a54
Improve Entities in water activation immunity and let items always move 2020-04-02 03:56:05 -04:00
Aikar 1dc7c308aa
Optimize Collision Chunk lookup and avoid loading far chunks
Try to use a faster chunk lookup for collision detection, and only
fall back to the original for nearby chunks.

The collision code takes an AABB and generates a cuboid of checks rather
than a cylinder, so at high velocity this can generate a lot of chunk checks.
2020-04-02 02:43:07 -04:00
Aikar d5c6dbee56
Prevent Double PlayerChunkMap adds crashing server
Suspected case would be around the technique used in .stopRiding
Stack will identify any causer of this and warn instead of crashing.
2020-04-02 01:45:33 -04:00
Aikar a2a9ffe3b9
Fix issues with Activation Range causing large chunk lookups.
Where I blocked movement did not consider velocity buildup, which I assume
then "unleashes" if something was really trying to push that entity, and moves
it a very large distance.

Additionally, this method was completely misnamed, as movementTick
is more "doLotsOfTickThings", and ended up breaking AI too, which the whole
point of temporary wake ups was to let AI run to trigger new immunity.

Also fixed numerous behavioral rules for Immunity to improve vanilla gameplay,
suchas bees that are angry or moving towards a flower or hive, any insentient
that is targetting any enemy (Accidently made it any player), and included flying
mobs such as phantoms by reducing the type check to insentient instead of Creature.

Also improved inWater immunity to consider if the mob is movable by water or not.
2020-04-02 01:25:36 -04:00
Aikar 017297cdba
Improve entity.getCurrentChunk() and use it for entity.isChunkLoaded() 2020-04-02 00:43:11 -04:00
chickeneer 979b53a7f1
Do not allow bee's to load chunks for beehives 2020-03-31 03:54:42 -04:00
Aikar 13cb837394
Remote Connections shouldn't hold up shutdown
Bugs in the connection logic appears to leave stale connections even, preventing shutdown
2020-03-31 03:52:57 -04:00
Aikar 7dac546709
Fix bug in double register fix
could accidently delay entity reg by a tick if the bug this was fixing was encountered
2020-03-31 03:52:30 -04:00
Aikar 87829d8333
Remove incorrect IO flush for save-all that doesn't have flush parameter
The entire reason the if statement exists is to only flush and print when done if flag is true

This avoids /save-all from hurting as much as it was before, such as from backup plugins.
2020-03-31 03:15:34 -04:00
Aikar 31e751cb40
Fix unregistering entities from unloading chunks
CraftBukkit caused a regression here by making unloading chunks not
have a ticket added and returning unloaded future.

This caused entities who were killed in same tick their chunk is unloading
to not be able to be removed from the chunk.

This then results in dead entities lingering in the Chunk.

Combine that with a buggy detail of the previous implementation of
the Dupe UUID patch, then this was the likely source of the "Ghost entities"
2020-03-31 03:05:04 -04:00
Aikar bc351f6eff
Ensure Entity is never double registered
If something calls register twice, and the world is ticking, it could be
enqueued to add twice.

Vs behavior of non ticking of just overwriting state.

We will now simply log a warning when this happens instead of crashing the server.
2020-03-31 03:04:47 -04:00
Aikar 2ec0274b88
Fix many issues with dupe uuid resolve patch
This was not applied correctly, and would completely blow up chunk entity
registration if this feature was turned off....

Additionally, change how the entities are removed to be more consistent with other code.

Surface some of the logs indicating there is a problem as we are having so many issues with
entities that we don't need to be surpressing logs like that.
2020-03-31 02:52:12 -04:00
Shane Freeder 756da10d46
(Actually) Don't duplicate velocity entry into hidden-configs 2020-03-31 05:37:39 +01:00
Shane Freeder 9b3679fbd3
Don't duplicate velocity entry into hidden-configs
also, rebuild patches
2020-03-31 05:30:04 +01:00
Max Lee 28cf6540c6
Pillager patrol spawn settings and per player options (#2924) 2020-03-31 04:27:58 +01:00
froobynooby 6bf04cd5ed
Reduce entity tracker updates on move 2020-03-31 03:58:13 +01:00
Spottedleaf de5b093c05
Handle chunk unloading during block tick 2020-03-30 05:07:04 +01:00
Spottedleaf be7b40634d
performance: Improve Activation Range entity iteration
Faster Entity iteration using the chunks full entity list and array access.

Faster chunk lookups skipping the cache, as the pattern of access was not suitable
for cache usage (each request will likely blow cache)

This reduces the cost of Entity Activation Range's initial marking.
2020-03-29 23:35:04 -04:00
Aikar bacbd8805f
performance: Many Entity Activation Range Improvements
1) Immunity no longer gives 20 tick immunity, each immunity check can
give its own tick value on how long it lasts, drastically cutting down on most to 0-1 ticks.

2) Fixed Villager Immunity to use proper 1.15 check for Breeding.

3) Fixed Water Mobs being 100% immune due to the inWater check...

4) Fixed flying mobs being 100% immune due to the !onGround check...

5) Made Insentient mobs only check for the hasTasks during immunity check window, not every single tick. this made them way more active than desired
  - this puts behavior closer to inline with my original behavior in Spigot, but still does some checks to allow them temporary immunity, just not as much as before.

6) Inactive Entities would "inch" while trying to move, effectively getting nowhere. Now while an entity is inactive, it just won't even try to move.
  - this saves us from the expensiveness of Entity movement 1 out of 20 ticks. Now they will only move while either active or triggered a true immunity.
2020-03-29 23:33:39 -04:00
Shane Freeder 269394fe15
Update hidden-configs 2020-03-30 03:52:56 +01:00
Shane Freeder 9a7ca3dbc5
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:
564ed152 #482: Add a DragonBattle API to manipulate respawn phases etc
9f2fd967 #474: Add ability to set other plugin names as provided API so others can still depend on it

CraftBukkit Changes:
fc318cc1 #642: Add a DragonBattle API to manipulate respawn phases etc
796eb15a #644: Fix ChunkMapDistance#removeAllTicketsFor not propagating ticket level updates
a6f80937 SPIGOT-5606: call BlockRedstoneEvent for fence gates

Spigot Changes:
a03b1fdb Rebuild patches
2020-03-26 02:44:23 +00:00
Spottedleaf 68ec946c7a
Fix memory leak in TickListServer (#3068)
Only occurred when entries were scheduled with huge tick delays

Add two flags to debug excessive tick delays:
-Dpaper.ticklist-warn-on-excessive-delay=true (false by default)
and -Dpaper.ticklist-excessive-delay-threshold=ticks which
sets the excessive tick delay to the specified ticks (defaults to
60 * 20 ticks, aka 60 seconds)
2020-03-25 14:56:18 -05:00
Spottedleaf 49fdb18206
Timings changes (#3044)
* Timings changes

- Increment entity tick count only when an entity ticks
- Remove chunk inhabited timer
- Try finally entity timings

* Add activated entity ticks

Co-authored-by: Spottedleaf <Spottedleaf@users.noreply.github.com>
2020-03-19 02:03:32 -04:00
Nassim d63075dff8
Pass fireworks through vanished players (#3021) 2020-03-18 13:58:50 +00:00
Shane Freeder 4d991f1946
[CI-SKIP] Rebuild patches 2020-03-18 12:42:18 +00:00
Spottedleaf 26070a0e5c
Indicate ticking status in entity list command (#2856) 2020-03-18 12:38:24 +00:00
Spottedleaf 2ff7b4800b
Optimise Chunk#getFluid (#2860)
Removing the try catch and generally reducing ops should make it
faster on its own, however removing the try catch makes it
easier to inline due to code size
2020-03-18 12:21:35 +00:00
Spottedleaf c23ebb780d
Optimise ticklistserver (#2957) 2020-03-18 12:17:28 +00:00
Shane Freeder e4602b6d48
Drop Ignore-Missing-Recipes-in-RecipeBook-to-avoid-data-e.patch
This patch appears to be no longer relevant, and is seemingly a leading
cause of datapack performance being horrific
2020-03-15 20:03:36 +00:00
Jan 0ad8cf73ff
Call BlockRedstoneEvent for fence gates (#3026)
Co-authored-by: Jan Boerman <Janboerman95@gmail.com>
2020-03-14 13:39:54 +00:00
Shevchik c8dea96ee1
Prevent blocking on adding a new network manager (#3027)
Previous solution could still block network thread (while addPending is executing). This window is small, but removing it completely is better. This should probably also speed up concurrent adds, because no locking will be performed anymore.
The only possible downside is that adding elements one by one to synchronized list might be slower (But it's done while already locked, so maybe jvm will avoid additional locking?),
2020-03-14 11:20:50 +00:00
BillyGalbreath ac2bbf62c8
Fix NPE on GUI during Windows Lock Screen (#3023) 2020-03-13 07:02:30 +00:00
Zero e1281a1414
Configurable chance of villager zombie infection (Closes #2501)
This allows you to solve an issue in vanilla behavior where:
* On easy difficulty your villagers will NEVER get infected, meaning they will always die.
* On normal difficulty they will have a 50% of getting infected or dying.
2020-03-10 16:13:58 +00:00
William Blake Galbreath ad708dd3f3
Add option to allow iron golems to spawn in air (Closes #1965, Closes #1851) 2020-03-10 15:35:54 +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 2c07231eeb
Validate tripwire hook placement before update 2020-03-07 00:08:51 +00:00
Shane Freeder 31872198b4
Fix dead telepotation logger format 2020-03-06 23:29:13 +00:00
Shane Freeder ccf1d5908f
Prevent teleporting dead entities (#2803) 2020-03-03 05:34:30 +00:00
Gergely Sarkozi 5ce1dd48e1
Add hand to BlockMultiPlaceEvent (fixes #2997) (#2998) 2020-03-02 20:55:31 +00:00
Shane Freeder 3ad47bcf8e
Reduce chunk range timers 2020-03-02 19:56:04 +00:00
Shane Freeder 793bae0d45
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:
13ed05de Prepare for Java 14
6b00b145 #639: Deep clone itemmetas persistent container on clone
2020-03-02 19:17:49 +00:00
Shane Freeder 4df3dad85d
Reduce PlayerNaturallySpawnCreaturesEvent calls 2020-02-29 23:49:45 +00:00
Andrew Mollenkamp c0f4b24e3a
Fix random ticks (Fixes #2990) (#2992) 2020-02-27 08:42:47 +00:00
Shane Freeder b077005910
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:
fd28180e #479: Add LivingEntity#attack, LivingEntity#swingMainHand, LivingEntity#swingOffHand
ae72ba3a SPIGOT-5591: Allow concurrent potion effects

CraftBukkit Changes:
3d61a853 Fix formatting in CraftLivingEntity
f7ab3055 #633: Add LivingEntity#attack, LivingEntity#swingMainHand, LivingEntity#swingOffHand
d5ef2eab SPIGOT-5591: Allow concurrent potion effects
25a9a9ff SPIGOT-5592: Custom ChunkGenerator can cause bugged dirt
3f6d0de9 Make it clear in error messages that api-version above 1.13 is also supported
2020-02-25 18:57:15 +00:00
Cat73 0809d6be3e
[CI-SKIP] fix avoid-hopper-search obfhelper hint type (#2989) 2020-02-25 18:42:52 +00:00
Shane Freeder 7434b6d710
Fix ProjectilCollideEvent cancellation (Fixes #2953) 2020-02-22 15:00:41 +00:00
Shane Freeder e5e4e9f717
Do not send PlayerProfile info before initial server send 2020-02-22 14:13:29 +00:00
Shane Freeder 4e0ed1f812
Backport fix for MC-167561 (Fixes #2886, closes#2960) 2020-02-21 18:46:00 +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
Zach Brown 9f5fadcc7c
Remove extraneous space from host info log message
This has been bothering me for a long time now.
2020-02-18 22:57:49 -06:00
BillyGalbreath d60a10c9ff
Make the GUI graph fancier (#2928) 2020-02-18 22:52:18 -06:00
Zach Brown ecfaff5283
Revert "Add root/admin user detection (#2432)"
This reverts commit 555ca59af7.

Unknown issue on CentOS/RHEL(?) requires further examination.
2020-02-18 22:32:13 -06:00
egg82 555ca59af7
Add root/admin user detection (#2432)
This patch detects whether or not the server is currently executing as a privileged user and spits out a warning. The warning serves as a sort-of PSA for newer server admins who don't understand the risks of running as root.

We've seen plenty of bad/malicious plugins hit markets, and there's been a few close-calls with exploits in the past. Hopefully this helps mitigate some potential damage to servers, even if it is just a warning.
2020-02-18 22:10:41 -06:00
Gergely Sarkozi e1f3b6d033
fix tripwire hook BlockPlaceEvent (fixes #2969) (#2971) 2020-02-18 21:51:51 -06:00
BillyGalbreath 33a615de43
Add option to nerf pigmen from nether portals (#2937)
* Add option to nerf pigmen from nether portals
2020-02-18 19:42:05 -06:00
Shane Freeder 6ea3c2cf3b
[CI-SKIP] Rebuild patches 2020-02-12 14:03:09 +00:00
Spottedleaf d7bed4cb07
Heavily optimise random block ticking (#2914)
* Optimise random block ticking

Massive performance improvement for random block ticking.
The performance increase comes from the fact that the vast
majority of attempted block ticks (~95% in my testing) fail
because the randomly selected block is not tickable.

Now only tickable blocks are targeted, however this means that
the maximum number of block ticks occurs per chunk. However,
not all chunks are going to be targeted. The percent chance
of a chunk being targeted is based on how many tickable blocks
are in the chunk.
This means that while block ticks are spread out less, the
total number of blocks ticked per world tick remains the same.
Therefore, the chance of a random tickable block being ticked
remains the same.
2020-02-12 13:49:52 +00:00
Zach Brown ba71c5d6e7
Stop stripping private use block Unicode from signs
Fixes GH-2943
2020-02-10 22:35:46 -06:00
BillyGalbreath 28d9dcfcf4
Entity Jump API (#1587) 2020-02-10 22:28:39 -06:00
Shane Freeder 9976a76809
Fix PlayerNaturallySpawnCreaturesEvent boolean inversion 2020-02-09 19:32:40 +00:00
BillyGalbreath a8984ccb9f
Add ThrownEggHatchEvent (#1982)
Add a new event similar to PlayerEggThrowEvent but without the Player
requirement (dispensers can throw eggs to hatch as well).
2020-02-09 00:32:29 -06:00
Gergely Sarkozi 9f24d4952b
Allow nerfed blazes, endermen to take water damage (#2847)
Fixes GH-2841
2020-02-08 22:19:54 -06:00
Zach Brown f09fed894f
Update upstream B/CB
--- work/Bukkit
Submodule work/Bukkit 6a4242cb..337955e3:
  > SPIGOT-5468: Improve Beehive TileEntity API
  > #473: Add an API for passing the heightmap to getHighestBlockAt* method

--- work/CraftBukkit
Submodule work/CraftBukkit 807a677e..708be695:
  > SPIGOT-5468: Improve Beehive TileEntity API
  > #624: Add an API for passing the heightmap to getHighestBlockAt* method
  > MC-135989, SPIGOT-5564: Don't kick players for flight while riptiding

This deprecates the Paper getHighestBlockAt HeightMap APIs now that
Bukkit has added their own. These methods will stick around long enough
for people to migrate. Their API is pretty much the same as ours,
migration should be quick and easy.
2020-02-08 18:32:48 -06:00
Zach Brown 7c1ef0b701
Add option to ignore the java version check in CB
Fixes GH-2935
2020-02-08 18:08:56 -06:00
Zach Brown 6aa27ec378
Rebuild patches 2020-02-06 21:07:34 -06:00
Spottedleaf 4712863375
Lag compensate eating (#2861)
When the server is lagging, players will wait longer when eating.
Change to also use a time check instead if it passes.
2020-02-06 21:06:52 -06:00
Zach Brown fa7400e567
Be more tolerant of invalid attributes 2020-02-06 19:32:49 -06:00
Shane Freeder 3dafa6a08a
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:
807a677e SPIGOT-5558: Fix World#getHighestBlockAt, previously off by +1
2020-02-03 01:54:02 +00:00
Shane Freeder 77b05b9c8e
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:
6a4242cb #468: Allow delegation of certain elements to Vanilla when using a custom ChunkGenerator
c6697f90 SPIGOT-5559: Add EntityPotionEffectEvent causes for PATROL_CAPTAIN and WITHER_ROSE
9c1fa040 #467: Add method to remove a recipe by its key
3961d1aa Add nb-configuration.xml to .gitignore

CraftBukkit Changes:
d70084e5 Remove unused seed in CustomChunkGenerator
8a66d4c7 #619: Allow delegation of certain elements to Vanilla when using a custom ChunkGenerator
c2dc19d3 Craftbukkit -> CraftBukkit
ae45e092 SPIGOT-5559: Add EntityPotionEffectEvent causes for bee, raiders and wither rose
00980376 #618: Add method to remove a recipe by its key

Spigot Changes:
c574e08b Rebuild patches
13c24cc4 Rebuild patches
2020-02-02 11:53:48 +00:00
Shane Freeder 55b3a09dde
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:
d0800d0c Update checkstyle
e4e4bf70 Remove package-info from tests, breaks some IDEs
d6651bb0 No longer necessary to synchronize sync events

CraftBukkit Changes:
e82b5477 SPIGOT-5556: Some biome methods use incorrect positions
544ccdc5 Update checkstyle
512ff7a5 Print legacy load reason in debug mode
df371c1b SPIGOT-5554: Clear error message when BossBar is used for not fully joined players
18168500 Update scriptus
6bbb4e73 Clean up CraftBlockData.toString
b1e96bd5 SPIGOT-5551: BlockState.setData fails when used by legacy plugin

Spigot Changes:
b9baf717 Add space before ocean seed output
13394884 Rebuild patches
2020-02-01 15:20:54 +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
Shane Freeder 4e48785d91
Drop 0394-Fixed-MC-156852.patch (Fixes #2913) 2020-01-30 09:36:03 +00:00
Spottedleaf 01b965e0fd
Fix getChunkAtIfCachedImmediately (#2915) 2020-01-29 01:26:07 +00:00
Shane Freeder 0a897d6e6a
Rebuild patches
Because you know... That's how you commit them...
2020-01-28 19:48:56 +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
Gergely Sarkozi c9eebbb802 Fix Player#applyMending NPE (#2917) 2020-01-28 18:20:53 +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
BillyGalbreath 5fdafcd7a9 Fix #2906 - Bees get gravity in void - Fixes MC-167279 (#2912) 2020-01-26 23:59:43 +00:00
Shane Freeder 60d4c80854
Properly check for running tasks in EAR 2020-01-26 23:35:34 +00:00
Shane Freeder 7329e19ce5
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:
e911c70f SPIGOT-5542: Cancelling EntityToggleGlideEvent doesn't stop client from gliding
2020-01-25 01:22:52 +00:00
BillyGalbreath b3a97d1446 Fix startup errors when double clicking jar (#2903) 2020-01-24 23:06:37 +00:00
Shane Freeder b51fbefc48
Revert "Fix errors on startup when double clicking jar (#2901)"
This reverts commit a0438faba9.
2020-01-24 21:30:15 +00:00
BillyGalbreath a0438faba9 Fix errors on startup when double clicking jar (#2901) 2020-01-24 19:13:59 +00:00
Max Lee e0da6d4b81 Seed based feature search (Fixes #2312) (#2852) 2020-01-24 19:07:14 +00:00
Shane Freeder 969ef51ad2
Init legacy material data
This fixes an issue with plugins using legacy materials, spigot does
not populate the bukkit registry properly, leading to NPEs when using
outdated plugins. This patch should likely be dropped when spigot fixes
their legacy data usage....

Also rebuild patches because 10/10
2020-01-23 21:38:17 +00:00
Andrew Mollenkamp c471490985
Fix items vanishing through end portal (Resolves #2681) (#2894)
hehe
2020-01-23 15:38:47 +00:00
Shane Freeder 8a0b371c68
Fix comparator behavior for EntityPhanton goal 2020-01-22 21:01:28 +00:00
Zach Brown 79710332e3
Update upstream CB
--- work/CraftBukkit
Submodule work/CraftBukkit 29737ccb..efd6cf55:
  > Only load legacy support data if something uses it
2020-01-21 20:12: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 d4ae43fc00
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:
58d299a5 Clarify that TotalExperience (XpTotal) is not displayed anywhere
3342ab1e #460: Add Player#sendExperienceChange
acc05b40 SPIGOT-5525: saveResource saves files from server jars

CraftBukkit Changes:
5c6b0dc6 SPIGOT-5526: Call EntityChangeBlockEvent for bees triggering crop growth
b91ce119 #601: Implement Player#sendExperienceChange
661bebc6 Remove outdated build delay.
2020-01-21 15:12:47 +00:00
Shane Freeder 9c2d9a5f41
[CI-SKIP] Rebuild patches 2020-01-20 16:04:39 +00:00
Andrew Mollenkamp 86a4b75200 Fix items not falling correctly (Resolves #2835) (#2872) 2020-01-20 15:57:12 +00:00
Omer Uddin 35472de2bc Port activation range improvement patch (#2763) 2020-01-20 15:54:57 +00:00
BillyGalbreath 617f6033e7 Add effect to block break naturally (#2819) 2020-01-18 20:10:06 -06:00
Shane Freeder 00860e4e10
[CI-SKIP] rebuild patches 2020-01-18 17:58:05 +00:00
Callahhh 3d51966885 Prevent sync chunk loads when villagers try to find beds (#2855) 2020-01-18 17:54:33 +00:00
Spottedleaf f177f878a8 Full chunk debug on incremental watchdog (#2868) 2020-01-18 17:50:23 +00:00
Spottedleaf c2954557e7 Fix last firework in stack not having effects when dispensed - #2871 (#2876)
CB used the resulting item in the dispenser rather than the item
dispensed. The resulting item would have size == 0 and therefore
be convertered to air, hence why the effects disappeared.
2020-01-18 17:31:05 +00:00
Spottedleaf dd8b8df0ca Ensure portal search radius is used when teleporting players (#2877)
Also add the create search radius mojang recently introduced
to config
2020-01-18 17:28:32 +00:00
Mark Vainomaa 701114058c Fix dupe with Eigencraft redstone implementation (#2864) 2020-01-16 20:07:50 -06:00
Brody Beckwith 5dc6bd450e Optimize call to getFluid for explosions (#2859)
Signed-off-by: BrodyBeckwith <brody@beckwith.dev>
2020-01-15 00:16:04 +00:00
Shane Freeder 0f795c3e8a
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:
01334e7d #616: Fix exception on entity portal teleport attempt
2020-01-14 21:43:50 +00:00
Shane Freeder 1d5bd44d13
Fix entity teleportation exceptions 2020-01-14 09:14:12 +00:00
Shane Freeder bd0337b7a9
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:
7dd1cfcd PortalEvent additions

CraftBukkit Changes:
e8cb2f51 SPIGOT-5252: Nether portal fixes and additions
fde78ef3 SPIGOT-5477: Server not shutting down

Spigot Changes:
037559e7 Rebuild patches
2020-01-13 22:36:41 +00:00
Spottedleaf 654a131620 Add more chunk debug to watchdog (#2851)
print chunk holder status, useful for indicating what steps the
server has gone through after loading chunks from disk

Also rebuild patches (cat...)
2020-01-12 21:06:05 +00:00
Spottedleaf d94d6a2970 Optimise IEntityAccess#getPlayerByUUID (#2842)
Use the world entity map instead of iterating over all players
2020-01-12 06:36:31 +00:00
Spottedleaf 4237539e58 Guard against serializing mismatching chunk coordinate (#2844)
Should help if something dumb happens
2020-01-12 06:32:44 +00:00
Shane Freeder c1f57657ee
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:
d208733e SPIGOT-5509: Sleeping player does not eject bed when teleported
2020-01-11 13:34:00 +00:00
Brokkonaut f5569fd3d8 Fix SkullMeta.setPlayerProfile() (#2833) 2020-01-10 18:07:29 +00:00
Omer Uddin 4151617d29 Update no chunk loads for hoppers and double chests patch (#2777) 2020-01-09 21:11:19 -06:00
Spottedleaf db3af11cea Fix race condition with regionfile being closed right after getting one (#2812)
Occurs when 1 thread retrieves a regionfile, and then the
regionfile is closed due to it being thrown out of cache.
2020-01-09 19:42:33 -06:00
BillyGalbreath 9aeba7c95a Prevent bees loading chunks checking hive position (#2828) 2020-01-09 19:28:29 -06:00
Shane Freeder bd1e1ad1aa
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:
5d4de46e Fix checkstyle.xml formatting
adf331f1 SPIGOT-5496: API to create and manipulate hardcore worlds

CraftBukkit Changes:
c727dc2a Fix checkstyle.xml formatting
e7202cd4 SPIGOT-5496: API to create and manipulate hardcore worlds
9820cd2d MC-151364, SPIGOT-5494: Feeding dolphin hangs if generate-structures=false
2020-01-05 23:08:18 +00:00
Zach Brown b74fe8ea11
Update upstream B/CB
--- work/Bukkit
Submodule work/Bukkit bbfd13dd..72e3dfd4:
  > SPIGOT-5486: Raider CanJoinRaid

--- work/CraftBukkit
Submodule work/CraftBukkit 83af86db..731e819c:
  > SPIGOT-5486: Raider CanJoinRaid
  > SPIGOT-5487: Increase outdated build delay
2020-01-01 17:44:53 -06:00
Shane Freeder 7530141468
remove burtned TNT blocks (Fixes #2808) 2019-12-30 12:49:48 +00:00
Zach Brown 92933b162c
Fix double dropping xp now that Spigot fixed it 2019-12-26 22:28:02 -05:00
Zach Brown 4ed5ab7c79
Update upstream CB/S
--- work/CraftBukkit
Submodule work/CraftBukkit 297ff400..83af86db:
  > SPIGOT-5457: Downgrade 'Mismatch in destroy block pos' message to debug
  > SPIGOT-5481: PlayerBedLeaveEvent returns wrong bed location
  > SPIGOT-5482: Structure Block setUsageMode encounters NullpointerException
  > SPIGOT-5426: isSimilar for player heads fails
  > SPIGOT-5478: XP not dropping when a player dies

--- work/Spigot
Submodule work/Spigot 05bb8bcf..492a7792:
  > Rebuild patches
2019-12-26 22:18:27 -05:00
Shane Freeder c32f8e132c
PlayerDeathEvent#shouldDropExperience 2019-12-24 00:36:24 +00:00
Shane Freeder 05ecc314d2
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:
8073dbec SPIGOT-5474: Just ignore bugged fireball data
2019-12-23 03:59:27 +00:00
Shane Freeder f8fd607e04
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:
bbfd13dd Hyperlink 'Events' in raid event package documentation
b2095bed SPIGOT-5413: Add TrustedPlayer API for foxes
1bf1f3f4 Block trace methods do not require hash sets
abf0cfdc Javadoc improvements per checkstyle
c4a2b425 Add TimeSkipEvent

CraftBukkit Changes:
817116de SPIGOT-5413: Add TrustedPlayer API for foxes
062680a8 SPIGOT-5467: Calm down bees that cannot exit hive
75fac431 SPIGOT-5472: Spurious warning when using clone command on tile entities
85106731 SPIGOT-5471: Allow empty title/author for books
2d9db47f Add TimeSkipEvent
384225c2 Add thread name to TerminalConsoleWriterThread

Spigot Changes:
05bb8bcf Postpone stopping the watchdog until the server is completely stopped
18e2b9be Add package-info.java for Spigot APIs
2019-12-23 02:37:47 +00:00
Omer Uddin 3f5564f1bc Port Optimize-Hoppers.patch to 1.15 (#2765)
* port patch

* fix hoppers eating items
2019-12-22 02:28:35 +00:00
Shane Freeder 26dfbc8046
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:
3aa8286b SPIGOT-794: Add boats to EntityPlaceEvent
c36d90a6 SPIGOT-5464: Add BEEHIVE SpawnReason for when a bee leaves a beehive

CraftBukkit Changes:
90ef74ef SPIGOT-794: Add boats to EntityPlaceEvent
fb7abcb3 SPIGOT-5466: Bees still get angry even if damage event cancelled
4499fec5 SPIGOT-5464: Add BEEHIVE SpawnReason for when a bee leaves a beehive
2019-12-19 19:17:36 +00:00
BillyGalbreath 539543ca9a MC-145656 Fix Follow Range Initial Target (#2778) 2019-12-19 19:03:16 +00: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 3cd952e225
Yank 0417-Avoid-Chunk-Lookups-for-Entity-TileEntity-Current-Ch.patch
Currently causing leaks
2019-12-16 19:02:26 +00:00
Shane Freeder c47cf32c7c
Restore 0129-Optimize-World.isLoaded-BlockPosition-Z.patch 2019-12-16 02:58:14 +00:00
Shane Freeder cd499c92a1
Restore Use-getChunkIfLoadedImmediately-in-places.patch 2019-12-16 02:47:46 +00:00
Callahhh 7986f57e5d Bring back Reduce-sync-loads.patch (#2761) 2019-12-16 01:43:21 +00:00
Shane Freeder 9e58f22640
Address gen concurrency issue causing crashes (Fixes #2746) 2019-12-16 01:38:00 +00:00
Shane Freeder 8b25307b34
Merge branch 'ver/1.14' 2019-12-15 23:05:36 +00:00
Shane Freeder 1c38436266
attempt to allow timings to continue with janky plugin classes 2019-12-15 22:45:17 +00:00
Shane Freeder 443ffb450b
Fix spectator teleport target (#2743) 2019-12-15 20:19:52 +00:00
Shane Freeder 7d8117083f
Fix spawn radius being treated as 0 (Fixes #2742) 2019-12-15 19:42:35 +00:00
Shane Freeder c36cf2aff4
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:
e43416a3 SPIGOT-5455: Mobs do not ignite due to sun in extra worlds
2019-12-15 19:40:28 +00:00
Shane Freeder 8782be3bb0
[CI-SKIP] Rebuild patches 2019-12-15 18:33:43 +00:00
Black Hole ff8a48b9d1 Don't show 1.15 plugins as legacy in plugins command (#2755)
* Don't show 1.15 plugins as legacy in plugins command

* Use CraftMagicNumbers.SUPPORTED_API
2019-12-15 18:28:44 +00:00
Omer Uddin a133980223 port PlayerLaunchProjectileEvent patch to 1.15 (#2758) 2019-12-15 18:25:10 +00:00
Omer Uddin f3c55f239a port TE chunk lookup patch to 1.15 (#2757) 2019-12-15 18:17:16 +00:00
Shane Freeder 0585f99b05
Prevent TRAP while loading Fireballs 2019-12-14 01:15:01 +00:00
Shane Freeder 12051feb76
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:
61d4b090 SPIGOT-5428: Better handling of some ItemMeta

Spigot Changes:
047b6f86 SPIGOT-5421: Add separate trident despawn rate
c1047ed9 SPIGOT-5445: Add log-villager-deaths option
2019-12-14 01:02:52 +00:00
Shane Freeder bc447dc137
Track correct branch for /version 2019-12-13 22:56:02 +00:00
Shane Freeder 7dbceea208
Restore zero-tick farms fix
They no longer directly call the tick method, so, one step forward...
2019-12-13 22:48:40 +00:00
Shane Freeder 55944bc6ff
Revert "Drop fix zero-tick farms (Fixes #2736)"
This reverts commit 3b93c5b112.
2019-12-13 22:41:00 +00:00
Shane Freeder 3b93c5b112
Drop fix zero-tick farms (Fixes #2736)
Fixed by mojang in 1.15, farm blocks are no longer in the next tick list

Also, add hopper optimization patch to the removed folder
2019-12-13 21:53:20 +00:00
Shane Freeder 31bc07cb65
Drop hopper optimization patch 2019-12-13 20:41:01 +00:00
Shane Freeder 788e033817
Don't set the count on already empty items in hopper moves (Fixes #2735) 2019-12-13 20:11:45 +00:00
Shane Freeder c034be8a82
Remove debug statement and rebuild patches properly 2019-12-13 16:29:51 +00:00
Shane Freeder 058e4efb41
Allow reading of oversized region files 2019-12-13 16:22:16 +00:00
Shane Freeder ae68db1f0e
Drop entity experience on death 2019-12-13 15:21:58 +00:00
Shane Freeder d413dca4ee
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:
333b9f02 SPIGOT-5422: Add support for 3-dimensional biomes
170d7386 Fix bad link in deprecated FlowerPot MaterialData class

CraftBukkit Changes:
16dc5758 SPIGOT-5449: Fix issue with projectiles
fd25653f SPIGOT-5448: Shulker Boxes collapse empty slots when picked up
b97d581a SPIGOT-5443: BEE_NEST BlockState
73698cf8 SPIGOT-5442: Fix issue with fire charges
beff9fb9 SPIGOT-5437: Fix CustomChunkGenerator.CustomBiomeGrid ignoring the y value for biomes
f777640e SPIGOT-5425: Prevent empty/air loot (again?)
db0dafb1 SPIGOT-5422: Add support for 3-dimensional biomes
4633e6c5 Fix crash with disabled worlds

Spigot Changes:
f39a89ef SPIGOT-5423: Remove covariant type change to give better chance of Java downgrades working
2019-12-13 14:08:40 +00:00
MiniDigger bd93836d4c Nuke IOWorker, make stuff compile (#2733)
* remove removed patch cause its not removed anymore

* Nuke IOWorker, oh, and also make it compile

* synchronize writes properly

* Remove note about IOWorker
2019-12-13 13:46:45 +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
MiniDigger 44d032f1e9 Houston, we got a patch (#2731)
* Houston, we got a patch

* is this the end of the beginning or the beginning of the end
2019-12-12 16:20:43 +00:00
Shane Freeder bbf27ec651
Fixup timings patch 2019-12-12 03:06:23 +00:00
Zach Brown e2c4ff50a2
My Name is ;
Hi! My name is (what?)
My name is (who?)
My name is
;

Hi! My name is (huh?)
My name is (what?)
My name is
;
2019-12-11 21:00:50 -06:00
Zach Brown 01de058bf2
Little more progress
Keep getting interrupted so not as much as I'd like :(
2019-12-11 20:48:34 -06:00
MiniDigger b00d871009 Patches 100-260 (#2729) 2019-12-11 17:43:22 -06:00
Zach Brown f2ed239ead
More progress 2019-12-10 22:01:17 -06:00
Shane Freeder a308619d28
Work on server patches 2019-12-11 00:56:03 +00:00
Shane Freeder 4d2f85630a
Fix ArmorStand#setItem flow (Fixes #2726) 2019-12-10 23:37:32 +00:00
Shane Freeder bb8b1e3eca
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:
8b6dd103 Update /version to reflect final build status.
6bdfd385 Remove some draft API designations
78a12dd9 SPIGOT-5417: Campfire should implement Directional

CraftBukkit Changes:
65670174 SPIGOT-5417: Campfire should implement Directional
eeae942e SPIGOT-5416: Block.getDrops gives drops even when tool should not give drops
2019-12-10 23:23:50 +00:00
Lukasz Derlatka 86daffa21c
Fix AssertionError when player hand set to empty type
Fixes GH-2718
2019-12-07 19:09:44 -06:00
Shane Freeder 3032599d38
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:
43183eab SPIGOT-5399: spawn-npcs ignored during world generation
e9bb2f15 SPIGOT-5403: isSimilar returns true for different skulls
5c9e7236 SPIGOT-5409: Remove unnecessary defaulting in CraftMetaBookSigned
821238b6 SPIGOT-5412: Use SpawnReason.NATURAL for wandering traders and trader llamas
2019-12-05 10:23:10 +00:00
stefvanschie 779f34cc37 Fix empty CanPlaceOn tags causing errors (#2713) 2019-12-01 00:20:12 +00:00
BillyGalbreath 4a97a7ca44 Add option to disable pillager patrols (#2626) 2019-11-24 01:10:15 -06:00
Gerrygames 23e53aab97 Backport MC-160177 fix from 1.15 (#2702) 2019-11-24 00:36:20 -06:00
Zach Brown 45089d59f0
Update upstream CB
--- work/CraftBukkit
Submodule work/CraftBukkit 7554e08e..ccd47a50:
  > SPIGOT-5395: Call BlockFadeEvent for Scaffolding
  > Increase outdated build delay to 4 weeks
2019-11-24 00:06:19 -06:00
BillyGalbreath 761c24fae9 Fix stuck in sneak when changing worlds (MC-10657) (#2627) 2019-11-24 00:02:47 -06:00
Spottedleaf 10c29e7369 Fix racey NextTickListEntry creation. (#2683)
The counter is used to distinguish entries from each other, however
since we can concurrently increment the counter we could totally
screw over the comparision of entries (see a() in NextTickListEntry),
as it compares only the time when the entry will tick, the priority
at which it will tick, and the counter. The block is not compared.

Async loading loads the chunk asynchronously which creates these
entries asynchronously.
2019-11-10 12:00:16 -06:00
William Blake Galbreath 8d036cea01
Expose the internal current tick 2019-10-30 18:10:42 +00:00
MisterErwin 0c71539093 [PATCH] bounding box check for hanging entities (#2664)
This patch intends to fix an issue with LeashHitchs where an exception
was thrown due EntityHanging#calculateBoundingBox not being able to
accept EnumDirections UP and DOWN.

This issue was introduced in a fix for SPIGOT-4674
(d65a2576e40e58c8e446b330febe6799d13a604f)
2019-10-30 17:29:40 +00:00
Shane Freeder 527073aa65
Update config version 2019-10-27 00:07:42 +01:00
Zach Brown 0d3b35c339
Rename baby zombie movement config option
This option does not set the absolute speed of the entity as the name
implies. It sets a modifier. The default (vanilla) value of `0.5` sets
the baby zombie to move at 50% faster than the base speed.

A negative value like `-0.4` would set them to move at 40% slower.

There should be no functional changes as a result of this change, it's
just clarifying the config name.
2019-10-26 17:55:58 -05:00
Spottedleaf df984898ac Fix server deadlock when loading some chunks (#2647)
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:
7554e08e Add UUID support to CraftProfileBanList
3fe37460 SPIGOT-5378: Fix TileEntity fixer deadlock
12386dd4 SPIGOT-5375: Add spaces to coordinates from tile fixer
606c19e2 SPIGOT-5373: Simultaneous left+right click in creative mode does not work
13caf848 SPIGOT-5370: Fix Block#rayTrace considering other blocks.
2019-10-20 10:03:39 +01:00
weaondara 9ea1f9ee3d performance improvement for CraftChunk.getEntities() (#2629) 2019-10-19 23:33:35 +01:00
Shane Freeder 419ae0e668
Fire EntityRemovedFromWorldEvent for all entities (Fixes #2282) 2019-10-19 09:14:26 +01:00
Shane Freeder 0f2ea04c1c
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:
af58d316 Fix javadoc warning in Firework.setShotAtAngle

CraftBukkit Changes:
e2dd6555 SPIGOT-5372: Re-add tile entity fixer due to MC-163945
1e7a197f Fix incorrect inequality in 683bae0670c
db98d54d SPIGOT-5362: Suspicious stews fail isSimilar check

Spigot Changes:
56f84710 Rebuild patches
2019-10-18 17:31:01 +01:00
Jonathan Frederick 2c8d20406f Re-implement treasure-maps-return-already-discovered for 1.14 (#2636) 2019-10-18 16:14:43 +01:00
Spottedleaf 8260cdf8c1 Use getIfLoadedImmediately and not cached immediately for isLoa… (#2641) 2019-10-18 16:05:45 +01:00
Andrew Steinborn ff8b9ef3d5
Really fix JLine on Windows
The history of how paths work in Win32 is a sad story and shall not be documented here.
Needless to say, Windows hates the temporary file name for jansi's native code since it
includes the version. For git builds, it includes quotes around the actual version. But
alas, the issue apparently doesn't occur if you build on Windows since it removes the
quotes from the git commandline that is ultimately used to build the version string,
because of more Win32 sadness and shame.

Go look at Raymond Chen's blog, The Old New Thing. It's full of Windows oddities and
it will make you want to weep because almost 90% of the world uses this legacy OS from
the 1980s.
2019-10-13 16:36:23 -05:00
Zach c65396072f
Revert "Fix jline with git builds under Windows (#2624)" (#2632)
This reverts commit 0c64f7b0ae.
2019-10-13 01:19:22 -05:00
Zach Brown a4dbabdbd3
Update upstream CB
--- work/CraftBukkit
Submodule work/CraftBukkit 7deb3728..d6b3eddf:
  > SPIGOT-5355: Double Chests still open after InventoryOpenEvent cancelled
2019-10-13 00:28:46 -05:00
Andrew Steinborn 0c64f7b0ae Fix jline with git builds under Windows (#2624) 2019-10-13 00:06:44 -05:00
Shane Freeder e8c82f4eee
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:
0399d9d6 SPIGOT-5341: Add Material.isAir
547f5709 SPIGOT-5353: Expand explosion API by adding source entity

CraftBukkit Changes:
7deb3728 SPIGOT-5309: Call cancelled EntityDamageEvent when damaging invisible armor stands
46351e17 SPIGOT-5341: Add Material.isAir
683bae06 SPIGOT-5342: Lore lost when deserializing items with no version stored
c2d12011 SPIGOT-5353: Expand explosion API by adding source entity
2019-10-08 19:37:02 +01:00
Omer Uddin aa776c1b15 Don't save canTick of armor stands if it has not been set by API (#2608) 2019-10-02 19:20:40 -05:00
Spottedleaf bfc807c27a Improve spawn loading and debug output for waiting on a chunk (#2595)
Spawn loading has been changed to use getChunkAt calls to manually
load chunks since watchdog can watch these calls and so we guard
against plugins/players changing the radius of a spawn while it's
loading

Debug output has been improved to note the status of the currently
waiting chunk
2019-09-29 20:23:09 -05:00
Spottedleaf 826b4762c0 Remove debug logging for incremental saves (#2600) 2019-09-29 20:14:39 -05:00
Spottedleaf d39916c7e2 Add more timings to chunk provider tick (#2549)
- Misc mob spawning
- Chunk range checks
2019-09-29 16:06:03 -05:00
Spottedleaf 43ec79a32c Add server oversleep to timings (#2509)
Now everything except waiting for the next tick should be included
in timings
2019-09-29 15:49:38 -05:00
Spottedleaf 1d2a5915ed Check if there are workers before trying to notify them (#2593)
* Fix #2591

We need to check if there are workers before trying to notify
them...
2019-09-29 15:29:56 -05:00
Zach Brown 89eb890239
[CI-SKIP] Rebuild patches 2019-09-29 15:02:04 -05:00
Spottedleaf 27fca92fa1 Drop Optimize-GameRules-to-use-LinkedHashMap (#2594)
Mojang has since replicated the logic
2019-09-29 15:01:21 -05:00
Zach Brown 936d57ba93
Use local variable for bedrock generation
Fixes GH-2596.
2019-09-27 20:53:20 -05:00
Zach Brown 767b935552
[CI-SKIP] Fix wrong patch author on zero-tick fix
See GH-2559 for context
2019-09-27 18:10:48 -05:00
Zach Brown 7caed1a8fa
[CI-SKIP] Rebuild patches 2019-09-24 18:19:41 -05:00
Spottedleaf 777073a54d Check horse entity validity in container interactions (#2584)
Fixes #2580
2019-09-24 18:16:16 -05:00
BillyGalbreath d69fe6c511 Fix zero-tick instant grow farms MC-113809 (#2559) 2019-09-22 23:07:01 -05:00
Spottedleaf c68dbb864c Updated Upstream (Bukkit/CraftBukkit/Spigot) (#2576)
* 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:
6527cb58 SPIGOT-5329: Clarify isGlowing documentation
5ddb414f Make Lantern extend BlockData
cb888903 Fix typos in previous commits
2a5e0ca2 Bring EnchantItemEvent documentation in line with EnchantmentOffer
3c5fcea2 SPIGOT-5317: Create accessors for player absorption hearts
c6e0d625 SPIGOT-5320: Clarify scope of ExactChoice

CraftBukkit Changes:
a3fdef8c SPIGOT-5331: Add support for Java 13
6ddeb980 SPIGOT-5317: Create accessors for player absorption hearts
5d335e96 SPIGOT-5315: Cannot serialize armor stand ItemMeta

Spigot Changes:
94af569b SPIGOT-5319: Async catcher for getNearbyEntities
2019-09-21 23:12:45 -05:00
Spottedleaf 30f9955e2a Fix race conditions in flush allowing for previously scheduled tasks to execute later than the flush call (#2548) 2019-09-15 23:02:13 -05:00
Spottedleaf 9e1620e3d3 Improve save logic (#2485)
Only wait for IO at the end of the save
we also were not force flushing async saves with /save-all flush
2019-09-15 22:39:30 -05:00
Zach Brown 728605013c
[CI-SKIP] Fix duplicate patch number 2019-09-15 22:15:33 -05:00
prplz 8735587529 Fix nether portal frame creation (#2546) 2019-09-15 22:12:17 -05:00
Zach Brown 26acc9b77a
Re-add flat bedrock config option 2019-09-15 19:20:02 -05:00
Shane Freeder 14513c3ce1
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:
92f24ff2 SPIGOT-5158: Add SuspiciousStewMeta
b9bf4dae SPIGOT-5310: Add Chunk.contains
b2adbb45 Add API to get/set inhabited time of a Chunk
e3c812dd SPIGOT-5250: Add ChunkSnapshot.contains
71973d85 SPIGOT-5255: Raid / patrol spawn reasons

CraftBukkit Changes:
03b145b3 SPIGOT-5158: Add SuspiciousStewMeta
9aa74304 SPIGOT-5310: Add Chunk.contains
7ef2b20d SPIGOT-3308: RecipeIterator cannot longer remove recipes
023f438c Add API to get/set inhabited time of a Chunk
b79a86ed SPIGOT-5250: Add ChunkSnapshot.contains
aa492e55 SPIGOT-5255: Raid / patrol spawn reasons
2019-09-10 19:51:02 +01:00
Omer Uddin b7dc6fb00e fix double world add bug (#2486) 2019-09-02 17:46:04 +01:00
Shane Freeder 439131c704
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:
e28fb3bd SPIGOT-5301: BlockIgniteEvent for campfire + arrow

CraftBukkit Changes:
763e5601 SPIGOT-5294: Cancelled EntityPickupItemEvent and PlayerPickupItemEvent alter on-ground stacks
403ac185 SPIGOT-5301: BlockIgniteEvent for campfire + arrow
2019-09-02 17:28:24 +01:00
Zach Brown 14e07afd20
[CI-SKIP] Fix patch number 2019-09-01 20:50:15 -05:00
Spottedleaf fc570959d4 Improve POI data saving logic (#2475)
- Do not unload data if world saving is disabled
- Aggressively target unloading
2019-09-01 20:49:09 -05:00
Spottedleaf 5ef93ded42 Fix #2499 (#2500)
Proper scheduling if async chunks is disabled, we would execute
a task that is cancelled without setting its run status
2019-09-01 20:30:25 -05:00
Nassim 26f644c554 Fix sign line capping check (#2522) 2019-09-01 17:21:08 -05:00
Spottedleaf b2758246c8 Target more sync loads (#2476) 2019-09-01 17:17:51 -05:00
Spottedleaf 5272f3c2ef Fix #2511 (#2519)
Did not double-flush the file io thread if async = false
2019-09-01 16:18:39 -05:00
Shane Freeder c9fd745840
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:
ff0672ca SPIGOT-5211: Add Raid API

CraftBukkit Changes:
96bc85f0 SPIGOT-5298: Remove unexplained 0.1 drop chance offset
6ed8a189 SPIGOT-5290: Invulnerable and/or Marker armor stand triggers EntityDamageEvent
631eaeb0 SPIGOT-5297: PlayerBedLeaveEvent.getBed() returns player location
8d4bc541 SPIGOT-5293: Sponge behaviour differs from Vanilla
e91fd75e SPIGOT-5291: Missing event for ravagers trampling crops
cbdd7139 SPIGOT-5211: Add Raid API
edd8fdfb SPIGOT-5287: Fix rare CME generating new chunks
3fc97f08 SPIGOT-5265: FireworkExplodeEvent only fired when rockets explode in air

Spigot Changes:
065a3734 Rebuild patches
a5961826 SPIGOT-5286: tick-inactive-villagers invokes the AI for NoAI villagers
2019-08-31 20:30:44 +01:00
Shane Freeder aba4969668
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:
e970fd72 Remove incorrect javadoc from TargetReason
84df6df1 SPIGOT-5282: Improve bucket event API

CraftBukkit Changes:
b2bcde89 SPIGOT-5258: TNT Not Moving Players in Creative Mode
44d675ad SPIGOT-5263: Chests stay open after InventoryOpenEvent cancelled.
2439178e SPIGOT-5278: EntityDrowned memory leak
7055c931 SPIGOT-5264: Call event for experience orbs losing their target
49141172 SPIGOT-5282: Improve bucket event API
6bbb3b04 SPIGOT-5281: Clearer error messages for ChunkSnapshot misuse
2019-08-26 15:36:37 +01:00
Omer Uddin 21faf8227b Implement optional per player mobspawning (#2171) 2019-08-21 02:02:51 +01:00
Omer Uddin 88722ec89c Prevent consuming the wrong itemstack (#2477) 2019-08-19 16:24:33 +01:00
Spottedleaf 294e30462b Async chunk api/io/loading (#2308) 2019-08-18 18:40:04 -05:00
Shane Freeder eee1a019f9
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:
2012f1e0 SPIGOT-5269: Item attribute modifiers don't persist their order
7a806a3a SPIGOT-5270: Call BlockSpreadEvent when bamboo saplings grow

Spigot Changes:
798ea6ab Add async catcher to World#save
2019-08-17 04:26:58 +01:00
Spottedleaf c4ae0002e1 Fix some API and commands usage of inactive chunks (#2457)
* /paper entity will no longer report entities in inactive chunks
* World#getEntityCount and World#getChunkCount will report only
in active chunks
2019-08-14 21:47:38 -05:00
Spottedleaf 700a664981 Print entity debug stacktrace on entity double add (#2438) 2019-08-14 21:37:07 -05:00
Spottedleaf 9d6680eec0 Fix MC-158900 (#2458)
The problem was we were checking isExpired() on the entry, but if it
was expired at that point, then it would be null.
2019-08-14 21:32:25 -05:00
Zach Brown 928abb41f8
[CI-SKIP] Rebuild patches for last merge 2019-08-11 11:27:09 -05:00
Paul Sauve 34e64781e8 Do less work if we have a custom Bukkit generator (#2318) 2019-08-11 11:23:11 -05:00
Zach Brown cdd0bb4376
Update upstream CB/S
--- work/CraftBukkit
Submodule work/CraftBukkit 1ec1b05e..368f4e99:
  > Increase outdated build delay to 3 weeks
  > SPIGOT-5249: Do not add data to empty loot table
  > SPIGOT-5257: Call EntityBreedEvent for foxes and set the child's spawn reason to BREEDING

--- work/Spigot
Submodule work/Spigot e5b1b5db..ea7e48b3:
  > Add string default for view distance, and API to retrieve per world
2019-08-10 12:44:57 -05:00
Shane Freeder aa022fdaca
Fix java cross-version compilation
(Also, rebuild patches)
2019-08-08 16:12:57 +01:00
Omer Uddin 8b7952a958 Implement alternative item-despawn-rate (#2128) 2019-08-07 22:06:08 +01:00
Omer Uddin 6ccf0bda3b Reimplement hopper optimization patch (#2388)
Co-authored-by: Shane Freeder <theboyetronic@gmail.com>
2019-08-07 19:08:22 +01:00
TheGreatKetchup e264c365ac MC-156852 fix (#2396) 2019-08-07 04:12:15 +01:00
Spottedleaf b6c32b2a15 Fix recursion in EntityFox (#2418)
I changed a method call without looking at the implications.
super.processDeath would re-invoke the unmapped method, whereas super.d
would call the super method.
2019-08-06 04:31:38 +01:00
Spottedleaf 7c640a1ae2 Updated Upstream (Bukkit/CraftBukkit/Spigot) (#2415)
* fixup patch and rebuild

* 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:
bde198c9 SPIGOT-5246: PlayerQuitEvent.get/setQuitMessage() is incorrectly marked as NotNull
24ad5a79 SPIGOT-5240: Vector.angle not valid for angles very close to each other
a143db9a SPIGOT-5231: ShotAtAngle API for Fireworks
10db5c3d SPIGOT-5226: Update Javadoc of PlayerDeathEvent

CraftBukkit Changes:
1ec1b05e SPIGOT-5245: Unneeded cast to WorldNBTStorage in CraftWorld#getWorldFolder
e5e8eec2 SPIGOT-5241: setAttributeModifiers does not work on untouched stack
803eaa31 SPIGOT-5231: ShotAtAngle API for Fireworks
7881d2ae SPIGOT-5237: Horses, pigs do not drop their inventory
06efc9ec Don't accept connections until all plugins have enabled
da62a66a SPIGOT-5225: World handle isn't closed if world is unloaded without saving
104b3831 SPIGOT-5222: Cannot get Long values from Entity memory
f0b3fe43 SPIGOT-5220: Server CPU usage reaches 100% when stdin is null

Spigot Changes:
e5b1b5db SPIGOT-5235: Destroy expired area effect clouds / fireworks that are inactive
cbcc8e87 Make region files more reliable to write to
8887c5f4 Remove redundant late-bind option
dac29063 Rebuild patches

* Preserve old flush on save flag for reliable regionfiles

Originally this patch was in paper

* Fix some issues with the death event

- Entities potentially entering a glitched state to the client where
they appear to be falling over
- Donkeys losing their chest if the event was cancelled (only an
issue since the upstream merge)
- Some wither death logic running for an entity killed by a wither
2019-08-05 11:35:40 -05:00
BillyGalbreath 474e5ad269 Fix enderpearl item use cooldown (fix #2412) (#2413) 2019-08-05 03:15:53 +01:00
Spottedleaf ae90011500 Fix chest logic being weird for coordinates that sum to 0 or a… (#2364)
We were previously calling what looks like a legacy check for distance
away for the inventory. Unfortunately, with our logic, we called the
open logic before the active container was set. So the legacy check
would register 0 viewers and the logic would become bugged.
2019-08-02 18:48:22 +01:00
Omer Uddin 263057961b Offset Itemframe ticking (#2385) 2019-08-02 18:31:24 +01:00
Nassim c80ba8dcc4 Fix server crash with piercing shots through vanished players (#2390) 2019-07-31 23:04:45 +01:00
Shane Freeder 93891ad57a
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:
3d9d2efc SPIGOT-5202: WorldCreator#copy does not copy all options

CraftBukkit Changes:
3e7b3862 SPIGOT-5195 (#2): Player loot table does not drop when keepInventory is on
c88867e4 SPIGOT-5208: Reset state on cancelled EntityTransformEvent to prevent event spam
f744c09c SPIGOT-5214: setCooldown not working
860b3540 SPIGOT-5204: Typo in deprecated enchantment name
2019-07-28 15:32:14 +01:00
Shane Freeder 42daaaddf6
Seperate out incremental saving
This fixes multiple issues, mainly cleaning up the patch as well as making save-all
actually save all. (Worth noting, that you should probably be using save-all flush if
you're relying on this for backups)
2019-07-28 01:39:02 +01:00
Shane Freeder 3a713bd57b
Mark entities as being ticked when notifying navigation 2019-07-28 00:53:49 +01:00
Spottedleaf 6f709200dd
use getChunkImmediately for vehicles 2019-07-28 00:38:49 +01: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 c6987e1a02 Peek the unload queue for chunk generation checks (#2332) 2019-07-23 22:41:26 -05:00
Spottedleaf 4ac69cec8d Bring task execution into server tick timings (#2357) 2019-07-23 22:20:14 -05:00
Black Hole 8ecd433727 Set spawning entity for fireworks spawned by a crossbow (#2358)
Fixes #2327
2019-07-23 22:12:40 -05:00
Lucavon ad8dbf3d2b
Add option to disable relative projectile velocity
Allows server owners to use 1.8 (and prior)'s projectile behavior
(ignored shooter's velocity when calculating projectile's velocity).

This patch adds an option "disable relative projectile velocity", which, when
enabled, will cause projectiles to ignore the shooter's current velocity,
like they did in Minecraft 1.8 and prior.
If a player is falling, for example, their shooting range will be drastically
reduced, as a downwards velocity is applied to the projectile. This prevents
players from saving themselves from falling off floating islands, for example,
as a thrown ender pearl will not make it back to the island, while it would
have in 1.8.

While this could easily be done with plugins, too, there are multiple problems:
1) If multiple plugins cancel the velocity by subtracting the shooter's velocity
   from the projectile's velocity, the projectile's velocity would be different.
   As there's no way to detect whether the projectile's velocity has already been
   adjusted to ignore the player's velocity, plugins can't not do it if it's not
   necessary.
2) I've noticed some inconsistencies, e.g. weird velocity when shooting while
   using an elytra. Checking for those inconsistencies is possible, but not as
   efficient as just not applying the velocity in the first place.
3) Solutions for 1) and especially 2) might not be future-proof, while this
   server-internal fix makes this change future-proof.
2019-07-23 20:31:21 -05:00
Minecrell fa8b4994ac Update TerminalConsoleAppender + JLine, use Jansi instead of JNA (#2299)
Remove dependency on JNA since it is no longer needed.
2019-07-23 19:25:05 -05:00
Shane Freeder 48b6bfe2a6
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:
c987938a SPIGOT-5180: Add Villager#sleep() and #wakeup() methods

CraftBukkit Changes:
7f33c6a2 SPIGOT-5196: Restore previous version behaviour regarding cancelled BlockBreakEvent
6a5fc902 Improve diff in EntityHanging
c98d61bf SPIGOT-4712: Allow spawning of upwards or downwards facing item frames
db971477 SPIGOT-5199: Fix NPE if setting the book of the ItemMeta of a lectern
b0ef3996 SPIGOT-4679 Fix black lines after book paragraphs
1215188f SPIGOT-5180: Add Villager#sleep() and #wakeup() methods
c03b2bef SPIGOT-4975: NPE on WorldGenStronghold When Using Multiple Worlds
65ea162c Ensure Bukkit data pack is always up to date
0b107b8d MC-157395, SPIGOT-5193: Small armor stands do not drop loot
6da0abca SPIGOT-5195: Player loot table does not drop when keepInventory is on
8b09d983 SPIGOT-5190: Superfluous EntityCombustEvent called when using fire aspect sword

Spigot Changes:
1981d553 SPIGOT-5198: Catch more bad async operations
6a14ca46 Rebuild patches
2019-07-23 20:17:32 +01:00
Spottedleaf 396d3f13c4 Ensure xray does not perform non MT-Safe operations (#2361) 2019-07-23 10:59:48 +01:00
Spottedleaf 160d1bc9e4 Only write to cached header in RegionFile if write potentially succeeds (#2294) 2019-07-21 16:36:27 -05:00
Andreas Troelsen ef6823811b
SPIGOT-5190: Do not call superfluous EntityCombustEvent 2019-07-20 19:14:06 -05:00
Spottedleaf 9fe63a1673 Update to 1.14.4 (#2333) 2019-07-19 23:01:24 -05:00
Spottedleaf 920ad7c742 Use getChunkIfLoadedImmediately in places (#2297)
* Use getChunkIfLoadedImmediately in places

This prevents us from hitting chunk loads for chunks at or less-than
ticket level 33 (yes getChunkIfLoaded will actually perform a chunk
load in that case).

* Resolve issue #2301

* Also target World#getChunkIfLoaded
2019-07-17 23:41:24 -05:00
Shane Freeder 0708fa363b
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:
eb2e6578 SPIGOT-5116: Fix concurrent modification exception inside ChunkMapDistance
989f9b3d SPIGOT-4849: Fix server crash when accessing chunks during chunk load/unload/populate events
f554183c SPIGOT-5171: Don't fire PlayerTeleportEvent if not actually moving
2349feb8 SPIGOT-5163: Cancelling PlayerBucketFillEvent visually removes the targeted block

Spigot Changes:
9a643a6a Remove DataWatcher Locking
2019-07-16 23:09:32 +01:00
kickash32 fa726c3f76 Create 0402-Only-count-Natural-Spawned-mobs-towards-natural-spaw.patch
delete old patch

Comment didn't make sense

Use original header

use original date in header
2019-07-13 13:38:22 -07:00
Spottedleaf 36c4831619 Fix loadChunk(x, z, false)
I was not correctly checking if the status was even cached.

Actually fix it this time

Do not forget about the async chunk placeholder

Actually fix it this time I hope

No plugin tickets for getChunkAtGen(x, z, boolean)

Change ChunkStatus ABI

This is required for asynchronous IO. async io will require
calls to getChunkStatusIfCached to return the chunk status for a
chunk currently queued to save - this cannot be reasonably done
with current ABI
2019-07-13 13:18:54 -07:00
Shane Freeder ff085b8e8e
Improve timings around chunk loading
Timers such as syncChunkLoad are hit persistently due to changes in how
this mechanism works which impacts the usablity of timings
2019-07-12 05:13:15 +01:00
Shane Freeder 7e8ae207bd
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:
e99c9444 Add Plugin Chunk Ticket API
6a235f06 Fix incorrect nullability annotations for PlayerJoinEvent's join message

CraftBukkit Changes:
5f889388 Tweak build expiration to 7 days
572c02b0 MC-155077, SPIGOT-5113: EntityTracker desync
7ad3a1f4 SPIGOT-5146: BlockDataMeta does not work
60860983 SPIGOT-5155: Setting EntityExplodeEvent yield to 0 still causes blocks to drop
087a2cf4 Print number of force loaded chunks per plugin in crash reports
07b5b06d Add Plugin Chunk Ticket API
7ffb2a27 SPIGOT-5149: resetRecipes does nothing
a2275f19 SPIGOT-5141: World.generateTree() causes ClassCastException with huge mushrooms
31d4a777 SPIGOT-5142: Ignore invalid firework effects

Spigot Changes:
5e4e7f32 BUILDTOOLS-471: Rebuild patches
6e944739 SPIGOT-5159: Raider activation range overridden by Monster range
2019-07-11 17:59:21 +01:00
kashike 8812fed9bb
Merge pull request #2240 from Spottedleaf/anti-xray
Re-Add Anti-Xray
2019-07-09 18:11:34 -07:00
Spottedleaf ef7202b9c2 Fix entity count in timings graph (#2293) 2019-07-08 14:29:22 +01:00
Shane Freeder 0a8afdacb6
Fix more issues with timings
- fixed usage of timings IDs (fixes region view)
- fixed more duplicated tick handlers
2019-07-08 03:54:40 +01:00
Shane Freeder c8bc57c719
Cleanup ChunkMapDistance patch 2019-07-05 03:23:33 +01:00
Shane Freeder 276afaa2ea
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:
c2d72c82 SPIGOT-3102: Add EXPLOSION SpawnReason

CraftBukkit Changes:
fca41573 SPIGOT-5136: EntityPortalEvent getting called on interdimensional entity teleports
604c8bf0 SPIGOT-3102: Add EXPLOSION SpawnReason
375969a6 Re-add chunk GC for plugin chunk loads
58151368 SPIGOT-5123: Snapshot tile entities can end up with a non-null world
491c8482 SPIGOT-5130: PersistentDataContainer not removing values on TileEntities

Spigot Changes:
d05d3c1f Rebuild patches
2019-07-05 03:13:38 +01:00
Jonathan Frederick 0d079188ea Remove unused fire-physics-event-for-redstone config option (#2277) 2019-07-03 15:44:07 -05:00
Shane Freeder 1bacdbd169
use a Queue in ChunkMapDistance
An oversight in this patch may be to blame for several issues in certain
cases, we'll opt to using a queue as this will fall in line with what is
expected and may help some issues where chunks remain loaded or fail to
load
2019-07-02 19:50:07 +01:00
Spottedleaf bd46b6397c Merge branch 'ver/1.14' of github.com:PaperMC/Paper into anti-xray 2019-07-01 22:24:09 -07:00
Zach Brown dafc3dbcd5
Update upstream B/CB/S
--- work/Bukkit
Submodule work/Bukkit aba2aaaf..949124e0:
  > SPIGOT-5121: Method to set PierceLevel of arrows

--- work/CraftBukkit
Submodule work/CraftBukkit c6997924..bf329334:
  > SPIGOT-5133: Throwing items into secondary end world portal causes crash
  > SPIGOT-5121: Method to set PierceLevel of arrows
  > SPIGOT-5122: Skip world#notify if sign has no world.
  > SPIGOT-5105: The EntityTag nbt tag disappears from preset armor_stand items.
  > SPIGOT-5106: Config option to prevent plugins with incompatible API's from loading

--- work/Spigot
Submodule work/Spigot 595711b0..935adb34:
  > SPIGOT-5088: Additional growth modifiers
2019-07-01 23:51:06 -05:00
Spottedleaf e679a7c11d Config migrations 2019-07-01 14:53:51 -07:00
Spottedleaf 0a667728c8 Resolve crash issue by shoving chunk loads onto the next tick 2019-07-01 14:36:31 -07:00
Spottedleaf 3a2d7f2ded Merge branch 'ver/1.14' of github.com:PaperMC/Paper into anti-xray 2019-07-01 12:53:51 -07:00
Shane Freeder edd3e778c4
Don't double-start the tickEntities Timing 2019-06-30 21:18:10 +01:00
Spottedleaf 511a6a1228
Actually use our log full policy 2019-06-29 20:38:27 -07:00
Spottedleaf 8f5b96ccc9 Queue log events when log buffer is full
This should resolve out of order logs when the buffer is full
2019-06-29 10:04:38 -07:00
Spottedleaf 5ffa0dae25 Do not force load chunks for plugin constructed packets 2019-06-28 08:05:52 -07:00
Spottedleaf e993aa6f69 Merge branch 'ver/1.14' of github.com:PaperMC/Paper into anti-xray 2019-06-28 06:37:28 -07:00
Shane Freeder a51823a732
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:
c6997924 SPIGOT-5110: Zombies converting to drowned too quickly
0c575603 SPIGOT-5101: Raids crash
2019-06-28 14:02:49 +01:00
BillyGalbreath 1019a87c2c Fix #2232 - Passive mobs don't move (#2253) 2019-06-28 11:33:17 +01:00
Spottedleaf 9a4a185fc1 Keep neighbour chunks loaded while obfuscating 2019-06-26 19:04:28 -07:00
Shane Freeder aa8483ea7e
Only save world data during a full save (Fixes #2243) 2019-06-26 15:21:16 +01:00
Spottedleaf f1f8060a4e
Fix build? 2019-06-25 22:27:22 -07:00
Spottedleaf 76eb2a5e5c
Use getChunkIfLoadedImmediately not getChunkIfCachedImmediately 2019-06-25 22:20:20 -07:00
Spottedleaf 46a6f1b2c5 Re-Add Anti-Xray 2019-06-25 21:56:19 -07:00
Shane Freeder 2ff7722630
Fix raids throwing an UnsupportedOperationException 2019-06-26 03:11:29 +01:00
Shane Freeder dc841f3379
Fix CME from raids
Use the iterator to remove elements
2019-06-26 01:31:26 +01:00