mirror of
				https://github.com/mcMMO-Dev/mcMMO.git
				synced 2025-11-03 18:43:43 +01:00 
			
		
		
		
	Fix McMMOItemSpawnEvent#setItemStack being ignored in ItemUtils (#5102)
This commit is contained in:
		@@ -764,7 +764,7 @@ public final class ItemUtils {
 | 
			
		||||
            return null;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        return location.getWorld().dropItem(location, itemStack);
 | 
			
		||||
        return location.getWorld().dropItem(location, event.getItemStack());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
@@ -791,7 +791,7 @@ public final class ItemUtils {
 | 
			
		||||
            return null;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        return location.getWorld().dropItemNaturally(location, itemStack);
 | 
			
		||||
        return location.getWorld().dropItemNaturally(location, event.getItemStack());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
@@ -845,6 +845,7 @@ public final class ItemUtils {
 | 
			
		||||
        // We can't get the item until we spawn it and we want to make it cancellable, so we have a custom event.
 | 
			
		||||
        McMMOItemSpawnEvent event = new McMMOItemSpawnEvent(spawnLocation, clonedItem, itemSpawnReason, player);
 | 
			
		||||
        mcMMO.p.getServer().getPluginManager().callEvent(event);
 | 
			
		||||
        clonedItem = event.getItemStack();
 | 
			
		||||
 | 
			
		||||
        //Something cancelled the event so back out
 | 
			
		||||
        if (event.isCancelled()) {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user