Commit Graph

3665 Commits

Author SHA1 Message Date
Aikar
6cc16bffe6
MaterialTags API
This adds a plethora of useful Tags to let you identify common grouping
of materials. This should complete all of the categories that mojang
did not provide official tags for plus some more.

These are not "registered" tags. They are not usable in any form of
command system that might support tags.

These are provided as a Paper maintained list of items so that plugins
do not have to worry about maintaining all these tags themselves.

This API can technically be copy and pasted into a plugin, and plugins
can add additional Tags's if they wish too to their plugin by
instantiating a MaterialSetTag.
2018-10-06 21:42:45 -04:00
Aikar
efd4acf4c9
Add Material.isAir API
Because mojang, we now have 3 airs.
2018-10-06 21:42:45 -04:00
Aikar
d0619d12f7
[Auto] Updated Upstream (CraftBukkit)
Upstream has released updates that appears to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

CraftBukkit Changes:
8ab46ff7 SPIGOT-4368: Tweak fish persistence
2018-10-06 19:11:42 -04:00
Aikar
468a1cbbd7
[Auto] Updated Upstream (Bukkit/CraftBukkit)
Upstream has released updates that appears to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

Bukkit Changes:
ee12ca7b Add maximum repair cost API to AnvilInventory

CraftBukkit Changes:
1ceee633 Implement maximum repair cost API to AnvilInventory
2018-10-06 05:31:40 -04:00
Aikar
addebee995
Fix logic error in water activation range immunity check
was no longer giving immunity to items
2018-10-06 01:17:32 -04:00
Aikar
49052de5e5
Fix many light bugs by removing recheckGaps change
Fixes #1539
Fixes #1483
2018-10-06 00:56:20 -04:00
Aikar
f21627490e
Don't stop chunk executors, cancel pending chunks instead
Fixes #1532
2018-10-06 00:15:40 -04:00
Aikar
70b156939f
Cancel pending chunk loads when they are no longer needed
This will improve queue times by canceling chunks when a player
leaves the radius of an async loading/generating chunk.

This matches behavior we had pre 1.13 for loading too.
2018-10-06 00:02:09 -04:00
Aikar
8b3952062a
[Auto] Updated Upstream (Bukkit)
Upstream has released updates that appears to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

Bukkit Changes:
66b9b8fd Clarify Colorable docs further
2018-10-05 21:01:32 -04:00
Aikar
771c724734
[Auto] Updated Upstream (Bukkit/CraftBukkit)
Upstream has released updates that appears to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

Bukkit Changes:
76fdc1ef SPIGOT-4411: Document use of null for shulker colours

CraftBukkit Changes:
6a0c4e1c SPIGOT-4411: Document use of null for shulker colours
2018-10-05 20:21:34 -04:00
Zach Brown
2ae1ed6336
Hook into CB's plugin rewriting system
Primarily to update plugins for our fastutil relocation. Can also be
used to do things like debug plugins accessing versioned NMS packages in
an IDE pre-relocate step.
2018-10-05 19:44:46 -04:00
133Seven
d7cb3a9989 [CI-SKIP] Change URL in POM to https://papermc.io 2018-10-05 11:52:04 -04:00
Matthew Miller
8749e58b72 Don't update snapshot blockstates (#1535)
Following this comment on PaperLib, https://github.com/PaperMC/PaperLib/pull/2#discussion_r222761017

