mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-01-31 06:39:36 +01:00
Beginning work on mcremove
This commit is contained in:
parent
26e3403ff4
commit
e31aea3492
@ -19,6 +19,7 @@ Version 1.3.00-dev
|
||||
+ Added size limit to Tree Feller in config as Tree Feller Threshold
|
||||
+ Added /addlevels command
|
||||
+ Added config values for XP multipliers for different hostile mobs
|
||||
+ Added mcremove commands
|
||||
+ Re-added mcMMO reporting damage events
|
||||
= Fixed bug where Swords command showed Bleed Length twice instead of Bleed Chance
|
||||
= Fixed bug where Tree Feller wasn't checking for Tree Feller permission
|
||||
|
52
src/main/java/com/gmail/nossr50/commands/mc/Mcremove.java
Normal file
52
src/main/java/com/gmail/nossr50/commands/mc/Mcremove.java
Normal file
@ -0,0 +1,52 @@
|
||||
package com.gmail.nossr50.commands.mc;
|
||||
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import com.gmail.nossr50.mcPermissions;
|
||||
import com.gmail.nossr50.config.LoadProperties;
|
||||
import com.gmail.nossr50.locale.mcLocale;
|
||||
|
||||
public class Mcremove implements CommandExecutor {
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||
Player player = null;
|
||||
|
||||
if (sender instanceof Player) {
|
||||
player = (Player) sender;
|
||||
}
|
||||
|
||||
if (player != null && !mcPermissions.getInstance().mcremove(player)) {
|
||||
player.sendMessage(ChatColor.YELLOW + "[mcMMO] " + ChatColor.DARK_RED + mcLocale.getString("mcPlayerListener.NoPermission"));
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!LoadProperties.mcremoveEnable) {
|
||||
sender.sendMessage("This command is not enabled.");
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!(sender instanceof Player)) {
|
||||
sender.sendMessage("This command does not support console useage.");
|
||||
return true;
|
||||
}
|
||||
|
||||
if(args.length == 1)
|
||||
{
|
||||
sender.sendMessage("Correct usage is /mcremove [Player Name]");
|
||||
}
|
||||
|
||||
//If the server is using MySQL
|
||||
if(LoadProperties.useMySQL)
|
||||
{
|
||||
|
||||
} else {
|
||||
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
@ -42,7 +42,7 @@ public class LoadProperties {
|
||||
xplockEnable, xpbar, xpicon, partybar, xprateEnable, spoutEnabled,
|
||||
donateMessage, chimaeraWingEnable, xpGainsMobSpawners, myspawnEnable,
|
||||
mccEnable, mcmmoEnable, partyEnable, inviteEnable, acceptEnable,
|
||||
whoisEnable, mcstatsEnable, addxpEnable, ptpEnable, mmoeditEnable,
|
||||
whoisEnable, mcstatsEnable, addxpEnable, ptpEnable, mmoeditEnable, mcremoveEnable,
|
||||
clearmyspawnEnable, mcgodEnable, mcabilityEnable, mctopEnable,
|
||||
addlevelsEnable, mcrefreshEnable, aEnable, pEnable, enableMotd, enableMySpawn,
|
||||
enableCobbleToMossy, useMySQL, toolsLoseDurabilityFromAbilities,
|
||||
@ -409,6 +409,7 @@ public class LoadProperties {
|
||||
mcgodEnable = readBoolean("Commands.mcgod.Enabled", true);
|
||||
mcstatsEnable = readBoolean("Commands.mcstats.Enabled", true);
|
||||
mmoeditEnable = readBoolean("Commands.mmoedit.Enabled", true);
|
||||
mcremoveEnable = readBoolean("Commands.mcremove.Enable", true);
|
||||
ptpEnable = readBoolean("Commands.ptp.Enabled", true);
|
||||
partyEnable = readBoolean("Commands.party.Enabled", true);
|
||||
myspawnEnable = readBoolean("Commands.myspawn.Enabled", true);
|
||||
|
@ -31,6 +31,9 @@ public class mcPermissions
|
||||
public boolean mcrefresh(Player player) {
|
||||
return player.hasPermission("mcmmo.tools.mcrefresh");
|
||||
}
|
||||
public boolean mcremove(Player player) {
|
||||
return player.hasPermission("mcmmo.tools.mcremove");
|
||||
}
|
||||
public boolean mmoedit(Player player) {
|
||||
return player.hasPermission("mcmmo.tools.mmoedit");
|
||||
}
|
||||
|
@ -1126,6 +1126,8 @@ Commands:
|
||||
Enabled: true
|
||||
mcc:
|
||||
Enabled: true
|
||||
mcremove:
|
||||
Enabled: true
|
||||
mmoedit:
|
||||
Enabled: true
|
||||
accept:
|
||||
|
@ -38,6 +38,8 @@ commands:
|
||||
permission: mcmmo.tools.mcgod
|
||||
mcstats:
|
||||
description: Shows your mcMMO stats and xp
|
||||
mcremove:
|
||||
description: Remove a user from the database
|
||||
mmoedit:
|
||||
description: Edit the skill values for a user
|
||||
permission: mcmmo.tools.mmoedit
|
||||
|
Loading…
x
Reference in New Issue
Block a user