Commit Graph
100 Commits
Author SHA1 Message Date
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
Aikar e6af5c897e update url to my repo 2018-02-19 22:35:32 -05: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
Aikar 79e1eb906f Remove warning for custom entities in precreaturespawn, add note to event
We can't fix this. The event will simply not fire for hacky plugins replacing
entity registrations.
2018-01-28 22:50:35 -05:00
Aikar 66e439e381 improve Profile Fill Events early return logic - #997 2018-01-28 19:40:19 -05:00
Aikar d69bbb5126 MC-99321 - Dont check for blocked double chest for hoppers etc
This is a source of MAJOR lag for hoppers, as well as a gameplay bug.

This removes the necessity to disable the cat on chest behavior to improve performance.

now performance will be improved even if you have cat chest detection on.
2018-01-24 20:08:58 -05:00
Aikar 5671bb65b6 Fix build due to IDE inserting bad import 2018-01-21 14:12:54 -05:00
Aikar 8d654f26d3 Make PlayerProfile.getProperties mutable
Most other collections returned like this is mutable, lets be consistent.
2018-01-21 14:09:09 -05:00
Aikar 8ed1cbe0fb Update upstream 2018-01-21 14:03:55 -05:00
Aikar 0d9f8672b1 Fill Profile Property Events
Allows plugins to populate profile properties from local sources to avoid calls out to Mojang API
to fill in textures for example.

If Mojang API does need to be hit, event fire so you can get the results.

This is useful for implementing a ProfileCache for Player Skulls
2018-01-19 00:55:38 -05:00
Aikar e06cc30ff7 Add SkullMeta.setPlayerProfile API
This allows you to create already filled textures on Skulls to avoid texture lookups
which commonly cause rate limit issues with Mojang API
2018-01-19 00:38:49 -05:00
Aikar d065e0b00e Move ProfileWhitelistVerifyEvent to use new PlayerProfile API
Also update javadocs on lookup events to link the new methods to use
2018-01-19 00:12:03 -05:00
Aikar 17bec29ef0 Update Profile Lookup Events to use new PlayerProfile API 2018-01-19 00:03:09 -05:00
Aikar a7da447b88 Add PlayerProfile API to replace GameProfile
This simply provides the base API to create the objects. Further commits will come that adds
adds usage of this API to existing GameProfile based API's, as well as new API's.
2018-01-15 22:13:17 -05:00
Aikar 8e612cbc0a Check for missing EntityType for PreCreatureSpawnEvent - Resolves #973 2018-01-15 23:44:21 -05:00
Aikar 093629c1f2 Fix "unlimited" max chunk gens per tick setting
hopefully tried to set it to be unlimited in the first place....
2018-01-15 23:43:46 -05:00
Aikar 70f7748553 PlayerNaturallySpawnCreaturesEvent
This event can be used for when you want to exclude a certain player
from triggering monster spawns on a server.

Also a highly more effecient way to blanket block spawns in a world
2018-01-14 17:36:24 -05:00
Aikar 5a2b8d5cdc Move definition of fields up 2018-01-14 17:15:27 -05:00
Aikar 2e05bc73b3 PreCreatureSpawnEvent - Closes #917
Adds an event to fire before an Entity is created, so that plugins that need to cancel
CreatureSpawnEvent can do so from this event instead.

Cancelling CreatureSpawnEvent rapidly causes a lot of garbage collection and CPU waste
as it's done after the Entity object has been fully created.

Mob Limiting plugins and blanket "ban this type of monster" plugins should use this event
instead and save a lot of server resources.

See: https://github.com/PaperMC/Paper/issues/917
2018-01-14 17:02:38 -05:00
Aikar 241f7f59d8 update upstream for spigot-3764 fix 2018-01-14 16:15:56 -05:00
Aikar 4a97e9c309 Fix SPIGOT-3764 - Fixes deadlock with Skull Owner changes 2018-01-13 12:29:50 -05:00
Aikar a101fadf4f upstream update 2018-01-01 20:09:39 -05:00
Aikar 580ae44414 Configurable Max Chunk Gens per Tick
Limit the number of generations that can occur in a single tick, forcing them
to be spread out more.

Defaulting to 10 as an average generation is going to be 3-6ms, which means 10 will
likely cause the server to lose TPS, but constrain how much.

This should result in no noticeable speed reduction in generation for servers not
lagging, and let larger servers reduce this value according to their own desires.
2018-01-01 16:38:34 -05:00
Aikar 661d97b76d Configurable Chunks Sends per Tick setting
Vanilla already had this limited, make it configurable.