I've made non-snapshot TE's not update when they receive the update call. They still do the rest of the update, just not the applying of the TE data. This is to still allow forced physics updates etc. Also in the case of Jukeboxes, updating the properties
2018-10-05 11:24:01 -04:00
Brokkonaut
0a6d449907 Sometimes World.save() did not save the whole world. (#1538)
flag = true is a force save of the whole world (for example World.save()), this should ignore the current queue size.
2018-10-05 11:23:20 -04:00
Aikar
e2418a9945
[CI-SKIP] Undo an accidental merger of patches
Accidently merged 1 pathfinding patch into a light patch instead
of the other pathfinding page.

Fixed that. Hand editting patch master race
2018-10-04 23:31:01 -04:00
Aikar
459987d69f
More improvements to activation range, improve turtles
improved the water code so that immunity wont trigger if the entity
has the water pathfinder system active, so this improves support
for all entities that know how to behave in water.

Merged 2 EAR patches together, and removed an MCUtil method that
doesnt have a purpose anymore
2018-10-04 23:18:46 -04:00
Aikar
a4df5ddee7
Report errors correctly from FutureTasks
Anything that posts something to main thread was not
correctly reporting their errors to the logger, passing the
ExecutionExcetion instead of the cause. This resolves that,
as well as patches some simple cases of System.nanoTime where mojang
had used a LongSupplier to use a different method on client.
2018-10-04 01:45:11 -04:00
Aikar
d7dd3798ec
Fix lag caused by water mobs across the board - Fixes #1462
This update introduces Entity Activation Range for water mobs.

Activation Range has been one of my biggest performance improvements
I ever added to Minecraft, however "Entity is in Water" is an immunity
case that keeps an entity active.

This update ignores the water check for known water based mobs, allowing
them to actually go inactive.

In addition to that, a new config option was added to spigot.yml to go with
the rest of the entity-activation-range options to let you configure
aquatic mobs like fish, squid and dolphins separately.

This should overall fix all lag caused by water mobs.
2018-10-04 01:21:02 -04:00
Aikar
aad2e08482
[CI-SKIP] Remove Trove and update to fastutul 8 on -api
These deps were marked as provided, not compile, so they were never
exposed to plugins anyways as we THOUGHT we had done, oops.

Well plugins can still add fastutil to their build and use the
deps as provided by minecraft.

This ensures -api side does not use a deprecated API as fastutil 8
removed the deprecated methods.
2018-10-03 21:32:11 -04:00
Zach Brown
ebe072deb6
Revert "Dont strip explicit leading color codes in chat components (#1512)"
This reverts commit 31a99db328.

Fixes GH-1525
Reintroduces GH-1484
2018-10-03 18:15:22 -04:00
Shane Freeder
2dcae290df 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:
867794b2 Make setPersistent also control player saving

CraftBukkit Changes:
02518f92 Make setPersistent also control player saving
2018-10-03 20:19:35 +01:00
Shane Freeder
26153def87 Fix FileIOThread concurrency issues (fixes #1505)
FileIOThread was using two volatile counters in order to track if
any pending work was in the queue, this causes potential concurrency
issues when this counter is updated from multiple threads, potentially
causing these counters to desync due to the unsafe volatile update
2018-10-03 19:12:07 +01:00
Aikar
a64b0952cb
Add config options to paper.yml for Async Chunks and Shared Host Overrides
Shared Hosts have been concerned over the increased CPU usage that Async Chunks
has introduced. We understand that shared hosts can't allow 1 client
to abuse the systme resources depriving other servers of cpu time, so we've
added some configs to allow hosts to force some settings.

Hosts, you may set the following SYSTEM ENVIRONMENT VARIABLES (NOT JVM FLAGS)
to change some behavior:

PAPER_ASYNC_CHUNKS_SHARED_HOST_GEN=1   - Enable Single Threaded World Generation (capping CPU Usage
PAPER_ASYNC_CHUNKS_SHARED_HOST_GEN=2   - Disable Async Chunk Generation - Please do not do this!!!
  - Minecraft is moving towards asynchronousm per-world chunk generation itself. You need to prepare
  - for this, so please do not disable async chunk generation.

PAPER_ASYNC_CHUNKS_SHARED_HOST_LOAD=#  - Where # is Maximum number of threads to use on Chunk Loading
  - This is a max, so your end user can reduce it more too. I suggest no lower than 2. Minimum is 1.
  - These are usually much faster request, so outside of loading entire worlds, They usually do not
  - get as much load. Paperby default uses CPU Core count * 1.5, so this may default to a higher value
  - on shared host and you should override it with this value to say 2-4.

These settings will override your clients paper.yml options. Set as a system wide environment
variable to ensure all Paper clients respect your resource usage desires.

Resolves #1520
2018-10-02 23:51:03 -04:00
Zach Brown
10209bfbd8
Do not allow null in CanPlaceDestroy NBT API
Fixes GH-1523
2018-10-02 22:54:38 -04:00
Aikar
38f0f0b71a
Disable use of Locks on main thread for DataPaletteBlock
This should greatly improve performance by using a No Op lock
while on the main thread.

Vanilla always had a write lock on write operations, but we added
a Read Lock during Async Chunks to make concurrent writes non fatal
for Async Chunks.

This means we added on a bunch of over head to all chunk read operations.

This corrects that, as well as disabling the write lock while on main thread.

It is a general rule that you do not touch a chunk async once it is loaded
into the world, as we never had locks on the chunk before 1.13 even.

So once we are on main, we don't expect concurrent access to begin with,
so we don't need the write locks either.
2018-10-02 22:29:31 -04:00
Aikar
e45b853e60
Optimize some light chunk access
light calculations repeatedly looks up the same chunk while going
down on the Y access. Pass the chunk to it to skip many round trips
to the map lookup process.

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

The avoiding of entering synchronized section is the main goal here.
2018-10-02 21:55:30 -04:00
Aikar
49f584a14b
[CI-SKIP] Update test server rebuild logic
Many times I've ran paper test trying to SHUTDOWN
the existing test server, only for it to see that my target folder
is missing (for whatever reason), and it try to build paper to make
the jar exists.

Well, the patch process will wipe out any uncommitted changes, causing
loss of work.

Now we will only build patches if your missing your entire Paper-Server
folder, and only trigger a mvn compile if the jar is missing.
2018-10-02 21:49:42 -04:00
Aikar
97b9ce8476
[CI-SKIP] [Auto] Rebuild Patches
A recent commit has been made that caused patches to be out of order, rebuilding
2018-10-02 10:26:35 -04:00
BillyGalbreath
31a99db328 Dont strip explicit leading color codes in chat components (#1512) 2018-10-02 10:21:12 -04:00
Aikar
920bf4680b
[Auto] Updated Upstream (CraftBukkit)
Upstream has released updates that appears to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

CraftBukkit Changes:
68588dac SPIGOT-4405: Chunk generation problem
2018-10-02 09:06:52 -04:00
Aikar
083bf7b255
[Auto] Updated Upstream (CraftBukkit)
Upstream has released updates that appears to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

CraftBukkit Changes:
c8f68670 Save server version
2018-10-02 06:56:32 -04:00
Shane Freeder
9038677c89
Updated Upstream (Bukkit/CraftBukkit)
Upstream has released updates that appears to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

Bukkit Changes:
c71bb9ca Add PlayerRecipeDiscoverEvent and methods to (un/)discover recipes

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

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

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

This should reduce the amount of spare chunks loaded on a server.
2018-09-30 20:34:05 -04:00
Aikar
6135b37c05
[Auto] Updated Upstream (Bukkit)
Upstream has released updates that appears to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

Bukkit Changes:
e64f4eb1 Remove some draft API markers
2018-09-29 22:16:44 -04:00
BillyGalbreath
c81736fd60 Fix cancelled lootables (#1510) 2018-09-29 21:57:59 -04:00
Zach Brown
d9363f2979
Fix slime pathfinding when loaded from NBT
GH-1507

The canWander property is initialized to true by default, however when
loaded from NBT, if the key doesn't exist the property will be set to
false. The correct solution is to ensure the key exists before setting
the property.
2018-09-29 16:06:26 -04:00
Zach Brown
cfc7baeefb
Add support for Java 11 to deprecated Timings API
In Java 11 the internal reflection method used to determine the calling
class in the legacy and deprecated Timings API, that no one should be
using anymore, was removed.

This means plugins that try and use it will all fail to enable and we
can't compile the server with JDK 11.

The solution to the removal of this internal reflection class is
to just use reflection to call it if its available and fall back to
the unnamed handler system if it isnt.

Update to the newer API if you use Timings already...
2018-09-29 14:05:24 -04:00
Aikar
9285b9cf1c
Fix village check
obf helper was in an unimported file, so just going to skip helper here
2018-09-29 12:20:29 -04:00
Aikar
c64503c66f
Fix Village Loading Doors fix, add config option, hopefully fix farms
The patch was previously applied wrong, and still caused chunk loads.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

This means, transitions between water and air also do not need
to recalculate light, which saves a TON of updates caused by
fluids flowing.
2018-09-28 21:30:03 -04:00