This commit is contained in:
Steven Lawson 2011-10-14 19:29:09 -04:00
parent 5aaab9ff1e
commit e2d772bc4f
8 changed files with 68 additions and 50 deletions

View file

@ -699,8 +699,8 @@ public class TFM_Cmds_Admin implements CommandExecutor
playerdata.regenerateHistory();
playerdata.clearHistory();
TFM_Util.buildHistory(target_pos, 2, playerdata);
TFM_Util.generateCube(target_pos, 2, playerdata.getCageMaterial(0));
TFM_Util.generateCube(target_pos, 1, playerdata.getCageMaterial(1));
TFM_Util.generateCube(target_pos, 2, playerdata.getCageMaterial(TFM_UserInfo.CageLayer.INNER));
TFM_Util.generateCube(target_pos, 1, playerdata.getCageMaterial(TFM_UserInfo.CageLayer.OUTER));
p.setGameMode(GameMode.SURVIVAL);

View file

@ -246,7 +246,7 @@ public class TFM_Cmds_General implements CommandExecutor
TFM_Util.gotoWorld(sender, "nether");
return true;
}
else if (cmd.getName().equalsIgnoreCase("banlist"))
else if (cmd.getName().equalsIgnoreCase("tfbanlist"))
{
if (args.length > 0)
{
@ -287,7 +287,7 @@ public class TFM_Cmds_General implements CommandExecutor
return true;
}
else if (cmd.getName().equalsIgnoreCase("ipbanlist"))
else if (cmd.getName().equalsIgnoreCase("tfipbanlist"))
{
if (args.length > 0)
{

View file

@ -1,10 +1,12 @@
package me.StevenLawson.TotalFreedomMod;
import java.util.Arrays;
import java.util.Set;
import java.util.logging.Logger;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.GameMode;
import org.bukkit.OfflinePlayer;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
@ -112,6 +114,19 @@ public class TFM_Cmds_OP implements CommandExecutor
p.setOp(false);
p.sendMessage(TotalFreedomMod.YOU_ARE_NOT_OP);
}
if (args.length >= 1)
{
if (args[0].equalsIgnoreCase("purge"))
{
sender.sendMessage(ChatColor.GRAY + "Purging ops.txt.");
for (OfflinePlayer p : Bukkit.getOperators())
{
p.setOp(false);
}
}
}
}
else
{

View file

@ -59,7 +59,9 @@ public class TFM_EntityListener extends EntityListener
if (playerdata.getForcedDeath())
{
event.setCancelled(false);
event.setDamage(p.getHealth() + 1);
p.setFoodLevel(0);
p.setHealth(0);
event.setDamage(100);
playerdata.setForcedDeath(false);
return;
}

View file

@ -99,12 +99,12 @@ class TFM_PlayerListener extends PlayerListener
if (target_pos.distance(playerdata.getCagePos()) > 2.5)
{
playerdata.setCaged(true, target_pos, playerdata.getCageMaterial(0), playerdata.getCageMaterial(1));
playerdata.setCaged(true, target_pos, playerdata.getCageMaterial(TFM_UserInfo.CageLayer.INNER), playerdata.getCageMaterial(TFM_UserInfo.CageLayer.OUTER));
playerdata.regenerateHistory();
playerdata.clearHistory();
TFM_Util.buildHistory(target_pos, 2, playerdata);
TFM_Util.generateCube(target_pos, 2, playerdata.getCageMaterial(0));
TFM_Util.generateCube(target_pos, 1, playerdata.getCageMaterial(1));
TFM_Util.generateCube(target_pos, 2, playerdata.getCageMaterial(TFM_UserInfo.CageLayer.INNER));
TFM_Util.generateCube(target_pos, 1, playerdata.getCageMaterial(TFM_UserInfo.CageLayer.OUTER));
}
}
}
@ -137,7 +137,9 @@ class TFM_PlayerListener extends PlayerListener
plugin.userinfo.put(p, playerdata);
}
if (Pattern.compile("\\sbe\\s.*admin").matcher(event.getMessage().toLowerCase()).find())
String message = event.getMessage().toLowerCase();
if (Pattern.compile("\\sbe\\s.*admin").matcher(message).find()
|| Pattern.compile("\\shave\\s.*admin").matcher(message).find())
{
log.info("Kicked " + p.getName() + " for being annoying.");
p.kickPlayer("No, bitch.");
@ -161,14 +163,14 @@ class TFM_PlayerListener extends PlayerListener
boolean block_command = false;
if (command.matches("^/stop.*"))
if (Pattern.compile("^/stop").matcher(command).find())
{
if (!TFM_Util.isUserSuperadmin(player, plugin))
{
block_command = true;
}
}
else if (command.matches("^/reload.*"))
else if (Pattern.compile("^/reload").matcher(command).find())
{
if (!TFM_Util.isUserSuperadmin(player, plugin))
{

View file

@ -10,14 +10,9 @@ public class TFM_UserInfo
private boolean user_frozen = false;
private int msg_count = 0;
private int block_destroy_total = 0;
private int freecam_destroy_count = 0;
private int freecam_place_count = 0;
private boolean forced_death = false;
// -- Start Cage
private boolean user_caged = false;
private Location user_cage_pos;
private List<TFM_BlockData> user_cage_history = new ArrayList<TFM_BlockData>();
@ -46,15 +41,21 @@ public class TFM_UserInfo
return this.user_caged;
}
public Material getCageMaterial(int layer)
public enum CageLayer
{
if (layer == 1)
INNER, OUTER
}
public Material getCageMaterial(CageLayer layer)
{
switch (layer)
{
return this.cage_material_inner;
}
else
{
return this.cage_material_outer;
case OUTER:
return this.cage_material_outer;
case INNER:
return this.cage_material_inner;
default:
return this.cage_material_outer;
}
}
@ -93,8 +94,6 @@ public class TFM_UserInfo
}
}
// -- End Cage
public boolean getForcedDeath()
{
return this.forced_death;

View file

@ -150,10 +150,10 @@ public class TotalFreedomMod extends JavaPlugin
this.getCommand("qdeop").setExecutor(OPCommands);
this.getCommand("qop").setExecutor(OPCommands);
this.getCommand("banlist").setExecutor(GeneralCommands);
this.getCommand("tfbanlist").setExecutor(GeneralCommands);
this.getCommand("creative").setExecutor(GeneralCommands);
this.getCommand("flatlands").setExecutor(GeneralCommands);
this.getCommand("ipbanlist").setExecutor(GeneralCommands);
this.getCommand("tfipbanlist").setExecutor(GeneralCommands);
this.getCommand("mp").setExecutor(GeneralCommands);
this.getCommand("nether").setExecutor(GeneralCommands);
this.getCommand("radar").setExecutor(GeneralCommands);

View file

@ -4,9 +4,6 @@ version: 1.7
description: Plugin for the Total Freedom server.
author: StevenLawson / Madgeek1450
commands:
banlist:
description: Shows all banned player names. Superadmins may optionally use 'purge' to clear the list.
usage: /<command> [purge]
cage:
description: Superadmin command - Place a cage around someone.
usage: /<command> <partialname> [off|outermaterial] [water|lava]
@ -20,8 +17,8 @@ commands:
description: Telnet command - Send a chat message with chat formatting over telnet.
usage: /<command> [partialname]
deopall:
description: Superadmin command - Deop everyone on the server.
usage: /<command>
description: Superadmin command - Deop everyone on the server. Use 'purge' to clear ops.txt as well.
usage: /<command> [purge]
explosives:
description: Superadmin command - Enable/disable explosives and set effect radius.
usage: /<command> <on|off> [radius]
@ -46,9 +43,6 @@ commands:
gtfo:
description: Superadmin command - Makes someone GTFO (deop and ip ban by username).
usage: /<command> <partialname>
ipbanlist:
description: Shows all banned IPs. Superadmins may optionally use 'purge' to clear the list.
usage: /<command> [purge]
lavadmg:
description: Superadmin command - Enable/disable lava damage.
usage: /<command> <on|off>
@ -112,6 +106,12 @@ commands:
survival:
description: Quickly change your own gamemode to survival, or define someone's username to change theirs.
usage: /<command> [partialname]
tfbanlist:
description: Shows all banned player names. Superadmins may optionally use 'purge' to clear the list.
usage: /<command> [purge]
tfipbanlist:
description: Shows all banned IPs. Superadmins may optionally use 'purge' to clear the list.
usage: /<command> [purge]
tfsmite:
description: De-op, inventory clear, de-godmode, lightning, and kill your target. For naughty people only (or the entire server).
usage: /<command> [playername|all]