Commit graph

3919 commits

Author SHA1 Message Date
Aikar
1ba5ee72ff Clean upstream before merging to ensure clean state 2019-04-02 21:46:32 -04:00
Aikar
fba6eef5bd Re-add isTypeNotPersistent check
seems CB did something different with that field more than I understood.

So now it permanently doesn't match vanilla? :(
2019-03-29 08:50:52 -04:00
Shane Freeder
a739de61cb Fix PersistentStructureLegacy NPE on custom worlds
This is caused due to the DimensionManager in CB worlds not being
registered by NMS, we fix this by copying CBs behavior of using the
world providers DimensionManager, vs using the actual dimension manager
of the world
2019-03-29 11:37:20 +00:00
Aikar
b306372426 Restore vanilla behavior of mob counts for persistent mobs
Now decounts entities that got name tagged or persistent state changed.

Removes a bad CB check that ignored some persistent mobs persistence state.

Vanilla code explicitly only cares 'is this mob persistent?' and if
it is, it is not counted. CB should not of been checking its type state.

Fixes #1922
2019-03-29 02:51:08 -04:00
Aikar
fbe06222c4 Fix map rendering issues - Fixes #1796 2019-03-29 02:27:56 -04:00
Aikar
f9b8a839ff Optimize Persistent Data Loading
removes Mineshaft loading legacy as we had pre 1.13.2 to avoid managing
that very large data file from legacy systems.

Previous to 1.13.2 these data files were never loaded to begin with, so they
effectively do not contain valid/relevant data.

These files take a long time to convert on large worlds and crashes the server.

Additionally, cache the result of a file being missing so we don't keep spam checking it.
2019-03-29 02:16:55 -04:00
Aikar
274fe387da Fix a concurrency issue with legacy structure data loading
This code could get hit by many threads at once, causing multiple
chunk loads to convert legacy data, leading to all sorts of fun.

Additionally, go ahead and preload it async on world load.
2019-03-29 02:02:53 -04:00
Zach Brown
8f045357ae Fix javadocs take 2: electric boogaloo 2019-03-29 00:44:06 -04:00
Aikar
03603ab34b fix javadocs 2019-03-28 23:58:09 -04:00
Aikar
7ed92736c0 Reuse buffers for chunk compression to optimize memory use
Instead of allocating a buffer for every chunk compression, reuse
the same 64k sized buffer.

Also stopped doing dynamic compression levels. It wasn't helping enough.

This will improve memory usage and zlib performance of chunk compression.
2019-03-28 22:06:35 -04:00
Aikar
bea67c4412 Forgot to convert duration to millis per the API expectation for tick event 2019-03-28 01:27:39 -04:00
Aikar
4606cb8ce3 PlayerDeathEvent#getItemsToKeep
Exposes a mutable array on items a player should keep on death.

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

Example Usage: https://gist.github.com/aikar/5bb202de6057a051a950ce1f29feb0b4
2019-03-28 00:58:05 -04:00
Aikar
05c82fcfe0 Server Tick Events
Fires event at start and end of a server tick
2019-03-27 22:49:29 -04:00
Aikar
4e0a1533d0 Remove light optimization
getting lots of bug reports on light. just going to drop this even though
I really don't see how it could be the source due to my understanding of
the games light engine...

Fixes #1920
2019-03-27 20:46:46 -04:00
Shane Freeder
0e54493013 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:
4c8327f7 SPIGOT-4673: EntitySpawnEvent should not be called for players

Spigot Changes:
5629554b Rebuild patches
2019-03-27 18:41:12 +00:00
Aikar
9c9062547e Revert "Optimize Bukkit <-> NMS Mapping tables and legacy conversion"
This reverts commit 9329e1383d.

Has issues, will fix later
2019-03-26 01:58:53 -04:00
Aikar
8c452eb0d5 Fix issue in last build with null task timings 2019-03-26 01:31:59 -04:00
Aikar
92059ef6ba Improve Timings stack protection more
Ensures in more places that exceptions will not corrupt the Timings stack.

Timings will now better report stack corruption and auto repair itself too.
2019-03-26 00:31:34 -04:00
Aikar
9329e1383d Optimize Bukkit <-> NMS Mapping tables and legacy conversion
Use O(1) patterns for mapping conversions to improve plugin performance.
Optimize collections used by legacy plugin conversion

