added lockschem
Dieser Commit ist enthalten in:
Ursprung
68abb4d42f
Commit
7720f020bd
@ -74,6 +74,7 @@ public class BauSystem extends JavaPlugin implements Listener {
|
|||||||
getCommand("protect").setExecutor(new CommandProtect());
|
getCommand("protect").setExecutor(new CommandProtect());
|
||||||
getCommand("skull").setExecutor(new CommandSkull());
|
getCommand("skull").setExecutor(new CommandSkull());
|
||||||
getCommand("loader").setExecutor(new CommandLoader());
|
getCommand("loader").setExecutor(new CommandLoader());
|
||||||
|
getCommand("lockschem").setExecutor(new CommandLockschem());
|
||||||
|
|
||||||
Bukkit.getPluginManager().registerEvents(this, this);
|
Bukkit.getPluginManager().registerEvents(this, this);
|
||||||
Bukkit.getPluginManager().registerEvents(new RegionListener(), this);
|
Bukkit.getPluginManager().registerEvents(new RegionListener(), this);
|
||||||
|
@ -0,0 +1,52 @@
|
|||||||
|
package de.steamwar.bausystem.commands;
|
||||||
|
|
||||||
|
import de.steamwar.bausystem.BauSystem;
|
||||||
|
import de.steamwar.sql.Schematic;
|
||||||
|
import de.steamwar.sql.SteamwarUser;
|
||||||
|
import de.steamwar.sql.UserGroup;
|
||||||
|
import org.bukkit.command.Command;
|
||||||
|
import org.bukkit.command.CommandExecutor;
|
||||||
|
import org.bukkit.command.CommandSender;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
|
public class CommandLockschem implements CommandExecutor {
|
||||||
|
@Override
|
||||||
|
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||||
|
if(!(sender instanceof Player)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
Player player = (Player) sender;
|
||||||
|
|
||||||
|
SteamwarUser steamwarUser = SteamwarUser.get(player.getUniqueId());
|
||||||
|
UserGroup userGroup = steamwarUser.getUserGroup();
|
||||||
|
|
||||||
|
if(userGroup != UserGroup.Admin &&
|
||||||
|
userGroup != UserGroup.Developer &&
|
||||||
|
userGroup != UserGroup.Moderator &&
|
||||||
|
userGroup != UserGroup.Supporter)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if(args.length == 2) {
|
||||||
|
SteamwarUser schemOwner = SteamwarUser.get(args[0]);
|
||||||
|
if(schemOwner == null) {
|
||||||
|
player.sendMessage(BauSystem.PREFIX + "Dieser Spieler existiert nicht!");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
Schematic schematic = Schematic.getSchemFromDB(args[1], schemOwner.getUUID());
|
||||||
|
if(schematic == null) {
|
||||||
|
player.sendMessage(BauSystem.PREFIX + "Dieser Spieler besitzt keine Schematic mit diesem Namen!");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
player.sendMessage(BauSystem.PREFIX + "Schematic " + schematic.getSchemName() + " von " +
|
||||||
|
steamwarUser.getUserName() + " von " + schematic.getSchemType().toString() +
|
||||||
|
" auf NORMAL zurückgesetzt!");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
sendHelp(player);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void sendHelp(Player player) {
|
||||||
|
player.sendMessage(BauSystem.PREFIX + "/schemlock [OWNER] [SCHEM NAME]");
|
||||||
|
}
|
||||||
|
}
|
@ -18,4 +18,5 @@ commands:
|
|||||||
freeze:
|
freeze:
|
||||||
loader:
|
loader:
|
||||||
nightvision:
|
nightvision:
|
||||||
aliases: nv
|
aliases: nv
|
||||||
|
lockschem:
|
In neuem Issue referenzieren
Einen Benutzer sperren