Commit Graph

3157 Commits

Author SHA1 Message Date
BillyGalbreath
3ad277b100 Add sun related API 2018-10-07 00:54:15 -05:00
BillyGalbreath
51b4b8a059 Add LivingEntity#getTargetEntity 2018-09-22 00:32:53 -05:00
Phoenix616
63821bf96b PreSpawnerSpawnEvent
This adds a separate event before an entity is spawned by a spawner
which contains the location of the spawner too similarly to how the
SpawnerSpawnEvent gets called instead of the CreatureSpawnEvent for
spawners.

Dropped as it does not apply due to the earlier PreCreatureSpawnEvent patch not being applied
2018-09-18 23:50:10 +01:00
Aikar
6512e0749b Add Material Tags
This adds a bunch of useful and missing Tags to be able to identify items that
are related to each other by a trait.

Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
Co-authored-by: Lena Kolb <lenakolb2204@gmail.com>
Co-authored-by: Layla Silbernberg <livsilbernberg@gmail.com>
Co-authored-by: Newwind <newwindserver@gmail.com>
2018-07-17 01:27:15 -04:00
Aikar
119dfa37f0 Material API additions 2018-10-06 21:14:29 -04:00
Tassu
6d98fbc47d Implement furnace cook speed multiplier API
Signed-off-by: Tassu <git@tassu.me>
2018-09-13 08:45:01 +03:00
Aikar
6a9c8c348b Performance & Concurrency Improvements to Permissions
Modifying of permissions was only half protected, enabling concurrency
issues to occur if permissions were modified async.

While no plugin really should be doing that, modifying operations
are not heavily called, so they are safe to add synchronization to.

Now, all modification API's will be synchronized ensuring safety.

Additionally, hasPermission was victim to a common java newbie mistake
of calling if (containsKey(k)) return get(k), resulting in 2 map lookups.

Optimized it to simply be a single get call cutting permission map
lookups in half.
2018-09-13 20:51:50 -04:00
Aikar
2983b658fc Mob Pathfinding API
Adds an API to allow plugins to instruct a Mob to Pathfind to a Location or Entity

This does not do anything to stop other AI rules from changing the location, so
it is still up to the plugin to control that or override after another goal changed
the location.

You can use EntityPathfindEvent to cancel new pathfinds from overriding your current.
2018-09-09 12:39:06 -04:00
Phoenix616
9bcb238879 Improve death events
This adds the ability to cancel the death events and to modify the sound
an entity makes when dying. (In cases were no sound should it will be
called with shouldPlaySound set to false allowing unsilencing of silent
entities)

It makes handling of entity deaths a lot nicer as you no longer need
to listen on the damage event and calculate if the entity dies yourself
to cancel the death which has the benefit of also receiving the dropped
items and experience which is otherwise only properly possible by using
internal code.
2018-08-21 01:32:28 +01:00
BillyGalbreath
9ccfc565ff Expose attack cooldown methods for Player 2018-09-04 15:01:54 -05:00
BillyGalbreath
c708d136f7 Add ray tracing methods to LivingEntity 2018-09-03 18:13:53 -05:00
Aikar
8ce80096b6 Async Chunks API
Adds API's to load or generate chunks asynchronously.

Also adds utility methods to Entity to teleport asynchronously.
2016-02-29 17:43:33 -06:00
Sotr
318265a167 Add source block constructor and getChangedBlockData() to BlockPhysicsEvent 2018-08-23 16:14:25 +08:00
cswhite2000
a366055b99 isChunkGenerated API 2018-08-21 19:39:46 -07:00
Zach Brown
6cc3102429 Inventory#removeItemAnySlot 2018-08-28 23:04:06 -04:00
BillyGalbreath
2c612508cb Add More Creeper API 2018-08-24 11:50:16 -05:00
BillyGalbreath
72098bd870 Add PhantomPreSpawnEvent 2018-08-25 19:56:42 -05:00
BillyGalbreath
b589db2d90 Slime Pathfinder Events 2018-08-24 08:18:27 -05:00
Spottedleaf
8170ae9d64 Allow Blocks to be accessed via a long key
The key can be retrieved via methods Location#toBlockKey() and
Block#getBlockKey()

World provides lookup for blocks by long key via method World#getBlockAtKey(long)

The formatting for the key is as follows:

10 bit y|27 bit z|27 bit x

The y value is considered unsigned while z and x are considered two's complement