Limit how much exploration lags the server
2018-01-01 16:36:23 -05:00
Aikar 31aa97180b Update Upstream 2018-01-01 16:29:33 -05:00
Aikar c3791a5225 Ability to apply mending to XP API
This allows plugins that give players the ability to apply the experience
points to the Item Mending formula, which will repair an item instead
of giving the player experience points.

Both an API To standalone mend, and apply mending logic to .giveExp has been added.
2017-12-20 17:50:26 -05:00
Aikar 4f6b49e007 Always copy completions for #setCompletions in Tab Complete Events
Per feedback on 6364cb2
2017-12-20 01:09:54 -05:00
Aikar 8665021cdb ExperienceOrbMergeEvent
Fired when the server is about to merge 2 experience orbs
Plugins can cancel this if they want to ensure experience orbs do not lose important
metadata such as spawn reason, or conditionally move data from source to target.
2017-12-19 22:57:46 -05:00
Aikar 0968270200 Make PlayerPickupExperienceEvent extend PlayerEvent 2017-12-19 22:08:28 -05:00
Aikar ac0ae12415 PlayerPickupExperienceEvent
Allows plugins to cancel a player picking up an experience orb
2017-12-19 22:05:16 -05:00
Aikar 1f44d0b82b Auto sort enchants on items - Fixes #915
This ensures that enchants are never added in inconsistent order.
The client shows the enchants in a sorted order already

This will auto fix previously created items too on load.
2017-12-19 17:56:13 -05:00
Aikar 6364cb2591 AsyncTabCompleteEvent shouldn't store Immutable Lists 2017-12-19 16:52:53 -05:00
Aikar db3cc65511 ExperienceOrbs API for Reason/Source/Triggering player
Adds lots of information about why this orb exists.

Replaces isFromBottle() with logic that persists entity reloads too.
2017-12-19 16:46:27 -05:00
Aikar 7cc544d715 Add World#createExplosion(Location, float, boolean, boolean) API
don't know why this API was missing
2017-12-19 16:25:38 -05:00
Aikar 3d71965eb8 Update upstream 2017-12-17 01:34:54 -05:00
Aikar 602a6e2bee SPIGOT-3699: Fix cloning banner itemstacks
the banner meta would end up with a shared reference to the patterns
2017-12-15 15:57:15 -05:00
Aikar fa254542bc Display warning on deprecated recipe API
Any plugin still using this API will result in the server saving an inconsistent UUID to player data files,
which then triggers warnings such as "Tried to load unrecognized recipe: bukkit:9e5b92f5-e549-4f47-b0a8-9f89390ed77b removed now."
on the players login.

Plugin authors need to define a key to keep it consistent between server restarts.
2017-12-09 12:42:11 -05:00
Aikar 036910d741 add latest copy of my apatch to the repo for easy access 2017-12-09 12:37:31 -05:00
Aikar 0ef74cf264 Update upstream 2017-12-09 12:37:09 -05:00
Aikar f854342c1b Fix AsyncTabCompleteEvent not setting isCommand 2017-11-29 23:36:31 -05:00
Aikar 93477a5b68 Avoid NPE in PathfinderGoalTempt 2017-11-29 22:19:24 -05:00
Aikar f7f8c59f60 AsyncTabCompleteEvent
Let plugins be able to control tab completion of commands and chat async.

This will be useful for frameworks like ACF so we can define async safe completion handlers,
and avoid going to main for tab completions.

Especially useful if you need to query a database in order to obtain the results for tab
completion, such as offline players.

Also adds isCommand and getLocation to the sync TabCompleteEvent
2017-11-26 22:05:48 -05:00
Aikar 584a612fc0 API to get a BlockState without a snapshot
This allows you to get a BlockState without creating a snapshot, operating
on the real tile entity.

This is useful for where performance is needed
2017-11-24 07:28:57 +00:00
Aikar 1f4f072193 Update CB Upstream 2017-11-12 18:53:38 -05:00
Aikar 64fdf06f84 Use <= instead of < for structure patch
Thankfully I randomly think about code and randomly wondered if I used <= or < here, and caught this!

This would of missed some chunks for the structure at the highest X/Z
2017-11-12 18:51:10 -05:00
Aikar 41afad51da Improve Structures Checking
Improves performance by keying every chunk thats part of a structure to a hashmap
instead of only the first one.

This allows us to avoid iterating the entire structures value set to see
if a block position is inside of a structure.

