mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2025-07-01 04:26:42 +00:00
Compare commits
54 Commits
Author | SHA1 | Date | |
---|---|---|---|
4f6a0ca5d3 | |||
f3684cc2ce | |||
772b7e43f7 | |||
c308c9a268 | |||
fcb424a793 | |||
be1acb4e03 | |||
386989fa69 | |||
4c7cd9cb23 | |||
1f87c05547 | |||
a2a6e39db9 | |||
c6ca262472 | |||
c96bdea066 | |||
893c7c2991 | |||
201d27e070 | |||
36ceb7007a | |||
6519ead121 | |||
95805dd9c1 | |||
6768854eda | |||
83176ba0b9 | |||
4a2b58bf97 | |||
79fc01eae7 | |||
d1d220f618 | |||
f6943b9754 | |||
2977167bd3 | |||
ad9e901aa0 | |||
4f6e4e2e87 | |||
d8ae364300 | |||
7f9661ec11 | |||
8d59ba59f4 | |||
6a7e866a53 | |||
63508addf4 | |||
b8ab56bed5 | |||
4853cc439b | |||
3b7a8d4d88 | |||
d016e1ff08 | |||
ab9650dc54 | |||
d3139dd39f | |||
ba834b6b92 | |||
ccd4237491 | |||
ff51bb1980 | |||
d2457adf68 | |||
aea65815a8 | |||
6abd2491f1 | |||
31b5c99007 | |||
4aebf33006 | |||
e29a820398 | |||
fabbc78d22 | |||
a8b4f1d950 | |||
b7c9f4e02d | |||
ba9289e1a3 | |||
47dec49381 | |||
b1202c7871 | |||
e82e88f48f | |||
36747cb986 |
65
CONTRIBUTING.md
Normal file
65
CONTRIBUTING.md
Normal file
@ -0,0 +1,65 @@
|
||||
# How to contribute
|
||||
|
||||
TotalFreedomMod aims to be a fully functional all-op server mod which works in
|
||||
a large range of configurations. In order to be as flexible as possible on the
|
||||
server-end, we encourage contributing to TotalFreedomMod by making 'pull-requests'
|
||||
to this repository.
|
||||
|
||||
## Getting Started
|
||||
|
||||
* Make sure you have a [GitHub account](https://github.com/signup/free)
|
||||
* If the issue is a bug, submit a ticket for it, assuming one does not already exist.
|
||||
* Clearly describe the issue including steps to reproduce it.
|
||||
* Make sure you fill in the earliest version that you know has the issue.
|
||||
* Fork the repository on GitHub
|
||||
|
||||
## Making Changes
|
||||
|
||||
* Create a topic branch from where you want to base your work.
|
||||
* This is usually the master branch.
|
||||
* Only target release branches if you are certain your addition must be on that
|
||||
branch.
|
||||
* To quickly create a topic branch based on master; `git checkout -b contribution`
|
||||
Please avoid working directly on the `master` branch.
|
||||
* Make changes and commit where necessary.
|
||||
* Check for unnecessary whitespace with `git diff --check` before committing.
|
||||
* Make sure your commit messages are in line with those which are already made.
|
||||
* Make sure your changes build (*and work!*).
|
||||
|
||||
## Tips on getting your pull request accepted
|
||||
* Make sure your changes work and compile without difficulty.
|
||||
* Make sure your change adds something useful, do not add commands to micromanage
|
||||
the server. (ie: Shorthands for a collection of commands)
|
||||
* Features must be in line the general idea of "Total Freedom".
|
||||
* Changes must be directed towards the main "TotalFreedom" server. Adding names such
|
||||
as the name of your own TotalFreedom-like server will get your pull request denied.
|
||||
* Do not add yourself to the developer list.
|
||||
* Ensure that you use the correct whitespace-style. That is: 4 spaces as indentation.
|
||||
* Please make sure your changes are written such as other features would be. Eg: commands
|
||||
have their own class and extend TFM_Command.
|
||||
* Make sure your code is written in the [Allman style](http://en.wikipedia.org/wiki/Indent_style#Allman_style).
|
||||
* Do not increment the version number.
|
||||
* If you want to add multiple changes, please make one pull request per change. This
|
||||
way, it's easier to accept your changes faster and won't block the other changes if there
|
||||
is an issue with a specific line of code.
|
||||
* Please make sure there are no bugs in your code.
|
||||
* Please avoid having to add files in the main namespace where possible.
|
||||
* Make sure all changes work before you commit these, this avoids having multiple
|
||||
unnecessary commits.
|
||||
* Please refrain from using an excessive amount of commits. As few as possible is generally the best.
|
||||
* Please do not spread your addition over several pull-requests.
|
||||
|
||||
## Submitting Changes
|
||||
|
||||
* Push your changes to a topic branch in your fork of the repository.
|
||||
* Submit a pull request to this repository.
|
||||
* Explain in detail what each one of your commits changes and point out any big changes.
|
||||
* Wait as a developer evaluates your changes.
|
||||
|
||||
# Additional Resources
|
||||
|
||||
* [TotalFreedom information](http://totalfreedom.me)
|
||||
* [TotalFreedom forums](http://totalfreedom.boards.net)
|
||||
* [Bug tracker](https://github.com/TotalFreedom/TotalFreedomMod/issues)
|
||||
* [General GitHub documentation](http://help.github.com/)
|
||||
* [GitHub pull request documentation](http://help.github.com/send-pull-requests/)
|
16
LICENCE.md
Normal file
16
LICENCE.md
Normal file
@ -0,0 +1,16 @@
|
||||
# Legal
|
||||
|
||||
TotalFreedomMod by Madgeek1450 and DarthSalamon is an effort to create an opensource plugin to effectively run a "Total Freedom" like all-Op server. It consists of over 85 custom coded commands and a large variety of distinguishable features not included in any other plugin. The plugin has since its beginning grown immensely. Together with the main server "TotalFreedom" (http://totalfreedom.me) TotalFreedomMod has a long-standing reputation of effectiveness whilst maintaining a clear feel of openness towards the administrators and the players themselves.
|
||||
|
||||
## License
|
||||
|
||||
TotalFreedomMod sourcecode is freely available under the GNU GPLv3 License with a few restrictions in place. The license is available here: http://www.gnu.org/licenses/gpl.txt
|
||||
|
||||
The few restrictions are in place to make sure that credit is given to the original authors who remain the maintainers of the plugin and it's sourcecode.
|
||||
|
||||
These are the restrictions under which the sourcecode is licensed:
|
||||
* A un-edited copy of this license must always be included with this sourcecode.
|
||||
* TotalFreedomMod sourcecode and its derrivations are freely distributable between anyone who choses to download it.
|
||||
* You may not remove the keywords "Madgeek1450", "StevenLawson", "DarthSalamon" and "jeromsar" from any part of the sourcecode.
|
||||
* However, compiled binaries (*.jar's) are not to be distributed. If you wish to obtain a copy of TotalFreedomMod you must compile the original sourcecode or it's derivations yourself using an IDE like netbeans. Official superadmins and above of the TotalFreedom (totalfreedom.me) server may obtain a compiled libary with the same limitations as described in this document.
|
||||
* Any conditions on this license may be waived by any of the official developers.
|
@ -1,5 +1,5 @@
|
||||
#Thu, 09 May 2013 15:32:18 +0200
|
||||
#Sun, 23 Jun 2013 15:16:34 +0200
|
||||
|
||||
program.VERSION=2.14
|
||||
program.BUILDNUM=182
|
||||
program.BUILDDATE=05/09/2013 03\:32 PM
|
||||
program.VERSION=2.19
|
||||
program.BUILDNUM=221
|
||||
program.BUILDDATE=06/23/2013 03\:16 PM
|
||||
|
@ -1,3 +1,3 @@
|
||||
#Build Number for ANT. Do not edit!
|
||||
#Thu May 09 15:32:18 CEST 2013
|
||||
build.number=183
|
||||
#Sun Jun 23 15:16:34 CEST 2013
|
||||
build.number=222
|
||||
|
@ -1,4 +1,4 @@
|
||||
# TotalFreedomMod v2.13 Configuration
|
||||
# TotalFreedomMod v2.19 Configuration
|
||||
# by Madgeek1450 and DarthSalamon
|
||||
|
||||
# Block placement prevention:
|
||||
@ -8,6 +8,7 @@ allow_lava_damage: false
|
||||
allow_lava_place: false
|
||||
allow_water_place: false
|
||||
allow_fluid_spread: false
|
||||
allow_tnt_minecarts: false
|
||||
|
||||
# Explosion management:
|
||||
allow_explosions: false
|
||||
|
@ -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'.");
|
||||
|
@ -43,7 +43,7 @@ public class Command_gtfo extends TFM_Command
|
||||
|
||||
//rollback
|
||||
|
||||
server.dispatchCommand(sender, "rollback " + p.getName() + " all");
|
||||
server.dispatchCommand(sender, "rollback " + p.getName());
|
||||
|
||||
|
||||
// deop
|
||||
|
@ -0,0 +1,65 @@
|
||||
package me.StevenLawson.TotalFreedomMod.Commands;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import me.StevenLawson.TotalFreedomMod.TFM_SuperadminList;
|
||||
import me.StevenLawson.TotalFreedomMod.TFM_Util;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.potion.PotionEffectType;
|
||||
|
||||
|
||||
@CommandPermissions(level = AdminLevel.SUPER, source = SourceType.BOTH)
|
||||
@CommandParameters(description = "Shows (optionally smites) invisisible players", usage = "/<command> (smite)")
|
||||
public class Command_invis extends TFM_Command {
|
||||
@Override
|
||||
public boolean run(CommandSender sender, Player sender_p, Command cmd, String commandLabel, String[] args, boolean senderIsConsole)
|
||||
{
|
||||
boolean smite = false;
|
||||
if (args.length >= 1)
|
||||
{
|
||||
if (args[0].equalsIgnoreCase("smite"))
|
||||
{
|
||||
smite = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
List<String> players = new ArrayList<String>();
|
||||
int smites = 0;
|
||||
|
||||
for (Player p : server.getOnlinePlayers())
|
||||
{
|
||||
if (p.hasPotionEffect(PotionEffectType.INVISIBILITY)) {
|
||||
players.add(p.getName());
|
||||
if (smite && !TFM_SuperadminList.isUserSuperadmin(p))
|
||||
{
|
||||
server.dispatchCommand(sender, "smite " + p.getName());
|
||||
smites++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (players.isEmpty()) {
|
||||
TFM_Util.playerMsg(sender, "There are no invisible players");
|
||||
return true;
|
||||
}
|
||||
|
||||
if (smite)
|
||||
{
|
||||
TFM_Util.playerMsg(sender, "Smitten " + smites + " players");
|
||||
}
|
||||
else
|
||||
{
|
||||
TFM_Util.playerMsg(sender, "Invisble players (" + players.size() + "): " + StringUtils.join(players, ", "));
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
@ -72,7 +72,7 @@ public class Command_list extends TFM_Command
|
||||
prefix = (ChatColor.GOLD + "[SA]");
|
||||
}
|
||||
|
||||
if (p.getName().equalsIgnoreCase("madgeek1450") || p.getName().equalsIgnoreCase("darthsalamon"))
|
||||
if (TFM_Util.DEVELOPERS.contains(p.getName()))
|
||||
{
|
||||
prefix = (ChatColor.DARK_PURPLE + "[Dev]");
|
||||
}
|
||||
|
@ -7,7 +7,7 @@ import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@CommandPermissions(level = AdminLevel.SENIOR, source = SourceType.ONLY_CONSOLE, block_host_console = true)
|
||||
@CommandPermissions(level = AdminLevel.SUPER, source = SourceType.BOTH, block_host_console = true)
|
||||
@CommandParameters(description = "Manage permanently banned players and IPs.", usage = "/<command> <list | reload>")
|
||||
public class Command_permban extends TFM_Command
|
||||
{
|
||||
|
@ -8,7 +8,7 @@ import org.bukkit.plugin.Plugin;
|
||||
import org.bukkit.plugin.PluginManager;
|
||||
|
||||
@CommandPermissions(level = AdminLevel.SENIOR, source = SourceType.BOTH)
|
||||
@CommandParameters(description = "Enable / disable plugins.", usage = "/<command> < <enable | disable> <pluginname> | list >")
|
||||
@CommandParameters(description = "Enable / disable plugins.", usage = "/<command> < <enable | disable> <pluginname> | list >", aliases = "plc")
|
||||
public class Command_plugincontrol extends TFM_Command
|
||||
{
|
||||
private enum CommandMode
|
||||
|
@ -0,0 +1,27 @@
|
||||
package me.StevenLawson.TotalFreedomMod.Commands;
|
||||
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@CommandPermissions(level = AdminLevel.SUPER, source = SourceType.BOTH)
|
||||
@CommandParameters(description = "Superadmin command - Purge everything! (except for bans).", usage = "/<command>")
|
||||
public class Command_purgeall extends TFM_Command
|
||||
{
|
||||
@Override
|
||||
public boolean run(CommandSender sender, Player sender_p, Command cmd, String commandLabel, String[] args, boolean senderIsConsole)
|
||||
{
|
||||
server.dispatchCommand(sender, "rd");
|
||||
server.dispatchCommand(sender, "potion clearall");
|
||||
server.dispatchCommand(sender, "uall");
|
||||
server.dispatchCommand(sender, "mute purge");
|
||||
server.dispatchCommand(sender, "fr purge");
|
||||
server.dispatchCommand(sender, "mp");
|
||||
server.dispatchCommand(sender, "blockcmd purge");
|
||||
server.dispatchCommand(sender, "halt purge");
|
||||
|
||||
//If I'm missing any, lemme know. Or just add it yourself.
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
@ -2,12 +2,13 @@ package me.StevenLawson.TotalFreedomMod.Commands;
|
||||
|
||||
import me.StevenLawson.TotalFreedomMod.TFM_Util;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@CommandPermissions(level = AdminLevel.SENIOR, source = SourceType.ONLY_CONSOLE, block_host_console = true)
|
||||
@CommandParameters(description = "Broadcasts the given message with no extra formatting.", usage = "/<command> <message>")
|
||||
@CommandParameters(description = "Broadcasts the given message. Supports colors.", usage = "/<command> <message>")
|
||||
public class Command_rawsay extends TFM_Command
|
||||
{
|
||||
@Override
|
||||
@ -15,7 +16,7 @@ public class Command_rawsay extends TFM_Command
|
||||
{
|
||||
if (args.length > 0)
|
||||
{
|
||||
TFM_Util.bcastMsg(StringUtils.join(args, " "));
|
||||
TFM_Util.bcastMsg(ChatColor.translateAlternateColorCodes('&', StringUtils.join(args, " ")));
|
||||
}
|
||||
|
||||
return true;
|
||||
|
@ -0,0 +1,88 @@
|
||||
package me.StevenLawson.TotalFreedomMod.Commands;
|
||||
|
||||
import me.StevenLawson.TotalFreedomMod.TFM_RollbackManager;
|
||||
import me.StevenLawson.TotalFreedomMod.TFM_Util;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.OfflinePlayer;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
|
||||
@CommandPermissions(level = AdminLevel.SUPER, source = SourceType.BOTH, block_host_console = true)
|
||||
@CommandParameters(description = "Issues a rollback on a player", usage = "/<command> <[partialname] | purge [partialname] | purgeall>", aliases = "rb")
|
||||
public class Command_rollback extends TFM_Command {
|
||||
|
||||
@Override
|
||||
public boolean run(CommandSender sender, Player sender_p, Command cmd, String commandLabel, String[] args, boolean senderIsConsole)
|
||||
{
|
||||
if (args.length > 2)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (args.length == 1 && args[0].equalsIgnoreCase("purgeall"))
|
||||
{
|
||||
TFM_Util.adminAction(sender.getName(), "Puring all rollback data", false);
|
||||
playerMsg("Purged entries for " + TFM_RollbackManager.purgeEntries() + " players.");
|
||||
return true;
|
||||
}
|
||||
|
||||
if (args.length == 2 && args[0].equalsIgnoreCase("purge"))
|
||||
{
|
||||
OfflinePlayer p;
|
||||
try
|
||||
{
|
||||
p = getPlayer(args[1]);
|
||||
}
|
||||
catch (CantFindPlayerException ex)
|
||||
{
|
||||
p = server.getOfflinePlayer(args[1]);
|
||||
if (!p.hasPlayedBefore())
|
||||
{
|
||||
playerMsg("Player is not online, or never joined the server.", ChatColor.RED);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
if (!TFM_RollbackManager.canRollback(p.getName()))
|
||||
{
|
||||
playerMsg("No rollback data found for that player", ChatColor.RED);
|
||||
} else {
|
||||
playerMsg("Purged " + TFM_RollbackManager.purgeEntries(p.getName()) + " entries.");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
if (args.length != 1)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
OfflinePlayer p;
|
||||
try
|
||||
{
|
||||
p = getPlayer(args[0]);
|
||||
}
|
||||
catch (CantFindPlayerException ex)
|
||||
{
|
||||
p = server.getOfflinePlayer(args[0]);
|
||||
if (!p.hasPlayedBefore())
|
||||
{
|
||||
playerMsg("Player is not online, or never joined the server.", ChatColor.RED);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
if (!TFM_RollbackManager.canRollback(p.getName()))
|
||||
{
|
||||
playerMsg("Player has no rollback data set.", ChatColor.RED);
|
||||
return true;
|
||||
}
|
||||
|
||||
TFM_Util.adminAction(sender.getName(), "Rolling back player: " + p.getName(), false);
|
||||
playerMsg("Rolled back " + TFM_RollbackManager.rollback(p) + " blocks");
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
@ -1,19 +1,19 @@
|
||||
package me.StevenLawson.TotalFreedomMod.Commands;
|
||||
|
||||
import me.StevenLawson.TotalFreedomMod.TFM_Util;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@CommandPermissions(level = AdminLevel.SUPER, source = SourceType.BOTH)
|
||||
@CommandParameters(description = "Removes all entities, nicks and disguises.", usage = "/<command>")
|
||||
public class Command_clearall extends TFM_Command
|
||||
@CommandParameters(description = "Sets everyone World Edit Limit to 500.", usage = "/<command>")
|
||||
public class Command_setl extends TFM_Command
|
||||
{
|
||||
@Override
|
||||
public boolean run(CommandSender sender, Player sender_p, Command cmd, String commandLabel, String[] args, boolean senderIsConsole)
|
||||
{
|
||||
server.dispatchCommand(sender, "rd");
|
||||
server.dispatchCommand(sender, "potion clearall");
|
||||
server.dispatchCommand(sender, "uall");
|
||||
server.dispatchCommand(sender, "wildcard gcmd ? /limit 500");
|
||||
TFM_Util.adminAction(sender.getName(), "Setting all online players block limit to 500.", true);
|
||||
|
||||
return true;
|
||||
}
|
@ -17,7 +17,7 @@ public class Command_stop extends TFM_Command
|
||||
|
||||
for (Player p : server.getOnlinePlayers())
|
||||
{
|
||||
p.kickPlayer("Server is going offline, come back in a few minutes.");
|
||||
p.kickPlayer("Server is going offline, come back in about 20 seconds.");
|
||||
}
|
||||
|
||||
server.shutdown();
|
||||
|
@ -1,6 +1,9 @@
|
||||
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;
|
||||
import org.bukkit.GameMode;
|
||||
import org.bukkit.command.Command;
|
||||
@ -8,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
|
||||
@ -24,12 +27,30 @@ public class Command_survival extends TFM_Command
|
||||
}
|
||||
|
||||
Player p;
|
||||
|
||||
if (args.length == 0)
|
||||
{
|
||||
p = sender_p;
|
||||
}
|
||||
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
|
||||
|
@ -0,0 +1,41 @@
|
||||
package me.StevenLawson.TotalFreedomMod.Commands;
|
||||
|
||||
import me.StevenLawson.TotalFreedomMod.TFM_ServerInterface;
|
||||
import me.StevenLawson.TotalFreedomMod.TFM_Util;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@CommandPermissions(level = AdminLevel.SUPER, source = SourceType.BOTH)
|
||||
@CommandParameters(description = "Temporarily bans a player for five minutes.", usage = "/<command> <partialname>", aliases = "nope")
|
||||
public class Command_tban extends TFM_Command {
|
||||
|
||||
@Override
|
||||
public boolean run(CommandSender sender, Player sender_p, Command cmd, String commandLabel, String[] args, boolean senderIsConsole)
|
||||
{
|
||||
if (args.length != 1)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
Player p;
|
||||
try
|
||||
{
|
||||
p = getPlayer(args[0]);
|
||||
}
|
||||
catch (CantFindPlayerException ex)
|
||||
{
|
||||
playerMsg(ex.getMessage(), ChatColor.RED);
|
||||
return true;
|
||||
}
|
||||
|
||||
TFM_Util.adminAction(sender.getName(), "NOPE: " + p.getName(), true);
|
||||
TFM_ServerInterface.banUsername(p.getName(), ChatColor.RED + "You have been temporarily banned for 5 minutes",
|
||||
sender.getName(), TFM_Util.parseDateOffset("5m"));
|
||||
p.kickPlayer(ChatColor.RED + "NOPE!\nYou have been temporarily banned for five minutes.");
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
@ -18,6 +18,21 @@ public class Command_wildcard extends TFM_Command
|
||||
playerMsg("What the hell are you trying to do, you stupid idiot...", ChatColor.RED);
|
||||
return true;
|
||||
}
|
||||
if (args[0].equals("gtfo"))
|
||||
{
|
||||
playerMsg("Nice try", ChatColor.RED);
|
||||
return true;
|
||||
}
|
||||
if (args[0].equals("doom"))
|
||||
{
|
||||
playerMsg("Look, we all hate people, but this is not the way to deal with it, doom is evil enough!", ChatColor.RED);
|
||||
return true;
|
||||
}
|
||||
if (args[0].equals("saconfig"))
|
||||
{
|
||||
playerMsg("WOA, WTF are you trying to do???", ChatColor.RED);
|
||||
return true;
|
||||
}
|
||||
|
||||
String base_command = StringUtils.join(args, " ");
|
||||
|
||||
|
@ -3,6 +3,8 @@ package me.StevenLawson.TotalFreedomMod.Listener;
|
||||
import me.StevenLawson.TotalFreedomMod.TFM_Log;
|
||||
import me.StevenLawson.TotalFreedomMod.TFM_PlayerData;
|
||||
import me.StevenLawson.TotalFreedomMod.TFM_ProtectedArea;
|
||||
import me.StevenLawson.TotalFreedomMod.TFM_RollbackEntry;
|
||||
import me.StevenLawson.TotalFreedomMod.TFM_RollbackManager;
|
||||
import me.StevenLawson.TotalFreedomMod.TFM_SuperadminList;
|
||||
import me.StevenLawson.TotalFreedomMod.TFM_Util;
|
||||
import me.StevenLawson.TotalFreedomMod.TotalFreedomMod;
|
||||
@ -24,7 +26,6 @@ public class TFM_BlockListener implements Listener
|
||||
if (!TotalFreedomMod.allowFireSpread)
|
||||
{
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@ -34,7 +35,6 @@ public class TFM_BlockListener implements Listener
|
||||
if (!TotalFreedomMod.allowFirePlace)
|
||||
{
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@ -95,7 +95,6 @@ public class TFM_BlockListener implements Listener
|
||||
if (TFM_ProtectedArea.isInProtectedArea(block_pos))
|
||||
{
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -180,7 +179,6 @@ public class TFM_BlockListener implements Listener
|
||||
p.sendMessage(ChatColor.GRAY + "Lava placement is currently disabled.");
|
||||
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
break;
|
||||
}
|
||||
@ -199,7 +197,6 @@ public class TFM_BlockListener implements Listener
|
||||
p.sendMessage(ChatColor.GRAY + "Water placement is currently disabled.");
|
||||
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
break;
|
||||
}
|
||||
@ -217,7 +214,6 @@ public class TFM_BlockListener implements Listener
|
||||
p.sendMessage(ChatColor.GRAY + "Fire placement is currently disabled.");
|
||||
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
break;
|
||||
}
|
||||
@ -235,7 +231,6 @@ public class TFM_BlockListener implements Listener
|
||||
|
||||
p.sendMessage(ChatColor.GRAY + "TNT is currently disabled.");
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
break;
|
||||
}
|
||||
@ -250,6 +245,22 @@ public class TFM_BlockListener implements Listener
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
||||
public void onBlockPlaceRollback(BlockPlaceEvent event)
|
||||
{
|
||||
TFM_RollbackEntry entry = new TFM_RollbackEntry();
|
||||
entry.setLocation(event.getBlock().getLocation());
|
||||
entry.setMaterial(Material.AIR);
|
||||
TFM_RollbackManager.blockUpdate(event.getPlayer(), entry);
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
|
||||
public void onBlockBreakRollback(BlockBreakEvent event)
|
||||
{
|
||||
TFM_RollbackManager.blockUpdate(event.getPlayer(), event.getBlock());
|
||||
}
|
||||
|
||||
// @EventHandler(priority = EventPriority.NORMAL)
|
||||
// public void onCommandBlockChangeEvent(CommandBlockChangeEvent event)
|
||||
// {
|
||||
|
@ -36,7 +36,7 @@ public class TFM_EntityListener implements Listener
|
||||
@EventHandler(priority = EventPriority.HIGH)
|
||||
public void onEntityCombust(EntityCombustEvent event)
|
||||
{
|
||||
if (!TotalFreedomMod.allowFireSpread)
|
||||
if (!TotalFreedomMod.allowExplosions)
|
||||
{
|
||||
event.setCancelled(true);
|
||||
}
|
||||
|
@ -44,22 +44,35 @@ public class TFM_PlayerListener implements Listener
|
||||
switch (event.getMaterial())
|
||||
{
|
||||
case WATER_BUCKET:
|
||||
{
|
||||
if (!TotalFreedomMod.allowWaterPlace)
|
||||
{
|
||||
player.getInventory().setItem(player.getInventory().getHeldItemSlot(), new ItemStack(Material.COOKIE, 1));
|
||||
player.sendMessage(ChatColor.GRAY + "Water buckets are currently disabled.");
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
}
|
||||
case LAVA_BUCKET:
|
||||
{
|
||||
if (!TotalFreedomMod.allowLavaPlace)
|
||||
{
|
||||
player.getInventory().setItem(player.getInventory().getHeldItemSlot(), new ItemStack(Material.COOKIE, 1));
|
||||
player.sendMessage(ChatColor.GRAY + "Lava buckets are currently disabled.");
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
case POTION:
|
||||
{
|
||||
}
|
||||
case EXPLOSIVE_MINECART:
|
||||
{
|
||||
if (!TotalFreedomMod.allowTntMinecarts)
|
||||
{
|
||||
player.getInventory().clear(player.getInventory().getHeldItemSlot());
|
||||
player.sendMessage(ChatColor.GRAY + "TNT minecarts are currently disabled.");
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
break;
|
||||
}
|
||||
@ -81,7 +94,6 @@ public class TFM_PlayerListener implements Listener
|
||||
playerdata.enqueueMob(rezzed_mob);
|
||||
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
break;
|
||||
}
|
||||
@ -100,7 +112,6 @@ public class TFM_PlayerListener implements Listener
|
||||
}
|
||||
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
break;
|
||||
}
|
||||
@ -491,6 +502,20 @@ public class TFM_PlayerListener implements Listener
|
||||
block_command = true;
|
||||
}
|
||||
}
|
||||
else if (Pattern.compile("^/nuke").matcher(command).find())
|
||||
{
|
||||
if (!TFM_SuperadminList.isUserSuperadmin(p))
|
||||
{
|
||||
block_command = true;
|
||||
}
|
||||
}
|
||||
else if (Pattern.compile("^/rl").matcher(command).find())
|
||||
{
|
||||
if (!TFM_SuperadminList.isUserSuperadmin(p))
|
||||
{
|
||||
block_command = true;
|
||||
}
|
||||
}
|
||||
else if (Pattern.compile("^/save-").matcher(command).find())
|
||||
{
|
||||
if (!TFM_SuperadminList.isUserSuperadmin(p))
|
||||
@ -498,6 +523,13 @@ public class TFM_PlayerListener implements Listener
|
||||
block_command = true;
|
||||
}
|
||||
}
|
||||
else if (Pattern.compile("^/clearhistory").matcher(command).find())
|
||||
{
|
||||
if (!TFM_SuperadminList.isUserSuperadmin(p))
|
||||
{
|
||||
block_command = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (block_command)
|
||||
{
|
||||
@ -727,5 +759,9 @@ public class TFM_PlayerListener implements Listener
|
||||
{
|
||||
event.setMotd(ChatColor.RED + "You are banned!");
|
||||
}
|
||||
if (TotalFreedomMod.adminOnlyMode)
|
||||
{
|
||||
event.setMotd(ChatColor.RED + "Server in AdminMode!");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
54
src/me/StevenLawson/TotalFreedomMod/TFM_RollbackEntry.java
Normal file
54
src/me/StevenLawson/TotalFreedomMod/TFM_RollbackEntry.java
Normal file
@ -0,0 +1,54 @@
|
||||
package me.StevenLawson.TotalFreedomMod;
|
||||
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.Block;
|
||||
|
||||
|
||||
public class TFM_RollbackEntry
|
||||
{
|
||||
|
||||
private Location location;
|
||||
private Material material;
|
||||
private byte data;
|
||||
|
||||
public TFM_RollbackEntry()
|
||||
{
|
||||
}
|
||||
|
||||
public TFM_RollbackEntry(Block block)
|
||||
{
|
||||
location = block.getLocation();
|
||||
material = block.getType();
|
||||
data = block.getData();
|
||||
}
|
||||
|
||||
public void setBlock(Block block)
|
||||
{
|
||||
location = block.getLocation();
|
||||
material = block.getType();
|
||||
data = block.getData();
|
||||
}
|
||||
|
||||
public void setLocation(Location location)
|
||||
{
|
||||
this.location = location;
|
||||
}
|
||||
|
||||
public void setMaterial(Material material)
|
||||
{
|
||||
this.material = material;
|
||||
}
|
||||
|
||||
public void setData(byte data)
|
||||
{
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
public void restore()
|
||||
{
|
||||
Block b = location.getWorld().getBlockAt(location);
|
||||
b.setType(material);
|
||||
b.setData(data);
|
||||
}
|
||||
}
|
86
src/me/StevenLawson/TotalFreedomMod/TFM_RollbackManager.java
Normal file
86
src/me/StevenLawson/TotalFreedomMod/TFM_RollbackManager.java
Normal file
@ -0,0 +1,86 @@
|
||||
package me.StevenLawson.TotalFreedomMod;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import org.bukkit.OfflinePlayer;
|
||||
import org.bukkit.block.Block;
|
||||
|
||||
public class TFM_RollbackManager
|
||||
{
|
||||
public static Map<String, List<TFM_RollbackEntry>> entries = new HashMap<String, List<TFM_RollbackEntry>>();
|
||||
|
||||
public static void blockUpdate(OfflinePlayer player, Block block)
|
||||
{
|
||||
List <TFM_RollbackEntry> e;
|
||||
if (entries.containsKey(player.getName()))
|
||||
{
|
||||
e = entries.get(player.getName());
|
||||
}
|
||||
else
|
||||
{
|
||||
e = new ArrayList<TFM_RollbackEntry>();
|
||||
}
|
||||
e.add(0, new TFM_RollbackEntry(block));
|
||||
entries.put(player.getName(), e);
|
||||
}
|
||||
|
||||
public static void blockUpdate(OfflinePlayer player, TFM_RollbackEntry entry)
|
||||
{
|
||||
List <TFM_RollbackEntry> e;
|
||||
if (entries.containsKey(player.getName()))
|
||||
{
|
||||
e = entries.get(player.getName());
|
||||
}
|
||||
else
|
||||
{
|
||||
e = new ArrayList<TFM_RollbackEntry>();
|
||||
}
|
||||
e.add(0, entry);
|
||||
entries.put(player.getName(), e);
|
||||
}
|
||||
|
||||
public static int rollback(OfflinePlayer player)
|
||||
{
|
||||
if (!canRollback(player.getName()))
|
||||
{
|
||||
TFM_Log.severe("Could not rollback player: " + player.getName() + "! No entries are set");
|
||||
return 0;
|
||||
}
|
||||
|
||||
List<TFM_RollbackEntry> e = entries.get(player.getName());
|
||||
int counter = 0;
|
||||
for (TFM_RollbackEntry entry : e)
|
||||
{
|
||||
entry.restore();
|
||||
counter++;
|
||||
}
|
||||
entries.remove(player.getName());
|
||||
return counter;
|
||||
}
|
||||
|
||||
public static boolean canRollback(String player)
|
||||
{
|
||||
return entries.containsKey(player);
|
||||
}
|
||||
|
||||
public static int purgeEntries()
|
||||
{
|
||||
int counter = entries.size();
|
||||
entries.clear();
|
||||
return counter;
|
||||
}
|
||||
|
||||
public static int purgeEntries(String player)
|
||||
{
|
||||
if (!canRollback(player))
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int counter = entries.get(player).size();
|
||||
entries.remove(player);
|
||||
return counter;
|
||||
}
|
||||
}
|
@ -27,6 +27,7 @@ public class TFM_Util
|
||||
private static final Map<String, Integer> eject_tracker = new HashMap<String, Integer>();
|
||||
public static final Map<String, EntityType> mobtypes = new HashMap<String, EntityType>();
|
||||
public static final List<String> STOP_COMMANDS = Arrays.asList("stop", "off", "end", "halt", "die");
|
||||
public static final List<String> DEVELOPERS = Arrays.asList("Madgeek1450", "DarthSalamon", "AcidicCyanide", "wild1145", "HeXeRei452", "disaster839");
|
||||
|
||||
static
|
||||
{
|
||||
@ -979,7 +980,9 @@ public class TFM_Util
|
||||
String prefix;
|
||||
if (senderIsConsole) {
|
||||
prefix = ChatColor.BLUE + "(Console)";
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
if (TFM_SuperadminList.isSeniorAdmin(sender))
|
||||
{
|
||||
prefix = ChatColor.LIGHT_PURPLE + "(SrA)";
|
||||
@ -987,8 +990,7 @@ public class TFM_Util
|
||||
{
|
||||
prefix = ChatColor.GOLD + "(SA)";
|
||||
}
|
||||
if (sender.getName().equalsIgnoreCase("Madgeek1450")
|
||||
|| sender.getName().equalsIgnoreCase("DarthSalamon"))
|
||||
if (DEVELOPERS.contains(sender.getName()))
|
||||
{
|
||||
prefix = ChatColor.DARK_PURPLE + "(Dev)";
|
||||
}
|
||||
|
@ -201,6 +201,8 @@ public class TotalFreedomMod extends JavaPlugin
|
||||
public static boolean allowLavaPlace = false;
|
||||
public static boolean allowWaterPlace = false;
|
||||
public static Boolean allowExplosions = false;
|
||||
public static boolean allowFliudSpread = false;
|
||||
public static boolean allowTntMinecarts = false;
|
||||
public static double explosiveRadius = 4.0D;
|
||||
public static boolean autoEntityWipe = true;
|
||||
public static boolean nukeMonitor = true;
|
||||
@ -222,7 +224,6 @@ public class TotalFreedomMod extends JavaPlugin
|
||||
public static boolean tossmobEnabled = false;
|
||||
public static boolean generateFlatlands = true;
|
||||
public static String flatlandsGenerationParams = "16,stone,32,dirt,1,grass";
|
||||
public static boolean allowFliudSpread = false;
|
||||
public static boolean adminOnlyMode = false;
|
||||
public static boolean protectedAreasEnabled = true;
|
||||
public static boolean autoProtectSpawnpoints = true;
|
||||
@ -245,6 +246,7 @@ public class TotalFreedomMod extends JavaPlugin
|
||||
allowLavaPlace = config.getBoolean("allow_lava_place", allowLavaPlace);
|
||||
allowWaterPlace = config.getBoolean("allow_water_place", allowWaterPlace);
|
||||
allowExplosions = config.getBoolean("allow_explosions", allowExplosions);
|
||||
allowTntMinecarts = config.getBoolean("allow_tnt_minecarts", allowTntMinecarts);
|
||||
explosiveRadius = config.getDouble("explosiveRadius", explosiveRadius);
|
||||
autoEntityWipe = config.getBoolean("auto_wipe", autoEntityWipe);
|
||||
nukeMonitor = config.getBoolean("nuke_monitor", nukeMonitor);
|
||||
|
@ -7,3 +7,4 @@ badplayer1:
|
||||
- 321.321.321.321
|
||||
badplayer2:
|
||||
- 111.111.111.111
|
||||
badplayer3: []
|
||||
|
@ -1,6 +1,6 @@
|
||||
name: TotalFreedomMod
|
||||
main: me.StevenLawson.TotalFreedomMod.TotalFreedomMod
|
||||
version: 2.14
|
||||
version: 2.19
|
||||
description: Plugin for the Total Freedom server.
|
||||
authors: [StevenLawson / Madgeek1450, JeromSar / DarthSalamon]
|
||||
|
||||
|
@ -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
|
||||
|
Reference in New Issue
Block a user