Commit Graph
100 Commits
Author SHA1 Message Date
Aikar 7daac312a5 Shame on you Mojang
Someone wrote some horrible code that throws a world accessing task
onto the HTTP DOWNLOADER Thread Pool, for an activity that is not even
heavy enough to warrant async operation.

This then triggers async chunk loads!

What in the hell were you thinking?
2017-02-05 19:19:35 -05:00
Aikar c5851f632a Remove CraftScheduler Async Task Debugger
I have not once ever seen this system help debug a crash.
One report of a suspected memory leak with the system.

This adds additional overhead to asynchronous task dispatching
2017-02-05 00:13:28 -05:00
Aikar 36ce1b950a Add more timings to Scheduler and other improvements 2017-02-05 00:13:16 -05:00
Aikar 01e765f886 Add API to get the url in a timing report listener 2017-02-04 23:07:09 -05:00
Aikar 8246be5c3d More improvements to Timings, RCON now is no longer blocking!
Finally made timings accept "Callback style" reports, so plugins
can listen for when the report is done.

Added new Util interfaces, MessageCommandSender and BufferedCommandSender

This restores and improves using RCON to generate timings reports
2017-02-04 22:47:39 -05:00
Aikar adc43dff10 Run timings reports after end of tick
I believe we are getting data corruption by doing it in the middle of the tick, as I was seeing
really odd reports from automated ones vs command ones.

This will break issueing timings over rcon single command mode and getting the report link in the response back

But I will try to restore that (and make RCON no longer cause spikes) soon.

Reports will still generate, just because its async, the RCON connection
will drop if not in terminal mode before its done.
2017-02-04 20:46:27 -05:00
Aikar 9e81fe5059 Cap Entity Collisions - Resolves #577
Limit a single entity to colliding a max of configurable times per tick.
This will alleviate issues where living entities are hoarded in 1x1 pens

This is not tied to the maxEntityCramming rule. Cramming will still apply
just as it does in Vanilla, but entity pushing logic will be capped.

You can set this to 0 to disable collisions.
2017-01-22 18:24:14 -05:00
Aikar 03263ff5df Remove the Vanilla Method Profiler
Spigot rebrought this back after it was removed for years due to the performance hit.

It is unknown if the JIT will optimize it out as effeciently with how it was
added, so we do not want any risk of performance degredation.

Paper has a proper Timings system that makes the Vanilla Method profiler obsolete and inferior.
2017-01-21 02:02:52 -05:00
Aikar 11711a201d Enforce Sync Chunk Unloads
Unloading Chunks async is extremely dangerous. This will force it to main
the same way we handle async chunk loads.
2017-01-07 16:08:16 -05:00
Aikar 24858ab25e Enforce Sync Player Saves
Saving players async is extremely dangerous. This will force it to main
the same way we handle async chunk loads.
2017-01-07 15:48:22 -05:00
Aikar 9bdc25e99b Provide E/TE/Chunk count stat methods
Provides counts without the ineffeciency of using .getEntities().size()
which creates copy of the collections.
2017-01-07 15:27:46 -05:00
Aikar 710f32619e SPIGOT-2989: Use correct Horse Inventory 2017-01-04 21:23:16 -05:00
Aikar d309b6e872 ShulkerBox Dupe Prevention - Fixes #488
This ensures that Shulker Boxes can never drop their contents twice, and
that the inventory is cleared incase it some how also got saved to the world.
2017-01-02 16:49:08 -05:00
Aikar aa074621bd Defensive copy chunk list to avoid "effective CME" - Fixes #313
Lighting operations apparently can load chunks, which will cause an NPE
in the same fashion you would trigger a CME during the chunk iteration.
2017-01-02 14:08:55 -05:00
Aikar 695ba0cbf5 Use alternate constructor for EndGateway - Fixes #563 2017-01-02 11:49:36 -05:00
Aikar beee3cd301 MC-112017: Allow 31 instead of 30 for item names 2017-01-02 02:43:50 -05:00
Aikar 7228b28a1a MC-111699: Ignore Improper Anvil Item Name Packets
The client is improperly sending Item Name Packets to the server BEFORE
the click event. This causes the server to reset before the click event is processed

