mirror of
https://github.com/GTNewHorizons/Opis.git
synced 2026-11-21 04:32:28 +00:00
New commands are included in the help.
This commit is contained in:
1 parent
8cbcd3376d
commit
af0d3ac2cb
3 files changed
+28
-6
No files matched your search
@@ -1,5 +1,6 @@
|
||||
package mcp.mobius.opis.commands.server;
|
||||
|
||||
import mcp.mobius.opis.commands.IOpisCommand;
|
||||
import mcp.mobius.opis.server.PlayerTracker;
|
||||
import net.minecraft.command.CommandBase;
|
||||
import net.minecraft.command.ICommandSender;
|
||||
@@ -8,7 +9,7 @@ import net.minecraft.network.MemoryConnection;
|
||||
import net.minecraft.server.dedicated.DedicatedServer;
|
||||
import net.minecraft.util.ChatMessageComponent;
|
||||
|
||||
public class CommandAddPrivileged extends CommandBase {
|
||||
public class CommandAddPrivileged extends CommandBase implements IOpisCommand{
|
||||
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
@@ -40,4 +41,14 @@ public class CommandAddPrivileged extends CommandBase {
|
||||
if (!(sender instanceof DedicatedServer) && !(sender instanceof EntityPlayerMP)) return true;
|
||||
return PlayerTracker.instance().isTrueOP(((EntityPlayerMP)sender).username);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDescription() {
|
||||
return "Add a user to the privileged list of users.";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCommandNameOpis() {
|
||||
return "opis_addpriv";
|
||||
}
|
||||
}
|
||||
@@ -51,7 +51,10 @@ public class CommandHelp extends CommandBase implements IOpisCommand {
|
||||
new CommandKill(),
|
||||
new CommandKillAll(),
|
||||
|
||||
new CommandHandler()
|
||||
new CommandHandler(),
|
||||
|
||||
new CommandAddPrivileged(),
|
||||
new CommandRmPrivileged()
|
||||
};
|
||||
|
||||
for (IOpisCommand cmd : commands)
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package mcp.mobius.opis.commands.server;
|
||||
|
||||
import mcp.mobius.opis.commands.IOpisCommand;
|
||||
import mcp.mobius.opis.server.PlayerTracker;
|
||||
import net.minecraft.command.CommandBase;
|
||||
import net.minecraft.command.ICommandSender;
|
||||
@@ -8,7 +9,7 @@ import net.minecraft.network.MemoryConnection;
|
||||
import net.minecraft.server.dedicated.DedicatedServer;
|
||||
import net.minecraft.util.ChatMessageComponent;
|
||||
|
||||
public class CommandRmPrivileged extends CommandBase{
|
||||
public class CommandRmPrivileged extends CommandBase implements IOpisCommand{
|
||||
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
@@ -28,9 +29,6 @@ public class CommandRmPrivileged extends CommandBase{
|
||||
} else {
|
||||
icommandsender.sendChatToPlayer(ChatMessageComponent.createFromText(String.format("Player %s not found in list.", astring[0])));
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -47,4 +45,14 @@ public class CommandRmPrivileged extends CommandBase{
|
||||
if (!(sender instanceof DedicatedServer) && !(sender instanceof EntityPlayerMP)) return true;
|
||||
return PlayerTracker.instance().isTrueOP(((EntityPlayerMP)sender).username);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDescription() {
|
||||
return "Remove a user from the privileged list of users.";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCommandNameOpis() {
|
||||
return "opis_rmpriv";
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user