This should improve plugin performance across the board
on Paper for both Modern and Legacy Plugins.

Also log how long building those tables takes...
2019-03-25 22:37:28 -04:00
Shane Freeder
e8b836dec8 Ensure that TimedEventExecutor timings are closed (Fixes #1918)
pre this, any event handler firing an exception would leave the timings
open, causing the timings stack to be corrupted
2019-03-26 00:55:29 +00:00
Automated
973a062bb9 [CI-SKIP] [Auto] Rebuild Patches
A recent commit has been made that caused patches to be out of order, rebuilding
2019-03-24 23:51:44 -04:00
Shane Freeder
9988ca1c1d Don't update entity trackers for worlds without players
PlayerList#moveToWorld already untracks the player from the player list,
meaning that we do not need to worry about this untracking players
who've left the world, The server also untracks a player during
disconnect, handing yet another case.

If we don't need to untrack players who've left the world, it should be
reasonably save to do this, as we're not going to be performing any
server->client updates here, which is what this code is intended to do,
and all players should be untracked.
2019-03-24 20:34:32 +00:00
Aikar
0800b3909a Improve nullability changes from last commit about getWorld 2019-03-24 19:33:26 -04:00
Aikar
fc271fbed3 Restore some SANITY around nullability annotations
Some of these were wrong (scoreboard manager), others are counter to
everything everyone expects (Locations world being null, which wasnt ever safe EVER)
others are just too noisy.

Replace some with Contract to get rid of the nullability constraint and go back to
the old days of IDE not considering it strictly one way or the other.

Also, stop requiring annotations on package-private.

Introduces the next Developer Perk for Paper-API: Your plugin isn't yellow anymore.

Also fixed random dupe code in ensureServerConversions that got mistakenly set in the update.
2019-03-24 19:13:07 -04:00
Aikar
b3005192c9 Add the unnecessary annotation
cmon, that wasn't even API.

i've updated my IDE to now not skip tests :(
2019-03-24 18:32:08 -04:00
Aikar
eb39758848 missed a spot for pickupDelay fix 2019-03-24 18:15:39 -04:00
Aikar
644e1d4f8f don't go below 0 for pickupDelay, breaks picking up items
vanilla checks for == 0

Fixes #1911
2019-03-24 18:12:56 -04:00
Aikar
310ae5b900 update metadata refresh approach
same fix, less work needed to do it
2019-03-24 17:48:22 -04:00
Aikar
a76d462eae Timings Improvements
use a better stack for managing timing tree relationships
remove unnecessary synchronization (i forgot HANDLERS is only touched on main)

this should hopefully resolve any data integrity concerns
2019-03-24 17:47:23 -04:00
Aikar
3f35065cd3 include chunk gen mobs in natural counting, fix some spawn reasons 2019-03-24 13:55:27 -04:00
Joel Paulien
3216b19a10 Add PlayerPostRespawnEvent (#1622) 2019-03-24 10:50:42 -07:00
Mark Vainomaa
6b534b0a0e Add GS4 query event (#1906) 2019-03-24 19:01:31 +02:00
Johnny Cao
7ac68eb046 Fixes issues with player interaction preventing metadata from being updated for other players (#1896) 2019-03-24 10:00:42 -07:00
Aikar
5b0b2630b1 Add a config for mob spawn change, really shouldn't use it
turning this to true allows 1 player to deny other players the ability
to have mobs spawn. It really is a bad idea and reverts back to iffy
mob spawn limits where mob farms in the world stops natural spawns
from occuring.

Really recommend resorting to different solutions than ever using this config.
2019-03-24 12:46:52 -04:00
Aikar
6e81645df1 Updated Upstream (Bukkit/CraftBukkit)
Upstream has released updates that appears to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

Bukkit Changes:
451bd74e Use gson for decoding version command

CraftBukkit Changes:
51100db8 SPIGOT-4678: Fix placing signs in certain circumstances
2019-03-24 12:33:39 -04:00
Zach Brown
66ac2b2606 Restore lost player cooldown APIs
Accidentally removed in a7ba5db3de
2019-03-24 13:16:59 -04:00
Aikar
669007b2f6 Only count Natural Spawned mobs towards natural spawn mob limit
This resolves the super common complaint about mobs not spawning.

This was ultimately a flaw in the vanilla count algorithim that allows
spawners and other misc mobs to count against the mob limit, which are
not bounded, and can prevent the entire world from spawning new.

I believe Bukkits changes around persistence may of actually made it
worse than vanilla.

This should fully solve all of the issues around it so that only natural
influences natural spawns.
2019-03-24 01:05:07 -04:00
Aikar
603ab21457 Entity#getEntitySpawnReason
Allows you to return the SpawnReason for why an Entity Spawned

Pre existing entities will return NATURAL if it was a non
persistenting Living Entity, SPAWNER for spawners,
or DEFAULT since data was not stored.
2019-03-24 01:00:55 -04:00
Aikar
2651356bc9 Fix a case where mob spawning could load/gen chunks 2019-03-24 00:59:45 -04:00
Automated
252420097a [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:
d65a2576 SPIGOT-4674: Allow spawning hanging on top/bottom of block
2019-03-22 05:36:44 -04:00
Automated
d80e635e91 [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:
0eaf10f1 Add getObject methods to ConfigurationSection
2019-03-21 06:21:43 -04:00
Riley Park
c752d3a80d Use proper max length when serialising BungeeCord text component 2019-03-20 21:20:56 -07:00
Shane Freeder
7e331bdc72 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

Developers!: You will need to clean up your work/Minecraft/1.13.2 folder
for this

Also, restore a patch that was dropped in the last upstream

Bukkit Changes:
279eeab3 Fix command description not being set
96e2bb18 Remove debug print from SyntheticEventTest

CraftBukkit Changes:
d3ed1516 Fix dangerously threaded beacons
217a293d Don't relocate joptsimple to allow --help to work.
1be05a21 Prepare for imminent Java 12 release
a49270b2 Mappings Update
5259d80c SPIGOT-4669: Fix PlayerTeleportEvent coordinates for relative teleports

Spigot Changes:
e6eb36f2 Rebuild patches
2019-03-20 01:46:00 +00:00
Shane Freeder
a7ba5db3de 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

Please note that this build includes changes to meet upstreams
requirements for nullability annotations. While we aim for a level of
accuracy, these might not be 100% correct, if there are any issues,
please speak to us on discord, or open an issue on the tracker to
discuss.

Bukkit Changes:
9a6a1de3 Remove nullability annotations from enum constructors
3f0591ea SPIGOT-2540: Add nullability annotations to entire Bukkit API

CraftBukkit Changes:
8d8475fc SPIGOT-4666: Force parameter in HumanEntity#sleep
8b1588e2 Fix ExplosionPrimeEvent#setFire not working with EnderCrystals
39a287b7 Don't ignore newlines in PlayerListHeader/Footer

Spigot Changes:
cf694d87 Add nullability annotations
2019-03-20 00:28:15 +00:00
Zach Brown
2b722719b3 Stop loading entity bounding boxes from NBT
This may be creating more issues than it's solving
cc GH-1806
2019-03-15 23:25:32 -04:00
Mark Vainomaa
acdbefc146 Add WhitelistToggleEvent (#1899) 2019-03-13 22:51:42 +02:00
Automated
4fab1deb13 [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:
f802d0a5 Use TestPlugin for ConversationTest
2019-03-08 23:16:44 -05:00
Automated
fd3df8fbd0 [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:
77cbdc61 SPIGOT-4651: MerchantRecipe.setIngredients() allows more than 2 ingredients
2019-03-07 12:36:43 -05:00
Shane Freeder
ab0e7dd082 Revert "Don't update snapshot blockstates" (Fixes #1882)
CraftBukkit already checks that we're not trying to copy data
back to the same snapshot, reverting this fixes the ability to
properly update non-snapshot blockstates
2019-03-07 17:16:39 +00:00
Zach Brown
a663d0d550 Update upstream B/CB
--- work/Bukkit
Submodule work/Bukkit 96e09e50..0b95b68f:
  > SPIGOT-4650: Charging API for Vex

--- work/CraftBukkit
Submodule work/CraftBukkit f102d882..77ca7ca0:
  > Rebuild patches
  > Improve damage handling of dead entities
  > SPIGOT-4646: Test + fix InventoryWrapper.getContents
  > SPIGOT-4650: Charging API for Vex
2019-03-06 00:46:21 -05:00