This breaks the ability to rename more than 1 item at a time.

See: https://bugs.mojang.com/browse/MC-111699
2017-01-02 02:09:31 -05:00
Aikar 3734a3acdb Fix build
I totally didn't notice that the patch had a conflict >_>
2017-01-02 02:05:02 -05:00
Aikar eee4d138dd Update upstream - fixes more Spawn Egg issues 2017-01-02 01:58:15 -05:00
Aikar 0d5ac24919 Remove my copyright headers, copy/pasted 2016-12-31 21:51:49 -05:00
Aikar 3eec7df88a PlayerTeleportEndGatewayEvent
Allows you to access the Gateway being used in a teleport event
2016-12-31 21:46:34 -05:00
Aikar 2c5f074c1d Fix String based Action Bar to use ChatComponent to handle proper escaping 2016-12-29 08:29:09 -05:00
Aikar 04c621bb48 Fix ItemStack Data Conversion
Spigot did not copy our version, and their version is not 100% correct.

The current state results in item meta and damage data value conversions clashing for control

For example on a horse egg, on itemstack creation, the 100 Damage is converted to 0 and sets EntityTag

SetItemMeta then drops the previous NBTTagCompound and makes a new one, which has no EntityType associated
to it as the previous stack had no metadata.

This change makes it so that itemstack conversion is delayed until after meta applies

Pretty much restores our previous implementation before Spigot tried to resolve it.
2016-12-29 07:58:49 -05:00
Aikar 2f831e83cd Change Outdated Build Download URL to Paper CI 2016-12-29 00:57:26 -05:00
Aikar 62d7e84ff0 Vehicle Dismount Event Improvements
player.getVehicle() was returning null during the event. Paper had added lots of code to
cause the player to remount the entity on cancel.

I've simplified the diff and made player.getVehicle() work during the event by setting the
vehicle back during the event, and only set it to null if the event is not cancelled.
2016-12-29 00:53:02 -05:00
Aikar 9db5f4c20a New Firework API's
Get the launcher of a Firework and who it is boosting
2016-12-28 02:25:35 -05:00
Aikar 3967ce4cb3 Activation Range Improvements
Fixes and adds new Immunities to improve gameplay behavior
2016-12-28 00:19:58 -05:00
Aikar 498c673952 Change default Debugging port to avoid conflicts 2016-12-27 16:12:39 -05:00
Aikar 34e0091024 Incremental Auto Save Players
Take same approach we did for chunks, and only save player if its been X time since last save,
instead of doing it all in 1 tick.

This is even more helpful considering Player Saving is done sync for File IO.
2016-12-27 16:11:25 -05:00
Aikar 422dc4fa06 JavaDoc String ActionBar API and Deprecate Component based methods.
The Component based methods are not even safe to use, as it may result in invalid items being sent to the client.

The string based method we have added is the only safe way to send with the API.

The client is stricter about componenents being sent for this API, and does not accept children components.

The client is expecting a legacy string.
2016-12-27 15:20:09 -05:00
Aikar 86925b4446 Change implementation of String based Action Bar API
Appears colors did not work for Bungee version, as Action Bar is stricter
2016-12-27 15:06:14 -05:00
Aikar 352c322914 Upstream update 2016-12-27 13:07:43 -05:00
Aikar 6a3e97e28a Respect AsyncCatcher for Async Command Detection - Fixes #555 2016-12-27 11:00:15 -05:00
Aikar da3827e1c5 Upstream, Fixes #533 2016-12-23 00:55:03 -05:00
Aikar bded01f0f5 continue instead of break for treasure map bounding
per: https://github.com/PaperMC/Paper/commit/a5f9077242fdaba3ae77170383c6cd12a2d82c10#commitcomment-20268968

