Permalink
Browse files

Added snowPile (needs small CraftBukkit patch!),

Started refactoring for commands, needs some additional work though
Removed Java 1.6 code and annotations to make it 1.5 compatible again.
  • Loading branch information...
1 parent 9336abc commit 0cd2a79dd5c3f94d7e9a2982df5d1f4d5ff0bfd5 @GuntherDW committed Dec 26, 2011
Showing with 5,069 additions and 6,928 deletions.
  1. +7 −6 plugin.yml
  2. +9 −10 src/com/guntherdw/bukkit/tweakcraft/Chat/Modes/AdminChat.java
  3. +0 −10 src/com/guntherdw/bukkit/tweakcraft/Chat/Modes/GroupChat.java
  4. +3 −4 src/com/guntherdw/bukkit/tweakcraft/Chat/Modes/LocalChat.java
  5. +18 −25 src/com/guntherdw/bukkit/tweakcraft/Chat/Modes/RegionChat.java
  6. +5 −6 src/com/guntherdw/bukkit/tweakcraft/Chat/Modes/WorldChat.java
  7. +14 −20 src/com/guntherdw/bukkit/tweakcraft/Chat/Modes/ZoneChat.java
  8. +0 −69 src/com/guntherdw/bukkit/tweakcraft/Commands/Admin/CommandAdmin.java
  9. +0 −86 src/com/guntherdw/bukkit/tweakcraft/Commands/Admin/CommandAdminAdd.java
  10. +0 −69 src/com/guntherdw/bukkit/tweakcraft/Commands/Admin/CommandAdminList.java
  11. +0 −100 src/com/guntherdw/bukkit/tweakcraft/Commands/Admin/CommandAdminRemove.java
  12. +0 −60 src/com/guntherdw/bukkit/tweakcraft/Commands/Admin/CommandAdmoff.java
  13. +0 −62 src/com/guntherdw/bukkit/tweakcraft/Commands/Admin/CommandAdmon.java
  14. +0 −67 src/com/guntherdw/bukkit/tweakcraft/Commands/Admin/CommandClearInventory.java
  15. +0 −273 src/com/guntherdw/bukkit/tweakcraft/Commands/Admin/CommandTC.java
  16. +0 −64 src/com/guntherdw/bukkit/tweakcraft/Commands/Admin/CommandTpList.java
  17. +0 −97 src/com/guntherdw/bukkit/tweakcraft/Commands/Admin/CommandViewDistance.java
  18. +0 −179 src/com/guntherdw/bukkit/tweakcraft/Commands/Chat/CommandChatMode.java
  19. +0 −124 src/com/guntherdw/bukkit/tweakcraft/Commands/Chat/CommandLc.java
  20. +0 −133 src/com/guntherdw/bukkit/tweakcraft/Commands/Chat/CommandRc.java
  21. +0 −124 src/com/guntherdw/bukkit/tweakcraft/Commands/Chat/CommandWc.java
  22. +0 −133 src/com/guntherdw/bukkit/tweakcraft/Commands/Chat/CommandZc.java
  23. +98 −110 src/com/guntherdw/bukkit/tweakcraft/Commands/CommandHandler.java
  24. +645 −0 src/com/guntherdw/bukkit/tweakcraft/Commands/Commands/AdminCommands.java
  25. +560 −0 src/com/guntherdw/bukkit/tweakcraft/Commands/Commands/ChatCommands.java
  26. +22 −22 src/com/guntherdw/bukkit/tweakcraft/Commands/{Debug/CommandDebug.java → Commands/DebugCommands.java}
  27. +1,374 −0 src/com/guntherdw/bukkit/tweakcraft/Commands/Commands/EssentialsCommands.java
  28. +1,094 −0 src/com/guntherdw/bukkit/tweakcraft/Commands/Commands/GeneralCommands.java
  29. +721 −0 src/com/guntherdw/bukkit/tweakcraft/Commands/Commands/TeleportationCommands.java
  30. +248 −0 src/com/guntherdw/bukkit/tweakcraft/Commands/Commands/WeatherCommands.java
  31. +0 −112 src/com/guntherdw/bukkit/tweakcraft/Commands/Essentials/CommandBan.java
  32. +0 −73 src/com/guntherdw/bukkit/tweakcraft/Commands/Essentials/CommandBanlist.java
  33. +0 −52 src/com/guntherdw/bukkit/tweakcraft/Commands/Essentials/CommandCompass.java
  34. +0 −95 src/com/guntherdw/bukkit/tweakcraft/Commands/Essentials/CommandGetpos.java
  35. +0 −174 src/com/guntherdw/bukkit/tweakcraft/Commands/Essentials/CommandHelp.java
  36. +0 −162 src/com/guntherdw/bukkit/tweakcraft/Commands/Essentials/CommandItem.java
  37. +0 −74 src/com/guntherdw/bukkit/tweakcraft/Commands/Essentials/CommandKick.java
  38. +0 −95 src/com/guntherdw/bukkit/tweakcraft/Commands/Essentials/CommandListWorlds.java
  39. +0 −77 src/com/guntherdw/bukkit/tweakcraft/Commands/Essentials/CommandMe.java
  40. +0 −61 src/com/guntherdw/bukkit/tweakcraft/Commands/Essentials/CommandMotd.java
  41. +0 −82 src/com/guntherdw/bukkit/tweakcraft/Commands/Essentials/CommandMsg.java
  42. +0 −90 src/com/guntherdw/bukkit/tweakcraft/Commands/Essentials/CommandMute.java
  43. +0 −114 src/com/guntherdw/bukkit/tweakcraft/Commands/Essentials/CommandPlugin.java
  44. +0 −74 src/com/guntherdw/bukkit/tweakcraft/Commands/Essentials/CommandReply.java
  45. +0 −62 src/com/guntherdw/bukkit/tweakcraft/Commands/Essentials/CommandSetSpawn.java
  46. +0 −61 src/com/guntherdw/bukkit/tweakcraft/Commands/Essentials/CommandSpawn.java
  47. +0 −196 src/com/guntherdw/bukkit/tweakcraft/Commands/Essentials/CommandSpawnmob.java
  48. +0 −92 src/com/guntherdw/bukkit/tweakcraft/Commands/Essentials/CommandTime.java
  49. +0 −60 src/com/guntherdw/bukkit/tweakcraft/Commands/Essentials/CommandUnban.java
  50. +0 −126 src/com/guntherdw/bukkit/tweakcraft/Commands/Essentials/CommandWho.java
  51. +0 −137 src/com/guntherdw/bukkit/tweakcraft/Commands/Essentials/CommandWorld.java
  52. +0 −53 src/com/guntherdw/bukkit/tweakcraft/Commands/General/CommandAFK.java
  53. +0 −93 src/com/guntherdw/bukkit/tweakcraft/Commands/General/CommandAddExperience.java
  54. +0 −100 src/com/guntherdw/bukkit/tweakcraft/Commands/General/CommandBroadcast.java
  55. +0 −65 src/com/guntherdw/bukkit/tweakcraft/Commands/General/CommandDoNotMount.java
  56. +0 −68 src/com/guntherdw/bukkit/tweakcraft/Commands/General/CommandEject.java
  57. +0 −122 src/com/guntherdw/bukkit/tweakcraft/Commands/General/CommandEnchant.java
  58. +0 −181 src/com/guntherdw/bukkit/tweakcraft/Commands/General/CommandExt.java
  59. +0 −106 src/com/guntherdw/bukkit/tweakcraft/Commands/General/CommandGetSpawn.java
  60. +0 −182 src/com/guntherdw/bukkit/tweakcraft/Commands/General/CommandIgnite.java
  61. +0 −73 src/com/guntherdw/bukkit/tweakcraft/Commands/General/CommandLocalWho.java
  62. +0 −98 src/com/guntherdw/bukkit/tweakcraft/Commands/General/CommandNick.java
  63. +0 −121 src/com/guntherdw/bukkit/tweakcraft/Commands/General/CommandSeen.java
  64. +0 −64 src/com/guntherdw/bukkit/tweakcraft/Commands/General/CommandTNTArrow.java
  65. +0 −118 src/com/guntherdw/bukkit/tweakcraft/Commands/General/CommandTamer.java
  66. +0 −150 src/com/guntherdw/bukkit/tweakcraft/Commands/General/CommandWhois.java
  67. +0 −130 src/com/guntherdw/bukkit/tweakcraft/Commands/Teleportation/CommandTPBack.java
  68. +0 −94 src/com/guntherdw/bukkit/tweakcraft/Commands/Teleportation/CommandTPForward.java
  69. +0 −174 src/com/guntherdw/bukkit/tweakcraft/Commands/Teleportation/CommandTele.java
  70. +0 −186 src/com/guntherdw/bukkit/tweakcraft/Commands/Teleportation/CommandTp.java
  71. +0 −120 src/com/guntherdw/bukkit/tweakcraft/Commands/Teleportation/CommandTpMob.java
  72. +0 −77 src/com/guntherdw/bukkit/tweakcraft/Commands/Teleportation/CommandTpOff.java
  73. +0 −77 src/com/guntherdw/bukkit/tweakcraft/Commands/Teleportation/CommandTpOn.java
  74. +0 −115 src/com/guntherdw/bukkit/tweakcraft/Commands/Teleportation/CommandTphere.java
  75. +0 −69 src/com/guntherdw/bukkit/tweakcraft/Commands/Weather/CommandLightning.java
  76. +0 −85 src/com/guntherdw/bukkit/tweakcraft/Commands/Weather/CommandRain.java
  77. +0 −116 src/com/guntherdw/bukkit/tweakcraft/Commands/Weather/CommandStrikeBind.java
  78. +0 −86 src/com/guntherdw/bukkit/tweakcraft/Commands/Weather/CommandThunder.java
  79. +36 −0 src/com/guntherdw/bukkit/tweakcraft/Commands/aCommand.java
  80. +7 −2 src/com/guntherdw/bukkit/tweakcraft/Commands/iCommand.java
  81. +77 −23 src/com/guntherdw/bukkit/tweakcraft/Configuration/ConfigurationHandler.java
  82. +46 −3 src/com/guntherdw/bukkit/tweakcraft/Listeners/TweakcraftBlockListener.java
  83. +1 −1 src/com/guntherdw/bukkit/tweakcraft/Listeners/TweakcraftEntityListener.java
  84. +10 −4 src/com/guntherdw/bukkit/tweakcraft/Listeners/TweakcraftPlayerListener.java
  85. +0 −6 src/com/guntherdw/bukkit/tweakcraft/Packages/CraftIRCAdminEndPoint.java
  86. +3 −9 src/com/guntherdw/bukkit/tweakcraft/Packages/CraftIRCEndPoint.java
  87. +13 −7 src/com/guntherdw/bukkit/tweakcraft/TweakcraftUtils.java
  88. +37 −19 src/com/guntherdw/bukkit/tweakcraft/Worlds/TweakWorld.java
  89. +17 −8 src/com/guntherdw/bukkit/tweakcraft/Worlds/WorldManager.java
  90. +4 −1 src/com/guntherdw/bukkit/tweakcraft/Worlds/iWorld.java
