Will now spawn chicken eggs to the amount of entities in the stack.

This commit is contained in:
Brianna O'Keefe 2019-03-07 14:23:43 -05:00
parent c5c60ca5c0
commit 18aa50c1d7

View File

@ -1,24 +1,25 @@
package com.songoda.ultimatestacker.events;
import com.songoda.ultimatestacker.UltimateStacker;
import com.songoda.ultimatestacker.entity.EntityStack;
import com.songoda.ultimatestacker.entity.EntityStackManager;
import com.songoda.ultimatestacker.spawner.SpawnerStack;
import com.songoda.ultimatestacker.utils.Methods;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.block.CreatureSpawner;
import org.bukkit.entity.Creeper;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import org.bukkit.entity.TNTPrimed;
import org.bukkit.entity.*;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.EntityExplodeEvent;
import org.bukkit.event.player.PlayerPickupItemEvent;
import org.bukkit.event.entity.ItemSpawnEvent;
import org.bukkit.inventory.ItemStack;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
public class EntityListeners implements Listener {
@ -53,7 +54,8 @@ public class EntityListeners implements Listener {
}
@EventHandler
public void onPickup(PlayerPickupItemEvent event) {
public void onPickup(EntityPickupItemEvent event) {
if (!(event.getEntity() instanceof Player)) return;
event.getItem().setItemStack(instance.getStackingTask().setMax(event.getItem().getItemStack(), 0, true));
ItemStack item = event.getItem().getItemStack();