The break may of been skipping attempts at valid chunks. I thought break was the right abort, but maybe it is not.
2016-12-21 21:28:01 -05:00
Aikar 06e82119e2 IllegalPacketEvent - Resolves #419
Fire an event when an illegal packet is received to let plugins handle it

Lets plugins change the kick message and if it should kick or not.
2016-12-21 21:22:02 -05:00
Aikar daab7ed781 Optimize isEmpty() to remove Map lookup
Every call to .isEmpty() made a horribly wasteful map lookup just to get the
reference to the Air Item for checking.

We will now cache a copy of that item
2016-12-21 04:21:42 -05:00
Aikar c6ffa97c7a Revert "Optimize ItemStack.isEmpty()"
This reverts commit c2b8a4be32.

See a bug
2016-12-21 03:51:48 -05:00
Aikar c2b8a4be32 Optimize ItemStack.isEmpty()
Remove hashMap lookup every check, simplify code to remove ternary
2016-12-21 03:50:43 -05:00
Aikar e0f5d3e1bd Update upstream 2016-12-21 01:40:41 -05:00
Aikar f7f9ba8639 Actually set the ChatPosition 2016-12-20 16:02:05 -05:00
Aikar 252c3ff471 Add String based Action Bar API 2016-12-20 15:56:41 -05:00
Aikar bc72d63bfc Configurable Cartographer Treasure Maps
Allow configuring for cartographers to return the same map location

Also allow turning off treasure maps all together as they can eat up Map ID's
which are limited in quantity.
2016-12-20 15:28:32 -05:00
Aikar a5f9077242 Bound Treasure Maps to World Border
Make it so a Treasure Map does not target a structure outside of the
World Border, where players are not even able to reach.

This also would help the case where a players close to the border, and one
that is outside happens to be closer, but unreachable, yet another reachable
one is in border that would of been missed.
2016-12-20 15:17:18 -05:00
Aikar 4506924566 Ignore invalid Marker Icon ID's in maps - Fixes #497
Replace with the red marker. Should of only happened by creative abuse.
2016-12-19 23:39:52 -05:00
Aikar fff0dc6598 Prevent Pathfinding out of World Border - Fixes #547
This prevents Entities from trying to run outside of the World Border
2016-12-19 23:08:31 -05:00
Aikar 310105c9c0 Update upstream 2016-12-19 22:58:12 -05:00
Aikar e82cdab244 Fix worldborder bug
typo in variable name
2016-12-19 01:23:59 -05:00
Aikar beb2b5b6c1 Update Upstream 2016-12-19 01:23:54 -05:00
Aikar 61526b1029 Optimize World.isLoaded(BlockPosition)Z
Reduce method invocations for World.isLoaded(BlockPosition)Z
2016-12-02 00:20:34 -05:00
Aikar e5b4e80232 Ignore "Unable to resolve BlockEntity" debug messages - Fixes #489 2016-12-02 00:02:18 -05:00
Aikar b1aa7e2ca9 Merge branch 'vemacs-cachedthreadpool-login'
* vemacs-cachedthreadpool-login:
  Cache user authenticator threads Idea from @AlfieC
2016-11-23 11:53:35 -05:00
Aikar 09a8e2f02f Update upstream 2016-11-21 18:00:40 -05:00
Aikar 84a72db135 Upstream update again 2016-11-19 00:16:42 -05:00
Aikar 7d73fa7ae0 Update Upstream 2016-11-18 23:58:56 -05:00
Aikar 8f3325047c Re-add dependency reduced pom
Learned the correct way to handle that file
2016-11-18 21:09:03 -05:00
Aikar 0ba0ac4910 update my repo url 2016-11-12 00:01:34 -05:00
Aikar 1d9fc7dfc2 Chunk Save Stats Debug Option
Adds a command line flag to enable stats on how chunk saves are processing.

