mirror of
https://github.com/songoda/UltimateStacker.git
synced 2024-11-14 22:25:22 +01:00
New method to spawn stacked items
This commit is contained in:
parent
8afc333442
commit
865e45010c
@ -49,6 +49,7 @@ import com.songoda.ultimatestacker.tasks.StackingTask;
|
||||
import com.songoda.ultimatestacker.utils.Methods;
|
||||
import org.apache.commons.lang.WordUtils;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.EntityType;
|
||||
import org.bukkit.entity.Item;
|
||||
@ -382,6 +383,19 @@ public class UltimateStacker extends SongodaPlugin {
|
||||
|
||||
//////// Convenient API //////////
|
||||
|
||||
/**
|
||||
* Spawn a stacked item at a location
|
||||
*
|
||||
* @param item The item to spawn
|
||||
* @param amount The amount of items to spawn
|
||||
* @param location The location to spawn the item
|
||||
*/
|
||||
public static void spawnStackedItem(ItemStack item, int amount, Location location) {
|
||||
location.getWorld().dropItem(location, item, dropped -> {
|
||||
updateItemAmount(dropped, amount);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Change the stacked amount for this item
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user