Commit Graph

3087 Commits

Author SHA1 Message Date
Aikar
f229e2c798 Optimize Hoppers 2018-01-18 01:00:27 -05:00
Zach Brown
0347d9b819 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 addition should serve a
starting point for future additions in this area.
2018-01-27 17:06:24 -05:00
Aikar
bfdd7ccc77 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-02 00:31:08 -05:00
BillyGalbreath
6535733e66 Add PlayerAdvancementCriterionGrantEvent
Co-authored-by: The456gamer <the456gamer@the456gamer.dev>
2018-01-19 08:15:14 -06:00
Aikar
142b065979 Add setPlayerProfile API for Skulls
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:29:28 -05:00
Aikar
b1e4edb712 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:31:37 -05:00
Aikar
d1f7f3a5ae PreCreatureSpawnEvent
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 16:59:43 -05:00
Aikar
8bfc474fb4 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:38:07 -05:00
Aikar
bb15855d47 ExperienceOrb merging/stacking API
Adds 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.

Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
2017-12-19 22:56:24 -05:00
Aikar
bef438ad25 PlayerPickupExperienceEvent
Allows plugins to cancel a player picking up an experience orb
2017-12-19 22:00:41 -05:00
Aikar
332152c40d 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:40:25 -05:00
Minecrell
5de53af38b Expose client protocol version and virtual host
Add a NetworkClient interface that provides access to:
  - The socket address
  - The protocol version
  - The virtual host (the hostname/port the client used to connect
    to the server)
2017-10-10 18:44:42 +02:00
Jason Penilla
7132df4810 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 Enforces mutability of the existing TabCompleteEvent.

Co-authored-by: Aikar <aikar@aikar.co>
2017-11-26 13:17:09 -05:00
Aikar
8306cc5b4f 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-06 21:10:01 -05:00
pkt77
74e0518b1a Add PlayerArmorChangeEvent 2017-11-10 23:45:59 -05:00
Minecrell
c85ea66260 Add workaround for plugins modifying the parent of the plugin logger
Essentials uses a custom logger name ("Essentials") instead of the
plugin logger. Log messages are redirected to the plugin logger by
setting the parent of the "Essentials" logger to the plugin logger.

With our changes, the plugin logger is now also called "Essentials",
resulting in an infinite loop. Make sure plugins can't change the
parent of the plugin logger to avoid this.
2017-09-21 19:41:20 +02:00
Zach Brown
bb09886459 Add PlayerJumpEvent 2017-09-28 17:21:32 -04:00
Minecrell
31a575f5f7 Handle plugin prefixes in implementation logging configuration
Currently, plugin prefixes are prepended to the log message in
the PluginLogger before passing the message to the underlying
logging framework. This is bad design because they need to be
stripped manually when using custom appenders to log messages
in a different format.

Additionally, it makes integration of alternative logging APIs hard
because all logging must go through the PluginLogger. Avoid using
PluginLogger and create a regular logger using the plugin name.
The implementation should handle plugin prefixes by displaying
logger names when appropriate.
2017-09-21 16:14:13 +02:00
Minecrell
1caeaef01d Allow plugins to use SLF4J for logging
SLF4J is a commonly used abstraction for various logging frameworks
such as java.util.logging (JUL) or Log4j. Currently, plugins are
required to do all their logging using the provided JUL logger.
This is annoying for plugins that target multiple platforms or when
using libraries that log messages using SLF4J.

Expose SLF4J as optional logging API for plugins, so they can use
it without having to shade it in the plugin and going through
several layers of logging abstraction.
2017-09-21 16:33:12 +02:00
Aikar
9dc2eb6be7 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-03 18:11:34 -05:00
BillyGalbreath
eb5ae9c077 LivingEntity#setKiller 2017-07-31 01:49:43 -05:00
Aikar
8df1d2656c 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.
2016-05-04 23:55:48 -04:00
Aikar
221abecc78 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.
2016-05-04 23:55:48 -04:00
Aikar
9895d6c5c3 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.
2016-12-10 16:12:48 -05:00
Aikar
48d1719745 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 16:30:44 -04:00
BillyGalbreath
7bde46eefa Entity#fromMobSpawner() 2017-06-18 18:17:05 -05:00
Aikar
705daba3f5 Shoulder Entities Release API 2017-06-17 15:04:51 -04:00
BillyGalbreath
f5829fec2e PlayerPickupItemEvent#setFlyAtPlayer 2017-05-07 06:26:01 -05:00
Aikar
ccd4375fa5 Basic PlayerProfile API
Provides basic elements of a PlayerProfile to be used by future API/events
2018-01-15 21:46:46 -05:00
Sweepyoface
95384179d4 Add UnknownCommandEvent 2017-06-17 18:48:06 -04:00
BillyGalbreath
915a67d444 PlayerAttemptPickupItemEvent 2017-06-11 16:30:37 -05:00
BillyGalbreath
9dc1cc8212 Item#canEntityPickup 2017-05-05 03:57:08 -05:00
Zach Brown
0c37d20354 Fix upstream javadocs 2017-06-10 16:59:40 -05:00
Riley Park
f7eff332be Add configuration option to prevent player names from being suggested 2017-06-09 07:24:24 -07:00
Aikar
f0d3438c11 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:28:32 -05:00
Aikar
204f5daef7 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:23:03 -05:00
Aikar
5c20ef4c6b PlayerTeleportEndGatewayEvent
Allows you to access the Gateway being used in a teleport event
2016-12-31 20:29:33 -05:00
Aikar
d84384e895 Fireworks API's
Get the Entity being boosted
Get the firework launcher
2016-12-28 01:18:55 -05:00
Aikar
75274808b6 IllegalPacketEvent
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-04 01:19:14 -05:00
Riley Park
614404fa55 Add API methods to control if armour stands can move 2016-12-21 11:47:25 -06:00
Aikar
e5e56e1ee1 Add String based Action Bar API 2016-12-20 15:55:55 -05:00
Techcable
8da0c13f67 Add ProjectileCollideEvent
Now deprecated and replaced with ProjectileHitEvent
2016-12-16 21:25:39 -06:00
AlphaBlend
df6649ed5d Add source to PlayerExpChangeEvent 2016-09-08 08:47:08 -07:00
willies952002
55dc3ff664 Allow Reloading of Command Aliases
Reload the aliases stored in commands.yml
2016-11-28 10:16:39 -05:00
vemacs
2b323743b6 Misc Utils 2016-11-23 12:53:43 -05:00
AlphaBlend
4d7ecbdb78 Add EntityZapEvent 2016-10-16 23:19:34 -07:00
Aikar
397d3cac4b LootTable API
Provides API to control what Loot Table an object uses.

Also provides an Event to control if a lootable inventory should
auto replenish for a player.

Provides methods to determine players looted state for an object
2016-05-01 15:19:49 -04:00
Zach Brown
391451207f EntityRegainHealthEvent isFastRegen API 2016-04-22 01:43:11 -05:00
Jedediah Smith
bcd6aecdab Arrow pickup rule API 2016-03-04 03:13:18 -05:00
Riley Park
21575c024f Add handshake event to allow plugins to handle client handshaking logic themselves 2016-04-13 20:20:18 -07:00