Commit Graph

321 Commits

Author SHA1 Message Date
Jake Potrebic 962554a0de Fix equipment slot and group API
Adds the following:
- Add missing 'body' slot group
- Expose LivingEntity#canUseSlot

Co-authored-by: SoSeDiK <mrsosedik@gmail.com>
2024-05-22 10:00:19 -07:00
Jake Potrebic 953ba33fc1 Fix issues with recipe API
Improves the validation when creating recipes
and RecipeChoices to closer match what is
allowed by the Codecs and StreamCodecs internally.

Adds RecipeChoice#empty which is allowed in specific
recipes and ingredient slots.

Also fixes some issues regarding mutability of both ItemStack
and implementations of RecipeChoice.

Also adds some validation regarding Materials passed to RecipeChoice
being items.
2024-05-12 10:42:42 -07:00
SoSeDiK 5e1dc7cf47 Expose #hasColor to leather armor 2024-05-01 10:58:50 +03:00
Jake Potrebic b0a676ba62 Fix ItemFlags
Adds new flag in HIDE_STORED_ENCHANTS which was split
from HIDE_ADDITIONAL_INFO. Adds a migration to account for
this, adding the new flag if the itemstack is old and had the
old flag.
2024-04-27 13:28:17 -07:00
Owen1212055 4092b60fa0 Deprecate ItemStack#setType 2024-02-29 17:54:26 -05:00
Owen1212055 1725de0232 Suspicious Effect Entry API
Exposes a new suspicious effect entry type that properly represents
storable effects in the context of suspicious effects as they only
define the potion effect type and duration.

This differentiates them from the existing PotionEffect API found in
bukkit and hence clarifies that storable values in the parts of the API
in which it replaces PotionEffect.

Co-authored-by: Yannick Lamprecht <yannicklamprecht@live.de>
2024-03-03 19:45:52 +01:00
Yannick Lamprecht de70580ea9 ItemStack Tooltip API 2024-01-22 13:27:18 +01:00
Jake Potrebic 17df649613 Add BlockStateMeta#clearBlockState 2024-01-11 12:41:54 -08:00
Jake Potrebic d513222b59 Improve Registry
Adds Registry#getKey(Object) which should be the
primary way people get the key for an object. Registry
items need to exist without having a key and so
getKey() methods on Keyed objects that have a registry
are marked as Deprecated or Obsolete.
2023-12-20 02:03:10 -08:00
Jake Potrebic 1ab1d0f10a Experimental annotations change 2023-12-09 11:47:53 -08:00
MrPowerGamerBR 41ca517939 Remove unnecessary durability check in "ItemStack#isSimilar(...)"
By removing this check we avoid unnecessarily allocating useless `ItemMeta` objects if we are comparing two items, or one of the two items, that don't have any durability. Don't worry, the durability of the item is checked when it checks if both item metas are equal.

