mirror of
				https://github.com/mcMMO-Dev/mcMMO.git
				synced 2025-11-04 11:03:43 +01:00 
			
		
		
		
	Prevent multiple events from being fired.
This commit is contained in:
		@@ -199,7 +199,12 @@ public class EntityListener implements Listener {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        Entity entity = event.getEntity();
 | 
					        Entity entity = event.getEntity();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if (!(entity instanceof LivingEntity)) {
 | 
					        if (entity.hasMetadata(mcMMO.customDamageKey)) {
 | 
				
			||||||
 | 
					            entity.removeMetadata(mcMMO.customDamageKey, plugin);
 | 
				
			||||||
 | 
					            return;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        if (Misc.isNPCEntity(entity) || !entity.isValid() || !(entity instanceof LivingEntity)) {
 | 
				
			||||||
            return;
 | 
					            return;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -213,11 +218,6 @@ public class EntityListener implements Listener {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        if (livingEntity instanceof Player) {
 | 
					        if (livingEntity instanceof Player) {
 | 
				
			||||||
            Player player = (Player) entity;
 | 
					            Player player = (Player) entity;
 | 
				
			||||||
 | 
					 | 
				
			||||||
            if (Misc.isNPCEntity(player)) {
 | 
					 | 
				
			||||||
                return;
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            McMMOPlayer mcMMOPlayer = UserManager.getPlayer(player);
 | 
					            McMMOPlayer mcMMOPlayer = UserManager.getPlayer(player);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            /* Check for invincibility */
 | 
					            /* Check for invincibility */
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user