Commit Graph

3103 Commits

Author SHA1 Message Date
Aikar
9970e9dfde WitchThrowPotionEvent
Fired when a witch throws a potion at a player
2018-05-16 20:39:09 -04:00
Aikar
045c3d85fe WitchConsumePotionEvent
Fires when a witch consumes the potion in their hand
2018-05-16 20:26:16 -04:00
Aikar
4be5a9c1a7 EndermanAttackPlayerEvent
Allow control over whether or not an enderman aggros a player.

This allows you to override/extend the pumpkin/stare logic.
2018-05-01 20:17:44 -04:00
Aikar
2a57740d34 Expand World.spawnParticle API and add Builder
Adds ability to control who receives it and who is the source/sender (vanish API)
the standard API is to send the packet to everyone in the world, which is ineffecient.

This adds a new Builder API which is much friendlier to use.
2017-08-29 23:58:48 -04:00
Aikar
623c56ab78 Location.isChunkLoaded() API 2018-04-30 19:27:31 -04:00
Aikar
f8d5489645 Additional world.getNearbyEntities API's
Provides more methods to get nearby entities, and filter by types and predicates
2018-04-30 17:55:28 -04:00
Aikar
228f9bab1c Enderman.teleportRandomly()
Ability to trigger the vanilla "teleport randomly" mechanic of an enderman.
2018-04-30 13:29:15 -04:00
Aikar
1281d5b384 EndermanEscapeEvent
Fires an event anytime an enderman intends to teleport away from the player

You may cancel this, enabling ranged attacks to damage the enderman for example.
2018-04-30 13:14:30 -04:00
Aikar
92482f8e92 Add Ban Methods to Player Objects
Allows a more logical API for banning players.

player.banPlayer("Breaking the rules");
2018-04-28 10:28:50 -04:00
Mark Vainomaa
a97f03a018 Add openSign method to HumanEntity 2018-04-01 02:28:43 +03:00
Minecrell
16b17bdc68 Add legacy ping support to PaperServerListPingEvent
Add a new method to StatusClient check if the client is a legacy
client that does not support all of the features provided in the
event.
2017-10-11 19:30:20 +02:00
Aikar
635e3fa1fa getPlayerUniqueId API
Gets the unique ID of the player currently known as the specified player name
In Offline Mode, will return an Offline UUID

This is a more performant way to obtain a UUID for a name than loading an OfflinePlayer
2018-03-22 01:39:28 -04:00
Aikar
4447307899 Player.setPlayerProfile API
This can be useful for changing name or skins after a player has logged in.
2018-03-18 12:28:55 -04:00
Minecrell
2eaa723e96 Add extended PaperServerListPingEvent
Add a new event that extends the original ServerListPingEvent
and allows full control of the response sent to the client.
2017-10-11 15:55:38 +02:00
Aikar
bb5e4dd0eb Add more fields to AsyncPreLoginEvent
Co-authored-by: Connor Linfoot <connorlinfoot@me.com>
Co-authored-by: MCMDEV <john-m.1@gmx.de>
2018-03-18 11:43:30 -04:00
Aikar
4198da1e99 Tameable#getOwnerUniqueId API
This is faster if all you need is the UUID, as .getOwner() will cause
an OfflinePlayer to be loaded from disk.
2018-02-24 00:55:52 -05:00
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