mirror of
https://github.com/craftaro/EpicSpawners.git
synced 2025-01-09 03:57:40 +08:00
Made it so that adding custom items for a spawner drop will cancel out the default ones.
This commit is contained in:
parent
834398bfc7
commit
b0cd5228d0
@ -100,11 +100,12 @@ public class EntityListeners implements Listener {
|
||||
EpicSpawnersPlugin instance = EpicSpawnersPlugin.getInstance();
|
||||
if (event.getEntity().hasMetadata("ES")) {
|
||||
SpawnerData spawnerData = instance.getSpawnerManager().getSpawnerData(event.getEntity().getMetadata("ES").get(0).asString());
|
||||
for (ItemStack itemStack : spawnerData.getEntityDroppedItems()) {
|
||||
Location location = event.getEntity().getLocation();
|
||||
location.getWorld().dropItemNaturally(location, itemStack);
|
||||
if (!spawnerData.getEntityDroppedItems().isEmpty()) {
|
||||
event.getDrops().clear();
|
||||
}
|
||||
for (ItemStack itemStack : spawnerData.getEntityDroppedItems()) {
|
||||
event.getDrops().add(itemStack);
|
||||
}
|
||||
|
||||
}
|
||||
if (event.getEntity().getKiller() == null) return;
|
||||
Player player = event.getEntity().getKiller();
|
||||
|
Loading…
Reference in New Issue
Block a user