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.regenerateHistory();
playerdata.clearHistory(); playerdata.clearHistory();
TFM_Util.buildHistory(target_pos, 2, playerdata); TFM_Util.buildHistory(target_pos, 2, playerdata);
TFM_Util.generateCube(target_pos, 2, playerdata.getCageMaterial(0)); TFM_Util.generateCube(target_pos, 2, playerdata.getCageMaterial(TFM_UserInfo.CageLayer.INNER));
TFM_Util.generateCube(target_pos, 1, playerdata.getCageMaterial(1)); TFM_Util.generateCube(target_pos, 1, playerdata.getCageMaterial(TFM_UserInfo.CageLayer.OUTER));
p.setGameMode(GameMode.SURVIVAL); p.setGameMode(GameMode.SURVIVAL);

View File

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

View File

@ -1,10 +1,12 @@
package me.StevenLawson.TotalFreedomMod; package me.StevenLawson.TotalFreedomMod;
import java.util.Arrays; import java.util.Arrays;
import java.util.Set;
import java.util.logging.Logger; import java.util.logging.Logger;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.ChatColor; import org.bukkit.ChatColor;
import org.bukkit.GameMode; import org.bukkit.GameMode;
import org.bukkit.OfflinePlayer;
import org.bukkit.command.Command; import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
@ -112,6 +114,19 @@ public class TFM_Cmds_OP implements CommandExecutor
p.setOp(false); p.setOp(false);
p.sendMessage(TotalFreedomMod.YOU_ARE_NOT_OP); 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 else
{ {

View File

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

View File

@ -99,12 +99,12 @@ class TFM_PlayerListener extends PlayerListener
if (target_pos.distance(playerdata.getCagePos()) > 2.5) 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.regenerateHistory();
playerdata.clearHistory(); playerdata.clearHistory();
TFM_Util.buildHistory(target_pos, 2, playerdata); TFM_Util.buildHistory(target_pos, 2, playerdata);
TFM_Util.generateCube(target_pos, 2, playerdata.getCageMaterial(0)); TFM_Util.generateCube(target_pos, 2, playerdata.getCageMaterial(TFM_UserInfo.CageLayer.INNER));
TFM_Util.generateCube(target_pos, 1, playerdata.getCageMaterial(1)); 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); 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."); log.info("Kicked " + p.getName() + " for being annoying.");
p.kickPlayer("No, bitch."); p.kickPlayer("No, bitch.");
@ -161,14 +163,14 @@ class TFM_PlayerListener extends PlayerListener
boolean block_command = false; boolean block_command = false;
if (command.matches("^/stop.*")) if (Pattern.compile("^/stop").matcher(command).find())
{ {
if (!TFM_Util.isUserSuperadmin(player, plugin)) if (!TFM_Util.isUserSuperadmin(player, plugin))
{ {
block_command = true; block_command = true;
} }
} }
else if (command.matches("^/reload.*")) else if (Pattern.compile("^/reload").matcher(command).find())
{ {
if (!TFM_Util.isUserSuperadmin(player, plugin)) if (!TFM_Util.isUserSuperadmin(player, plugin))
{ {

View File

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

View File

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

View File

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