mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2025-06-11 13:33:54 +00:00
Fix bat spawning and POM updates (#121)
* Fix bat spawning and POM updates - Update POM for latest versions available - Fix bats and giants bypassing spawn rules - Update usages for /invis from /invis (clear) to /invis [clear] - Add /mob as an alias to /spawnmob - Remove redundant variables from POM
This commit is contained in:
@ -3,6 +3,7 @@ package me.totalfreedom.totalfreedommod.blocking;
|
||||
import me.totalfreedom.totalfreedommod.FreedomService;
|
||||
import me.totalfreedom.totalfreedommod.TotalFreedomMod;
|
||||
import me.totalfreedom.totalfreedommod.config.ConfigEntry;
|
||||
import me.totalfreedom.totalfreedommod.util.FLog;
|
||||
import org.bukkit.attribute.Attributable;
|
||||
import org.bukkit.attribute.Attribute;
|
||||
import org.bukkit.entity.Bat;
|
||||
@ -69,6 +70,7 @@ public class MobBlocker extends FreedomService
|
||||
}
|
||||
|
||||
final Entity spawned = event.getEntity();
|
||||
|
||||
if (spawned instanceof EnderDragon)
|
||||
{
|
||||
if (ConfigEntry.MOB_LIMITER_DISABLE_DRAGON.getBoolean())
|
||||
@ -100,40 +102,40 @@ public class MobBlocker extends FreedomService
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
else if (spawned instanceof Giant)
|
||||
{
|
||||
if (ConfigEntry.MOB_LIMITER_DISABLE_GIANT.getBoolean())
|
||||
{
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
}
|
||||
else if (spawned instanceof Bat)
|
||||
}
|
||||
else if (spawned instanceof Giant)
|
||||
{
|
||||
if (ConfigEntry.MOB_LIMITER_DISABLE_GIANT.getBoolean())
|
||||
{
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
}
|
||||
else if (spawned instanceof Bat)
|
||||
{
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
|
||||
int mobLimiterMax = ConfigEntry.MOB_LIMITER_MAX.getInteger();
|
||||
int mobLimiterMax = ConfigEntry.MOB_LIMITER_MAX.getInteger();
|
||||
|
||||
if (mobLimiterMax <= 0)
|
||||
if (mobLimiterMax <= 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
int mobcount = 0;
|
||||
for (Entity entity : event.getLocation().getWorld().getLivingEntities())
|
||||
{
|
||||
if (!(entity instanceof HumanEntity))
|
||||
{
|
||||
return;
|
||||
mobcount++;
|
||||
}
|
||||
}
|
||||
|
||||
int mobcount = 0;
|
||||
for (Entity entity : event.getLocation().getWorld().getLivingEntities())
|
||||
{
|
||||
if (!(entity instanceof HumanEntity))
|
||||
{
|
||||
mobcount++;
|
||||
}
|
||||
}
|
||||
|
||||
if (mobcount > mobLimiterMax)
|
||||
{
|
||||
event.setCancelled(true);
|
||||
}
|
||||
if (mobcount > mobLimiterMax)
|
||||
{
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -11,7 +11,7 @@ import org.bukkit.entity.Player;
|
||||
import org.bukkit.potion.PotionEffectType;
|
||||
|
||||
@CommandPermissions(level = Rank.SUPER_ADMIN, source = SourceType.BOTH)
|
||||
@CommandParameters(description = "Shows (optionally clears) invisible players", usage = "/<command> (clear)")
|
||||
@CommandParameters(description = "Shows (optionally clears) invisible players", usage = "/<command> [clear]")
|
||||
public class Command_invis extends FreedomCommand
|
||||
{
|
||||
@Override
|
||||
|
Reference in New Issue
Block a user