Minor changes, added /creative -a, formatting fixes, updated version number

This commit is contained in:
Jerom van der Sar 2013-06-10 08:24:53 +02:00
parent c6ca262472
commit a2a6e39db9
8 changed files with 56 additions and 41 deletions

View File

@ -1,5 +1,5 @@
#Mon, 03 Jun 2013 23:06:55 +0200
#Mon, 03 Jun 2013 23:08:42 +0200
program.VERSION=2.17
program.BUILDNUM=214
program.BUILDDATE=06/03/2013 11\:06 PM
program.VERSION=2.18
program.BUILDNUM=216
program.BUILDDATE=06/03/2013 11\:08 PM

View File

@ -1,3 +1,3 @@
#Build Number for ANT. Do not edit!
#Mon Jun 03 23:06:55 CEST 2013
build.number=215
#Mon Jun 03 23:08:42 CEST 2013
build.number=217

View File

@ -1,4 +1,4 @@
# TotalFreedomMod v2.17 Configuration
# TotalFreedomMod v2.18 Configuration
# by Madgeek1450 and DarthSalamon
# Block placement prevention:

View File

@ -1,6 +1,8 @@
package me.StevenLawson.TotalFreedomMod.Commands;
import me.StevenLawson.TotalFreedomMod.TFM_SuperadminList;
import me.StevenLawson.TotalFreedomMod.TFM_Util;
import me.StevenLawson.TotalFreedomMod.TotalFreedomMod;
import org.bukkit.GameMode;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
@ -29,8 +31,29 @@ public class Command_creative extends TFM_Command
}
else
{
if (senderIsConsole || TFM_SuperadminList.isUserSuperadmin(sender))
if (args[0].equalsIgnoreCase("-a"))
{
if (!TFM_SuperadminList.isUserSuperadmin(sender))
{
sender.sendMessage(TotalFreedomMod.MSG_NO_PERMS);
return true;
}
for (Player player : server.getOnlinePlayers())
{
player.setGameMode(GameMode.CREATIVE);
}
TFM_Util.adminAction(sender.getName(), "Changing everyone's gamemode to creative", false);
return true;
}
if (!(senderIsConsole || TFM_SuperadminList.isUserSuperadmin(sender)))
{
playerMsg("Only superadmins can change other user's gamemode.");
return true;
}
try
{
p = getPlayer(args[0]);
@ -40,12 +63,7 @@ public class Command_creative extends TFM_Command
sender.sendMessage(ex.getMessage());
return true;
}
}
else
{
playerMsg("Only superadmins can change other user's gamemode.");
return true;
}
}
playerMsg("Setting " + p.getName() + " to game mode 'Creative'.");

View File

@ -1,6 +1,7 @@
package me.StevenLawson.TotalFreedomMod.Commands;
import me.StevenLawson.TotalFreedomMod.TFM_SuperadminList;
import me.StevenLawson.TotalFreedomMod.TFM_Util;
import me.StevenLawson.TotalFreedomMod.TotalFreedomMod;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
@ -10,7 +11,7 @@ import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
@CommandPermissions(level = AdminLevel.OP, source = SourceType.BOTH)
@CommandParameters(description = "Quickly change your own gamemode to survival, or define someone's username to change theirs.", usage = "/<command> [partialname]")
@CommandParameters(description = "Quickly change your own gamemode to survival, or define someone's username to change theirs.", usage = "/<command> <[partialname] | -a>")
public class Command_survival extends TFM_Command
{
@Override
@ -26,28 +27,6 @@ public class Command_survival extends TFM_Command
}
Player p;
p = sender_p;
if (args.length != 0){
if (args[0].equalsIgnoreCase("-a"))
{
if (!TFM_SuperadminList.isUserSuperadmin(sender))
{
sender.sendMessage(TotalFreedomMod.MSG_NO_PERMS);
return true;
}
for (Player player : server.getOnlinePlayers())
{
if(!TFM_SuperadminList.isUserSuperadmin(p))
{
player.setGameMode(GameMode.SURVIVAL);
}
}
Bukkit.broadcastMessage(ChatColor.AQUA + sender.getName() + " - Setting all non-admins gamemode to survival.");
return true;
}
}
if (args.length == 0)
{
@ -55,6 +34,23 @@ public class Command_survival extends TFM_Command
}
else
{
if (args[0].equalsIgnoreCase("-a"))
{
if (!TFM_SuperadminList.isUserSuperadmin(sender) || senderIsConsole)
{
sender.sendMessage(TotalFreedomMod.MSG_NO_PERMS);
return true;
}
for (Player player : server.getOnlinePlayers())
{
player.setGameMode(GameMode.SURVIVAL);
}
TFM_Util.adminAction(sender.getName(), "Changing everyone's gamemode to survival", false);
return true;
}
if (senderIsConsole || TFM_SuperadminList.isUserSuperadmin(sender))
{
try

View File

@ -7,3 +7,4 @@ badplayer1:
- 321.321.321.321
badplayer2:
- 111.111.111.111
badplayer3: []

View File

@ -1,6 +1,6 @@
name: TotalFreedomMod
main: me.StevenLawson.TotalFreedomMod.TotalFreedomMod
version: 2.17
version: 2.18
description: Plugin for the Total Freedom server.
authors: [StevenLawson / Madgeek1450, JeromSar / DarthSalamon]

View File

@ -15,7 +15,7 @@ superadmins:
- 127.0.0.1
- 8.8.8.8
last_login: Sun, 11 Nov 2012 01:09:14 -0500
custom_login_message: the &5Chief-Developer&b and &6Master-ass-kicker&b.
custom_login_message: the &4Co-Founder&b and &6Master-ass-kicker&b.
is_senior_admin: true
console_aliases:
- madgeek