Commit Graph

456 Commits

Author SHA1 Message Date
Andrew Steinborn
0069113b2e Put the decompile fixes into MC Dev Fixes patch 2018-07-23 13:10:06 -04:00
Andrew Steinborn
608b5e5235 Optimize RegistryID.c()
Fixes #1253
2018-07-23 12:58:48 -04:00
Shane Freeder
aad194a32e
Update B/CB/S 2018-07-23 09:44:57 +01:00
Aikar
e2c75e81f7
Update Paper to 1.13 proper - THIS IS STILL HIGHLY UNSTABLE
DO NOT RUN ON PRODUCTION SERVERS!!! Use Backups!!
2018-07-22 01:27:46 -04:00
Aikar
39ea0d21dc
Restore World.loadChunkAsync API - but load chunks sync
We are still missing Async Chunk Loading, but plugins may be
depending on this API, so it missing blocks upgrading.
2018-07-21 16:55:43 -04:00
BillyGalbreath
c2d29a73ac PlayerElytraBoostEvent 2018-07-21 02:00:31 -05:00
Shane Freeder
1fe8472503
update B/CB/S 2018-07-20 20:57:43 +01:00
Zach Brown
09663381ca
Use 1.13 branch and builds for versioning 2018-07-19 17:33:29 -05:00
Zach Brown
613db95e01
Add an asterisk to plugins onEnable and in command
Easy visual indicator for server admins to tell which plugins are
operating under the legacy compat mode, and which have been updated.
2018-07-19 15:08:07 -05:00
Shane Freeder
84c98c2ba8
NOT FINISHED! She compiles, and she... suffers the wrath of chunkgen... 2018-07-19 05:42:43 +01:00
Mark Vainomaa
b854308c88
Add TNTPrimeEvent 2018-07-16 14:32:13 +03:00
Aikar
5b6dfb3463
NOT FINISHED!!! Current Progress on 1.13-pre7 update
This work is 100% unfinished. I am pushing it up so that we as a team
can work on this update.

Do not try to use this branch. You will fail.
2018-07-16 00:13:29 -04:00
Aikar
a8c28e1920
Initial Paper-API for Bukkit 1.13 Preview 4 - THIS IS NOT SERVER
This branch/commit is only useful to those who purely use a clean Bukkit/Spigot/Paper API
and does not use NMS/OBC references.

This will let you start updating your plugin to the latest 1.13 builds of Bukkit Preview (4 as of now)

Note that this release is not final!!! API breakages may occur!