View
@@ -1,6 +1,6 @@
name: TweakcraftUtils
main: com.guntherdw.bukkit.tweakcraft.TweakcraftUtils
-version: 2.2.7-git
+version: 2.8.0-git
authors:
- GuntherDW
- Meaglin
@@ -83,7 +83,7 @@ commands:
tphere:
description: Teleport a player to you
usage: /<command> <player>
- aliases: [ 's' ]
+ aliases: [ 's', 'summon' ]
seen:
description: Report the last logout time of the player
usage: /<command> <player>
@@ -92,7 +92,7 @@ commands:
usage: /<command> <message>
aliases: [ 'b', 'broa' ]
tpmob:
- description: Teleports you to a mob
+ description: Teleports a mob to you
usage: /<command> <mobid>
kick:
description: Kicks a player with reason
@@ -123,7 +123,7 @@ commands:
description: Shows your current orientation
usage: /<command>
spawnmob:
- description: Spawns mobs at your position
+ description: Spawns mobs at your crosshair
usage: /<command> <mobname> [amount] [player]
motd:
description: Show the message of the day!
@@ -176,6 +176,7 @@ commands:
rain:
description: Turn storm on or off at command
usage: /<command> <world> <on|off>
+ aliases: [ 'storm' ]
thunder:
description: Turn thunder on or off at command
usage: /<command> <world> <on|off>
@@ -197,7 +198,7 @@ commands:
description: Tamer tool control
usage: /<command> <mode>
nick:
- description: Setup a nick
+ description: Give someone a nick
usage: /<command> <nick>
whois:
description: Find out who's behind that nick!
@@ -229,4 +230,4 @@ commands:
aliases: [ 'adde' ]
enchant:
description: Adds an enchantment to your current item
- usage: /<command> <enchantmentid> <level>
+ usage: /<command> <enchantmentid> <level>
@@ -46,7 +46,7 @@ public AdminChat(ChatHandler instance) {
subscribers = new ArrayList<String>();
this.chathandler = instance;
this.plugin = chathandler.getTCUtilsInstance();
- if(plugin.getConfigHandler().enableIRC) {
+ if (plugin.getConfigHandler().enableIRC) {
this.circ = plugin.getCraftIRC();
circ.registerEndPoint("tcutilsadmin", plugin.getAdminEndPoint());
}
@@ -71,16 +71,16 @@ public boolean sendMessage(CommandSender sender, String message) {
String targetmsg = plugin.getConfigHandler().AIRCMessageFormat;
- targetmsg = targetmsg.replace("%name%", cleanname).
- replace("%message%", message).
- replace("%dispname%", ChatColor.stripColor(sendername));
+ targetmsg = targetmsg.replace("%name%", cleanname).
+ replace("%message%", message).
+ replace("%dispname%", ChatColor.stripColor(sendername));
targetmsg = targetmsg.replace("%clearcolors%", Character.toString((char) 3));
RelayedMessage rmsg = plugin.getCraftIRC().newMsgToTag(plugin.getAdminEndPoint(), plugin.getConfigHandler().AIRCtag, "generic");
- rmsg.setField("sender", pcolor+sendername);
+ rmsg.setField("sender", pcolor + sendername);
rmsg.setField("realSender", cleanname);
rmsg.setField("message", targetmsg);
- if(sender instanceof Player) {
+ if (sender instanceof Player) {
Player p = (Player) sender;
// World w = p.getWorld();
rmsg.setField("world", p.getWorld().getName());
@@ -140,8 +140,8 @@ public boolean broadcastMessageRealAdmins(String message) {
for (Player p : plugin.getServer().getOnlinePlayers()) {
if (plugin.check(p, "admon")) {
- if(!recp.contains(p))
- recp.add(p);
+ if (!recp.contains(p))
+ recp.add(p);
}
}
return recp;
@@ -188,7 +188,6 @@ public void removeRecipient(String player) {
return subscribers;
}
- @Override
public String getDescription() {
return "Admin chat (needs permissions!)";
}
@@ -213,6 +212,6 @@ public String getColor() {
}
public String getPrefix() {
- return this.getColor()+"A";
+ return this.getColor() + "A";
}
}
@@ -28,52 +28,42 @@
* @author GuntherDW
*/
public class GroupChat implements ChatMode {
- @Override
public boolean sendMessage(CommandSender sender, String message) {
return false;
}
- @Override
public List<Player> getRecipients(CommandSender sender) {
return null;
}
- @Override
public void addRecipient(String player) {
}
- @Override
public boolean broadcastMessage(CommandSender sender, String message) {
return false;
}
- @Override
public void removeRecipient(String player) {
}
- @Override
public List<String> getSubscribers() {
return null;
}
- @Override
public String getDescription() {
return null;
}
- @Override
public boolean isEnabled() {
return false;
}
- @Override
public String getColor() {
return null;
}
- @Override
public String getPrefix() {
return null;
}
@@ -49,7 +49,7 @@ public boolean sendMessage(CommandSender sender, String message) {
Player player = (Player) sender;
List<Player> recp = getRecipients(player);
for (Player p : recp) {
- p.sendMessage(ChatColor.YELLOW+"L"+ChatColor.WHITE+": [" + player.getDisplayName() + "]: " + message);
+ p.sendMessage(ChatColor.YELLOW + "L" + ChatColor.WHITE + ": [" + player.getDisplayName() + "]: " + message);
}
if (recp.size() < 2) {
sender.sendMessage(ChatColor.GOLD + "No one can hear you!");
@@ -111,9 +111,8 @@ public void removeRecipient(String player) {
return subscribers;
}
- @Override
public String getDescription() {
- return "Chat locally ("+plugin.getConfigHandler().localchatdistance+" blocks)";
+ return "Chat locally (" + plugin.getConfigHandler().localchatdistance + " blocks)";
}
public boolean isEnabled() {
@@ -125,6 +124,6 @@ public String getColor() {
}
public String getPrefix() {
- return this.getColor()+"L";
+ return this.getColor() + "L";
}
}
@@ -50,34 +50,32 @@ public RegionChat(ChatHandler instance) {
this.subscribers = new ArrayList<String>();
}
- @Override
public boolean sendMessage(CommandSender sender, String message) {
if (sender instanceof Player) {
Player player = (Player) sender;
List<Player> recp = getRecipients(player);
for (Player p : recp) {
- p.sendMessage(ChatColor.AQUA+"R"+ChatColor.WHITE+": [" + player.getDisplayName() + "]: " + message);
+ p.sendMessage(ChatColor.AQUA + "R" + ChatColor.WHITE + ": [" + player.getDisplayName() + "]: " + message);
}
- if(getRegionName(player.getName(), false).equals("")) {
+ if (getRegionName(player.getName(), false).equals("")) {
sender.sendMessage(ChatColor.GOLD + "You're currently not inside of a region!");
} else if (recp.size() < 2) {
sender.sendMessage(ChatColor.GOLD + "No one can hear you!");
}
- plugin.getLogger().info("R: ("+getRegionName(player.getName(), false)+") <" + player.getName() + "> " + message);
+ plugin.getLogger().info("R: (" + getRegionName(player.getName(), false) + ") <" + player.getName() + "> " + message);
} else {
sender.sendMessage("How did you get here?!");
}
return true;
}
- @Override
public List<Player> getRecipients(CommandSender sender) {
List<Player> recp = new ArrayList<Player>();
List<String> regionIds = null;
- if(sender instanceof Player) {
+ if (sender instanceof Player) {
GlobalRegionManager gm = plugin.getWorldGuard().getGlobalRegionManager();
Player player = (Player) sender;
- if(plugin.getWorldGuard() == null) {
+ if (plugin.getWorldGuard() == null) {
sender.sendMessage(ChatColor.GOLD + "WorldGuard error!");
} else {
@@ -90,19 +88,19 @@ public boolean sendMessage(CommandSender sender, String message) {
regionIds = rm.getApplicableRegionsIDs(vec);
Vector pvec = null;
List<String> preg = null;
- for(Player p : player.getWorld().getPlayers()) {
+ for (Player p : player.getWorld().getPlayers()) {
pvec = new Vector(p.getLocation().getX(), p.getLocation().getY(), p.getLocation().getZ());
preg = rm.getApplicableRegionsIDs(pvec);
- for(String s : preg) {
- if(recp.contains(p)) // List already contains player, skip checks
+ for (String s : preg) {
+ if (recp.contains(p)) // List already contains player, skip checks
continue;
- if(!s.equalsIgnoreCase("__global__") && regionIds.contains(s)) {
+ if (!s.equalsIgnoreCase("__global__") && regionIds.contains(s)) {
recp.add(p);
}
}
}
}
- if(!recp.contains(player)) {
+ if (!recp.contains(player)) {
recp.add(player);
}
}
@@ -119,40 +117,36 @@ public boolean broadcastMessage(CommandSender sender, String message) {
if (recp.size() < 2) {
sender.sendMessage(ChatColor.GOLD + "No one can hear you!");
}
- plugin.getLogger().info("R: ("+getRegionName(player.getName(), false)+") : "+message);
+ plugin.getLogger().info("R: (" + getRegionName(player.getName(), false) + ") : " + message);
} else {
sender.sendMessage("How did you get here?!");
}
return true;
}
- @Override
public void addRecipient(String player) {
if (!subscribers.contains(player)) {
subscribers.add(player);
}
}
- @Override
public void removeRecipient(String player) {
if (subscribers.contains(player)) {
subscribers.remove(player);
}
}
- @Override
public List<String> getSubscribers() {
return subscribers;
}
- @Override
public String getDescription() {
return "WorldGuard regions chat!";
}
public String getRegionName(String sender, boolean color) {
Player p = plugin.getServer().getPlayer(sender);
- if(p!=null) {
+ if (p != null) {
GlobalRegionManager gm = plugin.getWorldGuard().getGlobalRegionManager();
Location loc = p.getLocation().clone();
Vector vec = new Vector(loc.getX(), loc.getY(), loc.getZ());
@@ -161,15 +155,14 @@ public String getRegionName(String sender, boolean color) {
String msg = "";
for (Iterator<String> iterator = regionIds.iterator(); iterator.hasNext(); ) {
String next = iterator.next();
- if(!next.equalsIgnoreCase("__global__"))
- {
- msg += (color?ChatColor.GOLD:"")+next;
- if(iterator.hasNext()) {
- msg += (color?ChatColor.WHITE:"")+",";
+ if (!next.equalsIgnoreCase("__global__")) {
+ msg += (color ? ChatColor.GOLD : "") + next;
+ if (iterator.hasNext()) {
+ msg += (color ? ChatColor.WHITE : "") + ",";
}
}
}
- return msg+(color?ChatColor.WHITE:"");
+ return msg + (color ? ChatColor.WHITE : "");
} else {
return null;
}
@@ -184,6 +177,6 @@ public String getColor() {
}
public String getPrefix() {
- return this.getColor()+"R";
+ return this.getColor() + "R";
}
}
@@ -49,12 +49,12 @@ public boolean sendMessage(CommandSender sender, String message) {
Player player = (Player) sender;
List<Player> recp = getRecipients(player);
for (Player p : recp) {
- p.sendMessage(ChatColor.DARK_GREEN+"W"+ChatColor.WHITE+": [" + player.getDisplayName() + "]: " + message);
+ p.sendMessage(ChatColor.DARK_GREEN + "W" + ChatColor.WHITE + ": [" + player.getDisplayName() + "]: " + message);
}
if (recp.size() < 2) {
sender.sendMessage(ChatColor.GOLD + "No one can hear you!");
}
- plugin.getLogger().info("W: ("+player.getWorld().getName()+") <" + player.getName() + "> " + message);
+ plugin.getLogger().info("W: (" + player.getWorld().getName() + ") <" + player.getName() + "> " + message);
} else {
sender.sendMessage("How did you get here?!");
}
@@ -71,7 +71,7 @@ public boolean broadcastMessage(CommandSender sender, String message) {
if (recp.size() < 2) {
sender.sendMessage(ChatColor.GOLD + "No one can hear you!");
}
- plugin.getLogger().info("W: ("+player.getWorld().getName()+") " + message);
+ plugin.getLogger().info("W: (" + player.getWorld().getName() + ") " + message);
} else {
sender.sendMessage("How did you get here?!");
}
@@ -85,7 +85,7 @@ public boolean broadcastMessage(CommandSender sender, String message) {
EntityLocation entityloc = new EntityLocation(player);
for (Player p : player.getWorld().getPlayers()) {
// if (entityloc.getDistance(p) < plugin.getConfigHandler().localchatdistance) {
- recp.add(p);
+ recp.add(p);
// }
}
}
@@ -108,7 +108,6 @@ public void removeRecipient(String player) {
return subscribers;
}
- @Override
public String getDescription() {
return "World Chat (chat in your current world)";
}
@@ -122,7 +121,7 @@ public String getColor() {
}
public String getPrefix() {
- return this.getColor()+"W";
+ return this.getColor() + "W";
}
}
Oops, something went wrong.

0 comments on commit 0cd2a79

Please sign in to comment.