Commit graph

360 commits

Author SHA1 Message Date
Zach Brown
c89e4105d2 Update upstream B/CB 2018-07-13 02:39:44 -05:00
Aikar
cc84e0fab8 Vex#getOwner API
Get's the NPC that summoned this Vex
2018-07-04 15:32:30 -04:00
Aikar
8778a2ef97 Current Chunk for Entity and Block Entities, counts by entity type
This enables us a fast reference to the entities current chunk instead
of having to look it up by hashmap lookups.

We also store counts by type to further enable other performance optimizations in later patches.
2018-07-04 03:55:24 -04:00
Aikar
58a2e2dc04 InventoryCloseEvent Reason API
Allows you to determine why an inventory was closed, enabling plugin developers
to "confirm" things based on if it was player triggered close or not.
2018-07-03 21:57:33 -04:00
Brokkonaut
651753d370 Add World.getEntity(UUID) API
This is the best way to get an entity when the world and its UUID are known.
It is faster than Server.getEntity(UUID) because it does not have to iterate all worlds
2018-07-03 16:16:01 +02:00
Brokkonaut
d47caaad6a Improve ProjectileHitEvent to include the BlockFace where the projectile has hit (#1182) 2018-06-30 05:50:17 +02:00
Aikar
14ccb8ebeb Add Critical missing Bukkit API - setTarget/getTarget moved down to SentientNPC
This fixes a CRITICAL missing part of the Bukkit API due to mistakes on upstream
refusing to implement the Sentient NPC baseclass of all NPC's.

Until now, the Bukkit API has not provided a way for accessing and setting
a non creature entities target.

Although Flying, Slime, Ambient, and Water mobs all supported targets internally,
you were unable to get/set it.

Now with the SentientNPC API and these API's moved down, every sentient NPC has
access to target data.
2018-07-01 22:07:35 -04:00
Aikar
2d646ba400 Subtraction goes down, not up. Silly me. 2018-06-30 04:45:17 -04:00
Aikar
d9c9b9a3d2 LivingEntity Hand Raised/Item Use API
How long an entity has raised hands to charge an attack or use an item

Also aliased isHandsRaised for isChargingAttack in RangedEntity
2018-06-29 00:55:29 -04:00
Aikar
278780623d RangedEntity API
Allows you to determine if an entity is capable of ranged attacks,
and to perform an attack.
2018-06-26 22:08:01 -04:00
Aikar
4342d72e74 EntityPathfindEvent should be an EntityEvent 2018-06-25 22:09:11 -04:00
Aikar
a0146a41f2 ItemStack API additions for quantity/flags/lore 2018-06-22 23:03:46 -04:00
Aikar
899149d68d Expand Explosions API
Add Entity as a Source capability, and add more API choices, and on Location.
2018-06-20 23:19:46 -04:00
Brokkonaut
fbe69b61a9 Add EntityKnockbackByEntityEvent (#1162)
This event is called when an entity receives knockback by another entity. The knockback can be modified in the event. If the event is cancelled the entity is not knocked back.
2018-06-21 03:59:11 +02:00
BillyGalbreath
63bf2ee267 Add "getNearbyXXX" methods to Location (#1160) 2018-06-20 20:30:09 -05:00
theminecoder
680e0ad864 Fix PluginCommand to not wrap exceptions before ServerExceptionEvent can get to it (#1130) 2018-06-19 07:03:09 +10:00
BillyGalbreath
283a4b7d60 [CI-SKIP] Clarify Event#callEvent() JavaDoc (#1158) 2018-06-18 15:42:39 -05:00
Aikar
be0d8a5f74 PlayerReadyArrowEvent
Called when a player is firing a bow and the server is choosing an arrow to use.
Plugins can skip selection of certain arrows and control which is used.
2018-06-18 01:13:16 -04:00
Aikar
9fc9d3f486 EntityShootBowEvent consumeArrow and getArrowItem API
Adds ability to get what arrow was shot, and control if it should be consumed.
2018-06-18 00:39:04 -04:00
BillyGalbreath
4a55e34625 Make shield blocking delay configurable (#1154)
Resolves #1153
2018-06-16 14:54:35 -05:00
Aikar
488c39f0f4 Make SentientNPC extend LivingEntity 2018-06-16 14:28:13 -04:00
Aikar
3368739906 Add SentientNPC Interface to Entities
Used to determine ACTUAL Living NPC's. Spigot mistakenly inversed the conditions for LivingEntity, and
used LivingEntity for Insentient Entities, and named the actual EntityLiving class EntityInsentient.

This should of all been inversed on the implementation side. To make matters worse, Spigot never
exposed the differentiator that there are entities with AI that are not sentient/alive such as
Armor stands and Players are the only things that do not implement the REAL EntityLiving class (named Insentient internally)

This interface lets you identify NPC entities capable of sentience, and able to move about and react to the world.
2018-06-16 14:01:01 -04:00
Shane Freeder
1470add5c4 Fix compat with PluginClassloader implementations 2018-06-12 16:10:01 +01:00
Shane Freeder
50eaba9503 Cleanup last commit (Remember, always git diff!)
Because the one time you don't...
2018-06-09 20:03:42 +01:00
Shane Freeder
6812a948db Only close classloaders unless implict, reload or error on enabling (Closes #1120)
We also expose the control of this behavior to the API, while retaining
the old behavior unless implictly requested.
2018-06-09 18:58:04 +01:00
Shane Freeder
056199bd92 Add EntityTeleportEndGatewayEvent for entities (closes #1124) 2018-06-09 14:21:40 +01:00
Aikar
d72d79efee Fix potential for NPE if receivers is null and the world was empty 2018-06-06 21:45:30 -04:00
Aikar
d4e763c30e ParticleBuilder.hasReceivers shouldnt return true if no players are in the world 2018-06-06 21:35:44 -04:00
Aikar
3f4bd3e8f7 Expand ParticleBuilder more with hasReceivers, fix empty receivers list 2018-06-06 21:27:50 -04:00
Aikar
052479037b Expand particle builder API with radius based radius methods 2018-06-06 20:59:04 -04:00
Aikar
4e86ff1c24 ItemStack#getMaxItemUseDuration
Allows you to determine how long it takes to use a usable/consumable item
2018-06-05 23:01:16 -04:00
Aikar
0cd3d13ae9 WitchReadyPotionEvent
Control what potion the witch readies to use
2018-06-05 22:48:27 -04:00
Aikar
de96024fe7 PotionEffect clone methods
Help with modifying potion effects
2018-06-04 01:55:52 -04:00
Aikar
cb9b5bfa82 add Escape Reason Drown for EndermanEscapeEvent
to detect rain specifically from every other armor ignoring hit
2018-05-31 18:16:26 -04:00
Aikar
b4d7828a4f rename method for center to toCenterLocation() 2018-05-24 21:06:06 -04:00
Aikar
b70c406245 Location.toBlockLocation
Convert location objects to their block coordinates, or the center of the block
2018-05-24 21:02:38 -04:00
Aikar
efe156b1f7 Fix Witch Throw Potion error - Resolves #1129 2018-05-23 23:08:04 -04:00
Foorack
bd9e73a2c6 Upgrade ASM to 6.1.1 to allow Java 9 and 10 plugins to load 2018-05-22 22:07:25 -05:00
Zach Brown
4b7080388e Update URLs
Redirects are in place (or will be shortly). This is mostly
housekeeping.

Maven repo URLs already redirect however we can't deploy through them.
Jenkins URLs do not currently redirect but will within 24 hours.

Also adds a Discord link to the README, because apparently that's what
people want.

Documentation will be updated and announcements made once all redirects
are in place, until then, consider this advanced notice.
2018-05-19 01:29:05 -05:00
Aikar
375b54fcd1 WitchThrowPotionEvent
Fired when a witch throws a potion at a player
2018-05-16 20:49:47 -04:00
Aikar
9b4be61ac6 WitchConsumePotionEvent
Fires when a witch consumes the potion in their hand
2018-05-16 20:35:33 -04:00
Shane Freeder
f6f8ff278f Update B/CB 2018-05-08 23:09:45 +01:00
Aikar
1a80507406 Close Plugin Class Loaders on Disable
This should close more memory leaks from /reload and disabling plugins,
by closing the class loader and the jar file.
2018-05-01 21:36:55 -04:00
Aikar
6f281bc19f 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:19:47 -04:00
Aikar
c84c87f8b2 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.
2018-04-30 20:32:15 -04:00
Aikar
30e08681c8 Location.isChunkLoaded() API 2018-04-30 19:27:59 -04:00
Aikar
f4d5ad301c Additional world.getNearbyEntities API's
Provides more methods to get nearby entities, and filter by types and predicates
2018-04-30 18:27:42 -04:00
Aikar
c25c800a3c Enderman.teleportRandomly()
Ability to trigger the vanilla "teleport randomly" mechanic of an enderman.
2018-04-30 13:30:00 -04:00
Aikar
2c7a08b1df 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.

Resolves #1101
2018-04-30 13:16:42 -04:00
Aikar
582999642c Add Ban Methods to Player Objects
Allows a more logical API for banning players.

player.banPlayer("Breaking the rules");
2018-04-28 11:31:26 -04:00