Commit graph

1077 commits

Author SHA1 Message Date
Zach Brown 731eab80ed
Fix ArmorStand Item serialization
Broken in 09182f737d
2018-02-01 22:24:37 -05:00
Aikar 9b1ada78c9
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 a485501ce4
improve Profile Fill Events early return logic - #997 2018-01-28 19:40:19 -05:00
Zach Brown 09182f737d
Add ArmorStand Item Meta
This is adds basic item meta for armor stands. It does not add all
possible metadata however.

There are armor, hand, and equipment types, as well as position data
that can also be added here. This initial implementation should serve as
a starting point for future additions in this area.

Fixes GH-559
2018-01-27 20:40:42 -05:00
Zach Brown f28f199099
Make push based hoppers imitate vanilla bounds
This is vanilla behavior https://i.imgur.com/zMIpRcQ.png
So we have to allow that sort of thing.

Fixes GH-993
2018-01-26 21:28:34 -05:00
Aikar 388f0e1001
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
Shane Freeder 212a6811db
Update B/CB 2018-01-24 17:31:43 +00:00
Aikar 845fcb7bd7
Fix build due to IDE inserting bad import 2018-01-21 14:12:54 -05:00
Aikar 8173d569d6
Make PlayerProfile.getProperties mutable
Most other collections returned like this is mutable, lets be consistent.
2018-01-21 14:09:41 -05:00
BillyGalbreath 4d7c516cb4 PlayerAdvancementCriterionGrantEvent (#978) 2018-01-21 13:23:34 -05:00
Aikar 5b72a03bcf
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 f193fdb1ab
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 531981a1cc
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 18e3bf685c
Update Profile Lookup Events to use new PlayerProfile API 2018-01-19 00:03:09 -05:00
Aikar 71c18fd5c9
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-18 23:19:30 -05:00
Aikar 2f0e48c89a
Check for missing EntityType for PreCreatureSpawnEvent - Resolves #973 2018-01-15 23:44:21 -05:00
Aikar d5023110eb
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 6068eb129f
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 b98f8232e8
Move definition of fields up 2018-01-14 17:15:27 -05:00
Aikar 6a5948b316
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:12:13 -05:00
Aikar 7c60dbe814
update upstream for spigot-3764 fix 2018-01-14 16:15:56 -05:00
Aikar 4886fbd3cc
Fix SPIGOT-3764 - Fixes deadlock with Skull Owner changes 2018-01-13 12:29:50 -05:00
Zach Brown e6f92aecf3
Re-add config option for max squid spawn height
Apparently not only do people actually use it, but upstream missed it.
2018-01-11 16:50:27 -06:00
Zach Brown d8c81d20d8
Update upstream B/CB/S 2018-01-10 23:31:19 -06:00
Zach Brown 7c27a2af9c
Update patches that slipped through last 2018-01-05 01:30:03 -06:00
Zach Brown 06818d2dd7
Update upstream CB/S 2018-01-05 00:46:00 -06:00
Zach Brown fc911a20f5
Update upstream B/CB/S 2018-01-04 02:04:31 -06:00
Aikar 13b35536ce
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 baeb737366
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 c3432c8d29
Update Upstream 2018-01-01 16:29:33 -05:00
Zach Brown eb0f5adfdc
Update upstream B/CB/S 2017-12-27 22:45:33 -06:00
Shane Freeder c79d824fcd
Provide a system property to set the keepalive limit
add a system property to allow people to tweak how long the server
will wait for a reply. There is a compromise here between lower and higher
values, lower values will mean that dead connections can be closed sooner,
whereas higher values will make this less sensitive to issues such as spikes
from networking or during connections flood of chunk packets on slower clients,
at the cost of dead connections being kept open for longer.
2017-12-24 13:44:41 +00:00
Zach Brown 34731dd04e
Restructure lighting queue runnable handling
Instead of overriding add within the queue, never add runnables to the
queue if the light queue is disabled.

This change is made to make timings reports and stacktraces less
confusing for administrators, who prior to this change, would have seen
the lighting queue referenced in both, regardless of whether or not it
was enabled.

This change should not affect performance, nor is it made with the
intent to.
2017-12-22 15:25:01 -06:00
Aikar fc194dfaae
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 46394cb8b0
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 9f204c2a91
PlayerPickupExperienceEvent
Allows plugins to cancel a player picking up an experience orb
2017-12-19 22:05:16 -05:00
Aikar 2603e833f7
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 c208d652b4
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
Shane Freeder fa204e45f9
Don't blindly send unlit chunks when lighting updates are allowed
Spigot, by default, disables several mechanisms around how chunks are
lit, if ever, which has forced them to always send chunks before vanilla
would consider them ready to send, causing for lots of issues around
lighting glitches.

Shamefully, the amount of work to relight chunks can be detremental
to some servers, meaning that forcibily disabling light updates can
cause major performance issues.

as such, we make a compromise; if this "feature" is disabled, we will
only send chunks which are actually ready to be sent, otherwise, we
will always send chunks.
2017-12-18 07:37:50 +00:00
Shane Freeder 0f97922ebd
Restore broken lighting logic from spigot 2017-12-18 07:35:42 +00:00
Aikar 099911fbd1
Update upstream 2017-12-17 01:34:54 -05:00
Aikar b8833f477c
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 ad40e694a3
Update upstream 2017-12-09 12:37:09 -05:00
Shane Freeder a693cb21ab
Update B/CB/S 2017-12-05 01:34:10 +00:00
Aikar 70caa048a8
Fix AsyncTabCompleteEvent not setting isCommand 2017-11-29 23:36:31 -05:00
Aikar b02a8b65df
Avoid NPE in PathfinderGoalTempt 2017-11-29 22:19:24 -05:00
Shane Freeder f0e225b526
Fix ClassCastException in tabCompletor (fixes #942) 2017-11-27 16:52:32 +00:00
Aikar 147081d0ff
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
Shane Freeder f4e9f4737f
Do not use a snapshot for hoppers
In 1.12, Spigot improved their blockstate implementation to take a full
copy of the TE, this allows for a much better snapshot in that it will
actually retain all of the TE's state, it is a much more expensive
implementation. This is also implicated with their backwards compat
for inventories meaning that accessing of a snapshots inventory of a
placed block will actually access the inventory of the live TE, making
creation of a snapshot redundant if the only intent is to interact with
the TEs inventory.

Hoppers are a horrible hit, every attempt to transfer an ItemStack will
result in two TileEntity snapshots, with two hoppers and a double chest
ontop, I managed to log 380 cases per second where a snapshot would have been
taken in cases where the snapshot is redundant.
2017-11-25 17:39:31 +00:00
Aikar 79f57aa18c
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