Commit Graph

3930 Commits

Author SHA1 Message Date
Aikar
d07f7197f2
Use Last Access Cache for isLoaded calls
this should provide a pretty good across-the-board performance
improvement for the entire server, as it's very common for code
to check if (isLoaded(x, z)) { then do something on that chunk }

Previously, containsKey would not read or set the last access cache

By making it do get() != null, we gain the benefits of last access
and also improves thread safey for async isLoaded checks

This exact usage scenario is used in Entity movement, so that alone
saves us up to 5%~ of CPU time for Entity movement.
2018-10-23 23:50:51 -04:00
Aikar
e9305f96a3
Don't sleep after profile lookups if not needed
Mojang was sleeping even if we had no more requests to go after
the current one finished, resulting in 100ms lost per profile lookup
2018-10-23 21:14:11 -04:00
Aikar
eb38e51ee0
Fix "prevent players from moving into unloaded chunks"
it used public method instead of private, and moved to world config

also improved the implementation to not use obfuscated stuff

Also removed the Fix Double chest conversion patch since its
fixed in other ways in vanilla
2018-10-23 21:13:58 -04:00
Zach Brown
042ccbb9b2
Strip private area unicode characters from signs
It is not immediately clear how these characters ended up on signs in
previous versions. It is clear, however, that they now render as empty
unicode boxes in 1.13, whereas previously they rendered as invisible
characters.

When these signs are loaded in versions after this commit, these
characters from the private use area of the Unicode block will be
stripped. The sign will then be marked to ensure this conversion only
runs once.

There is a flag -DPaper.keepInvalidUnicode=true that can be used if you
do not want us to strip these characters from your signs, though I can
think of no reason to use it.