Stats on current queue, how many was processed and how many were queued.
2016-11-04 02:21:33 -04:00
Aikar 3732877c5c Rework that save cap patch and make it configurable 2016-11-04 01:55:36 -04:00
Aikar e9542e33fd Don't process auto save if the save queue is filled
This avoids ever growing pending NBT objects which eat up memory.
2016-11-04 01:33:08 -04:00
Aikar 5fe1de30c9 Prevent Hoppers from loading chunks by double chest 2016-11-04 01:32:53 -04:00
Aikar c15001e24d Fix faulty logic in Auto Save check - Fixes #443 2016-11-04 01:31:49 -04:00
Aikar 4708920d8d Updated Timings to better detail saves 2016-10-20 00:21:35 -04:00
Aikar 59eb1231b5 Revert "Option to hide plugins from the Query Protocol"
This already exists

This reverts commit d6a9c326c7.
2016-10-19 23:38:18 -04:00
Aikar d6a9c326c7 Option to hide plugins from the Query Protocol 2016-10-19 23:37:14 -04:00
Aikar c59127a587 Disable Vanilla Chunk GC in favor of Bukkits 2016-09-26 01:52:01 -04:00
Aikar e081f311cb don't save level every tick for auto save. whoops 2016-09-26 01:50:26 -04:00
Aikar 731f141042 Raise string limit for packet serialization
The default limit is possible to hit with 50 page books with color codes, causing clients to disconnect.

Bump the limit up a hair to above currently seen sizes.
2016-09-21 23:56:41 -04:00
Aikar 663fbf798e Auto fix bad Y levels on player login
Bring down to a saner Y level if super high, as this can cause the server to crash
2016-09-21 23:49:27 -04:00
Aikar 59b9ad36e6 Remove FishingHook reference on Craft Entity removal
This caused some bugs chickeneer reported to me, with fishing.
2016-09-21 23:45:05 -04:00
Aikar d330ae5050 Process NMS Data Conversion post ItemMeta on Copy
ItemMeta apply is a destructive process that expects to be the authority on
what the items NBT data is.

When CraftItemStack.asNMSCopy was called, the conversion ran, potentially setting
the converted data into the ItemStacks tag.

Then if that item had ItemMeta, it would completely undo that conversion by
erasing the NBT Tag.

On copy, run conversion post ItemMeta apply.
2016-09-21 23:42:13 -04:00
Aikar cc1f66ce0e add a chunk registration fix
World checks and the Chunk Add logic are inconsistent on how Y > 256, < 0, is treated

Keep them consistent
2016-09-21 22:56:19 -04:00
Aikar 77825c2a60 Log chunk save failures as ERROR level 2016-09-21 22:33:09 -04:00
Aikar 6c7ea0b67a Auto Save Improvements
Makes Auto Save Rate setting configurable per-world. If the auto save rate is left -1, the global bukkit.yml value will be used.

Process auto save every tick instead of once per auto tick interval, so that chunk saves will distribute over many ticks instead of all at once.

Re-introduce a cap per tick for auto save (Spigot disabled the vanilla cap) and make it configurable.
2016-09-21 22:12:56 -04:00
Aikar 7c6d0644a2 Don't save players every tick, oops 2016-09-19 23:39:21 -04:00
Aikar f18f712da2 Incremental Auto Saving
Process auto save every tick instead of once per auto tick interval, so that chunk saves will distribute over many ticks instead of all at once.
2016-09-19 23:31:42 -04:00
Aikar f919bc9732 fix order of mc dev imports 2016-08-30 18:54:03 -04:00
Aikar 086939fe19 Timings v2 updates for more chunk related timings (generations) 2016-08-20 00:07:26 -04:00
Aikar 6b24c4cfde Timings v2: confirm before reset. Add delays before report generation
Require user to confirm the timings reset, warning them that they should not be doing this.
Also require Timings to have ran for 3 minutes before allowing the report command.
Also require 1 minute intervals between reports to stop report spam.
2016-08-19 23:42:38 -04:00
Aikar 0c18db0e44 Upstream burritos, maybe tacos, and churros. 2016-07-08 00:17:25 -04:00
Aikar 122f47ac1c More Upstream tacos 2016-06-30 01:38:53 -04:00
Aikar 869b06ea1e Timings v2 cleanups - potential overflow fix and fix bad hostnames
if hostname is invalid on system, just use a static string

