This commit is contained in:
Steven Lawson 2012-12-10 22:05:08 -05:00
parent 972e81276d
commit d066c1b754
2 changed files with 84 additions and 64 deletions

View File

@ -102,7 +102,9 @@ public class TFM_PlayerListener implements Listener
}
case BLAZE_ROD:
{
if (TotalFreedomMod.allowExplosions && TFM_SuperadminList.isSeniorAdmin(player))
if (TotalFreedomMod.allowExplosions)
{
if (TFM_SuperadminList.isSeniorAdmin(player, true))
{
Block target_block;
@ -128,11 +130,14 @@ public class TFM_PlayerListener implements Listener
event.setCancelled(true);
return;
}
}
break;
}
case CARROT:
{
if (TotalFreedomMod.allowExplosions && TFM_SuperadminList.isSeniorAdmin(player))
if (TotalFreedomMod.allowExplosions)
{
if (TFM_SuperadminList.isSeniorAdmin(player, true))
{
Location player_location = player.getLocation().clone();
@ -186,6 +191,7 @@ public class TFM_PlayerListener implements Listener
event.setCancelled(true);
return;
}
}
break;
}
}
@ -291,6 +297,7 @@ public class TFM_PlayerListener implements Listener
p.setVelocity(new Vector(0, playerdata.orbitStrength(), 0));
}
}
if (TotalFreedomMod.landminesEnabled && TotalFreedomMod.allowExplosions)
{
Iterator<TFM_LandmineData> landmines = TFM_LandmineData.landmines.iterator();

View File

@ -202,6 +202,19 @@ public class TFM_SuperadminList
public static boolean isSeniorAdmin(CommandSender user)
{
return isSeniorAdmin(user, false);
}
public static boolean isSeniorAdmin(CommandSender user, boolean verify_is_superadmin)
{
if (verify_is_superadmin)
{
if (!isUserSuperadmin(user))
{
return false;
}
}
String user_name = user.getName().toLowerCase();
if (!(user instanceof Player))