diff --git a/CHANGELOG.md b/CHANGELOG.md index f2ca1765f..b368dfb13 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,5 @@ # Table of contents +- [Release Candidate 29 (TBD)](#release-candidate-29-tbd) - [Release Candidate 28 (06 Sep 2021)](#release-candidate-28-06-sep-2021) - [Release Candidate 27 (03 Sep 2021)](#release-candidate-27-03-sep-2021) - [Release Candidate 26 (20 Jul 2021)](#release-candidate-26-20-jul-2021) @@ -28,6 +29,15 @@ - [Release Candidate 2 (29 Sep 2019)](#release-candidate-2-29-sep-2019) - [Release Candidate 1 (26 Sep 2019)](#release-candidate-1-26-sep-2019) +## Release Candidate 29 (TBD) + +#### Additions + +#### Changes + +#### Fixes +* Fixed #3218 + ## Release Candidate 28 (06 Sep 2021) #### Fixes diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/blocks/BlockPlacer.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/blocks/BlockPlacer.java index f8c5dcacf..530a0742c 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/blocks/BlockPlacer.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/blocks/BlockPlacer.java @@ -107,7 +107,8 @@ public class BlockPlacer extends SlimefunItem { if (!(item instanceof NotPlaceable)) { placeSlimefunBlock(item, e.getItem(), facedBlock, dispenser); } - } else { + } else if (!Slimefun.getIntegrations().isCustomItem(e.getItem())) { + // Fixes #3218 - Prevent placement of custom items (ItemsAdder) placeBlock(e.getItem(), facedBlock, dispenser); } } diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/integrations/IntegrationsManager.java b/src/main/java/io/github/thebusybiscuit/slimefun4/integrations/IntegrationsManager.java index f755dda19..501fe851b 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/integrations/IntegrationsManager.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/integrations/IntegrationsManager.java @@ -267,6 +267,28 @@ public class IntegrationsManager { return false; } + /** + * This checks if one of our third party integrations defines a given + * {@link ItemStack} as custom. + * + * @param item + * The {@link ItemStack} to check + * + * @return Whether this {@link ItemStack} is a custom item + */ + @SuppressWarnings("deprecation") + public boolean isCustomItem(@Nonnull ItemStack item) { + if (isItemsAdderInstalled) { + try { + return ItemsAdder.isCustomItem(item); + } catch (Exception | LinkageError x) { + logError("ItemsAdder", x); + } + } + + return false; + } + /** * This method removes any temporary enchantments from the given {@link ItemStack}. * Some plugins apply enchantments for a short amount of time and remove it later.