This should have pretty decent performance improvement to any standard world
that has been around for a whilewith lots of structures due to ineffeciencies
in how MC stores structures (even unloaded chunks has structured data loaded)
2017-11-11 18:47:30 -05:00
Aikar 68b6b07086 World can be null for sign conversion, fixes #886 2017-09-18 21:03:45 -04:00
Aikar 64b2b87256 Upstream update 2017-08-07 23:05:16 -04:00
Aikar 489fda430a Update Upstream 2017-07-30 18:41:08 -04:00
Aikar b4131ee68f Further refine logic 2017-07-28 00:04:01 -04:00
Aikar 8ff15ca2af ProfileWhitelistVerifyEvent
Fires when the server is validating if a player is whitelisted.

Allows you to do dynamic whitelisting and change of kick message
2017-07-27 23:39:31 -04:00
Aikar 8d26bacb73 Fix a bug in recipe books that prevented them from working as they should 2017-07-27 03:13:13 -04:00
Aikar 89ff242bd4 Remove use of FastUtil for unload queue, very bad performance 2017-07-27 00:25:13 -04:00
Aikar 337e7791a6 Resolves GH-806: Respect saving disabled before unloading all chunks in a world
This behavior causes a save to occur even though saving was supposed to be turned off.

It's triggered when Hell/End worlds are empty of players.
2017-07-27 00:09:24 -04:00
Aikar 5495450456 Add getI18NDisplayName API
Gets the Display name as seen in the Client.
Currently the server only supports the English language. To override this,
You must replace the language file embedded in the server jar.
2017-07-26 23:44:09 -04:00
Aikar 5617a28291 Implement ensureServerConversions API
This will take a Bukkit ItemStack and run it through any conversions a server process would perform on it,
to ensure it meets latest minecraft expectations.
2017-07-26 23:40:49 -04:00
Aikar cab448bd32 Improve the Saddle API for Horses
Not all horses with Saddles have armor. This lets us break up the horses with saddles
and access their saddle state separately from an interface shared with Armor.
2017-07-26 23:31:58 -04:00
Aikar 4265551308 Upstream update 2017-07-26 21:12:40 -04:00
Aikar ca512353fc Remove last patch, didn't resolve issue. 2017-07-16 20:59:39 -04:00
Aikar 892fca2c4c SPIGOT-3427: Recalculate ConsoleSender permissions after plugins have loaded
Resolves a really weird race condition where the console sender could lose permission to execute
commands defined in plugin.yml with default=op
2017-07-16 20:41:30 -04:00
Aikar a289bd5949 Update upstream (memory leak fix) 2017-07-16 20:36:27 -04:00
Aikar 3ecd084ba8 Fix Anvil Level sync to client
https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/commits/763827668e6e5cddc111f3c93a0d718fec21ff51

Was done incorrectly and is now causing level desyncs to client.

Always send current level to the client, and instead make setWindowProperty set the level.
2017-07-11 23:23:17 -04:00
Aikar 61bbe8c3b3 Update upstream 2017-06-30 18:13:06 -05:00
Aikar 70d35b0de5 Update upstream, pretty important bug fix 2017-06-25 21:49:36 -04:00
Aikar 46e300045a Update upstream 2017-06-25 20:26:00 -04:00
Aikar b8fb29dc77 SPIGOT-3381: Alias SWEEPING to SWEEPING_EDGE 2017-06-25 19:40:06 -04:00
Aikar fe6fa3846a Update upstream 2017-06-22 23:14:20 -04:00
Aikar 95ae0890a6 Allow plugins to override Vanilla commands with aliases
Spigot broke this in 1.12, re-adding the logic back
2017-06-20 18:59:23 -04:00
Aikar 104b4ec3ae Fix Lootable bug 2017-06-20 18:59:18 -04:00
Aikar 285746c465 update upstream 2017-06-20 18:53:55 -04:00
Aikar 43e2c9c48c Profile Lookup Events
Adds a Pre Lookup Event and a Post Lookup Event so that plugins may prefill in profile data, and cache the responses from
profiles that had to be looked up.
2017-06-17 17:15:25 -04:00
Aikar 60177fdfaf Shoulder Entities Release API
Let's you eject the Parrot naturally and get the newly spawned Parrot.
2017-06-17 15:20:25 -04:00
Aikar a22ed886b5 upstream update 2017-06-10 13:14:52 -04:00
Aikar e68554e5c6 Update upstream 2017-06-09 08:29:44 -04:00
Aikar f73ec445b6 Update test server JVM flags. Bad me not even using my own flags! 2017-05-17 22:51:42 -04:00
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