mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-22 05:06:45 +01:00
Everything currently implemented is now toggle-able
This commit is contained in:
parent
929c56b395
commit
0cd2bce459
@ -17,6 +17,11 @@ public class settings {
|
||||
private boolean cmdPromote = false;
|
||||
private boolean cmdDemote = false;
|
||||
private boolean cmdWhoIs = false;
|
||||
private boolean cmdRules = false;
|
||||
private boolean cmdTp = false;
|
||||
private boolean cmdTphere = false;
|
||||
private boolean globalmessages = false;
|
||||
private boolean cmdSay = false;
|
||||
private PropertiesFile properties;
|
||||
String file = "vminecraft.properties";
|
||||
public String rules[] = null;
|
||||
@ -55,6 +60,46 @@ public void rules() {
|
||||
}
|
||||
else adminChat = false;
|
||||
}
|
||||
if(split[0].equalsIgnoreCase("cmdTp"))
|
||||
{
|
||||
if(split[1].equalsIgnoreCase("true"))
|
||||
{
|
||||
cmdTp = true;
|
||||
}
|
||||
else cmdTp = false;
|
||||
}
|
||||
if(split[0].equalsIgnoreCase("cmdTphere"))
|
||||
{
|
||||
if(split[1].equalsIgnoreCase("true"))
|
||||
{
|
||||
cmdTphere = true;
|
||||
}
|
||||
else cmdTphere = false;
|
||||
}
|
||||
if(split[0].equalsIgnoreCase("globalmessages"))
|
||||
{
|
||||
if(split[1].equalsIgnoreCase("true"))
|
||||
{
|
||||
globalmessages = true;
|
||||
}
|
||||
else globalmessages = false;
|
||||
}
|
||||
if(split[0].equalsIgnoreCase("cmdSay"))
|
||||
{
|
||||
if(split[1].equalsIgnoreCase("true"))
|
||||
{
|
||||
cmdSay = true;
|
||||
}
|
||||
else cmdSay = false;
|
||||
}
|
||||
if(split[0].equalsIgnoreCase("cmdRules"))
|
||||
{
|
||||
if(split[1].equalsIgnoreCase("true"))
|
||||
{
|
||||
cmdRules = true;
|
||||
}
|
||||
else cmdRules = false;
|
||||
}
|
||||
if(split[0].equalsIgnoreCase("Greentext"))
|
||||
{
|
||||
if(split[1].equalsIgnoreCase("true"))
|
||||
@ -128,6 +173,11 @@ public void rules() {
|
||||
public boolean cmdPromote() {return cmdPromote;}
|
||||
public boolean cmdDemote() {return cmdDemote;}
|
||||
public boolean cmdWhoIs() {return cmdWhoIs;}
|
||||
public boolean cmdTp() {return cmdTp;}
|
||||
public boolean cmdTphere() {return cmdTphere;}
|
||||
public boolean cmdSay() {return cmdSay;}
|
||||
public boolean cmdRules() {return cmdRules;}
|
||||
public boolean globalmessages() {return globalmessages;}
|
||||
|
||||
public static settings getInstance() {
|
||||
if (instance == null) {
|
||||
|
@ -93,7 +93,7 @@ public class vminecraft extends Plugin {
|
||||
return false;
|
||||
}
|
||||
//Replacement for /tp
|
||||
if(split[0].equalsIgnoreCase("/tp")) {
|
||||
if(settings.getInstance().cmdTp() && split[0].equalsIgnoreCase("/tp")) {
|
||||
{
|
||||
if (split.length < 2) {
|
||||
player.sendMessage(Colors.Rose + "Correct usage is: /tp [player]");
|
||||
@ -123,7 +123,7 @@ public class vminecraft extends Plugin {
|
||||
}
|
||||
}
|
||||
//Replacement for /tphere
|
||||
if ((split[0].equalsIgnoreCase("/tphere") || split[0].equalsIgnoreCase("/s"))) {
|
||||
if (settings.getInstance().cmdTphere() && (split[0].equalsIgnoreCase("/tphere") || split[0].equalsIgnoreCase("/s"))) {
|
||||
if (split.length < 2) {
|
||||
player.sendMessage(Colors.Rose + "Correct usage is: /tphere [player]");
|
||||
return true;
|
||||
@ -148,32 +148,32 @@ public class vminecraft extends Plugin {
|
||||
}
|
||||
}
|
||||
//Global messages that should only parse when a command can be successful
|
||||
if(split[0].equalsIgnoreCase("/kick")) {
|
||||
if(settings.getInstance().globalmessages() && split[0].equalsIgnoreCase("/kick")) {
|
||||
Player playerTarget = etc.getServer().matchPlayer(split[1]);
|
||||
if (playerTarget != null && !playerTarget.hasControlOver(player)) {
|
||||
other.gmsg(player.getColor()+player.getName()+Colors.Blue+" has kicked "+Colors.Red+playerTarget.getColor()+playerTarget.getName());
|
||||
}
|
||||
}
|
||||
if(split[0].equalsIgnoreCase("/ban")) {
|
||||
if(settings.getInstance().globalmessages() && split[0].equalsIgnoreCase("/ban")) {
|
||||
Player playerTarget = etc.getServer().matchPlayer(split[1]);
|
||||
if (playerTarget != null && !playerTarget.hasControlOver(player)) {
|
||||
other.gmsg(player.getColor()+player.getName()+Colors.Blue+" has banned "+Colors.Red+playerTarget.getColor()+playerTarget.getName());
|
||||
}
|
||||
}
|
||||
if(split[0].equalsIgnoreCase("/ipban")) {
|
||||
if(settings.getInstance().globalmessages() && split[0].equalsIgnoreCase("/ipban")) {
|
||||
Player playerTarget = etc.getServer().matchPlayer(split[1]);
|
||||
if (playerTarget != null && !playerTarget.hasControlOver(player)) {
|
||||
other.gmsg(player.getColor()+player.getName()+Colors.Blue+" has IP banned "+Colors.Red+playerTarget.getColor()+playerTarget.getName());
|
||||
}
|
||||
}
|
||||
if(split[0].equalsIgnoreCase("/time")) {
|
||||
if(settings.getInstance().globalmessages() && split[0].equalsIgnoreCase("/time")) {
|
||||
if (split.length <= 2) {
|
||||
other.gmsg(Colors.Blue+"Time changes thanks to "+player.getColor()+player.getName());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
//Rules
|
||||
if(split[0].equalsIgnoreCase("/rules")) {
|
||||
if(settings.getInstance().cmdRules() && split[0].equalsIgnoreCase("/rules")) {
|
||||
for (String str : settings.getInstance().getRules()) {
|
||||
player.sendMessage(Colors.Blue+str);
|
||||
}
|
||||
@ -368,7 +368,7 @@ public class vminecraft extends Plugin {
|
||||
}
|
||||
}
|
||||
//Say
|
||||
if (split[0].equalsIgnoreCase("/say")) {
|
||||
if (settings.getInstance().cmdSay() && (split[0].equalsIgnoreCase("/say"))) {
|
||||
String sayan;
|
||||
sayan = etc.combineSplit(1, split, " ");
|
||||
other.gmsg(Colors.Yellow+sayan);
|
||||
|
Loading…
Reference in New Issue
Block a user