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-01-16 11:28:38 +01:00
parent 24f1359ecf
commit e523d7849e
2 changed files with 11 additions and 1 deletions

View File

@ -38,6 +38,7 @@
* Fixed a threading issue related to BlockStates and persistent data
* Fixed an error when the server was shutting down
* Fixed #2721
* Fixed #2662
## Release Candidate 19 (11 Jan 2021)

View File

@ -16,6 +16,7 @@ import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.InventoryHolder;
import org.bukkit.inventory.ItemStack;
import io.github.thebusybiscuit.cscorelib2.inventory.InvUtils;
import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin;
import io.github.thebusybiscuit.slimefun4.utils.SlimefunUtils;
import io.github.thebusybiscuit.slimefun4.utils.itemstack.ItemStackWrapper;
@ -310,7 +311,15 @@ final class CargoUtils {
}
@Nullable
private static ItemStack insertIntoVanillaInventory(ItemStack stack, Inventory inv) {
private static ItemStack insertIntoVanillaInventory(@Nonnull ItemStack stack, @Nonnull Inventory inv) {
/*
* If the Inventory does not accept this Item Type, bounce the item back.
* Example: Shulker boxes within shulker boxes (fixes #2662)
*/
if (!InvUtils.isItemAllowed(stack.getType(), inv.getType())) {
return stack;
}
ItemStack[] contents = inv.getContents();
int[] range = getInputSlotRange(inv, stack);
int minSlot = range[0];