mirror of
https://github.com/StarWishsama/Slimefun4.git
synced 2024-09-20 03:35:51 +00:00
Added SlimefunUtils.spawnItem instead of dropItemNaturally
This commit is contained in:
parent
dd343e8e73
commit
c148c8b4da
@ -5,6 +5,7 @@ import org.bukkit.inventory.ItemStack;
|
||||
|
||||
import io.github.thebusybiscuit.slimefun4.api.events.SlimefunItemSpawnEvent;
|
||||
import io.github.thebusybiscuit.slimefun4.core.networks.cargo.CargoNet;
|
||||
import io.github.thebusybiscuit.slimefun4.core.multiblocks.MultiBlockMachine;
|
||||
import io.github.thebusybiscuit.slimefun4.implementation.items.altar.AncientPedestal;
|
||||
import io.github.thebusybiscuit.slimefun4.implementation.items.seasonal.ChristmasPresent;
|
||||
import io.github.thebusybiscuit.slimefun4.implementation.items.seasonal.EasterEgg;
|
||||
@ -39,12 +40,18 @@ public enum ItemSpawnReason {
|
||||
CARGO_OVERFLOW,
|
||||
|
||||
/**
|
||||
* THe {@link ItemStack} is dropped as the result of an opened {@link ChristmasPresent}.
|
||||
* The {@link ItemStack} is dropped as the result of a {@link MultiBlockMachine}
|
||||
* overflowing.
|
||||
*/
|
||||
MULTIBLOCK_MACHINE_OVERFLOW,
|
||||
|
||||
/**
|
||||
* The {@link ItemStack} is dropped as the result of an opened {@link ChristmasPresent}.
|
||||
*/
|
||||
CHRISTMAS_PRESENT_OPENED,
|
||||
|
||||
/**
|
||||
* THe {@link ItemStack} is dropped as the result of an opened {@link EasterEgg}.
|
||||
* The {@link ItemStack} is dropped as the result of an opened {@link EasterEgg}.
|
||||
*/
|
||||
EASTER_EGG_OPENED,
|
||||
|
||||
|
@ -9,6 +9,8 @@ import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
import javax.annotation.ParametersAreNonnullByDefault;
|
||||
|
||||
import io.github.thebusybiscuit.slimefun4.api.items.ItemSpawnReason;
|
||||
import io.github.thebusybiscuit.slimefun4.utils.SlimefunUtils;
|
||||
import org.apache.commons.lang.Validate;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.World;
|
||||
@ -186,7 +188,7 @@ public abstract class MultiBlockMachine extends SlimefunItem implements NotPlace
|
||||
containerInv.addItem(outputItem);
|
||||
} else {
|
||||
// fallback
|
||||
container.getWorld().dropItemNaturally(container.getLocation(), outputItem);
|
||||
SlimefunUtils.spawnItem(container.getLocation(), outputItem, ItemSpawnReason.MULTIBLOCK_MACHINE_OVERFLOW, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user