From 16013fa7b1fc97f84d3babc46c727fcfa9356930 Mon Sep 17 00:00:00 2001 From: YoyoNow Date: Wed, 22 Nov 2023 20:57:38 +0100 Subject: [PATCH] Update Schem Command on Builder Cloud --- .../schematiccommand/SchematicCommand.java | 299 +++++++++--------- 1 file changed, 149 insertions(+), 150 deletions(-) diff --git a/SchematicSystem_Core/src/de/steamwar/schematicsystem/commands/schematiccommand/SchematicCommand.java b/SchematicSystem_Core/src/de/steamwar/schematicsystem/commands/schematiccommand/SchematicCommand.java index 53f3ee5..b3ecf37 100644 --- a/SchematicSystem_Core/src/de/steamwar/schematicsystem/commands/schematiccommand/SchematicCommand.java +++ b/SchematicSystem_Core/src/de/steamwar/schematicsystem/commands/schematiccommand/SchematicCommand.java @@ -1,150 +1,149 @@ -/* - This file is a part of the SteamWar software. - - Copyright (C) 2023 SteamWar.de-Serverteam - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Affero General Public License for more details. - - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see . - */ - -package de.steamwar.schematicsystem.commands.schematiccommand; - -import com.sk89q.worldedit.*; -import com.sk89q.worldedit.extent.clipboard.Clipboard; -import de.steamwar.command.*; -import de.steamwar.core.VersionDependent; -import de.steamwar.schematicsystem.CheckSchemType; -import de.steamwar.schematicsystem.SchematicSystem; -import de.steamwar.schematicsystem.autocheck.AutoCheckerResult; -import de.steamwar.sql.*; -import org.bukkit.Bukkit; -import org.bukkit.command.CommandSender; -import org.bukkit.entity.Player; - -import static de.steamwar.schematicsystem.commands.schematiccommand.SchematicCommandHelp.*; -import static de.steamwar.schematicsystem.commands.schematiccommand.SchematicCommandUtils.*; - -@SuppressWarnings("unused") -public class SchematicCommand extends SWCommand { - - public SchematicCommand() { - super("schematic", Bukkit.getPluginManager().getPlugin("Teamserver") == null ? new String[] {"schem", "/schem", "/schematic"} : new String[]{"schem"}); - } - - @Register("help") - public void pagedHelp(Player player, HelpPage page) { - printHelpPage(player, page); - } - - @Register - public void genericHelp(Player player, String... args) { - printHelpMainPage(player); - } - - @Register(value = "togglepublic", noTabComplete = true) - public void togglePublicMode(Player player) { - SteamwarUser user = SteamwarUser.get(player.getUniqueId()); - if (!user.hasPerm(UserPerm.MODERATION)) { - genericHelp(player); - return; - } - - if (togglePublic(player)) { - SchematicSystem.MESSAGE.send("COMMAND_PUBLIC_ON", player); - } else { - SchematicSystem.MESSAGE.send("COMMAND_PUBLIC_OFF", player); - } - } - - @Mapper("publicMapper") - public TypeMapper publicNodeTypeMapper() { - return SchematicMapper.publicNodeTypeMapper(); - } - - @Mapper("memberMapper") - public static TypeMapper nodeMemberTypeMapper() { - return SchematicMapper.nodeMemberTypeMapper(); - } - - @Mapper("dirMapper") - public static TypeMapper dirNodeTypeMapper() { - return SchematicMapper.dirNodeTypeMapper(); - } - - @Mapper("publicDirMapper") - public static TypeMapper publicDirNodeTypeMapper() { - return SchematicMapper.publicDirNodeTypeMapper(); - } - - @Mapper("dirStringMapper") - public static TypeMapper stringTabMapper() { - return SchematicMapper.stringTabMapper(); - } - - @Mapper("stringMapper") - public static TypeMapper stringMapper() { - return SchematicMapper.stringMapper(); - } - - @ClassMapper(SchematicType.class) - public static TypeMapper typeTypeMapper() { - return SchematicMapper.typeTypeMapper(); - } - - @AbstractSWCommand.ClassMapper(value = SchematicNode.class, local = true) - public static TypeMapper nodeTypeMapper() { - return SchematicMapper.nodeTypeMapper(); - } - - @ClassMapper(value = CheckSchemType.class, local = true) - public static TypeMapper checkSchemTypeTypeMapper() { - return SchematicMapper.checkSchemTypeTypeMapper(); - } - - @Override - protected void sendMessage(CommandSender sender, String message, Object[] args) { - SchematicSystem.MESSAGE.send(message, sender, args); - } - - @Validator(value = "isSchemValidator", local = true) - public static TypeValidator isSchemValidator() { - return SchematicValidator.isSchemValidator(); - } - - @Validator(value = "isDirValidator", local = true) - public static TypeValidator isDirValidator() { - return SchematicValidator.isDirValidator(); - } - - @Validator(value = "isOwnerValidator", local = true) - public static TypeValidator isOwnerValidator() { - return SchematicValidator.isOwnerValidator(); - } - - @Validator(value = "isOwnerSchematicValidator", local = true) - public static TypeValidator isOwnerSchematicValidator() { - return SchematicValidator.isOwnerSchematicValidator(); - } - - public enum Extend { - AUSFAHREN, - NORMAL - } - - public static final ISchematicCommand impl = VersionDependent.getVersionImpl(SchematicSystem.getInstance()); - - public interface ISchematicCommand { - Clipboard fixClipboard(Clipboard clipboard, AutoCheckerResult result, CheckSchemType type) throws Exception; - void createCopy(EditSession editSession, Clipboard clipboard) throws WorldEditException; - } -} +/* + This file is a part of the SteamWar software. + + Copyright (C) 2023 SteamWar.de-Serverteam + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . + */ + +package de.steamwar.schematicsystem.commands.schematiccommand; + +import com.sk89q.worldedit.*; +import com.sk89q.worldedit.extent.clipboard.Clipboard; +import de.steamwar.command.*; +import de.steamwar.core.VersionDependent; +import de.steamwar.schematicsystem.CheckSchemType; +import de.steamwar.schematicsystem.SchematicSystem; +import de.steamwar.schematicsystem.autocheck.AutoCheckerResult; +import de.steamwar.sql.*; +import org.bukkit.command.CommandSender; +import org.bukkit.entity.Player; + +import static de.steamwar.schematicsystem.commands.schematiccommand.SchematicCommandHelp.*; +import static de.steamwar.schematicsystem.commands.schematiccommand.SchematicCommandUtils.*; + +@SuppressWarnings("unused") +public class SchematicCommand extends SWCommand { + + public SchematicCommand() { + super("schematic", new String[] {"schem", "/schem", "/schematic"}); + } + + @Register("help") + public void pagedHelp(Player player, HelpPage page) { + printHelpPage(player, page); + } + + @Register + public void genericHelp(Player player, String... args) { + printHelpMainPage(player); + } + + @Register(value = "togglepublic", noTabComplete = true) + public void togglePublicMode(Player player) { + SteamwarUser user = SteamwarUser.get(player.getUniqueId()); + if (!user.hasPerm(UserPerm.MODERATION)) { + genericHelp(player); + return; + } + + if (togglePublic(player)) { + SchematicSystem.MESSAGE.send("COMMAND_PUBLIC_ON", player); + } else { + SchematicSystem.MESSAGE.send("COMMAND_PUBLIC_OFF", player); + } + } + + @Mapper("publicMapper") + public TypeMapper publicNodeTypeMapper() { + return SchematicMapper.publicNodeTypeMapper(); + } + + @Mapper("memberMapper") + public static TypeMapper nodeMemberTypeMapper() { + return SchematicMapper.nodeMemberTypeMapper(); + } + + @Mapper("dirMapper") + public static TypeMapper dirNodeTypeMapper() { + return SchematicMapper.dirNodeTypeMapper(); + } + + @Mapper("publicDirMapper") + public static TypeMapper publicDirNodeTypeMapper() { + return SchematicMapper.publicDirNodeTypeMapper(); + } + + @Mapper("dirStringMapper") + public static TypeMapper stringTabMapper() { + return SchematicMapper.stringTabMapper(); + } + + @Mapper("stringMapper") + public static TypeMapper stringMapper() { + return SchematicMapper.stringMapper(); + } + + @ClassMapper(SchematicType.class) + public static TypeMapper typeTypeMapper() { + return SchematicMapper.typeTypeMapper(); + } + + @AbstractSWCommand.ClassMapper(value = SchematicNode.class, local = true) + public static TypeMapper nodeTypeMapper() { + return SchematicMapper.nodeTypeMapper(); + } + + @ClassMapper(value = CheckSchemType.class, local = true) + public static TypeMapper checkSchemTypeTypeMapper() { + return SchematicMapper.checkSchemTypeTypeMapper(); + } + + @Override + protected void sendMessage(CommandSender sender, String message, Object[] args) { + SchematicSystem.MESSAGE.send(message, sender, args); + } + + @Validator(value = "isSchemValidator", local = true) + public static TypeValidator isSchemValidator() { + return SchematicValidator.isSchemValidator(); + } + + @Validator(value = "isDirValidator", local = true) + public static TypeValidator isDirValidator() { + return SchematicValidator.isDirValidator(); + } + + @Validator(value = "isOwnerValidator", local = true) + public static TypeValidator isOwnerValidator() { + return SchematicValidator.isOwnerValidator(); + } + + @Validator(value = "isOwnerSchematicValidator", local = true) + public static TypeValidator isOwnerSchematicValidator() { + return SchematicValidator.isOwnerSchematicValidator(); + } + + public enum Extend { + AUSFAHREN, + NORMAL + } + + public static final ISchematicCommand impl = VersionDependent.getVersionImpl(SchematicSystem.getInstance()); + + public interface ISchematicCommand { + Clipboard fixClipboard(Clipboard clipboard, AutoCheckerResult result, CheckSchemType type) throws Exception; + void createCopy(EditSession editSession, Clipboard clipboard) throws WorldEditException; + } +}