Fixes GH-1571
2018-10-23 20:59:08 -04:00
Aikar
d5357c3fd9
[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:
3359cb19 MC-137353: Don't go crazy on amount of bootstrap threads needed
2018-10-23 05:40:18 -04:00
Shane Freeder
1387cff4e8
Update for Minecraft 1.13.2 2018-10-23 00:16:21 +01:00
GreenMeanie
9b98a252d6 Reset players remainingAir on respawn (#1598)
As mentioned in #1597, your air level did not reset if you drown.

Now you get a full breath during respawn.
2018-10-22 15:25:48 -04:00
Gabriele C
ce7e1c14a6 Add option to prevent players from moving into unloaded chunks (#1608)
Resolves #1551
2018-10-22 15:25:16 -04:00
Aikar
7c5b5ce946
[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:
a639ae44 Remove outdated build delay.
2018-10-22 15:02:10 -04:00
Aikar
d066d8b926 Remove debug text
resolves #1606
2018-10-21 19:16:54 -04:00
BillyGalbreath
0db94d4fca Fix #1604 (#1605) 2018-10-21 20:39:21 +01:00
Aikar
3fa9c0b5c3
[CI-SKIP] [Auto] Rebuild Patches
A recent commit has been made that caused patches to be out of order, rebuilding
2018-10-21 15:31:50 -04:00
Caleb Bassham
64840b3018 Fix NPE when setting a player's spectator target (#1596)
Fix NPE when setting a player's spectator target
2018-10-21 20:27:53 +01:00
Brokkonaut
4dc24e6c0f Don't modify item tag if interaction is canceled (#1589)
The item tag is stored before executing the interaction and restored before handling the
resulting events. If the event was not canceled and the ItemStack is not modified in the
event, the new tag is set back to the new one afterwards. This is similar to the handling
of the item amount.

This fixes a bug where tools lose durability when the interaction is canceled and another bug
where tools become completely repaired when they should break but the interaction was canceled.
2018-10-20 10:03:35 -04:00
kashike
f572d1e021
Merge pull request #1588 from BillyGalbreath/MC93764
Fix MC-93764
2018-10-19 17:46:56 -07:00
BillyGalbreath
8098020fd0 Fix MC-93764 2018-10-19 19:39:21 -05:00
Aikar
d9bd2d8440
[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:
db10914a Improve minecart spawners
2018-10-19 05:31:49 -04:00
BillyGalbreath
8c7f0e79ce Add more Witch API (#1564) 2018-10-18 23:24:09 -04:00
Aikar
0d1ca37436
Remove MOST Synchronization from Chunk Map
This will provide quite a major performance boost by avoiding
synchronizing on EVERY chunk lookup.

Synchronize, even without contention, incurs processor cache flushes.

Considering this is the 2nd hottest method in the code base, lets
avoid doing that...

Additionally, chunk conversion operations were occuring while
under synchronization which lead to deadlocks.

Now the conversion will occur outside of the lock, and fix
that issue, resolving #1586

Note, that the chunk map is still thread safe for get operations!

The chunk map was never intended to be modified async with our
changes, as we post to main to modify the map, however
we do still synchronize for write operations (put, remove)

We also synchronize for async get operations, ensuring that
async gets are safe.

We do not need to synchronize main thread gets as the processor
cache will be insync since the map is only updated on the main thread.

However, if someone does try to delete or put concurrently, we
will force their operation back to the main thread.
2018-10-18 22:41:23 -04:00
Aikar
fa72a71601
Remove useless hashes from patches
This avoids annoying conflicts as well as gets rid of diff noise
from clients preferring different hash lengths
2018-10-18 22:37:06 -04:00
Andrew Steinborn
7141632abf Add Velocity IP forwarding support (#1557)
While Velocity supports BungeeCord-style IP forwarding, it is not secure. Users
have a lot of problems setting up firewalls or setting up plugins like IPWhitelist.
Further, the BungeeCord IP forwarding protocol still retains essentially its original
form, when there is brand new support for custom login plugin messages in 1.13.

Velocity's modern IP forwarding uses an HMAC-SHA256 code to ensure authenticity
of messages, is packed into a binary format that is smaller than BungeeCord's
forwarding, and is integrated into the Minecraft login process by using the 1.13
login plugin message packet.
2018-10-18 20:44:59 -04:00
Caleb Bassham
3b358452ba Add events for player changing spectator target (#1498)
* Add events for player changing spectator target

- Add PlayerStartSpectatingEntityEvent
- Add PlayerStopSpectatingEntityEvent
2018-10-18 16:53:10 -04:00
Aikar
42772e476a
[CI-SKIP] [Auto] Rebuild Patches
A recent commit has been made that caused patches to be out of order, rebuilding
2018-10-17 23:06:33 -04:00
Brokkonaut
4168fa182e Fire EntityCombustEvent for phantoms (#1573) 2018-10-17 23:04:21 -04:00
Aikar
00f0a30680
Ensure chunk neighbor counts do not get desynced
Mojang was not checking that the chunk did not overwrite, or
was successfully removed.

We're seeing odd reports in #1561 that indicates issues around
this are having problems.
2018-10-17 22:47:27 -04:00
Aikar
ed9a89e82e
Improvements to Timings Performance
1) Get rid of string interning. can be heavy, has been seen to cause issues for some users
2) Use ConcurrentHashMap instead of a SynchronizedMap
3) Stop use of MRUMapCache which is not thread safe for Group lookups
4) Stop using IdentityHashMap which has performance issues in Java 8
2018-10-17 22:09:08 -04:00
Aikar
e047098814
MC-50319: Check other worlds for shooter of projectiles
Say a player shoots an arrow through a nether portal, the game
would lose the shooter for determining things such as Player Kills,
because the entity is in another world.

If the projectile fails to find the shooter in the current world, check
other worlds.
2018-10-17 19:30:57 -04:00
Aikar
dcc764db21
[CI-SKIP] Fix build script for version detection
Apparently grep was being greedy even when it shouldn't.
This ensures it doesn't be too greedy.
2018-10-17 00:03:30 -04:00
BillyGalbreath
52ae2a1aec
Implement getters and setters for EntityItem owner and thrower
Closes #1526
2018-10-16 22:17:59 -04:00
Zach Brown
6ec7d9f674
Fix equals case in lightning sounds 2018-10-16 21:40:32 -04:00
Trigary
20515a30ae
Limit lightning strike effect distance
Resolves GH-1436
2018-10-16 21:23:44 -04:00
Zach Brown
026ee580a3
[CI-SKIP] Remove debug echo statements from last 2018-10-16 20:41:20 -04:00
Zach Brown
1944b6bd54
Fix decompile script json regex
When Mojang added 1.13.2-pre2 to their manifest page it exposed a flaw
in the way the script's regex was getting the version json manifest.

I've tweaked the regex such that it will always first get the version
entry and then use that entry to get the json url, rather than trying to
do the whole thing in one shot.

Fixes GH-1582
2018-10-16 20:38:05 -04:00
Aikar
06f15f54ba
[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:
cd6252a4 Fixed missed diff in PathfinderGoalPanic.
2018-10-16 17:21:46 -04:00
Aikar
951ef517b3
[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:
0adc1b99 SPIGOT-4428: Update Player CustomName
2018-10-15 04:26:41 -04:00
GreenMeanie
03ecc80de8 Actually set the header (#1576) 2018-10-15 01:05:02 -04:00
Aikar
c4c9984906
[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:
0e17dc03 Add Block#isPassable

CraftBukkit Changes:
e3d7b2fd Add Block#isPassable
2018-10-12 19:06:39 -04:00
Aikar
6a60c4295d
[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:
e7ced970 Catch plugins setting null Material or BlockData to blocks
2018-10-12 18:46:42 -04:00
Shane Freeder
35fcc2e2d0
Share the main thread queue for AsyncChunkProvider
fixes an issue in which thread requests are only processed
for the current provider which can cause a deadlock should
multiple requests exist across providers
2018-10-12 15:50:58 +01:00
Aikar
69a4a30e47
[CI-SKIP] [Auto] Rebuild Patches
A recent commit has been made that caused patches to be out of order, rebuilding
2018-10-12 03:11:50 -04:00
BillyGalbreath
3b580e8aa9 Here's Johnny! (#1563)
Adds Johnny API to Vindicator
2018-10-12 03:09:53 -04:00
Aikar
04b8268cf1
Improvements to DataFixers for performance
Mojang asked me to make some changes, so applied them here.
2018-10-12 01:29:28 -04:00
Aikar
77c6bafe46
Missed a +1 on village doors 2018-10-11 21:54:15 -04:00
Aikar
dc6dbeb6ad
[CI-SKIP] [Auto] Rebuild Patches
A recent commit has been made that caused patches to be out of order, rebuilding
2018-10-11 21:46:35 -04:00
Aikar
ee7933e43e
Improve Village Door code to not break village mechanics 2018-10-11 21:42:52 -04:00
BillyGalbreath
a16ef75bfd Add sun related API (#1546)
These methods are used internally throughout the game for things like spawning mobs during day/night only or making them burn in daylight, etc. Now exposed for plugin usage.
2018-10-11 21:42:49 -04:00
Aikar
69cad796ab
Ignore colorable size in test, NMS Tags not loaded at unit test
runtime materials is different than unit test.

prob going to run into this again in future, will worry about it then
2018-10-10 23:40:52 -04:00
BillyGalbreath
fe01fa5641 Turtle API (#1509) 2018-10-10 23:40:49 -04:00
Aikar
14de21393c
Use a method for EntityTrackerEntry for Gerrygames
Allow overriding the method for interception

https://github.com/PaperMC/Paper/issues/1537

Resolves #1537
2018-10-10 23:19:51 -04:00
Aikar
e020015aad
Fix rebuildPatches and grep colors not reverting junk changes
we've seen some index lines change in length in some PR's, though
this script was suppose to ignore those changes already.

The only way I can see that not working is if the color mode
of grep is breaking the pattern matching, as some people
default their grep to use color=always

this adds color=none to ensure colors are disabled, should ensure it.
2018-10-10 23:16:18 -04:00