Commit graph

2907 commits

Author SHA1 Message Date
Aikar
700c900cc3 Fix isCurrentlyRunning for sync tasks
Not sure where this would of ever been used, but for correctness sake.
2018-03-17 13:14:44 -04:00
Aikar
7241626ffd check that a task is valid before executing incase it was cancelled elsewhere
also set runners in the short circuit path so we know of the pending task incase its long running
2018-03-17 12:58:27 -04:00
Aikar
fb8222874d Improved Async Task Scheduler
The Craft Scheduler still uses the primary thread for task scheduling.
This results in the main thread still having to do work as part of the
dispatching of async tasks.

If plugins make use of lots of async tasks, such as particle emitters
that want to keep the logic off the main thread, the main thread still
receives quite a bit of load from processing all of these queued tasks.

Additionally, resizing and managing the pending entries for all of
these asynchronous tasks takes up time on the main thread too.

This commit replaces the implementation of the scheduler when working
with asynchronous tasks, by forwarding calls to the new scheduler.

The Async Scheduler uses a single thread executor for "management" tasks.
The Management Thread is responsible for all adding and dispatching of
scheduled tasks.

The mainThreadHeartbeat will send a heartbeat task to the management thread
with the currentTick value, so that it can find which tasks to execute.

Scheduling of an async tasks also dispatches a management task, ensuring
that any Queue resizing operation occurs off of the main thread.

The async queue uses a complete separate PriorityQueue, ensuring that resize
operations are decoupled from the sync tasks queue.