Y range: [0, 1023]
X, Z range: [-67 108 864, 67 108 863]
2018-08-14 21:42:10 -07:00
Aikar
ffe27211fb Don't use snapshots for Timings Tile Entity reports 2018-08-15 01:19:37 -04:00
Aikar
99bdc0fc19 Ability to get Tile Entities from a chunk without snapshots 2018-08-15 01:04:58 -04:00
Aikar
1dd927ee10 Provide Chunk Coordinates as a Long API
Allows you to easily access the chunks X/z as a long, and a method
to look up by the long key too.
2018-08-04 19:37:35 -04:00
Mark Vainomaa
0961228e4c Add TNTPrimeEvent 2018-07-15 22:17:55 +03:00
BillyGalbreath
cc6614603e AnvilDamageEvent 2018-07-20 23:36:55 -05:00
willies952002
2a9bc8abb9 Expand ArmorStand API
Adds the following:
- Add proper methods for getting and setting items in both hands. Deprecates old methods
- Enable/Disable slot interactions
- Allow using degrees for ArmorStand rotations (via new Rotations class)

Co-authored-by: SoSeDiK <mrsosedik@gmail.com>
2018-07-26 02:22:44 -04:00
Aikar
134ca58ee1 Expand Location Manipulation API
Adds set(x, y, z), add(base, x, y, z), subtract(base, x, y, z);
2018-07-25 01:36:07 -04:00
BillyGalbreath
431acee6c7 SkeletonHorse Additions 2018-07-27 22:36:17 -05:00
Riley Park
f55cc79973 Allow disabling armour stand ticking 2018-08-15 01:26:03 -07:00
BillyGalbreath
d50ba0d9d0 PlayerLaunchProjectileEvent 2018-07-21 03:10:50 -05:00
BillyGalbreath
c3ab659a8a PlayerElytraBoostEvent 2018-07-21 01:59:53 -05:00
BillyGalbreath
d8cc2cf7e6 EnderDragon Events 2018-07-21 01:51:05 -05:00
Aikar
aec70dca41 Entity#getChunk API
Get the chunk the entity is currently registered to
2018-07-04 02:25:48 -04:00
BillyGalbreath
aa4a072807 Allow setting the vex's summoner 2018-10-06 21:47:09 -05:00
Aikar
6d3de60244 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:52:52 -04:00
Brokkonaut
f8562d67ca Add World.getEntity(UUID) API 2018-07-03 16:07:16 +02:00
Aikar
c8a0abe8fd RangedEntity API
Allows you to determine if an entity is capable of ranged attacks,
and to perform an attack.
2018-06-26 21:34:40 -04:00
Aikar
77334adf24 LivingEntity Active Item API
API relating to items being actively used by a LivingEntity
such as a bow or eating food.

Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
2018-06-29 00:19:19 -04:00
Aikar
fe1b88829d ItemStack API additions for quantity/flags/lore 2018-06-22 22:59:18 -04:00
Aikar
9624ed131b Expand Explosions API
Add Entity as a Source capability, and add more API choices, and on Location.

Co-authored-by: Esoteric Enderman <90862990+EsotericEnderman@users.noreply.github.com>
Co-authored-by: Bjarne Koll <git@lynxplay.dev>
2017-12-19 16:24:42 -05:00
Brokkonaut
e95376162f Add entity knockback events
- EntityKnockbackEvent
- EntityPushedByEntityAttackEvent
- EntityKnockbackByEntityEvent

Co-authored-by: aerulion <aerulion@gmail.com>
Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
2018-06-18 15:40:39 +02:00
Aikar
2533372193 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:09:27 -04:00
BillyGalbreath
85e9ea4189 Add "getNearbyXXX" methods to Location 2018-06-18 00:41:46 -05:00
Aikar
2961c3844c EntityShootBowEvent consumeArrow and getArrowItem API
Adds ability to get what arrow was shot, and control if it should be consumed.
2013-06-15 19:52:04 -04:00
BillyGalbreath
e7267acf84 Make shield blocking delay configurable 2018-06-16 01:17:39 -05:00
Shane Freeder
5cc8f5a0e6 Add EntityTeleportEndGatewayEvent 2018-06-09 13:08:21 +01:00
Aikar
b513a8369d ItemStack#getMaxItemUseDuration
Allows you to determine how long it takes to use a usable/consumable item
2018-06-05 22:59:50 -04:00
Aikar
a4ea7eef0b WitchReadyPotionEvent
Control what potion the witch readies to use
2018-06-05 22:47:08 -04:00
Aikar
bf8735b85b PotionEffect clone methods 2018-06-03 04:10:13 -04:00
Aikar
0432bbd3a8 Location.toBlockLocation/toCenterLocation()
Convert location objects to their block coordinates, or the center of the block
2018-05-24 21:01:13 -04:00
Aikar
9970e9dfde WitchThrowPotionEvent
Fired when a witch throws a potion at a player
2018-05-16 20:39:09 -04:00