├── .gitignore ├── .travis.yml ├── LICENSE ├── README.md ├── astraledit-api ├── pom.xml └── src │ └── main │ └── java │ └── com │ └── github │ └── shynixn │ └── astraledit │ └── api │ └── business │ ├── enumeration │ ├── ChatColor.kt │ └── PluginDependency.kt │ ├── proxy │ └── SelectionProxy.kt │ └── service │ ├── ConcurrencyService.kt │ ├── DependencyService.kt │ ├── DependencyWorldEditService.kt │ └── UpdateCheckService.kt ├── astraledit-bukkit-api ├── pom.xml └── src │ └── main │ └── java │ └── com │ └── github │ └── shynixn │ └── astraledit │ └── api │ └── bukkit │ ├── AstralEditApi.java │ └── business │ ├── command │ └── PlayerCommand.java │ ├── controller │ └── SelectionController.java │ └── entity │ ├── PacketArmorstand.java │ └── Selection.java ├── astraledit-bukkit-plugin ├── pom.xml └── src │ └── main │ ├── java │ └── com │ │ └── github │ │ └── shynixn │ │ └── astraledit │ │ └── bukkit │ │ ├── AstralEditPlugin.java │ │ ├── Permission.java │ │ └── logic │ │ ├── business │ │ ├── Container.java │ │ ├── Operation.java │ │ ├── OperationType.java │ │ ├── SelectionHolder.java │ │ ├── SelectionListener.java │ │ ├── SelectionManager.java │ │ ├── command │ │ │ ├── AnglesCommand.java │ │ │ ├── AutoFollowCommand.java │ │ │ ├── AutoRotateCommand.java │ │ │ ├── ClearCommand.java │ │ │ ├── ConvertToBlocksCommand.java │ │ │ ├── ConvertToRenderCommand.java │ │ │ ├── FlipCommand.java │ │ │ ├── HideCommand.java │ │ │ ├── JoinCommand.java │ │ │ ├── MirrorCommand.java │ │ │ ├── MoveCommand.java │ │ │ ├── PlaceCommand.java │ │ │ ├── RenderCommand.java │ │ │ ├── RotateCommand.java │ │ │ ├── ShowCommand.java │ │ │ ├── TearCommand.java │ │ │ ├── TeleportCommand.java │ │ │ ├── UndoCommand.java │ │ │ └── UpsidedownCommand.java │ │ ├── commandexecutor │ │ │ └── SelectionCommandExecutor.java │ │ ├── nms │ │ │ ├── NMSRegistry.java │ │ │ ├── VersionSupport.java │ │ │ ├── v1_10_R1 │ │ │ │ └── DisplayArmorstand.java │ │ │ ├── v1_11_R1 │ │ │ │ └── DisplayArmorstand.java │ │ │ ├── v1_12_R1 │ │ │ │ └── DisplayArmorstand.java │ │ │ ├── v1_8_R1 │ │ │ │ └── DisplayArmorstand.java │ │ │ ├── v1_8_R2 │ │ │ │ └── DisplayArmorstand.java │ │ │ ├── v1_8_R3 │ │ │ │ └── DisplayArmorstand.java │ │ │ ├── v1_9_R1 │ │ │ │ └── DisplayArmorstand.java │ │ │ └── v1_9_R2 │ │ │ │ └── DisplayArmorstand.java │ │ └── service │ │ │ ├── ConcurrencyServiceImpl.kt │ │ │ ├── DependencyServiceImpl.kt │ │ │ ├── DependencyWorldEditServiceImpl.kt │ │ │ └── UpdateCheckServiceImpl.kt │ │ └── lib │ │ ├── ItemStackBuilder.java │ │ ├── LocationBuilder.java │ │ ├── ReflectionUtils.java │ │ ├── SimpleCommandExecutor.java │ │ ├── SimpleListener.java │ │ └── Utils.java │ └── resources │ ├── META-INF │ └── MANIFEST.MF │ ├── config.yml │ └── plugin.yml ├── astraledit-core ├── pom.xml └── src │ └── main │ └── java │ └── com │ └── github │ └── shynixn │ └── astraledit │ └── core │ └── business │ └── extension │ └── ExtensionMethod.kt ├── docs ├── apidocs │ ├── META-INF │ │ └── MANIFEST.MF │ ├── allclasses-frame.html │ ├── allclasses-noframe.html │ ├── com │ │ └── github │ │ │ └── shynixn │ │ │ └── astraledit │ │ │ ├── api │ │ │ ├── AstralEditApi.html │ │ │ ├── class-use │ │ │ │ └── AstralEditApi.html │ │ │ ├── entity │ │ │ │ ├── PacketArmorstand.html │ │ │ │ ├── Selection.html │ │ │ │ ├── class-use │ │ │ │ │ ├── PacketArmorstand.html │ │ │ │ │ └── Selection.html │ │ │ │ ├── package-frame.html │ │ │ │ ├── package-summary.html │ │ │ │ ├── package-tree.html │ │ │ │ └── package-use.html │ │ │ ├── package-frame.html │ │ │ ├── package-summary.html │ │ │ ├── package-tree.html │ │ │ └── package-use.html │ │ │ ├── business │ │ │ ├── bukkit │ │ │ │ ├── AstralEditPlugin.html │ │ │ │ ├── Permission.html │ │ │ │ ├── class-use │ │ │ │ │ ├── AstralEditPlugin.html │ │ │ │ │ └── Permission.html │ │ │ │ ├── dependencies │ │ │ │ │ ├── DependencySupport.html │ │ │ │ │ ├── class-use │ │ │ │ │ │ └── DependencySupport.html │ │ │ │ │ ├── package-frame.html │ │ │ │ │ ├── package-summary.html │ │ │ │ │ ├── package-tree.html │ │ │ │ │ ├── package-use.html │ │ │ │ │ └── worldedit │ │ │ │ │ │ ├── WorldEditConnection.html │ │ │ │ │ │ ├── class-use │ │ │ │ │ │ └── WorldEditConnection.html │ │ │ │ │ │ ├── package-frame.html │ │ │ │ │ │ ├── package-summary.html │ │ │ │ │ │ ├── package-tree.html │ │ │ │ │ │ └── package-use.html │ │ │ │ ├── nms │ │ │ │ │ ├── NMSRegistry.html │ │ │ │ │ ├── VersionSupport.html │ │ │ │ │ ├── class-use │ │ │ │ │ │ ├── NMSRegistry.html │ │ │ │ │ │ └── VersionSupport.html │ │ │ │ │ ├── package-frame.html │ │ │ │ │ ├── package-summary.html │ │ │ │ │ ├── package-tree.html │ │ │ │ │ ├── package-use.html │ │ │ │ │ ├── v1_10_R1 │ │ │ │ │ │ ├── DisplayArmorstand.html │ │ │ │ │ │ ├── class-use │ │ │ │ │ │ │ └── DisplayArmorstand.html │ │ │ │ │ │ ├── package-frame.html │ │ │ │ │ │ ├── package-summary.html │ │ │ │ │ │ ├── package-tree.html │ │ │ │ │ │ └── package-use.html │ │ │ │ │ ├── v1_11_R1 │ │ │ │ │ │ ├── DisplayArmorstand.html │ │ │ │ │ │ ├── class-use │ │ │ │ │ │ │ └── DisplayArmorstand.html │ │ │ │ │ │ ├── package-frame.html │ │ │ │ │ │ ├── package-summary.html │ │ │ │ │ │ ├── package-tree.html │ │ │ │ │ │ └── package-use.html │ │ │ │ │ ├── v1_12_R1 │ │ │ │ │ │ ├── DisplayArmorstand.html │ │ │ │ │ │ ├── class-use │ │ │ │ │ │ │ └── DisplayArmorstand.html │ │ │ │ │ │ ├── package-frame.html │ │ │ │ │ │ ├── package-summary.html │ │ │ │ │ │ ├── package-tree.html │ │ │ │ │ │ └── package-use.html │ │ │ │ │ ├── v1_8_R1 │ │ │ │ │ │ ├── DisplayArmorstand.html │ │ │ │ │ │ ├── class-use │ │ │ │ │ │ │ └── DisplayArmorstand.html │ │ │ │ │ │ ├── package-frame.html │ │ │ │ │ │ ├── package-summary.html │ │ │ │ │ │ ├── package-tree.html │ │ │ │ │ │ └── package-use.html │ │ │ │ │ ├── v1_8_R2 │ │ │ │ │ │ ├── DisplayArmorstand.html │ │ │ │ │ │ ├── class-use │ │ │ │ │ │ │ └── DisplayArmorstand.html │ │ │ │ │ │ ├── package-frame.html │ │ │ │ │ │ ├── package-summary.html │ │ │ │ │ │ ├── package-tree.html │ │ │ │ │ │ └── package-use.html │ │ │ │ │ ├── v1_8_R3 │ │ │ │ │ │ ├── DisplayArmorstand.html │ │ │ │ │ │ ├── class-use │ │ │ │ │ │ │ └── DisplayArmorstand.html │ │ │ │ │ │ ├── package-frame.html │ │ │ │ │ │ ├── package-summary.html │ │ │ │ │ │ ├── package-tree.html │ │ │ │ │ │ └── package-use.html │ │ │ │ │ ├── v1_9_R1 │ │ │ │ │ │ ├── DisplayArmorstand.html │ │ │ │ │ │ ├── class-use │ │ │ │ │ │ │ └── DisplayArmorstand.html │ │ │ │ │ │ ├── package-frame.html │ │ │ │ │ │ ├── package-summary.html │ │ │ │ │ │ ├── package-tree.html │ │ │ │ │ │ └── package-use.html │ │ │ │ │ └── v1_9_R2 │ │ │ │ │ │ ├── DisplayArmorstand.html │ │ │ │ │ │ ├── class-use │ │ │ │ │ │ └── DisplayArmorstand.html │ │ │ │ │ │ ├── package-frame.html │ │ │ │ │ │ ├── package-summary.html │ │ │ │ │ │ ├── package-tree.html │ │ │ │ │ │ └── package-use.html │ │ │ │ ├── package-frame.html │ │ │ │ ├── package-summary.html │ │ │ │ ├── package-tree.html │ │ │ │ └── package-use.html │ │ │ ├── logic │ │ │ │ ├── SelectionManager.html │ │ │ │ ├── class-use │ │ │ │ │ └── SelectionManager.html │ │ │ │ ├── package-frame.html │ │ │ │ ├── package-summary.html │ │ │ │ ├── package-tree.html │ │ │ │ └── package-use.html │ │ │ └── metrics │ │ │ │ ├── Metrics.AdvancedBarChart.html │ │ │ │ ├── Metrics.AdvancedPie.html │ │ │ │ ├── Metrics.CustomChart.html │ │ │ │ ├── Metrics.DrilldownPie.html │ │ │ │ ├── Metrics.MultiLineChart.html │ │ │ │ ├── Metrics.SimpleBarChart.html │ │ │ │ ├── Metrics.SimplePie.html │ │ │ │ ├── Metrics.SingleLineChart.html │ │ │ │ ├── Metrics.html │ │ │ │ ├── class-use │ │ │ │ ├── Metrics.AdvancedBarChart.html │ │ │ │ ├── Metrics.AdvancedPie.html │ │ │ │ ├── Metrics.CustomChart.html │ │ │ │ ├── Metrics.DrilldownPie.html │ │ │ │ ├── Metrics.MultiLineChart.html │ │ │ │ ├── Metrics.SimpleBarChart.html │ │ │ │ ├── Metrics.SimplePie.html │ │ │ │ ├── Metrics.SingleLineChart.html │ │ │ │ └── Metrics.html │ │ │ │ ├── package-frame.html │ │ │ │ ├── package-summary.html │ │ │ │ ├── package-tree.html │ │ │ │ └── package-use.html │ │ │ └── lib │ │ │ ├── ItemStackBuilder.html │ │ │ ├── LocationBuilder.Direction.html │ │ │ ├── LocationBuilder.html │ │ │ ├── ReflectionUtils.html │ │ │ ├── SimpleCommandExecutor.Registered.html │ │ │ ├── SimpleCommandExecutor.UnRegistered.html │ │ │ ├── SimpleCommandExecutor.html │ │ │ ├── SimpleListener.html │ │ │ ├── UpdateUtils.html │ │ │ ├── class-use │ │ │ ├── ItemStackBuilder.html │ │ │ ├── LocationBuilder.Direction.html │ │ │ ├── LocationBuilder.html │ │ │ ├── ReflectionUtils.html │ │ │ ├── SimpleCommandExecutor.Registered.html │ │ │ ├── SimpleCommandExecutor.UnRegistered.html │ │ │ ├── SimpleCommandExecutor.html │ │ │ ├── SimpleListener.html │ │ │ └── UpdateUtils.html │ │ │ ├── package-frame.html │ │ │ ├── package-summary.html │ │ │ ├── package-tree.html │ │ │ └── package-use.html │ ├── constant-values.html │ ├── deprecated-list.html │ ├── help-doc.html │ ├── index-all.html │ ├── index.html │ ├── overview-frame.html │ ├── overview-summary.html │ ├── overview-tree.html │ ├── package-list │ ├── script.js │ └── stylesheet.css └── index.html └── pom.xml /.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled class file 2 | *.class 3 | 4 | # Log file 5 | *.log 6 | 7 | # BlueJ files 8 | *.ctxt 9 | 10 | # Mobile Tools for Java (J2ME) 11 | .mtj.tmp/ 12 | 13 | # Package Files # 14 | *.jar 15 | *.war 16 | *.nar 17 | *.ear 18 | *.zip 19 | *.tar.gz 20 | *.rar 21 | 22 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml 23 | hs_err_pid* 24 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: java 2 | sudo: true 3 | jdk: 4 | - oraclejdk8 5 | cache: 6 | timeout: 1000 7 | directories: 8 | - $HOME/.m2/repository/org/spigotmc 9 | install: true 10 | #- cd /home/travis/build/Shynixn/AstralEdit/ 11 | #- mkdir lib 12 | #- wget https://hub.spigotmc.org/jenkins/job/BuildTools/lastStableBuild/artifact/target/BuildTools.jar -P /home/travis/build/Shynixn/AstralEdit/lib/ 13 | #- cd /home/travis/build/Shynixn/AstralEdit/lib/ 14 | #- java -jar BuildTools.jar --rev 1.8 > /dev/null 15 | #- java -jar BuildTools.jar --rev 1.8.3 > /dev/null 16 | #- java -jar BuildTools.jar --rev 1.8.8 > /dev/null 17 | #- java -jar BuildTools.jar --rev 1.9 > /dev/null 18 | #- java -jar BuildTools.jar --rev 1.9.4 > /dev/null 19 | #- java -jar BuildTools.jar --rev 1.10 > /dev/null 20 | #- java -jar BuildTools.jar --rev 1.11 > /dev/null 21 | #- java -jar BuildTools.jar --rev 1.12 > /dev/null 22 | #- java -jar BuildTools.jar --rev 1.13 > /dev/null 23 | #- java -jar BuildTools.jar --rev 1.13.1 > /dev/null 24 | #- mvn install:install-file -Dfile=spigot-1.8.jar -DgroupId=org.spigotmc -DartifactId=spigot18R1 -Dversion=1.8.0-R1.0 -Dpackaging=jar 25 | #- mvn install:install-file -Dfile=spigot-1.8.3.jar -DgroupId=org.spigotmc -DartifactId=spigot18R2 -Dversion=1.8.3-R2.0 -Dpackaging=jar 26 | #- mvn install:install-file -Dfile=spigot-1.8.8.jar -DgroupId=org.spigotmc -DartifactId=spigot18R3 -Dversion=1.8.8-R3.0 -Dpackaging=jar 27 | #- mvn install:install-file -Dfile=spigot-1.9.jar -DgroupId=org.spigotmc -DartifactId=spigot19R1 -Dversion=1.9.0-R1.0 -Dpackaging=jar 28 | #- mvn install:install-file -Dfile=spigot-1.9.4.jar -DgroupId=org.spigotmc -DartifactId=spigot19R2 -Dversion=1.9.4-R2.0 -Dpackaging=jar 29 | #- mvn install:install-file -Dfile=spigot-1.10.2.jar -DgroupId=org.spigotmc -DartifactId=spigot110R1 -Dversion=1.10.2-R1.0 -Dpackaging=jar 30 | #- mvn install:install-file -Dfile=spigot-1.11.jar -DgroupId=org.spigotmc -DartifactId=spigot111R1 -Dversion=1.11.0-R1.0 -Dpackaging=jar 31 | #- mvn install:install-file -Dfile=spigot-1.12.jar -DgroupId=org.spigotmc -DartifactId=spigot112R1 -Dversion=1.12.0-R1.0 -Dpackaging=jar 32 | #- mvn install:install-file -Dfile=spigot-1.13.jar -DgroupId=org.spigotmc -DartifactId=spigot113R1 -Dversion=1.13.0-R1.0 -Dpackaging=jar 33 | #- mvn install:install-file -Dfile=spigot-1.13.1.jar -DgroupId=org.spigotmc -DartifactId=spigot113R2 -Dversion=1.13.1-R2.0 -Dpackaging=jar 34 | #- cd /home/travis/build/Shynixn/AstralEdit/ 35 | before_script: 36 | - sudo /etc/init.d/mysql stop 37 | script: 38 | - mvn clean install -------------------------------------------------------------------------------- /astraledit-api/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | root 7 | com.github.shynixn.astraledit 8 | 1.1.0 9 | 10 | 4.0.0 11 | 12 | astraledit-api 13 | 1.1.0 14 | 15 | -------------------------------------------------------------------------------- /astraledit-api/src/main/java/com/github/shynixn/astraledit/api/business/enumeration/ChatColor.kt: -------------------------------------------------------------------------------- 1 | @file:Suppress("unused") 2 | 3 | package com.github.shynixn.astraledit.api.business.enumeration 4 | 5 | /** 6 | * Created by Shynixn 2018. 7 | *

8 | * Version 1.2 9 | *

10 | * MIT License 11 | *

12 | * Copyright (c) 2018 by Shynixn 13 | *

14 | * Permission is hereby granted, free of charge, to any person obtaining a copy 15 | * of this software and associated documentation files (the "Software"), to deal 16 | * in the Software without restriction, including without limitation the rights 17 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 18 | * copies of the Software, and to permit persons to whom the Software is 19 | * furnished to do so, subject to the following conditions: 20 | *

21 | * The above copyright notice and this permission notice shall be included in all 22 | * copies or substantial portions of the Software. 23 | *

