Fixes for Codacy;

These fixes are designed to satisfy codacy.

However, codacy reports a NPath Complexity of 649, whereas the current, recommended, and standardized threshold is 200.

This is caused by FreedomCommand#execute(CommandSender, String, String[]);
This commit is contained in:
Paldiu
2020-12-25 15:35:33 -05:00
parent 361aa4ee04
commit 97edce0a67
7 changed files with 22 additions and 27 deletions

View File

@ -134,13 +134,11 @@ public class EventBlocker extends FreedomService
@EventHandler(priority = EventPriority.HIGH)
public void onEntityDamage(EntityDamageEvent event)
{
if (event.getCause() == EntityDamageEvent.DamageCause.LAVA)
if ((event.getCause() == EntityDamageEvent.DamageCause.LAVA)
&& !ConfigEntry.ALLOW_LAVA_DAMAGE.getBoolean())
{
if (!ConfigEntry.ALLOW_LAVA_DAMAGE.getBoolean())
{
event.setCancelled(true);
return;
}
event.setCancelled(true);
return;
}
if (ConfigEntry.ENABLE_PET_PROTECT.getBoolean())