소스 검색

Refactoring

RedstoneFuture 1 년 전
부모
커밋
7d268aa1e9
1개의 변경된 파일3개의 추가작업 그리고 6개의 파일을 삭제
  1. 3 6
      missilewars-plugin/src/main/java/de/butzlabben/missilewars/listener/ShieldListener.java

+ 3 - 6
missilewars-plugin/src/main/java/de/butzlabben/missilewars/listener/ShieldListener.java

@@ -49,12 +49,9 @@ public class ShieldListener implements Listener {
         Bukkit.getScheduler().runTaskLater(MissileWars.getInstance(), () -> {
             HandlerList.unregisterAll(this);
             
-            if (!ball.isDead()) {
-                game.spawnShield(player, ball);
-            } else {
-                Logger.WARN.log("Could not spawn the shield, because the snowball-entity is dead now. " + 
-                        "Check the 'fly_time' of the shield-configuration in this arena!");
-            }
+            // Is the snowball-entity dead because of an invalid 'fly_time' of the shield-configuration 
+            // or a projectile hit before.
+            if (!ball.isDead()) game.spawnShield(player, ball);
             
         }, game.getArena().getShieldConfiguration().getFlyTime());
     }