24 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 25 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 26 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 27 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 28 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 29 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 30 | * SOFTWARE. 31 | */ 32 | enum class ChatColor( 33 | /** 34 | * Unique code. 35 | */ 36 | val code: Char, 37 | /** 38 | * Unique int code. 39 | */ 40 | val internalCode: Int, 41 | /** 42 | * Is color being used for formatting. 43 | */ 44 | val isFormatting: Boolean = false, 45 | /** 46 | * Internal string description of the color. 47 | */ 48 | private val internalString: String = String(charArrayOf('§', code))) { 49 | /** 50 | * Black. 51 | */ 52 | BLACK('0', 0), 53 | /** 54 | * Dark_Blue. 55 | */ 56 | DARK_BLUE('1', 1), 57 | /** 58 | * Dark_Green. 59 | */ 60 | DARK_GREEN('2', 2), 61 | /** 62 | * Dark_Aqua. 63 | */ 64 | DARK_AQUA('3', 3), 65 | /** 66 | * Dark_Red. 67 | */ 68 | DARK_RED('4', 4), 69 | /** 70 | * Dark_Purple. 71 | */ 72 | DARK_PURPLE('5', 5), 73 | /** 74 | * Gold. 75 | */ 76 | GOLD('6', 6), 77 | /** 78 | * Gray. 79 | */ 80 | GRAY('7', 7), 81 | /** 82 | * Dark Gray. 83 | */ 84 | DARK_GRAY('8', 8), 85 | /** 86 | * Blue. 87 | */ 88 | BLUE('9', 9), 89 | /** 90 | * Green. 91 | */ 92 | GREEN('a', 10), 93 | /** 94 | * Aqua. 95 | */ 96 | AQUA('b', 11), 97 | /** 98 | * Red. 99 | */ 100 | RED('c', 12), 101 | /** 102 | * Light_Purple. 103 | */ 104 | LIGHT_PURPLE('d', 13), 105 | /** 106 | * Yellow. 107 | */ 108 | YELLOW('e', 14), 109 | /** 110 | * White. 111 | */ 112 | WHITE('f', 15), 113 | /** 114 | * Magic. 115 | */ 116 | MAGIC('k', 16, true), 117 | /** 118 | * Bold. 119 | */ 120 | BOLD('l', 17, true), 121 | /** 122 | * Strikethrough. 123 | */ 124 | STRIKETHROUGH('m', 18, true), 125 | /** 126 | * Underline. 127 | */ 128 | UNDERLINE('n', 19, true), 129 | /** 130 | * Italic. 131 | */ 132 | ITALIC('o', 20, true), 133 | /** 134 | * Reset. 135 | */ 136 | RESET('r', 21); 137 | 138 | /** 139 | * Returns the string code. 140 | */ 141 | override fun toString(): String { 142 | return this.internalString 143 | } 144 | 145 | companion object { 146 | /** 147 | * Translates the given [colorCodeChar] in the given [text] to the color code chars of minecraft. 148 | */ 149 | fun translateChatColorCodes(colorCodeChar: Char, text: String): String { 150 | val letters = text.toCharArray() 151 | 152 | for (i in 0 until letters.size - 1) { 153 | if (letters[i] == colorCodeChar && "0123456789AaBbCcDdEeFfKkLlMmNnOoRr".indexOf(letters[i + 1]) > -1) { 154 | letters[i] = 167.toChar() 155 | letters[i + 1] = Character.toLowerCase(letters[i + 1]) 156 | } 157 | } 158 | 159 | return String(letters) 160 | } 161 | } 162 | } -------------------------------------------------------------------------------- /astraledit-api/src/main/java/com/github/shynixn/astraledit/api/business/enumeration/PluginDependency.kt: -------------------------------------------------------------------------------- 1 | package com.github.shynixn.astraledit.api.business.enumeration 2 | 3 | /** 4 | * Created by Shynixn 2018. 5 | *

6 | * Version 1.2 7 | *

8 | * MIT License 9 | *

10 | * Copyright (c) 2018 by Shynixn 11 | *

12 | * Permission is hereby granted, free of charge, to any person obtaining a copy 13 | * of this software and associated documentation files (the "Software"), to deal 14 | * in the Software without restriction, including without limitation the rights 15 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 16 | * copies of the Software, and to permit persons to whom the Software is 17 | * furnished to do so, subject to the following conditions: 18 | *

19 | * The above copyright notice and this permission notice shall be included in all 20 | * copies or substantial portions of the Software. 21 | *

22 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 23 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 24 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 25 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 26 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 27 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 28 | * SOFTWARE. 29 | */ 30 | enum class PluginDependency( 31 | /** 32 | * Plugin name. 33 | */ 34 | val pluginName: String) { 35 | 36 | /** 37 | * WorldEdit plugin. 38 | */ 39 | WORLEDIT("WorldEdit") 40 | } -------------------------------------------------------------------------------- /astraledit-api/src/main/java/com/github/shynixn/astraledit/api/business/proxy/SelectionProxy.kt: -------------------------------------------------------------------------------- 1 | package com.github.shynixn.astraledit.api.business.proxy 2 | 3 | /** 4 | * Created by Shynixn 2018. 5 | *

6 | * Version 1.2 7 | *

8 | * MIT License 9 | *

10 | * Copyright (c) 2018 by Shynixn 11 | *

12 | * Permission is hereby granted, free of charge, to any person obtaining a copy 13 | * of this software and associated documentation files (the "Software"), to deal 14 | * in the Software without restriction, including without limitation the rights 15 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 16 | * copies of the Software, and to permit persons to whom the Software is 17 | * furnished to do so, subject to the following conditions: 18 | *

19 | * The above copyright notice and this permission notice shall be included in all 20 | * copies or substantial portions of the Software. 21 | *

22 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 23 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 24 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 25 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 26 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 27 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 28 | * SOFTWARE. 29 | */ 30 | interface SelectionProxy { 31 | } -------------------------------------------------------------------------------- /astraledit-api/src/main/java/com/github/shynixn/astraledit/api/business/service/ConcurrencyService.kt: -------------------------------------------------------------------------------- 1 | package com.github.shynixn.astraledit.api.business.service 2 | 3 | /** 4 | * Created by Shynixn 2018. 5 | *

6 | * Version 1.2 7 | *

8 | * MIT License 9 | *

10 | * Copyright (c) 2018 by Shynixn 11 | *

12 | * Permission is hereby granted, free of charge, to any person obtaining a copy 13 | * of this software and associated documentation files (the "Software"), to deal 14 | * in the Software without restriction, including without limitation the rights 15 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 16 | * copies of the Software, and to permit persons to whom the Software is 17 | * furnished to do so, subject to the following conditions: 18 | *

19 | * The above copyright notice and this permission notice shall be included in all 20 | * copies or substantial portions of the Software. 21 | *

22 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 23 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 24 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 25 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 26 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 27 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 28 | * SOFTWARE. 29 | */ 30 | interface ConcurrencyService { 31 | /** 32 | * Runs the given [function] synchronised with the given [delayTicks] and [repeatingTicks]. 33 | */ 34 | fun runTaskSync(delayTicks: Long = 0L, repeatingTicks: Long = 0L, function: Runnable) 35 | 36 | /** 37 | * Runs the given [function] asynchronous with the given [delayTicks] and [repeatingTicks]. 38 | */ 39 | fun runTaskAsync(delayTicks: Long = 0L, repeatingTicks: Long = 0L, function: Runnable) 40 | } -------------------------------------------------------------------------------- /astraledit-api/src/main/java/com/github/shynixn/astraledit/api/business/service/DependencyService.kt: -------------------------------------------------------------------------------- 1 | package com.github.shynixn.astraledit.api.business.service 2 | 3 | import com.github.shynixn.astraledit.api.business.enumeration.PluginDependency 4 | 5 | /** 6 | * Created by Shynixn 2018. 7 | *

8 | * Version 1.2 9 | *

10 | * MIT License 11 | *

12 | * Copyright (c) 2018 by Shynixn 13 | *

14 | * Permission is hereby granted, free of charge, to any person obtaining a copy 15 | * of this software and associated documentation files (the "Software"), to deal 16 | * in the Software without restriction, including without limitation the rights 17 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 18 | * copies of the Software, and to permit persons to whom the Software is 19 | * furnished to do so, subject to the following conditions: 20 | *

21 | * The above copyright notice and this permission notice shall be included in all 22 | * copies or substantial portions of the Software. 23 | *

24 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 25 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 26 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 27 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 28 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 29 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 30 | * SOFTWARE. 31 | */ 32 | interface DependencyService { 33 | /** 34 | * Checks for installed dependencies and shows console output. 35 | * @return True when all required dependencies are installed. 36 | */ 37 | fun checkForInstalledDependencies(): Boolean 38 | 39 | /** 40 | * Returns if the given [pluginDependency] is installed. 41 | */ 42 | fun isInstalled(pluginDependency: PluginDependency): Boolean 43 | } -------------------------------------------------------------------------------- /astraledit-api/src/main/java/com/github/shynixn/astraledit/api/business/service/DependencyWorldEditService.kt: -------------------------------------------------------------------------------- 1 | package com.github.shynixn.astraledit.api.business.service 2 | 3 | import java.util.* 4 | 5 | /** 6 | * Created by Shynixn 2018. 7 | *

8 | * Version 1.2 9 | *

10 | * MIT License 11 | *

12 | * Copyright (c) 2018 by Shynixn 13 | *

14 | * Permission is hereby granted, free of charge, to any person obtaining a copy 15 | * of this software and associated documentation files (the "Software"), to deal 16 | * in the Software without restriction, including without limitation the rights 17 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 18 | * copies of the Software, and to permit persons to whom the Software is 19 | * furnished to do so, subject to the following conditions: 20 | *

21 | * The above copyright notice and this permission notice shall be included in all 22 | * copies or substantial portions of the Software. 23 | *

24 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 25 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 26 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 27 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 28 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 29 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 30 | * SOFTWARE. 31 | */ 32 | interface DependencyWorldEditService { 33 | /** 34 | * Returns the LeftClick WorldEdit selection of the given [player]. 35 | * @param [L] Location. 36 | * @param [P] Player. 37 | */ 38 | fun getLeftClickLocation(player: P): Optional 39 | 40 | /** 41 | * Returns the RightClick WorldEdit selection of the given [player]. 42 | * @param [L] Location. 43 | * @param [P] Player. 44 | */ 45 | fun getRightClickLocation(player: P): Optional 46 | } -------------------------------------------------------------------------------- /astraledit-api/src/main/java/com/github/shynixn/astraledit/api/business/service/UpdateCheckService.kt: -------------------------------------------------------------------------------- 1 | package com.github.shynixn.astraledit.api.business.service 2 | 3 | import java.util.concurrent.CompletableFuture 4 | 5 | /** 6 | * Created by Shynixn 2018. 7 | *

8 | * Version 1.2 9 | *

10 | * MIT License 11 | *

12 | * Copyright (c) 2018 by Shynixn 13 | *

14 | * Permission is hereby granted, free of charge, to any person obtaining a copy 15 | * of this software and associated documentation files (the "Software"), to deal 16 | * in the Software without restriction, including without limitation the rights 17 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 18 | * copies of the Software, and to permit persons to whom the Software is 19 | * furnished to do so, subject to the following conditions: 20 | *

21 | * The above copyright notice and this permission notice shall be included in all 22 | * copies or substantial portions of the Software. 23 | *

24 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 25 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 26 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 27 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 28 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 29 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 30 | * SOFTWARE. 31 | */ 32 | interface UpdateCheckService { 33 | /** 34 | * Returns if there are any new updates for the AstralEdit plugin. 35 | */ 36 | fun checkForUpdates(): CompletableFuture 37 | } -------------------------------------------------------------------------------- /astraledit-bukkit-api/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | root 7 | com.github.shynixn.astraledit 8 | 1.1.0 9 | 10 | 4.0.0 11 | 12 | astraledit-bukkit-api 13 | 1.1.0 14 | 15 | 16 | 17 | com.github.shynixn.astraledit 18 | astraledit-api 19 | 1.1.0 20 | compile 21 | 22 | 23 | org.spigotmc 24 | spigot113R2 25 | 1.13.1-R2.0 26 | provided 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /astraledit-bukkit-api/src/main/java/com/github/shynixn/astraledit/api/bukkit/business/command/PlayerCommand.java: -------------------------------------------------------------------------------- 1 | package com.github.shynixn.astraledit.api.bukkit.business.command; 2 | 3 | import org.bukkit.entity.Player; 4 | 5 | /** 6 | * Created by Shynixn 2018. 7 | *

8 | * Version 1.2 9 | *

10 | * MIT License 11 | *

12 | * Copyright (c) 2018 by Shynixn 13 | *

14 | * Permission is hereby granted, free of charge, to any person obtaining a copy 15 | * of this software and associated documentation files (the "Software"), to deal 16 | * in the Software without restriction, including without limitation the rights 17 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 18 | * copies of the Software, and to permit persons to whom the Software is 19 | * furnished to do so, subject to the following conditions: 20 | *

21 | * The above copyright notice and this permission notice shall be included in all 22 | * copies or substantial portions of the Software. 23 | *

24 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 25 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 26 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 27 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 28 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 29 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 30 | * SOFTWARE. 31 | */ 32 | public interface PlayerCommand { 33 | /** 34 | * Executes the given command if the arguments match. 35 | * 36 | * @param player executing the command. 37 | * @param args arguments. 38 | * @return True if this command was executed. False if the arguments do not match. 39 | */ 40 | boolean onPlayerExecuteCommand(Player player, String[] args); 41 | } 42 | -------------------------------------------------------------------------------- /astraledit-bukkit-api/src/main/java/com/github/shynixn/astraledit/api/bukkit/business/controller/SelectionController.java: -------------------------------------------------------------------------------- 1 | package com.github.shynixn.astraledit.api.bukkit.business.controller; 2 | 3 | import com.github.shynixn.astraledit.api.bukkit.business.entity.Selection; 4 | import com.github.shynixn.astraledit.api.business.service.DependencyWorldEditService; 5 | import org.bukkit.Location; 6 | import org.bukkit.entity.Player; 7 | 8 | /** 9 | * Created by Shynixn 2018. 10 | *

11 | * Version 1.2 12 | *

13 | * MIT License 14 | *

15 | * Copyright (c) 2018 by Shynixn 16 | *

17 | * Permission is hereby granted, free of charge, to any person obtaining a copy 18 | * of this software and associated documentation files (the "Software"), to deal 19 | * in the Software without restriction, including without limitation the rights 20 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 21 | * copies of the Software, and to permit persons to whom the Software is 22 | * furnished to do so, subject to the following conditions: 23 | *

24 | * The above copyright notice and this permission notice shall be included in all 25 | * copies or substantial portions of the Software. 26 | *

27 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 28 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 29 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 30 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 31 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 32 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 33 | * SOFTWARE. 34 | */ 35 | public interface SelectionController extends AutoCloseable { 36 | /** 37 | * Creates a new selection for the given player, corner1, corner2. 38 | * 39 | * @param player player 40 | * @param corner1 corner1 41 | * @param corner2 corner2 42 | * @return selection 43 | */ 44 | Selection create(Player player, Location corner1, Location corner2); 45 | 46 | /** 47 | * Adds the selection to the manager to be managed 48 | * 49 | * @param player player 50 | * @param selection selection 51 | */ 52 | void addSelection(Player player, Selection selection); 53 | 54 | /** 55 | * Checks if the player has got a selection. 56 | * 57 | * @param player player 58 | * @return selection 59 | */ 60 | boolean hasSelection(Player player); 61 | 62 | /** 63 | * Returns the selection of a player 64 | * 65 | * @param player player 66 | * @return selection 67 | */ 68 | Selection getSelection(Player player); 69 | 70 | /** 71 | * Clears the selection of the player 72 | * 73 | * @param player player 74 | */ 75 | void clearSelection(Player player); 76 | 77 | /** 78 | * Gets the worldedit controller. 79 | * 80 | * @return controll 81 | */ 82 | DependencyWorldEditService getWorldEditController(); 83 | } 84 | -------------------------------------------------------------------------------- /astraledit-bukkit-api/src/main/java/com/github/shynixn/astraledit/api/bukkit/business/entity/PacketArmorstand.java: -------------------------------------------------------------------------------- 1 | package com.github.shynixn.astraledit.api.bukkit.business.entity; 2 | 3 | import org.bukkit.Location; 4 | import org.bukkit.util.EulerAngle; 5 | 6 | /** 7 | * Copyright 2017 Shynixn 8 | *

9 | * Do not remove this header! 10 | *

11 | * Version 1.0 12 | *

13 | * MIT License 14 | *

15 | * Copyright (c) 2017 16 | *

17 | * Permission is hereby granted, free of charge, to any person obtaining a copy 18 | * of this software and associated documentation files (the "Software"), to deal 19 | * in the Software without restriction, including without limitation the rights 20 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 21 | * copies of the Software, and to permit persons to whom the Software is 22 | * furnished to do so, subject to the following conditions: 23 | *

24 | * The above copyright notice and this permission notice shall be included in all 25 | * copies or substantial portions of the Software. 26 | *

27 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 28 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 29 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 30 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 31 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 32 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 33 | * SOFTWARE. 34 | */ 35 | public interface PacketArmorstand extends AutoCloseable { 36 | 37 | /** 38 | * Spawns the armorstand 39 | */ 40 | void spawn(); 41 | 42 | /** 43 | * Teleports the armorstand to the given location 44 | * 45 | * @param location location 46 | */ 47 | void teleport(Location location); 48 | 49 | /** 50 | * Removes the armorstand 51 | */ 52 | void remove(); 53 | 54 | /** 55 | * Returns the location of the armorstand 56 | * 57 | * @return location 58 | */ 59 | Location getLocation(); 60 | 61 | /** 62 | * Sets the pose of 63 | * 64 | * @param angle angle 65 | */ 66 | void setHeadPose(EulerAngle angle); 67 | 68 | /** 69 | * Returns the pose of the head 70 | * 71 | * @return angle 72 | */ 73 | EulerAngle getHeadPose(); 74 | 75 | /** 76 | * Returns the stored block id 77 | * 78 | * @return id 79 | */ 80 | int getStoredBlockId(); 81 | 82 | /** 83 | * Sets the stored block id 84 | * 85 | * @param id id 86 | */ 87 | void setStoreBlockId(int id); 88 | 89 | /** 90 | * Returns the stored block data 91 | * 92 | * @return data 93 | */ 94 | byte getStoredBlockData(); 95 | 96 | /** 97 | * Sets the stored block data 98 | * 99 | * @param data data 100 | */ 101 | void setStoredBlockData(byte data); 102 | } 103 | -------------------------------------------------------------------------------- /astraledit-bukkit-api/src/main/java/com/github/shynixn/astraledit/api/bukkit/business/entity/Selection.java: -------------------------------------------------------------------------------- 1 | package com.github.shynixn.astraledit.api.bukkit.business.entity; 2 | 3 | import org.bukkit.Location; 4 | import org.bukkit.entity.Player; 5 | import org.bukkit.util.EulerAngle; 6 | 7 | /** 8 | * Copyright 2017 Shynixn 9 | *

10 | * Do not remove this header! 11 | *

12 | * Version 1.0 13 | *

14 | * MIT License 15 | *

16 | * Copyright (c) 2017 17 | *

18 | * Permission is hereby granted, free of charge, to any person obtaining a copy 19 | * of this software and associated documentation files (the "Software"), to deal 20 | * in the Software without restriction, including without limitation the rights 21 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 22 | * copies of the Software, and to permit persons to whom the Software is 23 | * furnished to do so, subject to the following conditions: 24 | *

25 | * The above copyright notice and this permission notice shall be included in all 26 | * copies or substantial portions of the Software. 27 | *

28 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 29 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 30 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 31 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 32 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 33 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 34 | * SOFTWARE. 35 | */ 36 | public interface Selection extends AutoCloseable { 37 | /** 38 | * Returns the amount of selected blocks 39 | * 40 | * @return amount 41 | */ 42 | int getAmountOfSelectedBlocks(); 43 | 44 | /** 45 | * Renders the selection 46 | */ 47 | void render(); 48 | 49 | /** 50 | * Renders the selection and destroys the blocks 51 | */ 52 | void renderAndDestroy(); 53 | 54 | /** 55 | * Joins the blocks together if teared apart 56 | */ 57 | void join(); 58 | 59 | /** 60 | * Tears the blocks apart if joined 61 | */ 62 | void tearApart(); 63 | 64 | /** 65 | * Returns if the blocks are joined 66 | * 67 | * @return joined 68 | */ 69 | boolean isJoined(); 70 | 71 | /** 72 | * Places the selection at the current location 73 | * @param callBack callBack 74 | */ 75 | void placeBlocks(Runnable callBack); 76 | 77 | /** 78 | * Moves the object to the given location 79 | * 80 | * @param location location 81 | */ 82 | void move(Location location); 83 | 84 | /** 85 | * Returns the location of the selection 86 | * 87 | * @return location 88 | */ 89 | Location getLocation(); 90 | 91 | /** 92 | * Flips the selection 93 | */ 94 | void flip(); 95 | 96 | /** 97 | * UpsideDowns the selection 98 | */ 99 | void upSideDown(); 100 | 101 | /** 102 | * Mirrors the selection 103 | */ 104 | void mirror(); 105 | 106 | /** 107 | * Checks if the selection is hidden from other player 108 | * 109 | * @return hidden 110 | */ 111 | boolean isHidden(); 112 | 113 | /** 114 | * Shows the given players the selection 115 | * 116 | * @param players players 117 | */ 118 | void show(Player... players); 119 | 120 | /** 121 | * Hides the selection from the given player 122 | * 123 | * @param players players 124 | */ 125 | void hide(Player... players); 126 | 127 | /** 128 | * Returns the owner of the selection 129 | * 130 | * @return owner 131 | */ 132 | Player getOwner(); 133 | 134 | /** 135 | * Returns the angle of the single blocks 136 | * 137 | * @return angle 138 | */ 139 | EulerAngle getBlockAngle(); 140 | 141 | /** 142 | * Returns the rotation of the selection 143 | * 144 | * @return rotation 145 | */ 146 | double getRotation(); 147 | 148 | /** 149 | * Rotates the selection 150 | * 151 | * @param amount amount 152 | */ 153 | void rotate(double amount); 154 | 155 | /** 156 | * Sets the angle of the single blocks 157 | * 158 | * @param eulerAngle angle 159 | */ 160 | void setBlockAngle(EulerAngle eulerAngle); 161 | 162 | /** 163 | * Sets auto follow enabled 164 | * 165 | * @param enabled enabled 166 | */ 167 | void setAutoFollowEnabled(boolean enabled); 168 | 169 | /** 170 | * Set auto follow rotate enabled 171 | * 172 | * @param enabled enabled 173 | */ 174 | void setAutoFollowRotateEnabled(boolean enabled); 175 | 176 | /** 177 | * Returns if auto follow is enabled 178 | * 179 | * @return enabled 180 | */ 181 | boolean isAutoFollowEnabled(); 182 | 183 | /** 184 | * Returns if auto follow rotate is enabled 185 | * 186 | * @return enabled 187 | */ 188 | boolean isAutoFollowRotateEnabled(); 189 | } 190 | -------------------------------------------------------------------------------- /astraledit-bukkit-plugin/src/main/java/com/github/shynixn/astraledit/bukkit/Permission.java: -------------------------------------------------------------------------------- 1 | package com.github.shynixn.astraledit.bukkit; 2 | 3 | import org.bukkit.entity.Player; 4 | 5 | /** 6 | * Copyright 2017 Shynixn 7 | *

8 | * Do not remove this header! 9 | *

10 | * Version 1.0 11 | *

12 | * MIT License 13 | *

14 | * Copyright (c) 2017 15 | *

16 | * Permission is hereby granted, free of charge, to any person obtaining a copy 17 | * of this software and associated documentation files (the "Software"), to deal 18 | * in the Software without restriction, including without limitation the rights 19 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 20 | * copies of the Software, and to permit persons to whom the Software is 21 | * furnished to do so, subject to the following conditions: 22 | *

23 | * The above copyright notice and this permission notice shall be included in all 24 | * copies or substantial portions of the Software. 25 | *

26 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 27 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 28 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 29 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 30 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 31 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 32 | * SOFTWARE. 33 | */ 34 | public enum Permission { 35 | 36 | RENDER("astraledit.commands.render"), 37 | JOIN("astraledit.commands.join"), 38 | TEAR("astraledit.commands.tear"), 39 | PLACE("astraledit.commands.place"), 40 | CLEAR("astraledit.commands.clear"), 41 | MOVE_COORDINATE("astraledit.commands.movecoordinate"), 42 | MOVE_PLAYER("astraledit.commands.moveplayer"), 43 | MIRROR("astraledit.commands.mirror"), 44 | FLIP("astraledit.commands.flip"), 45 | UPSIDEDOWN("astraledit.commands.upsidedown"), 46 | ANGLES("astraledit.commands.angles"), 47 | ROTATE("astraledit.commands.rotate"), 48 | TELEPORT_PLAYER("astraledit.commands.teleportplayer"), 49 | CONVERT_TO_BLOCKS("astraledit.commands.converttoblocks"), 50 | CONVERT_TO_RENDER("astraledit.commands.converttorender"), 51 | AUTO_FOLLOW("astraledit.commands.autofollow"), 52 | AUTO_ROTATE("astraledit.commands.autorotate"), 53 | UNDO("astraledit.commands.undo"), 54 | HIDE_OTHER("astraledit.commands.hideother"), 55 | SHOW_OTHER("astraledit.commands.showother"),; 56 | 57 | private final String text; 58 | 59 | /** 60 | * Initializes a new permission 61 | * 62 | * @param text text 63 | */ 64 | Permission(String text) { 65 | this.text = text; 66 | } 67 | 68 | /** 69 | * Returns if the given player has permissions 70 | * 71 | * @param player player 72 | * @return has 73 | */ 74 | public boolean hasPermission(Player player) { 75 | return player.hasPermission(this.text); 76 | } 77 | 78 | /** 79 | * Returns the text of the permission 80 | * 81 | * @return text 82 | */ 83 | public String getText() { 84 | return this.text; 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /astraledit-bukkit-plugin/src/main/java/com/github/shynixn/astraledit/bukkit/logic/business/Container.java: -------------------------------------------------------------------------------- 1 | package com.github.shynixn.astraledit.bukkit.logic.business; 2 | 3 | import com.github.shynixn.astraledit.bukkit.logic.lib.LocationBuilder; 4 | 5 | /** 6 | * Copyright 2017 Shynixn 7 | *

8 | * Do not remove this header! 9 | *

10 | * Version 1.0 11 | *

12 | * MIT License 13 | *

14 | * Copyright (c) 2017 15 | *

16 | * Permission is hereby granted, free of charge, to any person obtaining a copy 17 | * of this software and associated documentation files (the "Software"), to deal 18 | * in the Software without restriction, including without limitation the rights 19 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 20 | * copies of the Software, and to permit persons to whom the Software is 21 | * furnished to do so, subject to the following conditions: 22 | *

23 | * The above copyright notice and this permission notice shall be included in all 24 | * copies or substantial portions of the Software. 25 | *

26 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 27 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 28 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 29 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 30 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 31 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 32 | * SOFTWARE. 33 | */ 34 | class Container { 35 | final int id; 36 | final byte data; 37 | final LocationBuilder location; 38 | 39 | /** 40 | * Initializes a new container 41 | * 42 | * @param id id 43 | * @param data data 44 | * @param location location 45 | */ 46 | Container(int id, byte data, LocationBuilder location) { 47 | super(); 48 | this.id = id; 49 | this.data = data; 50 | this.location = location; 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /astraledit-bukkit-plugin/src/main/java/com/github/shynixn/astraledit/bukkit/logic/business/Operation.java: -------------------------------------------------------------------------------- 1 | package com.github.shynixn.astraledit.bukkit.logic.business; 2 | 3 | /** 4 | * Copyright 2017 Shynixn 5 | *

6 | * Do not remove this header! 7 | *

8 | * Version 1.0 9 | *

10 | * MIT License 11 | *

12 | * Copyright (c) 2017 13 | *

14 | * Permission is hereby granted, free of charge, to any person obtaining a copy 15 | * of this software and associated documentation files (the "Software"), to deal 16 | * in the Software without restriction, including without limitation the rights 17 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 18 | * copies of the Software, and to permit persons to whom the Software is 19 | * furnished to do so, subject to the following conditions: 20 | *

21 | * The above copyright notice and this permission notice shall be included in all 22 | * copies or substantial portions of the Software. 23 | *

24 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 25 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 26 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 27 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 28 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 29 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 30 | * SOFTWARE. 31 | */ 32 | public class Operation { 33 | private final OperationType type; 34 | private Object operationData; 35 | 36 | /** 37 | * Initializes a new operation 38 | * 39 | * @param type type 40 | */ 41 | public Operation(OperationType type) { 42 | super(); 43 | this.type = type; 44 | } 45 | 46 | /** 47 | * Returns the operationType 48 | * 49 | * @return type 50 | */ 51 | public OperationType getType() { 52 | return this.type; 53 | } 54 | 55 | /** 56 | * Returns the unknown operation Data 57 | * 58 | * @return data 59 | */ 60 | public Object getOperationData() { 61 | return this.operationData; 62 | } 63 | 64 | /** 65 | * Sets the data of the operation 66 | * 67 | * @param operationData operationsData 68 | */ 69 | public void setOperationData(Object operationData) { 70 | this.operationData = operationData; 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /astraledit-bukkit-plugin/src/main/java/com/github/shynixn/astraledit/bukkit/logic/business/OperationType.java: -------------------------------------------------------------------------------- 1 | package com.github.shynixn.astraledit.bukkit.logic.business; 2 | 3 | /** 4 | * Copyright 2017 Shynixn 5 | *

6 | * Do not remove this header! 7 | *

8 | * Version 1.0 9 | *

10 | * MIT License 11 | *

12 | * Copyright (c) 2017 13 | *

14 | * Permission is hereby granted, free of charge, to any person obtaining a copy 15 | * of this software and associated documentation files (the "Software"), to deal 16 | * in the Software without restriction, including without limitation the rights 17 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 18 | * copies of the Software, and to permit persons to whom the Software is 19 | * furnished to do so, subject to the following conditions: 20 | *

21 | * The above copyright notice and this permission notice shall be included in all 22 | * copies or substantial portions of the Software. 23 | *

24 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 25 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 26 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 27 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 28 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 29 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 30 | * SOFTWARE. 31 | */ 32 | public enum OperationType { 33 | MIRROR, 34 | FLIP, 35 | UPSIDEDOWN, 36 | ROTATE, 37 | ANGLES, 38 | UNCOMBINE, 39 | COMBINE, 40 | PLACE, 41 | MOVE, 42 | CONVERTOBLOCKS 43 | } 44 | -------------------------------------------------------------------------------- /astraledit-bukkit-plugin/src/main/java/com/github/shynixn/astraledit/bukkit/logic/business/SelectionListener.java: -------------------------------------------------------------------------------- 1 | package com.github.shynixn.astraledit.bukkit.logic.business; 2 | 3 | import com.github.shynixn.astraledit.bukkit.logic.lib.SimpleListener; 4 | import org.bukkit.event.EventHandler; 5 | import org.bukkit.event.player.PlayerQuitEvent; 6 | import org.bukkit.plugin.Plugin; 7 | 8 | /** 9 | * Copyright 2017 Shynixn 10 | *

11 | * Do not remove this header! 12 | *

13 | * Version 1.0 14 | *

15 | * MIT License 16 | *

17 | * Copyright (c) 2017 18 | *

19 | * Permission is hereby granted, free of charge, to any person obtaining a copy 20 | * of this software and associated documentation files (the "Software"), to deal 21 | * in the Software without restriction, including without limitation the rights 22 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 23 | * copies of the Software, and to permit persons to whom the Software is 24 | * furnished to do so, subject to the following conditions: 25 | *

26 | * The above copyright notice and this permission notice shall be included in all 27 | * copies or substantial portions of the Software. 28 | *

29 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 30 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 31 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 32 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 33 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 34 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 35 | * SOFTWARE. 36 | */ 37 | class SelectionListener extends SimpleListener { 38 | private final SelectionManager manager; 39 | 40 | /** 41 | * Initializes a new listener by plugin 42 | */ 43 | SelectionListener(SelectionManager manager, Plugin plugin) { 44 | super(plugin); 45 | this.manager = manager; 46 | } 47 | 48 | /** 49 | * Clears remaining data 50 | * 51 | * @param event event 52 | */ 53 | @EventHandler 54 | public void onPlayerQuitEvent(PlayerQuitEvent event) { 55 | this.manager.clearSelection(event.getPlayer()); 56 | this.manager.clearOperations(event.getPlayer()); 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /astraledit-bukkit-plugin/src/main/java/com/github/shynixn/astraledit/bukkit/logic/business/command/AnglesCommand.java: -------------------------------------------------------------------------------- 1 | package com.github.shynixn.astraledit.bukkit.logic.business.command; 2 | 3 | import com.github.shynixn.astraledit.api.bukkit.business.command.PlayerCommand; 4 | import com.github.shynixn.astraledit.bukkit.AstralEditPlugin; 5 | import com.github.shynixn.astraledit.bukkit.Permission; 6 | import com.github.shynixn.astraledit.bukkit.logic.business.Operation; 7 | import com.github.shynixn.astraledit.bukkit.logic.business.OperationType; 8 | import com.github.shynixn.astraledit.bukkit.logic.business.SelectionManager; 9 | import org.bukkit.entity.Player; 10 | import org.bukkit.plugin.Plugin; 11 | import org.bukkit.util.EulerAngle; 12 | 13 | import static com.github.shynixn.astraledit.bukkit.logic.lib.Utils.tryParseDouble; 14 | 15 | /** 16 | * Created by Shynixn 2018. 17 | *

18 | * Version 1.2 19 | *

20 | * MIT License 21 | *

22 | * Copyright (c) 2018 by Shynixn 23 | *

24 | * Permission is hereby granted, free of charge, to any person obtaining a copy 25 | * of this software and associated documentation files (the "Software"), to deal 26 | * in the Software without restriction, including without limitation the rights 27 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 28 | * copies of the Software, and to permit persons to whom the Software is 29 | * furnished to do so, subject to the following conditions: 30 | *

31 | * The above copyright notice and this permission notice shall be included in all 32 | * copies or substantial portions of the Software. 33 | *

34 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 35 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 36 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 37 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 38 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 39 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 40 | * SOFTWARE. 41 | */ 42 | public class AnglesCommand implements PlayerCommand { 43 | private final Plugin plugin; 44 | private final SelectionManager manager; 45 | /** 46 | * Creates an instance of {@link AnglesCommand} which depends on 47 | * a {@link SelectionManager} and a {@link Plugin} 48 | * 49 | * @param manager SelectionManager 50 | */ 51 | public AnglesCommand(SelectionManager manager, Plugin plugin) { 52 | this.manager = manager; 53 | this.plugin = plugin; 54 | } 55 | /** 56 | * Executes the given command if the arguments match. 57 | * 58 | * @param player executing the command. 59 | * @param args arguments. 60 | * @return True if this command was executed. False if the arguments do not match. 61 | */ 62 | @Override 63 | public boolean onPlayerExecuteCommand(Player player, String[] args) { 64 | if (args.length != 4 || !args[0].equalsIgnoreCase("angles") || 65 | !tryParseDouble(args[1]) || !tryParseDouble(args[2]) || !tryParseDouble(args[3]) || 66 | !Permission.ANGLES.hasPermission(player)) { 67 | return false; 68 | } 69 | 70 | this.plugin.getServer().getScheduler().runTaskAsynchronously(this.plugin, () -> { 71 | if (!this.manager.hasSelection(player)) { 72 | player.sendMessage(AstralEditPlugin.PREFIX_ERROR + "You don't have a valid render."); 73 | } else { 74 | final Operation operation = new Operation(OperationType.ANGLES); 75 | operation.setOperationData(this.manager.getSelection(player).getBlockAngle()); 76 | this.manager.getSelection(player).setBlockAngle(new EulerAngle(Double.parseDouble(args[1]), Double.parseDouble(args[2]), Double.parseDouble(args[3]))); 77 | this.manager.addOperation(player, operation); 78 | } 79 | }); 80 | 81 | return true; 82 | } 83 | } -------------------------------------------------------------------------------- /astraledit-bukkit-plugin/src/main/java/com/github/shynixn/astraledit/bukkit/logic/business/command/AutoFollowCommand.java: -------------------------------------------------------------------------------- 1 | package com.github.shynixn.astraledit.bukkit.logic.business.command; 2 | 3 | import com.github.shynixn.astraledit.api.bukkit.business.command.PlayerCommand; 4 | import com.github.shynixn.astraledit.api.bukkit.business.entity.Selection; 5 | import com.github.shynixn.astraledit.bukkit.AstralEditPlugin; 6 | import com.github.shynixn.astraledit.bukkit.Permission; 7 | import com.github.shynixn.astraledit.bukkit.logic.business.SelectionManager; 8 | import org.bukkit.entity.Player; 9 | import org.bukkit.plugin.Plugin; 10 | 11 | /** 12 | * Created by Shynixn 2018. 13 | *

14 | * Version 1.2 15 | *

16 | * MIT License 17 | *

18 | * Copyright (c) 2018 by Shynixn 19 | *

20 | * Permission is hereby granted, free of charge, to any person obtaining a copy 21 | * of this software and associated documentation files (the "Software"), to deal 22 | * in the Software without restriction, including without limitation the rights 23 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 24 | * copies of the Software, and to permit persons to whom the Software is 25 | * furnished to do so, subject to the following conditions: 26 | *

27 | * The above copyright notice and this permission notice shall be included in all 28 | * copies or substantial portions of the Software. 29 | *

30 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 31 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 32 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 33 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 34 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 35 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 36 | * SOFTWARE. 37 | */ 38 | public class AutoFollowCommand implements PlayerCommand { 39 | private final SelectionManager manager; 40 | 41 | /** 42 | * Creates a new instance of the JoinCommand with SelectionController as dependency. 43 | * 44 | * @param manager dependency. 45 | */ 46 | public AutoFollowCommand(SelectionManager manager) { 47 | this.manager = manager; 48 | } 49 | 50 | /** 51 | * Executes the given command if the arguments match. 52 | * 53 | * @param player executing the command. 54 | * @param args arguments. 55 | * @return True if this command was executed. False if the arguments do not match. 56 | */ 57 | @Override 58 | public boolean onPlayerExecuteCommand(Player player, String[] args) { 59 | if (args.length != 1 || !args[0].equalsIgnoreCase("auto-follow") || !Permission.AUTO_FOLLOW.hasPermission(player)) { 60 | return false; 61 | } 62 | 63 | if (!this.manager.hasSelection(player)) { 64 | player.sendMessage(AstralEditPlugin.PREFIX_ERROR + "You don't have a valid render."); 65 | } else { 66 | final Selection selection = this.manager.getSelection(player); 67 | selection.setAutoFollowEnabled(!selection.isAutoFollowEnabled()); 68 | if (selection.isAutoFollowEnabled()) { 69 | player.sendMessage(AstralEditPlugin.PREFIX_SUCCESS + "Enabled auto-follow."); 70 | } else { 71 | player.sendMessage(AstralEditPlugin.PREFIX_SUCCESS + "Disabled auto-follow."); 72 | } 73 | } 74 | 75 | return true; 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /astraledit-bukkit-plugin/src/main/java/com/github/shynixn/astraledit/bukkit/logic/business/command/AutoRotateCommand.java: -------------------------------------------------------------------------------- 1 | package com.github.shynixn.astraledit.bukkit.logic.business.command; 2 | 3 | import com.github.shynixn.astraledit.api.bukkit.business.command.PlayerCommand; 4 | import com.github.shynixn.astraledit.api.bukkit.business.controller.SelectionController; 5 | import com.github.shynixn.astraledit.api.bukkit.business.entity.Selection; 6 | import com.github.shynixn.astraledit.bukkit.AstralEditPlugin; 7 | import com.github.shynixn.astraledit.bukkit.Permission; 8 | import org.bukkit.entity.Player; 9 | 10 | /** 11 | * Created by Shynixn 2018. 12 | *

13 | * Version 1.2 14 | *

15 | * MIT License 16 | *

17 | * Copyright (c) 2018 by Shynixn 18 | *

19 | * Permission is hereby granted, free of charge, to any person obtaining a copy 20 | * of this software and associated documentation files (the "Software"), to deal 21 | * in the Software without restriction, including without limitation the rights 22 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 23 | * copies of the Software, and to permit persons to whom the Software is 24 | * furnished to do so, subject to the following conditions: 25 | *

26 | * The above copyright notice and this permission notice shall be included in all 27 | * copies or substantial portions of the Software. 28 | *

29 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 30 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 31 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 32 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 33 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 34 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 35 | * SOFTWARE. 36 | */ 37 | public class AutoRotateCommand implements PlayerCommand { 38 | private final SelectionController selectionController; 39 | 40 | /** 41 | * Creates a new instance of the AutoRotateCommand with SelectionController as dependency. 42 | * 43 | * @param selectionController dependency. 44 | */ 45 | public AutoRotateCommand(SelectionController selectionController) { 46 | this.selectionController = selectionController; 47 | } 48 | 49 | /** 50 | * Executes the given command if the arguments match. 51 | * 52 | * @param player executing the command. 53 | * @param args arguments. 54 | * @return True if this command was executed. False if the arguments do not match. 55 | */ 56 | @Override 57 | public boolean onPlayerExecuteCommand(Player player, String[] args) { 58 | if (args.length != 1 || !args[0].equalsIgnoreCase("auto-rotate") || !Permission.AUTO_ROTATE.hasPermission(player)) { 59 | return false; 60 | } 61 | 62 | if (!this.selectionController.hasSelection(player)) { 63 | player.sendMessage(AstralEditPlugin.PREFIX_ERROR + "You don't have a valid render."); 64 | } else { 65 | final Selection selection = this.selectionController.getSelection(player); 66 | selection.setAutoFollowRotateEnabled(!selection.isAutoFollowRotateEnabled()); 67 | if (selection.isAutoFollowRotateEnabled()) { 68 | player.sendMessage(AstralEditPlugin.PREFIX_SUCCESS + "Enabled auto-rotate."); 69 | } else { 70 | player.sendMessage(AstralEditPlugin.PREFIX_SUCCESS + "Disabled auto-rotate."); 71 | } 72 | } 73 | 74 | return true; 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /astraledit-bukkit-plugin/src/main/java/com/github/shynixn/astraledit/bukkit/logic/business/command/ClearCommand.java: -------------------------------------------------------------------------------- 1 | package com.github.shynixn.astraledit.bukkit.logic.business.command; 2 | 3 | import com.github.shynixn.astraledit.api.bukkit.business.command.PlayerCommand; 4 | import com.github.shynixn.astraledit.bukkit.AstralEditPlugin; 5 | import com.github.shynixn.astraledit.bukkit.Permission; 6 | import com.github.shynixn.astraledit.bukkit.logic.business.SelectionManager; 7 | import org.bukkit.entity.Player; 8 | import org.bukkit.plugin.Plugin; 9 | 10 | import java.util.Objects; 11 | 12 | public class ClearCommand implements PlayerCommand { 13 | 14 | private static final String commandName = "clear"; 15 | 16 | private final Plugin plugin; 17 | 18 | private final SelectionManager manager; 19 | 20 | public ClearCommand(Plugin plugin, SelectionManager manager) { 21 | this.plugin = Objects.requireNonNull(plugin); 22 | this.manager = Objects.requireNonNull(manager); 23 | } 24 | 25 | /** 26 | * Clears the rendered object 27 | */ 28 | @Override 29 | public boolean onPlayerExecuteCommand(Player player, String[] args) { 30 | if (args.length == 1 && args[0].equalsIgnoreCase(commandName) && Permission.CLEAR.hasPermission(player)) { 31 | this.plugin.getServer().getScheduler().runTaskAsynchronously(this.plugin, () -> { 32 | if (!this.manager.hasSelection(player)) { 33 | player.sendMessage(AstralEditPlugin.PREFIX_ERROR + "You don't have a valid render."); 34 | } else { 35 | player.sendMessage(AstralEditPlugin.PREFIX_SUCCESS + "Destroying render ..."); 36 | this.manager.clearSelection(player); 37 | player.sendMessage(AstralEditPlugin.PREFIX_SUCCESS + "Finished destroying render."); 38 | } 39 | }); 40 | return true; 41 | } 42 | return false; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /astraledit-bukkit-plugin/src/main/java/com/github/shynixn/astraledit/bukkit/logic/business/command/ConvertToBlocksCommand.java: -------------------------------------------------------------------------------- 1 | package com.github.shynixn.astraledit.bukkit.logic.business.command; 2 | 3 | import com.github.shynixn.astraledit.api.bukkit.business.command.PlayerCommand; 4 | import com.github.shynixn.astraledit.bukkit.AstralEditPlugin; 5 | import com.github.shynixn.astraledit.bukkit.Permission; 6 | import com.github.shynixn.astraledit.bukkit.logic.business.Operation; 7 | import com.github.shynixn.astraledit.bukkit.logic.business.OperationType; 8 | import com.github.shynixn.astraledit.bukkit.logic.business.SelectionHolder; 9 | import com.github.shynixn.astraledit.bukkit.logic.business.SelectionManager; 10 | import org.bukkit.entity.Player; 11 | import org.bukkit.plugin.Plugin; 12 | 13 | public class ConvertToBlocksCommand implements PlayerCommand { 14 | private static final String commandName = "convertToBlocks"; 15 | private final SelectionManager selectionManager; 16 | private final Plugin plugin; 17 | 18 | /** 19 | * Creates a new instance of ConvertToBlocksCommand with SelectionManager and Plugin as dependency. 20 | * 21 | * @param selectionManager selectionManager. 22 | * @param plugin plugin 23 | */ 24 | public ConvertToBlocksCommand(SelectionManager selectionManager, Plugin plugin){ 25 | this.selectionManager = selectionManager; 26 | this.plugin = plugin; 27 | } 28 | 29 | /** 30 | * Executes the given command if the arguments match. 31 | * 32 | * @param player executing the command. 33 | * @param args arguments. 34 | * @return True if this command was executed. False if the arguments do not match. 35 | */ 36 | @Override 37 | public boolean onPlayerExecuteCommand(Player player, String[] args) { 38 | if (args.length == 1 && args[0].equalsIgnoreCase(commandName) && Permission.CONVERT_TO_BLOCKS.hasPermission(player)) { 39 | this.convertToBlocksCommand(player); 40 | return true; 41 | } 42 | 43 | return false; 44 | } 45 | 46 | /** 47 | * Converts the blocks to a rendered object 48 | * 49 | * @param player player 50 | */ 51 | private void convertToBlocksCommand(Player player) { 52 | this.plugin.getServer().getScheduler().runTaskAsynchronously(this.plugin, () -> { 53 | if (!this.selectionManager.hasSelection(player)) { 54 | player.sendMessage(AstralEditPlugin.PREFIX_ERROR + "You don't have a valid render."); 55 | } else { 56 | player.sendMessage(AstralEditPlugin.PREFIX_SUCCESS + "Converting render ..."); 57 | final Operation operation = new Operation(OperationType.PLACE); 58 | operation.setOperationData(((SelectionHolder) this.selectionManager.getSelection(player)).getTemporaryStorage()); 59 | this.selectionManager.getSelection(player).placeBlocks(() -> { 60 | this.selectionManager.clearSelection(player); 61 | this.selectionManager.addOperation(player, operation); 62 | player.sendMessage(AstralEditPlugin.PREFIX_SUCCESS + "Finished converting render."); 63 | }); 64 | } 65 | }); 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /astraledit-bukkit-plugin/src/main/java/com/github/shynixn/astraledit/bukkit/logic/business/command/ConvertToRenderCommand.java: -------------------------------------------------------------------------------- 1 | package com.github.shynixn.astraledit.bukkit.logic.business.command; 2 | 3 | import com.github.shynixn.astraledit.api.bukkit.AstralEditApi; 4 | import com.github.shynixn.astraledit.api.bukkit.business.command.PlayerCommand; 5 | import com.github.shynixn.astraledit.bukkit.AstralEditPlugin; 6 | import com.github.shynixn.astraledit.bukkit.Permission; 7 | import org.bukkit.entity.Player; 8 | import org.bukkit.plugin.Plugin; 9 | 10 | public class ConvertToRenderCommand implements PlayerCommand { 11 | private final Plugin plugin; 12 | private static final String commandName = "convertToRender"; 13 | 14 | /** 15 | * Creates a new instance of ConvertToRenderCommand which depends on a Plugin 16 | * 17 | * @param plugin The plugin. 18 | */ 19 | public ConvertToRenderCommand(Plugin plugin){ this.plugin = plugin; } 20 | 21 | /** 22 | * Executes the given command if the arguments match. 23 | * 24 | * @param player executing the command. 25 | * @param args arguments. 26 | * @return True if this command was executed. False if the arguments do not match. 27 | */ 28 | @Override 29 | public boolean onPlayerExecuteCommand(Player player, String[] args) { 30 | if (args.length == 1 && args[0].equalsIgnoreCase(commandName) && Permission.CONVERT_TO_RENDER.hasPermission(player)){ 31 | this.convertToRenderCommand(player); 32 | return true; 33 | } 34 | return false; 35 | } 36 | 37 | /** 38 | * Converts a rendered object to blocks 39 | * 40 | * @param player player 41 | */ 42 | private void convertToRenderCommand(final Player player) { 43 | this.plugin.getServer().getScheduler().runTaskAsynchronously(this.plugin, () -> { 44 | try { 45 | player.sendMessage(AstralEditPlugin.PREFIX_SUCCESS + "Removing blocks and rendering selection asynchronously..."); 46 | this.plugin.getServer().getScheduler().runTaskAsynchronously(this.plugin, () -> { 47 | AstralEditApi.INSTANCE.renderAndDestroy(player); 48 | player.sendMessage(AstralEditPlugin.PREFIX_SUCCESS + "Finished converting selection."); 49 | }); 50 | } catch (final Exception e) { 51 | player.sendMessage(AstralEditPlugin.PREFIX_ERROR + "Failed converting WE selection!"); 52 | player.sendMessage(AstralEditPlugin.PREFIX_ERROR + "Check if you selected an area with Worldedit."); 53 | } 54 | }); 55 | } 56 | 57 | } 58 | -------------------------------------------------------------------------------- /astraledit-bukkit-plugin/src/main/java/com/github/shynixn/astraledit/bukkit/logic/business/command/FlipCommand.java: -------------------------------------------------------------------------------- 1 | package com.github.shynixn.astraledit.bukkit.logic.business.command; 2 | 3 | import com.github.shynixn.astraledit.api.bukkit.business.command.PlayerCommand; 4 | import com.github.shynixn.astraledit.api.bukkit.business.entity.Selection; 5 | import com.github.shynixn.astraledit.bukkit.AstralEditPlugin; 6 | import com.github.shynixn.astraledit.bukkit.Permission; 7 | import com.github.shynixn.astraledit.bukkit.logic.business.Operation; 8 | import com.github.shynixn.astraledit.bukkit.logic.business.OperationType; 9 | import com.github.shynixn.astraledit.bukkit.logic.business.SelectionManager; 10 | import org.bukkit.entity.Player; 11 | import org.bukkit.plugin.Plugin; 12 | 13 | public class FlipCommand implements PlayerCommand { 14 | private final Plugin plugin; 15 | private final SelectionManager manager; 16 | 17 | /** 18 | * The Command flips the current selection depending on the Plugin and SelectionManager. 19 | * 20 | * @param plugin the Plugin 21 | * @param manager the current SelectionManager 22 | */ 23 | public FlipCommand(Plugin plugin, SelectionManager manager) { 24 | this.plugin = plugin; 25 | this.manager = manager; 26 | } 27 | 28 | /** 29 | * Executes the given command if the arguments match. 30 | * 31 | * @param player executing the command. 32 | * @param args arguments. 33 | * @return Boolean - Whether the arguments and permissions are valid and the command successfully gets executed. 34 | */ 35 | @Override 36 | public boolean onPlayerExecuteCommand(Player player, String[] args) { 37 | if (args.length != 1 || !args[0].equalsIgnoreCase("flip") || !Permission.FLIP.hasPermission(player)) { 38 | return false; 39 | } 40 | 41 | this.plugin.getServer().getScheduler().runTaskAsynchronously(this.plugin, () -> { 42 | final Selection selection = this.manager.getSelection(player); 43 | if (selection == null) { 44 | player.sendMessage(AstralEditPlugin.PREFIX_ERROR + "You don't have a valid render."); 45 | } else { 46 | selection.flip(); 47 | this.manager.addOperation(player, new Operation(OperationType.FLIP)); 48 | } 49 | }); 50 | 51 | return true; 52 | } 53 | 54 | } 55 | -------------------------------------------------------------------------------- /astraledit-bukkit-plugin/src/main/java/com/github/shynixn/astraledit/bukkit/logic/business/command/HideCommand.java: -------------------------------------------------------------------------------- 1 | package com.github.shynixn.astraledit.bukkit.logic.business.command; 2 | 3 | import com.github.shynixn.astraledit.api.bukkit.business.command.PlayerCommand; 4 | import com.github.shynixn.astraledit.bukkit.AstralEditPlugin; 5 | import com.github.shynixn.astraledit.bukkit.Permission; 6 | import com.github.shynixn.astraledit.bukkit.logic.business.SelectionManager; 7 | import com.github.shynixn.astraledit.bukkit.logic.lib.Utils; 8 | import org.bukkit.entity.Player; 9 | import org.bukkit.plugin.Plugin; 10 | 11 | /** 12 | * Created by Shynixn 2018. 13 | *

14 | * Version 1.2 15 | *

16 | * MIT License 17 | *

18 | * Copyright (c) 2018 by Shynixn 19 | *

20 | * Permission is hereby granted, free of charge, to any person obtaining a copy 21 | * of this software and associated documentation files (the "Software"), to deal 22 | * in the Software without restriction, including without limitation the rights 23 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 24 | * copies of the Software, and to permit persons to whom the Software is 25 | * furnished to do so, subject to the following conditions: 26 | *

27 | * The above copyright notice and this permission notice shall be included in all 28 | * copies or substantial portions of the Software. 29 | *

30 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 31 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 32 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 33 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 34 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 35 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 36 | * SOFTWARE. 37 | */ 38 | public class HideCommand implements PlayerCommand { 39 | private final Plugin plugin; 40 | private final SelectionManager manager; 41 | 42 | /** 43 | * Creates an instance of {@link HideCommand} which depends on 44 | * a {@link SelectionManager} and a {@link Plugin} 45 | * 46 | * @param manager SelectionManager 47 | */ 48 | public HideCommand(SelectionManager manager, Plugin plugin) { 49 | this.manager = manager; 50 | this.plugin = plugin; 51 | } 52 | 53 | /** 54 | * Executes the given command if the arguments match. 55 | * 56 | * @param player executing the command. 57 | * @param args arguments. 58 | * @return True if this command was executed. False if the arguments do not match. 59 | */ 60 | @Override 61 | public boolean onPlayerExecuteCommand(Player player, String[] args) { 62 | if (args.length != 1 || !args[0].equalsIgnoreCase("hide") || !Permission.HIDE_OTHER.hasPermission(player)) { 63 | return false; 64 | } else { 65 | this.plugin.getServer().getScheduler().runTaskAsynchronously(this.plugin, () -> { 66 | if (!this.manager.hasSelection(player)) { 67 | player.sendMessage(AstralEditPlugin.PREFIX_ERROR + "You don't have a valid render."); 68 | } else { 69 | if (!this.manager.getSelection(player).isHidden()) { 70 | this.manager.getSelection(player).hide(Utils.getOnlinePlayers().toArray(new Player[Utils.getOnlinePlayers().size()])); 71 | player.sendMessage(AstralEditPlugin.PREFIX_SUCCESS + "Your render is now invisible to other players."); 72 | } 73 | } 74 | }); 75 | 76 | return true; 77 | } 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /astraledit-bukkit-plugin/src/main/java/com/github/shynixn/astraledit/bukkit/logic/business/command/JoinCommand.java: -------------------------------------------------------------------------------- 1 | package com.github.shynixn.astraledit.bukkit.logic.business.command; 2 | 3 | import com.github.shynixn.astraledit.api.bukkit.business.command.PlayerCommand; 4 | import com.github.shynixn.astraledit.bukkit.AstralEditPlugin; 5 | import com.github.shynixn.astraledit.bukkit.Permission; 6 | import com.github.shynixn.astraledit.bukkit.logic.business.Operation; 7 | import com.github.shynixn.astraledit.bukkit.logic.business.OperationType; 8 | import com.github.shynixn.astraledit.bukkit.logic.business.SelectionManager; 9 | import org.bukkit.entity.Player; 10 | import org.bukkit.plugin.Plugin; 11 | 12 | /** 13 | * Created by Shynixn 2018. 14 | *

15 | * Version 1.2 16 | *

17 | * MIT License 18 | *

19 | * Copyright (c) 2018 by Shynixn 20 | *

21 | * Permission is hereby granted, free of charge, to any person obtaining a copy 22 | * of this software and associated documentation files (the "Software"), to deal 23 | * in the Software without restriction, including without limitation the rights 24 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 25 | * copies of the Software, and to permit persons to whom the Software is 26 | * furnished to do so, subject to the following conditions: 27 | *

28 | * The above copyright notice and this permission notice shall be included in all 29 | * copies or substantial portions of the Software. 30 | *

31 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 32 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 33 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 34 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 35 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 36 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 37 | * SOFTWARE. 38 | */ 39 | public class JoinCommand implements PlayerCommand { 40 | private final SelectionManager manager; 41 | private final Plugin plugin; 42 | 43 | /** 44 | * Creates a new instance of the JoinCommand with SelectionController as dependency. 45 | * 46 | * @param manager dependency. 47 | */ 48 | public JoinCommand(SelectionManager manager, Plugin plugin) { 49 | this.manager = manager; 50 | this.plugin = plugin; 51 | } 52 | 53 | /** 54 | * Executes the given command if the arguments match. 55 | * 56 | * @param player executing the command. 57 | * @param args arguments. 58 | * @return True if this command was executed. False if the arguments do not match. 59 | */ 60 | @Override 61 | public boolean onPlayerExecuteCommand(Player player, String[] args) { 62 | if (args.length != 1 || !args[0].equalsIgnoreCase("join") || !Permission.JOIN.hasPermission(player)) { 63 | return false; 64 | } 65 | 66 | this.plugin.getServer().getScheduler().runTaskAsynchronously(this.plugin, () -> { 67 | if (!this.manager.hasSelection(player)) { 68 | player.sendMessage(AstralEditPlugin.PREFIX_ERROR + "You don't have a valid render."); 69 | } else if (!this.manager.getSelection(player).isJoined()) { 70 | this.manager.getSelection(player).join(); 71 | this.manager.addOperation(player, new Operation(OperationType.COMBINE)); 72 | } 73 | }); 74 | 75 | return true; 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /astraledit-bukkit-plugin/src/main/java/com/github/shynixn/astraledit/bukkit/logic/business/command/MirrorCommand.java: -------------------------------------------------------------------------------- 1 | package com.github.shynixn.astraledit.bukkit.logic.business.command; 2 | 3 | import com.github.shynixn.astraledit.api.bukkit.business.command.PlayerCommand; 4 | import com.github.shynixn.astraledit.bukkit.AstralEditPlugin; 5 | import com.github.shynixn.astraledit.bukkit.Permission; 6 | import com.github.shynixn.astraledit.bukkit.logic.business.Operation; 7 | import com.github.shynixn.astraledit.bukkit.logic.business.OperationType; 8 | import com.github.shynixn.astraledit.bukkit.logic.business.SelectionManager; 9 | import org.bukkit.entity.Player; 10 | import org.bukkit.plugin.Plugin; 11 | 12 | import java.util.Objects; 13 | 14 | public class MirrorCommand implements PlayerCommand { 15 | 16 | private static final String commandName = "mirror"; 17 | 18 | private final Plugin plugin; 19 | 20 | private final SelectionManager selectionManager; 21 | 22 | public MirrorCommand(Plugin plugin, SelectionManager selectionManager) { 23 | this.plugin = Objects.requireNonNull(plugin); 24 | this.selectionManager = Objects.requireNonNull(selectionManager); 25 | } 26 | 27 | /** 28 | * Mirrors the given selection 29 | * 30 | * @param player executing the command. 31 | * @param args arguments. 32 | */ 33 | @Override 34 | public boolean onPlayerExecuteCommand(Player player, String[] args) { 35 | if (args.length == 1 && args[0].equalsIgnoreCase(commandName) && Permission.MIRROR.hasPermission(player)) { 36 | this.plugin.getServer().getScheduler().runTaskAsynchronously(plugin, () -> { 37 | if (!this.selectionManager.hasSelection(player)) { 38 | player.sendMessage(AstralEditPlugin.PREFIX_ERROR + "You don't have a valid render."); 39 | } else { 40 | this.selectionManager.getSelection(player).mirror(); 41 | this.selectionManager.addOperation(player, new Operation(OperationType.MIRROR)); 42 | } 43 | }); 44 | return true; 45 | } else { 46 | return false; 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /astraledit-bukkit-plugin/src/main/java/com/github/shynixn/astraledit/bukkit/logic/business/command/MoveCommand.java: -------------------------------------------------------------------------------- 1 | package com.github.shynixn.astraledit.bukkit.logic.business.command; 2 | 3 | import com.github.shynixn.astraledit.api.bukkit.business.command.PlayerCommand; 4 | import com.github.shynixn.astraledit.bukkit.AstralEditPlugin; 5 | import com.github.shynixn.astraledit.bukkit.Permission; 6 | import com.github.shynixn.astraledit.bukkit.logic.business.Operation; 7 | import com.github.shynixn.astraledit.bukkit.logic.business.OperationType; 8 | import com.github.shynixn.astraledit.bukkit.logic.business.SelectionManager; 9 | import org.bukkit.Location; 10 | import org.bukkit.entity.Player; 11 | import org.bukkit.plugin.Plugin; 12 | 13 | import static com.github.shynixn.astraledit.bukkit.logic.lib.Utils.tryParseDouble; 14 | 15 | public class MoveCommand implements PlayerCommand { 16 | private final SelectionManager selectionManager; 17 | private final Plugin plugin; 18 | 19 | /** 20 | * Creates a new instance of MoveCommand with SelectionManager as dependency. 21 | * 22 | * @param selectionManager selectionManager. 23 | */ 24 | public MoveCommand(SelectionManager selectionManager, Plugin plugin) { 25 | this.selectionManager = selectionManager; 26 | this.plugin = plugin; 27 | } 28 | 29 | /** 30 | * Executes the given command if the arguments match. 31 | * 32 | * @param player executing the command. 33 | * @param args arguments. 34 | * @return True if this command was executed. False if the arguments do not match. 35 | */ 36 | @Override 37 | public boolean onPlayerExecuteCommand(Player player, String[] args) { 38 | if (args.length == 1 && args[0].equalsIgnoreCase("move") && Permission.MOVE_PLAYER.hasPermission(player)) { 39 | this.moveRenderCommand(player, player.getLocation().clone().add(0, -2, 0)); 40 | return true; 41 | } else if (args.length == 4 && args[0].equalsIgnoreCase("move") && tryParseDouble(args[1]) && tryParseDouble(args[2]) && tryParseDouble(args[3]) && Permission.MOVE_COORDINATE.hasPermission(player)) { 42 | this.moveRenderCommand(player, new Location(player.getWorld(), Double.parseDouble(args[1]), Double.parseDouble(args[2]), Double.parseDouble(args[3]))); 43 | return true; 44 | } 45 | 46 | return false; 47 | } 48 | 49 | /** 50 | * Moves the rendered Object to the given coordinates. 51 | * 52 | * @param player player 53 | * @param location location. 54 | */ 55 | private void moveRenderCommand(Player player, Location location) { 56 | this.plugin.getServer().getScheduler().runTaskAsynchronously(this.plugin, () -> { 57 | if (!this.selectionManager.hasSelection(player)) { 58 | player.sendMessage(AstralEditPlugin.PREFIX_ERROR + "You don't have a valid render."); 59 | } else { 60 | final Operation operation = new Operation(OperationType.MOVE); 61 | operation.setOperationData(this.selectionManager.getSelection(player).getLocation().clone()); 62 | this.selectionManager.getSelection(player).move(location); 63 | this.selectionManager.addOperation(player, operation); 64 | } 65 | }); 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /astraledit-bukkit-plugin/src/main/java/com/github/shynixn/astraledit/bukkit/logic/business/command/PlaceCommand.java: -------------------------------------------------------------------------------- 1 | package com.github.shynixn.astraledit.bukkit.logic.business.command; 2 | 3 | import com.github.shynixn.astraledit.api.bukkit.business.command.PlayerCommand; 4 | import com.github.shynixn.astraledit.api.bukkit.business.entity.Selection; 5 | import com.github.shynixn.astraledit.bukkit.AstralEditPlugin; 6 | import com.github.shynixn.astraledit.bukkit.Permission; 7 | import com.github.shynixn.astraledit.bukkit.logic.business.Operation; 8 | import com.github.shynixn.astraledit.bukkit.logic.business.OperationType; 9 | import com.github.shynixn.astraledit.bukkit.logic.business.SelectionHolder; 10 | import com.github.shynixn.astraledit.bukkit.logic.business.SelectionManager; 11 | import org.bukkit.entity.Player; 12 | import org.bukkit.plugin.Plugin; 13 | 14 | public class PlaceCommand implements PlayerCommand { 15 | private final Plugin plugin; 16 | private final SelectionManager manager; 17 | 18 | /** 19 | * Creates a new instance of the PlaceCommand which depends on a Plugin and a SelectionManager. 20 | * 21 | * @param plugin the Plugin 22 | * @param manager the SelectionManager 23 | */ 24 | public PlaceCommand(Plugin plugin, SelectionManager manager) { 25 | this.plugin = plugin; 26 | this.manager = manager; 27 | } 28 | 29 | /** 30 | * Executes the PlaceCommand, if the arguments match and the Player has a valid ({@link Permission#PLACE}) Permission. 31 | * 32 | * @param player executing the command. 33 | * @param args arguments. 34 | * @return True if this command was executed. False if the arguments do not match. 35 | */ 36 | @Override 37 | public boolean onPlayerExecuteCommand(Player player, String[] args) { 38 | if (args.length != 1 || !args[0].equalsIgnoreCase("place") || !Permission.PLACE.hasPermission(player)) { 39 | return false; 40 | } 41 | 42 | this.plugin.getServer().getScheduler().runTaskAsynchronously(this.plugin, () -> { 43 | final Selection selection = this.manager.getSelection(player); 44 | if (selection == null) { 45 | player.sendMessage(AstralEditPlugin.PREFIX_ERROR + "You don't have a valid render."); 46 | } else { 47 | player.sendMessage(AstralEditPlugin.PREFIX_SUCCESS + "Placing render ..."); 48 | final Operation operation = new Operation(OperationType.PLACE); 49 | operation.setOperationData(((SelectionHolder) selection).getTemporaryStorage()); 50 | selection.placeBlocks(() -> { 51 | this.manager.addOperation(player, operation); 52 | player.sendMessage(AstralEditPlugin.PREFIX_SUCCESS + "Finished placing render."); 53 | }); 54 | } 55 | }); 56 | 57 | return true; 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /astraledit-bukkit-plugin/src/main/java/com/github/shynixn/astraledit/bukkit/logic/business/command/RenderCommand.java: -------------------------------------------------------------------------------- 1 | package com.github.shynixn.astraledit.bukkit.logic.business.command; 2 | 3 | import com.github.shynixn.astraledit.api.bukkit.AstralEditApi; 4 | import com.github.shynixn.astraledit.api.bukkit.business.command.PlayerCommand; 5 | import com.github.shynixn.astraledit.api.bukkit.business.entity.Selection; 6 | import com.github.shynixn.astraledit.bukkit.AstralEditPlugin; 7 | import com.github.shynixn.astraledit.bukkit.Permission; 8 | import org.bukkit.entity.Player; 9 | import org.bukkit.plugin.Plugin; 10 | 11 | public class RenderCommand implements PlayerCommand { 12 | private final Plugin plugin; 13 | 14 | /** 15 | * Creates an instance of RenderCommand which depends on a Plugin 16 | * 17 | * @param plugin the Plugin 18 | */ 19 | public RenderCommand(Plugin plugin) { 20 | this.plugin = plugin; 21 | } 22 | 23 | /** 24 | * Executes the given command if the arguments match. 25 | * 26 | * @param player executing the command. 27 | * @param args arguments. 28 | * @return True if this command was executed. False if the arguments do not match. 29 | */ 30 | @Override 31 | public boolean onPlayerExecuteCommand(Player player, String[] args) { 32 | if (args.length != 1 || !args[0].equalsIgnoreCase("render") || !Permission.RENDER.hasPermission(player)) { 33 | return false; 34 | } else { 35 | this.plugin.getServer().getScheduler().runTaskAsynchronously(this.plugin, () -> { 36 | player.sendMessage(AstralEditPlugin.PREFIX_SUCCESS + "Rendering WorldEdit-Selection asynchronously..."); 37 | final Selection selection = AstralEditApi.INSTANCE.render(player); 38 | if (selection == null) { 39 | player.sendMessage(AstralEditPlugin.PREFIX_ERROR + "Failed rendering WE selection!"); 40 | player.sendMessage(AstralEditPlugin.PREFIX_ERROR + "Check if you selected an area with Worldedit."); 41 | } else { 42 | player.sendMessage(AstralEditPlugin.PREFIX_SUCCESS + "Finished rendering selection."); 43 | } 44 | }); 45 | return true; 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /astraledit-bukkit-plugin/src/main/java/com/github/shynixn/astraledit/bukkit/logic/business/command/RotateCommand.java: -------------------------------------------------------------------------------- 1 | package com.github.shynixn.astraledit.bukkit.logic.business.command; 2 | 3 | import com.github.shynixn.astraledit.api.bukkit.business.command.PlayerCommand; 4 | import com.github.shynixn.astraledit.bukkit.AstralEditPlugin; 5 | import com.github.shynixn.astraledit.bukkit.Permission; 6 | import com.github.shynixn.astraledit.bukkit.logic.business.Operation; 7 | import com.github.shynixn.astraledit.bukkit.logic.business.OperationType; 8 | import com.github.shynixn.astraledit.bukkit.logic.business.SelectionManager; 9 | import org.bukkit.entity.Player; 10 | import org.bukkit.plugin.Plugin; 11 | 12 | import java.util.Objects; 13 | 14 | import static com.github.shynixn.astraledit.bukkit.logic.lib.Utils.tryParseDouble; 15 | 16 | 17 | public class RotateCommand implements PlayerCommand { 18 | 19 | private static final String commandName = "rotate"; 20 | 21 | private final Plugin plugin; 22 | 23 | private final SelectionManager manager; 24 | 25 | /** 26 | * Creates an instance of {@link RotateCommand} which depends on 27 | * a {@link SelectionManager} and a {@link Plugin} 28 | * 29 | * @param manager Selection Manager 30 | * @param plugin 31 | */ 32 | public RotateCommand(SelectionManager manager, Plugin plugin) { 33 | this.plugin = Objects.requireNonNull(plugin); 34 | this.manager = Objects.requireNonNull(manager); 35 | } 36 | 37 | /** 38 | * Rotates the selection for the given angle 39 | * 40 | * @param player executing the command. 41 | * @param args arguments. 42 | * @return True if this command was executed. False if the arguments do not match 43 | */ 44 | @Override 45 | public boolean onPlayerExecuteCommand(Player player, String[] args) { 46 | if (args.length == 2 && args[0].equalsIgnoreCase("rotate") && tryParseDouble(args[1]) && Permission.ROTATE.hasPermission(player)) { 47 | this.plugin.getServer().getScheduler().runTaskAsynchronously(this.plugin, () -> { 48 | if (!this.manager.hasSelection(player)) { 49 | player.sendMessage(AstralEditPlugin.PREFIX_ERROR + "You don't have a valid render."); 50 | } else { 51 | final Operation operation = new Operation(OperationType.ROTATE); 52 | operation.setOperationData(this.manager.getSelection(player).getRotation()); 53 | this.manager.getSelection(player).rotate(Double.parseDouble(args[1])); 54 | this.manager.addOperation(player, operation); 55 | } 56 | }); 57 | return true; 58 | } 59 | return false; 60 | } 61 | } -------------------------------------------------------------------------------- /astraledit-bukkit-plugin/src/main/java/com/github/shynixn/astraledit/bukkit/logic/business/command/ShowCommand.java: -------------------------------------------------------------------------------- 1 | package com.github.shynixn.astraledit.bukkit.logic.business.command; 2 | 3 | import com.github.shynixn.astraledit.api.bukkit.business.command.PlayerCommand; 4 | import com.github.shynixn.astraledit.bukkit.AstralEditPlugin; 5 | import com.github.shynixn.astraledit.bukkit.Permission; 6 | import com.github.shynixn.astraledit.bukkit.logic.business.SelectionManager; 7 | import com.github.shynixn.astraledit.bukkit.logic.lib.Utils; 8 | import org.bukkit.entity.Player; 9 | import org.bukkit.plugin.Plugin; 10 | 11 | /** 12 | * Created by Shynixn 2018. 13 | *

14 | * Version 1.2 15 | *

16 | * MIT License 17 | *

18 | * Copyright (c) 2018 by Shynixn 19 | *

20 | * Permission is hereby granted, free of charge, to any person obtaining a copy 21 | * of this software and associated documentation files (the "Software"), to deal 22 | * in the Software without restriction, including without limitation the rights 23 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 24 | * copies of the Software, and to permit persons to whom the Software is 25 | * furnished to do so, subject to the following conditions: 26 | *

27 | * The above copyright notice and this permission notice shall be included in all 28 | * copies or substantial portions of the Software. 29 | *

30 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 31 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 32 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 33 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 34 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 35 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 36 | * SOFTWARE. 37 | */ 38 | public class ShowCommand implements PlayerCommand { 39 | private final Plugin plugin; 40 | private final SelectionManager manager; 41 | 42 | /** 43 | * Creates an instance of {@link ShowCommand} which depends on 44 | * a {@link SelectionManager} and a {@link Plugin} 45 | * 46 | * @param manager SelectionManager 47 | */ 48 | public ShowCommand(SelectionManager manager, Plugin plugin) { 49 | this.manager = manager; 50 | this.plugin = plugin; 51 | } 52 | 53 | /** 54 | * Executes the given command if the arguments match. 55 | * 56 | * @param player executing the command. 57 | * @param args arguments. 58 | * @return True if this command was executed. False if the arguments do not match. 59 | */ 60 | @Override 61 | public boolean onPlayerExecuteCommand(Player player, String[] args) { 62 | if (args.length != 1 || !args[0].equalsIgnoreCase("show") || !Permission.SHOW_OTHER.hasPermission(player)) { 63 | return false; 64 | } else { 65 | this.plugin.getServer().getScheduler().runTaskAsynchronously(this.plugin, () -> { 66 | if (!this.manager.hasSelection(player)) { 67 | player.sendMessage(AstralEditPlugin.PREFIX_ERROR + "You don't have a valid render."); 68 | } else { 69 | if (this.manager.getSelection(player).isHidden()) { 70 | this.manager.getSelection(player).show(Utils.getOnlinePlayers().toArray(new Player[Utils.getOnlinePlayers().size()])); 71 | player.sendMessage(AstralEditPlugin.PREFIX_SUCCESS + "Your render is now visible to other players."); 72 | } 73 | } 74 | }); 75 | return true; 76 | } 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /astraledit-bukkit-plugin/src/main/java/com/github/shynixn/astraledit/bukkit/logic/business/command/TearCommand.java: -------------------------------------------------------------------------------- 1 | package com.github.shynixn.astraledit.bukkit.logic.business.command; 2 | 3 | import com.github.shynixn.astraledit.api.bukkit.business.command.PlayerCommand; 4 | import com.github.shynixn.astraledit.bukkit.AstralEditPlugin; 5 | import com.github.shynixn.astraledit.bukkit.Permission; 6 | import com.github.shynixn.astraledit.bukkit.logic.business.Operation; 7 | import com.github.shynixn.astraledit.bukkit.logic.business.OperationType; 8 | import com.github.shynixn.astraledit.bukkit.logic.business.SelectionManager; 9 | import org.bukkit.entity.Player; 10 | import org.bukkit.plugin.Plugin; 11 | 12 | public class TearCommand implements PlayerCommand { 13 | private final Plugin plugin; 14 | private final SelectionManager manager; 15 | 16 | /** 17 | * Creates an instance of TearCommand which depends on 18 | * a SelectionManager and a Plugin 19 | * 20 | * @param manager SelectionManager 21 | * @param plugin Plugin 22 | */ 23 | public TearCommand(SelectionManager manager, Plugin plugin) { 24 | this.manager = manager; 25 | this.plugin = plugin; 26 | } 27 | 28 | /** 29 | * Executes the given command if the arguments match. 30 | * 31 | * @param player executing the command. 32 | * @param args arguments. 33 | * @return True if this command was executed. False if the arguments do not match. 34 | */ 35 | @Override 36 | public boolean onPlayerExecuteCommand(Player player, String[] args) { 37 | if (args.length != 1 || !args[0].equalsIgnoreCase("tear") || !Permission.TEAR.hasPermission(player)) { 38 | return false; 39 | } else { 40 | this.plugin.getServer().getScheduler().runTaskAsynchronously(this.plugin, () -> { 41 | if (!this.manager.hasSelection(player)) { 42 | player.sendMessage(AstralEditPlugin.PREFIX_ERROR + "You don't have a valid render."); 43 | } else if (this.manager.getSelection(player).isJoined()) { 44 | this.manager.getSelection(player).tearApart(); 45 | this.manager.addOperation(player, new Operation(OperationType.UNCOMBINE)); 46 | } 47 | }); 48 | return true; 49 | } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /astraledit-bukkit-plugin/src/main/java/com/github/shynixn/astraledit/bukkit/logic/business/command/TeleportCommand.java: -------------------------------------------------------------------------------- 1 | package com.github.shynixn.astraledit.bukkit.logic.business.command; 2 | 3 | import com.github.shynixn.astraledit.api.bukkit.business.command.PlayerCommand; 4 | import com.github.shynixn.astraledit.bukkit.AstralEditPlugin; 5 | import com.github.shynixn.astraledit.bukkit.Permission; 6 | import com.github.shynixn.astraledit.bukkit.logic.business.SelectionManager; 7 | import org.bukkit.entity.Player; 8 | 9 | public class TeleportCommand implements PlayerCommand { 10 | private static final String commandName = "teleport"; 11 | private final SelectionManager selectionManager; 12 | 13 | /** 14 | * Creates an instance of TearCommand which depends on 15 | * a SelectionManager 16 | * 17 | * @param selectionManager SelectionManager 18 | */ 19 | public TeleportCommand(SelectionManager selectionManager){ 20 | this.selectionManager = selectionManager; 21 | } 22 | 23 | /** 24 | * Executes the given command if the arguments match. 25 | * 26 | * @param player executing the command. 27 | * @param args arguments. 28 | * @return True if this command was executed. False if the arguments do not match. 29 | */ 30 | @Override 31 | public boolean onPlayerExecuteCommand(Player player, String[] args) { 32 | if (args.length == 1 && args[0].equalsIgnoreCase(commandName) && Permission.TELEPORT_PLAYER.hasPermission(player)){ 33 | this.teleportPlayerToRenderCommand(player); 34 | return true; 35 | } 36 | return false; 37 | } 38 | 39 | /** 40 | * Teleports the given player to the selection 41 | * 42 | * @param player player 43 | */ 44 | private void teleportPlayerToRenderCommand(Player player) { 45 | if (!this.selectionManager.hasSelection(player)) { 46 | player.sendMessage(AstralEditPlugin.PREFIX_ERROR + "You don't have a valid render."); 47 | } else { 48 | player.teleport(this.selectionManager.getSelection(player).getLocation()); 49 | } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /astraledit-bukkit-plugin/src/main/java/com/github/shynixn/astraledit/bukkit/logic/business/command/UndoCommand.java: -------------------------------------------------------------------------------- 1 | package com.github.shynixn.astraledit.bukkit.logic.business.command; 2 | 3 | import com.github.shynixn.astraledit.api.bukkit.business.command.PlayerCommand; 4 | import com.github.shynixn.astraledit.bukkit.AstralEditPlugin; 5 | import com.github.shynixn.astraledit.bukkit.Permission; 6 | import com.github.shynixn.astraledit.bukkit.logic.business.SelectionManager; 7 | import org.bukkit.entity.Player; 8 | import org.bukkit.plugin.Plugin; 9 | 10 | /** 11 | * Created by Shynixn 2018. 12 | *

13 | * Version 1.2 14 | *

15 | * MIT License 16 | *

17 | * Copyright (c) 2018 by Shynixn 18 | *

19 | * Permission is hereby granted, free of charge, to any person obtaining a copy 20 | * of this software and associated documentation files (the "Software"), to deal 21 | * in the Software without restriction, including without limitation the rights 22 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 23 | * copies of the Software, and to permit persons to whom the Software is 24 | * furnished to do so, subject to the following conditions: 25 | *

26 | * The above copyright notice and this permission notice shall be included in all 27 | * copies or substantial portions of the Software. 28 | *

29 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 30 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 31 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 32 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 33 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 34 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 35 | * SOFTWARE. 36 | */ 37 | public class UndoCommand implements PlayerCommand { 38 | private final Plugin plugin; 39 | private final SelectionManager manager; 40 | /** 41 | * Creates an instance of {@link UndoCommand} which depends on 42 | * a {@link SelectionManager} and a {@link Plugin} 43 | * 44 | * @param manager SelectionManager 45 | */ 46 | public UndoCommand(SelectionManager manager, Plugin plugin) { 47 | this.manager = manager; 48 | this.plugin = plugin; 49 | } 50 | /** 51 | * Executes the given command if the arguments match. 52 | * 53 | * @param player executing the command. 54 | * @param args arguments. 55 | * @return True if this command was executed. False if the arguments do not match. 56 | */ 57 | @Override 58 | public boolean onPlayerExecuteCommand(Player player, String[] args) { 59 | if (args.length != 1 || !args[0].equalsIgnoreCase("undo") || !Permission.UNDO.hasPermission(player)) { 60 | return false; 61 | } 62 | 63 | this.plugin.getServer().getScheduler().runTaskAsynchronously(this.plugin, () -> { 64 | player.sendMessage(AstralEditPlugin.PREFIX_SUCCESS + "Undoing operation ..."); 65 | if (!this.manager.undoOperation(player)) { 66 | player.sendMessage(AstralEditPlugin.PREFIX_ERROR + "You cannot undo the last operation."); 67 | } else { 68 | player.sendMessage(AstralEditPlugin.PREFIX_SUCCESS + "Finished undoing the last operation."); 69 | } 70 | }); 71 | 72 | return true; 73 | } 74 | } -------------------------------------------------------------------------------- /astraledit-bukkit-plugin/src/main/java/com/github/shynixn/astraledit/bukkit/logic/business/command/UpsidedownCommand.java: -------------------------------------------------------------------------------- 1 | package com.github.shynixn.astraledit.bukkit.logic.business.command; 2 | 3 | import com.github.shynixn.astraledit.api.bukkit.business.command.PlayerCommand; 4 | import com.github.shynixn.astraledit.bukkit.AstralEditPlugin; 5 | import com.github.shynixn.astraledit.bukkit.Permission; 6 | import com.github.shynixn.astraledit.bukkit.logic.business.Operation; 7 | import com.github.shynixn.astraledit.bukkit.logic.business.OperationType; 8 | import com.github.shynixn.astraledit.bukkit.logic.business.SelectionManager; 9 | import org.bukkit.entity.Player; 10 | import org.bukkit.plugin.Plugin; 11 | 12 | /** 13 | * Created by Shynixn 2018. 14 | *

15 | * Version 1.2 16 | *

17 | * MIT License 18 | *

19 | * Copyright (c) 2018 by Shynixn 20 | *

21 | * Permission is hereby granted, free of charge, to any person obtaining a copy 22 | * of this software and associated documentation files (the "Software"), to deal 23 | * in the Software without restriction, including without limitation the rights 24 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 25 | * copies of the Software, and to permit persons to whom the Software is 26 | * furnished to do so, subject to the following conditions: 27 | *

28 | * The above copyright notice and this permission notice shall be included in all 29 | * copies or substantial portions of the Software. 30 | *

31 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 32 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 33 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 34 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 35 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 36 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 37 | * SOFTWARE. 38 | */ 39 | public class UpsidedownCommand implements PlayerCommand { 40 | private final Plugin plugin; 41 | private final SelectionManager manager; 42 | 43 | /** 44 | * Creates an instance of {@link UpsidedownCommand} which depends on 45 | * a {@link SelectionManager} and a {@link Plugin} 46 | * 47 | * @param manager SelectionManager 48 | */ 49 | public UpsidedownCommand(SelectionManager manager, Plugin plugin) { 50 | this.manager = manager; 51 | this.plugin = plugin; 52 | } 53 | 54 | /** 55 | * Executes the given command if the arguments match. 56 | * 57 | * @param player executing the command. 58 | * @param args arguments. 59 | * @return True if this command was executed. False if the arguments do not match. 60 | */ 61 | @Override 62 | public boolean onPlayerExecuteCommand(Player player, String[] args) { 63 | if (args.length != 1 || !args[0].equalsIgnoreCase("upsidedown") || !Permission.UPSIDEDOWN.hasPermission(player)) { 64 | return false; 65 | } 66 | 67 | this.plugin.getServer().getScheduler().runTaskAsynchronously(this.plugin, () -> { 68 | if (!this.manager.hasSelection(player)) { 69 | player.sendMessage(AstralEditPlugin.PREFIX_ERROR + "You don't have a valid render."); 70 | } else { 71 | this.manager.getSelection(player).upSideDown(); 72 | this.manager.addOperation(player, new Operation(OperationType.UPSIDEDOWN)); 73 | } 74 | }); 75 | 76 | return true; 77 | } 78 | } -------------------------------------------------------------------------------- /astraledit-bukkit-plugin/src/main/java/com/github/shynixn/astraledit/bukkit/logic/business/nms/NMSRegistry.java: -------------------------------------------------------------------------------- 1 | package com.github.shynixn.astraledit.bukkit.logic.business.nms; 2 | 3 | import com.github.shynixn.astraledit.api.bukkit.business.entity.PacketArmorstand; 4 | import com.github.shynixn.astraledit.bukkit.AstralEditPlugin; 5 | import com.github.shynixn.astraledit.bukkit.logic.lib.ReflectionUtils; 6 | import org.bukkit.Location; 7 | import org.bukkit.entity.Player; 8 | 9 | import java.lang.reflect.InvocationTargetException; 10 | import java.util.Set; 11 | import java.util.logging.Level; 12 | 13 | /** 14 | * Copyright 2017 Shynixn 15 | *

16 | * Do not remove this header! 17 | *

18 | * Version 1.0 19 | *

20 | * MIT License 21 | *

22 | * Copyright (c) 2017 23 | *

24 | * Permission is hereby granted, free of charge, to any person obtaining a copy 25 | * of this software and associated documentation files (the "Software"), to deal 26 | * in the Software without restriction, including without limitation the rights 27 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 28 | * copies of the Software, and to permit persons to whom the Software is 29 | * furnished to do so, subject to the following conditions: 30 | *

31 | * The above copyright notice and this permission notice shall be included in all 32 | * copies or substantial portions of the Software. 33 | *

34 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 35 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 36 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 37 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 38 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 39 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 40 | * SOFTWARE. 41 | */ 42 | public class NMSRegistry { 43 | public static final String WATER_HEAD = "emack0714"; 44 | public static final String LAVA_HEAD = "Spe"; 45 | public static final String NOT_FOUND = "X_AgusRodri_X"; 46 | 47 | /** 48 | * Creates a new packetArmorstand 49 | * 50 | * @param player player 51 | * @param location location 52 | * @param id id 53 | * @param data data 54 | * @param watchers watchers 55 | * @return packetArmorstand 56 | */ 57 | public static PacketArmorstand createPacketArmorstand(Player player, Location location, int id, byte data, Set watchers) { 58 | try { 59 | return (PacketArmorstand) ReflectionUtils 60 | .invokeConstructor(ReflectionUtils.invokeClass("com.github.shynixn.astraledit.bukkit.logic.business.nms.VERSION.DisplayArmorstand" 61 | .replace("VERSION", VersionSupport.getServerVersion().getVersionText())) 62 | , new Class[]{Player.class, Location.class, int.class, byte.class, Set.class} 63 | , new Object[]{player, location, id, data, watchers}); 64 | } catch (IllegalAccessException | InvocationTargetException | InstantiationException | NoSuchMethodException | ClassNotFoundException e) { 65 | AstralEditPlugin.logger().log(Level.WARNING, "Failed to create packetArmorstand.", e); 66 | throw new RuntimeException("Failed to create packetArmorstand."); 67 | } 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /astraledit-bukkit-plugin/src/main/java/com/github/shynixn/astraledit/bukkit/logic/business/service/ConcurrencyServiceImpl.kt: -------------------------------------------------------------------------------- 1 | package com.github.shynixn.astraledit.bukkit.logic.business.service 2 | 3 | import com.github.shynixn.astraledit.api.business.service.ConcurrencyService 4 | import org.bukkit.plugin.Plugin 5 | 6 | /** 7 | * Created by Shynixn 2018. 8 | *

9 | * Version 1.2 10 | *

11 | * MIT License 12 | *

13 | * Copyright (c) 2018 by Shynixn 14 | *

15 | * Permission is hereby granted, free of charge, to any person obtaining a copy 16 | * of this software and associated documentation files (the "Software"), to deal 17 | * in the Software without restriction, including without limitation the rights 18 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 19 | * copies of the Software, and to permit persons to whom the Software is 20 | * furnished to do so, subject to the following conditions: 21 | *

22 | * The above copyright notice and this permission notice shall be included in all 23 | * copies or substantial portions of the Software. 24 | *

25 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 26 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 27 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 28 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 29 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 30 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 31 | * SOFTWARE. 32 | */ 33 | class ConcurrencyServiceImpl(private val plugin: Plugin) : ConcurrencyService { 34 | /** 35 | * Runs the given [function] synchronised with the given [delayTicks] and [repeatingTicks]. 36 | */ 37 | override fun runTaskSync(delayTicks: Long, repeatingTicks: Long, function: Runnable) { 38 | if (repeatingTicks > 0) { 39 | plugin.server.scheduler.runTaskTimer(plugin, function, delayTicks, repeatingTicks) 40 | } else { 41 | plugin.server.scheduler.runTaskLater(plugin, function, delayTicks) 42 | } 43 | } 44 | 45 | /** 46 | * Runs the given [function] asynchronous with the given [delayTicks] and [repeatingTicks]. 47 | */ 48 | override fun runTaskAsync(delayTicks: Long, repeatingTicks: Long, function: Runnable) { 49 | if (repeatingTicks > 0) { 50 | plugin.server.scheduler.runTaskTimerAsynchronously(plugin, function, delayTicks, repeatingTicks) 51 | } else { 52 | plugin.server.scheduler.runTaskLaterAsynchronously(plugin, function, delayTicks) 53 | } 54 | } 55 | } -------------------------------------------------------------------------------- /astraledit-bukkit-plugin/src/main/java/com/github/shynixn/astraledit/bukkit/logic/business/service/DependencyServiceImpl.kt: -------------------------------------------------------------------------------- 1 | package com.github.shynixn.astraledit.bukkit.logic.business.service 2 | 3 | import com.github.shynixn.astraledit.api.business.enumeration.PluginDependency 4 | import com.github.shynixn.astraledit.api.business.service.DependencyService 5 | import org.bukkit.Bukkit 6 | import org.bukkit.ChatColor 7 | import org.bukkit.plugin.Plugin 8 | 9 | /** 10 | * Created by Shynixn 2018. 11 | *

12 | * Version 1.2 13 | *

14 | * MIT License 15 | *

16 | * Copyright (c) 2018 by Shynixn 17 | *

18 | * Permission is hereby granted, free of charge, to any person obtaining a copy 19 | * of this software and associated documentation files (the "Software"), to deal 20 | * in the Software without restriction, including without limitation the rights 21 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 22 | * copies of the Software, and to permit persons to whom the Software is 23 | * furnished to do so, subject to the following conditions: 24 | *

25 | * The above copyright notice and this permission notice shall be included in all 26 | * copies or substantial portions of the Software. 27 | *

28 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 29 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 30 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 31 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 32 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 33 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 34 | * SOFTWARE. 35 | */ 36 | class DependencyServiceImpl(private val plugin: Plugin) : DependencyService { 37 | private val prefix = ChatColor.LIGHT_PURPLE.toString() + "[AstralEdit] " 38 | 39 | 40 | /** 41 | * Checks for installed dependencies and shows console output. 42 | * @return True when all required dependencies are installed. 43 | */ 44 | override fun checkForInstalledDependencies(): Boolean { 45 | printInstallment(PluginDependency.WORLEDIT) 46 | 47 | if (!isInstalled(PluginDependency.WORLEDIT)) { 48 | Bukkit.getServer().consoleSender.sendMessage(prefix + ChatColor.RED + "================================================") 49 | Bukkit.getServer().consoleSender.sendMessage(prefix + ChatColor.RED + plugin.name + " requires additional dependencies") 50 | Bukkit.getServer().consoleSender.sendMessage(prefix + ChatColor.RED + "Install [WorldEdit]") 51 | Bukkit.getServer().consoleSender.sendMessage(prefix + ChatColor.RED + "Plugin gets now disabled!") 52 | Bukkit.getServer().consoleSender.sendMessage(prefix + ChatColor.RED + "================================================") 53 | 54 | return false 55 | } 56 | 57 | return true 58 | } 59 | 60 | /** 61 | * Returns if the given [pluginDependency] is installed. 62 | */ 63 | override fun isInstalled(pluginDependency: PluginDependency): Boolean { 64 | val plugin = Bukkit.getPluginManager().getPlugin(pluginDependency.pluginName) 65 | return plugin != null 66 | } 67 | 68 | /** 69 | * Prints to the console if the plugin is installed. 70 | */ 71 | private fun printInstallment(pluginDependency: PluginDependency) { 72 | if (isInstalled(pluginDependency)) { 73 | val plugin = Bukkit.getPluginManager().getPlugin(pluginDependency.pluginName) 74 | 75 | Bukkit.getServer().consoleSender.sendMessage(prefix + ChatColor.DARK_GREEN + "found dependency [" + plugin.name + "].") 76 | Bukkit.getServer().consoleSender.sendMessage(prefix + ChatColor.DARK_GREEN + "successfully loaded dependency [" + plugin.name + "] " + plugin.description.version + '.') 77 | } 78 | } 79 | } -------------------------------------------------------------------------------- /astraledit-bukkit-plugin/src/main/java/com/github/shynixn/astraledit/bukkit/logic/business/service/DependencyWorldEditServiceImpl.kt: -------------------------------------------------------------------------------- 1 | @file:Suppress("UNCHECKED_CAST") 2 | 3 | package com.github.shynixn.astraledit.bukkit.logic.business.service 4 | 5 | import com.github.shynixn.astraledit.api.business.service.DependencyWorldEditService 6 | import org.bukkit.Bukkit 7 | import org.bukkit.Location 8 | import org.bukkit.entity.Player 9 | import org.bukkit.plugin.Plugin 10 | import java.util.* 11 | import java.util.logging.Level 12 | 13 | /** 14 | * Created by Shynixn 2018. 15 | *

16 | * Version 1.2 17 | *

18 | * MIT License 19 | *

20 | * Copyright (c) 2018 by Shynixn 21 | *

22 | * Permission is hereby granted, free of charge, to any person obtaining a copy 23 | * of this software and associated documentation files (the "Software"), to deal 24 | * in the Software without restriction, including without limitation the rights 25 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 26 | * copies of the Software, and to permit persons to whom the Software is 27 | * furnished to do so, subject to the following conditions: 28 | *

29 | * The above copyright notice and this permission notice shall be included in all 30 | * copies or substantial portions of the Software. 31 | *

32 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 33 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 34 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 35 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 36 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 37 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 38 | * SOFTWARE. 39 | */ 40 | class DependencyWorldEditServiceImpl(private val plugin: Plugin) : DependencyWorldEditService { 41 | 42 | /** 43 | * Returns the LeftClick WorldEdit selection of the given [player]. 44 | * @param [L] Location. 45 | * @param [P] Player. 46 | */ 47 | override fun getLeftClickLocation(player: P): Optional { 48 | if (player !is Player) { 49 | throw IllegalArgumentException("Player has to be a BukkitPlayer!") 50 | } 51 | 52 | return getSelection(player, "getMinimumPoint") as Optional 53 | } 54 | 55 | /** 56 | * Returns the RightClick WorldEdit selection of the given [player]. 57 | * @param [L] Location. 58 | * @param [P] Player. 59 | */ 60 | override fun getRightClickLocation(player: P): Optional { 61 | if (player !is Player) { 62 | throw IllegalArgumentException("Player has to be a BukkitPlayer!") 63 | } 64 | 65 | return getSelection(player, "getMaximumPoint") as Optional 66 | } 67 | 68 | /** 69 | * Returns the we selection. 70 | */ 71 | private fun getSelection(player: Player, name: String): Optional { 72 | try { 73 | val clazz = Class.forName("com.sk89q.worldedit.bukkit.WorldEditPlugin") 74 | val plugin = Bukkit.getPluginManager().getPlugin("WorldEdit") 75 | val selection = clazz.getDeclaredMethod("getSelection", Player::class.java).invoke(plugin, player) 76 | 77 | if (selection != null) { 78 | return Optional.of(Class.forName("com.sk89q.worldedit.bukkit.selections.RegionSelection").getDeclaredMethod(name).invoke(selection)) as Optional 79 | } 80 | } catch (e: Exception) { 81 | plugin.logger.log(Level.WARNING, "Failed to gather selection from worldedit.", e) 82 | } 83 | 84 | return Optional.empty() 85 | } 86 | } -------------------------------------------------------------------------------- /astraledit-bukkit-plugin/src/main/java/com/github/shynixn/astraledit/bukkit/logic/business/service/UpdateCheckServiceImpl.kt: -------------------------------------------------------------------------------- 1 | package com.github.shynixn.astraledit.bukkit.logic.business.service 2 | 3 | import com.github.shynixn.astraledit.api.business.service.ConcurrencyService 4 | import com.github.shynixn.astraledit.api.business.service.UpdateCheckService 5 | import com.github.shynixn.astraledit.core.business.extension.async 6 | import org.bukkit.Bukkit 7 | import org.bukkit.ChatColor 8 | import org.bukkit.plugin.Plugin 9 | import java.io.BufferedReader 10 | import java.io.IOException 11 | import java.io.InputStreamReader 12 | import java.net.URL 13 | import java.util.concurrent.CompletableFuture 14 | import java.util.logging.Level 15 | import javax.net.ssl.HttpsURLConnection 16 | 17 | /** 18 | * Created by Shynixn 2018. 19 | *

20 | * Version 1.2 21 | *

22 | * MIT License 23 | *

24 | * Copyright (c) 2018 by Shynixn 25 | *

26 | * Permission is hereby granted, free of charge, to any person obtaining a copy 27 | * of this software and associated documentation files (the "Software"), to deal 28 | * in the Software without restriction, including without limitation the rights 29 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 30 | * copies of the Software, and to permit persons to whom the Software is 31 | * furnished to do so, subject to the following conditions: 32 | *

33 | * The above copyright notice and this permission notice shall be included in all 34 | * copies or substantial portions of the Software. 35 | *

36 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 37 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 38 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 39 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 40 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 41 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 42 | * SOFTWARE. 43 | */ 44 | class UpdateCheckServiceImpl constructor(private val plugin: Plugin, private val concurrencyService: ConcurrencyService) : UpdateCheckService { 45 | private val baseUrl = "https://api.spigotmc.org/legacy/update.php?resource=" 46 | private val spigotResourceId: Long = 11409 47 | private val prefix: String = ChatColor.LIGHT_PURPLE.toString() + "[AstralEdit] " 48 | 49 | /** 50 | * Returns if there are any new updates for the BlockBall plugin. 51 | */ 52 | override fun checkForUpdates(): CompletableFuture { 53 | val completableFuture = CompletableFuture() 54 | 55 | async(concurrencyService) { 56 | try { 57 | val resourceVersion = getLatestReleaseVersion(spigotResourceId) 58 | 59 | if (resourceVersion == plugin.description.version) { 60 | completableFuture.complete(false) 61 | } else { 62 | val sender = Bukkit.getServer().consoleSender 63 | val pluginName = plugin.name 64 | 65 | if (plugin.description.version.endsWith("SNAPSHOT")) { 66 | sender.sendMessage(prefix + ChatColor.YELLOW + "================================================") 67 | sender.sendMessage(prefix + ChatColor.YELLOW + "You are using a snapshot of " + pluginName) 68 | sender.sendMessage(prefix + ChatColor.YELLOW + "Please check if there is a new version available") 69 | sender.sendMessage(prefix + ChatColor.YELLOW + "================================================") 70 | } else { 71 | sender.sendMessage(prefix + ChatColor.YELLOW + "================================================") 72 | sender.sendMessage(prefix + ChatColor.YELLOW + pluginName + " is outdated") 73 | sender.sendMessage(prefix + ChatColor.YELLOW + "Please download the latest version from github") 74 | sender.sendMessage(prefix + ChatColor.YELLOW + "================================================") 75 | } 76 | 77 | completableFuture.complete(true) 78 | } 79 | } catch (e: IOException) { 80 | plugin.logger.log(Level.WARNING, "Failed to check for updates.") 81 | completableFuture.complete(false) 82 | } 83 | } 84 | 85 | return completableFuture 86 | } 87 | 88 | /** 89 | * Makes a webrequest and returns the latest version id. 90 | */ 91 | @Throws(IOException::class) 92 | private fun getLatestReleaseVersion(resourceId: Long): String { 93 | val httpsURLConnection = URL(baseUrl + resourceId).openConnection() as HttpsURLConnection 94 | httpsURLConnection.inputStream.use { stream -> 95 | InputStreamReader(stream).use { reader -> 96 | BufferedReader(reader).use { bufferedReader -> 97 | return bufferedReader.readLine() 98 | } 99 | } 100 | } 101 | } 102 | } -------------------------------------------------------------------------------- /astraledit-bukkit-plugin/src/main/java/com/github/shynixn/astraledit/bukkit/logic/lib/SimpleListener.java: -------------------------------------------------------------------------------- 1 | package com.github.shynixn.astraledit.bukkit.logic.lib; 2 | 3 | import org.bukkit.Bukkit; 4 | import org.bukkit.event.HandlerList; 5 | import org.bukkit.event.Listener; 6 | import org.bukkit.plugin.Plugin; 7 | 8 | /** 9 | * Copyright 2017 Shynixn 10 | *

11 | * Do not remove this header! 12 | *

13 | * Version 1.0 14 | *

15 | * MIT License 16 | *

17 | * Copyright (c) 2016 18 | *

19 | * Permission is hereby granted, free of charge, to any person obtaining a copy 20 | * of this software and associated documentation files (the "Software"), to deal 21 | * in the Software without restriction, including without limitation the rights 22 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 23 | * copies of the Software, and to permit persons to whom the Software is 24 | * furnished to do so, subject to the following conditions: 25 | *

26 | * The above copyright notice and this permission notice shall be included in all 27 | * copies or substantial portions of the Software. 28 | *

29 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 30 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 31 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 32 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 33 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 34 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 35 | * SOFTWARE. 36 | */ 37 | public class SimpleListener implements Listener { 38 | 39 | final Plugin plugin; 40 | 41 | /** 42 | * Initializes a new listener by plugin 43 | * 44 | * @param plugin plugin 45 | */ 46 | public SimpleListener(Plugin plugin) { 47 | super(); 48 | if (plugin == null) 49 | throw new IllegalArgumentException("Plugin cannot be null!"); 50 | this.plugin = plugin; 51 | this.register(); 52 | } 53 | 54 | /** 55 | * Initializes a new listener by pluginName 56 | * 57 | * @param plugin plugin 58 | */ 59 | public SimpleListener(String plugin) { 60 | this(Bukkit.getPluginManager().getPlugin(plugin)); 61 | } 62 | 63 | /** 64 | * Registers the listener to spigot 65 | */ 66 | final void register() { 67 | Bukkit.getPluginManager().registerEvents(this, this.plugin); 68 | } 69 | 70 | /** 71 | * Unregisters the lister from spigot 72 | */ 73 | final void unregister() { 74 | HandlerList.unregisterAll(this); 75 | } 76 | } -------------------------------------------------------------------------------- /astraledit-bukkit-plugin/src/main/java/com/github/shynixn/astraledit/bukkit/logic/lib/Utils.java: -------------------------------------------------------------------------------- 1 | package com.github.shynixn.astraledit.bukkit.logic.lib; 2 | 3 | import org.bukkit.Bukkit; 4 | import org.bukkit.World; 5 | import org.bukkit.entity.Player; 6 | 7 | import java.util.ArrayList; 8 | import java.util.List; 9 | 10 | /** 11 | * Copyright 2018 Shynixn 12 | *

13 | * Do not remove this header! 14 | *

15 | * Version 1.2 16 | *

17 | * MIT License 18 | *

19 | * Copyright (c) 2018 20 | *

21 | * Permission is hereby granted, free of charge, to any person obtaining a copy 22 | * of this software and associated documentation files (the "Software"), to deal 23 | * in the Software without restriction, including without limitation the rights 24 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 25 | * copies of the Software, and to permit persons to whom the Software is 26 | * furnished to do so, subject to the following conditions: 27 | *

28 | * The above copyright notice and this permission notice shall be included in all 29 | * copies or substantial portions of the Software. 30 | *

31 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 32 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 33 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 34 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 35 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 36 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 37 | * SOFTWARE. 38 | */ 39 | public class Utils { 40 | /** 41 | * Returns online players. 42 | * 43 | * @return players 44 | */ 45 | public static List getOnlinePlayers() { 46 | final List players = new ArrayList<>(); 47 | 48 | for (final World world : Bukkit.getWorlds()) { 49 | players.addAll(world.getPlayers()); 50 | } 51 | 52 | return players; 53 | } 54 | 55 | /** 56 | * Checks if the string can be parsed to double. 57 | * 58 | * @param value value 59 | * @return success 60 | */ 61 | public static boolean tryParseDouble(String value) { 62 | try { 63 | Double.parseDouble(value); 64 | } catch (final NumberFormatException nfe) { 65 | return false; 66 | } 67 | return true; 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /astraledit-bukkit-plugin/src/main/resources/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | 3 | -------------------------------------------------------------------------------- /astraledit-bukkit-plugin/src/main/resources/config.yml: -------------------------------------------------------------------------------- 1 | ####################################################################### 2 | # AstralEdit [Rendered WorldEdit Reforged] 2017 by Shynixn # 3 | # RenderedWorldEdit 2015 by Shynixn # 4 | ####################################################################### 5 | 6 | # Permission: 7 | # LEVEL DESCRIPTION PERMISSION 8 | # admin Allows to use the /awe command astraledit.allowCommands 9 | # admin Allows to render a selection astraledit.commands.render 10 | # admin Allows to join a selection astraledit.commands.join 11 | # admin Allows to tear a selection apart astraledit.commands.tear 12 | # admin Allows to place a selection astraledit.commands.place 13 | # admin Allows to clear a selection astraledit.commands.clear 14 | # admin Allows to move a selection to coordinates astraledit.commands.movecoordinate 15 | # admin Allows to move a selection to players astraledit.commands.moveplayer 16 | # admin Allows to mirror a selection astraledit.commands.mirror 17 | # admin Allows to flip a selection astraledit.commands.flip 18 | # admin Allows to upsidedown a selection astraledit.commands.upsidedown 19 | # admin Allows to set a selection's angles astraledit.commands.angles 20 | # admin Allows to rotate a selection astraledit.commands.rotate 21 | # admin Allows to teleport player to selection astraledit.commands.teleportplayer 22 | # admin Allows to convert to blocks astraledit.commands.converttoblocks 23 | # admin Allows to convert to render astraledit.commands.converttorender 24 | # admin Allows to convert to auto-follow astraledit.commands.autofollow 25 | # admin Allows to convert to auto-rotate astraledit.commands.autorotate 26 | # admin Allows to undo operations astraledit.commands.undo 27 | # admin Allows to hide your selection astraledit.commands.hideother 28 | # admin Allows to show your selection astraledit.commands.showother 29 | 30 | ############################ 31 | 32 | # Data-collecting settings 33 | 34 | # Settings to send anonymous stats to https://bstats.org/plugin/bukkit/AstralEdit. 35 | # As this does not have an impact on your AstralEdit experience at all I would like you to set it on true as knowing that my 36 | # plugin gets used by many server helps me focusing on new updates ;) 37 | 38 | ############################ 39 | 40 | metrics: true 41 | 42 | ############################ 43 | 44 | # General settings 45 | 46 | # Settings to manage performance and cache which the plugin can use. 47 | 48 | # max-selected-blocks-amount: Amount of blocks which can be rendered at once. 49 | # As it's handled via packets the server won't lag at all but the client might crash if he selects too many blocks 50 | # max-undo-amount: Amount of operations per player which can be undone# 51 | 52 | ############################ 53 | 54 | general: 55 | max-selected-blocks-amount: 10000 56 | max-undo-amount: 10 57 | -------------------------------------------------------------------------------- /astraledit-bukkit-plugin/src/main/resources/plugin.yml: -------------------------------------------------------------------------------- 1 | name: AstralEdit 2 | version: 1.1.0 3 | author: Shynixn 4 | website: https://www.spigotmc.org/members/shynixn.63455/ 5 | main: com.github.shynixn.astraledit.bukkit.AstralEditPlugin 6 | softdepend: [WorldEdit] 7 | commands: 8 | awe: 9 | description: Opens the arena menu. 10 | usage: / 11 | permission: astraledit.allowCommands 12 | permission-message: You don't have permission. -------------------------------------------------------------------------------- /astraledit-core/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | root 7 | com.github.shynixn.astraledit 8 | 1.1.0 9 | 10 | 4.0.0 11 | 12 | astraledit-core 13 | 1.1.0 14 | 15 | 16 | 17 | com.github.shynixn.astraledit 18 | astraledit-api 19 | 1.1.0 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /astraledit-core/src/main/java/com/github/shynixn/astraledit/core/business/extension/ExtensionMethod.kt: -------------------------------------------------------------------------------- 1 | package com.github.shynixn.astraledit.core.business.extension 2 | 3 | import com.github.shynixn.astraledit.api.business.service.ConcurrencyService 4 | 5 | /** 6 | * Created by Shynixn 2018. 7 | *

8 | * Version 1.2 9 | *

10 | * MIT License 11 | *

12 | * Copyright (c) 2018 by Shynixn 13 | *

14 | * Permission is hereby granted, free of charge, to any person obtaining a copy 15 | * of this software and associated documentation files (the "Software"), to deal 16 | * in the Software without restriction, including without limitation the rights 17 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 18 | * copies of the Software, and to permit persons to whom the Software is 19 | * furnished to do so, subject to the following conditions: 20 | *

21 | * The above copyright notice and this permission notice shall be included in all 22 | * copies or substantial portions of the Software. 23 | *

24 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 25 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 26 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 27 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 28 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 29 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 30 | * SOFTWARE. 31 | */ 32 | /** 33 | * Executes the given [f] via the [concurrencyService] synchronized with the server tick. 34 | */ 35 | inline fun Any.sync(concurrencyService: ConcurrencyService, delayTicks: Long = 0L, repeatingTicks: Long = 0L, crossinline f: () -> Unit) { 36 | concurrencyService.runTaskSync(delayTicks, repeatingTicks, Runnable { f.invoke() }) 37 | } 38 | 39 | /** 40 | * Executes the given [f] via the [concurrencyService] asynchronous. 41 | */ 42 | inline fun Any.async(concurrencyService: ConcurrencyService, delayTicks: Long = 0L, repeatingTicks: Long = 0L, crossinline f: () -> Unit) { 43 | concurrencyService.runTaskAsync(delayTicks, repeatingTicks, Runnable { f.invoke() }) 44 | } -------------------------------------------------------------------------------- /docs/apidocs/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Archiver-Version: Plexus Archiver 3 | Built-By: Christoph 4 | Created-By: Apache Maven 5 | Build-Jdk: 1.8.0_112 6 | 7 | -------------------------------------------------------------------------------- /docs/apidocs/com/github/shynixn/astraledit/api/entity/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | com.github.shynixn.astraledit.api.entity (AstralEdit 1.1.0 API) 8 | 9 | 10 | 11 | 12 | 13 |

com.github.shynixn.astraledit.api.entity

14 |
15 |

Interfaces

16 | 20 |
21 | 22 | 23 | -------------------------------------------------------------------------------- /docs/apidocs/com/github/shynixn/astraledit/api/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | com.github.shynixn.astraledit.api (AstralEdit 1.1.0 API) 8 | 9 | 10 | 11 | 12 | 13 |

com.github.shynixn.astraledit.api

14 |
15 |

Classes

16 | 19 |
20 | 21 | 22 | -------------------------------------------------------------------------------- /docs/apidocs/com/github/shynixn/astraledit/api/package-use.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Uses of Package com.github.shynixn.astraledit.api (AstralEdit 1.1.0 API) 8 | 9 | 10 | 11 | 12 | 13 | 23 | 26 | 27 |
28 | 29 | 30 |
Skip navigation links
31 | 32 | 33 | 34 | 44 |
45 | 72 | 73 |
74 |

Uses of Package
com.github.shynixn.astraledit.api

75 |
76 |
No usage of com.github.shynixn.astraledit.api
77 | 78 |
79 | 80 | 81 |
Skip navigation links
82 | 83 | 84 | 85 | 95 |
96 | 123 | 124 |

Copyright © 2017. All rights reserved.

125 | 126 | 127 | -------------------------------------------------------------------------------- /docs/apidocs/com/github/shynixn/astraledit/business/bukkit/dependencies/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | com.github.shynixn.astraledit.business.bukkit.dependencies (AstralEdit 1.1.0 API) 8 | 9 | 10 | 11 | 12 | 13 |

com.github.shynixn.astraledit.business.bukkit.dependencies

14 |
15 |

Enums

16 | 19 |
20 | 21 | 22 | -------------------------------------------------------------------------------- /docs/apidocs/com/github/shynixn/astraledit/business/bukkit/dependencies/worldedit/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | com.github.shynixn.astraledit.business.bukkit.dependencies.worldedit (AstralEdit 1.1.0 API) 8 | 9 | 10 | 11 | 12 | 13 |

com.github.shynixn.astraledit.business.bukkit.dependencies.worldedit

14 |
15 |

Classes

16 | 19 |
20 | 21 | 22 | -------------------------------------------------------------------------------- /docs/apidocs/com/github/shynixn/astraledit/business/bukkit/nms/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | com.github.shynixn.astraledit.business.bukkit.nms (AstralEdit 1.1.0 API) 8 | 9 | 10 | 11 | 12 | 13 |

com.github.shynixn.astraledit.business.bukkit.nms

14 |
15 |

Classes

16 | 19 |

Enums

20 | 23 |
24 | 25 | 26 | -------------------------------------------------------------------------------- /docs/apidocs/com/github/shynixn/astraledit/business/bukkit/nms/v1_10_R1/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | com.github.shynixn.astraledit.business.bukkit.nms.v1_10_R1 (AstralEdit 1.1.0 API) 8 | 9 | 10 | 11 | 12 | 13 |

com.github.shynixn.astraledit.business.bukkit.nms.v1_10_R1

14 |
15 |

Classes

16 | 19 |
20 | 21 | 22 | -------------------------------------------------------------------------------- /docs/apidocs/com/github/shynixn/astraledit/business/bukkit/nms/v1_10_R1/package-use.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Uses of Package com.github.shynixn.astraledit.business.bukkit.nms.v1_10_R1 (AstralEdit 1.1.0 API) 8 | 9 | 10 | 11 | 12 | 13 | 23 | 26 | 27 |
28 | 29 | 30 |
Skip navigation links
31 | 32 | 33 | 34 | 44 |
45 | 72 | 73 |
74 |

Uses of Package
com.github.shynixn.astraledit.business.bukkit.nms.v1_10_R1

75 |
76 |
No usage of com.github.shynixn.astraledit.business.bukkit.nms.v1_10_R1
77 | 78 |
79 | 80 | 81 |
Skip navigation links
82 | 83 | 84 | 85 | 95 |
96 | 123 | 124 |

Copyright © 2017. All rights reserved.

125 | 126 | 127 | -------------------------------------------------------------------------------- /docs/apidocs/com/github/shynixn/astraledit/business/bukkit/nms/v1_11_R1/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | com.github.shynixn.astraledit.business.bukkit.nms.v1_11_R1 (AstralEdit 1.1.0 API) 8 | 9 | 10 | 11 | 12 | 13 |

com.github.shynixn.astraledit.business.bukkit.nms.v1_11_R1

14 |
15 |

Classes

16 | 19 |
20 | 21 | 22 | -------------------------------------------------------------------------------- /docs/apidocs/com/github/shynixn/astraledit/business/bukkit/nms/v1_11_R1/package-use.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Uses of Package com.github.shynixn.astraledit.business.bukkit.nms.v1_11_R1 (AstralEdit 1.1.0 API) 8 | 9 | 10 | 11 | 12 | 13 | 23 | 26 | 27 |
28 | 29 | 30 |
Skip navigation links
31 | 32 | 33 | 34 | 44 |
45 | 72 | 73 |
74 |

Uses of Package
com.github.shynixn.astraledit.business.bukkit.nms.v1_11_R1

75 |
76 |
No usage of com.github.shynixn.astraledit.business.bukkit.nms.v1_11_R1
77 | 78 |
79 | 80 | 81 |
Skip navigation links
82 | 83 | 84 | 85 | 95 |
96 | 123 | 124 |

Copyright © 2017. All rights reserved.

125 | 126 | 127 | -------------------------------------------------------------------------------- /docs/apidocs/com/github/shynixn/astraledit/business/bukkit/nms/v1_12_R1/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | com.github.shynixn.astraledit.business.bukkit.nms.v1_12_R1 (AstralEdit 1.1.0 API) 8 | 9 | 10 | 11 | 12 | 13 |

com.github.shynixn.astraledit.business.bukkit.nms.v1_12_R1

14 |
15 |

Classes

16 | 19 |
20 | 21 | 22 | -------------------------------------------------------------------------------- /docs/apidocs/com/github/shynixn/astraledit/business/bukkit/nms/v1_12_R1/package-use.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Uses of Package com.github.shynixn.astraledit.business.bukkit.nms.v1_12_R1 (AstralEdit 1.1.0 API) 8 | 9 | 10 | 11 | 12 | 13 | 23 | 26 | 27 |
28 | 29 | 30 |
Skip navigation links
31 | 32 | 33 | 34 | 44 |
45 | 72 | 73 |
74 |

Uses of Package
com.github.shynixn.astraledit.business.bukkit.nms.v1_12_R1

75 |
76 |
No usage of com.github.shynixn.astraledit.business.bukkit.nms.v1_12_R1
77 | 78 |
79 | 80 | 81 |
Skip navigation links
82 | 83 | 84 | 85 | 95 |
96 | 123 | 124 |

Copyright © 2017. All rights reserved.

125 | 126 | 127 | -------------------------------------------------------------------------------- /docs/apidocs/com/github/shynixn/astraledit/business/bukkit/nms/v1_8_R1/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | com.github.shynixn.astraledit.business.bukkit.nms.v1_8_R1 (AstralEdit 1.1.0 API) 8 | 9 | 10 | 11 | 12 | 13 |

com.github.shynixn.astraledit.business.bukkit.nms.v1_8_R1

14 |
15 |

Classes

16 | 19 |
20 | 21 | 22 | -------------------------------------------------------------------------------- /docs/apidocs/com/github/shynixn/astraledit/business/bukkit/nms/v1_8_R1/package-use.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Uses of Package com.github.shynixn.astraledit.business.bukkit.nms.v1_8_R1 (AstralEdit 1.1.0 API) 8 | 9 | 10 | 11 | 12 | 13 | 23 | 26 | 27 |
28 | 29 | 30 |
Skip navigation links
31 | 32 | 33 | 34 | 44 |
45 | 72 | 73 |
74 |

Uses of Package
com.github.shynixn.astraledit.business.bukkit.nms.v1_8_R1

75 |
76 |
No usage of com.github.shynixn.astraledit.business.bukkit.nms.v1_8_R1
77 | 78 |
79 | 80 | 81 |
Skip navigation links
82 | 83 | 84 | 85 | 95 |
96 | 123 | 124 |

Copyright © 2017. All rights reserved.

125 | 126 | 127 | -------------------------------------------------------------------------------- /docs/apidocs/com/github/shynixn/astraledit/business/bukkit/nms/v1_8_R2/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | com.github.shynixn.astraledit.business.bukkit.nms.v1_8_R2 (AstralEdit 1.1.0 API) 8 | 9 | 10 | 11 | 12 | 13 |

com.github.shynixn.astraledit.business.bukkit.nms.v1_8_R2

14 |
15 |

Classes

16 | 19 |
20 | 21 | 22 | -------------------------------------------------------------------------------- /docs/apidocs/com/github/shynixn/astraledit/business/bukkit/nms/v1_8_R2/package-use.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Uses of Package com.github.shynixn.astraledit.business.bukkit.nms.v1_8_R2 (AstralEdit 1.1.0 API) 8 | 9 | 10 | 11 | 12 | 13 | 23 | 26 | 27 |
28 | 29 | 30 |
Skip navigation links
31 | 32 | 33 | 34 | 44 |
45 | 72 | 73 |
74 |

Uses of Package
com.github.shynixn.astraledit.business.bukkit.nms.v1_8_R2

75 |
76 |
No usage of com.github.shynixn.astraledit.business.bukkit.nms.v1_8_R2
77 | 78 |
79 | 80 | 81 |
Skip navigation links
82 | 83 | 84 | 85 | 95 |
96 | 123 | 124 |

Copyright © 2017. All rights reserved.

125 | 126 | 127 | -------------------------------------------------------------------------------- /docs/apidocs/com/github/shynixn/astraledit/business/bukkit/nms/v1_8_R3/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | com.github.shynixn.astraledit.business.bukkit.nms.v1_8_R3 (AstralEdit 1.1.0 API) 8 | 9 | 10 | 11 | 12 | 13 |

com.github.shynixn.astraledit.business.bukkit.nms.v1_8_R3

14 |
15 |

Classes

16 | 19 |
20 | 21 | 22 | -------------------------------------------------------------------------------- /docs/apidocs/com/github/shynixn/astraledit/business/bukkit/nms/v1_8_R3/package-use.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Uses of Package com.github.shynixn.astraledit.business.bukkit.nms.v1_8_R3 (AstralEdit 1.1.0 API) 8 | 9 | 10 | 11 | 12 | 13 | 23 | 26 | 27 |
28 | 29 | 30 |
Skip navigation links
31 | 32 | 33 | 34 | 44 |
45 | 72 | 73 |
74 |

Uses of Package
com.github.shynixn.astraledit.business.bukkit.nms.v1_8_R3

75 |
76 |
No usage of com.github.shynixn.astraledit.business.bukkit.nms.v1_8_R3
77 | 78 |
79 | 80 | 81 |
Skip navigation links
82 | 83 | 84 | 85 | 95 |
96 | 123 | 124 |

Copyright © 2017. All rights reserved.

125 | 126 | 127 | -------------------------------------------------------------------------------- /docs/apidocs/com/github/shynixn/astraledit/business/bukkit/nms/v1_9_R1/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | com.github.shynixn.astraledit.business.bukkit.nms.v1_9_R1 (AstralEdit 1.1.0 API) 8 | 9 | 10 | 11 | 12 | 13 |

com.github.shynixn.astraledit.business.bukkit.nms.v1_9_R1

14 |
15 |

Classes

16 | 19 |
20 | 21 | 22 | -------------------------------------------------------------------------------- /docs/apidocs/com/github/shynixn/astraledit/business/bukkit/nms/v1_9_R1/package-use.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Uses of Package com.github.shynixn.astraledit.business.bukkit.nms.v1_9_R1 (AstralEdit 1.1.0 API) 8 | 9 | 10 | 11 | 12 | 13 | 23 | 26 | 27 |
28 | 29 | 30 |
Skip navigation links
31 | 32 | 33 | 34 | 44 |
45 | 72 | 73 |
74 |

Uses of Package
com.github.shynixn.astraledit.business.bukkit.nms.v1_9_R1

75 |
76 |
No usage of com.github.shynixn.astraledit.business.bukkit.nms.v1_9_R1
77 | 78 |
79 | 80 | 81 |
Skip navigation links
82 | 83 | 84 | 85 | 95 |
96 | 123 | 124 |

Copyright © 2017. All rights reserved.

125 | 126 | 127 | -------------------------------------------------------------------------------- /docs/apidocs/com/github/shynixn/astraledit/business/bukkit/nms/v1_9_R2/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | com.github.shynixn.astraledit.business.bukkit.nms.v1_9_R2 (AstralEdit 1.1.0 API) 8 | 9 | 10 | 11 | 12 | 13 |

com.github.shynixn.astraledit.business.bukkit.nms.v1_9_R2

14 |
15 |

Classes

16 | 19 |
20 | 21 | 22 | -------------------------------------------------------------------------------- /docs/apidocs/com/github/shynixn/astraledit/business/bukkit/nms/v1_9_R2/package-use.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Uses of Package com.github.shynixn.astraledit.business.bukkit.nms.v1_9_R2 (AstralEdit 1.1.0 API) 8 | 9 | 10 | 11 | 12 | 13 | 23 | 26 | 27 |
28 | 29 | 30 |
Skip navigation links
31 | 32 | 33 | 34 | 44 |
45 | 72 | 73 |
74 |

Uses of Package
com.github.shynixn.astraledit.business.bukkit.nms.v1_9_R2

75 |
76 |
No usage of com.github.shynixn.astraledit.business.bukkit.nms.v1_9_R2
77 | 78 |
79 | 80 | 81 |
Skip navigation links
82 | 83 | 84 | 85 | 95 |
96 | 123 | 124 |

Copyright © 2017. All rights reserved.

125 | 126 | 127 | -------------------------------------------------------------------------------- /docs/apidocs/com/github/shynixn/astraledit/business/bukkit/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | com.github.shynixn.astraledit.business.bukkit (AstralEdit 1.1.0 API) 8 | 9 | 10 | 11 | 12 | 13 |

com.github.shynixn.astraledit.business.bukkit

14 |
15 |

Classes

16 | 19 |

Enums

20 | 23 |
24 | 25 | 26 | -------------------------------------------------------------------------------- /docs/apidocs/com/github/shynixn/astraledit/business/logic/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | com.github.shynixn.astraledit.business.logic (AstralEdit 1.1.0 API) 8 | 9 | 10 | 11 | 12 | 13 |

com.github.shynixn.astraledit.business.logic

14 |
15 |

Classes

16 | 19 |
20 | 21 | 22 | -------------------------------------------------------------------------------- /docs/apidocs/com/github/shynixn/astraledit/business/logic/package-use.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Uses of Package com.github.shynixn.astraledit.business.logic (AstralEdit 1.1.0 API) 8 | 9 | 10 | 11 | 12 | 13 | 23 | 26 | 27 |
28 | 29 | 30 |
Skip navigation links
31 | 32 | 33 | 34 | 44 |
45 | 72 | 73 |
74 |

Uses of Package
com.github.shynixn.astraledit.business.logic

75 |
76 |
No usage of com.github.shynixn.astraledit.business.logic
77 | 78 |
79 | 80 | 81 |
Skip navigation links
82 | 83 | 84 | 85 | 95 |
96 | 123 | 124 |

Copyright © 2017. All rights reserved.

125 | 126 | 127 | -------------------------------------------------------------------------------- /docs/apidocs/com/github/shynixn/astraledit/business/metrics/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | com.github.shynixn.astraledit.business.metrics (AstralEdit 1.1.0 API) 8 | 9 | 10 | 11 | 12 | 13 |

com.github.shynixn.astraledit.business.metrics

14 |
15 |

Classes

16 | 27 |
28 | 29 | 30 | -------------------------------------------------------------------------------- /docs/apidocs/com/github/shynixn/astraledit/lib/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | com.github.shynixn.astraledit.lib (AstralEdit 1.1.0 API) 8 | 9 | 10 | 11 | 12 | 13 |

com.github.shynixn.astraledit.lib

14 |
15 |

Classes

16 | 26 |

Enums

27 | 30 |
31 | 32 | 33 | -------------------------------------------------------------------------------- /docs/apidocs/deprecated-list.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Deprecated List (AstralEdit 1.1.0 API) 8 | 9 | 10 | 11 | 12 | 13 | 23 | 26 | 27 |
28 | 29 | 30 |
Skip navigation links
31 | 32 | 33 | 34 | 44 |
45 | 72 | 73 |
74 |

Deprecated API

75 |

Contents

76 |
77 | 78 |
79 | 80 | 81 |
Skip navigation links
82 | 83 | 84 | 85 | 95 |
96 | 123 | 124 |

Copyright © 2017. All rights reserved.

125 | 126 | 127 | -------------------------------------------------------------------------------- /docs/apidocs/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | AstralEdit 1.1.0 API 8 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | <noscript> 70 | <div>JavaScript is disabled on your browser.</div> 71 | </noscript> 72 | <h2>Frame Alert</h2> 73 | <p>This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client. Link to <a href="overview-summary.html">Non-frame version</a>.</p> 74 | 75 | 76 | 77 | -------------------------------------------------------------------------------- /docs/apidocs/overview-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Overview List (AstralEdit 1.1.0 API) 8 | 9 | 10 | 11 | 12 | 13 |
All Classes
14 |
15 |

Packages

16 | 35 |
36 |

 

37 | 38 | 39 | -------------------------------------------------------------------------------- /docs/apidocs/package-list: -------------------------------------------------------------------------------- 1 | com.github.shynixn.astraledit.api 2 | com.github.shynixn.astraledit.api.entity 3 | com.github.shynixn.astraledit.business.bukkit 4 | com.github.shynixn.astraledit.business.bukkit.dependencies 5 | com.github.shynixn.astraledit.business.bukkit.dependencies.worldedit 6 | com.github.shynixn.astraledit.business.bukkit.nms 7 | com.github.shynixn.astraledit.business.bukkit.nms.v1_10_R1 8 | com.github.shynixn.astraledit.business.bukkit.nms.v1_11_R1 9 | com.github.shynixn.astraledit.business.bukkit.nms.v1_12_R1 10 | com.github.shynixn.astraledit.business.bukkit.nms.v1_8_R1 11 | com.github.shynixn.astraledit.business.bukkit.nms.v1_8_R2 12 | com.github.shynixn.astraledit.business.bukkit.nms.v1_8_R3 13 | com.github.shynixn.astraledit.business.bukkit.nms.v1_9_R1 14 | com.github.shynixn.astraledit.business.bukkit.nms.v1_9_R2 15 | com.github.shynixn.astraledit.business.logic 16 | com.github.shynixn.astraledit.business.metrics 17 | com.github.shynixn.astraledit.lib 18 | -------------------------------------------------------------------------------- /docs/apidocs/script.js: -------------------------------------------------------------------------------- 1 | function show(type) 2 | { 3 | count = 0; 4 | for (var key in methods) { 5 | var row = document.getElementById(key); 6 | if ((methods[key] & type) != 0) { 7 | row.style.display = ''; 8 | row.className = (count++ % 2) ? rowColor : altColor; 9 | } 10 | else 11 | row.style.display = 'none'; 12 | } 13 | updateTabs(type); 14 | } 15 | 16 | function updateTabs(type) 17 | { 18 | for (var value in tabs) { 19 | var sNode = document.getElementById(tabs[value][0]); 20 | var spanNode = sNode.firstChild; 21 | if (value == type) { 22 | sNode.className = activeTableTab; 23 | spanNode.innerHTML = tabs[value][1]; 24 | } 25 | else { 26 | sNode.className = tableTab; 27 | spanNode.innerHTML = "" + tabs[value][1] + ""; 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /docs/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | Page Redirection 9 | 10 | 11 | If you are not redirected automatically, follow this Link 13 | 14 | --------------------------------------------------------------------------------