Additionally, an optimization was made that if a plugin schedules
a single, non repeating, no delay task, that we immediately dispatch it
to the executor pool instead of scheduling it. This avoids an unnecessary
round trip through the queue, as well as will reduce the size growth of the
queue if a plugin schedules lots of asynchronous tasks.
2018-03-16 23:09:51 -04:00
Zach Brown
83d069ba65 [CI-SKIP] macOS filesystem dust made it past gitignore! 2018-03-13 18:43:13 -04:00
Y. Lin
d6a5844fe8 [CI-SKIP] Add vemacs to MIT list (#1043)
Somebody pinged me on Telegram and said I should do this
2018-03-11 14:16:52 -05:00
Aikar
2a34a59149 explicit, not implicit... oops 2018-03-11 14:21:03 -04:00
Aikar
9e35831323 Disable Implicit Network Manager Flushing
This seems completely pointless, as packet dispatch uses .writeAndFlush.

Things seem to work fine without implicit flushing, but incase issues arise,
provide a System property to re-enable it using improved logic of doing the
flushing on the netty event loop, so it won't do the flush on the main thread.

Renable flushing by passing -Dpaper.implicit-flush=true
2018-03-11 14:15:38 -04:00
Brokkonaut
3672d832d4 [CI-SKIP] Add Brokkonaut to MIT list (#1042) 2018-03-11 04:38:50 +01:00
Aikar
af506a11ee Prevent Frosted Ice from loading/holding chunks 2018-03-10 16:33:49 -05:00
Shane Freeder
d0ccbd3161 Return null instead of players location on EnderChests opened by plugins 2018-03-10 20:26:05 +00:00
Shane Freeder
d207b66009 Add OBFHELPER - InventoryEnderChest#getTileEntity 2018-03-10 17:11:51 +00:00
Shane Freeder
3af34bfe45 Fix NPE when getting location from players EnderChest (fixes #1041) 2018-03-10 13:07:40 +00:00
MiniDigger | Martin
12012ab589 Toggleable player crits, helps mitigate hacked clients. (#1040)
This is a port of https://github.com/PaperMC/Paper/blob/ver/1.8.8/Spigot-Server-Patches/0040-Toggleable-player-crits-helps-mitigate-hacked-client.patch
Also adds me to the MIT list.
2018-03-10 05:14:47 +01:00
BillyGalbreath
b36c43bc6b [CI-SKIP] Add BillyGalbreath to MIT list (#1037) 2018-03-09 11:00:48 -06:00
Techcable
d46a2b11b7 [CI-SKIP] Add Techcable to MIT list (#1038) 2018-03-09 09:59:59 -07:00
Shane Freeder
db23ad30cb Fix ItemStack.damage OBFHelper (fixes #1036) 2018-03-08 19:41:00 +00:00
Shane Freeder
ab5b167d08 Update CB/S 2018-03-08 19:36:35 +00:00
Minecrell
1894a7a608 [CI-SKIP] Add Minecrell to MIT list (#1035)
Change email address for some older patches to make it clear that
they are MIT licensed too.
2018-03-08 16:08:21 +01:00
chickeneer
bc19f55565 [CI-SKIP] Add me (chickeneer) to MIT list (#1034) 2018-03-07 21:56:00 -06:00
Aikar
b4c8581812 Fix ProfilePropertyIterator#remove() recursion bug 2018-03-07 21:03:01 -05:00
Jadon Fowler
cb8f0e5674 [CI-SKIP] Add myself to the MIT List (#1032)
I added https://github.com/PaperMC/Paper/blob/master/Spigot-Server-Patches/0141-Toggleable-Elytra-Wall-Damage.patch
a while ago and I'd like to license it under MIT in case someone ever wants to use it for anything.
2018-03-07 12:13:32 -08:00
Gabscap
3c4959439e [CI-SKIP] Add me (Gabscap) to MIT list
And change my used mail address in patch
2018-03-07 13:58:17 +01:00
Shane Freeder
11625293d1 [CI-SKIP] The power of MIT compells me 2018-03-07 12:15:43 +00:00
Shane Freeder
9488fd00fc [CI-SKIP] Merge 'Add me (Mystiflow) to MIT list' 2018-03-07 12:13:50 +00:00
Mark Vainomaa
e4df6ed2cb [CI-SKIP] I (mikroskeem) do MIT licensed contributions to Paper 2018-03-07 09:49:17 +02:00
Mystiflow
388808cc7e [CI-SKIP] Add me (Mystiflow) to MIT list 2018-03-07 04:30:52 +00:00
Black Hole
1cc8a6d8d9 [CI-SKIP] Add me (Black Hole) to MIT list (#1027) 2018-03-07 03:45:43 +01:00
Riley Park
b3a2532662 [ci skip] kashike wears MITtens too 2018-03-06 18:12:30 -08:00
Kyle Wood
a09cbf7989 [CI-SKIP] Add me (Kyle Wood) to MIT list 2018-03-06 19:47:50 -06:00
Daniel Ennis
5ead7691dd Add self to LICENSE as MIT 2018-03-06 20:46:25 -05:00
Zach Brown
8c988cacd7 [CI-SKIP] Clarify project licensing
* THIS IS NOT A RELICENSE *

This commit adds explicit clarification as to the state of this
project's licensing as it has always been. Nothing has changed here.

It also adds a note about how specific authors have chosen to release
their work under a more permissive license. Any past contributors who
want their name added to this list should submit a pull request here.

We will not be adding anyone's names to this list ourselves.
2018-03-06 20:41:03 -05:00
Aikar
66dd61702a Add max-player-auto-save-per-tick setting to spread out saves more
This will force the saves to spread over multiple ticks even when many
players auto save interval is aligned, avoiding spikes on large servers.

Closes #1021
2018-03-04 20:20:27 -05:00
Zach Brown
7c577df97d Update upstream B/CB 2018-03-04 18:32:38 -05:00
Kyle Wood
b2eb1e7f00 Use a more general method of aliasing md5sum
Rather than checking the platform or operating system, simply check if
the command exists. If the check fails, check if the md5 command exists.
If that fails as well, cancel the build script. Otherwise, assign the
alias as before.
2018-02-23 18:58:45 -06:00
Aikar
d39553c217 Rename getOwnerUUID to Tameable#getOwnerUniqueId for consistency
for the @kashike, thanks for adding a server diff to use this name!
2018-02-24 01:16:01 -05:00
Aikar
d285cd8073 Tameable#getOwnerUUID API
This is faster if all you need is the UUID, as .getOwner() will cause
an OfflinePlayer to be loaded from disk.

This method is already implemented on the server, just needed to expose it.
2018-02-24 00:57:03 -05:00
Shane Freeder
cf2f346ccb Update B/CB 2018-02-24 04:03:32 +00:00
Zach Brown
3d54d86de2 Merge pull request #1016 from ShelLuser/master
Allowing Paper to be build on FreeBSD
2018-02-22 10:47:58 -05:00
ShelLuser
f512fe2faa This patch allows Paper to be build on FreeBSD using the paper script. FreeBSD also doesn't have md5sum and uses md5, just like OS X. As such I added an extra check for the presence of FreeBSD. 2018-02-22 11:43:31 +01:00
Aikar
e6af5c897e update url to my repo 2018-02-19 22:35:32 -05:00
Zach Brown
d793872ffd Update parent pom
Switch repos to use HTTPS (@demonwav)
Add destroystokyo public
Add note that screwing with this file sucks
Remove outdated parent
2018-02-18 19:37:12 -05:00
Shane Freeder
f10fedcc19 Update CB 2018-02-18 14:41:40 +00:00
Shane Freeder
ca86dc72f6 Extend Player Interact to cover CommandBlocks (@Phoenix616) 2018-02-18 14:39:02 +00:00
Aikar
1fcba9b26d Ignore AsyncCatcher setting for Command Dispatch, always force sync
Plugins were abusing this to dispatch commands async anyways.

We will no longer check that flag, and force all commands to be ran sync.

Use a different boolean for allowing things go to through on shutdown/restart instead.

Resolves #1004
Resolves #1005
2018-02-15 00:34:58 -05:00
Aikar
c28c88eb35 Fix bug with hopper optimizations when amount > 3 - Closes #1011 2018-02-14 21:30:12 -05:00
Aikar
3d9d0a7227 Optimize Hoppers
- Lots of itemstack cloning removed. Only clone if the item is actually moved
- Return true when a plugin cancels inventory move item event instead of false, as false causes pulls to cycle through all items.
  However, pushes do not exhibit the same behavior, so this is not something plugins could of been relying on.
- Add option (Default on) to cooldown hoppers when they fail to move an item due to full inventory
- Skip subsequent InventoryMoveItemEvents if a plugin does not use the item after first event fire for an iteration
2018-01-18 01:00:51 -05:00
Nikita Rudy
9105e06867 Added options to disable additional ore generation in Mesa and Extreme Hills (#1006) 2018-02-13 03:44:50 +03:00
Shane Freeder
808e2dff16 Update B/CB 2018-02-12 18:04:05 +00:00
Shane Freeder
a95873bd35 Close Structure Window when PlayerInteractEvent is cancelled
This is opened on the client, and so we send a CloseWindow packet
2018-02-11 10:52:04 +00:00
Shane Freeder
26144e31b3 Update B/CB 2018-02-08 10:07:27 +00:00