This is a leftover from when checking for the item's durability was "free" because the durability was stored in the `ItemStack` itself, this [was changed in Minecraft 1.13](https://hub.spigotmc.org/stash/projects/SPIGOT/repos/bukkit/commits/f8b2086d60942eb2cd7ac25a2a1408cb790c222c#src/main/java/org/bukkit/inventory/ItemStack.java).
2023-11-26 20:00:50 -03:00
Aeltumn b7bb062734 Allow proper checking of empty item stacks
This adds a method to check if an item stack is empty or not. This mirrors vanilla's implementation of the same method.
2023-08-28 13:41:09 +02:00
Joo200 8fb0d8f90a MerchantRecipe: add copy constructor 2022-12-20 15:26:36 +01:00
Jake Potrebic 26780d3ac6 Fix SpawnEggMeta#get/setSpawnedType 2023-02-26 07:14:19 -08:00
Nassim Jahnke e03e924177 Replace ItemFlag.HIDE_POTION_EFFECTS 2023-01-05 10:45:20 +01:00
Jake Potrebic c189c3ba5b ItemStack damage API
Adds methods notify clients about item breaks and
to simulate damage done to an itemstack and all
the logic associated with damaging them
2022-05-08 13:35:58 -07:00
SoSeDiK d533ea2226 Add EquipmentSlot convenience methods 2022-10-16 15:28:49 +03:00
Jason Penilla a0b5bad27f Add enchantWithLevels API
Deprecate upstream's newer and poorly implemented similar
API.
2022-03-16 20:35:13 -07:00
BillyGalbreath 1fa51dd469 Expose isFuel and canSmelt methods to FurnaceInventory 2021-12-23 15:32:40 -06:00
Jake Potrebic c8e36cb205 Option to prevent data components copy in smithing recipes 2021-09-26 12:57:35 -07:00
Jake Potrebic 00ebe90031 Improve item default attribute API 2021-05-08 15:02:00 -07:00
Riley Park 482d7e4984 ItemStack#editMeta 2021-05-23 05:04:28 -07:00
Jake Potrebic fce24f3b52 ItemStack repair check API 2021-05-15 22:10:50 -07:00
Jake Potrebic 07e76ccd5b Inventory#close 2021-05-11 14:54:20 -07:00
Jake Potrebic 411f1ddea7 add get-set drop chance to EntityEquipment 2021-04-22 00:28:20 -07:00
Jake Potrebic 83c4827433 Improve Item Rarity API 2021-03-12 17:09:40 -08:00
Mariell Hoversholm 9c8829553b Add ignore discounts API 2020-11-09 20:33:38 +01:00
ysl3000 124e1f8619 Create HoverEvent from ItemStack Entity 2020-07-06 22:17:37 +02:00
Jake Potrebic f610d0b477 Add methods to get translation keys
Co-authored-by: MeFisto94 <MeFisto94@users.noreply.github.com>
2020-08-11 19:17:46 +02:00
MiniDigger | Martin 53d5aca783 Support components in ItemMeta 2020-06-06 18:13:16 +02:00
Phoenix616 78acda62f2 Inventory getHolder method without block snapshot 2020-06-10 23:55:16 +01:00
Nassim Jahnke ec2e3991b9 Add item slot convenience methods
Co-authored-by: Janet Blackquill <uhhadd@gmail.com>
2020-04-25 23:31:28 +02:00
Mariell Hoversholm 21792a6e4b Add Raw Byte ItemStack Serialization
Serializes using NBT which is safer for server data migrations than bukkits format.

Co-authored-by: Nassim Jahnke <nassim@njahnke.dev>
2020-04-30 16:56:31 +02:00
Aikar 2825ece820 Fix Spigot annotation mistakes
while some of these may of been true, they are extreme cases and cause
a ton of noise to plugin developers.

Use ApiStatus.Internal instead of Deprecated for actual internal API
that continues to have use (internally).

These do not help plugin developers if they bring moise noise than value.
2019-03-24 18:39:01 -04:00
Aikar fda116f002 Add ItemStack Recipe API helper methods
Allows using ExactChoice Recipes with easier methods

Redirects some of upstream's APIs to these new methods to avoid
usage of magic values and the deprecated RecipeChoice#getItemStack
2014-01-28 19:13:57 -05:00
Zach Brown 6cc3102429 Inventory#removeItemAnySlot 2018-08-28 23:04:06 -04:00
Aikar fe1b88829d ItemStack API additions for quantity/flags/lore 2018-06-22 22:59:18 -04: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
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 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 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
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
Zach Brown 0c37d20354 Fix upstream javadocs 2017-06-10 16:59:40 -05:00
Riley Park 15081a5912 Adventure
Co-authored-by: zml <zml@stellardrift.ca>
Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
Co-authored-by: Yannick Lamprecht <yannicklamprecht@live.de>
2021-01-29 17:21:55 +01:00
Bukkit/Spigot 28e80d52a4 BungeeCord Chat API
By: md_5 <git@md-5.net>
2014-12-13 02:59:14 +01:00
Bukkit/Spigot 8de3a6a15d Skeleton API Implementations
By: md_5 <git@md-5.net>
2017-05-15 15:16:15 +10:00
Bukkit/Spigot 88499aa05b Update to Minecraft 1.21.4
By: md_5 <git@md-5.net>
2024-12-04 03:20:00 +11:00
Bukkit/Spigot 0023e5549a #1082: Add "since" to Deprecation annotations
By: DerFrZocker <derrieple@gmail.com>
2024-11-25 07:52:33 +11:00