It is up to you if you find use out of this work.
2018-07-14 21:53:22 -04:00
Zach Brown
5b02e5736a
Update upstream B/CB 2018-07-13 02:39:44 -05:00
Aikar
3d1f804a22
Vex#getOwner API
Get's the NPC that summoned this Vex
2018-07-04 15:32:30 -04:00
Aikar
18c3716c49
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:58:56 -04:00
Aikar
f534210885
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
e19ed02025
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 14:53:28 -05:00
Brokkonaut
2ed792d699
Improve ProjectileHitEvent to include the BlockFace where the projectile has hit (#1182) 2018-07-03 14:34:42 -05:00
Aikar
2adb879802
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:10:21 -04:00
Aikar
5659d66915
Subtraction goes down, not up. Silly me. 2018-06-30 04:45:17 -04:00
Aikar
98555e9b90
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
7abf2eeeac
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
ae79aa3436
EntityPathfindEvent should be an EntityEvent 2018-06-25 22:09:11 -04:00
Aikar
ff572760c4
ItemStack API additions for quantity/flags/lore 2018-06-22 23:03:46 -04:00
Aikar
980d53d156
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
a5285de480 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-20 21:59:11 -04:00
BillyGalbreath
4f20c7ab67 Add "getNearbyXXX" methods to Location (#1160) 2018-06-20 21:30:09 -04:00
theminecoder
b02d49beaa Fix PluginCommand to not wrap exceptions before ServerExceptionEvent can get to it (#1130) 2018-06-18 16:03:09 -05:00
BillyGalbreath
efb52083b9 [CI-SKIP] Clarify Event#callEvent() JavaDoc (#1158) 2018-06-18 15:42:39 -05:00
Aikar
c92fa14d36
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
76d60b167f
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
Aikar
708d52ca03
Ignore Missing Recipes in RecipeBook to avoid data errors
This code was causing NPE's in saving player data, potentially related to reloads.
2018-06-16 16:30:29 -04:00
BillyGalbreath
1ae07ecf52 Make shield blocking delay configurable (#1154)
Resolves #1153
2018-06-16 15:54:35 -04:00
Aikar
89aa04f9ed
Make SentientNPC extend LivingEntity 2018-06-16 14:28:13 -04:00
Aikar
ed61b2982e
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
2c1d1ac456
Fix compat with PluginClassloader implementations 2018-06-12 16:10:01 +01:00
Shane Freeder
586435d325
Cleanup last commit (Remember, always git diff!)
Because the one time you don't...
2018-06-09 20:03:42 +01:00
Shane Freeder
f022bc006f
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
5913a2cc1a
Add EntityTeleportEndGatewayEvent for entities (closes #1124) 2018-06-09 14:21:40 +01:00
Aikar
72c26039eb
Fix potential for NPE if receivers is null and the world was empty 2018-06-06 21:45:30 -04:00
Aikar
d4dffd1d71
ParticleBuilder.hasReceivers shouldnt return true if no players are in the world 2018-06-06 21:35:44 -04:00
Aikar
fd4a65c566
Expand ParticleBuilder more with hasReceivers, fix empty receivers list 2018-06-06 21:27:50 -04:00
Aikar
11cb276a4a
Expand particle builder API with radius based radius methods 2018-06-06 20:59:04 -04:00
Aikar
2e423c8954
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
b97e5124e4
WitchReadyPotionEvent
Control what potion the witch readies to use
2018-06-05 22:48:48 -04:00
Aikar
5c8bd61d24
PotionEffect clone methods
Help with modifying potion effects
2018-06-04 01:55:52 -04:00
Aikar
727f932d05
add Escape Reason Drown for EndermanEscapeEvent
to detect rain specifically from every other armor ignoring hit
2018-05-31 18:16:26 -04:00
Mark Vainomaa
e74e4584d6 Skip Entity and Tile Entity ticking in chunks scheduled for unload (#1132)
Fixes #1131
2018-05-30 15:31:55 -05:00
Zach Brown
51b88cabbc
Update upstream CB 2018-05-27 23:39:08 -05:00
Aikar
dab41b12ce
rename method for center to toCenterLocation() 2018-05-24 21:06:06 -04:00
Aikar
45308a08d7
Location.toBlockLocation
Convert location objects to their block coordinates, or the center of the block
2018-05-24 21:02:38 -04:00
Aikar
3eb1cdef72
Fix Witch Throw Potion error - Resolves #1129 2018-05-23 23:08:04 -04:00
Foorack
aedd155be1
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
de3bd3f635
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
5e644e2637
WitchThrowPotionEvent
Fired when a witch throws a potion at a player
2018-05-16 20:49:47 -04:00
Aikar
dc7680211c
WitchConsumePotionEvent
Fires when a witch consumes the potion in their hand
2018-05-16 20:49:43 -04:00
Shane Freeder
8595189ab6
Update B/CB 2018-05-08 23:09:45 +01:00
Aikar
19dea1a6f7
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
bd603371bf
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
00f24317ff
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
0eba89f673
Location.isChunkLoaded() API 2018-04-30 19:27:59 -04:00
Aikar
dbc775c09c
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
d38e9dcf0e
Enderman.teleportRandomly()
Ability to trigger the vanilla "teleport randomly" mechanic of an enderman.
2018-04-30 13:30:00 -04:00
Aikar
30bc4df0a9
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
33a6de0f13
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
Kyle Wood
35b4136815
Track previous version and report in command
It is often difficult to diagnose new issues server admins get when
upgrading to a new server version because the only information they are
able to tell us regarding the server version they are running is
"latest". This commit attempts to mitigate this by keeping track of the
previous version of Paper they were running, which is then reported by
the `/version` or `/paper version` command. This gives us a better idea
of the commits included in the upgrade, which may help diagnose new
issues easier.
2018-04-11 23:02:20 -04:00
Zach Brown
d4c3e49a06
Make version command use the direct link
It was using a redirect, but apparently a small portion of systems,
networks, some mess, are having problems with that redirect.

Just use the direct link and skip the hassle.
2018-04-09 16:13:08 -04:00
Shane Freeder
242d671fa9
Allow logger instances to be used across reloads 2018-04-08 02:02:48 +01:00
Mark Vainomaa
c6ac33816b
Add method to open already placed sign 2018-04-05 06:48:24 +03:00
Shane Freeder
d09826faf2
Flag to disable the channel limit
In some enviroments, the channel limit set by spigot can cause issues,
e.g. servers which allow and support the usage of mod packs.

provide an optional flag to disable this check, at your own risk.
2018-03-31 18:56:49 +01:00
Minecrell
16869992a8 Call PaperServerListPingEvent for legacy pings (#1057)
* Make the legacy ping handler more reliable

The Minecraft server often fails to respond to old ("legacy") pings
from old Minecraft versions using the protocol used before the switch
to Netty in Minecraft 1.7.

Due to packet fragmentation[1], we might not have all needed bytes
available when the LegacyPingHandler is called. In this case, it will
run into an error, remove the handler and continue using the modern
protocol.

This is unlikely to happen for the first two revisions of the legacy
ping protocol (used in Minecraft 1.5.x and older) since the request
consists of only one or two bytes, but happens frequently for the
last/third revision introduced in Minecraft 1.6.

It has much larger, variable packet sizes due to the inclusion of
the virtual host (the hostname/port used to connect to the server).

The solution[2] is simple: If we find more than two matching bytes,
we buffer the remaining bytes until we have enough to fully read and
respond to the request.

[1]: https://netty.io/wiki/user-guide-for-4.x.html#wiki-h3-11
[2]: https://netty.io/wiki/user-guide-for-4.x.html#wiki-h4-13

* 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.
2018-03-30 13:00:01 -04:00
Minecrell
5b6c59009b Improve backward compatibility of deprecated player sample API (#1065)
Some plugins (e.g. older builds of EssentialsX) assume that
ServerListPingEvent.getSampleText() returns a mutable copy of
the player sample list. This was the case until it was refactored
on top of the new API introduced in #980.

As a result, they may run into an error when trying to modify the
returned list directly. Modify getSampleText() to return a mutable
copy (a plain ArrayList) to mimic the old behavior.
2018-03-26 17:45:18 -04:00
Aikar
658eca0c22
Add Setters for ID/Name and add completeByCache for Profile API 2018-03-25 21:50:46 -04:00
Aikar
cff8ae9644
Use copies for PlayerProfile in PaperServerList and SkullMeta
Don't want to risk mutating players properties in server list (unlikely, but lets be proper)

and Skull also has a setter API, so that should be used too.
2018-03-22 23:32:55 -04:00
Minecrell
e15167251b Add extended PaperServerListPingEvent (#980)
* Drop original implementation for old player sample API

* Add extended PaperServerListPingEvent

Add a new event that extends the original ServerListPingEvent
and allows full control of the response sent to the client.

* Implement deprecated player sample API
2018-03-22 23:19:59 -04:00
Aikar
b8a672dd94
Fix Profile Textures and expand PlayerProfile .complete() API
I mistakenly thought .complete() also checked for textures, which was not the case

So the logic was not working as desired.

Also some undesired logic paths lead to textures of the logging in player being dropped, forcing
us to always load the textures immediately again on login, leading to rate limits.

Everythings now good

the .complete() api now will default specify to also complete textures, but you may
pass false to it to skip loading textures.
2018-03-22 21:40:57 -04:00
Aikar
b29f5c05c1
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:41:44 -04:00
Aikar
7354b9166d
Update javadoc on setPlayerProfile 2018-03-18 13:28:01 -04:00
Aikar
c2933f8106
Player.setPlayerProfile API
This can be useful for changing name or skins after a player has logged in.
2018-03-18 12:32:09 -04:00
Aikar
fb02c91835
Ability to change PlayerProfile in AsyncPreLoginEvent
This will allow you to change the players name or skin on login.
2018-03-18 11:46:14 -04:00
Aikar
e3e257562f
Add PlayerProfile.complete() API to trigger skin lookup 2018-03-18 11:31:32 -04:00
Shane Freeder
77229ce7ab
Add OBFHELPER - InventoryEnderChest#getTileEntity 2018-03-10 17:11:51 +00:00
Shane Freeder
9daa9cec93
Fix NPE when getting location from players EnderChest (fixes #1041) 2018-03-10 13:26:49 +00:00
MiniDigger
09692269ca Toggleable player crits, helps mitigate hacked clients. (#1040)
This is a port of https://github.com/PaperMC/Paper/blob/ver/1.8.8/Spigot-Server-Patches/0040-Toggleable-player-crits-helps-mitigate-hacked-client.patch
Also adds me to the MIT list.
2018-03-09 23:14:47 -05:00
Minecrell
ce30be9781 [CI-SKIP] Add Minecrell to MIT list (#1035)
Change email address for some older patches to make it clear that
they are MIT licensed too.
2018-03-08 07:08:21 -08:00
Aikar
34e91b6e40
Rename getOwnerUUID to Tameable#getOwnerUniqueId for consistency
for the @kashike, thanks for adding a server diff to use this name!
2018-02-24 01:17:05 -05:00
Aikar
dcbb0f1e27
Tameable#getOwnerUUID API
This is faster if all you need is the UUID, as .getOwner() will cause
an OfflinePlayer to be loaded from disk.

This method is already implemented on the server, just needed to expose it.
2018-02-24 00:57:09 -05:00
Aikar
094bb03a37
Optimize Hoppers
- Lots of itemstack cloning removed. Only clone if the item is actually moved
- Return true when a plugin cancels inventory move item event instead of false, as false causes pulls to cycle through all items.
  However, pushes do not exhibit the same behavior, so this is not something plugins could of been relying on.
- Add option (Default on) to cooldown hoppers when they fail to move an item due to full inventory
- Skip subsequent InventoryMoveItemEvents if a plugin does not use the item after first event fire for an iteration
2018-02-12 23:26:02 -05:00
Shane Freeder
89a61a21ef
Update B/CB 2018-02-12 17:37:33 +00:00
Zach Brown
18ee843380
Properly flag profile events as async as needed 2018-02-01 23:24:27 -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
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
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