also cleans up visibility of a lot of code, hopefully will help jvm optimize more.
2016-06-30 01:31:00 -04:00
Aikar cb334f6321 Upstream tacos 2016-06-30 01:23:30 -04:00
Aikar 997285e344 Update Entity AddTo|RemoveFrom World events to be EntityEvents 2016-06-24 00:16:46 -04:00
Aikar ba61e44475 Fix Old Sign Conversion
1) Sign loading code was trying to parse the JSON before the check for oldSign.
       That code could then skip the old sign converting code if it triggers a JSON parse exception.
    2) New Mojang Schematic system has Tile Entities in the new converted format, but missing the Bukkit.isConverted flag
       This causes Igloos and such to render broken signs. We fix this by ignoring sign conversion for Defined Structures
2016-06-22 22:56:57 -04:00
Aikar faa5f1fb18 Fix Double World Add issues - Fixes #328
Vanilla will double add Spider Jockeys to the world, so ignore already added.

Also add debug if something else tries to, and abort before world gets bad state
2016-06-22 22:50:19 -04:00
Aikar 6463bc2fe2 Optimize isInvalidYLocation, getType and getBlockData
Some pretty micro optimizations, but this is the hottest method in the server....

This will drastically reduce number of operations to perform getType

the 2 previous patches was squashed into 1
2016-06-22 22:43:02 -04:00
Aikar 03553d232e Update upstream 2016-06-22 22:18:41 -04:00
Aikar 284e2f4856 Delay Chunk Unloads based on Player Movement
When players are moving in the world, doing things such as building or exploring,
they will commonly go back and forth in a small area. This causes a ton of chunk load
and unload activity on the edge chunks of their view distance.

A simple back and forth movement in 6 blocks could spam a chunk to thrash a
loading and unload cycle over and over again.

This is very wasteful. This system introduces a delay of inactivity on a chunk
before it actually unloads, which is maintained separately from ChunkGC.

This allows servers with smaller worlds who do less long distance exploring to stop
wasting cpu cycles on saving/unloading/reloading chunks repeatedly.
2016-06-18 23:33:57 -04:00
Aikar 76ccb4c5f0 Remove the item from the correct hand when spawn egg depletes 2016-06-18 03:44:11 -04:00
Daniel Ennis 290af99931 Merge pull request #340 from phase/master
Fix infinite loop when saving chunks
2016-06-17 18:56:51 -04:00
Aikar c9bf3f3819 Fix issue with chests being erased - #322 Fixed 2016-06-07 03:03:51 -04:00
Aikar 85df861eda more chunk unload queue fixes, hopefully fix various odd bugs 2016-06-07 02:08:59 -04:00
Aikar 49c8b34653 Fix bug with lootable refresh not saving inventory if on 2016-06-06 19:56:51 -04:00
Aikar fbcd3ce763 Add sub timings to chunk map 2016-06-05 00:10:50 -04:00
Aikar e18cef3e72 remove part of my hopper patch, not sure its doing what I intended 2016-06-04 11:52:25 -04:00
Aikar ec95eb86f7 Update Upstream 2016-06-04 11:41:04 -04:00
Aikar ba0a4c75bd Only send Dragon/Wither Death sounds to same world
Also fix view distance lookup
2016-05-31 23:56:19 -04:00
Aikar a9ec7b3a75 Fix skeleton horse spawn chance ignoring difficulty modifier if custom set
Also reduce diff
2016-05-30 12:50:57 -04:00
Aikar d9971432c2 re-add timing that spigot missed 2016-05-27 22:29:09 -04:00