mirror of
				https://github.com/IntellectualSites/PlotSquared.git
				synced 2025-11-04 11:13:45 +01:00 
			
		
		
		
	Suppress errors due to failed getEntitySpawnReason implementation (#4334)
fix: suppress errors due to failed getEntitySpawnReason implementation
This commit is contained in:
		
				
					committed by
					
						
						GitHub
					
				
			
			
				
	
			
			
			
						parent
						
							0de6887526
						
					
				
				
					commit
					d9537ee9df
				
			@@ -779,7 +779,8 @@ public final class BukkitPlatform extends JavaPlugin implements Listener, PlotPl
 | 
			
		||||
                Iterator<Entity> iterator = entities.iterator();
 | 
			
		||||
                while (iterator.hasNext()) {
 | 
			
		||||
                    Entity entity = iterator.next();
 | 
			
		||||
                    if (PaperLib.isPaper() && "CUSTOM".equals(entity.getEntitySpawnReason().name())) {
 | 
			
		||||
                    //noinspection ConstantValue - getEntitySpawnReason annotated as NotNull, but is not NotNull. lol.
 | 
			
		||||
                    if (PaperLib.isPaper() && entity.getEntitySpawnReason() != null && "CUSTOM".equals(entity.getEntitySpawnReason().name())) {
 | 
			
		||||
                        continue;
 | 
			
		||||
                    }
 | 
			
		||||
                    // Fallback for Spigot not having Entity#getEntitySpawnReason
 | 
			
		||||
 
 | 
			
		||||
@@ -124,7 +124,8 @@ public class EntitySpawnListener implements Listener {
 | 
			
		||||
            return;
 | 
			
		||||
        }
 | 
			
		||||
        if (PaperLib.isPaper()) {
 | 
			
		||||
            if (area.isSpawnCustom() && "CUSTOM".equals(entity.getEntitySpawnReason().name())) {
 | 
			
		||||
            //noinspection ConstantValue - getEntitySpawnReason annotated as NotNull, but is not NotNull. lol.
 | 
			
		||||
            if (area.isSpawnCustom() && entity.getEntitySpawnReason() != null && "CUSTOM".equals(entity.getEntitySpawnReason().name())) {
 | 
			
		||||
                return;
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user