Commit graph

3771 commits

Author SHA1 Message Date
GreenMeanie
f20d327458 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
039f9ecfd8 Add option to prevent players from moving into unloaded chunks (#1608)
Resolves #1551
2018-10-22 21:25:16 +02:00
Automated
897ae0754a [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
af53c8c59e Remove debug text
resolves #1606
2018-10-21 19:16:54 -04:00
BillyGalbreath
71cf04c13d Fix #1604 (#1605) 2018-10-21 14:39:21 -05:00
Automated
fd43e4e3cf [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
0c7c2af037 Fix NPE when setting a player's spectator target (#1596)
Fix NPE when setting a player's spectator target
2018-10-21 14:27:53 -05:00
Brokkonaut
4c9478551c 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 16:03:35 +02:00
Riley Park
15fb6a6c01 Merge pull request #1588 from BillyGalbreath/MC93764
Fix MC-93764
2018-10-19 17:46:56 -07:00
BillyGalbreath
367d892a6e Fix MC-93764 2018-10-19 19:39:21 -05:00
Automated
927780a15f [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
4a5ad2e1d2 Add more Witch API (#1564) 2018-10-18 22:24:09 -05:00
Aikar
6ef36f5d24 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
8593ac6ec5 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:36:03 -04:00
Andrew Steinborn
344d299d69 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
99cd22a793 Add events for player changing spectator target (#1498)
* Add events for player changing spectator target

- Add PlayerStartSpectatingEntityEvent
- Add PlayerStopSpectatingEntityEvent
2018-10-18 15:53:10 -05:00
Automated
5c711f1b9a [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
62630cfdc6 Fire EntityCombustEvent for phantoms (#1573) 2018-10-18 05:04:21 +02:00
Aikar
ec2f1e4093 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
b3b0490651 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 21:59:35 -04:00
Aikar
82d6028aa7 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
ed7f9b32de [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-16 23:55:54 -04:00
BillyGalbreath
7040465881 Implement getters and setters for EntityItem owner and thrower
Closes #1526
2018-10-06 20:55:18 -05:00
Zach Brown
4a6e5b036f Fix equals case in lightning sounds 2018-10-16 21:40:32 -04:00
Trigary
cdbdd636e7 Limit lightning strike effect distance
Resolves GH-1436
2018-09-14 17:49:25 +02:00
Zach Brown
39d7c99598 [CI-SKIP] Remove debug echo statements from last 2018-10-16 20:41:07 -04:00
Zach Brown
963393ce85 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
Automated
96a9d10df0 [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
Automated
edff8c9a95 [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
f7142b9603 Actually set the header (#1576) 2018-10-15 01:05:02 -04:00
Automated
ead4f30915 [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
Automated
0e6f024eda [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
442538c84f 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:41:15 +01:00
Automated
6f4f194503 [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
83e66d52da Here's Johnny! (#1563)
Adds Johnny API to Vindicator
2018-10-12 02:09:53 -05:00
Aikar
f481fac7c9 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
71645db85f Missed a +1 on village doors 2018-10-11 21:54:15 -04:00
Automated
b6902b9615 [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
9ea608cf84 Improve Village Door code to not break village mechanics 2018-10-11 21:42:13 -04:00
BillyGalbreath
f4da2d1b05 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 20:42:49 -05:00
Aikar
e6b2a1d2a6 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:39:36 -04:00
BillyGalbreath
35e512ae34 Turtle API (#1509) 2018-10-10 22:40:49 -05:00
Aikar
3c30cc1600 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:18:02 -04:00
Aikar
f0ade197ea 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
Automated
9ce97cd031 [CI-SKIP] [Auto] Rebuild Patches
A recent commit has been made that caused patches to be out of order, rebuilding
2018-10-10 23:06:38 -04:00
BillyGalbreath
e43da4fba9 Check Drowned for Villager Aggression Config (#1560) 2018-10-10 22:01:14 -05:00
Aikar
3fe4a2dd2f Improvements to Async Chunks
If a chunk load comes in on a chunk load or gen thread,
execute it synchronously on that thread instead of enqueueing it.

It doesn't make sense to enqueue it as that thread is then
going to future.join() it and block until it's ready anyways.

This opens risk to a deadlock if every load or gen thread is
waiting on a recursive chunk but it will never finish because
all of the threads are waiting.
2018-10-10 22:48:35 -04:00
Aikar
ed0d75e389 Identify corrupt region file data and self recover
If we identify an invalid offset (negative, or the header sectors),
then back up the region file and erase that specific chunks offset
data.

This will avoid crashing the server with AIOBB errors and also avoids
server owners having to consider the entire region file 'lost'.

I'm not sure what leads to this state, I can only assume write cut
off mid bits.

In this scenario, there is absolutely no way to know where the chunk
actually is in the data file without loading every
single chunk in the file. And even to do that, would be quite extreme
due to the fact the file isn't in some orderly fashion.

Since the file is backed up, the user can use a region fixer tool
externally to try to restore that single chunk. We could even
add a command to restore a chunk from a backup file in a different
commit later on. But this at least prevents the server from crashing.

The server will just generate a new chunk and move on,
after printing an error to the console about it.

Also fixed the case reported in this issue about the server
hanging when a corrupt chunk is encountered, so this issue
is now fully closed.

Resolves #1541
2018-10-10 21:28:12 -04:00
BillyGalbreath
7f7b6df9bd Add LivingEntity#getTargetEntity (#1467) 2018-10-08 20:14:55 -05:00
Aikar
3e600507c8 Complete future when chunk fails to load 2018-10-08 21:14:13 -04:00