Yatopia/patches/Purpur/patches/api/0017-ItemStack-convenience-...

702 lines
23 KiB
Diff
Raw Normal View History

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
Date: Sun, 15 Mar 2020 20:52:12 -0500
Subject: [PATCH] ItemStack convenience methods
diff --git a/src/main/java/org/bukkit/Material.java b/src/main/java/org/bukkit/Material.java
Upstream (#490) * Updated Upstream and Sidestream(s) (Paper/Tuinity/Airplane/Purpur/Origami) Upstream/An Sidestream has released updates that appears to apply and compile correctly This update has NOT been tested by YatopiaMC and as with ANY update, please do your own testing. Paper Changes: 151457628 Fix Counter#decrement recursive call (#5665) 21ac7dc98 [Auto] Updated Upstream (CraftBukkit) 18ad2c9dd Add environment variable (PAPER_DISABLE_SERVER_GUI) to disable server gui 6ecbe5776 Rename leftover resource->datapack (#5662) ec90a7859 I give up on trying to teach people to avoid the incorrect ways. dc7b7a160 Fix missing username console death message (#5654) (#5658) c639a52a6 Add basic Datapack API (#5653) (#5653) 99c1d9da6 Updated Upstream (CraftBukkit) (#5652) 2d50c17e2 [CI-SKIP] Add PR rebasing steps (#5634) 2c5f8085e Remove boat interaction event (Fixes #5539) 96ee1fb8f fix WorldSaveEvent not firing with /save-all (#5650) e90e7829e remove unneeded patch (#5641) d875bacc2 Activate warning by default when people are doing silly things (#5642) cb896d471 Updated Upstream (Bukkit/CraftBukkit/Spigot) (#5643) ecbf5a38e Revert "Updated Upstream (Bukkit/CraftBukkit/Spigot) (#5636)" 20fc4ab70 Updated Upstream (Bukkit/CraftBukkit/Spigot) (#5636) 20d8812ea Fix CraftPotionBrewer cache (#5632) cd6ae8816 Add a "Should Burn in Sunlight" API for Phantoms and Skeletons (#5608) 25edfe58b Remove unneeded component conversion for kick msg (#5626) cec386f66 Call PortalCreateEvent when players enter the end (#5618) 453c7f05c Add ItemStack#displayName to get the formatted display name of an ItemStack (#5628) 4efe8b498 Update Java version warning (#5621) e0a021ccc Add ItemStack#getTranslationKey() (#5616) 53d71b717 Add setPotionUseTimeLeft to Witch (#5597) 239935d18 Add Inventory#close (#5610) 29bf6cd41 Updated Upstream (CraftBukkit) ad45f316c Add raw address to AsyncPlayerPreLoginEvent (#5614) 28865335a [Auto] Updated Upstream (CraftBukkit) 750049fa2 Fix incorrect colors in some log messages (#5609) c5fa3f0d4 Add Adventure message to PlayerAdvancementDoneEvent (#5030) 69c09cdb0 Updated Upstream (CraftBukkit) (#5607) Tuinity Changes: 1222573 Fix incorrect status dataconverter for pre 1.13 chunks Airplane Changes: 3dce697 Fix gradle stuff 209bce3 Patches Purpur Changes: 72708f4 Option to disable dragon egg teleporting 5f87a45 Updated Upstream (Paper) 7bfc70d swap heavy logic to end bb9d72d Fix #338 - Phantoms always burning bug 8fa99b3 Configurable critical damage multiplier (#339) dc4a1cb Updated Upstream (Paper & Tuinity) c166841 Configurable powered rail boost modifier (closes #329) (#333) ab9b8ca Updated Upstream (Paper & Airplane) 44e72f7 Let parrots breed using any tempting item 09d98d3 this part is important, too :3 2015fe5 Breedable parrots 552d783 Iron golem poppy calms anger 1fa06a1 Optimize collisions (#328) 1112240 Extend Halloween Optimization (#321) 03f1aec Config for health to impact Creeper explosion radius (#304) 8f7bce4 Add config for hidden from entity selector patch 21906a2 Hide hidden players from entity selector 445496d [ci-skip] fix this too, now.. jfc 3ba8c81 Ya'll didn't see nothing.. 2d4611b Updated Upstream (Paper) beed258 Better offline mode warning (#330) c1efe3c It's meant to be double :facepalm: 3f9958b Implement the Mob Blindness mod 6e98c88 Add missing repo to settings.gradle.kts da5185b Update Gradle to 7.0.1 fbd28d8 Updated Upstream (Paper & Tuinity) cb42dec Updated Upstream (Paper) e883991 Fix compatibility with MyPet Origami Changes: 4c0616d Update Paper * Updated Upstream and Sidestream(s) (Paper) Upstream/An Sidestream has released updates that appears to apply and compile correctly This update has NOT been tested by YatopiaMC and as with ANY update, please do your own testing. Paper Changes: 45e19ffb0 [Auto] Updated Upstream (CraftBukkit) * Updated Upstream and Sidestream(s) (Paper/Purpur) Upstream/An Sidestream has released updates that appears to apply and compile correctly This update has NOT been tested by YatopiaMC and as with ANY update, please do your own testing. Paper Changes: 7989028a5 More Enchantment API (#5588) c0cb5c129 Adds methods for checking item repairability (#5651) 22399b07f Actually use extended/ambient in BeaconEffectEvent (#5647) 979135878 Add cause and cancel message to PlayerGameModeChangeEvent (#5638) 51e1e58d2 Fix Adventure support in UnknownCommandEvent (#5664) Purpur Changes: ca9be56 Do not allow duplicate unsafe enchants * Updated Upstream and Sidestream(s) (Paper/Purpur/Paper) Upstream/An Sidestream has released updates that appears to apply and compile correctly This update has NOT been tested by YatopiaMC and as with ANY update, please do your own testing. Paper Changes: 7989028a5 More Enchantment API (#5588) c0cb5c129 Adds methods for checking item repairability (#5651) 22399b07f Actually use extended/ambient in BeaconEffectEvent (#5647) 979135878 Add cause and cancel message to PlayerGameModeChangeEvent (#5638) 51e1e58d2 Fix Adventure support in UnknownCommandEvent (#5664) Purpur Changes: ca9be56 Do not allow duplicate unsafe enchants Paper Changes: 322886c86 Avoid NPE due to PlayerBedFailEnterEvent d3c9a195c removed duplicate ProjectileHitEvent for fireball (#5671) * Updated Upstream and Sidestream(s) (Paper/Airplane/Empirecraft) Upstream/An Sidestream has released updates that appears to apply and compile correctly This update has NOT been tested by YatopiaMC and as with ANY update, please do your own testing. Paper Changes: 2c6b1f048 Revert "Remove itneract event from boat" (Fixes #5677) aae1c54a9 Add command line option to load extra plugin jars not in the plugins folder Airplane Changes: 4a22184 Updated Upstream (Tuinity) Empirecraft Changes: d0aaf527 Updated Paper * Updated Upstream and Sidestream(s) (Airplane/Purpur) Upstream/An Sidestream has released updates that appears to apply and compile correctly This update has NOT been tested by YatopiaMC and as with ANY update, please do your own testing. Airplane Changes: 046ae54 Improve hopper performance via bitset Purpur Changes: c333d3d Add config for the unverified username message (#348) 703b5da Fix invulnerable-while-accepting-resource-pack not being used * Updated Upstream and Sidestream(s) (Paper/Purpur) Upstream/An Sidestream has released updates that appears to apply and compile correctly This update has NOT been tested by YatopiaMC and as with ANY update, please do your own testing. Paper Changes: 6c183f1ae [Auto] Updated Upstream (CraftBukkit) Purpur Changes: e0991e0 allow using legacy section symbol in unverified username message 6bd246b Updated Upstream (Paper) * Updated Upstream and Sidestream(s) (Airplane) Upstream/An Sidestream has released updates that appears to apply and compile correctly This update has NOT been tested by YatopiaMC and as with ANY update, please do your own testing. Airplane Changes: 5fab6a2 Improvements to fluid & profiler patches * Updated Upstream and Sidestream(s) (Paper/Tuinity/Airplane/Purpur/Empirecraft) Upstream/An Sidestream has released updates that appears to apply and compile correctly This update has NOT been tested by YatopiaMC and as with ANY update, please do your own testing. Paper Changes: 41e6073ce [Auto] Updated Upstream (CraftBukkit) 6f93dc95d Add cause to Weather/ThunderChangeEvents (#4832) 507cf19b3 [CI-SKIP] [Auto] Rebuild Patches afe0785bf Added PlayerPurchaseEvent for standalone Merchant GUIs (#5583) 615df3d8a Fix entity motion tag from mob spawners (#5718) 2d34898b5 Add methods for getting default item attributes (#5593) d9766433e Add EntityInsideBlockEvent (#5596) 47d48790d Change return type of ItemStack#editMeta to allow checking for successful vs non-successful edits 7aabe7d56 [CI-SKIP] fix minecart vs minecraft typos (#5713) f775e87b4 [CI-SKIP] ci: update setup-java action (#5710) c58b3b277 ci: replace Java 11 with Java 16 in GH Actions build flow (#5709) 4b72327a6 ItemStack#editMeta 68984b664 Add Unix domain socket support (#5611) 68c67e680 Add Mob#lookAt API (#5633) 4bacecd16 [Auto] Updated Upstream (Bukkit/CraftBukkit) 1f28e6eeb Fix default ChatRenderer when no plugins are installed (#5702) ecb0d32ca Enhance (Async)ChatEvent with per-viewer rendering API (#5684) f3e541ca1 Actually list all missing hard depends (#5701) 11f83fe8e [CI-SKIP] [Auto] Rebuild Patches a36e5d65f MC-148809: Fix incorrect structure block data length 3dcbdc73b Fix force upgrade patch (#5699) dab6ec6cd List all missing hard depends not just first (#5673) aed5031e3 Fix/Optimize world and light datafixes (#5693) 719040d92 [Auto] Updated Upstream (CraftBukkit) Tuinity Changes: f0e91a4 Updated Upstream (Paper) f88659c Fix and optimise world force upgrading Airplane Changes: 636dbff [ci skip] Cleanup mcdev import files c579320 [ci skip] Remove icons 7ada9a4 [skip ci] Need to specify 1.16.5 in the README of course 813df1a Update README daf3f0b Optimize air case for raytracing 1c252a5 Update Tuinity URL 50babee Updated Upstream (Tuinity) 85e0c63 Revert "Allow plugins to stupidly replace server internals" db3fe2c Remove auto import 6b32e01 Allow plugins to stupidly replace server internals f849f00 Flare Update ac10e43 Flare Update 7f3b091 Move check 040fa19 Better checking for useless move packets Purpur Changes: adb0cafe Updated Upstream (Paper) f9ccf6dd Updated Upstream (Paper & Airplane) 1343a050 Updated Upstream (Paper, Tuinity, & Airplane) af2dd61a Updated Upstream (Paper, Tuinity, & Airplane) 1808888a Expand gamemode extra perms some more Empirecraft Changes: 9e2881e6 Don't dismount on teleports... 7ed16bf3 Updated Paper c3d0a1b2 Re-add missing line in Vehicle teleporting patch * drop Improved-oversized-chunk-data-packet-handling.patch
2021-05-27 04:01:31 +02:00
index e2b3470e3c9a97671723f5a67f722fb86fb07fbf..560b441ef35e507236e683b04f6a774c5949a078 100644
--- a/src/main/java/org/bukkit/Material.java
+++ b/src/main/java/org/bukkit/Material.java
Upstream (#490) * Updated Upstream and Sidestream(s) (Paper/Tuinity/Airplane/Purpur/Origami) Upstream/An Sidestream has released updates that appears to apply and compile correctly This update has NOT been tested by YatopiaMC and as with ANY update, please do your own testing. Paper Changes: 151457628 Fix Counter#decrement recursive call (#5665) 21ac7dc98 [Auto] Updated Upstream (CraftBukkit) 18ad2c9dd Add environment variable (PAPER_DISABLE_SERVER_GUI) to disable server gui 6ecbe5776 Rename leftover resource->datapack (#5662) ec90a7859 I give up on trying to teach people to avoid the incorrect ways. dc7b7a160 Fix missing username console death message (#5654) (#5658) c639a52a6 Add basic Datapack API (#5653) (#5653) 99c1d9da6 Updated Upstream (CraftBukkit) (#5652) 2d50c17e2 [CI-SKIP] Add PR rebasing steps (#5634) 2c5f8085e Remove boat interaction event (Fixes #5539) 96ee1fb8f fix WorldSaveEvent not firing with /save-all (#5650) e90e7829e remove unneeded patch (#5641) d875bacc2 Activate warning by default when people are doing silly things (#5642) cb896d471 Updated Upstream (Bukkit/CraftBukkit/Spigot) (#5643) ecbf5a38e Revert "Updated Upstream (Bukkit/CraftBukkit/Spigot) (#5636)" 20fc4ab70 Updated Upstream (Bukkit/CraftBukkit/Spigot) (#5636) 20d8812ea Fix CraftPotionBrewer cache (#5632) cd6ae8816 Add a "Should Burn in Sunlight" API for Phantoms and Skeletons (#5608) 25edfe58b Remove unneeded component conversion for kick msg (#5626) cec386f66 Call PortalCreateEvent when players enter the end (#5618) 453c7f05c Add ItemStack#displayName to get the formatted display name of an ItemStack (#5628) 4efe8b498 Update Java version warning (#5621) e0a021ccc Add ItemStack#getTranslationKey() (#5616) 53d71b717 Add setPotionUseTimeLeft to Witch (#5597) 239935d18 Add Inventory#close (#5610) 29bf6cd41 Updated Upstream (CraftBukkit) ad45f316c Add raw address to AsyncPlayerPreLoginEvent (#5614) 28865335a [Auto] Updated Upstream (CraftBukkit) 750049fa2 Fix incorrect colors in some log messages (#5609) c5fa3f0d4 Add Adventure message to PlayerAdvancementDoneEvent (#5030) 69c09cdb0 Updated Upstream (CraftBukkit) (#5607) Tuinity Changes: 1222573 Fix incorrect status dataconverter for pre 1.13 chunks Airplane Changes: 3dce697 Fix gradle stuff 209bce3 Patches Purpur Changes: 72708f4 Option to disable dragon egg teleporting 5f87a45 Updated Upstream (Paper) 7bfc70d swap heavy logic to end bb9d72d Fix #338 - Phantoms always burning bug 8fa99b3 Configurable critical damage multiplier (#339) dc4a1cb Updated Upstream (Paper & Tuinity) c166841 Configurable powered rail boost modifier (closes #329) (#333) ab9b8ca Updated Upstream (Paper & Airplane) 44e72f7 Let parrots breed using any tempting item 09d98d3 this part is important, too :3 2015fe5 Breedable parrots 552d783 Iron golem poppy calms anger 1fa06a1 Optimize collisions (#328) 1112240 Extend Halloween Optimization (#321) 03f1aec Config for health to impact Creeper explosion radius (#304) 8f7bce4 Add config for hidden from entity selector patch 21906a2 Hide hidden players from entity selector 445496d [ci-skip] fix this too, now.. jfc 3ba8c81 Ya'll didn't see nothing.. 2d4611b Updated Upstream (Paper) beed258 Better offline mode warning (#330) c1efe3c It's meant to be double :facepalm: 3f9958b Implement the Mob Blindness mod 6e98c88 Add missing repo to settings.gradle.kts da5185b Update Gradle to 7.0.1 fbd28d8 Updated Upstream (Paper & Tuinity) cb42dec Updated Upstream (Paper) e883991 Fix compatibility with MyPet Origami Changes: 4c0616d Update Paper * Updated Upstream and Sidestream(s) (Paper) Upstream/An Sidestream has released updates that appears to apply and compile correctly This update has NOT been tested by YatopiaMC and as with ANY update, please do your own testing. Paper Changes: 45e19ffb0 [Auto] Updated Upstream (CraftBukkit) * Updated Upstream and Sidestream(s) (Paper/Purpur) Upstream/An Sidestream has released updates that appears to apply and compile correctly This update has NOT been tested by YatopiaMC and as with ANY update, please do your own testing. Paper Changes: 7989028a5 More Enchantment API (#5588) c0cb5c129 Adds methods for checking item repairability (#5651) 22399b07f Actually use extended/ambient in BeaconEffectEvent (#5647) 979135878 Add cause and cancel message to PlayerGameModeChangeEvent (#5638) 51e1e58d2 Fix Adventure support in UnknownCommandEvent (#5664) Purpur Changes: ca9be56 Do not allow duplicate unsafe enchants * Updated Upstream and Sidestream(s) (Paper/Purpur/Paper) Upstream/An Sidestream has released updates that appears to apply and compile correctly This update has NOT been tested by YatopiaMC and as with ANY update, please do your own testing. Paper Changes: 7989028a5 More Enchantment API (#5588) c0cb5c129 Adds methods for checking item repairability (#5651) 22399b07f Actually use extended/ambient in BeaconEffectEvent (#5647) 979135878 Add cause and cancel message to PlayerGameModeChangeEvent (#5638) 51e1e58d2 Fix Adventure support in UnknownCommandEvent (#5664) Purpur Changes: ca9be56 Do not allow duplicate unsafe enchants Paper Changes: 322886c86 Avoid NPE due to PlayerBedFailEnterEvent d3c9a195c removed duplicate ProjectileHitEvent for fireball (#5671) * Updated Upstream and Sidestream(s) (Paper/Airplane/Empirecraft) Upstream/An Sidestream has released updates that appears to apply and compile correctly This update has NOT been tested by YatopiaMC and as with ANY update, please do your own testing. Paper Changes: 2c6b1f048 Revert "Remove itneract event from boat" (Fixes #5677) aae1c54a9 Add command line option to load extra plugin jars not in the plugins folder Airplane Changes: 4a22184 Updated Upstream (Tuinity) Empirecraft Changes: d0aaf527 Updated Paper * Updated Upstream and Sidestream(s) (Airplane/Purpur) Upstream/An Sidestream has released updates that appears to apply and compile correctly This update has NOT been tested by YatopiaMC and as with ANY update, please do your own testing. Airplane Changes: 046ae54 Improve hopper performance via bitset Purpur Changes: c333d3d Add config for the unverified username message (#348) 703b5da Fix invulnerable-while-accepting-resource-pack not being used * Updated Upstream and Sidestream(s) (Paper/Purpur) Upstream/An Sidestream has released updates that appears to apply and compile correctly This update has NOT been tested by YatopiaMC and as with ANY update, please do your own testing. Paper Changes: 6c183f1ae [Auto] Updated Upstream (CraftBukkit) Purpur Changes: e0991e0 allow using legacy section symbol in unverified username message 6bd246b Updated Upstream (Paper) * Updated Upstream and Sidestream(s) (Airplane) Upstream/An Sidestream has released updates that appears to apply and compile correctly This update has NOT been tested by YatopiaMC and as with ANY update, please do your own testing. Airplane Changes: 5fab6a2 Improvements to fluid & profiler patches * Updated Upstream and Sidestream(s) (Paper/Tuinity/Airplane/Purpur/Empirecraft) Upstream/An Sidestream has released updates that appears to apply and compile correctly This update has NOT been tested by YatopiaMC and as with ANY update, please do your own testing. Paper Changes: 41e6073ce [Auto] Updated Upstream (CraftBukkit) 6f93dc95d Add cause to Weather/ThunderChangeEvents (#4832) 507cf19b3 [CI-SKIP] [Auto] Rebuild Patches afe0785bf Added PlayerPurchaseEvent for standalone Merchant GUIs (#5583) 615df3d8a Fix entity motion tag from mob spawners (#5718) 2d34898b5 Add methods for getting default item attributes (#5593) d9766433e Add EntityInsideBlockEvent (#5596) 47d48790d Change return type of ItemStack#editMeta to allow checking for successful vs non-successful edits 7aabe7d56 [CI-SKIP] fix minecart vs minecraft typos (#5713) f775e87b4 [CI-SKIP] ci: update setup-java action (#5710) c58b3b277 ci: replace Java 11 with Java 16 in GH Actions build flow (#5709) 4b72327a6 ItemStack#editMeta 68984b664 Add Unix domain socket support (#5611) 68c67e680 Add Mob#lookAt API (#5633) 4bacecd16 [Auto] Updated Upstream (Bukkit/CraftBukkit) 1f28e6eeb Fix default ChatRenderer when no plugins are installed (#5702) ecb0d32ca Enhance (Async)ChatEvent with per-viewer rendering API (#5684) f3e541ca1 Actually list all missing hard depends (#5701) 11f83fe8e [CI-SKIP] [Auto] Rebuild Patches a36e5d65f MC-148809: Fix incorrect structure block data length 3dcbdc73b Fix force upgrade patch (#5699) dab6ec6cd List all missing hard depends not just first (#5673) aed5031e3 Fix/Optimize world and light datafixes (#5693) 719040d92 [Auto] Updated Upstream (CraftBukkit) Tuinity Changes: f0e91a4 Updated Upstream (Paper) f88659c Fix and optimise world force upgrading Airplane Changes: 636dbff [ci skip] Cleanup mcdev import files c579320 [ci skip] Remove icons 7ada9a4 [skip ci] Need to specify 1.16.5 in the README of course 813df1a Update README daf3f0b Optimize air case for raytracing 1c252a5 Update Tuinity URL 50babee Updated Upstream (Tuinity) 85e0c63 Revert "Allow plugins to stupidly replace server internals" db3fe2c Remove auto import 6b32e01 Allow plugins to stupidly replace server internals f849f00 Flare Update ac10e43 Flare Update 7f3b091 Move check 040fa19 Better checking for useless move packets Purpur Changes: adb0cafe Updated Upstream (Paper) f9ccf6dd Updated Upstream (Paper & Airplane) 1343a050 Updated Upstream (Paper, Tuinity, & Airplane) af2dd61a Updated Upstream (Paper, Tuinity, & Airplane) 1808888a Expand gamemode extra perms some more Empirecraft Changes: 9e2881e6 Don't dismount on teleports... 7ed16bf3 Updated Paper c3d0a1b2 Re-add missing line in Vehicle teleporting patch * drop Improved-oversized-chunk-data-packet-handling.patch
2021-05-27 04:01:31 +02:00
@@ -8731,4 +8731,40 @@ public enum Material implements Keyed {
// </editor-fold>
}
}
+
+ // Purpur start
+ public boolean isArmor() {
+ switch (this) {
+ // <editor-fold defaultstate="collapsed" desc="isarmor">
+ case LEATHER_BOOTS:
+ case LEATHER_CHESTPLATE:
+ case LEATHER_HELMET:
+ case LEATHER_LEGGINGS:
+ case CHAINMAIL_BOOTS:
+ case CHAINMAIL_CHESTPLATE:
+ case CHAINMAIL_HELMET:
+ case CHAINMAIL_LEGGINGS:
+ case IRON_BOOTS:
+ case IRON_CHESTPLATE:
+ case IRON_HELMET:
+ case IRON_LEGGINGS:
+ case GOLDEN_BOOTS:
+ case GOLDEN_CHESTPLATE:
+ case GOLDEN_HELMET:
+ case GOLDEN_LEGGINGS:
+ case DIAMOND_BOOTS:
+ case DIAMOND_CHESTPLATE:
+ case DIAMOND_HELMET:
+ case DIAMOND_LEGGINGS:
Upstream (#484) * Updated Upstream and Sidestream(s) (Paper/Purpur/Empirecraft) Upstream/An Sidestream has released updates that appears to apply and compile correctly This update has NOT been tested by YatopiaMC and as with ANY update, please do your own testing. Paper Changes: 2a67a9e51 Fix missing CraftMetaBook#toBuilder override 48aa06106 Add more Wandering Trader API (#5020) 8cec462a5 [CI-SKIP] Remove Astei from the MIT list (#5577) 21fbc3196 [CI-SKIP] Add Other textarea to issue templates (#5562) 453e983e4 fix isProxyOnlineMode coverage, don't lookup UUIDs in offline mode (Fixes #2011) 81cc4f928 Send empty commands if tab completion is disabled (Closes #5519) 9ed3e470d Keep moveToWorld with old method signature 99a66a583 [Auto] Updated Upstream (CraftBukkit) 976c6d425 [CI-SKIP] [Auto] Rebuild Patches 51deec726 Drop unneeded portal patch (#5566) 07a18c457 [Auto] Updated Upstream (CraftBukkit) 6733d7875 [Auto] Updated Upstream (Bukkit) 9958447cb [Auto] Updated Upstream (Bukkit) 840e72091 [CI-SKIP] [Auto] Rebuild Patches a33232d4a Add beacon activation and deactivation events (#5121) Purpur Changes: ebc0765 Updated Upstream (Paper) 5bc5dfd Fix #318 - Stonecutter does not damage when sneaking 8366582 Resolve #286 - Add config and API for item immunity to lightning a86555b Updated Upstream (Paper) 8b2607c Config for only sending advancements to affected players (#312) 7ee3393 Add config for the piston push limit (#311) a30e5ac Add config for void damage dealt 786382b Updated Upstream (Paper) 60d8411 [ci-skip] fix patch name b64f536 Config for changing the blocks that turn into paths (#303) 1d3f710 Updated Upstream (Paper) 3af86ad Oopsie 4b0342a Gamemode extra permissions 17c8573 [CI-SKIP] Don't pass ping to demo command output c3481c0 Initialize the credits command output in config a176fe6 Add credits command Empirecraft Changes: b2879a24 Updated Paper * Updated Upstream and Sidestream(s) (Paper/Tuinity/Airplane/Purpur/Empirecraft) Upstream/An Sidestream has released updates that appears to apply and compile correctly This update has NOT been tested by YatopiaMC and as with ANY update, please do your own testing. Paper Changes: b3cc88799 Add the ability to clear entities from block storage (#5598) f50171f3b Add missing rarity method on ItemStack (#5594) aeb6e7dd2 Updated Upstream (Bukkit/CraftBukkit/Spigot) (#5601) b0a4f353b fix cancelling block falling causing client desync (fixes #5386) (#5419) 8ed45920c Don't annotate type parameters using JetBrains annotations (#5600) d7625d926 Add new methods from PlayerMoveEvent to EntityMoveEvent (#5591) 29785297b Allow for Component suggestion tooltips in AsyncTabCompleteEvent (#5504) 0aea6c2ff Use JsonSerializationContext#serialize instead of recursion for AdventureComponents - fixes #5580 and #5371 8fcef3c1f Return after sending empty commands (#5586) Tuinity Changes: 3350246 Updated Upstream (Paper) f773caf Fix rare ticket level recursion crash 0fa8a0e Starlight Handle concurrent chunk generation and lighting better Airplane Changes: fad74c2 Fix JB annotations for gradle (credit jpenilla) d02f034 Updated Upstream (Tuinity) Purpur Changes: adfe5d3 Updated Upstream (Paper) 7a728f8 Fix #325 - Fix SPIGOT-6278 f5c3dae Updated Upstream (Paper) a80e5b6 Dont create item meta when checking if meta properties exist 90339c5 Add missing netherite from Material#isArmor bedac18 Updated Upstream (Paper, Tuinity, & Airplane) 3b1531a [ci-skip] Add wrapper validation step to actions 73ab4e6 Update the "changing the blocks that turn into paths" defaults to reflect the vanilla defaults. (#322) a24b31b Updated Upstream (Paper) Empirecraft Changes: 87ceb204 Updated Paper a3497a7e Fix some patches 2ed9e7fa Updated Paper d5a47a3d Updated Paper * Updated Upstream and Sidestream(s) (Tuinity) Upstream/An Sidestream has released updates that appears to apply and compile correctly This update has NOT been tested by YatopiaMC and as with ANY update, please do your own testing. Tuinity Changes: 1382473 Null check chunk in block changes for Starlight
2021-05-11 05:16:50 +02:00
+ case NETHERITE_BOOTS:
+ case NETHERITE_CHESTPLATE:
+ case NETHERITE_HELMET:
+ case NETHERITE_LEGGINGS:
+ case TURTLE_HELMET:
+ return true;
+ default:
+ return false;
+ }
+ }
+ // Purpur end
}
diff --git a/src/main/java/org/bukkit/inventory/ItemStack.java b/src/main/java/org/bukkit/inventory/ItemStack.java
Upstream (#490) * Updated Upstream and Sidestream(s) (Paper/Tuinity/Airplane/Purpur/Origami) Upstream/An Sidestream has released updates that appears to apply and compile correctly This update has NOT been tested by YatopiaMC and as with ANY update, please do your own testing. Paper Changes: 151457628 Fix Counter#decrement recursive call (#5665) 21ac7dc98 [Auto] Updated Upstream (CraftBukkit) 18ad2c9dd Add environment variable (PAPER_DISABLE_SERVER_GUI) to disable server gui 6ecbe5776 Rename leftover resource->datapack (#5662) ec90a7859 I give up on trying to teach people to avoid the incorrect ways. dc7b7a160 Fix missing username console death message (#5654) (#5658) c639a52a6 Add basic Datapack API (#5653) (#5653) 99c1d9da6 Updated Upstream (CraftBukkit) (#5652) 2d50c17e2 [CI-SKIP] Add PR rebasing steps (#5634) 2c5f8085e Remove boat interaction event (Fixes #5539) 96ee1fb8f fix WorldSaveEvent not firing with /save-all (#5650) e90e7829e remove unneeded patch (#5641) d875bacc2 Activate warning by default when people are doing silly things (#5642) cb896d471 Updated Upstream (Bukkit/CraftBukkit/Spigot) (#5643) ecbf5a38e Revert "Updated Upstream (Bukkit/CraftBukkit/Spigot) (#5636)" 20fc4ab70 Updated Upstream (Bukkit/CraftBukkit/Spigot) (#5636) 20d8812ea Fix CraftPotionBrewer cache (#5632) cd6ae8816 Add a "Should Burn in Sunlight" API for Phantoms and Skeletons (#5608) 25edfe58b Remove unneeded component conversion for kick msg (#5626) cec386f66 Call PortalCreateEvent when players enter the end (#5618) 453c7f05c Add ItemStack#displayName to get the formatted display name of an ItemStack (#5628) 4efe8b498 Update Java version warning (#5621) e0a021ccc Add ItemStack#getTranslationKey() (#5616) 53d71b717 Add setPotionUseTimeLeft to Witch (#5597) 239935d18 Add Inventory#close (#5610) 29bf6cd41 Updated Upstream (CraftBukkit) ad45f316c Add raw address to AsyncPlayerPreLoginEvent (#5614) 28865335a [Auto] Updated Upstream (CraftBukkit) 750049fa2 Fix incorrect colors in some log messages (#5609) c5fa3f0d4 Add Adventure message to PlayerAdvancementDoneEvent (#5030) 69c09cdb0 Updated Upstream (CraftBukkit) (#5607) Tuinity Changes: 1222573 Fix incorrect status dataconverter for pre 1.13 chunks Airplane Changes: 3dce697 Fix gradle stuff 209bce3 Patches Purpur Changes: 72708f4 Option to disable dragon egg teleporting 5f87a45 Updated Upstream (Paper) 7bfc70d swap heavy logic to end bb9d72d Fix #338 - Phantoms always burning bug 8fa99b3 Configurable critical damage multiplier (#339) dc4a1cb Updated Upstream (Paper & Tuinity) c166841 Configurable powered rail boost modifier (closes #329) (#333) ab9b8ca Updated Upstream (Paper & Airplane) 44e72f7 Let parrots breed using any tempting item 09d98d3 this part is important, too :3 2015fe5 Breedable parrots 552d783 Iron golem poppy calms anger 1fa06a1 Optimize collisions (#328) 1112240 Extend Halloween Optimization (#321) 03f1aec Config for health to impact Creeper explosion radius (#304) 8f7bce4 Add config for hidden from entity selector patch 21906a2 Hide hidden players from entity selector 445496d [ci-skip] fix this too, now.. jfc 3ba8c81 Ya'll didn't see nothing.. 2d4611b Updated Upstream (Paper) beed258 Better offline mode warning (#330) c1efe3c It's meant to be double :facepalm: 3f9958b Implement the Mob Blindness mod 6e98c88 Add missing repo to settings.gradle.kts da5185b Update Gradle to 7.0.1 fbd28d8 Updated Upstream (Paper & Tuinity) cb42dec Updated Upstream (Paper) e883991 Fix compatibility with MyPet Origami Changes: 4c0616d Update Paper * Updated Upstream and Sidestream(s) (Paper) Upstream/An Sidestream has released updates that appears to apply and compile correctly This update has NOT been tested by YatopiaMC and as with ANY update, please do your own testing. Paper Changes: 45e19ffb0 [Auto] Updated Upstream (CraftBukkit) * Updated Upstream and Sidestream(s) (Paper/Purpur) Upstream/An Sidestream has released updates that appears to apply and compile correctly This update has NOT been tested by YatopiaMC and as with ANY update, please do your own testing. Paper Changes: 7989028a5 More Enchantment API (#5588) c0cb5c129 Adds methods for checking item repairability (#5651) 22399b07f Actually use extended/ambient in BeaconEffectEvent (#5647) 979135878 Add cause and cancel message to PlayerGameModeChangeEvent (#5638) 51e1e58d2 Fix Adventure support in UnknownCommandEvent (#5664) Purpur Changes: ca9be56 Do not allow duplicate unsafe enchants * Updated Upstream and Sidestream(s) (Paper/Purpur/Paper) Upstream/An Sidestream has released updates that appears to apply and compile correctly This update has NOT been tested by YatopiaMC and as with ANY update, please do your own testing. Paper Changes: 7989028a5 More Enchantment API (#5588) c0cb5c129 Adds methods for checking item repairability (#5651) 22399b07f Actually use extended/ambient in BeaconEffectEvent (#5647) 979135878 Add cause and cancel message to PlayerGameModeChangeEvent (#5638) 51e1e58d2 Fix Adventure support in UnknownCommandEvent (#5664) Purpur Changes: ca9be56 Do not allow duplicate unsafe enchants Paper Changes: 322886c86 Avoid NPE due to PlayerBedFailEnterEvent d3c9a195c removed duplicate ProjectileHitEvent for fireball (#5671) * Updated Upstream and Sidestream(s) (Paper/Airplane/Empirecraft) Upstream/An Sidestream has released updates that appears to apply and compile correctly This update has NOT been tested by YatopiaMC and as with ANY update, please do your own testing. Paper Changes: 2c6b1f048 Revert "Remove itneract event from boat" (Fixes #5677) aae1c54a9 Add command line option to load extra plugin jars not in the plugins folder Airplane Changes: 4a22184 Updated Upstream (Tuinity) Empirecraft Changes: d0aaf527 Updated Paper * Updated Upstream and Sidestream(s) (Airplane/Purpur) Upstream/An Sidestream has released updates that appears to apply and compile correctly This update has NOT been tested by YatopiaMC and as with ANY update, please do your own testing. Airplane Changes: 046ae54 Improve hopper performance via bitset Purpur Changes: c333d3d Add config for the unverified username message (#348) 703b5da Fix invulnerable-while-accepting-resource-pack not being used * Updated Upstream and Sidestream(s) (Paper/Purpur) Upstream/An Sidestream has released updates that appears to apply and compile correctly This update has NOT been tested by YatopiaMC and as with ANY update, please do your own testing. Paper Changes: 6c183f1ae [Auto] Updated Upstream (CraftBukkit) Purpur Changes: e0991e0 allow using legacy section symbol in unverified username message 6bd246b Updated Upstream (Paper) * Updated Upstream and Sidestream(s) (Airplane) Upstream/An Sidestream has released updates that appears to apply and compile correctly This update has NOT been tested by YatopiaMC and as with ANY update, please do your own testing. Airplane Changes: 5fab6a2 Improvements to fluid & profiler patches * Updated Upstream and Sidestream(s) (Paper/Tuinity/Airplane/Purpur/Empirecraft) Upstream/An Sidestream has released updates that appears to apply and compile correctly This update has NOT been tested by YatopiaMC and as with ANY update, please do your own testing. Paper Changes: 41e6073ce [Auto] Updated Upstream (CraftBukkit) 6f93dc95d Add cause to Weather/ThunderChangeEvents (#4832) 507cf19b3 [CI-SKIP] [Auto] Rebuild Patches afe0785bf Added PlayerPurchaseEvent for standalone Merchant GUIs (#5583) 615df3d8a Fix entity motion tag from mob spawners (#5718) 2d34898b5 Add methods for getting default item attributes (#5593) d9766433e Add EntityInsideBlockEvent (#5596) 47d48790d Change return type of ItemStack#editMeta to allow checking for successful vs non-successful edits 7aabe7d56 [CI-SKIP] fix minecart vs minecraft typos (#5713) f775e87b4 [CI-SKIP] ci: update setup-java action (#5710) c58b3b277 ci: replace Java 11 with Java 16 in GH Actions build flow (#5709) 4b72327a6 ItemStack#editMeta 68984b664 Add Unix domain socket support (#5611) 68c67e680 Add Mob#lookAt API (#5633) 4bacecd16 [Auto] Updated Upstream (Bukkit/CraftBukkit) 1f28e6eeb Fix default ChatRenderer when no plugins are installed (#5702) ecb0d32ca Enhance (Async)ChatEvent with per-viewer rendering API (#5684) f3e541ca1 Actually list all missing hard depends (#5701) 11f83fe8e [CI-SKIP] [Auto] Rebuild Patches a36e5d65f MC-148809: Fix incorrect structure block data length 3dcbdc73b Fix force upgrade patch (#5699) dab6ec6cd List all missing hard depends not just first (#5673) aed5031e3 Fix/Optimize world and light datafixes (#5693) 719040d92 [Auto] Updated Upstream (CraftBukkit) Tuinity Changes: f0e91a4 Updated Upstream (Paper) f88659c Fix and optimise world force upgrading Airplane Changes: 636dbff [ci skip] Cleanup mcdev import files c579320 [ci skip] Remove icons 7ada9a4 [skip ci] Need to specify 1.16.5 in the README of course 813df1a Update README daf3f0b Optimize air case for raytracing 1c252a5 Update Tuinity URL 50babee Updated Upstream (Tuinity) 85e0c63 Revert "Allow plugins to stupidly replace server internals" db3fe2c Remove auto import 6b32e01 Allow plugins to stupidly replace server internals f849f00 Flare Update ac10e43 Flare Update 7f3b091 Move check 040fa19 Better checking for useless move packets Purpur Changes: adb0cafe Updated Upstream (Paper) f9ccf6dd Updated Upstream (Paper & Airplane) 1343a050 Updated Upstream (Paper, Tuinity, & Airplane) af2dd61a Updated Upstream (Paper, Tuinity, & Airplane) 1808888a Expand gamemode extra perms some more Empirecraft Changes: 9e2881e6 Don't dismount on teleports... 7ed16bf3 Updated Paper c3d0a1b2 Re-add missing line in Vehicle teleporting patch * drop Improved-oversized-chunk-data-packet-handling.patch
2021-05-27 04:01:31 +02:00
index 3e2c08641edffcf00b230ad624685aaff30af0e5..fceba6780a15c274c4689eccbeb6dfb2eee25ed9 100644
--- a/src/main/java/org/bukkit/inventory/ItemStack.java
+++ b/src/main/java/org/bukkit/inventory/ItemStack.java
@@ -17,6 +17,18 @@ import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.material.MaterialData;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
+// Purpur start
+import com.google.common.collect.Multimap;
+import java.util.Collection;
+import org.bukkit.attribute.Attribute;
+import org.bukkit.attribute.AttributeModifier;
+import org.bukkit.block.data.BlockData;
+import org.bukkit.inventory.meta.BlockDataMeta;
+import org.bukkit.inventory.meta.Repairable;
+import org.bukkit.persistence.PersistentDataContainer;
+import org.bukkit.persistence.PersistentDataHolder;
+import com.destroystokyo.paper.Namespaced;
+// Purpur end
/**
* Represents a stack of items.
Upstream (#490) * Updated Upstream and Sidestream(s) (Paper/Tuinity/Airplane/Purpur/Origami) Upstream/An Sidestream has released updates that appears to apply and compile correctly This update has NOT been tested by YatopiaMC and as with ANY update, please do your own testing. Paper Changes: 151457628 Fix Counter#decrement recursive call (#5665) 21ac7dc98 [Auto] Updated Upstream (CraftBukkit) 18ad2c9dd Add environment variable (PAPER_DISABLE_SERVER_GUI) to disable server gui 6ecbe5776 Rename leftover resource->datapack (#5662) ec90a7859 I give up on trying to teach people to avoid the incorrect ways. dc7b7a160 Fix missing username console death message (#5654) (#5658) c639a52a6 Add basic Datapack API (#5653) (#5653) 99c1d9da6 Updated Upstream (CraftBukkit) (#5652) 2d50c17e2 [CI-SKIP] Add PR rebasing steps (#5634) 2c5f8085e Remove boat interaction event (Fixes #5539) 96ee1fb8f fix WorldSaveEvent not firing with /save-all (#5650) e90e7829e remove unneeded patch (#5641) d875bacc2 Activate warning by default when people are doing silly things (#5642) cb896d471 Updated Upstream (Bukkit/CraftBukkit/Spigot) (#5643) ecbf5a38e Revert "Updated Upstream (Bukkit/CraftBukkit/Spigot) (#5636)" 20fc4ab70 Updated Upstream (Bukkit/CraftBukkit/Spigot) (#5636) 20d8812ea Fix CraftPotionBrewer cache (#5632) cd6ae8816 Add a "Should Burn in Sunlight" API for Phantoms and Skeletons (#5608) 25edfe58b Remove unneeded component conversion for kick msg (#5626) cec386f66 Call PortalCreateEvent when players enter the end (#5618) 453c7f05c Add ItemStack#displayName to get the formatted display name of an ItemStack (#5628) 4efe8b498 Update Java version warning (#5621) e0a021ccc Add ItemStack#getTranslationKey() (#5616) 53d71b717 Add setPotionUseTimeLeft to Witch (#5597) 239935d18 Add Inventory#close (#5610) 29bf6cd41 Updated Upstream (CraftBukkit) ad45f316c Add raw address to AsyncPlayerPreLoginEvent (#5614) 28865335a [Auto] Updated Upstream (CraftBukkit) 750049fa2 Fix incorrect colors in some log messages (#5609) c5fa3f0d4 Add Adventure message to PlayerAdvancementDoneEvent (#5030) 69c09cdb0 Updated Upstream (CraftBukkit) (#5607) Tuinity Changes: 1222573 Fix incorrect status dataconverter for pre 1.13 chunks Airplane Changes: 3dce697 Fix gradle stuff 209bce3 Patches Purpur Changes: 72708f4 Option to disable dragon egg teleporting 5f87a45 Updated Upstream (Paper) 7bfc70d swap heavy logic to end bb9d72d Fix #338 - Phantoms always burning bug 8fa99b3 Configurable critical damage multiplier (#339) dc4a1cb Updated Upstream (Paper & Tuinity) c166841 Configurable powered rail boost modifier (closes #329) (#333) ab9b8ca Updated Upstream (Paper & Airplane) 44e72f7 Let parrots breed using any tempting item 09d98d3 this part is important, too :3 2015fe5 Breedable parrots 552d783 Iron golem poppy calms anger 1fa06a1 Optimize collisions (#328) 1112240 Extend Halloween Optimization (#321) 03f1aec Config for health to impact Creeper explosion radius (#304) 8f7bce4 Add config for hidden from entity selector patch 21906a2 Hide hidden players from entity selector 445496d [ci-skip] fix this too, now.. jfc 3ba8c81 Ya'll didn't see nothing.. 2d4611b Updated Upstream (Paper) beed258 Better offline mode warning (#330) c1efe3c It's meant to be double :facepalm: 3f9958b Implement the Mob Blindness mod 6e98c88 Add missing repo to settings.gradle.kts da5185b Update Gradle to 7.0.1 fbd28d8 Updated Upstream (Paper & Tuinity) cb42dec Updated Upstream (Paper) e883991 Fix compatibility with MyPet Origami Changes: 4c0616d Update Paper * Updated Upstream and Sidestream(s) (Paper) Upstream/An Sidestream has released updates that appears to apply and compile correctly This update has NOT been tested by YatopiaMC and as with ANY update, please do your own testing. Paper Changes: 45e19ffb0 [Auto] Updated Upstream (CraftBukkit) * Updated Upstream and Sidestream(s) (Paper/Purpur) Upstream/An Sidestream has released updates that appears to apply and compile correctly This update has NOT been tested by YatopiaMC and as with ANY update, please do your own testing. Paper Changes: 7989028a5 More Enchantment API (#5588) c0cb5c129 Adds methods for checking item repairability (#5651) 22399b07f Actually use extended/ambient in BeaconEffectEvent (#5647) 979135878 Add cause and cancel message to PlayerGameModeChangeEvent (#5638) 51e1e58d2 Fix Adventure support in UnknownCommandEvent (#5664) Purpur Changes: ca9be56 Do not allow duplicate unsafe enchants * Updated Upstream and Sidestream(s) (Paper/Purpur/Paper) Upstream/An Sidestream has released updates that appears to apply and compile correctly This update has NOT been tested by YatopiaMC and as with ANY update, please do your own testing. Paper Changes: 7989028a5 More Enchantment API (#5588) c0cb5c129 Adds methods for checking item repairability (#5651) 22399b07f Actually use extended/ambient in BeaconEffectEvent (#5647) 979135878 Add cause and cancel message to PlayerGameModeChangeEvent (#5638) 51e1e58d2 Fix Adventure support in UnknownCommandEvent (#5664) Purpur Changes: ca9be56 Do not allow duplicate unsafe enchants Paper Changes: 322886c86 Avoid NPE due to PlayerBedFailEnterEvent d3c9a195c removed duplicate ProjectileHitEvent for fireball (#5671) * Updated Upstream and Sidestream(s) (Paper/Airplane/Empirecraft) Upstream/An Sidestream has released updates that appears to apply and compile correctly This update has NOT been tested by YatopiaMC and as with ANY update, please do your own testing. Paper Changes: 2c6b1f048 Revert "Remove itneract event from boat" (Fixes #5677) aae1c54a9 Add command line option to load extra plugin jars not in the plugins folder Airplane Changes: 4a22184 Updated Upstream (Tuinity) Empirecraft Changes: d0aaf527 Updated Paper * Updated Upstream and Sidestream(s) (Airplane/Purpur) Upstream/An Sidestream has released updates that appears to apply and compile correctly This update has NOT been tested by YatopiaMC and as with ANY update, please do your own testing. Airplane Changes: 046ae54 Improve hopper performance via bitset Purpur Changes: c333d3d Add config for the unverified username message (#348) 703b5da Fix invulnerable-while-accepting-resource-pack not being used * Updated Upstream and Sidestream(s) (Paper/Purpur) Upstream/An Sidestream has released updates that appears to apply and compile correctly This update has NOT been tested by YatopiaMC and as with ANY update, please do your own testing. Paper Changes: 6c183f1ae [Auto] Updated Upstream (CraftBukkit) Purpur Changes: e0991e0 allow using legacy section symbol in unverified username message 6bd246b Updated Upstream (Paper) * Updated Upstream and Sidestream(s) (Airplane) Upstream/An Sidestream has released updates that appears to apply and compile correctly This update has NOT been tested by YatopiaMC and as with ANY update, please do your own testing. Airplane Changes: 5fab6a2 Improvements to fluid & profiler patches * Updated Upstream and Sidestream(s) (Paper/Tuinity/Airplane/Purpur/Empirecraft) Upstream/An Sidestream has released updates that appears to apply and compile correctly This update has NOT been tested by YatopiaMC and as with ANY update, please do your own testing. Paper Changes: 41e6073ce [Auto] Updated Upstream (CraftBukkit) 6f93dc95d Add cause to Weather/ThunderChangeEvents (#4832) 507cf19b3 [CI-SKIP] [Auto] Rebuild Patches afe0785bf Added PlayerPurchaseEvent for standalone Merchant GUIs (#5583) 615df3d8a Fix entity motion tag from mob spawners (#5718) 2d34898b5 Add methods for getting default item attributes (#5593) d9766433e Add EntityInsideBlockEvent (#5596) 47d48790d Change return type of ItemStack#editMeta to allow checking for successful vs non-successful edits 7aabe7d56 [CI-SKIP] fix minecart vs minecraft typos (#5713) f775e87b4 [CI-SKIP] ci: update setup-java action (#5710) c58b3b277 ci: replace Java 11 with Java 16 in GH Actions build flow (#5709) 4b72327a6 ItemStack#editMeta 68984b664 Add Unix domain socket support (#5611) 68c67e680 Add Mob#lookAt API (#5633) 4bacecd16 [Auto] Updated Upstream (Bukkit/CraftBukkit) 1f28e6eeb Fix default ChatRenderer when no plugins are installed (#5702) ecb0d32ca Enhance (Async)ChatEvent with per-viewer rendering API (#5684) f3e541ca1 Actually list all missing hard depends (#5701) 11f83fe8e [CI-SKIP] [Auto] Rebuild Patches a36e5d65f MC-148809: Fix incorrect structure block data length 3dcbdc73b Fix force upgrade patch (#5699) dab6ec6cd List all missing hard depends not just first (#5673) aed5031e3 Fix/Optimize world and light datafixes (#5693) 719040d92 [Auto] Updated Upstream (CraftBukkit) Tuinity Changes: f0e91a4 Updated Upstream (Paper) f88659c Fix and optimise world force upgrading Airplane Changes: 636dbff [ci skip] Cleanup mcdev import files c579320 [ci skip] Remove icons 7ada9a4 [skip ci] Need to specify 1.16.5 in the README of course 813df1a Update README daf3f0b Optimize air case for raytracing 1c252a5 Update Tuinity URL 50babee Updated Upstream (Tuinity) 85e0c63 Revert "Allow plugins to stupidly replace server internals" db3fe2c Remove auto import 6b32e01 Allow plugins to stupidly replace server internals f849f00 Flare Update ac10e43 Flare Update 7f3b091 Move check 040fa19 Better checking for useless move packets Purpur Changes: adb0cafe Updated Upstream (Paper) f9ccf6dd Updated Upstream (Paper & Airplane) 1343a050 Updated Upstream (Paper, Tuinity, & Airplane) af2dd61a Updated Upstream (Paper, Tuinity, & Airplane) 1808888a Expand gamemode extra perms some more Empirecraft Changes: 9e2881e6 Don't dismount on teleports... 7ed16bf3 Updated Paper c3d0a1b2 Re-add missing line in Vehicle teleporting patch * drop Improved-oversized-chunk-data-packet-handling.patch
2021-05-27 04:01:31 +02:00
@@ -914,4 +926,626 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, net.kyor
return Bukkit.getUnsafe().isValidRepairItemStack(toBeRepaired, this);
}
// Paper end
+
+ // Purpur start
+ /**
+ * Gets the display name that is set.
+ * <p>
+ * Plugins should check that hasDisplayName() returns <code>true</code>
+ * before calling this method.
+ *
+ * @return the display name that is set
+ */
+ @NotNull
+ public String getDisplayName() {
+ return getItemMeta().getDisplayName();
+ }
+
+ /**
+ * Sets the display name.
+ *
+ * @param name the name to set
+ */
+ public void setDisplayName(@Nullable String name) {
+ ItemMeta itemMeta = getItemMeta();
+ itemMeta.setDisplayName(name);
+ setItemMeta(itemMeta);
+ }
+
+ /**
+ * Checks for existence of a display name.
+ *
+ * @return true if this has a display name
+ */
+ public boolean hasDisplayName() {
Upstream (#484) * Updated Upstream and Sidestream(s) (Paper/Purpur/Empirecraft) Upstream/An Sidestream has released updates that appears to apply and compile correctly This update has NOT been tested by YatopiaMC and as with ANY update, please do your own testing. Paper Changes: 2a67a9e51 Fix missing CraftMetaBook#toBuilder override 48aa06106 Add more Wandering Trader API (#5020) 8cec462a5 [CI-SKIP] Remove Astei from the MIT list (#5577) 21fbc3196 [CI-SKIP] Add Other textarea to issue templates (#5562) 453e983e4 fix isProxyOnlineMode coverage, don't lookup UUIDs in offline mode (Fixes #2011) 81cc4f928 Send empty commands if tab completion is disabled (Closes #5519) 9ed3e470d Keep moveToWorld with old method signature 99a66a583 [Auto] Updated Upstream (CraftBukkit) 976c6d425 [CI-SKIP] [Auto] Rebuild Patches 51deec726 Drop unneeded portal patch (#5566) 07a18c457 [Auto] Updated Upstream (CraftBukkit) 6733d7875 [Auto] Updated Upstream (Bukkit) 9958447cb [Auto] Updated Upstream (Bukkit) 840e72091 [CI-SKIP] [Auto] Rebuild Patches a33232d4a Add beacon activation and deactivation events (#5121) Purpur Changes: ebc0765 Updated Upstream (Paper) 5bc5dfd Fix #318 - Stonecutter does not damage when sneaking 8366582 Resolve #286 - Add config and API for item immunity to lightning a86555b Updated Upstream (Paper) 8b2607c Config for only sending advancements to affected players (#312) 7ee3393 Add config for the piston push limit (#311) a30e5ac Add config for void damage dealt 786382b Updated Upstream (Paper) 60d8411 [ci-skip] fix patch name b64f536 Config for changing the blocks that turn into paths (#303) 1d3f710 Updated Upstream (Paper) 3af86ad Oopsie 4b0342a Gamemode extra permissions 17c8573 [CI-SKIP] Don't pass ping to demo command output c3481c0 Initialize the credits command output in config a176fe6 Add credits command Empirecraft Changes: b2879a24 Updated Paper * Updated Upstream and Sidestream(s) (Paper/Tuinity/Airplane/Purpur/Empirecraft) Upstream/An Sidestream has released updates that appears to apply and compile correctly This update has NOT been tested by YatopiaMC and as with ANY update, please do your own testing. Paper Changes: b3cc88799 Add the ability to clear entities from block storage (#5598) f50171f3b Add missing rarity method on ItemStack (#5594) aeb6e7dd2 Updated Upstream (Bukkit/CraftBukkit/Spigot) (#5601) b0a4f353b fix cancelling block falling causing client desync (fixes #5386) (#5419) 8ed45920c Don't annotate type parameters using JetBrains annotations (#5600) d7625d926 Add new methods from PlayerMoveEvent to EntityMoveEvent (#5591) 29785297b Allow for Component suggestion tooltips in AsyncTabCompleteEvent (#5504) 0aea6c2ff Use JsonSerializationContext#serialize instead of recursion for AdventureComponents - fixes #5580 and #5371 8fcef3c1f Return after sending empty commands (#5586) Tuinity Changes: 3350246 Updated Upstream (Paper) f773caf Fix rare ticket level recursion crash 0fa8a0e Starlight Handle concurrent chunk generation and lighting better Airplane Changes: fad74c2 Fix JB annotations for gradle (credit jpenilla) d02f034 Updated Upstream (Tuinity) Purpur Changes: adfe5d3 Updated Upstream (Paper) 7a728f8 Fix #325 - Fix SPIGOT-6278 f5c3dae Updated Upstream (Paper) a80e5b6 Dont create item meta when checking if meta properties exist 90339c5 Add missing netherite from Material#isArmor bedac18 Updated Upstream (Paper, Tuinity, & Airplane) 3b1531a [ci-skip] Add wrapper validation step to actions 73ab4e6 Update the "changing the blocks that turn into paths" defaults to reflect the vanilla defaults. (#322) a24b31b Updated Upstream (Paper) Empirecraft Changes: 87ceb204 Updated Paper a3497a7e Fix some patches 2ed9e7fa Updated Paper d5a47a3d Updated Paper * Updated Upstream and Sidestream(s) (Tuinity) Upstream/An Sidestream has released updates that appears to apply and compile correctly This update has NOT been tested by YatopiaMC and as with ANY update, please do your own testing. Tuinity Changes: 1382473 Null check chunk in block changes for Starlight
2021-05-11 05:16:50 +02:00
+ return hasItemMeta() && getItemMeta().hasDisplayName();
+ }
+
+ /**
+ * Gets the localized display name that is set.
+ * <p>
+ * Plugins should check that hasLocalizedName() returns <code>true</code>
+ * before calling this method.
+ *
+ * @return the localized name that is set
+ */
+ @NotNull
+ public String getLocalizedName() {
+ return getItemMeta().getLocalizedName();
+ }
+
+ /**
+ * Sets the localized name.
+ *
+ * @param name the name to set
+ */
+ public void setLocalizedName(@Nullable String name) {
+ ItemMeta itemMeta = getItemMeta();
+ itemMeta.setLocalizedName(name);
+ setItemMeta(itemMeta);
+ }
+
+ /**
+ * Checks for existence of a localized name.
+ *
+ * @return true if this has a localized name
+ */
+ public boolean hasLocalizedName() {
Upstream (#484) * Updated Upstream and Sidestream(s) (Paper/Purpur/Empirecraft) Upstream/An Sidestream has released updates that appears to apply and compile correctly This update has NOT been tested by YatopiaMC and as with ANY update, please do your own testing. Paper Changes: 2a67a9e51 Fix missing CraftMetaBook#toBuilder override 48aa06106 Add more Wandering Trader API (#5020) 8cec462a5 [CI-SKIP] Remove Astei from the MIT list (#5577) 21fbc3196 [CI-SKIP] Add Other textarea to issue templates (#5562) 453e983e4 fix isProxyOnlineMode coverage, don't lookup UUIDs in offline mode (Fixes #2011) 81cc4f928 Send empty commands if tab completion is disabled (Closes #5519) 9ed3e470d Keep moveToWorld with old method signature 99a66a583 [Auto] Updated Upstream (CraftBukkit) 976c6d425 [CI-SKIP] [Auto] Rebuild Patches 51deec726 Drop unneeded portal patch (#5566) 07a18c457 [Auto] Updated Upstream (CraftBukkit) 6733d7875 [Auto] Updated Upstream (Bukkit) 9958447cb [Auto] Updated Upstream (Bukkit) 840e72091 [CI-SKIP] [Auto] Rebuild Patches a33232d4a Add beacon activation and deactivation events (#5121) Purpur Changes: ebc0765 Updated Upstream (Paper) 5bc5dfd Fix #318 - Stonecutter does not damage when sneaking 8366582 Resolve #286 - Add config and API for item immunity to lightning a86555b Updated Upstream (Paper) 8b2607c Config for only sending advancements to affected players (#312) 7ee3393 Add config for the piston push limit (#311) a30e5ac Add config for void damage dealt 786382b Updated Upstream (Paper) 60d8411 [ci-skip] fix patch name b64f536 Config for changing the blocks that turn into paths (#303) 1d3f710 Updated Upstream (Paper) 3af86ad Oopsie 4b0342a Gamemode extra permissions 17c8573 [CI-SKIP] Don't pass ping to demo command output c3481c0 Initialize the credits command output in config a176fe6 Add credits command Empirecraft Changes: b2879a24 Updated Paper * Updated Upstream and Sidestream(s) (Paper/Tuinity/Airplane/Purpur/Empirecraft) Upstream/An Sidestream has released updates that appears to apply and compile correctly This update has NOT been tested by YatopiaMC and as with ANY update, please do your own testing. Paper Changes: b3cc88799 Add the ability to clear entities from block storage (#5598) f50171f3b Add missing rarity method on ItemStack (#5594) aeb6e7dd2 Updated Upstream (Bukkit/CraftBukkit/Spigot) (#5601) b0a4f353b fix cancelling block falling causing client desync (fixes #5386) (#5419) 8ed45920c Don't annotate type parameters using JetBrains annotations (#5600) d7625d926 Add new methods from PlayerMoveEvent to EntityMoveEvent (#5591) 29785297b Allow for Component suggestion tooltips in AsyncTabCompleteEvent (#5504) 0aea6c2ff Use JsonSerializationContext#serialize instead of recursion for AdventureComponents - fixes #5580 and #5371 8fcef3c1f Return after sending empty commands (#5586) Tuinity Changes: 3350246 Updated Upstream (Paper) f773caf Fix rare ticket level recursion crash 0fa8a0e Starlight Handle concurrent chunk generation and lighting better Airplane Changes: fad74c2 Fix JB annotations for gradle (credit jpenilla) d02f034 Updated Upstream (Tuinity) Purpur Changes: adfe5d3 Updated Upstream (Paper) 7a728f8 Fix #325 - Fix SPIGOT-6278 f5c3dae Updated Upstream (Paper) a80e5b6 Dont create item meta when checking if meta properties exist 90339c5 Add missing netherite from Material#isArmor bedac18 Updated Upstream (Paper, Tuinity, & Airplane) 3b1531a [ci-skip] Add wrapper validation step to actions 73ab4e6 Update the "changing the blocks that turn into paths" defaults to reflect the vanilla defaults. (#322) a24b31b Updated Upstream (Paper) Empirecraft Changes: 87ceb204 Updated Paper a3497a7e Fix some patches 2ed9e7fa Updated Paper d5a47a3d Updated Paper * Updated Upstream and Sidestream(s) (Tuinity) Upstream/An Sidestream has released updates that appears to apply and compile correctly This update has NOT been tested by YatopiaMC and as with ANY update, please do your own testing. Tuinity Changes: 1382473 Null check chunk in block changes for Starlight
2021-05-11 05:16:50 +02:00
+ return hasItemMeta() && getItemMeta().hasLocalizedName();
+ }
+
+ /**
+ * Checks for existence of lore.
+ *
+ * @return true if this has lore
+ */
+ public boolean hasLore() {
Upstream (#484) * Updated Upstream and Sidestream(s) (Paper/Purpur/Empirecraft) Upstream/An Sidestream has released updates that appears to apply and compile correctly This update has NOT been tested by YatopiaMC and as with ANY update, please do your own testing. Paper Changes: 2a67a9e51 Fix missing CraftMetaBook#toBuilder override 48aa06106 Add more Wandering Trader API (#5020) 8cec462a5 [CI-SKIP] Remove Astei from the MIT list (#5577) 21fbc3196 [CI-SKIP] Add Other textarea to issue templates (#5562) 453e983e4 fix isProxyOnlineMode coverage, don't lookup UUIDs in offline mode (Fixes #2011) 81cc4f928 Send empty commands if tab completion is disabled (Closes #5519) 9ed3e470d Keep moveToWorld with old method signature 99a66a583 [Auto] Updated Upstream (CraftBukkit) 976c6d425 [CI-SKIP] [Auto] Rebuild Patches 51deec726 Drop unneeded portal patch (#5566) 07a18c457 [Auto] Updated Upstream (CraftBukkit) 6733d7875 [Auto] Updated Upstream (Bukkit) 9958447cb [Auto] Updated Upstream (Bukkit) 840e72091 [CI-SKIP] [Auto] Rebuild Patches a33232d4a Add beacon activation and deactivation events (#5121) Purpur Changes: ebc0765 Updated Upstream (Paper) 5bc5dfd Fix #318 - Stonecutter does not damage when sneaking 8366582 Resolve #286 - Add config and API for item immunity to lightning a86555b Updated Upstream (Paper) 8b2607c Config for only sending advancements to affected players (#312) 7ee3393 Add config for the piston push limit (#311) a30e5ac Add config for void damage dealt 786382b Updated Upstream (Paper) 60d8411 [ci-skip] fix patch name b64f536 Config for changing the blocks that turn into paths (#303) 1d3f710 Updated Upstream (Paper) 3af86ad Oopsie 4b0342a Gamemode extra permissions 17c8573 [CI-SKIP] Don't pass ping to demo command output c3481c0 Initialize the credits command output in config a176fe6 Add credits command Empirecraft Changes: b2879a24 Updated Paper * Updated Upstream and Sidestream(s) (Paper/Tuinity/Airplane/Purpur/Empirecraft) Upstream/An Sidestream has released updates that appears to apply and compile correctly This update has NOT been tested by YatopiaMC and as with ANY update, please do your own testing. Paper Changes: b3cc88799 Add the ability to clear entities from block storage (#5598) f50171f3b Add missing rarity method on ItemStack (#5594) aeb6e7dd2 Updated Upstream (Bukkit/CraftBukkit/Spigot) (#5601) b0a4f353b fix cancelling block falling causing client desync (fixes #5386) (#5419) 8ed45920c Don't annotate type parameters using JetBrains annotations (#5600) d7625d926 Add new methods from PlayerMoveEvent to EntityMoveEvent (#5591) 29785297b Allow for Component suggestion tooltips in AsyncTabCompleteEvent (#5504) 0aea6c2ff Use JsonSerializationContext#serialize instead of recursion for AdventureComponents - fixes #5580 and #5371 8fcef3c1f Return after sending empty commands (#5586) Tuinity Changes: 3350246 Updated Upstream (Paper) f773caf Fix rare ticket level recursion crash 0fa8a0e Starlight Handle concurrent chunk generation and lighting better Airplane Changes: fad74c2 Fix JB annotations for gradle (credit jpenilla) d02f034 Updated Upstream (Tuinity) Purpur Changes: adfe5d3 Updated Upstream (Paper) 7a728f8 Fix #325 - Fix SPIGOT-6278 f5c3dae Updated Upstream (Paper) a80e5b6 Dont create item meta when checking if meta properties exist 90339c5 Add missing netherite from Material#isArmor bedac18 Updated Upstream (Paper, Tuinity, & Airplane) 3b1531a [ci-skip] Add wrapper validation step to actions 73ab4e6 Update the "changing the blocks that turn into paths" defaults to reflect the vanilla defaults. (#322) a24b31b Updated Upstream (Paper) Empirecraft Changes: 87ceb204 Updated Paper a3497a7e Fix some patches 2ed9e7fa Updated Paper d5a47a3d Updated Paper * Updated Upstream and Sidestream(s) (Tuinity) Upstream/An Sidestream has released updates that appears to apply and compile correctly This update has NOT been tested by YatopiaMC and as with ANY update, please do your own testing. Tuinity Changes: 1382473 Null check chunk in block changes for Starlight
2021-05-11 05:16:50 +02:00
+ return hasItemMeta() && getItemMeta().hasLore();
+ }
+
+ /**
+ * Checks for existence of the specified enchantment.
+ *
+ * @param ench enchantment to check
+ * @return true if this enchantment exists for this meta
+ */
+ public boolean hasEnchant(@NotNull Enchantment ench) {
Upstream (#484) * Updated Upstream and Sidestream(s) (Paper/Purpur/Empirecraft) Upstream/An Sidestream has released updates that appears to apply and compile correctly This update has NOT been tested by YatopiaMC and as with ANY update, please do your own testing. Paper Changes: 2a67a9e51 Fix missing CraftMetaBook#toBuilder override 48aa06106 Add more Wandering Trader API (#5020) 8cec462a5 [CI-SKIP] Remove Astei from the MIT list (#5577) 21fbc3196 [CI-SKIP] Add Other textarea to issue templates (#5562) 453e983e4 fix isProxyOnlineMode coverage, don't lookup UUIDs in offline mode (Fixes #2011) 81cc4f928 Send empty commands if tab completion is disabled (Closes #5519) 9ed3e470d Keep moveToWorld with old method signature 99a66a583 [Auto] Updated Upstream (CraftBukkit) 976c6d425 [CI-SKIP] [Auto] Rebuild Patches 51deec726 Drop unneeded portal patch (#5566) 07a18c457 [Auto] Updated Upstream (CraftBukkit) 6733d7875 [Auto] Updated Upstream (Bukkit) 9958447cb [Auto] Updated Upstream (Bukkit) 840e72091 [CI-SKIP] [Auto] Rebuild Patches a33232d4a Add beacon activation and deactivation events (#5121) Purpur Changes: ebc0765 Updated Upstream (Paper) 5bc5dfd Fix #318 - Stonecutter does not damage when sneaking 8366582 Resolve #286 - Add config and API for item immunity to lightning a86555b Updated Upstream (Paper) 8b2607c Config for only sending advancements to affected players (#312) 7ee3393 Add config for the piston push limit (#311) a30e5ac Add config for void damage dealt 786382b Updated Upstream (Paper) 60d8411 [ci-skip] fix patch name b64f536 Config for changing the blocks that turn into paths (#303) 1d3f710 Updated Upstream (Paper) 3af86ad Oopsie 4b0342a Gamemode extra permissions 17c8573 [CI-SKIP] Don't pass ping to demo command output c3481c0 Initialize the credits command output in config a176fe6 Add credits command Empirecraft Changes: b2879a24 Updated Paper * Updated Upstream and Sidestream(s) (Paper/Tuinity/Airplane/Purpur/Empirecraft) Upstream/An Sidestream has released updates that appears to apply and compile correctly This update has NOT been tested by YatopiaMC and as with ANY update, please do your own testing. Paper Changes: b3cc88799 Add the ability to clear entities from block storage (#5598) f50171f3b Add missing rarity method on ItemStack (#5594) aeb6e7dd2 Updated Upstream (Bukkit/CraftBukkit/Spigot) (#5601) b0a4f353b fix cancelling block falling causing client desync (fixes #5386) (#5419) 8ed45920c Don't annotate type parameters using JetBrains annotations (#5600) d7625d926 Add new methods from PlayerMoveEvent to EntityMoveEvent (#5591) 29785297b Allow for Component suggestion tooltips in AsyncTabCompleteEvent (#5504) 0aea6c2ff Use JsonSerializationContext#serialize instead of recursion for AdventureComponents - fixes #5580 and #5371 8fcef3c1f Return after sending empty commands (#5586) Tuinity Changes: 3350246 Updated Upstream (Paper) f773caf Fix rare ticket level recursion crash 0fa8a0e Starlight Handle concurrent chunk generation and lighting better Airplane Changes: fad74c2 Fix JB annotations for gradle (credit jpenilla) d02f034 Updated Upstream (Tuinity) Purpur Changes: adfe5d3 Updated Upstream (Paper) 7a728f8 Fix #325 - Fix SPIGOT-6278 f5c3dae Updated Upstream (Paper) a80e5b6 Dont create item meta when checking if meta properties exist 90339c5 Add missing netherite from Material#isArmor bedac18 Updated Upstream (Paper, Tuinity, & Airplane) 3b1531a [ci-skip] Add wrapper validation step to actions 73ab4e6 Update the "changing the blocks that turn into paths" defaults to reflect the vanilla defaults. (#322) a24b31b Updated Upstream (Paper) Empirecraft Changes: 87ceb204 Updated Paper a3497a7e Fix some patches 2ed9e7fa Updated Paper d5a47a3d Updated Paper * Updated Upstream and Sidestream(s) (Tuinity) Upstream/An Sidestream has released updates that appears to apply and compile correctly This update has NOT been tested by YatopiaMC and as with ANY update, please do your own testing. Tuinity Changes: 1382473 Null check chunk in block changes for Starlight
2021-05-11 05:16:50 +02:00
+ return hasItemMeta() && getItemMeta().hasEnchant(ench);
+ }
+
+ /**
+ * Checks for the level of the specified enchantment.
+ *
+ * @param ench enchantment to check
+ * @return The level that the specified enchantment has, or 0 if none
+ */
+ public int getEnchantLevel(@NotNull Enchantment ench) {
+ return getItemMeta().getEnchantLevel(ench);
+ }
+
+ /**
+ * Returns a copy the enchantments in this ItemMeta. <br>
+ * Returns an empty map if none.
+ *
+ * @return An immutable copy of the enchantments
+ */
+ @NotNull
+ public Map<Enchantment, Integer> getEnchants() {
+ return getItemMeta().getEnchants();
+ }
+
+ /**
+ * Adds the specified enchantment to this item meta.
+ *
+ * @param ench Enchantment to add
+ * @param level Level for the enchantment
+ * @param ignoreLevelRestriction this indicates the enchantment should be
+ * applied, ignoring the level limit
+ * @return true if the item meta changed as a result of this call, false
+ * otherwise
+ */
+ public boolean addEnchant(@NotNull Enchantment ench, int level, boolean ignoreLevelRestriction) {
+ ItemMeta itemMeta = getItemMeta();
+ boolean result = itemMeta.addEnchant(ench, level, ignoreLevelRestriction);
+ setItemMeta(itemMeta);
+ return result;
+ }
+
+ /**
+ * Removes the specified enchantment from this item meta.
+ *
+ * @param ench Enchantment to remove
+ * @return true if the item meta changed as a result of this call, false
+ * otherwise
+ */
+ public boolean removeEnchant(@NotNull Enchantment ench) {
+ ItemMeta itemMeta = getItemMeta();
+ boolean result = itemMeta.removeEnchant(ench);
+ setItemMeta(itemMeta);
+ return result;
+ }
+
+ /**
+ * Checks for the existence of any enchantments.
+ *
+ * @return true if an enchantment exists on this meta
+ */
+ public boolean hasEnchants() {
Upstream (#484) * Updated Upstream and Sidestream(s) (Paper/Purpur/Empirecraft) Upstream/An Sidestream has released updates that appears to apply and compile correctly This update has NOT been tested by YatopiaMC and as with ANY update, please do your own testing. Paper Changes: 2a67a9e51 Fix missing CraftMetaBook#toBuilder override 48aa06106 Add more Wandering Trader API (#5020) 8cec462a5 [CI-SKIP] Remove Astei from the MIT list (#5577) 21fbc3196 [CI-SKIP] Add Other textarea to issue templates (#5562) 453e983e4 fix isProxyOnlineMode coverage, don't lookup UUIDs in offline mode (Fixes #2011) 81cc4f928 Send empty commands if tab completion is disabled (Closes #5519) 9ed3e470d Keep moveToWorld with old method signature 99a66a583 [Auto] Updated Upstream (CraftBukkit) 976c6d425 [CI-SKIP] [Auto] Rebuild Patches 51deec726 Drop unneeded portal patch (#5566) 07a18c457 [Auto] Updated Upstream (CraftBukkit) 6733d7875 [Auto] Updated Upstream (Bukkit) 9958447cb [Auto] Updated Upstream (Bukkit) 840e72091 [CI-SKIP] [Auto] Rebuild Patches a33232d4a Add beacon activation and deactivation events (#5121) Purpur Changes: ebc0765 Updated Upstream (Paper) 5bc5dfd Fix #318 - Stonecutter does not damage when sneaking 8366582 Resolve #286 - Add config and API for item immunity to lightning a86555b Updated Upstream (Paper) 8b2607c Config for only sending advancements to affected players (#312) 7ee3393 Add config for the piston push limit (#311) a30e5ac Add config for void damage dealt 786382b Updated Upstream (Paper) 60d8411 [ci-skip] fix patch name b64f536 Config for changing the blocks that turn into paths (#303) 1d3f710 Updated Upstream (Paper) 3af86ad Oopsie 4b0342a Gamemode extra permissions 17c8573 [CI-SKIP] Don't pass ping to demo command output c3481c0 Initialize the credits command output in config a176fe6 Add credits command Empirecraft Changes: b2879a24 Updated Paper * Updated Upstream and Sidestream(s) (Paper/Tuinity/Airplane/Purpur/Empirecraft) Upstream/An Sidestream has released updates that appears to apply and compile correctly This update has NOT been tested by YatopiaMC and as with ANY update, please do your own testing. Paper Changes: b3cc88799 Add the ability to clear entities from block storage (#5598) f50171f3b Add missing rarity method on ItemStack (#5594) aeb6e7dd2 Updated Upstream (Bukkit/CraftBukkit/Spigot) (#5601) b0a4f353b fix cancelling block falling causing client desync (fixes #5386) (#5419) 8ed45920c Don't annotate type parameters using JetBrains annotations (#5600) d7625d926 Add new methods from PlayerMoveEvent to EntityMoveEvent (#5591) 29785297b Allow for Component suggestion tooltips in AsyncTabCompleteEvent (#5504) 0aea6c2ff Use JsonSerializationContext#serialize instead of recursion for AdventureComponents - fixes #5580 and #5371 8fcef3c1f Return after sending empty commands (#5586) Tuinity Changes: 3350246 Updated Upstream (Paper) f773caf Fix rare ticket level recursion crash 0fa8a0e Starlight Handle concurrent chunk generation and lighting better Airplane Changes: fad74c2 Fix JB annotations for gradle (credit jpenilla) d02f034 Updated Upstream (Tuinity) Purpur Changes: adfe5d3 Updated Upstream (Paper) 7a728f8 Fix #325 - Fix SPIGOT-6278 f5c3dae Updated Upstream (Paper) a80e5b6 Dont create item meta when checking if meta properties exist 90339c5 Add missing netherite from Material#isArmor bedac18 Updated Upstream (Paper, Tuinity, & Airplane) 3b1531a [ci-skip] Add wrapper validation step to actions 73ab4e6 Update the "changing the blocks that turn into paths" defaults to reflect the vanilla defaults. (#322) a24b31b Updated Upstream (Paper) Empirecraft Changes: 87ceb204 Updated Paper a3497a7e Fix some patches 2ed9e7fa Updated Paper d5a47a3d Updated Paper * Updated Upstream and Sidestream(s) (Tuinity) Upstream/An Sidestream has released updates that appears to apply and compile correctly This update has NOT been tested by YatopiaMC and as with ANY update, please do your own testing. Tuinity Changes: 1382473 Null check chunk in block changes for Starlight
2021-05-11 05:16:50 +02:00
+ return hasItemMeta() && getItemMeta().hasEnchants();
+ }
+
+ /**
+ * Checks if the specified enchantment conflicts with any enchantments in
+ * this ItemMeta.
+ *
+ * @param ench enchantment to test
+ * @return true if the enchantment conflicts, false otherwise
+ */
+ public boolean hasConflictingEnchant(@NotNull Enchantment ench) {
Upstream (#484) * Updated Upstream and Sidestream(s) (Paper/Purpur/Empirecraft) Upstream/An Sidestream has released updates that appears to apply and compile correctly This update has NOT been tested by YatopiaMC and as with ANY update, please do your own testing. Paper Changes: 2a67a9e51 Fix missing CraftMetaBook#toBuilder override 48aa06106 Add more Wandering Trader API (#5020) 8cec462a5 [CI-SKIP] Remove Astei from the MIT list (#5577) 21fbc3196 [CI-SKIP] Add Other textarea to issue templates (#5562) 453e983e4 fix isProxyOnlineMode coverage, don't lookup UUIDs in offline mode (Fixes #2011) 81cc4f928 Send empty commands if tab completion is disabled (Closes #5519) 9ed3e470d Keep moveToWorld with old method signature 99a66a583 [Auto] Updated Upstream (CraftBukkit) 976c6d425 [CI-SKIP] [Auto] Rebuild Patches 51deec726 Drop unneeded portal patch (#5566) 07a18c457 [Auto] Updated Upstream (CraftBukkit) 6733d7875 [Auto] Updated Upstream (Bukkit) 9958447cb [Auto] Updated Upstream (Bukkit) 840e72091 [CI-SKIP] [Auto] Rebuild Patches a33232d4a Add beacon activation and deactivation events (#5121) Purpur Changes: ebc0765 Updated Upstream (Paper) 5bc5dfd Fix #318 - Stonecutter does not damage when sneaking 8366582 Resolve #286 - Add config and API for item immunity to lightning a86555b Updated Upstream (Paper) 8b2607c Config for only sending advancements to affected players (#312) 7ee3393 Add config for the piston push limit (#311) a30e5ac Add config for void damage dealt 786382b Updated Upstream (Paper) 60d8411 [ci-skip] fix patch name b64f536 Config for changing the blocks that turn into paths (#303) 1d3f710 Updated Upstream (Paper) 3af86ad Oopsie 4b0342a Gamemode extra permissions 17c8573 [CI-SKIP] Don't pass ping to demo command output c3481c0 Initialize the credits command output in config a176fe6 Add credits command Empirecraft Changes: b2879a24 Updated Paper * Updated Upstream and Sidestream(s) (Paper/Tuinity/Airplane/Purpur/Empirecraft) Upstream/An Sidestream has released updates that appears to apply and compile correctly This update has NOT been tested by YatopiaMC and as with ANY update, please do your own testing. Paper Changes: b3cc88799 Add the ability to clear entities from block storage (#5598) f50171f3b Add missing rarity method on ItemStack (#5594) aeb6e7dd2 Updated Upstream (Bukkit/CraftBukkit/Spigot) (#5601) b0a4f353b fix cancelling block falling causing client desync (fixes #5386) (#5419) 8ed45920c Don't annotate type parameters using JetBrains annotations (#5600) d7625d926 Add new methods from PlayerMoveEvent to EntityMoveEvent (#5591) 29785297b Allow for Component suggestion tooltips in AsyncTabCompleteEvent (#5504) 0aea6c2ff Use JsonSerializationContext#serialize instead of recursion for AdventureComponents - fixes #5580 and #5371 8fcef3c1f Return after sending empty commands (#5586) Tuinity Changes: 3350246 Updated Upstream (Paper) f773caf Fix rare ticket level recursion crash 0fa8a0e Starlight Handle concurrent chunk generation and lighting better Airplane Changes: fad74c2 Fix JB annotations for gradle (credit jpenilla) d02f034 Updated Upstream (Tuinity) Purpur Changes: adfe5d3 Updated Upstream (Paper) 7a728f8 Fix #325 - Fix SPIGOT-6278 f5c3dae Updated Upstream (Paper) a80e5b6 Dont create item meta when checking if meta properties exist 90339c5 Add missing netherite from Material#isArmor bedac18 Updated Upstream (Paper, Tuinity, & Airplane) 3b1531a [ci-skip] Add wrapper validation step to actions 73ab4e6 Update the "changing the blocks that turn into paths" defaults to reflect the vanilla defaults. (#322) a24b31b Updated Upstream (Paper) Empirecraft Changes: 87ceb204 Updated Paper a3497a7e Fix some patches 2ed9e7fa Updated Paper d5a47a3d Updated Paper * Updated Upstream and Sidestream(s) (Tuinity) Upstream/An Sidestream has released updates that appears to apply and compile correctly This update has NOT been tested by YatopiaMC and as with ANY update, please do your own testing. Tuinity Changes: 1382473 Null check chunk in block changes for Starlight
2021-05-11 05:16:50 +02:00
+ return hasItemMeta() && getItemMeta().hasConflictingEnchant(ench);
+ }
+
+ /**
+ * Sets the custom model data.
+ * <p>
+ * CustomModelData is an integer that may be associated client side with a
+ * custom item model.
+ *
+ * @param data the data to set, or null to clear
+ */
+ public void setCustomModelData(@Nullable Integer data) {
+ ItemMeta itemMeta = getItemMeta();
+ itemMeta.setCustomModelData(data);
+ setItemMeta(itemMeta);
+ }
+
+ /**
+ * Gets the custom model data that is set.
+ * <p>
+ * CustomModelData is an integer that may be associated client side with a
+ * custom item model.
+ * <p>
+ * Plugins should check that hasCustomModelData() returns <code>true</code>
+ * before calling this method.
+ *
+ * @return the localized name that is set
+ */
+ public int getCustomModelData() {
+ return getItemMeta().getCustomModelData();
+ }
+
+ /**
+ * Checks for existence of custom model data.
+ * <p>
+ * CustomModelData is an integer that may be associated client side with a
+ * custom item model.
+ *
+ * @return true if this has custom model data
+ */
+ public boolean hasCustomModelData() {
Upstream (#484) * Updated Upstream and Sidestream(s) (Paper/Purpur/Empirecraft) Upstream/An Sidestream has released updates that appears to apply and compile correctly This update has NOT been tested by YatopiaMC and as with ANY update, please do your own testing. Paper Changes: 2a67a9e51 Fix missing CraftMetaBook#toBuilder override 48aa06106 Add more Wandering Trader API (#5020) 8cec462a5 [CI-SKIP] Remove Astei from the MIT list (#5577) 21fbc3196 [CI-SKIP] Add Other textarea to issue templates (#5562) 453e983e4 fix isProxyOnlineMode coverage, don't lookup UUIDs in offline mode (Fixes #2011) 81cc4f928 Send empty commands if tab completion is disabled (Closes #5519) 9ed3e470d Keep moveToWorld with old method signature 99a66a583 [Auto] Updated Upstream (CraftBukkit) 976c6d425 [CI-SKIP] [Auto] Rebuild Patches 51deec726 Drop unneeded portal patch (#5566) 07a18c457 [Auto] Updated Upstream (CraftBukkit) 6733d7875 [Auto] Updated Upstream (Bukkit) 9958447cb [Auto] Updated Upstream (Bukkit) 840e72091 [CI-SKIP] [Auto] Rebuild Patches a33232d4a Add beacon activation and deactivation events (#5121) Purpur Changes: ebc0765 Updated Upstream (Paper) 5bc5dfd Fix #318 - Stonecutter does not damage when sneaking 8366582 Resolve #286 - Add config and API for item immunity to lightning a86555b Updated Upstream (Paper) 8b2607c Config for only sending advancements to affected players (#312) 7ee3393 Add config for the piston push limit (#311) a30e5ac Add config for void damage dealt 786382b Updated Upstream (Paper) 60d8411 [ci-skip] fix patch name b64f536 Config for changing the blocks that turn into paths (#303) 1d3f710 Updated Upstream (Paper) 3af86ad Oopsie 4b0342a Gamemode extra permissions 17c8573 [CI-SKIP] Don't pass ping to demo command output c3481c0 Initialize the credits command output in config a176fe6 Add credits command Empirecraft Changes: b2879a24 Updated Paper * Updated Upstream and Sidestream(s) (Paper/Tuinity/Airplane/Purpur/Empirecraft) Upstream/An Sidestream has released updates that appears to apply and compile correctly This update has NOT been tested by YatopiaMC and as with ANY update, please do your own testing. Paper Changes: b3cc88799 Add the ability to clear entities from block storage (#5598) f50171f3b Add missing rarity method on ItemStack (#5594) aeb6e7dd2 Updated Upstream (Bukkit/CraftBukkit/Spigot) (#5601) b0a4f353b fix cancelling block falling causing client desync (fixes #5386) (#5419) 8ed45920c Don't annotate type parameters using JetBrains annotations (#5600) d7625d926 Add new methods from PlayerMoveEvent to EntityMoveEvent (#5591) 29785297b Allow for Component suggestion tooltips in AsyncTabCompleteEvent (#5504) 0aea6c2ff Use JsonSerializationContext#serialize instead of recursion for AdventureComponents - fixes #5580 and #5371 8fcef3c1f Return after sending empty commands (#5586) Tuinity Changes: 3350246 Updated Upstream (Paper) f773caf Fix rare ticket level recursion crash 0fa8a0e Starlight Handle concurrent chunk generation and lighting better Airplane Changes: fad74c2 Fix JB annotations for gradle (credit jpenilla) d02f034 Updated Upstream (Tuinity) Purpur Changes: adfe5d3 Updated Upstream (Paper) 7a728f8 Fix #325 - Fix SPIGOT-6278 f5c3dae Updated Upstream (Paper) a80e5b6 Dont create item meta when checking if meta properties exist 90339c5 Add missing netherite from Material#isArmor bedac18 Updated Upstream (Paper, Tuinity, & Airplane) 3b1531a [ci-skip] Add wrapper validation step to actions 73ab4e6 Update the "changing the blocks that turn into paths" defaults to reflect the vanilla defaults. (#322) a24b31b Updated Upstream (Paper) Empirecraft Changes: 87ceb204 Updated Paper a3497a7e Fix some patches 2ed9e7fa Updated Paper d5a47a3d Updated Paper * Updated Upstream and Sidestream(s) (Tuinity) Upstream/An Sidestream has released updates that appears to apply and compile correctly This update has NOT been tested by YatopiaMC and as with ANY update, please do your own testing. Tuinity Changes: 1382473 Null check chunk in block changes for Starlight
2021-05-11 05:16:50 +02:00
+ return hasItemMeta() && getItemMeta().hasCustomModelData();
+ }
+
+ /**
+ * Returns whether the item has block data currently attached to it.
+ *
+ * @return whether block data is already attached
+ */
+ public boolean hasBlockData() {
Upstream (#484) * Updated Upstream and Sidestream(s) (Paper/Purpur/Empirecraft) Upstream/An Sidestream has released updates that appears to apply and compile correctly This update has NOT been tested by YatopiaMC and as with ANY update, please do your own testing. Paper Changes: 2a67a9e51 Fix missing CraftMetaBook#toBuilder override 48aa06106 Add more Wandering Trader API (#5020) 8cec462a5 [CI-SKIP] Remove Astei from the MIT list (#5577) 21fbc3196 [CI-SKIP] Add Other textarea to issue templates (#5562) 453e983e4 fix isProxyOnlineMode coverage, don't lookup UUIDs in offline mode (Fixes #2011) 81cc4f928 Send empty commands if tab completion is disabled (Closes #5519) 9ed3e470d Keep moveToWorld with old method signature 99a66a583 [Auto] Updated Upstream (CraftBukkit) 976c6d425 [CI-SKIP] [Auto] Rebuild Patches 51deec726 Drop unneeded portal patch (#5566) 07a18c457 [Auto] Updated Upstream (CraftBukkit) 6733d7875 [Auto] Updated Upstream (Bukkit) 9958447cb [Auto] Updated Upstream (Bukkit) 840e72091 [CI-SKIP] [Auto] Rebuild Patches a33232d4a Add beacon activation and deactivation events (#5121) Purpur Changes: ebc0765 Updated Upstream (Paper) 5bc5dfd Fix #318 - Stonecutter does not damage when sneaking 8366582 Resolve #286 - Add config and API for item immunity to lightning a86555b Updated Upstream (Paper) 8b2607c Config for only sending advancements to affected players (#312) 7ee3393 Add config for the piston push limit (#311) a30e5ac Add config for void damage dealt 786382b Updated Upstream (Paper) 60d8411 [ci-skip] fix patch name b64f536 Config for changing the blocks that turn into paths (#303) 1d3f710 Updated Upstream (Paper) 3af86ad Oopsie 4b0342a Gamemode extra permissions 17c8573 [CI-SKIP] Don't pass ping to demo command output c3481c0 Initialize the credits command output in config a176fe6 Add credits command Empirecraft Changes: b2879a24 Updated Paper * Updated Upstream and Sidestream(s) (Paper/Tuinity/Airplane/Purpur/Empirecraft) Upstream/An Sidestream has released updates that appears to apply and compile correctly This update has NOT been tested by YatopiaMC and as with ANY update, please do your own testing. Paper Changes: b3cc88799 Add the ability to clear entities from block storage (#5598) f50171f3b Add missing rarity method on ItemStack (#5594) aeb6e7dd2 Updated Upstream (Bukkit/CraftBukkit/Spigot) (#5601) b0a4f353b fix cancelling block falling causing client desync (fixes #5386) (#5419) 8ed45920c Don't annotate type parameters using JetBrains annotations (#5600) d7625d926 Add new methods from PlayerMoveEvent to EntityMoveEvent (#5591) 29785297b Allow for Component suggestion tooltips in AsyncTabCompleteEvent (#5504) 0aea6c2ff Use JsonSerializationContext#serialize instead of recursion for AdventureComponents - fixes #5580 and #5371 8fcef3c1f Return after sending empty commands (#5586) Tuinity Changes: 3350246 Updated Upstream (Paper) f773caf Fix rare ticket level recursion crash 0fa8a0e Starlight Handle concurrent chunk generation and lighting better Airplane Changes: fad74c2 Fix JB annotations for gradle (credit jpenilla) d02f034 Updated Upstream (Tuinity) Purpur Changes: adfe5d3 Updated Upstream (Paper) 7a728f8 Fix #325 - Fix SPIGOT-6278 f5c3dae Updated Upstream (Paper) a80e5b6 Dont create item meta when checking if meta properties exist 90339c5 Add missing netherite from Material#isArmor bedac18 Updated Upstream (Paper, Tuinity, & Airplane) 3b1531a [ci-skip] Add wrapper validation step to actions 73ab4e6 Update the "changing the blocks that turn into paths" defaults to reflect the vanilla defaults. (#322) a24b31b Updated Upstream (Paper) Empirecraft Changes: 87ceb204 Updated Paper a3497a7e Fix some patches 2ed9e7fa Updated Paper d5a47a3d Updated Paper * Updated Upstream and Sidestream(s) (Tuinity) Upstream/An Sidestream has released updates that appears to apply and compile correctly This update has NOT been tested by YatopiaMC and as with ANY update, please do your own testing. Tuinity Changes: 1382473 Null check chunk in block changes for Starlight
2021-05-11 05:16:50 +02:00
+ return hasItemMeta() && ((BlockDataMeta) getItemMeta()).hasBlockData();
+ }
+
+ /**
+ * Returns the currently attached block data for this item or creates a new
+ * one if one doesn't exist.
+ *
+ * The state is a copy, it must be set back (or to another item) with
+ * {@link #setBlockData(BlockData)}
+ *
+ * @param material the material we wish to get this data in the context of
+ * @return the attached data or new data
+ */
+ @NotNull
+ public BlockData getBlockData(@NotNull Material material) {
+ return ((BlockDataMeta) getItemMeta()).getBlockData(material);
+ }
+
+ /**
+ * Attaches a copy of the passed block data to the item.
+ *
+ * @param blockData the block data to attach to the block.
+ * @throws IllegalArgumentException if the blockData is null or invalid for
+ * this item.
+ */
+ public void setBlockData(@NotNull BlockData blockData) {
+ ItemMeta itemMeta = getItemMeta();
+ ((BlockDataMeta) itemMeta).setBlockData(blockData);
+ setItemMeta(itemMeta);
+ }
+
+ /**
+ * Gets the repair penalty
+ *
+ * @return the repair penalty
+ */
+ public int getRepairCost() {
+ return ((Repairable) getItemMeta()).getRepairCost();
+ }
+
+ /**
+ * Sets the repair penalty
+ *
+ * @param cost repair penalty
+ */
+ public void setRepairCost(int cost) {
+ ItemMeta itemMeta = getItemMeta();
+ ((Repairable) itemMeta).setRepairCost(cost);
+ setItemMeta(itemMeta);
+ }
+
+ /**
+ * Checks to see if this has a repair penalty
+ *
+ * @return true if this has a repair penalty
+ */
+ public boolean hasRepairCost() {
Upstream (#484) * Updated Upstream and Sidestream(s) (Paper/Purpur/Empirecraft) Upstream/An Sidestream has released updates that appears to apply and compile correctly This update has NOT been tested by YatopiaMC and as with ANY update, please do your own testing. Paper Changes: 2a67a9e51 Fix missing CraftMetaBook#toBuilder override 48aa06106 Add more Wandering Trader API (#5020) 8cec462a5 [CI-SKIP] Remove Astei from the MIT list (#5577) 21fbc3196 [CI-SKIP] Add Other textarea to issue templates (#5562) 453e983e4 fix isProxyOnlineMode coverage, don't lookup UUIDs in offline mode (Fixes #2011) 81cc4f928 Send empty commands if tab completion is disabled (Closes #5519) 9ed3e470d Keep moveToWorld with old method signature 99a66a583 [Auto] Updated Upstream (CraftBukkit) 976c6d425 [CI-SKIP] [Auto] Rebuild Patches 51deec726 Drop unneeded portal patch (#5566) 07a18c457 [Auto] Updated Upstream (CraftBukkit) 6733d7875 [Auto] Updated Upstream (Bukkit) 9958447cb [Auto] Updated Upstream (Bukkit) 840e72091 [CI-SKIP] [Auto] Rebuild Patches a33232d4a Add beacon activation and deactivation events (#5121) Purpur Changes: ebc0765 Updated Upstream (Paper) 5bc5dfd Fix #318 - Stonecutter does not damage when sneaking 8366582 Resolve #286 - Add config and API for item immunity to lightning a86555b Updated Upstream (Paper) 8b2607c Config for only sending advancements to affected players (#312) 7ee3393 Add config for the piston push limit (#311) a30e5ac Add config for void damage dealt 786382b Updated Upstream (Paper) 60d8411 [ci-skip] fix patch name b64f536 Config for changing the blocks that turn into paths (#303) 1d3f710 Updated Upstream (Paper) 3af86ad Oopsie 4b0342a Gamemode extra permissions 17c8573 [CI-SKIP] Don't pass ping to demo command output c3481c0 Initialize the credits command output in config a176fe6 Add credits command Empirecraft Changes: b2879a24 Updated Paper * Updated Upstream and Sidestream(s) (Paper/Tuinity/Airplane/Purpur/Empirecraft) Upstream/An Sidestream has released updates that appears to apply and compile correctly This update has NOT been tested by YatopiaMC and as with ANY update, please do your own testing. Paper Changes: b3cc88799 Add the ability to clear entities from block storage (#5598) f50171f3b Add missing rarity method on ItemStack (#5594) aeb6e7dd2 Updated Upstream (Bukkit/CraftBukkit/Spigot) (#5601) b0a4f353b fix cancelling block falling causing client desync (fixes #5386) (#5419) 8ed45920c Don't annotate type parameters using JetBrains annotations (#5600) d7625d926 Add new methods from PlayerMoveEvent to EntityMoveEvent (#5591) 29785297b Allow for Component suggestion tooltips in AsyncTabCompleteEvent (#5504) 0aea6c2ff Use JsonSerializationContext#serialize instead of recursion for AdventureComponents - fixes #5580 and #5371 8fcef3c1f Return after sending empty commands (#5586) Tuinity Changes: 3350246 Updated Upstream (Paper) f773caf Fix rare ticket level recursion crash 0fa8a0e Starlight Handle concurrent chunk generation and lighting better Airplane Changes: fad74c2 Fix JB annotations for gradle (credit jpenilla) d02f034 Updated Upstream (Tuinity) Purpur Changes: adfe5d3 Updated Upstream (Paper) 7a728f8 Fix #325 - Fix SPIGOT-6278 f5c3dae Updated Upstream (Paper) a80e5b6 Dont create item meta when checking if meta properties exist 90339c5 Add missing netherite from Material#isArmor bedac18 Updated Upstream (Paper, Tuinity, & Airplane) 3b1531a [ci-skip] Add wrapper validation step to actions 73ab4e6 Update the "changing the blocks that turn into paths" defaults to reflect the vanilla defaults. (#322) a24b31b Updated Upstream (Paper) Empirecraft Changes: 87ceb204 Updated Paper a3497a7e Fix some patches 2ed9e7fa Updated Paper d5a47a3d Updated Paper * Updated Upstream and Sidestream(s) (Tuinity) Upstream/An Sidestream has released updates that appears to apply and compile correctly This update has NOT been tested by YatopiaMC and as with ANY update, please do your own testing. Tuinity Changes: 1382473 Null check chunk in block changes for Starlight
2021-05-11 05:16:50 +02:00
+ return hasItemMeta() && ((Repairable) getItemMeta()).hasRepairCost();
+ }
+
+ /**
+ * Return if the unbreakable tag is true. An unbreakable item will not lose
+ * durability.
+ *
+ * @return true if the unbreakable tag is true
+ */
+ public boolean isUnbreakable() {
Upstream (#484) * Updated Upstream and Sidestream(s) (Paper/Purpur/Empirecraft) Upstream/An Sidestream has released updates that appears to apply and compile correctly This update has NOT been tested by YatopiaMC and as with ANY update, please do your own testing. Paper Changes: 2a67a9e51 Fix missing CraftMetaBook#toBuilder override 48aa06106 Add more Wandering Trader API (#5020) 8cec462a5 [CI-SKIP] Remove Astei from the MIT list (#5577) 21fbc3196 [CI-SKIP] Add Other textarea to issue templates (#5562) 453e983e4 fix isProxyOnlineMode coverage, don't lookup UUIDs in offline mode (Fixes #2011) 81cc4f928 Send empty commands if tab completion is disabled (Closes #5519) 9ed3e470d Keep moveToWorld with old method signature 99a66a583 [Auto] Updated Upstream (CraftBukkit) 976c6d425 [CI-SKIP] [Auto] Rebuild Patches 51deec726 Drop unneeded portal patch (#5566) 07a18c457 [Auto] Updated Upstream (CraftBukkit) 6733d7875 [Auto] Updated Upstream (Bukkit) 9958447cb [Auto] Updated Upstream (Bukkit) 840e72091 [CI-SKIP] [Auto] Rebuild Patches a33232d4a Add beacon activation and deactivation events (#5121) Purpur Changes: ebc0765 Updated Upstream (Paper) 5bc5dfd Fix #318 - Stonecutter does not damage when sneaking 8366582 Resolve #286 - Add config and API for item immunity to lightning a86555b Updated Upstream (Paper) 8b2607c Config for only sending advancements to affected players (#312) 7ee3393 Add config for the piston push limit (#311) a30e5ac Add config for void damage dealt 786382b Updated Upstream (Paper) 60d8411 [ci-skip] fix patch name b64f536 Config for changing the blocks that turn into paths (#303) 1d3f710 Updated Upstream (Paper) 3af86ad Oopsie 4b0342a Gamemode extra permissions 17c8573 [CI-SKIP] Don't pass ping to demo command output c3481c0 Initialize the credits command output in config a176fe6 Add credits command Empirecraft Changes: b2879a24 Updated Paper * Updated Upstream and Sidestream(s) (Paper/Tuinity/Airplane/Purpur/Empirecraft) Upstream/An Sidestream has released updates that appears to apply and compile correctly This update has NOT been tested by YatopiaMC and as with ANY update, please do your own testing. Paper Changes: b3cc88799 Add the ability to clear entities from block storage (#5598) f50171f3b Add missing rarity method on ItemStack (#5594) aeb6e7dd2 Updated Upstream (Bukkit/CraftBukkit/Spigot) (#5601) b0a4f353b fix cancelling block falling causing client desync (fixes #5386) (#5419) 8ed45920c Don't annotate type parameters using JetBrains annotations (#5600) d7625d926 Add new methods from PlayerMoveEvent to EntityMoveEvent (#5591) 29785297b Allow for Component suggestion tooltips in AsyncTabCompleteEvent (#5504) 0aea6c2ff Use JsonSerializationContext#serialize instead of recursion for AdventureComponents - fixes #5580 and #5371 8fcef3c1f Return after sending empty commands (#5586) Tuinity Changes: 3350246 Updated Upstream (Paper) f773caf Fix rare ticket level recursion crash 0fa8a0e Starlight Handle concurrent chunk generation and lighting better Airplane Changes: fad74c2 Fix JB annotations for gradle (credit jpenilla) d02f034 Updated Upstream (Tuinity) Purpur Changes: adfe5d3 Updated Upstream (Paper) 7a728f8 Fix #325 - Fix SPIGOT-6278 f5c3dae Updated Upstream (Paper) a80e5b6 Dont create item meta when checking if meta properties exist 90339c5 Add missing netherite from Material#isArmor bedac18 Updated Upstream (Paper, Tuinity, & Airplane) 3b1531a [ci-skip] Add wrapper validation step to actions 73ab4e6 Update the "changing the blocks that turn into paths" defaults to reflect the vanilla defaults. (#322) a24b31b Updated Upstream (Paper) Empirecraft Changes: 87ceb204 Updated Paper a3497a7e Fix some patches 2ed9e7fa Updated Paper d5a47a3d Updated Paper * Updated Upstream and Sidestream(s) (Tuinity) Upstream/An Sidestream has released updates that appears to apply and compile correctly This update has NOT been tested by YatopiaMC and as with ANY update, please do your own testing. Tuinity Changes: 1382473 Null check chunk in block changes for Starlight
2021-05-11 05:16:50 +02:00
+ return hasItemMeta() && getItemMeta().isUnbreakable();
+ }
+
+ /**
+ * Sets the unbreakable tag. An unbreakable item will not lose durability.
+ *
+ * @param unbreakable true if set unbreakable
+ */
+ public void setUnbreakable(boolean unbreakable) {
+ ItemMeta itemMeta = getItemMeta();
+ itemMeta.setUnbreakable(unbreakable);
+ setItemMeta(itemMeta);
+ }
+
+ /**
+ * Checks for the existence of any AttributeModifiers.
+ *
+ * @return true if any AttributeModifiers exist
+ */
+ public boolean hasAttributeModifiers() {
Upstream (#484) * Updated Upstream and Sidestream(s) (Paper/Purpur/Empirecraft) Upstream/An Sidestream has released updates that appears to apply and compile correctly This update has NOT been tested by YatopiaMC and as with ANY update, please do your own testing. Paper Changes: 2a67a9e51 Fix missing CraftMetaBook#toBuilder override 48aa06106 Add more Wandering Trader API (#5020) 8cec462a5 [CI-SKIP] Remove Astei from the MIT list (#5577) 21fbc3196 [CI-SKIP] Add Other textarea to issue templates (#5562) 453e983e4 fix isProxyOnlineMode coverage, don't lookup UUIDs in offline mode (Fixes #2011) 81cc4f928 Send empty commands if tab completion is disabled (Closes #5519) 9ed3e470d Keep moveToWorld with old method signature 99a66a583 [Auto] Updated Upstream (CraftBukkit) 976c6d425 [CI-SKIP] [Auto] Rebuild Patches 51deec726 Drop unneeded portal patch (#5566) 07a18c457 [Auto] Updated Upstream (CraftBukkit) 6733d7875 [Auto] Updated Upstream (Bukkit) 9958447cb [Auto] Updated Upstream (Bukkit) 840e72091 [CI-SKIP] [Auto] Rebuild Patches a33232d4a Add beacon activation and deactivation events (#5121) Purpur Changes: ebc0765 Updated Upstream (Paper) 5bc5dfd Fix #318 - Stonecutter does not damage when sneaking 8366582 Resolve #286 - Add config and API for item immunity to lightning a86555b Updated Upstream (Paper) 8b2607c Config for only sending advancements to affected players (#312) 7ee3393 Add config for the piston push limit (#311) a30e5ac Add config for void damage dealt 786382b Updated Upstream (Paper) 60d8411 [ci-skip] fix patch name b64f536 Config for changing the blocks that turn into paths (#303) 1d3f710 Updated Upstream (Paper) 3af86ad Oopsie 4b0342a Gamemode extra permissions 17c8573 [CI-SKIP] Don't pass ping to demo command output c3481c0 Initialize the credits command output in config a176fe6 Add credits command Empirecraft Changes: b2879a24 Updated Paper * Updated Upstream and Sidestream(s) (Paper/Tuinity/Airplane/Purpur/Empirecraft) Upstream/An Sidestream has released updates that appears to apply and compile correctly This update has NOT been tested by YatopiaMC and as with ANY update, please do your own testing. Paper Changes: b3cc88799 Add the ability to clear entities from block storage (#5598) f50171f3b Add missing rarity method on ItemStack (#5594) aeb6e7dd2 Updated Upstream (Bukkit/CraftBukkit/Spigot) (#5601) b0a4f353b fix cancelling block falling causing client desync (fixes #5386) (#5419) 8ed45920c Don't annotate type parameters using JetBrains annotations (#5600) d7625d926 Add new methods from PlayerMoveEvent to EntityMoveEvent (#5591) 29785297b Allow for Component suggestion tooltips in AsyncTabCompleteEvent (#5504) 0aea6c2ff Use JsonSerializationContext#serialize instead of recursion for AdventureComponents - fixes #5580 and #5371 8fcef3c1f Return after sending empty commands (#5586) Tuinity Changes: 3350246 Updated Upstream (Paper) f773caf Fix rare ticket level recursion crash 0fa8a0e Starlight Handle concurrent chunk generation and lighting better Airplane Changes: fad74c2 Fix JB annotations for gradle (credit jpenilla) d02f034 Updated Upstream (Tuinity) Purpur Changes: adfe5d3 Updated Upstream (Paper) 7a728f8 Fix #325 - Fix SPIGOT-6278 f5c3dae Updated Upstream (Paper) a80e5b6 Dont create item meta when checking if meta properties exist 90339c5 Add missing netherite from Material#isArmor bedac18 Updated Upstream (Paper, Tuinity, & Airplane) 3b1531a [ci-skip] Add wrapper validation step to actions 73ab4e6 Update the "changing the blocks that turn into paths" defaults to reflect the vanilla defaults. (#322) a24b31b Updated Upstream (Paper) Empirecraft Changes: 87ceb204 Updated Paper a3497a7e Fix some patches 2ed9e7fa Updated Paper d5a47a3d Updated Paper * Updated Upstream and Sidestream(s) (Tuinity) Upstream/An Sidestream has released updates that appears to apply and compile correctly This update has NOT been tested by YatopiaMC and as with ANY update, please do your own testing. Tuinity Changes: 1382473 Null check chunk in block changes for Starlight
2021-05-11 05:16:50 +02:00
+ return hasItemMeta() && getItemMeta().hasAttributeModifiers();
+ }
+
+ /**
+ * Return an immutable copy of all Attributes and
+ * their modifiers in this ItemMeta.<br>
+ * Returns null if none exist.
+ *
+ * @return an immutable {@link Multimap} of Attributes
+ * and their AttributeModifiers, or null if none exist
+ */
+ @Nullable
+ public Multimap<Attribute, AttributeModifier> getAttributeModifiers() {
+ return getItemMeta().getAttributeModifiers();
+ }
+
+ /**
+ * Return an immutable copy of all {@link Attribute}s and their
+ * {@link AttributeModifier}s for a given {@link EquipmentSlot}.<br>
+ * Any {@link AttributeModifier} that does have have a given
+ * {@link EquipmentSlot} will be returned. This is because
+ * AttributeModifiers without a slot are active in any slot.<br>
+ * If there are no attributes set for the given slot, an empty map
+ * will be returned.
+ *
+ * @param slot the {@link EquipmentSlot} to check
+ * @return the immutable {@link Multimap} with the
+ * respective Attributes and modifiers, or an empty map
+ * if no attributes are set.
+ */
+ @NotNull
+ public Multimap<Attribute, AttributeModifier> getAttributeModifiers(@Nullable EquipmentSlot slot) {
+ return getItemMeta().getAttributeModifiers(slot);
+ }
+
+ /**
+ * Return an immutable copy of all {@link AttributeModifier}s
+ * for a given {@link Attribute}
+ *
+ * @param attribute the {@link Attribute}
+ * @return an immutable collection of {@link AttributeModifier}s
+ * or null if no AttributeModifiers exist for the Attribute.
+ * @throws NullPointerException if Attribute is null
+ */
+ @Nullable
+ public Collection<AttributeModifier> getAttributeModifiers(@NotNull Attribute attribute) {
+ return getItemMeta().getAttributeModifiers(attribute);
+ }
+
+ /**
+ * Add an Attribute and it's Modifier.
+ * AttributeModifiers can now support {@link EquipmentSlot}s.
+ * If not set, the {@link AttributeModifier} will be active in ALL slots.
+ * <br>
+ * Two {@link AttributeModifier}s that have the same {@link java.util.UUID}
+ * cannot exist on the same Attribute.
+ *
+ * @param attribute the {@link Attribute} to modify
+ * @param modifier the {@link AttributeModifier} specifying the modification
+ * @return true if the Attribute and AttributeModifier were
+ * successfully added
+ * @throws NullPointerException if Attribute is null
+ * @throws NullPointerException if AttributeModifier is null
+ * @throws IllegalArgumentException if AttributeModifier already exists
+ */
+ public boolean addAttributeModifier(@NotNull Attribute attribute, @NotNull AttributeModifier modifier) {
+ ItemMeta itemMeta = getItemMeta();
+ boolean result = itemMeta.addAttributeModifier(attribute, modifier);
+ setItemMeta(itemMeta);
+ return result;
+ }
+
+ /**
+ * Set all {@link Attribute}s and their {@link AttributeModifier}s.
+ * To clear all currently set Attributes and AttributeModifiers use
+ * null or an empty Multimap.
+ * If not null nor empty, this will filter all entries that are not-null
+ * and add them to the ItemStack.
+ *
+ * @param attributeModifiers the new Multimap containing the Attributes
+ * and their AttributeModifiers
+ */
+ public void setAttributeModifiers(@Nullable Multimap<Attribute, AttributeModifier> attributeModifiers) {
+ ItemMeta itemMeta = getItemMeta();
+ itemMeta.setAttributeModifiers(attributeModifiers);
+ setItemMeta(itemMeta);
+ }
+
+ /**
+ * Remove all {@link AttributeModifier}s associated with the given
+ * {@link Attribute}.
+ * This will return false if nothing was removed.
+ *
+ * @param attribute attribute to remove
+ * @return true if all modifiers were removed from a given
+ * Attribute. Returns false if no attributes were
+ * removed.
+ * @throws NullPointerException if Attribute is null
+ */
+ public boolean removeAttributeModifier(@NotNull Attribute attribute) {
+ ItemMeta itemMeta = getItemMeta();
+ boolean result = itemMeta.removeAttributeModifier(attribute);
+ setItemMeta(itemMeta);
+ return result;
+ }
+
+ /**
+ * Remove all {@link Attribute}s and {@link AttributeModifier}s for a
+ * given {@link EquipmentSlot}.<br>
+ * If the given {@link EquipmentSlot} is null, this will remove all
+ * {@link AttributeModifier}s that do not have an EquipmentSlot set.
+ *
+ * @param slot the {@link EquipmentSlot} to clear all Attributes and
+ * their modifiers for
+ * @return true if all modifiers were removed that match the given
+ * EquipmentSlot.
+ */
+ public boolean removeAttributeModifier(@Nullable EquipmentSlot slot) {
+ ItemMeta itemMeta = getItemMeta();
+ boolean result = itemMeta.removeAttributeModifier(slot);
+ setItemMeta(itemMeta);
+ return result;
+ }
+
+ /**
+ * Remove a specific {@link Attribute} and {@link AttributeModifier}.
+ * AttributeModifiers are matched according to their {@link java.util.UUID}.
+ *
+ * @param attribute the {@link Attribute} to remove
+ * @param modifier the {@link AttributeModifier} to remove
+ * @return if any attribute modifiers were remove
+ *
+ * @throws NullPointerException if the Attribute is null
+ * @throws NullPointerException if the AttributeModifier is null
+ *
+ * @see AttributeModifier#getUniqueId()
+ */
+ public boolean removeAttributeModifier(@NotNull Attribute attribute, @NotNull AttributeModifier modifier) {
+ ItemMeta itemMeta = getItemMeta();
+ boolean result = itemMeta.removeAttributeModifier(attribute, modifier);
+ setItemMeta(itemMeta);
+ return result;
+ }
+
+ /**
+ * Returns a custom tag container capable of storing tags on the object.
+ *
+ * Note that the tags stored on this container are all stored under their
+ * own custom namespace therefore modifying default tags using this
+ * {@link PersistentDataHolder} is impossible.
+ *
+ * @return the persistent metadata container
+ */
+ @NotNull
+ public PersistentDataContainer getPersistentDataContainer() {
+ return getItemMeta().getPersistentDataContainer();
+ }
+
+ /**
+ * Checks to see if this item has damage
+ *
+ * @return true if this has damage
+ */
+ public boolean hasDamage() {
Upstream (#484) * Updated Upstream and Sidestream(s) (Paper/Purpur/Empirecraft) Upstream/An Sidestream has released updates that appears to apply and compile correctly This update has NOT been tested by YatopiaMC and as with ANY update, please do your own testing. Paper Changes: 2a67a9e51 Fix missing CraftMetaBook#toBuilder override 48aa06106 Add more Wandering Trader API (#5020) 8cec462a5 [CI-SKIP] Remove Astei from the MIT list (#5577) 21fbc3196 [CI-SKIP] Add Other textarea to issue templates (#5562) 453e983e4 fix isProxyOnlineMode coverage, don't lookup UUIDs in offline mode (Fixes #2011) 81cc4f928 Send empty commands if tab completion is disabled (Closes #5519) 9ed3e470d Keep moveToWorld with old method signature 99a66a583 [Auto] Updated Upstream (CraftBukkit) 976c6d425 [CI-SKIP] [Auto] Rebuild Patches 51deec726 Drop unneeded portal patch (#5566) 07a18c457 [Auto] Updated Upstream (CraftBukkit) 6733d7875 [Auto] Updated Upstream (Bukkit) 9958447cb [Auto] Updated Upstream (Bukkit) 840e72091 [CI-SKIP] [Auto] Rebuild Patches a33232d4a Add beacon activation and deactivation events (#5121) Purpur Changes: ebc0765 Updated Upstream (Paper) 5bc5dfd Fix #318 - Stonecutter does not damage when sneaking 8366582 Resolve #286 - Add config and API for item immunity to lightning a86555b Updated Upstream (Paper) 8b2607c Config for only sending advancements to affected players (#312) 7ee3393 Add config for the piston push limit (#311) a30e5ac Add config for void damage dealt 786382b Updated Upstream (Paper) 60d8411 [ci-skip] fix patch name b64f536 Config for changing the blocks that turn into paths (#303) 1d3f710 Updated Upstream (Paper) 3af86ad Oopsie 4b0342a Gamemode extra permissions 17c8573 [CI-SKIP] Don't pass ping to demo command output c3481c0 Initialize the credits command output in config a176fe6 Add credits command Empirecraft Changes: b2879a24 Updated Paper * Updated Upstream and Sidestream(s) (Paper/Tuinity/Airplane/Purpur/Empirecraft) Upstream/An Sidestream has released updates that appears to apply and compile correctly This update has NOT been tested by YatopiaMC and as with ANY update, please do your own testing. Paper Changes: b3cc88799 Add the ability to clear entities from block storage (#5598) f50171f3b Add missing rarity method on ItemStack (#5594) aeb6e7dd2 Updated Upstream (Bukkit/CraftBukkit/Spigot) (#5601) b0a4f353b fix cancelling block falling causing client desync (fixes #5386) (#5419) 8ed45920c Don't annotate type parameters using JetBrains annotations (#5600) d7625d926 Add new methods from PlayerMoveEvent to EntityMoveEvent (#5591) 29785297b Allow for Component suggestion tooltips in AsyncTabCompleteEvent (#5504) 0aea6c2ff Use JsonSerializationContext#serialize instead of recursion for AdventureComponents - fixes #5580 and #5371 8fcef3c1f Return after sending empty commands (#5586) Tuinity Changes: 3350246 Updated Upstream (Paper) f773caf Fix rare ticket level recursion crash 0fa8a0e Starlight Handle concurrent chunk generation and lighting better Airplane Changes: fad74c2 Fix JB annotations for gradle (credit jpenilla) d02f034 Updated Upstream (Tuinity) Purpur Changes: adfe5d3 Updated Upstream (Paper) 7a728f8 Fix #325 - Fix SPIGOT-6278 f5c3dae Updated Upstream (Paper) a80e5b6 Dont create item meta when checking if meta properties exist 90339c5 Add missing netherite from Material#isArmor bedac18 Updated Upstream (Paper, Tuinity, & Airplane) 3b1531a [ci-skip] Add wrapper validation step to actions 73ab4e6 Update the "changing the blocks that turn into paths" defaults to reflect the vanilla defaults. (#322) a24b31b Updated Upstream (Paper) Empirecraft Changes: 87ceb204 Updated Paper a3497a7e Fix some patches 2ed9e7fa Updated Paper d5a47a3d Updated Paper * Updated Upstream and Sidestream(s) (Tuinity) Upstream/An Sidestream has released updates that appears to apply and compile correctly This update has NOT been tested by YatopiaMC and as with ANY update, please do your own testing. Tuinity Changes: 1382473 Null check chunk in block changes for Starlight
2021-05-11 05:16:50 +02:00
+ return hasItemMeta() && ((Damageable) getItemMeta()).hasDamage();
+ }
+
+ /**
+ * Gets the damage
+ *
+ * @return the damage
+ */
+ public int getDamage() {
+ return ((Damageable) getItemMeta()).getDamage();
+ }
+
+ /**
+ * Sets the damage
+ *
+ * @param damage item damage
+ */
+ public void setDamage(int damage) {
+ ItemMeta itemMeta = getItemMeta();
+ ((Damageable) itemMeta).setDamage(damage);
+ setItemMeta(itemMeta);
+ }
+
+ /**
+ * Gets the collection of namespaced keys that the item can destroy in {@link org.bukkit.GameMode#ADVENTURE}
+ *
+ * @return Set of {@link com.destroystokyo.paper.Namespaced}
+ */
+ @NotNull
+ public Set<Namespaced> getDestroyableKeys() {
+ return getItemMeta().getDestroyableKeys();
+ }
+
+ /**
+ * Sets the collection of namespaced keys that the item can destroy in {@link org.bukkit.GameMode#ADVENTURE}
+ *
+ * @param canDestroy Collection of {@link com.destroystokyo.paper.Namespaced}
+ */
+ public void setDestroyableKeys(@NotNull Collection<Namespaced> canDestroy) {
+ ItemMeta itemMeta = getItemMeta();
+ itemMeta.setDestroyableKeys(canDestroy);
+ setItemMeta(itemMeta);
+ }
+
+ /**
+ * Gets the collection of namespaced keys that the item can be placed on in {@link org.bukkit.GameMode#ADVENTURE}
+ *
+ * @return Set of {@link com.destroystokyo.paper.Namespaced}
+ */
+ @NotNull
+ public Set<Namespaced> getPlaceableKeys() {
+ return getItemMeta().getPlaceableKeys();
+ }
+
+ /**
+ * Sets the set of namespaced keys that the item can be placed on in {@link org.bukkit.GameMode#ADVENTURE}
+ *
+ * @param canPlaceOn Collection of {@link com.destroystokyo.paper.Namespaced}
+ */
+ @NotNull
+ public void setPlaceableKeys(@NotNull Collection<Namespaced> canPlaceOn) {
+ ItemMeta itemMeta = getItemMeta();
+ itemMeta.setPlaceableKeys(canPlaceOn);
+ setItemMeta(itemMeta);
+ }
+
+ /**
+ * Checks for the existence of any keys that the item can be placed on
+ *
+ * @return true if this item has placeable keys
+ */
+ public boolean hasPlaceableKeys() {
Upstream (#484) * Updated Upstream and Sidestream(s) (Paper/Purpur/Empirecraft) Upstream/An Sidestream has released updates that appears to apply and compile correctly This update has NOT been tested by YatopiaMC and as with ANY update, please do your own testing. Paper Changes: 2a67a9e51 Fix missing CraftMetaBook#toBuilder override 48aa06106 Add more Wandering Trader API (#5020) 8cec462a5 [CI-SKIP] Remove Astei from the MIT list (#5577) 21fbc3196 [CI-SKIP] Add Other textarea to issue templates (#5562) 453e983e4 fix isProxyOnlineMode coverage, don't lookup UUIDs in offline mode (Fixes #2011) 81cc4f928 Send empty commands if tab completion is disabled (Closes #5519) 9ed3e470d Keep moveToWorld with old method signature 99a66a583 [Auto] Updated Upstream (CraftBukkit) 976c6d425 [CI-SKIP] [Auto] Rebuild Patches 51deec726 Drop unneeded portal patch (#5566) 07a18c457 [Auto] Updated Upstream (CraftBukkit) 6733d7875 [Auto] Updated Upstream (Bukkit) 9958447cb [Auto] Updated Upstream (Bukkit) 840e72091 [CI-SKIP] [Auto] Rebuild Patches a33232d4a Add beacon activation and deactivation events (#5121) Purpur Changes: ebc0765 Updated Upstream (Paper) 5bc5dfd Fix #318 - Stonecutter does not damage when sneaking 8366582 Resolve #286 - Add config and API for item immunity to lightning a86555b Updated Upstream (Paper) 8b2607c Config for only sending advancements to affected players (#312) 7ee3393 Add config for the piston push limit (#311) a30e5ac Add config for void damage dealt 786382b Updated Upstream (Paper) 60d8411 [ci-skip] fix patch name b64f536 Config for changing the blocks that turn into paths (#303) 1d3f710 Updated Upstream (Paper) 3af86ad Oopsie 4b0342a Gamemode extra permissions 17c8573 [CI-SKIP] Don't pass ping to demo command output c3481c0 Initialize the credits command output in config a176fe6 Add credits command Empirecraft Changes: b2879a24 Updated Paper * Updated Upstream and Sidestream(s) (Paper/Tuinity/Airplane/Purpur/Empirecraft) Upstream/An Sidestream has released updates that appears to apply and compile correctly This update has NOT been tested by YatopiaMC and as with ANY update, please do your own testing. Paper Changes: b3cc88799 Add the ability to clear entities from block storage (#5598) f50171f3b Add missing rarity method on ItemStack (#5594) aeb6e7dd2 Updated Upstream (Bukkit/CraftBukkit/Spigot) (#5601) b0a4f353b fix cancelling block falling causing client desync (fixes #5386) (#5419) 8ed45920c Don't annotate type parameters using JetBrains annotations (#5600) d7625d926 Add new methods from PlayerMoveEvent to EntityMoveEvent (#5591) 29785297b Allow for Component suggestion tooltips in AsyncTabCompleteEvent (#5504) 0aea6c2ff Use JsonSerializationContext#serialize instead of recursion for AdventureComponents - fixes #5580 and #5371 8fcef3c1f Return after sending empty commands (#5586) Tuinity Changes: 3350246 Updated Upstream (Paper) f773caf Fix rare ticket level recursion crash 0fa8a0e Starlight Handle concurrent chunk generation and lighting better Airplane Changes: fad74c2 Fix JB annotations for gradle (credit jpenilla) d02f034 Updated Upstream (Tuinity) Purpur Changes: adfe5d3 Updated Upstream (Paper) 7a728f8 Fix #325 - Fix SPIGOT-6278 f5c3dae Updated Upstream (Paper) a80e5b6 Dont create item meta when checking if meta properties exist 90339c5 Add missing netherite from Material#isArmor bedac18 Updated Upstream (Paper, Tuinity, & Airplane) 3b1531a [ci-skip] Add wrapper validation step to actions 73ab4e6 Update the "changing the blocks that turn into paths" defaults to reflect the vanilla defaults. (#322) a24b31b Updated Upstream (Paper) Empirecraft Changes: 87ceb204 Updated Paper a3497a7e Fix some patches 2ed9e7fa Updated Paper d5a47a3d Updated Paper * Updated Upstream and Sidestream(s) (Tuinity) Upstream/An Sidestream has released updates that appears to apply and compile correctly This update has NOT been tested by YatopiaMC and as with ANY update, please do your own testing. Tuinity Changes: 1382473 Null check chunk in block changes for Starlight
2021-05-11 05:16:50 +02:00
+ return hasItemMeta() && getItemMeta().hasPlaceableKeys();
+ }
+
+ /**
+ * Checks for the existence of any keys that the item can destroy
+ *
+ * @return true if this item has destroyable keys
+ */
+ public boolean hasDestroyableKeys() {
Upstream (#484) * Updated Upstream and Sidestream(s) (Paper/Purpur/Empirecraft) Upstream/An Sidestream has released updates that appears to apply and compile correctly This update has NOT been tested by YatopiaMC and as with ANY update, please do your own testing. Paper Changes: 2a67a9e51 Fix missing CraftMetaBook#toBuilder override 48aa06106 Add more Wandering Trader API (#5020) 8cec462a5 [CI-SKIP] Remove Astei from the MIT list (#5577) 21fbc3196 [CI-SKIP] Add Other textarea to issue templates (#5562) 453e983e4 fix isProxyOnlineMode coverage, don't lookup UUIDs in offline mode (Fixes #2011) 81cc4f928 Send empty commands if tab completion is disabled (Closes #5519) 9ed3e470d Keep moveToWorld with old method signature 99a66a583 [Auto] Updated Upstream (CraftBukkit) 976c6d425 [CI-SKIP] [Auto] Rebuild Patches 51deec726 Drop unneeded portal patch (#5566) 07a18c457 [Auto] Updated Upstream (CraftBukkit) 6733d7875 [Auto] Updated Upstream (Bukkit) 9958447cb [Auto] Updated Upstream (Bukkit) 840e72091 [CI-SKIP] [Auto] Rebuild Patches a33232d4a Add beacon activation and deactivation events (#5121) Purpur Changes: ebc0765 Updated Upstream (Paper) 5bc5dfd Fix #318 - Stonecutter does not damage when sneaking 8366582 Resolve #286 - Add config and API for item immunity to lightning a86555b Updated Upstream (Paper) 8b2607c Config for only sending advancements to affected players (#312) 7ee3393 Add config for the piston push limit (#311) a30e5ac Add config for void damage dealt 786382b Updated Upstream (Paper) 60d8411 [ci-skip] fix patch name b64f536 Config for changing the blocks that turn into paths (#303) 1d3f710 Updated Upstream (Paper) 3af86ad Oopsie 4b0342a Gamemode extra permissions 17c8573 [CI-SKIP] Don't pass ping to demo command output c3481c0 Initialize the credits command output in config a176fe6 Add credits command Empirecraft Changes: b2879a24 Updated Paper * Updated Upstream and Sidestream(s) (Paper/Tuinity/Airplane/Purpur/Empirecraft) Upstream/An Sidestream has released updates that appears to apply and compile correctly This update has NOT been tested by YatopiaMC and as with ANY update, please do your own testing. Paper Changes: b3cc88799 Add the ability to clear entities from block storage (#5598) f50171f3b Add missing rarity method on ItemStack (#5594) aeb6e7dd2 Updated Upstream (Bukkit/CraftBukkit/Spigot) (#5601) b0a4f353b fix cancelling block falling causing client desync (fixes #5386) (#5419) 8ed45920c Don't annotate type parameters using JetBrains annotations (#5600) d7625d926 Add new methods from PlayerMoveEvent to EntityMoveEvent (#5591) 29785297b Allow for Component suggestion tooltips in AsyncTabCompleteEvent (#5504) 0aea6c2ff Use JsonSerializationContext#serialize instead of recursion for AdventureComponents - fixes #5580 and #5371 8fcef3c1f Return after sending empty commands (#5586) Tuinity Changes: 3350246 Updated Upstream (Paper) f773caf Fix rare ticket level recursion crash 0fa8a0e Starlight Handle concurrent chunk generation and lighting better Airplane Changes: fad74c2 Fix JB annotations for gradle (credit jpenilla) d02f034 Updated Upstream (Tuinity) Purpur Changes: adfe5d3 Updated Upstream (Paper) 7a728f8 Fix #325 - Fix SPIGOT-6278 f5c3dae Updated Upstream (Paper) a80e5b6 Dont create item meta when checking if meta properties exist 90339c5 Add missing netherite from Material#isArmor bedac18 Updated Upstream (Paper, Tuinity, & Airplane) 3b1531a [ci-skip] Add wrapper validation step to actions 73ab4e6 Update the "changing the blocks that turn into paths" defaults to reflect the vanilla defaults. (#322) a24b31b Updated Upstream (Paper) Empirecraft Changes: 87ceb204 Updated Paper a3497a7e Fix some patches 2ed9e7fa Updated Paper d5a47a3d Updated Paper * Updated Upstream and Sidestream(s) (Tuinity) Upstream/An Sidestream has released updates that appears to apply and compile correctly This update has NOT been tested by YatopiaMC and as with ANY update, please do your own testing. Tuinity Changes: 1382473 Null check chunk in block changes for Starlight
2021-05-11 05:16:50 +02:00
+ return hasItemMeta() && getItemMeta().hasDestroyableKeys();
+ }
+
+ /**
+ * Repairs this item by 1 durability
+ */
+ public void repair() {
+ repair(1);
+ }
+
+ /**
+ * Damages this item by 1 durability
+ *
+ * @return True if damage broke the item
+ */
+ public boolean damage() {
+ return damage(1);
+ }
+
+ /**
+ * Repairs this item's durability by amount
+ *
+ * @param amount Amount of durability to repair
+ */
+ public void repair(int amount) {
+ damage(-amount);
+ }
+
+ /**
+ * Damages this item's durability by amount
+ *
+ * @param amount Amount of durability to damage
+ * @return True if damage broke the item
+ */
+ public boolean damage(int amount) {
+ return damage(amount, false);
+ }
+
+ /**
+ * Damages this item's durability by amount
+ *
+ * @param amount Amount of durability to damage
+ * @param ignoreUnbreaking Ignores unbreaking enchantment
+ * @return True if damage broke the item
+ */
+ public boolean damage(int amount, boolean ignoreUnbreaking) {
+ Damageable damageable = (Damageable) getItemMeta();
+ if (amount > 0) {
+ int unbreaking = getEnchantLevel(Enchantment.DURABILITY);
+ int reduce = 0;
+ for (int i = 0; unbreaking > 0 && i < amount; ++i) {
+ if (reduceDamage(java.util.concurrent.ThreadLocalRandom.current(), unbreaking)) {
+ ++reduce;
+ }
+ }
+ amount -= reduce;
+ if (amount <= 0) {
+ return isBroke(damageable.getDamage());
+ }
+ }
+ int damage = damageable.getDamage() + amount;
+ damageable.setDamage(damage);
+ setItemMeta((ItemMeta) damageable);
+ return isBroke(damage);
+ }
+
+ public boolean isBroke(int damage) {
+ if (damage > getType().getMaxDurability()) {
+ if (getAmount() > 0) {
+ // ensure it "breaks"
+ setAmount(0);
+ }
+ return true;
+ }
+ return false;
+ }
+
+ private boolean reduceDamage(java.util.Random random, int unbreaking) {
+ if (getType().isArmor()) {
+ return random.nextFloat() < 0.6F;
+ }
+ return random.nextInt(unbreaking + 1) > 0;
+ }
+ // Purpur end
}