1
mirror of https://github.com/StarWishsama/Slimefun4.git synced 2024-09-19 19:25:48 +00:00
This commit is contained in:
TheBusyBiscuit 2021-09-09 12:58:57 +02:00
parent 1e5c32cf52
commit 68e32cb358
3 changed files with 34 additions and 1 deletions

View File

@ -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

View File

@ -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);
}
}

View File

@ -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.