├── .gitignore ├── LICENSE ├── README.md ├── build.gradle ├── gradle.properties ├── gradle └── wrapper │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── misc └── .gitkeep ├── prepare-servers.sh ├── settings.gradle └── src ├── integration-test ├── java │ └── io │ │ └── t2l │ │ └── mc │ │ └── matrix │ │ ├── PlainServerIntegrationTest.java │ │ └── test │ │ ├── mcserver │ │ ├── MCVersion.java │ │ ├── Server.java │ │ ├── ServerInstance.java │ │ └── ServerManager.java │ │ └── minecraft │ │ └── NodeJsBot.java ├── nodejs │ ├── index.js │ ├── package-lock.json │ └── package.json └── resources │ ├── plugin │ ├── .gitkeep │ └── MatrixMinecraft.yml │ └── servers │ ├── .gitkeep │ └── server.properties └── main ├── java └── io │ └── t2l │ └── mc │ └── matrix │ ├── LogService.java │ ├── MatrixClient.java │ ├── MatrixException.java │ ├── appservice │ ├── Appservice.java │ ├── AppserviceHttp.java │ └── AppserviceTransactionHandler.java │ ├── bridge │ ├── AppserviceBridge.java │ ├── IBridge.java │ └── MatrixEventHandler.java │ ├── bukkit │ ├── BukkitMinecraft.java │ ├── ChatListener.java │ └── MatrixBukkitPlugin.java │ ├── dto │ ├── EventIdResponse.java │ ├── MatrixAppserviceTransaction.java │ ├── MatrixAppserviceTransactionEvent.java │ ├── MatrixError.java │ ├── MatrixMessage.java │ ├── MatrixUserProfile.java │ ├── RegistrationResponse.java │ └── RoomIdResponse.java │ ├── events │ ├── AppserviceEvent.java │ └── PluginEventBus.java │ └── minecraft │ └── IMinecraft.java └── resources ├── config.yml └── plugin.yml /.gitignore: -------------------------------------------------------------------------------- 1 | .idea/ 2 | .gradle/ 3 | build/ 4 | out/ 5 | 6 | src/integration-test/resources/plugin/** 7 | src/integration-test/resources/servers/** 8 | !src/integration-test/resources/plugin/.gitkeep 9 | !src/integration-test/resources/plugin/MatrixMinecraft.yml 10 | !src/integration-test/resources/servers/.gitkeep 11 | !src/integration-test/resources/servers/server.properties 12 | 13 | misc/** 14 | !misc/.gitkeep 15 | 16 | node_modules 17 | 18 | # Compiled class file 19 | *.class 20 | 21 | # Log file 22 | *.log 23 | 24 | # BlueJ files 25 | *.ctxt 26 | 27 | # Mobile Tools for Java (J2ME) 28 | .mtj.tmp/ 29 | 30 | # Package Files # 31 | *.jar 32 | *.war 33 | *.nar 34 | *.ear 35 | *.zip 36 | *.tar.gz 37 | *.rar 38 | 39 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml 40 | hs_err_pid* 41 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # THIS PROJECT IS ABANDONED 2 | 3 | You're welcome to try and revive it, but to be honest you're better off starting from scratch. 4 | 5 | No maintenance is planned for this bridge. 6 | 7 | 8 | # matrix-minecraft 9 | Minecraft plugin and optional proxy server for bridging to Matrix 10 | -------------------------------------------------------------------------------- /build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'com.github.johnrengelman.shadow' version '4.0.3' 3 | id 'java' 4 | } 5 | 6 | group 'io.t2l' 7 | version '1.0-SNAPSHOT' 8 | 9 | sourceCompatibility = 1.8 10 | targetCompatibility = 1.8 11 | 12 | sourceSets { 13 | integrationTest { 14 | java { 15 | compileClasspath += main.output + test.output 16 | runtimeClasspath += main.output + test.output 17 | srcDir file('src/integration-test/java') 18 | } 19 | resources.srcDirs file('src/integration-test/resources'), file('src/integration-test/nodejs') 20 | } 21 | } 22 | 23 | repositories { 24 | mavenCentral() 25 | maven { url 'https://hub.spigotmc.org/nexus/content/repositories/snapshots/' } 26 | maven { url 'https://jitpack.io' } 27 | } 28 | 29 | configurations { 30 | shade 31 | compile.extendsFrom shade 32 | integrationTestCompile.extendsFrom testCompile 33 | integrationTestRuntime.extendsFrom testRuntime 34 | } 35 | 36 | dependencies { 37 | compile "org.bukkit:bukkit:1.13-R0.1-SNAPSHOT" 38 | shade "org.apache.httpcomponents:httpclient:4.5" 39 | shade "com.fasterxml.jackson.core:jackson-databind:2.9.7" 40 | shade "org.nanohttpd:nanohttpd:2.3.1" 41 | shade "org.nanohttpd:nanohttpd-nanolets:2.3.1" 42 | shade "com.github.javaplugs:minibus:0.4.10" 43 | testCompile group: 'junit', name: 'junit', version: '4.12' 44 | testCompile "org.awaitility:awaitility:3.1.5" 45 | integrationTestCompile sourceSets.main.output 46 | integrationTestCompile 'org.assertj:assertj-core:3.0.0' 47 | } 48 | 49 | jar { 50 | configurations.shade.each { dep -> 51 | from(project.zipTree(dep)) { 52 | exclude 'META-INF', 'META-INF/**' 53 | } 54 | } 55 | } 56 | 57 | task copyPlugin(type: Copy) { 58 | from "build/libs/matrix-minecraft-${version}.jar" 59 | rename { String filename -> return "MatrixMinecraft.jar" } 60 | into 'src/integration-test/resources/plugin' 61 | } 62 | 63 | task integrationTest(type: Test) { 64 | testClassesDirs = sourceSets.integrationTest.output.classesDirs 65 | classpath = sourceSets.integrationTest.runtimeClasspath 66 | } 67 | 68 | check.dependsOn integrationTest 69 | copyPlugin.dependsOn jar 70 | integrationTest.dependsOn copyPlugin 71 | 72 | integrationTest.mustRunAfter test -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/turt2live/matrix-minecraft/23c801b7b40fe808b63f86d9368a55f5bc323a58/gradle.properties -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri Dec 28 20:44:16 MST 2018 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.10-all.zip 7 | -------------------------------------------------------------------------------- /gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Attempt to set APP_HOME 10 | # Resolve links: $0 may be a link 11 | PRG="$0" 12 | # Need this for relative symlinks. 13 | while [ -h "$PRG" ] ; do 14 | ls=`ls -ld "$PRG"` 15 | link=`expr "$ls" : '.*-> \(.*\)$'` 16 | if expr "$link" : '/.*' > /dev/null; then 17 | PRG="$link" 18 | else 19 | PRG=`dirname "$PRG"`"/$link" 20 | fi 21 | done 22 | SAVED="`pwd`" 23 | cd "`dirname \"$PRG\"`/" >/dev/null 24 | APP_HOME="`pwd -P`" 25 | cd "$SAVED" >/dev/null 26 | 27 | APP_NAME="Gradle" 28 | APP_BASE_NAME=`basename "$0"` 29 | 30 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 31 | DEFAULT_JVM_OPTS="" 32 | 33 | # Use the maximum available, or set MAX_FD != -1 to use that value. 34 | MAX_FD="maximum" 35 | 36 | warn () { 37 | echo "$*" 38 | } 39 | 40 | die () { 41 | echo 42 | echo "$*" 43 | echo 44 | exit 1 45 | } 46 | 47 | # OS specific support (must be 'true' or 'false'). 48 | cygwin=false 49 | msys=false 50 | darwin=false 51 | nonstop=false 52 | case "`uname`" in 53 | CYGWIN* ) 54 | cygwin=true 55 | ;; 56 | Darwin* ) 57 | darwin=true 58 | ;; 59 | MINGW* ) 60 | msys=true 61 | ;; 62 | NONSTOP* ) 63 | nonstop=true 64 | ;; 65 | esac 66 | 67 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 68 | 69 | # Determine the Java command to use to start the JVM. 70 | if [ -n "$JAVA_HOME" ] ; then 71 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 72 | # IBM's JDK on AIX uses strange locations for the executables 73 | JAVACMD="$JAVA_HOME/jre/sh/java" 74 | else 75 | JAVACMD="$JAVA_HOME/bin/java" 76 | fi 77 | if [ ! -x "$JAVACMD" ] ; then 78 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 79 | 80 | Please set the JAVA_HOME variable in your environment to match the 81 | location of your Java installation." 82 | fi 83 | else 84 | JAVACMD="java" 85 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 86 | 87 | Please set the JAVA_HOME variable in your environment to match the 88 | location of your Java installation." 89 | fi 90 | 91 | # Increase the maximum file descriptors if we can. 92 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then 93 | MAX_FD_LIMIT=`ulimit -H -n` 94 | if [ $? -eq 0 ] ; then 95 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 96 | MAX_FD="$MAX_FD_LIMIT" 97 | fi 98 | ulimit -n $MAX_FD 99 | if [ $? -ne 0 ] ; then 100 | warn "Could not set maximum file descriptor limit: $MAX_FD" 101 | fi 102 | else 103 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 104 | fi 105 | fi 106 | 107 | # For Darwin, add options to specify how the application appears in the dock 108 | if $darwin; then 109 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 110 | fi 111 | 112 | # For Cygwin, switch paths to Windows format before running java 113 | if $cygwin ; then 114 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 115 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 116 | JAVACMD=`cygpath --unix "$JAVACMD"` 117 | 118 | # We build the pattern for arguments to be converted via cygpath 119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 120 | SEP="" 121 | for dir in $ROOTDIRSRAW ; do 122 | ROOTDIRS="$ROOTDIRS$SEP$dir" 123 | SEP="|" 124 | done 125 | OURCYGPATTERN="(^($ROOTDIRS))" 126 | # Add a user-defined pattern to the cygpath arguments 127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 129 | fi 130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 131 | i=0 132 | for arg in "$@" ; do 133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 135 | 136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 138 | else 139 | eval `echo args$i`="\"$arg\"" 140 | fi 141 | i=$((i+1)) 142 | done 143 | case $i in 144 | (0) set -- ;; 145 | (1) set -- "$args0" ;; 146 | (2) set -- "$args0" "$args1" ;; 147 | (3) set -- "$args0" "$args1" "$args2" ;; 148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 154 | esac 155 | fi 156 | 157 | # Escape application args 158 | save () { 159 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done 160 | echo " " 161 | } 162 | APP_ARGS=$(save "$@") 163 | 164 | # Collect all arguments for the java command, following the shell quoting and substitution rules 165 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" 166 | 167 | # by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong 168 | if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then 169 | cd "$(dirname "$0")" 170 | fi 171 | 172 | exec "$JAVACMD" "$@" 173 | -------------------------------------------------------------------------------- /gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | set DIRNAME=%~dp0 12 | if "%DIRNAME%" == "" set DIRNAME=. 13 | set APP_BASE_NAME=%~n0 14 | set APP_HOME=%DIRNAME% 15 | 16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 17 | set DEFAULT_JVM_OPTS= 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windows variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | 53 | :win9xME_args 54 | @rem Slurp the command line arguments. 55 | set CMD_LINE_ARGS= 56 | set _SKIP=2 57 | 58 | :win9xME_args_slurp 59 | if "x%~1" == "x" goto execute 60 | 61 | set CMD_LINE_ARGS=%* 62 | 63 | :execute 64 | @rem Setup the command line 65 | 66 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 67 | 68 | @rem Execute Gradle 69 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 70 | 71 | :end 72 | @rem End local scope for the variables with windows NT shell 73 | if "%ERRORLEVEL%"=="0" goto mainEnd 74 | 75 | :fail 76 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 77 | rem the _cmd.exe /c_ return code! 78 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 79 | exit /b 1 80 | 81 | :mainEnd 82 | if "%OS%"=="Windows_NT" endlocal 83 | 84 | :omega 85 | -------------------------------------------------------------------------------- /misc/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/turt2live/matrix-minecraft/23c801b7b40fe808b63f86d9368a55f5bc323a58/misc/.gitkeep -------------------------------------------------------------------------------- /prepare-servers.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -ex 3 | 4 | cd misc 5 | curl -o BuildTools.jar https://hub.spigotmc.org/jenkins/job/BuildTools/lastSuccessfulBuild/artifact/target/BuildTools.jar 6 | 7 | ## 1.13.2 8 | if [ ! -f ../src/integration-test/resources/servers/CraftBukkit-1.13.2.jar ] || [ ! -f ../src/integration-test/resources/servers/Spigot-1.13.2.jar ]; then 9 | echo Building 1.13.2 CraftBukkit/Spigot servers 10 | java -Xmx1024M -jar BuildTools.jar --rev 1.13.2 11 | mv craftbukkit-1.13.2.jar ../src/integration-test/resources/servers/CraftBukkit-1.13.2.jar 12 | mv spigot-1.13.2.jar ../src/integration-test/resources/servers/Spigot-1.13.2.jar 13 | fi 14 | if [ ! -f ../src/integration-test/resources/servers/Paperclip-1.13.2.jar ]; then 15 | echo Downloading Paperclip 1.13.2 16 | curl -Lo ../src/integration-test/resources/servers/Paperclip-1.13.2.jar https://papermc.io/ci/job/Paper-1.13/488/artifact/paperclip-488.jar 17 | fi 18 | 19 | ## 1.13.1 20 | if [ ! -f ../src/integration-test/resources/servers/CraftBukkit-1.13.1.jar ] || [ ! -f ../src/integration-test/resources/servers/Spigot-1.13.1.jar ]; then 21 | echo Building 1.13.1 CraftBukkit/Spigot servers 22 | java -Xmx1024M -jar BuildTools.jar --rev 1.13.1 23 | mv craftbukkit-1.13.1.jar ../src/integration-test/resources/servers/CraftBukkit-1.13.1.jar 24 | mv spigot-1.13.1.jar ../src/integration-test/resources/servers/Spigot-1.13.1.jar 25 | fi 26 | 27 | ## 1.13 28 | if [ ! -f ../src/integration-test/resources/servers/CraftBukkit-1.13.jar ] || [ ! -f ../src/integration-test/resources/servers/Spigot-1.13.jar ]; then 29 | echo Building 1.13 CraftBukkit/Spigot servers 30 | java -Xmx1024M -jar BuildTools.jar --rev 1.13 31 | mv craftbukkit-1.13.jar ../src/integration-test/resources/servers/CraftBukkit-1.13.jar 32 | mv spigot-1.13.jar ../src/integration-test/resources/servers/Spigot-1.13.jar 33 | fi 34 | 35 | ## 1.12.2 36 | if [ ! -f ../src/integration-test/resources/servers/CraftBukkit-1.12.2.jar ] || [ ! -f ../src/integration-test/resources/servers/Spigot-1.12.2.jar ]; then 37 | echo Building 1.12.2 CraftBukkit/Spigot servers 38 | java -Xmx1024M -jar BuildTools.jar --rev 1.12.2 39 | mv craftbukkit-1.12.2.jar ../src/integration-test/resources/servers/CraftBukkit-1.12.2.jar 40 | mv spigot-1.12.2.jar ../src/integration-test/resources/servers/Spigot-1.12.2.jar 41 | fi 42 | if [ ! -f ../src/integration-test/resources/servers/Glowstone-1.12.2.jar ]; then 43 | echo Downloading Glowstone 1.12.2 44 | curl -Lo ../src/integration-test/resources/servers/Glowstone-1.12.2.jar https://github.com/GlowstoneMC/Glowstone/releases/download/2018.0.1/glowstone.jar 45 | fi 46 | if [ ! -f ../src/integration-test/resources/servers/Paperclip-1.12.2.jar ]; then 47 | echo Downloading Paperclip 1.12.2 48 | curl -Lo ../src/integration-test/resources/servers/Paperclip-1.12.2.jar https://papermc.io/ci/job/Paper/1594/artifact/paperclip-1594.jar 49 | fi 50 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'matrix-minecraft' 2 | 3 | -------------------------------------------------------------------------------- /src/integration-test/java/io/t2l/mc/matrix/PlainServerIntegrationTest.java: -------------------------------------------------------------------------------- 1 | package io.t2l.mc.matrix; 2 | 3 | import io.t2l.mc.matrix.test.mcserver.MCVersion; 4 | import io.t2l.mc.matrix.test.mcserver.Server; 5 | import io.t2l.mc.matrix.test.mcserver.ServerInstance; 6 | import io.t2l.mc.matrix.test.mcserver.ServerManager; 7 | import io.t2l.mc.matrix.test.minecraft.NodeJsBot; 8 | import org.awaitility.Awaitility; 9 | import org.awaitility.Duration; 10 | import org.junit.*; 11 | import org.junit.rules.Timeout; 12 | import org.junit.runner.RunWith; 13 | import org.junit.runners.Parameterized; 14 | 15 | import java.io.IOException; 16 | import java.util.ArrayList; 17 | import java.util.Collection; 18 | import java.util.Objects; 19 | import java.util.concurrent.TimeUnit; 20 | 21 | @RunWith(Parameterized.class) 22 | public class PlainServerIntegrationTest { 23 | 24 | @Rule 25 | public Timeout globalTimeout = new Timeout(5, TimeUnit.MINUTES); 26 | 27 | private static final String BOT_USERNAME = "testing-bot"; 28 | private static final boolean USE_LOCAL_SERVER = false; 29 | 30 | private Server server; 31 | private MCVersion version; 32 | private NodeJsBot bot; 33 | private static ServerInstance instance; 34 | private static Server forServer; 35 | private static MCVersion forVersion; 36 | 37 | public PlainServerIntegrationTest(Server server, MCVersion version) { 38 | this.server = server; 39 | this.version = version; 40 | } 41 | 42 | @Parameterized.Parameters 43 | public static Collection input() { 44 | ArrayList items = new ArrayList<>(); 45 | for (Server server : Server.class.getEnumConstants()) { 46 | for (MCVersion version : server.versions) { 47 | items.add(new Object[]{server, version}); 48 | } 49 | } 50 | return items; 51 | } 52 | 53 | @Before 54 | public void init() throws Exception { 55 | if (!USE_LOCAL_SERVER) { 56 | if (instance != null) { 57 | if (forServer != server || forVersion != version) { 58 | instance.stop(); 59 | } else return; 60 | } 61 | System.out.println("Creating server..."); 62 | instance = ServerManager.createServer(this.server, this.version); 63 | instance.start(); 64 | forServer = server; 65 | forVersion = version; 66 | } 67 | 68 | this.bot = new NodeJsBot(BOT_USERNAME); 69 | this.bot.start(); 70 | } 71 | 72 | @After 73 | public void teardown() { 74 | if (this.bot != null) { 75 | this.bot.stop(); 76 | } 77 | } 78 | 79 | @AfterClass 80 | public static void teardownClass() throws IOException { 81 | if (instance != null) { 82 | instance.stop(); 83 | } 84 | } 85 | 86 | @Test 87 | public void botCanEcho() throws InterruptedException { 88 | this.bot.sendMessage("hello"); 89 | Awaitility.await().atMost(new Duration(10, TimeUnit.SECONDS)) 90 | .until(() -> Objects.equals(this.bot.lastMessage, "{\"extra\":[{\"text\":\"<" + BOT_USERNAME + "> hello\"}],\"text\":\"\"}") 91 | || Objects.equals(this.bot.lastMessage, "{\"text\":\"<" + BOT_USERNAME + "> hello\"}")); 92 | } 93 | } 94 | -------------------------------------------------------------------------------- /src/integration-test/java/io/t2l/mc/matrix/test/mcserver/MCVersion.java: -------------------------------------------------------------------------------- 1 | package io.t2l.mc.matrix.test.mcserver; 2 | 3 | public enum MCVersion { 4 | V1_12_2("1.12.2"), 5 | V1_13("1.13"), 6 | V1_13_1("1.13.1"), 7 | V1_13_2("1.13.2"), 8 | ; 9 | 10 | public final String version; 11 | 12 | MCVersion(String version) { 13 | this.version = version; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/integration-test/java/io/t2l/mc/matrix/test/mcserver/Server.java: -------------------------------------------------------------------------------- 1 | package io.t2l.mc.matrix.test.mcserver; 2 | 3 | import java.util.Arrays; 4 | import java.util.Collections; 5 | import java.util.List; 6 | 7 | public enum Server { 8 | CRAFTBUKKIT("CraftBukkit", new MCVersion[]{ 9 | MCVersion.V1_13_2, 10 | MCVersion.V1_13_1, 11 | MCVersion.V1_13, 12 | MCVersion.V1_12_2 13 | }), 14 | SPIGOT("Spigot", new MCVersion[]{ 15 | MCVersion.V1_13_2, 16 | MCVersion.V1_13_1, 17 | MCVersion.V1_13, 18 | MCVersion.V1_12_2 19 | }), 20 | PAPER("Paperclip", new MCVersion[]{ 21 | MCVersion.V1_13_2, 22 | MCVersion.V1_12_2 23 | }), 24 | GLOWSTONE("Glowstone", new MCVersion[]{ 25 | MCVersion.V1_12_2 26 | }), 27 | ; 28 | 29 | public final String serverName; 30 | public final List versions; 31 | 32 | Server(String serverName, MCVersion[] versions) { 33 | this.serverName = serverName; 34 | this.versions = Collections.unmodifiableList(Arrays.asList(versions)); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/integration-test/java/io/t2l/mc/matrix/test/mcserver/ServerInstance.java: -------------------------------------------------------------------------------- 1 | package io.t2l.mc.matrix.test.mcserver; 2 | 3 | import java.io.*; 4 | import java.nio.file.Files; 5 | import java.nio.file.Path; 6 | import java.nio.file.Paths; 7 | import java.util.concurrent.Semaphore; 8 | 9 | public class ServerInstance { 10 | 11 | private File serverJar; 12 | private Path dataPath; 13 | private File pluginFile; 14 | private File pluginConfig; 15 | private File[] serverConfigs; 16 | private Process process; 17 | private Semaphore lock = new Semaphore(1); 18 | private Exception error = null; 19 | 20 | ServerInstance(File serverJar, File[] serverConfigs, Path dataPath, File pluginFile, File pluginConfig) { 21 | this.serverJar = serverJar; 22 | this.dataPath = dataPath; 23 | this.pluginFile = pluginFile; 24 | this.pluginConfig = pluginConfig; 25 | this.serverConfigs = serverConfigs; 26 | } 27 | 28 | public void start() throws Exception { 29 | System.out.println("Starting server in directory: " + dataPath.toString()); 30 | 31 | System.out.println("Creating plugin directory..."); 32 | Files.createDirectories(Paths.get(dataPath.toString(), "plugins", "MatrixMinecraft")); 33 | Files.copy(pluginFile.toPath(), Paths.get(dataPath.toString(), "plugins", "MatrixMinecraft.jar")); 34 | Files.copy(pluginConfig.toPath(), Paths.get(dataPath.toString(), "plugins", "MatrixMinecraft", "config.yml")); 35 | 36 | System.out.println("Copying server JAR..."); 37 | Files.copy(serverJar.toPath(), Paths.get(dataPath.toString(), "server.jar")); 38 | 39 | System.out.println("Copying server configs..."); 40 | for(File serverConfig : serverConfigs) { 41 | Files.copy(serverConfig.toPath(), Paths.get(dataPath.toString(), serverConfig.getName())); 42 | } 43 | 44 | System.out.println("Starting server..."); 45 | try (PrintWriter w = new PrintWriter(Paths.get(dataPath.toString(), "eula.txt").toString())) { 46 | w.println("eula=True"); 47 | } 48 | 49 | lock = new Semaphore(1); 50 | new Thread(new ServerInstanceRunnable()).start(); 51 | Thread.sleep(500); 52 | lock.acquire(); 53 | if (error != null) { 54 | this.stop(); 55 | throw error; 56 | } 57 | } 58 | 59 | public void stop() throws IOException { 60 | if (this.process != null) { 61 | this.process.destroy(); 62 | lock.release(); 63 | } 64 | } 65 | 66 | private class ServerInstanceRunnable implements Runnable { 67 | @Override 68 | public void run() { 69 | try { 70 | lock.acquire(); 71 | process = new ProcessBuilder() 72 | .directory(dataPath.toFile()) 73 | .command("java", "-Xmx1024M", "-XX:-UseParallelGC", "-jar", "server.jar") 74 | .start(); 75 | 76 | try (BufferedReader input = new BufferedReader(new InputStreamReader(process.getInputStream()))) { 77 | String line; 78 | while ((line = input.readLine()) != null) { 79 | System.out.println(line); 80 | if ((line.contains("Done") && line.contains("For help, type \"help\"")) || line.contains("Ready for connections.")) { 81 | lock.release(); 82 | } 83 | } 84 | } 85 | } catch (IOException | InterruptedException e) { 86 | e.printStackTrace(); 87 | error = e; 88 | } 89 | } 90 | } 91 | } 92 | -------------------------------------------------------------------------------- /src/integration-test/java/io/t2l/mc/matrix/test/mcserver/ServerManager.java: -------------------------------------------------------------------------------- 1 | package io.t2l.mc.matrix.test.mcserver; 2 | 3 | import java.io.File; 4 | import java.io.IOException; 5 | import java.net.URL; 6 | import java.nio.file.Files; 7 | import java.nio.file.Path; 8 | 9 | public class ServerManager { 10 | 11 | private ServerManager() { 12 | } 13 | 14 | public static ServerInstance createServer(Server server, MCVersion version) throws IOException { 15 | Path dataPath = Files.createTempDirectory("mc_tests"); 16 | File serverJar = new File(ServerManager.tryGetFile("servers/" + server.serverName + "-" + version.version + ".jar")); 17 | File pluginFile = new File(ServerManager.tryGetFile("plugin/MatrixMinecraft.jar")); 18 | File pluginConfig = new File(ServerManager.tryGetFile("plugin/MatrixMinecraft.yml")); 19 | File[] serverConfifs = new File[]{ 20 | new File(ServerManager.tryGetFile("servers/server.properties")), 21 | }; 22 | 23 | return new ServerInstance(serverJar, serverConfifs, dataPath, pluginFile, pluginConfig); 24 | } 25 | 26 | private static String tryGetFile(String resourceName) { 27 | ClassLoader classLoader = ServerManager.class.getClassLoader(); 28 | if (classLoader == null) throw new NullPointerException("classLoader is null"); 29 | 30 | URL resource = classLoader.getResource(resourceName); 31 | if (resource == null) throw new NullPointerException("resource is null"); 32 | 33 | return resource.getFile(); 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /src/integration-test/java/io/t2l/mc/matrix/test/minecraft/NodeJsBot.java: -------------------------------------------------------------------------------- 1 | package io.t2l.mc.matrix.test.minecraft; 2 | 3 | import org.awaitility.Awaitility; 4 | import org.awaitility.Duration; 5 | 6 | import java.io.*; 7 | import java.util.concurrent.SynchronousQueue; 8 | import java.util.concurrent.TimeUnit; 9 | 10 | public class NodeJsBot { 11 | 12 | private String username; 13 | private Process process; 14 | private SynchronousQueue sendQueue = new SynchronousQueue<>(); 15 | 16 | public volatile String lastMessage; 17 | 18 | public NodeJsBot(String username) { 19 | this.username = username; 20 | } 21 | 22 | public void start() throws IOException { 23 | ProcessBuilder builder = new ProcessBuilder(); 24 | builder.environment().putAll(System.getenv()); 25 | this.process = builder 26 | //.inheritIO() 27 | .directory(new File("src/integration-test/nodejs")) 28 | .command("node", "index.js", username) 29 | .start(); 30 | 31 | new Thread(() -> { 32 | try (BufferedReader input = new BufferedReader(new InputStreamReader(process.getInputStream()))) { 33 | String line; 34 | while ((line = input.readLine()) != null) { 35 | System.out.println(line); 36 | if (line.startsWith("P:")) { 37 | lastMessage = line.substring("P:".length()); 38 | } 39 | } 40 | } catch (IOException e) { 41 | e.printStackTrace(); 42 | } 43 | }).start(); 44 | new Thread(() -> { 45 | try (BufferedReader input = new BufferedReader(new InputStreamReader(process.getErrorStream()))) { 46 | String line; 47 | while ((line = input.readLine()) != null) { 48 | System.err.println(line); 49 | } 50 | } catch (IOException e) { 51 | e.printStackTrace(); 52 | } 53 | }).start(); 54 | new Thread(() -> { 55 | try (PrintWriter w = new PrintWriter(process.getOutputStream())) { 56 | System.out.println("Waiting for startup"); 57 | Awaitility.await().atMost(new Duration(10, TimeUnit.SECONDS)).until(() -> lastMessage != null); 58 | System.out.println("Waiting for messages"); 59 | while (true) { 60 | String message = sendQueue.take(); 61 | System.out.println("Sending message..."); 62 | w.println(message); 63 | w.flush(); 64 | } 65 | } catch (InterruptedException e) { 66 | e.printStackTrace(); 67 | } 68 | }).start(); 69 | } 70 | 71 | public void stop() { 72 | if (this.process != null) { 73 | this.process.destroy(); 74 | } 75 | } 76 | 77 | public void sendMessage(String message) throws InterruptedException { 78 | sendQueue.put(message); 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /src/integration-test/nodejs/index.js: -------------------------------------------------------------------------------- 1 | const process = require('process'); 2 | const mc = require("minecraft-protocol"); 3 | 4 | process.stdin.setEncoding('utf8'); 5 | 6 | process.stdin.on('readable', () => { 7 | const chunk = process.stdin.read(); 8 | if (chunk != null) { 9 | process.stdout.write("E:" + chunk + "\n"); 10 | } 11 | if (chunk !== null && client != null) { 12 | client.write('chat', {message: chunk.trim()}); 13 | } 14 | }); 15 | 16 | process.stdin.on('end', () => { 17 | process.stdout.write('end'); 18 | }); 19 | 20 | const username = process.argv[2] || "monbot"; 21 | process.stdout.write('Starting protocol client with username: ' + username + "\n"); 22 | const client = mc.createClient({ 23 | username: username, 24 | }); 25 | 26 | client.on('chat', function (packet) { 27 | const jsonMsg = JSON.parse(packet.message); 28 | process.stdout.write("P:" + JSON.stringify(jsonMsg) + "\n"); 29 | }); -------------------------------------------------------------------------------- /src/integration-test/nodejs/package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "integration-test-client", 3 | "version": "1.0.0", 4 | "lockfileVersion": 1, 5 | "requires": true, 6 | "dependencies": { 7 | "acorn": { 8 | "version": "6.0.4", 9 | "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.0.4.tgz", 10 | "integrity": "sha512-VY4i5EKSKkofY2I+6QLTbTTN/UvEQPCo6eiwzzSaSWfpaDhOmStMCMod6wmuPciNq+XS0faCglFu2lHZpdHUtg==" 11 | }, 12 | "acorn-jsx": { 13 | "version": "5.0.1", 14 | "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.0.1.tgz", 15 | "integrity": "sha512-HJ7CfNHrfJLlNTzIEUTj43LNWGkqpRLxm3YjAlcD0ACydk9XynzYsCBHxut+iqt+1aBXkx9UP/w/ZqMr13XIzg==" 16 | }, 17 | "ajv": { 18 | "version": "6.6.2", 19 | "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.6.2.tgz", 20 | "integrity": "sha512-FBHEW6Jf5TB9MGBgUUA9XHkTbjXYfAUjY43ACMfmdMRHniyoMHjHjzD50OK8LGDWQwp4rWEsIq5kEqq7rvIM1g==", 21 | "requires": { 22 | "fast-deep-equal": "^2.0.1", 23 | "fast-json-stable-stringify": "^2.0.0", 24 | "json-schema-traverse": "^0.4.1", 25 | "uri-js": "^4.2.2" 26 | } 27 | }, 28 | "ajv-keywords": { 29 | "version": "3.2.0", 30 | "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.2.0.tgz", 31 | "integrity": "sha1-6GuBnGAs+IIa1jdBNpjx3sAhhHo=" 32 | }, 33 | "ansi-escapes": { 34 | "version": "3.1.0", 35 | "resolved": "http://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.1.0.tgz", 36 | "integrity": "sha512-UgAb8H9D41AQnu/PbWlCofQVcnV4Gs2bBJi9eZPxfU/hgglFh3SMDMENRIqdr7H6XFnXdoknctFByVsCOotTVw==" 37 | }, 38 | "ansi-regex": { 39 | "version": "2.1.1", 40 | "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", 41 | "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=" 42 | }, 43 | "ansi-styles": { 44 | "version": "2.2.1", 45 | "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", 46 | "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=" 47 | }, 48 | "argparse": { 49 | "version": "1.0.10", 50 | "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", 51 | "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", 52 | "requires": { 53 | "sprintf-js": "~1.0.2" 54 | } 55 | }, 56 | "array-includes": { 57 | "version": "3.0.3", 58 | "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.0.3.tgz", 59 | "integrity": "sha1-GEtI9i2S10UrsxsyMWXH+L0CJm0=", 60 | "requires": { 61 | "define-properties": "^1.1.2", 62 | "es-abstract": "^1.7.0" 63 | } 64 | }, 65 | "asn1": { 66 | "version": "0.2.3", 67 | "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.3.tgz", 68 | "integrity": "sha1-2sh4dxPJlmhJ/IGAd36+nB3fO4Y=" 69 | }, 70 | "babel-code-frame": { 71 | "version": "6.26.0", 72 | "resolved": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.26.0.tgz", 73 | "integrity": "sha1-Y/1D99weO7fONZR9uP42mj9Yx0s=", 74 | "requires": { 75 | "chalk": "^1.1.3", 76 | "esutils": "^2.0.2", 77 | "js-tokens": "^3.0.2" 78 | }, 79 | "dependencies": { 80 | "chalk": { 81 | "version": "1.1.3", 82 | "resolved": "http://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", 83 | "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", 84 | "requires": { 85 | "ansi-styles": "^2.2.1", 86 | "escape-string-regexp": "^1.0.2", 87 | "has-ansi": "^2.0.0", 88 | "strip-ansi": "^3.0.0", 89 | "supports-color": "^2.0.0" 90 | } 91 | }, 92 | "strip-ansi": { 93 | "version": "3.0.1", 94 | "resolved": "http://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", 95 | "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", 96 | "requires": { 97 | "ansi-regex": "^2.0.0" 98 | } 99 | } 100 | } 101 | }, 102 | "balanced-match": { 103 | "version": "1.0.0", 104 | "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", 105 | "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" 106 | }, 107 | "brace-expansion": { 108 | "version": "1.1.11", 109 | "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", 110 | "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", 111 | "requires": { 112 | "balanced-match": "^1.0.0", 113 | "concat-map": "0.0.1" 114 | } 115 | }, 116 | "buffer-equal": { 117 | "version": "1.0.0", 118 | "resolved": "https://registry.npmjs.org/buffer-equal/-/buffer-equal-1.0.0.tgz", 119 | "integrity": "sha1-WWFrSYME1Var1GaWayLu2j7KX74=" 120 | }, 121 | "builtin-modules": { 122 | "version": "1.1.1", 123 | "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz", 124 | "integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=" 125 | }, 126 | "caller-path": { 127 | "version": "0.1.0", 128 | "resolved": "https://registry.npmjs.org/caller-path/-/caller-path-0.1.0.tgz", 129 | "integrity": "sha1-lAhe9jWB7NPaqSREqP6U6CV3dR8=", 130 | "requires": { 131 | "callsites": "^0.2.0" 132 | } 133 | }, 134 | "callsites": { 135 | "version": "0.2.0", 136 | "resolved": "http://registry.npmjs.org/callsites/-/callsites-0.2.0.tgz", 137 | "integrity": "sha1-r6uWJikQp/M8GaV3WCXGnzTjUMo=" 138 | }, 139 | "chalk": { 140 | "version": "2.4.1", 141 | "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", 142 | "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", 143 | "requires": { 144 | "ansi-styles": "^3.2.1", 145 | "escape-string-regexp": "^1.0.5", 146 | "supports-color": "^5.3.0" 147 | }, 148 | "dependencies": { 149 | "ansi-styles": { 150 | "version": "3.2.1", 151 | "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", 152 | "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", 153 | "requires": { 154 | "color-convert": "^1.9.0" 155 | } 156 | }, 157 | "supports-color": { 158 | "version": "5.5.0", 159 | "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", 160 | "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", 161 | "requires": { 162 | "has-flag": "^3.0.0" 163 | } 164 | } 165 | } 166 | }, 167 | "chardet": { 168 | "version": "0.4.2", 169 | "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.4.2.tgz", 170 | "integrity": "sha1-tUc7M9yXxCTl2Y3IfVXU2KKci/I=" 171 | }, 172 | "circular-json": { 173 | "version": "0.3.3", 174 | "resolved": "https://registry.npmjs.org/circular-json/-/circular-json-0.3.3.tgz", 175 | "integrity": "sha512-UZK3NBx2Mca+b5LsG7bY183pHWt5Y1xts4P3Pz7ENTwGVnJOUWbRb3ocjvX7hx9tq/yTAdclXm9sZ38gNuem4A==" 176 | }, 177 | "cli-cursor": { 178 | "version": "2.1.0", 179 | "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz", 180 | "integrity": "sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU=", 181 | "requires": { 182 | "restore-cursor": "^2.0.0" 183 | } 184 | }, 185 | "cli-width": { 186 | "version": "2.2.0", 187 | "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.0.tgz", 188 | "integrity": "sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk=" 189 | }, 190 | "color-convert": { 191 | "version": "1.9.3", 192 | "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", 193 | "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", 194 | "requires": { 195 | "color-name": "1.1.3" 196 | } 197 | }, 198 | "color-name": { 199 | "version": "1.1.3", 200 | "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", 201 | "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" 202 | }, 203 | "concat-map": { 204 | "version": "0.0.1", 205 | "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", 206 | "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" 207 | }, 208 | "contains-path": { 209 | "version": "0.1.0", 210 | "resolved": "https://registry.npmjs.org/contains-path/-/contains-path-0.1.0.tgz", 211 | "integrity": "sha1-/ozxhP9mcLa67wGp1IYaXL7EEgo=" 212 | }, 213 | "cross-spawn": { 214 | "version": "6.0.5", 215 | "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", 216 | "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", 217 | "requires": { 218 | "nice-try": "^1.0.4", 219 | "path-key": "^2.0.1", 220 | "semver": "^5.5.0", 221 | "shebang-command": "^1.2.0", 222 | "which": "^1.2.9" 223 | } 224 | }, 225 | "debug": { 226 | "version": "4.1.1", 227 | "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", 228 | "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", 229 | "requires": { 230 | "ms": "^2.1.1" 231 | } 232 | }, 233 | "debug-log": { 234 | "version": "1.0.1", 235 | "resolved": "http://registry.npmjs.org/debug-log/-/debug-log-1.0.1.tgz", 236 | "integrity": "sha1-IwdjLUwEOCuN+KMvcLiVBG1SdF8=" 237 | }, 238 | "deep-is": { 239 | "version": "0.1.3", 240 | "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", 241 | "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=" 242 | }, 243 | "define-properties": { 244 | "version": "1.1.3", 245 | "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", 246 | "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", 247 | "requires": { 248 | "object-keys": "^1.0.12" 249 | } 250 | }, 251 | "deglob": { 252 | "version": "2.1.1", 253 | "resolved": "https://registry.npmjs.org/deglob/-/deglob-2.1.1.tgz", 254 | "integrity": "sha512-2kjwuGGonL7gWE1XU4Fv79+vVzpoQCl0V+boMwWtOQJV2AGDabCwez++nB1Nli/8BabAfZQ/UuHPlp6AymKdWw==", 255 | "requires": { 256 | "find-root": "^1.0.0", 257 | "glob": "^7.0.5", 258 | "ignore": "^3.0.9", 259 | "pkg-config": "^1.1.0", 260 | "run-parallel": "^1.1.2", 261 | "uniq": "^1.0.1" 262 | }, 263 | "dependencies": { 264 | "ignore": { 265 | "version": "3.3.10", 266 | "resolved": "https://registry.npmjs.org/ignore/-/ignore-3.3.10.tgz", 267 | "integrity": "sha512-Pgs951kaMm5GXP7MOvxERINe3gsaVjUWFm+UZPSq9xYriQAksyhg0csnS0KXSNRD5NmNdapXEpjxG49+AKh/ug==" 268 | } 269 | } 270 | }, 271 | "doctrine": { 272 | "version": "2.1.0", 273 | "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", 274 | "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", 275 | "requires": { 276 | "esutils": "^2.0.2" 277 | } 278 | }, 279 | "endian-toggle": { 280 | "version": "0.0.0", 281 | "resolved": "https://registry.npmjs.org/endian-toggle/-/endian-toggle-0.0.0.tgz", 282 | "integrity": "sha1-5cx1eLEDLW7gHq/Nc3ZdsNtNwKY=" 283 | }, 284 | "error-ex": { 285 | "version": "1.3.2", 286 | "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", 287 | "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", 288 | "requires": { 289 | "is-arrayish": "^0.2.1" 290 | } 291 | }, 292 | "es-abstract": { 293 | "version": "1.12.0", 294 | "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.12.0.tgz", 295 | "integrity": "sha512-C8Fx/0jFmV5IPoMOFPA9P9G5NtqW+4cOPit3MIuvR2t7Ag2K15EJTpxnHAYTzL+aYQJIESYeXZmDBfOBE1HcpA==", 296 | "requires": { 297 | "es-to-primitive": "^1.1.1", 298 | "function-bind": "^1.1.1", 299 | "has": "^1.0.1", 300 | "is-callable": "^1.1.3", 301 | "is-regex": "^1.0.4" 302 | } 303 | }, 304 | "es-to-primitive": { 305 | "version": "1.2.0", 306 | "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.0.tgz", 307 | "integrity": "sha512-qZryBOJjV//LaxLTV6UC//WewneB3LcXOL9NP++ozKVXsIIIpm/2c13UDiD9Jp2eThsecw9m3jPqDwTyobcdbg==", 308 | "requires": { 309 | "is-callable": "^1.1.4", 310 | "is-date-object": "^1.0.1", 311 | "is-symbol": "^1.0.2" 312 | } 313 | }, 314 | "escape-string-regexp": { 315 | "version": "1.0.5", 316 | "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", 317 | "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=" 318 | }, 319 | "eslint": { 320 | "version": "5.4.0", 321 | "resolved": "https://registry.npmjs.org/eslint/-/eslint-5.4.0.tgz", 322 | "integrity": "sha512-UIpL91XGex3qtL6qwyCQJar2j3osKxK9e3ano3OcGEIRM4oWIpCkDg9x95AXEC2wMs7PnxzOkPZ2gq+tsMS9yg==", 323 | "requires": { 324 | "ajv": "^6.5.0", 325 | "babel-code-frame": "^6.26.0", 326 | "chalk": "^2.1.0", 327 | "cross-spawn": "^6.0.5", 328 | "debug": "^3.1.0", 329 | "doctrine": "^2.1.0", 330 | "eslint-scope": "^4.0.0", 331 | "eslint-utils": "^1.3.1", 332 | "eslint-visitor-keys": "^1.0.0", 333 | "espree": "^4.0.0", 334 | "esquery": "^1.0.1", 335 | "esutils": "^2.0.2", 336 | "file-entry-cache": "^2.0.0", 337 | "functional-red-black-tree": "^1.0.1", 338 | "glob": "^7.1.2", 339 | "globals": "^11.7.0", 340 | "ignore": "^4.0.2", 341 | "imurmurhash": "^0.1.4", 342 | "inquirer": "^5.2.0", 343 | "is-resolvable": "^1.1.0", 344 | "js-yaml": "^3.11.0", 345 | "json-stable-stringify-without-jsonify": "^1.0.1", 346 | "levn": "^0.3.0", 347 | "lodash": "^4.17.5", 348 | "minimatch": "^3.0.4", 349 | "mkdirp": "^0.5.1", 350 | "natural-compare": "^1.4.0", 351 | "optionator": "^0.8.2", 352 | "path-is-inside": "^1.0.2", 353 | "pluralize": "^7.0.0", 354 | "progress": "^2.0.0", 355 | "regexpp": "^2.0.0", 356 | "require-uncached": "^1.0.3", 357 | "semver": "^5.5.0", 358 | "strip-ansi": "^4.0.0", 359 | "strip-json-comments": "^2.0.1", 360 | "table": "^4.0.3", 361 | "text-table": "^0.2.0" 362 | }, 363 | "dependencies": { 364 | "debug": { 365 | "version": "3.2.6", 366 | "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", 367 | "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", 368 | "requires": { 369 | "ms": "^2.1.1" 370 | } 371 | } 372 | } 373 | }, 374 | "eslint-config-standard": { 375 | "version": "12.0.0", 376 | "resolved": "https://registry.npmjs.org/eslint-config-standard/-/eslint-config-standard-12.0.0.tgz", 377 | "integrity": "sha512-COUz8FnXhqFitYj4DTqHzidjIL/t4mumGZto5c7DrBpvWoie+Sn3P4sLEzUGeYhRElWuFEf8K1S1EfvD1vixCQ==" 378 | }, 379 | "eslint-config-standard-jsx": { 380 | "version": "6.0.2", 381 | "resolved": "https://registry.npmjs.org/eslint-config-standard-jsx/-/eslint-config-standard-jsx-6.0.2.tgz", 382 | "integrity": "sha512-D+YWAoXw+2GIdbMBRAzWwr1ZtvnSf4n4yL0gKGg7ShUOGXkSOLerI17K4F6LdQMJPNMoWYqepzQD/fKY+tXNSg==" 383 | }, 384 | "eslint-import-resolver-node": { 385 | "version": "0.3.2", 386 | "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.2.tgz", 387 | "integrity": "sha512-sfmTqJfPSizWu4aymbPr4Iidp5yKm8yDkHp+Ir3YiTHiiDfxh69mOUsmiqW6RZ9zRXFaF64GtYmN7e+8GHBv6Q==", 388 | "requires": { 389 | "debug": "^2.6.9", 390 | "resolve": "^1.5.0" 391 | }, 392 | "dependencies": { 393 | "debug": { 394 | "version": "2.6.9", 395 | "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", 396 | "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", 397 | "requires": { 398 | "ms": "2.0.0" 399 | } 400 | }, 401 | "ms": { 402 | "version": "2.0.0", 403 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", 404 | "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" 405 | } 406 | } 407 | }, 408 | "eslint-module-utils": { 409 | "version": "2.2.0", 410 | "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.2.0.tgz", 411 | "integrity": "sha1-snA2LNiLGkitMIl2zn+lTphBF0Y=", 412 | "requires": { 413 | "debug": "^2.6.8", 414 | "pkg-dir": "^1.0.0" 415 | }, 416 | "dependencies": { 417 | "debug": { 418 | "version": "2.6.9", 419 | "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", 420 | "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", 421 | "requires": { 422 | "ms": "2.0.0" 423 | } 424 | }, 425 | "ms": { 426 | "version": "2.0.0", 427 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", 428 | "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" 429 | } 430 | } 431 | }, 432 | "eslint-plugin-es": { 433 | "version": "1.4.0", 434 | "resolved": "https://registry.npmjs.org/eslint-plugin-es/-/eslint-plugin-es-1.4.0.tgz", 435 | "integrity": "sha512-XfFmgFdIUDgvaRAlaXUkxrRg5JSADoRC8IkKLc/cISeR3yHVMefFHQZpcyXXEUUPHfy5DwviBcrfqlyqEwlQVw==", 436 | "requires": { 437 | "eslint-utils": "^1.3.0", 438 | "regexpp": "^2.0.1" 439 | } 440 | }, 441 | "eslint-plugin-import": { 442 | "version": "2.14.0", 443 | "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.14.0.tgz", 444 | "integrity": "sha512-FpuRtniD/AY6sXByma2Wr0TXvXJ4nA/2/04VPlfpmUDPOpOY264x+ILiwnrk/k4RINgDAyFZByxqPUbSQ5YE7g==", 445 | "requires": { 446 | "contains-path": "^0.1.0", 447 | "debug": "^2.6.8", 448 | "doctrine": "1.5.0", 449 | "eslint-import-resolver-node": "^0.3.1", 450 | "eslint-module-utils": "^2.2.0", 451 | "has": "^1.0.1", 452 | "lodash": "^4.17.4", 453 | "minimatch": "^3.0.3", 454 | "read-pkg-up": "^2.0.0", 455 | "resolve": "^1.6.0" 456 | }, 457 | "dependencies": { 458 | "debug": { 459 | "version": "2.6.9", 460 | "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", 461 | "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", 462 | "requires": { 463 | "ms": "2.0.0" 464 | } 465 | }, 466 | "doctrine": { 467 | "version": "1.5.0", 468 | "resolved": "http://registry.npmjs.org/doctrine/-/doctrine-1.5.0.tgz", 469 | "integrity": "sha1-N53Ocw9hZvds76TmcHoVmwLFpvo=", 470 | "requires": { 471 | "esutils": "^2.0.2", 472 | "isarray": "^1.0.0" 473 | } 474 | }, 475 | "ms": { 476 | "version": "2.0.0", 477 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", 478 | "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" 479 | } 480 | } 481 | }, 482 | "eslint-plugin-node": { 483 | "version": "7.0.1", 484 | "resolved": "https://registry.npmjs.org/eslint-plugin-node/-/eslint-plugin-node-7.0.1.tgz", 485 | "integrity": "sha512-lfVw3TEqThwq0j2Ba/Ckn2ABdwmL5dkOgAux1rvOk6CO7A6yGyPI2+zIxN6FyNkp1X1X/BSvKOceD6mBWSj4Yw==", 486 | "requires": { 487 | "eslint-plugin-es": "^1.3.1", 488 | "eslint-utils": "^1.3.1", 489 | "ignore": "^4.0.2", 490 | "minimatch": "^3.0.4", 491 | "resolve": "^1.8.1", 492 | "semver": "^5.5.0" 493 | } 494 | }, 495 | "eslint-plugin-promise": { 496 | "version": "4.0.1", 497 | "resolved": "https://registry.npmjs.org/eslint-plugin-promise/-/eslint-plugin-promise-4.0.1.tgz", 498 | "integrity": "sha512-Si16O0+Hqz1gDHsys6RtFRrW7cCTB6P7p3OJmKp3Y3dxpQE2qwOA7d3xnV+0mBmrPoi0RBnxlCKvqu70te6wjg==" 499 | }, 500 | "eslint-plugin-react": { 501 | "version": "7.11.1", 502 | "resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.11.1.tgz", 503 | "integrity": "sha512-cVVyMadRyW7qsIUh3FHp3u6QHNhOgVrLQYdQEB1bPWBsgbNCHdFAeNMquBMCcZJu59eNthX053L70l7gRt4SCw==", 504 | "requires": { 505 | "array-includes": "^3.0.3", 506 | "doctrine": "^2.1.0", 507 | "has": "^1.0.3", 508 | "jsx-ast-utils": "^2.0.1", 509 | "prop-types": "^15.6.2" 510 | } 511 | }, 512 | "eslint-plugin-standard": { 513 | "version": "4.0.0", 514 | "resolved": "https://registry.npmjs.org/eslint-plugin-standard/-/eslint-plugin-standard-4.0.0.tgz", 515 | "integrity": "sha512-OwxJkR6TQiYMmt1EsNRMe5qG3GsbjlcOhbGUBY4LtavF9DsLaTcoR+j2Tdjqi23oUwKNUqX7qcn5fPStafMdlA==" 516 | }, 517 | "eslint-scope": { 518 | "version": "4.0.0", 519 | "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-4.0.0.tgz", 520 | "integrity": "sha512-1G6UTDi7Jc1ELFwnR58HV4fK9OQK4S6N985f166xqXxpjU6plxFISJa2Ba9KCQuFa8RCnj/lSFJbHo7UFDBnUA==", 521 | "requires": { 522 | "esrecurse": "^4.1.0", 523 | "estraverse": "^4.1.1" 524 | } 525 | }, 526 | "eslint-utils": { 527 | "version": "1.3.1", 528 | "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-1.3.1.tgz", 529 | "integrity": "sha512-Z7YjnIldX+2XMcjr7ZkgEsOj/bREONV60qYeB/bjMAqqqZ4zxKyWX+BOUkdmRmA9riiIPVvo5x86m5elviOk0Q==" 530 | }, 531 | "eslint-visitor-keys": { 532 | "version": "1.0.0", 533 | "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz", 534 | "integrity": "sha512-qzm/XxIbxm/FHyH341ZrbnMUpe+5Bocte9xkmFMzPMjRaZMcXww+MpBptFvtU+79L362nqiLhekCxCxDPaUMBQ==" 535 | }, 536 | "espree": { 537 | "version": "4.1.0", 538 | "resolved": "https://registry.npmjs.org/espree/-/espree-4.1.0.tgz", 539 | "integrity": "sha512-I5BycZW6FCVIub93TeVY1s7vjhP9CY6cXCznIRfiig7nRviKZYdRnj/sHEWC6A7WE9RDWOFq9+7OsWSYz8qv2w==", 540 | "requires": { 541 | "acorn": "^6.0.2", 542 | "acorn-jsx": "^5.0.0", 543 | "eslint-visitor-keys": "^1.0.0" 544 | } 545 | }, 546 | "esprima": { 547 | "version": "4.0.1", 548 | "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", 549 | "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==" 550 | }, 551 | "esquery": { 552 | "version": "1.0.1", 553 | "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.0.1.tgz", 554 | "integrity": "sha512-SmiyZ5zIWH9VM+SRUReLS5Q8a7GxtRdxEBVZpm98rJM7Sb+A9DVCndXfkeFUd3byderg+EbDkfnevfCwynWaNA==", 555 | "requires": { 556 | "estraverse": "^4.0.0" 557 | } 558 | }, 559 | "esrecurse": { 560 | "version": "4.2.1", 561 | "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.2.1.tgz", 562 | "integrity": "sha512-64RBB++fIOAXPw3P9cy89qfMlvZEXZkqqJkjqqXIvzP5ezRZjW+lPWjw35UX/3EhUPFYbg5ER4JYgDw4007/DQ==", 563 | "requires": { 564 | "estraverse": "^4.1.0" 565 | } 566 | }, 567 | "estraverse": { 568 | "version": "4.2.0", 569 | "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.2.0.tgz", 570 | "integrity": "sha1-De4/7TH81GlhjOc0IJn8GvoL2xM=" 571 | }, 572 | "esutils": { 573 | "version": "2.0.2", 574 | "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", 575 | "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=" 576 | }, 577 | "external-editor": { 578 | "version": "2.2.0", 579 | "resolved": "http://registry.npmjs.org/external-editor/-/external-editor-2.2.0.tgz", 580 | "integrity": "sha512-bSn6gvGxKt+b7+6TKEv1ZycHleA7aHhRHyAqJyp5pbUFuYYNIzpZnQDk7AsYckyWdEnTeAnay0aCy2aV6iTk9A==", 581 | "requires": { 582 | "chardet": "^0.4.0", 583 | "iconv-lite": "^0.4.17", 584 | "tmp": "^0.0.33" 585 | } 586 | }, 587 | "fast-deep-equal": { 588 | "version": "2.0.1", 589 | "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz", 590 | "integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=" 591 | }, 592 | "fast-json-stable-stringify": { 593 | "version": "2.0.0", 594 | "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", 595 | "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=" 596 | }, 597 | "fast-levenshtein": { 598 | "version": "2.0.6", 599 | "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", 600 | "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=" 601 | }, 602 | "figures": { 603 | "version": "2.0.0", 604 | "resolved": "https://registry.npmjs.org/figures/-/figures-2.0.0.tgz", 605 | "integrity": "sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI=", 606 | "requires": { 607 | "escape-string-regexp": "^1.0.5" 608 | } 609 | }, 610 | "file-entry-cache": { 611 | "version": "2.0.0", 612 | "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-2.0.0.tgz", 613 | "integrity": "sha1-w5KZDD5oR4PYOLjISkXYoEhFg2E=", 614 | "requires": { 615 | "flat-cache": "^1.2.1", 616 | "object-assign": "^4.0.1" 617 | } 618 | }, 619 | "find-root": { 620 | "version": "1.1.0", 621 | "resolved": "https://registry.npmjs.org/find-root/-/find-root-1.1.0.tgz", 622 | "integrity": "sha512-NKfW6bec6GfKc0SGx1e07QZY9PE99u0Bft/0rzSD5k3sO/vwkVUpDUKVm5Gpp5Ue3YfShPFTX2070tDs5kB9Ng==" 623 | }, 624 | "find-up": { 625 | "version": "1.1.2", 626 | "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz", 627 | "integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=", 628 | "requires": { 629 | "path-exists": "^2.0.0", 630 | "pinkie-promise": "^2.0.0" 631 | } 632 | }, 633 | "flat-cache": { 634 | "version": "1.3.4", 635 | "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-1.3.4.tgz", 636 | "integrity": "sha512-VwyB3Lkgacfik2vhqR4uv2rvebqmDvFu4jlN/C1RzWoJEo8I7z4Q404oiqYCkq41mni8EzQnm95emU9seckwtg==", 637 | "requires": { 638 | "circular-json": "^0.3.1", 639 | "graceful-fs": "^4.1.2", 640 | "rimraf": "~2.6.2", 641 | "write": "^0.2.1" 642 | } 643 | }, 644 | "fs.realpath": { 645 | "version": "1.0.0", 646 | "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", 647 | "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" 648 | }, 649 | "function-bind": { 650 | "version": "1.1.1", 651 | "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", 652 | "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" 653 | }, 654 | "functional-red-black-tree": { 655 | "version": "1.0.1", 656 | "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", 657 | "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=" 658 | }, 659 | "get-stdin": { 660 | "version": "6.0.0", 661 | "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-6.0.0.tgz", 662 | "integrity": "sha512-jp4tHawyV7+fkkSKyvjuLZswblUtz+SQKzSWnBbii16BuZksJlU1wuBYXY75r+duh/llF1ur6oNwi+2ZzjKZ7g==" 663 | }, 664 | "glob": { 665 | "version": "7.1.3", 666 | "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", 667 | "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", 668 | "requires": { 669 | "fs.realpath": "^1.0.0", 670 | "inflight": "^1.0.4", 671 | "inherits": "2", 672 | "minimatch": "^3.0.4", 673 | "once": "^1.3.0", 674 | "path-is-absolute": "^1.0.0" 675 | } 676 | }, 677 | "globals": { 678 | "version": "11.9.0", 679 | "resolved": "https://registry.npmjs.org/globals/-/globals-11.9.0.tgz", 680 | "integrity": "sha512-5cJVtyXWH8PiJPVLZzzoIizXx944O4OmRro5MWKx5fT4MgcN7OfaMutPeaTdJCCURwbWdhhcCWcKIffPnmTzBg==" 681 | }, 682 | "graceful-fs": { 683 | "version": "4.1.15", 684 | "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.15.tgz", 685 | "integrity": "sha512-6uHUhOPEBgQ24HM+r6b/QwWfZq+yiFcipKFrOFiBEnWdy5sdzYoi+pJeQaPI5qOLRFqWmAXUPQNsielzdLoecA==" 686 | }, 687 | "has": { 688 | "version": "1.0.3", 689 | "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", 690 | "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", 691 | "requires": { 692 | "function-bind": "^1.1.1" 693 | } 694 | }, 695 | "has-ansi": { 696 | "version": "2.0.0", 697 | "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", 698 | "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", 699 | "requires": { 700 | "ansi-regex": "^2.0.0" 701 | } 702 | }, 703 | "has-flag": { 704 | "version": "3.0.0", 705 | "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", 706 | "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=" 707 | }, 708 | "has-symbols": { 709 | "version": "1.0.0", 710 | "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.0.tgz", 711 | "integrity": "sha1-uhqPGvKg/DllD1yFA2dwQSIGO0Q=" 712 | }, 713 | "hosted-git-info": { 714 | "version": "2.7.1", 715 | "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.7.1.tgz", 716 | "integrity": "sha512-7T/BxH19zbcCTa8XkMlbK5lTo1WtgkFi3GvdWEyNuc4Vex7/9Dqbnpsf4JMydcfj9HCg4zUWFTL3Za6lapg5/w==" 717 | }, 718 | "iconv-lite": { 719 | "version": "0.4.24", 720 | "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", 721 | "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", 722 | "requires": { 723 | "safer-buffer": ">= 2.1.2 < 3" 724 | } 725 | }, 726 | "ignore": { 727 | "version": "4.0.6", 728 | "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", 729 | "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==" 730 | }, 731 | "imurmurhash": { 732 | "version": "0.1.4", 733 | "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", 734 | "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=" 735 | }, 736 | "inflight": { 737 | "version": "1.0.6", 738 | "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", 739 | "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", 740 | "requires": { 741 | "once": "^1.3.0", 742 | "wrappy": "1" 743 | } 744 | }, 745 | "inherits": { 746 | "version": "2.0.3", 747 | "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", 748 | "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" 749 | }, 750 | "inquirer": { 751 | "version": "5.2.0", 752 | "resolved": "http://registry.npmjs.org/inquirer/-/inquirer-5.2.0.tgz", 753 | "integrity": "sha512-E9BmnJbAKLPGonz0HeWHtbKf+EeSP93paWO3ZYoUpq/aowXvYGjjCSuashhXPpzbArIjBbji39THkxTz9ZeEUQ==", 754 | "requires": { 755 | "ansi-escapes": "^3.0.0", 756 | "chalk": "^2.0.0", 757 | "cli-cursor": "^2.1.0", 758 | "cli-width": "^2.0.0", 759 | "external-editor": "^2.1.0", 760 | "figures": "^2.0.0", 761 | "lodash": "^4.3.0", 762 | "mute-stream": "0.0.7", 763 | "run-async": "^2.2.0", 764 | "rxjs": "^5.5.2", 765 | "string-width": "^2.1.0", 766 | "strip-ansi": "^4.0.0", 767 | "through": "^2.3.6" 768 | } 769 | }, 770 | "is-arrayish": { 771 | "version": "0.2.1", 772 | "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", 773 | "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=" 774 | }, 775 | "is-builtin-module": { 776 | "version": "1.0.0", 777 | "resolved": "http://registry.npmjs.org/is-builtin-module/-/is-builtin-module-1.0.0.tgz", 778 | "integrity": "sha1-VAVy0096wxGfj3bDDLwbHgN6/74=", 779 | "requires": { 780 | "builtin-modules": "^1.0.0" 781 | } 782 | }, 783 | "is-callable": { 784 | "version": "1.1.4", 785 | "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.4.tgz", 786 | "integrity": "sha512-r5p9sxJjYnArLjObpjA4xu5EKI3CuKHkJXMhT7kwbpUyIFD1n5PMAsoPvWnvtZiNz7LjkYDRZhd7FlI0eMijEA==" 787 | }, 788 | "is-date-object": { 789 | "version": "1.0.1", 790 | "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.1.tgz", 791 | "integrity": "sha1-mqIOtq7rv/d/vTPnTKAbM1gdOhY=" 792 | }, 793 | "is-fullwidth-code-point": { 794 | "version": "2.0.0", 795 | "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", 796 | "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=" 797 | }, 798 | "is-promise": { 799 | "version": "2.1.0", 800 | "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.1.0.tgz", 801 | "integrity": "sha1-eaKp7OfwlugPNtKy87wWwf9L8/o=" 802 | }, 803 | "is-regex": { 804 | "version": "1.0.4", 805 | "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.4.tgz", 806 | "integrity": "sha1-VRdIm1RwkbCTDglWVM7SXul+lJE=", 807 | "requires": { 808 | "has": "^1.0.1" 809 | } 810 | }, 811 | "is-resolvable": { 812 | "version": "1.1.0", 813 | "resolved": "https://registry.npmjs.org/is-resolvable/-/is-resolvable-1.1.0.tgz", 814 | "integrity": "sha512-qgDYXFSR5WvEfuS5dMj6oTMEbrrSaM0CrFk2Yiq/gXnBvD9pMa2jGXxyhGLfvhZpuMZe18CJpFxAt3CRs42NMg==" 815 | }, 816 | "is-symbol": { 817 | "version": "1.0.2", 818 | "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.2.tgz", 819 | "integrity": "sha512-HS8bZ9ox60yCJLH9snBpIwv9pYUAkcuLhSA1oero1UB5y9aiQpRA8y2ex945AOtCZL1lJDeIk3G5LthswI46Lw==", 820 | "requires": { 821 | "has-symbols": "^1.0.0" 822 | } 823 | }, 824 | "isarray": { 825 | "version": "1.0.0", 826 | "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", 827 | "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" 828 | }, 829 | "isexe": { 830 | "version": "2.0.0", 831 | "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", 832 | "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=" 833 | }, 834 | "js-tokens": { 835 | "version": "3.0.2", 836 | "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz", 837 | "integrity": "sha1-mGbfOVECEw449/mWvOtlRDIJwls=" 838 | }, 839 | "js-yaml": { 840 | "version": "3.12.0", 841 | "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.12.0.tgz", 842 | "integrity": "sha512-PIt2cnwmPfL4hKNwqeiuz4bKfnzHTBv6HyVgjahA6mPLwPDzjDWrplJBMjHUFxku/N3FlmrbyPclad+I+4mJ3A==", 843 | "requires": { 844 | "argparse": "^1.0.7", 845 | "esprima": "^4.0.0" 846 | } 847 | }, 848 | "json-parse-better-errors": { 849 | "version": "1.0.2", 850 | "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", 851 | "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==" 852 | }, 853 | "json-schema-traverse": { 854 | "version": "0.4.1", 855 | "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", 856 | "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" 857 | }, 858 | "json-stable-stringify-without-jsonify": { 859 | "version": "1.0.1", 860 | "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", 861 | "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=" 862 | }, 863 | "jsx-ast-utils": { 864 | "version": "2.0.1", 865 | "resolved": "https://registry.npmjs.org/jsx-ast-utils/-/jsx-ast-utils-2.0.1.tgz", 866 | "integrity": "sha1-6AGxs5mF4g//yHtA43SAgOLcrH8=", 867 | "requires": { 868 | "array-includes": "^3.0.3" 869 | } 870 | }, 871 | "levn": { 872 | "version": "0.3.0", 873 | "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", 874 | "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", 875 | "requires": { 876 | "prelude-ls": "~1.1.2", 877 | "type-check": "~0.3.2" 878 | } 879 | }, 880 | "load-json-file": { 881 | "version": "2.0.0", 882 | "resolved": "http://registry.npmjs.org/load-json-file/-/load-json-file-2.0.0.tgz", 883 | "integrity": "sha1-eUfkIUmvgNaWy/eXvKq8/h/inKg=", 884 | "requires": { 885 | "graceful-fs": "^4.1.2", 886 | "parse-json": "^2.2.0", 887 | "pify": "^2.0.0", 888 | "strip-bom": "^3.0.0" 889 | } 890 | }, 891 | "locate-path": { 892 | "version": "2.0.0", 893 | "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", 894 | "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", 895 | "requires": { 896 | "p-locate": "^2.0.0", 897 | "path-exists": "^3.0.0" 898 | }, 899 | "dependencies": { 900 | "path-exists": { 901 | "version": "3.0.0", 902 | "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", 903 | "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=" 904 | } 905 | } 906 | }, 907 | "lodash": { 908 | "version": "4.17.11", 909 | "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", 910 | "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==" 911 | }, 912 | "lodash.get": { 913 | "version": "4.4.2", 914 | "resolved": "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz", 915 | "integrity": "sha1-LRd/ZS+jHpObRDjVNBSZ36OCXpk=" 916 | }, 917 | "lodash.merge": { 918 | "version": "4.6.1", 919 | "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.1.tgz", 920 | "integrity": "sha512-AOYza4+Hf5z1/0Hztxpm2/xiPZgi/cjMqdnKTUWTBSKchJlxXXuUSxCCl8rJlf4g6yww/j6mA8nC8Hw/EZWxKQ==" 921 | }, 922 | "lodash.reduce": { 923 | "version": "4.6.0", 924 | "resolved": "https://registry.npmjs.org/lodash.reduce/-/lodash.reduce-4.6.0.tgz", 925 | "integrity": "sha1-8atrg5KZrUj3hKu/R2WW8DuRTTs=" 926 | }, 927 | "loose-envify": { 928 | "version": "1.4.0", 929 | "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", 930 | "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", 931 | "requires": { 932 | "js-tokens": "^3.0.0 || ^4.0.0" 933 | } 934 | }, 935 | "macaddress": { 936 | "version": "0.2.9", 937 | "resolved": "https://registry.npmjs.org/macaddress/-/macaddress-0.2.9.tgz", 938 | "integrity": "sha512-k4F1JUof6cQXxNFzx3thLby4oJzXTXQueAOOts944Vqizn+Rjc2QNFenT9FJSLU1CH3PmrHRSyZs2E+Cqw+P2w==" 939 | }, 940 | "mimic-fn": { 941 | "version": "1.2.0", 942 | "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", 943 | "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==" 944 | }, 945 | "minecraft-data": { 946 | "version": "2.35.0", 947 | "resolved": "https://registry.npmjs.org/minecraft-data/-/minecraft-data-2.35.0.tgz", 948 | "integrity": "sha512-MooL/Sx6rnDr+vz6RXvh7/A0nWPrXyoxGuj2Iyp+essjzNOV33dJbQMMl4CgiZ0V2XxyngK322wcfnEWZKUSbQ==", 949 | "requires": { 950 | "standard": "^12.0.1" 951 | } 952 | }, 953 | "minecraft-protocol": { 954 | "version": "1.8.3", 955 | "resolved": "https://registry.npmjs.org/minecraft-protocol/-/minecraft-protocol-1.8.3.tgz", 956 | "integrity": "sha512-y7c4aADZwabpx0Ub+D2tFc4VHLLO0aKp5AsaQY37ho6pE5RkVbdaDV/s6k4D274Fku94dBWiuBltjwj4CFsvTg==", 957 | "requires": { 958 | "buffer-equal": "^1.0.0", 959 | "debug": "^4.1.0", 960 | "endian-toggle": "^0.0.0", 961 | "lodash.get": "^4.1.2", 962 | "lodash.merge": "^4.3.0", 963 | "minecraft-data": "^2.34.0", 964 | "node-rsa": "^0.4.2", 965 | "prismarine-nbt": "^1.2.0", 966 | "protodef": "^1.6.7", 967 | "readable-stream": "^3.0.6", 968 | "uuid-1345": "^0.99.6", 969 | "yggdrasil": "^1.1.1" 970 | } 971 | }, 972 | "minimatch": { 973 | "version": "3.0.4", 974 | "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", 975 | "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", 976 | "requires": { 977 | "brace-expansion": "^1.1.7" 978 | } 979 | }, 980 | "minimist": { 981 | "version": "0.0.8", 982 | "resolved": "http://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", 983 | "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=" 984 | }, 985 | "mkdirp": { 986 | "version": "0.5.1", 987 | "resolved": "http://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", 988 | "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", 989 | "requires": { 990 | "minimist": "0.0.8" 991 | } 992 | }, 993 | "ms": { 994 | "version": "2.1.1", 995 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", 996 | "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==" 997 | }, 998 | "mute-stream": { 999 | "version": "0.0.7", 1000 | "resolved": "http://registry.npmjs.org/mute-stream/-/mute-stream-0.0.7.tgz", 1001 | "integrity": "sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s=" 1002 | }, 1003 | "natural-compare": { 1004 | "version": "1.4.0", 1005 | "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", 1006 | "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=" 1007 | }, 1008 | "nice-try": { 1009 | "version": "1.0.5", 1010 | "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", 1011 | "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==" 1012 | }, 1013 | "node-rsa": { 1014 | "version": "0.4.2", 1015 | "resolved": "http://registry.npmjs.org/node-rsa/-/node-rsa-0.4.2.tgz", 1016 | "integrity": "sha1-1jkXKewWqDDtWjgEKzFX0tXXJTA=", 1017 | "requires": { 1018 | "asn1": "0.2.3" 1019 | } 1020 | }, 1021 | "normalize-package-data": { 1022 | "version": "2.4.0", 1023 | "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.4.0.tgz", 1024 | "integrity": "sha512-9jjUFbTPfEy3R/ad/2oNbKtW9Hgovl5O1FvFWKkKblNXoN/Oou6+9+KKohPK13Yc3/TyunyWhJp6gvRNR/PPAw==", 1025 | "requires": { 1026 | "hosted-git-info": "^2.1.4", 1027 | "is-builtin-module": "^1.0.0", 1028 | "semver": "2 || 3 || 4 || 5", 1029 | "validate-npm-package-license": "^3.0.1" 1030 | } 1031 | }, 1032 | "object-assign": { 1033 | "version": "4.1.1", 1034 | "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", 1035 | "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=" 1036 | }, 1037 | "object-keys": { 1038 | "version": "1.0.12", 1039 | "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.0.12.tgz", 1040 | "integrity": "sha512-FTMyFUm2wBcGHnH2eXmz7tC6IwlqQZ6mVZ+6dm6vZ4IQIHjs6FdNsQBuKGPuUUUY6NfJw2PshC08Tn6LzLDOag==" 1041 | }, 1042 | "once": { 1043 | "version": "1.4.0", 1044 | "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", 1045 | "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", 1046 | "requires": { 1047 | "wrappy": "1" 1048 | } 1049 | }, 1050 | "onetime": { 1051 | "version": "2.0.1", 1052 | "resolved": "https://registry.npmjs.org/onetime/-/onetime-2.0.1.tgz", 1053 | "integrity": "sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ=", 1054 | "requires": { 1055 | "mimic-fn": "^1.0.0" 1056 | } 1057 | }, 1058 | "optionator": { 1059 | "version": "0.8.2", 1060 | "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.2.tgz", 1061 | "integrity": "sha1-NkxeQJ0/TWMB1sC0wFu6UBgK62Q=", 1062 | "requires": { 1063 | "deep-is": "~0.1.3", 1064 | "fast-levenshtein": "~2.0.4", 1065 | "levn": "~0.3.0", 1066 | "prelude-ls": "~1.1.2", 1067 | "type-check": "~0.3.2", 1068 | "wordwrap": "~1.0.0" 1069 | } 1070 | }, 1071 | "os-tmpdir": { 1072 | "version": "1.0.2", 1073 | "resolved": "http://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", 1074 | "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=" 1075 | }, 1076 | "p-limit": { 1077 | "version": "1.3.0", 1078 | "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", 1079 | "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", 1080 | "requires": { 1081 | "p-try": "^1.0.0" 1082 | } 1083 | }, 1084 | "p-locate": { 1085 | "version": "2.0.0", 1086 | "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", 1087 | "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", 1088 | "requires": { 1089 | "p-limit": "^1.1.0" 1090 | } 1091 | }, 1092 | "p-try": { 1093 | "version": "1.0.0", 1094 | "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", 1095 | "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=" 1096 | }, 1097 | "parse-json": { 1098 | "version": "2.2.0", 1099 | "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", 1100 | "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", 1101 | "requires": { 1102 | "error-ex": "^1.2.0" 1103 | } 1104 | }, 1105 | "path-exists": { 1106 | "version": "2.1.0", 1107 | "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz", 1108 | "integrity": "sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=", 1109 | "requires": { 1110 | "pinkie-promise": "^2.0.0" 1111 | } 1112 | }, 1113 | "path-is-absolute": { 1114 | "version": "1.0.1", 1115 | "resolved": "http://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", 1116 | "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" 1117 | }, 1118 | "path-is-inside": { 1119 | "version": "1.0.2", 1120 | "resolved": "https://registry.npmjs.org/path-is-inside/-/path-is-inside-1.0.2.tgz", 1121 | "integrity": "sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM=" 1122 | }, 1123 | "path-key": { 1124 | "version": "2.0.1", 1125 | "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", 1126 | "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=" 1127 | }, 1128 | "path-parse": { 1129 | "version": "1.0.6", 1130 | "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", 1131 | "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==" 1132 | }, 1133 | "path-type": { 1134 | "version": "2.0.0", 1135 | "resolved": "https://registry.npmjs.org/path-type/-/path-type-2.0.0.tgz", 1136 | "integrity": "sha1-8BLMuEFbcJb8LaoQVMPXI4lZTHM=", 1137 | "requires": { 1138 | "pify": "^2.0.0" 1139 | } 1140 | }, 1141 | "phin": { 1142 | "version": "2.9.3", 1143 | "resolved": "https://registry.npmjs.org/phin/-/phin-2.9.3.tgz", 1144 | "integrity": "sha512-CzFr90qM24ju5f88quFC/6qohjC144rehe5n6DH900lgXmUe86+xCKc10ev56gRKC4/BkHUoG4uSiQgBiIXwDA==" 1145 | }, 1146 | "pify": { 1147 | "version": "2.3.0", 1148 | "resolved": "http://registry.npmjs.org/pify/-/pify-2.3.0.tgz", 1149 | "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=" 1150 | }, 1151 | "pinkie": { 1152 | "version": "2.0.4", 1153 | "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", 1154 | "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=" 1155 | }, 1156 | "pinkie-promise": { 1157 | "version": "2.0.1", 1158 | "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", 1159 | "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", 1160 | "requires": { 1161 | "pinkie": "^2.0.0" 1162 | } 1163 | }, 1164 | "pkg-conf": { 1165 | "version": "2.1.0", 1166 | "resolved": "https://registry.npmjs.org/pkg-conf/-/pkg-conf-2.1.0.tgz", 1167 | "integrity": "sha1-ISZRTKbyq/69FoWW3xi6V4Z/AFg=", 1168 | "requires": { 1169 | "find-up": "^2.0.0", 1170 | "load-json-file": "^4.0.0" 1171 | }, 1172 | "dependencies": { 1173 | "find-up": { 1174 | "version": "2.1.0", 1175 | "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", 1176 | "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", 1177 | "requires": { 1178 | "locate-path": "^2.0.0" 1179 | } 1180 | }, 1181 | "load-json-file": { 1182 | "version": "4.0.0", 1183 | "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz", 1184 | "integrity": "sha1-L19Fq5HjMhYjT9U62rZo607AmTs=", 1185 | "requires": { 1186 | "graceful-fs": "^4.1.2", 1187 | "parse-json": "^4.0.0", 1188 | "pify": "^3.0.0", 1189 | "strip-bom": "^3.0.0" 1190 | } 1191 | }, 1192 | "parse-json": { 1193 | "version": "4.0.0", 1194 | "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", 1195 | "integrity": "sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=", 1196 | "requires": { 1197 | "error-ex": "^1.3.1", 1198 | "json-parse-better-errors": "^1.0.1" 1199 | } 1200 | }, 1201 | "pify": { 1202 | "version": "3.0.0", 1203 | "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", 1204 | "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=" 1205 | } 1206 | } 1207 | }, 1208 | "pkg-config": { 1209 | "version": "1.1.1", 1210 | "resolved": "https://registry.npmjs.org/pkg-config/-/pkg-config-1.1.1.tgz", 1211 | "integrity": "sha1-VX7yLXPaPIg3EHdmxS6tq94pj+Q=", 1212 | "requires": { 1213 | "debug-log": "^1.0.0", 1214 | "find-root": "^1.0.0", 1215 | "xtend": "^4.0.1" 1216 | } 1217 | }, 1218 | "pkg-dir": { 1219 | "version": "1.0.0", 1220 | "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-1.0.0.tgz", 1221 | "integrity": "sha1-ektQio1bstYp1EcFb/TpyTFM89Q=", 1222 | "requires": { 1223 | "find-up": "^1.0.0" 1224 | } 1225 | }, 1226 | "pluralize": { 1227 | "version": "7.0.0", 1228 | "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-7.0.0.tgz", 1229 | "integrity": "sha512-ARhBOdzS3e41FbkW/XWrTEtukqqLoK5+Z/4UeDaLuSW+39JPeFgs4gCGqsrJHVZX0fUrx//4OF0K1CUGwlIFow==" 1230 | }, 1231 | "prelude-ls": { 1232 | "version": "1.1.2", 1233 | "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", 1234 | "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=" 1235 | }, 1236 | "prismarine-nbt": { 1237 | "version": "1.2.1", 1238 | "resolved": "https://registry.npmjs.org/prismarine-nbt/-/prismarine-nbt-1.2.1.tgz", 1239 | "integrity": "sha512-E2bBd2XzmcynT67zrkucgrC2MIgjmUtUathJ9sfjTswT+ou+7kbHbbLHO3nHLb6TKGiWFH79OfUmBTHJFULpbw==", 1240 | "requires": { 1241 | "protodef": "^1.2.1" 1242 | } 1243 | }, 1244 | "progress": { 1245 | "version": "2.0.3", 1246 | "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", 1247 | "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==" 1248 | }, 1249 | "prop-types": { 1250 | "version": "15.6.2", 1251 | "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.6.2.tgz", 1252 | "integrity": "sha512-3pboPvLiWD7dkI3qf3KbUe6hKFKa52w+AE0VCqECtf+QHAKgOL37tTaNCnuX1nAAQ4ZhyP+kYVKf8rLmJ/feDQ==", 1253 | "requires": { 1254 | "loose-envify": "^1.3.1", 1255 | "object-assign": "^4.1.1" 1256 | } 1257 | }, 1258 | "protodef": { 1259 | "version": "1.6.9", 1260 | "resolved": "https://registry.npmjs.org/protodef/-/protodef-1.6.9.tgz", 1261 | "integrity": "sha512-evAmLjdHgQ3B+wYyCgEijQxSBW049psaXCQlvg6PeJGhgTGEcMrn3M7idHbYvpGNKVIqwnIx8dpFpz1CJNm1wQ==", 1262 | "requires": { 1263 | "lodash.get": "^4.4.2", 1264 | "lodash.reduce": "^4.6.0", 1265 | "protodef-validator": "^1.2.2", 1266 | "readable-stream": "^3.0.3" 1267 | } 1268 | }, 1269 | "protodef-validator": { 1270 | "version": "1.2.2", 1271 | "resolved": "https://registry.npmjs.org/protodef-validator/-/protodef-validator-1.2.2.tgz", 1272 | "integrity": "sha512-EnfcF1v/FGPtkwQr6SAbCM+9IoMCXlhtUVQKgeavUXoJ4FLNk3dZ0jIg/KDnTmaVgvDdHXhg1foH/qTae9vfhw==", 1273 | "requires": { 1274 | "ajv": "^6.5.4" 1275 | } 1276 | }, 1277 | "punycode": { 1278 | "version": "2.1.1", 1279 | "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", 1280 | "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==" 1281 | }, 1282 | "read-pkg": { 1283 | "version": "2.0.0", 1284 | "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-2.0.0.tgz", 1285 | "integrity": "sha1-jvHAYjxqbbDcZxPEv6xGMysjaPg=", 1286 | "requires": { 1287 | "load-json-file": "^2.0.0", 1288 | "normalize-package-data": "^2.3.2", 1289 | "path-type": "^2.0.0" 1290 | } 1291 | }, 1292 | "read-pkg-up": { 1293 | "version": "2.0.0", 1294 | "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-2.0.0.tgz", 1295 | "integrity": "sha1-a3KoBImE4MQeeVEP1en6mbO1Sb4=", 1296 | "requires": { 1297 | "find-up": "^2.0.0", 1298 | "read-pkg": "^2.0.0" 1299 | }, 1300 | "dependencies": { 1301 | "find-up": { 1302 | "version": "2.1.0", 1303 | "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", 1304 | "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", 1305 | "requires": { 1306 | "locate-path": "^2.0.0" 1307 | } 1308 | } 1309 | } 1310 | }, 1311 | "readable-stream": { 1312 | "version": "3.1.1", 1313 | "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.1.1.tgz", 1314 | "integrity": "sha512-DkN66hPyqDhnIQ6Jcsvx9bFjhw214O4poMBcIMgPVpQvNy9a0e0Uhg5SqySyDKAmUlwt8LonTBz1ezOnM8pUdA==", 1315 | "requires": { 1316 | "inherits": "^2.0.3", 1317 | "string_decoder": "^1.1.1", 1318 | "util-deprecate": "^1.0.1" 1319 | } 1320 | }, 1321 | "regexpp": { 1322 | "version": "2.0.1", 1323 | "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-2.0.1.tgz", 1324 | "integrity": "sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw==" 1325 | }, 1326 | "require-uncached": { 1327 | "version": "1.0.3", 1328 | "resolved": "http://registry.npmjs.org/require-uncached/-/require-uncached-1.0.3.tgz", 1329 | "integrity": "sha1-Tg1W1slmL9MeQwEcS5WqSZVUIdM=", 1330 | "requires": { 1331 | "caller-path": "^0.1.0", 1332 | "resolve-from": "^1.0.0" 1333 | } 1334 | }, 1335 | "resolve": { 1336 | "version": "1.9.0", 1337 | "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.9.0.tgz", 1338 | "integrity": "sha512-TZNye00tI67lwYvzxCxHGjwTNlUV70io54/Ed4j6PscB8xVfuBJpRenI/o6dVk0cY0PYTY27AgCoGGxRnYuItQ==", 1339 | "requires": { 1340 | "path-parse": "^1.0.6" 1341 | } 1342 | }, 1343 | "resolve-from": { 1344 | "version": "1.0.1", 1345 | "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-1.0.1.tgz", 1346 | "integrity": "sha1-Jsv+k10a7uq7Kbw/5a6wHpPUQiY=" 1347 | }, 1348 | "restore-cursor": { 1349 | "version": "2.0.0", 1350 | "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz", 1351 | "integrity": "sha1-n37ih/gv0ybU/RYpI9YhKe7g368=", 1352 | "requires": { 1353 | "onetime": "^2.0.0", 1354 | "signal-exit": "^3.0.2" 1355 | } 1356 | }, 1357 | "rimraf": { 1358 | "version": "2.6.2", 1359 | "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.2.tgz", 1360 | "integrity": "sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w==", 1361 | "requires": { 1362 | "glob": "^7.0.5" 1363 | } 1364 | }, 1365 | "run-async": { 1366 | "version": "2.3.0", 1367 | "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.3.0.tgz", 1368 | "integrity": "sha1-A3GrSuC91yDUFm19/aZP96RFpsA=", 1369 | "requires": { 1370 | "is-promise": "^2.1.0" 1371 | } 1372 | }, 1373 | "run-parallel": { 1374 | "version": "1.1.9", 1375 | "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.1.9.tgz", 1376 | "integrity": "sha512-DEqnSRTDw/Tc3FXf49zedI638Z9onwUotBMiUFKmrO2sdFKIbXamXGQ3Axd4qgphxKB4kw/qP1w5kTxnfU1B9Q==" 1377 | }, 1378 | "rxjs": { 1379 | "version": "5.5.12", 1380 | "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-5.5.12.tgz", 1381 | "integrity": "sha512-xx2itnL5sBbqeeiVgNPVuQQ1nC8Jp2WfNJhXWHmElW9YmrpS9UVnNzhP3EH3HFqexO5Tlp8GhYY+WEcqcVMvGw==", 1382 | "requires": { 1383 | "symbol-observable": "1.0.1" 1384 | } 1385 | }, 1386 | "safe-buffer": { 1387 | "version": "5.1.2", 1388 | "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", 1389 | "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" 1390 | }, 1391 | "safer-buffer": { 1392 | "version": "2.1.2", 1393 | "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", 1394 | "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" 1395 | }, 1396 | "semver": { 1397 | "version": "5.6.0", 1398 | "resolved": "https://registry.npmjs.org/semver/-/semver-5.6.0.tgz", 1399 | "integrity": "sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg==" 1400 | }, 1401 | "shebang-command": { 1402 | "version": "1.2.0", 1403 | "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", 1404 | "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", 1405 | "requires": { 1406 | "shebang-regex": "^1.0.0" 1407 | } 1408 | }, 1409 | "shebang-regex": { 1410 | "version": "1.0.0", 1411 | "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", 1412 | "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=" 1413 | }, 1414 | "signal-exit": { 1415 | "version": "3.0.2", 1416 | "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", 1417 | "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=" 1418 | }, 1419 | "slice-ansi": { 1420 | "version": "1.0.0", 1421 | "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-1.0.0.tgz", 1422 | "integrity": "sha512-POqxBK6Lb3q6s047D/XsDVNPnF9Dl8JSaqe9h9lURl0OdNqy/ujDrOiIHtsqXMGbWWTIomRzAMaTyawAU//Reg==", 1423 | "requires": { 1424 | "is-fullwidth-code-point": "^2.0.0" 1425 | } 1426 | }, 1427 | "spdx-correct": { 1428 | "version": "3.1.0", 1429 | "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.0.tgz", 1430 | "integrity": "sha512-lr2EZCctC2BNR7j7WzJ2FpDznxky1sjfxvvYEyzxNyb6lZXHODmEoJeFu4JupYlkfha1KZpJyoqiJ7pgA1qq8Q==", 1431 | "requires": { 1432 | "spdx-expression-parse": "^3.0.0", 1433 | "spdx-license-ids": "^3.0.0" 1434 | } 1435 | }, 1436 | "spdx-exceptions": { 1437 | "version": "2.2.0", 1438 | "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.2.0.tgz", 1439 | "integrity": "sha512-2XQACfElKi9SlVb1CYadKDXvoajPgBVPn/gOQLrTvHdElaVhr7ZEbqJaRnJLVNeaI4cMEAgVCeBMKF6MWRDCRA==" 1440 | }, 1441 | "spdx-expression-parse": { 1442 | "version": "3.0.0", 1443 | "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz", 1444 | "integrity": "sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg==", 1445 | "requires": { 1446 | "spdx-exceptions": "^2.1.0", 1447 | "spdx-license-ids": "^3.0.0" 1448 | } 1449 | }, 1450 | "spdx-license-ids": { 1451 | "version": "3.0.3", 1452 | "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.3.tgz", 1453 | "integrity": "sha512-uBIcIl3Ih6Phe3XHK1NqboJLdGfwr1UN3k6wSD1dZpmPsIkb8AGNbZYJ1fOBk834+Gxy8rpfDxrS6XLEMZMY2g==" 1454 | }, 1455 | "sprintf-js": { 1456 | "version": "1.0.3", 1457 | "resolved": "http://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", 1458 | "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=" 1459 | }, 1460 | "standard": { 1461 | "version": "12.0.1", 1462 | "resolved": "https://registry.npmjs.org/standard/-/standard-12.0.1.tgz", 1463 | "integrity": "sha512-UqdHjh87OG2gUrNCSM4QRLF5n9h3TFPwrCNyVlkqu31Hej0L/rc8hzKqVvkb2W3x0WMq7PzZdkLfEcBhVOR6lg==", 1464 | "requires": { 1465 | "eslint": "~5.4.0", 1466 | "eslint-config-standard": "12.0.0", 1467 | "eslint-config-standard-jsx": "6.0.2", 1468 | "eslint-plugin-import": "~2.14.0", 1469 | "eslint-plugin-node": "~7.0.1", 1470 | "eslint-plugin-promise": "~4.0.0", 1471 | "eslint-plugin-react": "~7.11.1", 1472 | "eslint-plugin-standard": "~4.0.0", 1473 | "standard-engine": "~9.0.0" 1474 | } 1475 | }, 1476 | "standard-engine": { 1477 | "version": "9.0.0", 1478 | "resolved": "https://registry.npmjs.org/standard-engine/-/standard-engine-9.0.0.tgz", 1479 | "integrity": "sha512-ZfNfCWZ2Xq67VNvKMPiVMKHnMdvxYzvZkf1AH8/cw2NLDBm5LRsxMqvEJpsjLI/dUosZ3Z1d6JlHDp5rAvvk2w==", 1480 | "requires": { 1481 | "deglob": "^2.1.0", 1482 | "get-stdin": "^6.0.0", 1483 | "minimist": "^1.1.0", 1484 | "pkg-conf": "^2.0.0" 1485 | }, 1486 | "dependencies": { 1487 | "minimist": { 1488 | "version": "1.2.0", 1489 | "resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", 1490 | "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=" 1491 | } 1492 | } 1493 | }, 1494 | "string-width": { 1495 | "version": "2.1.1", 1496 | "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", 1497 | "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", 1498 | "requires": { 1499 | "is-fullwidth-code-point": "^2.0.0", 1500 | "strip-ansi": "^4.0.0" 1501 | } 1502 | }, 1503 | "string_decoder": { 1504 | "version": "1.2.0", 1505 | "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.2.0.tgz", 1506 | "integrity": "sha512-6YqyX6ZWEYguAxgZzHGL7SsCeGx3V2TtOTqZz1xSTSWnqsbWwbptafNyvf/ACquZUXV3DANr5BDIwNYe1mN42w==", 1507 | "requires": { 1508 | "safe-buffer": "~5.1.0" 1509 | } 1510 | }, 1511 | "strip-ansi": { 1512 | "version": "4.0.0", 1513 | "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", 1514 | "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", 1515 | "requires": { 1516 | "ansi-regex": "^3.0.0" 1517 | }, 1518 | "dependencies": { 1519 | "ansi-regex": { 1520 | "version": "3.0.0", 1521 | "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", 1522 | "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=" 1523 | } 1524 | } 1525 | }, 1526 | "strip-bom": { 1527 | "version": "3.0.0", 1528 | "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", 1529 | "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=" 1530 | }, 1531 | "strip-json-comments": { 1532 | "version": "2.0.1", 1533 | "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", 1534 | "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=" 1535 | }, 1536 | "supports-color": { 1537 | "version": "2.0.0", 1538 | "resolved": "http://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", 1539 | "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=" 1540 | }, 1541 | "symbol-observable": { 1542 | "version": "1.0.1", 1543 | "resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-1.0.1.tgz", 1544 | "integrity": "sha1-g0D8RwLDEi310iKI+IKD9RPT/dQ=" 1545 | }, 1546 | "table": { 1547 | "version": "4.0.3", 1548 | "resolved": "http://registry.npmjs.org/table/-/table-4.0.3.tgz", 1549 | "integrity": "sha512-S7rnFITmBH1EnyKcvxBh1LjYeQMmnZtCXSEbHcH6S0NoKit24ZuFO/T1vDcLdYsLQkM188PVVhQmzKIuThNkKg==", 1550 | "requires": { 1551 | "ajv": "^6.0.1", 1552 | "ajv-keywords": "^3.0.0", 1553 | "chalk": "^2.1.0", 1554 | "lodash": "^4.17.4", 1555 | "slice-ansi": "1.0.0", 1556 | "string-width": "^2.1.1" 1557 | } 1558 | }, 1559 | "text-table": { 1560 | "version": "0.2.0", 1561 | "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", 1562 | "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=" 1563 | }, 1564 | "through": { 1565 | "version": "2.3.8", 1566 | "resolved": "http://registry.npmjs.org/through/-/through-2.3.8.tgz", 1567 | "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=" 1568 | }, 1569 | "tmp": { 1570 | "version": "0.0.33", 1571 | "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", 1572 | "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", 1573 | "requires": { 1574 | "os-tmpdir": "~1.0.2" 1575 | } 1576 | }, 1577 | "type-check": { 1578 | "version": "0.3.2", 1579 | "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", 1580 | "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", 1581 | "requires": { 1582 | "prelude-ls": "~1.1.2" 1583 | } 1584 | }, 1585 | "uniq": { 1586 | "version": "1.0.1", 1587 | "resolved": "https://registry.npmjs.org/uniq/-/uniq-1.0.1.tgz", 1588 | "integrity": "sha1-sxxa6CVIRKOoKBVBzisEuGWnNP8=" 1589 | }, 1590 | "uri-js": { 1591 | "version": "4.2.2", 1592 | "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", 1593 | "integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==", 1594 | "requires": { 1595 | "punycode": "^2.1.0" 1596 | } 1597 | }, 1598 | "util-deprecate": { 1599 | "version": "1.0.2", 1600 | "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", 1601 | "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" 1602 | }, 1603 | "uuid": { 1604 | "version": "3.3.2", 1605 | "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz", 1606 | "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==" 1607 | }, 1608 | "uuid-1345": { 1609 | "version": "0.99.7", 1610 | "resolved": "https://registry.npmjs.org/uuid-1345/-/uuid-1345-0.99.7.tgz", 1611 | "integrity": "sha512-A70cwvqH95zULri1/t00/r6Bd97hKpNvS9SoSLP9Bupn95sX/01JkOuH9YjJrmNul7ZAjyX3Y3ZMlDrCjuoNPQ==", 1612 | "requires": { 1613 | "macaddress": "^0.2.9" 1614 | } 1615 | }, 1616 | "validate-npm-package-license": { 1617 | "version": "3.0.4", 1618 | "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", 1619 | "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", 1620 | "requires": { 1621 | "spdx-correct": "^3.0.0", 1622 | "spdx-expression-parse": "^3.0.0" 1623 | } 1624 | }, 1625 | "which": { 1626 | "version": "1.3.1", 1627 | "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", 1628 | "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", 1629 | "requires": { 1630 | "isexe": "^2.0.0" 1631 | } 1632 | }, 1633 | "wordwrap": { 1634 | "version": "1.0.0", 1635 | "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", 1636 | "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=" 1637 | }, 1638 | "wrappy": { 1639 | "version": "1.0.2", 1640 | "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", 1641 | "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" 1642 | }, 1643 | "write": { 1644 | "version": "0.2.1", 1645 | "resolved": "https://registry.npmjs.org/write/-/write-0.2.1.tgz", 1646 | "integrity": "sha1-X8A4KOJkzqP+kUVUdvejxWbLB1c=", 1647 | "requires": { 1648 | "mkdirp": "^0.5.1" 1649 | } 1650 | }, 1651 | "xtend": { 1652 | "version": "4.0.1", 1653 | "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", 1654 | "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=" 1655 | }, 1656 | "yggdrasil": { 1657 | "version": "1.1.1", 1658 | "resolved": "https://registry.npmjs.org/yggdrasil/-/yggdrasil-1.1.1.tgz", 1659 | "integrity": "sha1-dbNIjfayr0kAmohX8+Xc7uDDpeQ=", 1660 | "requires": { 1661 | "phin": "^2.2.1", 1662 | "uuid": "^3.1.0" 1663 | } 1664 | } 1665 | } 1666 | } 1667 | -------------------------------------------------------------------------------- /src/integration-test/nodejs/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "integration-test-client", 3 | "version": "1.0.0", 4 | "description": "Test client for integrations", 5 | "main": "index.js", 6 | "dependencies": { 7 | "minecraft-protocol": "^1.8.3" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/integration-test/resources/plugin/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/turt2live/matrix-minecraft/23c801b7b40fe808b63f86d9368a55f5bc323a58/src/integration-test/resources/plugin/.gitkeep -------------------------------------------------------------------------------- /src/integration-test/resources/plugin/MatrixMinecraft.yml: -------------------------------------------------------------------------------- 1 | appservice: 2 | enabled: true 3 | port: 8080 4 | hsToken: "abc123" 5 | asToken: "abc123" 6 | userPrefix: "_minecraft_" 7 | domain: "localhost" 8 | hsUrl: "http://localhost:8008" 9 | -------------------------------------------------------------------------------- /src/integration-test/resources/servers/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/turt2live/matrix-minecraft/23c801b7b40fe808b63f86d9368a55f5bc323a58/src/integration-test/resources/servers/.gitkeep -------------------------------------------------------------------------------- /src/integration-test/resources/servers/server.properties: -------------------------------------------------------------------------------- 1 | #Minecraft server properties 2 | #Mon Dec 31 20:29:55 MST 2018 3 | generator-settings= 4 | op-permission-level=4 5 | allow-nether=false 6 | level-name=world 7 | enable-query=false 8 | allow-flight=false 9 | prevent-proxy-connections=false 10 | server-port=25565 11 | max-world-size=15 12 | level-type=DEFAULT 13 | level-seed= 14 | force-gamemode=true 15 | server-ip= 16 | network-compression-threshold=256 17 | max-build-height=256 18 | spawn-npcs=false 19 | enforce-whitelist=false 20 | white-list=false 21 | spawn-animals=false 22 | hardcore=false 23 | snooper-enabled=true 24 | resource-pack-sha1= 25 | online-mode=false 26 | resource-pack= 27 | pvp=false 28 | difficulty=0 29 | enable-command-block=false 30 | gamemode=1 31 | player-idle-timeout=0 32 | max-players=20 33 | spawn-monsters=false 34 | view-distance=1 35 | generate-structures=false 36 | motd=A Minecraft Server 37 | -------------------------------------------------------------------------------- /src/main/java/io/t2l/mc/matrix/LogService.java: -------------------------------------------------------------------------------- 1 | package io.t2l.mc.matrix; 2 | 3 | import java.util.logging.Logger; 4 | 5 | public class LogService { 6 | 7 | private static Logger logger; 8 | 9 | private LogService() { 10 | } 11 | 12 | public static void setLogger(Logger logger) { 13 | LogService.logger = logger; 14 | } 15 | 16 | public static Logger get() { 17 | return logger; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/io/t2l/mc/matrix/MatrixClient.java: -------------------------------------------------------------------------------- 1 | package io.t2l.mc.matrix; 2 | 3 | import com.fasterxml.jackson.databind.ObjectMapper; 4 | import io.t2l.mc.matrix.dto.EventIdResponse; 5 | import io.t2l.mc.matrix.dto.MatrixError; 6 | import io.t2l.mc.matrix.dto.MatrixMessage; 7 | import io.t2l.mc.matrix.dto.RoomIdResponse; 8 | 9 | import javax.net.ssl.HttpsURLConnection; 10 | import java.io.*; 11 | import java.net.URL; 12 | import java.net.URLEncoder; 13 | import java.util.Date; 14 | import java.util.HashMap; 15 | import java.util.Map; 16 | 17 | public class MatrixClient { 18 | 19 | private static ObjectMapper json = new ObjectMapper(); 20 | 21 | private String hsUrl; 22 | private String accessToken; 23 | private String impersonateUserId; 24 | 25 | public MatrixClient(String hsUrl, String accessToken) { 26 | this.hsUrl = hsUrl; 27 | this.accessToken = accessToken; 28 | 29 | if (this.hsUrl.endsWith("/")) { 30 | this.hsUrl = this.hsUrl.substring(0, this.hsUrl.length() - 1); 31 | } 32 | } 33 | 34 | public MatrixClient(String hsUrl, String accessToken, String impersonateUserId) { 35 | this(hsUrl, accessToken); 36 | this.impersonateUserId = impersonateUserId; 37 | } 38 | 39 | public String joinRoom(String roomIdOrAlias) throws MatrixException { 40 | RoomIdResponse r = this.doRequest("POST", "/_matrix/client/r0/rooms/" + roomIdOrAlias + "/join", null, null, RoomIdResponse.class); 41 | return r.roomId; 42 | } 43 | 44 | public String sendMessage(String roomId, MatrixMessage message) throws MatrixException { 45 | EventIdResponse r = this.doRequest("PUT", "/_matrix/client/r0/rooms/" + roomId + "/send/m.room.message/" + (new Date().getTime()), null, message, EventIdResponse.class); 46 | return r.eventId; 47 | } 48 | 49 | public T doRequest(String method, String endpoint, Map queryString, Object body, Class clazz) throws MatrixException { 50 | try { 51 | if (!endpoint.startsWith("/")) endpoint = "/" + endpoint; 52 | if (queryString == null) queryString = new HashMap<>(); 53 | 54 | StringBuilder qs = new StringBuilder(); 55 | if (this.impersonateUserId != null) queryString.put("user_id", this.impersonateUserId); 56 | for (Map.Entry param : queryString.entrySet()) { 57 | if (qs.length() > 0) qs.append("&"); 58 | qs.append(param.getKey()).append("=").append(URLEncoder.encode(param.getValue().toString(), "UTF-8")); 59 | } 60 | 61 | URL url = new URL(this.hsUrl + endpoint + "?" + qs.toString()); 62 | 63 | HttpsURLConnection connection = (HttpsURLConnection) url.openConnection(); 64 | connection.setRequestMethod(method); 65 | connection.setRequestProperty("Authorization", "Bearer " + this.accessToken); 66 | connection.setRequestProperty("Content-Type", "application/json"); 67 | connection.setRequestProperty("User-Agent", "Matrix-Minecraft Bukkit Plugin"); 68 | 69 | String bodyJson = ""; 70 | if (body != null) bodyJson = json.writeValueAsString(body); 71 | 72 | connection.setDoOutput(true); 73 | OutputStreamWriter writer = new OutputStreamWriter(connection.getOutputStream()); 74 | writer.write(bodyJson); 75 | writer.flush(); 76 | writer.close(); 77 | 78 | int responseCode = connection.getResponseCode(); 79 | 80 | InputStream stream = connection.getErrorStream(); 81 | if (stream == null) stream = connection.getInputStream(); 82 | 83 | BufferedReader reader = new BufferedReader(new InputStreamReader(stream)); 84 | StringBuilder rawJson = new StringBuilder(); 85 | String line; 86 | while ((line = reader.readLine()) != null) rawJson.append(line); 87 | reader.close(); 88 | 89 | if (responseCode != 200) { 90 | MatrixError err = json.readValue(rawJson.toString(), MatrixError.class); 91 | throw new MatrixException(err.error, err.errcode, responseCode); 92 | } 93 | 94 | return json.readValue(rawJson.toString(), clazz); 95 | } catch (IOException e) { 96 | throw new MatrixException("Error making request", "M_UNKNOWN", 500, e); 97 | } 98 | } 99 | } 100 | -------------------------------------------------------------------------------- /src/main/java/io/t2l/mc/matrix/MatrixException.java: -------------------------------------------------------------------------------- 1 | package io.t2l.mc.matrix; 2 | 3 | public class MatrixException extends Exception { 4 | 5 | public final int statusCode; 6 | public final String errcode; 7 | 8 | public MatrixException(String message, String errcode, int statusCode) { 9 | super(errcode + ":" + message); 10 | this.statusCode = statusCode; 11 | this.errcode = errcode; 12 | } 13 | 14 | public MatrixException(String message, String errcode, int statusCode, Exception inner) { 15 | super(errcode + ":" + message, inner); 16 | this.statusCode = statusCode; 17 | this.errcode = errcode; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/io/t2l/mc/matrix/appservice/Appservice.java: -------------------------------------------------------------------------------- 1 | package io.t2l.mc.matrix.appservice; 2 | 3 | import fi.iki.elonen.NanoHTTPD; 4 | import io.t2l.mc.matrix.LogService; 5 | import io.t2l.mc.matrix.MatrixClient; 6 | import io.t2l.mc.matrix.MatrixException; 7 | import io.t2l.mc.matrix.dto.RegistrationResponse; 8 | 9 | import java.io.IOException; 10 | import java.util.HashMap; 11 | import java.util.Map; 12 | 13 | public class Appservice { 14 | 15 | private String asToken; 16 | private String userPrefix; 17 | private String domainName; 18 | private String csUrl; 19 | private AppserviceHttp httpServer; 20 | 21 | public Appservice(int port, String hsToken, String asToken, String userPrefix, String domainName, String csUrl) { 22 | this.asToken = asToken; 23 | this.userPrefix = userPrefix; 24 | this.domainName = domainName; 25 | this.csUrl = csUrl; 26 | 27 | this.httpServer = new AppserviceHttp(port, hsToken); 28 | } 29 | 30 | public void start() throws IOException { 31 | LogService.get().info("Starting appservice http server"); 32 | this.httpServer.start(NanoHTTPD.SOCKET_READ_TIMEOUT, true); 33 | } 34 | 35 | public void stop() { 36 | LogService.get().info("Stopping appservice http server"); 37 | this.httpServer.stop(); 38 | } 39 | 40 | public MatrixClient getClient(String suffix) throws MatrixException { 41 | String localpart = this.userPrefix + suffix; 42 | this.registerUser(localpart); 43 | return new MatrixClient(this.csUrl, this.asToken, "@" + localpart + ":" + this.domainName); 44 | } 45 | 46 | private void registerUser(String localpart) throws MatrixException { 47 | try { 48 | MatrixClient asBot = new MatrixClient(this.csUrl, this.asToken); 49 | 50 | Map body = new HashMap<>(); 51 | body.put("type", "m.login.application_service"); 52 | body.put("username", localpart); 53 | 54 | asBot.doRequest("POST", "/_matrix/client/r0/register", null, body, RegistrationResponse.class); 55 | } catch (MatrixException e) { 56 | if (!e.errcode.equals("M_USER_IN_USE")) { 57 | throw e; 58 | } 59 | } 60 | } 61 | 62 | public boolean isNamespaced(String userId) { 63 | return userId.startsWith("@" + this.userPrefix); 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /src/main/java/io/t2l/mc/matrix/appservice/AppserviceHttp.java: -------------------------------------------------------------------------------- 1 | package io.t2l.mc.matrix.appservice; 2 | 3 | import fi.iki.elonen.router.RouterNanoHTTPD; 4 | 5 | public class AppserviceHttp extends RouterNanoHTTPD { 6 | 7 | AppserviceHttp(int port, String hsToken) { 8 | super(port); 9 | AppserviceTransactionHandler.hsToken = hsToken; 10 | addMappings(); 11 | } 12 | 13 | @Override 14 | public void addMappings() { 15 | super.addMappings(); 16 | addRoute("/transactions/:txnId", AppserviceTransactionHandler.class); 17 | addRoute("/_matrix/app/v1/transactions/:txnId", AppserviceTransactionHandler.class); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/io/t2l/mc/matrix/appservice/AppserviceTransactionHandler.java: -------------------------------------------------------------------------------- 1 | package io.t2l.mc.matrix.appservice; 2 | 3 | import com.fasterxml.jackson.databind.ObjectMapper; 4 | import fi.iki.elonen.NanoHTTPD; 5 | import fi.iki.elonen.router.RouterNanoHTTPD; 6 | import io.t2l.mc.matrix.dto.MatrixAppserviceTransaction; 7 | import io.t2l.mc.matrix.events.AppserviceEvent; 8 | import io.t2l.mc.matrix.events.PluginEventBus; 9 | 10 | import java.io.BufferedReader; 11 | import java.io.FileInputStream; 12 | import java.io.IOException; 13 | import java.io.InputStreamReader; 14 | import java.util.HashMap; 15 | import java.util.LinkedHashMap; 16 | import java.util.List; 17 | import java.util.Map; 18 | 19 | import static fi.iki.elonen.NanoHTTPD.newFixedLengthResponse; 20 | 21 | public class AppserviceTransactionHandler extends RouterNanoHTTPD.DefaultHandler { 22 | 23 | private static final int MAX_TRANSACTION_HISTORY = 50; 24 | private static LinkedHashMap transactions = new LinkedHashMap<>(); 25 | private static ObjectMapper json = new ObjectMapper(); 26 | static String hsToken; 27 | 28 | public AppserviceTransactionHandler() { 29 | super(); 30 | } 31 | 32 | private void pruneMap() { 33 | while (transactions.size() > MAX_TRANSACTION_HISTORY) { 34 | transactions.remove(transactions.keySet().toArray()[0].toString()); 35 | } 36 | } 37 | 38 | private boolean isAuthorized(NanoHTTPD.IHTTPSession session) { 39 | List accessTokens = session.getParameters().get("access_token"); 40 | if (accessTokens != null && accessTokens.size() > 0) { 41 | return accessTokens.stream().findFirst().get().equals(hsToken); 42 | } 43 | return false; 44 | } 45 | 46 | @Override 47 | public String getText() { 48 | return "{}"; 49 | } 50 | 51 | @Override 52 | public String getMimeType() { 53 | return "application/json"; 54 | } 55 | 56 | @Override 57 | public NanoHTTPD.Response.IStatus getStatus() { 58 | return NanoHTTPD.Response.Status.NOT_FOUND; 59 | } 60 | 61 | @Override 62 | public NanoHTTPD.Response put(RouterNanoHTTPD.UriResource uriResource, Map urlParams, NanoHTTPD.IHTTPSession session) { 63 | if (!isAuthorized(session)) { 64 | return newFixedLengthResponse(NanoHTTPD.Response.Status.FORBIDDEN, "application/json", "{\"error\":\"Not authorized\",\"errcode\":\"M_FORBIDDEN\"}"); 65 | } 66 | 67 | String transactionId = urlParams.get("txnId"); 68 | if (transactions.containsKey(transactionId)) { 69 | if (transactions.get(transactionId) != null) { 70 | return newFixedLengthResponse(NanoHTTPD.Response.Status.OK, "application/json", "{}"); 71 | } else { 72 | return newFixedLengthResponse(NanoHTTPD.Response.Status.BAD_REQUEST, "application/json", "{\"error\":\"Duplicate request in progress\",\"errcode\":\"M_UNKNOWN\"}"); 73 | } 74 | } 75 | transactions.put(transactionId, null); 76 | 77 | try { 78 | Map body = new HashMap<>(); 79 | session.parseBody(body); 80 | 81 | if (!body.containsKey("content")) { 82 | return newFixedLengthResponse(NanoHTTPD.Response.Status.INTERNAL_ERROR, "application/json", "{\"error\":\"Missing post data\",\"errcode\":\"M_UNKNOWN\"}"); 83 | } 84 | 85 | BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(body.get("content")))); 86 | StringBuilder rawJson = new StringBuilder(); 87 | String line; 88 | while ((line = reader.readLine()) != null) rawJson.append(line); 89 | reader.close(); 90 | 91 | MatrixAppserviceTransaction txn = json.readValue(rawJson.toString(), MatrixAppserviceTransaction.class); 92 | txn.events.stream().map(AppserviceEvent::new).forEach(e -> PluginEventBus.getInstance().publish(e)); 93 | 94 | NanoHTTPD.Response response = newFixedLengthResponse(NanoHTTPD.Response.Status.OK, "application/json", "{}"); 95 | transactions.put(transactionId, response); 96 | pruneMap(); 97 | return response; 98 | } catch (IOException | NanoHTTPD.ResponseException e) { 99 | e.printStackTrace(); 100 | return newFixedLengthResponse(NanoHTTPD.Response.Status.INTERNAL_ERROR, "application/json", "{\"error\":\"Internal server error\",\"errcode\":\"M_UNKNOWN\"}"); 101 | } 102 | } 103 | } 104 | -------------------------------------------------------------------------------- /src/main/java/io/t2l/mc/matrix/bridge/AppserviceBridge.java: -------------------------------------------------------------------------------- 1 | package io.t2l.mc.matrix.bridge; 2 | 3 | import io.t2l.mc.matrix.MatrixClient; 4 | import io.t2l.mc.matrix.MatrixException; 5 | import io.t2l.mc.matrix.appservice.Appservice; 6 | import io.t2l.mc.matrix.dto.MatrixMessage; 7 | import io.t2l.mc.matrix.events.PluginEventBus; 8 | import io.t2l.mc.matrix.minecraft.IMinecraft; 9 | 10 | import java.io.IOException; 11 | import java.util.UUID; 12 | 13 | public class AppserviceBridge implements IBridge { 14 | 15 | private Appservice appservice; 16 | private IMinecraft minecraft; 17 | 18 | public AppserviceBridge(Appservice appservice, IMinecraft minecraft) { 19 | this.appservice = appservice; 20 | this.minecraft = minecraft; 21 | 22 | PluginEventBus.register(new MatrixEventHandler(this)); 23 | } 24 | 25 | @Override 26 | public void start() throws IOException { 27 | this.appservice.start(); 28 | } 29 | 30 | @Override 31 | public void stop() throws IOException { 32 | this.appservice.stop(); 33 | } 34 | 35 | @Override 36 | public void sendMatrixMessage(String roomId, UUID sender, String message) throws MatrixException { 37 | MatrixClient client = this.appservice.getClient(sender.toString()); 38 | client.joinRoom(roomId); 39 | client.sendMessage(roomId, new MatrixMessage() {{ 40 | body = message; 41 | msgtype = "m.text"; 42 | }}); 43 | } 44 | 45 | @Override 46 | public void sendMinecraftMessage(String sourceRoomId, String sender, String plaintext) { 47 | if (this.appservice.isNamespaced(sender)) { 48 | return; 49 | } 50 | this.minecraft.sendMessage(sender, plaintext); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /src/main/java/io/t2l/mc/matrix/bridge/IBridge.java: -------------------------------------------------------------------------------- 1 | package io.t2l.mc.matrix.bridge; 2 | 3 | import io.t2l.mc.matrix.MatrixException; 4 | 5 | import java.io.IOException; 6 | import java.util.UUID; 7 | 8 | public interface IBridge { 9 | void start() throws IOException; 10 | 11 | void stop() throws IOException; 12 | 13 | void sendMatrixMessage(String roomId, UUID sender, String message) throws MatrixException; 14 | 15 | // TODO: Support Minecraft-JSON 16 | void sendMinecraftMessage(String sourceRoomId, String sender, String plaintext); 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/io/t2l/mc/matrix/bridge/MatrixEventHandler.java: -------------------------------------------------------------------------------- 1 | package io.t2l.mc.matrix.bridge; 2 | 3 | import com.github.jneat.minibus.EventBusHandler; 4 | import io.t2l.mc.matrix.LogService; 5 | import io.t2l.mc.matrix.dto.MatrixAppserviceTransactionEvent; 6 | import io.t2l.mc.matrix.events.AppserviceEvent; 7 | 8 | public class MatrixEventHandler extends EventBusHandler { 9 | 10 | private IBridge bridge; 11 | 12 | MatrixEventHandler(IBridge bridge) { 13 | this.bridge = bridge; 14 | } 15 | 16 | @Override 17 | public void handle(AppserviceEvent ev) throws Throwable { 18 | MatrixAppserviceTransactionEvent event = ev.event; 19 | if (!event.type.equals("m.room.message")) return; 20 | if (event.stateKey != null) return; 21 | if (!event.content.containsKey("body")) return; 22 | 23 | String bodyRaw = event.content.get("body").toString(); 24 | if (bodyRaw.isEmpty()) return; 25 | 26 | LogService.get().info(String.format("Processing %s from %s in %s", event.type, event.sender, event.roomId)); 27 | this.bridge.sendMinecraftMessage(event.roomId, event.sender, bodyRaw); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/io/t2l/mc/matrix/bukkit/BukkitMinecraft.java: -------------------------------------------------------------------------------- 1 | package io.t2l.mc.matrix.bukkit; 2 | 3 | import io.t2l.mc.matrix.minecraft.IMinecraft; 4 | 5 | public class BukkitMinecraft implements IMinecraft { 6 | 7 | private MatrixBukkitPlugin plugin; 8 | 9 | public BukkitMinecraft(MatrixBukkitPlugin plugin) { 10 | this.plugin = plugin; 11 | } 12 | 13 | @Override 14 | public void sendMessage(String senderName, String text) { 15 | this.plugin.getServer().broadcastMessage(String.format("<%s> %s", senderName, text)); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/io/t2l/mc/matrix/bukkit/ChatListener.java: -------------------------------------------------------------------------------- 1 | package io.t2l.mc.matrix.bukkit; 2 | 3 | import io.t2l.mc.matrix.MatrixException; 4 | import io.t2l.mc.matrix.bridge.IBridge; 5 | import org.bukkit.event.EventHandler; 6 | import org.bukkit.event.EventPriority; 7 | import org.bukkit.event.Listener; 8 | import org.bukkit.event.player.AsyncPlayerChatEvent; 9 | 10 | public class ChatListener implements Listener { 11 | 12 | private IBridge bridge; 13 | 14 | ChatListener(IBridge bridge) { 15 | this.bridge = bridge; 16 | } 17 | 18 | @EventHandler(ignoreCancelled = true, priority = EventPriority.MONITOR) 19 | public void onChatMessage(AsyncPlayerChatEvent e) { 20 | try { 21 | this.bridge.sendMatrixMessage("!QrQxqLruMjHFnRxrvs:dev.t2host.io", e.getPlayer().getUniqueId(), e.getMessage()); 22 | } catch (MatrixException ex) { 23 | ex.printStackTrace(); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/io/t2l/mc/matrix/bukkit/MatrixBukkitPlugin.java: -------------------------------------------------------------------------------- 1 | package io.t2l.mc.matrix.bukkit; 2 | 3 | import io.t2l.mc.matrix.LogService; 4 | import io.t2l.mc.matrix.appservice.Appservice; 5 | import io.t2l.mc.matrix.bridge.AppserviceBridge; 6 | import io.t2l.mc.matrix.bridge.IBridge; 7 | import io.t2l.mc.matrix.minecraft.IMinecraft; 8 | import org.bukkit.Bukkit; 9 | import org.bukkit.plugin.java.JavaPlugin; 10 | 11 | import java.io.IOException; 12 | 13 | public class MatrixBukkitPlugin extends JavaPlugin { 14 | 15 | private static MatrixBukkitPlugin instance; 16 | 17 | public static MatrixBukkitPlugin getInstance() { 18 | return instance; 19 | } 20 | 21 | private IBridge bridge; 22 | 23 | @Override 24 | public void onEnable() { 25 | instance = this; 26 | LogService.setLogger(this.getLogger()); 27 | this.bridge = null; // just in case we were reloaded 28 | 29 | IMinecraft minecraft = new BukkitMinecraft(this); 30 | 31 | this.saveDefaultConfig(); 32 | if (this.getConfig().getBoolean("appservice.enabled", false)) { 33 | this.getLogger().info("Bridging to Matrix via the configured appservice"); 34 | bridge = new AppserviceBridge(new Appservice( 35 | this.getConfig().getInt("appservice.port", 8080), 36 | this.getConfig().getString("appservice.hsToken", "GENERATE_ME"), 37 | this.getConfig().getString("appservice.asToken", "GENERATE_ME"), 38 | this.getConfig().getString("appservice.userPrefix", "_minecraft_"), 39 | this.getConfig().getString("appservice.domain", "matrix.org"), 40 | this.getConfig().getString("appservice.hsUrl", "https://matrix.org") 41 | ), minecraft); 42 | } 43 | 44 | if (bridge == null) { 45 | this.getLogger().warning("No bridge configuration was found - please enable at least one route in the config."); 46 | Bukkit.getPluginManager().disablePlugin(this); 47 | return; 48 | } 49 | 50 | try { 51 | this.getLogger().info("Starting bridge handler..."); 52 | bridge.start(); 53 | } catch (IOException e) { 54 | e.printStackTrace(); 55 | Bukkit.getPluginManager().disablePlugin(this); 56 | return; 57 | } 58 | 59 | Bukkit.getPluginManager().registerEvents(new ChatListener(bridge), this); 60 | } 61 | 62 | @Override 63 | public void onDisable() { 64 | if (this.bridge != null) { 65 | try { 66 | this.bridge.stop(); 67 | } catch (IOException e) { 68 | e.printStackTrace(); 69 | } 70 | } 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /src/main/java/io/t2l/mc/matrix/dto/EventIdResponse.java: -------------------------------------------------------------------------------- 1 | package io.t2l.mc.matrix.dto; 2 | 3 | import com.fasterxml.jackson.annotation.JsonProperty; 4 | 5 | public class EventIdResponse { 6 | @JsonProperty("event_id") 7 | public String eventId; 8 | } 9 | -------------------------------------------------------------------------------- /src/main/java/io/t2l/mc/matrix/dto/MatrixAppserviceTransaction.java: -------------------------------------------------------------------------------- 1 | package io.t2l.mc.matrix.dto; 2 | 3 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 4 | import com.fasterxml.jackson.annotation.JsonProperty; 5 | 6 | import java.util.List; 7 | import java.util.Map; 8 | 9 | public class MatrixAppserviceTransaction { 10 | public List events; 11 | } 12 | 13 | -------------------------------------------------------------------------------- /src/main/java/io/t2l/mc/matrix/dto/MatrixAppserviceTransactionEvent.java: -------------------------------------------------------------------------------- 1 | package io.t2l.mc.matrix.dto; 2 | 3 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 4 | import com.fasterxml.jackson.annotation.JsonProperty; 5 | 6 | import java.util.Map; 7 | 8 | @JsonIgnoreProperties(ignoreUnknown = true) 9 | public class MatrixAppserviceTransactionEvent { 10 | public static final String STATE_KEY_DEFAULT = "____NO_STATE_KEY____"; 11 | 12 | public Map content; 13 | 14 | public String type; 15 | 16 | @JsonProperty("event_id") 17 | public String eventId; 18 | 19 | @JsonProperty("room_id") 20 | public String roomId; 21 | 22 | @JsonProperty("sender") 23 | public String sender; 24 | 25 | @JsonProperty(value = "state_key", defaultValue = STATE_KEY_DEFAULT) 26 | public String stateKey; 27 | 28 | @JsonProperty("origin_server_ts") 29 | public long originServerTs; 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/io/t2l/mc/matrix/dto/MatrixError.java: -------------------------------------------------------------------------------- 1 | package io.t2l.mc.matrix.dto; 2 | 3 | public class MatrixError { 4 | public String errcode; 5 | public String error; 6 | } 7 | -------------------------------------------------------------------------------- /src/main/java/io/t2l/mc/matrix/dto/MatrixMessage.java: -------------------------------------------------------------------------------- 1 | package io.t2l.mc.matrix.dto; 2 | 3 | import com.fasterxml.jackson.annotation.JsonProperty; 4 | 5 | public class MatrixMessage { 6 | 7 | public String body; 8 | public String msgtype; 9 | public String format; 10 | 11 | @JsonProperty("formatted_body") 12 | public String formattedBody; 13 | 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/io/t2l/mc/matrix/dto/MatrixUserProfile.java: -------------------------------------------------------------------------------- 1 | package io.t2l.mc.matrix.dto; 2 | 3 | import com.fasterxml.jackson.annotation.JsonProperty; 4 | 5 | public class MatrixUserProfile { 6 | @JsonProperty("displayname") 7 | public String displayName; 8 | 9 | @JsonProperty("avatar_url") 10 | public String avatarMxc; 11 | } 12 | -------------------------------------------------------------------------------- /src/main/java/io/t2l/mc/matrix/dto/RegistrationResponse.java: -------------------------------------------------------------------------------- 1 | package io.t2l.mc.matrix.dto; 2 | 3 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 4 | import com.fasterxml.jackson.annotation.JsonProperty; 5 | 6 | @JsonIgnoreProperties("home_server") 7 | public class RegistrationResponse { 8 | @JsonProperty("access_token") 9 | public String accessToken; 10 | 11 | @JsonProperty("user_id") 12 | public String userId; 13 | 14 | @JsonProperty("device_id") 15 | public String deviceId; 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/io/t2l/mc/matrix/dto/RoomIdResponse.java: -------------------------------------------------------------------------------- 1 | package io.t2l.mc.matrix.dto; 2 | 3 | import com.fasterxml.jackson.annotation.JsonProperty; 4 | 5 | public class RoomIdResponse { 6 | @JsonProperty("room_id") 7 | public String roomId; 8 | } 9 | -------------------------------------------------------------------------------- /src/main/java/io/t2l/mc/matrix/events/AppserviceEvent.java: -------------------------------------------------------------------------------- 1 | package io.t2l.mc.matrix.events; 2 | 3 | import com.github.jneat.minibus.EventBusEvent; 4 | import io.t2l.mc.matrix.dto.MatrixAppserviceTransactionEvent; 5 | 6 | public class AppserviceEvent implements EventBusEvent { 7 | public final MatrixAppserviceTransactionEvent event; 8 | 9 | public AppserviceEvent(MatrixAppserviceTransactionEvent event) { 10 | this.event = event; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/io/t2l/mc/matrix/events/PluginEventBus.java: -------------------------------------------------------------------------------- 1 | package io.t2l.mc.matrix.events; 2 | 3 | import com.github.jneat.minibus.EventBus; 4 | import com.github.jneat.minibus.EventBusAsync; 5 | import com.github.jneat.minibus.EventBusEvent; 6 | import com.github.jneat.minibus.EventBusHandler; 7 | 8 | import java.util.ArrayList; 9 | import java.util.List; 10 | 11 | public class PluginEventBus { 12 | 13 | private static EventBus> instance; 14 | private static List> handlers = new ArrayList<>(); 15 | 16 | private PluginEventBus() { 17 | } 18 | 19 | public static void register(EventBusHandler handler) { 20 | handlers.add(handler); 21 | getInstance().subscribe(handler); 22 | } 23 | 24 | public static EventBus> getInstance() { 25 | if (instance == null) { 26 | instance = new EventBusAsync<>(); 27 | } 28 | return instance; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/io/t2l/mc/matrix/minecraft/IMinecraft.java: -------------------------------------------------------------------------------- 1 | package io.t2l.mc.matrix.minecraft; 2 | 3 | public interface IMinecraft { 4 | void sendMessage(String senderName, String text); 5 | } 6 | -------------------------------------------------------------------------------- /src/main/resources/config.yml: -------------------------------------------------------------------------------- 1 | appservice: 2 | enabled: false 3 | port: 8080 4 | hsToken: "GiveThisALongString" 5 | asToken: "GiveThisADifferentLongString" 6 | userPrefix: "_minecraft_" 7 | domain: "t2bot.io" 8 | hsUrl: "https://t2bot.io" 9 | -------------------------------------------------------------------------------- /src/main/resources/plugin.yml: -------------------------------------------------------------------------------- 1 | name: MatrixMinecraft 2 | version: 1.0-SNAPSHOT 3 | main: io.t2l.mc.matrix.bukkit.MatrixBukkitPlugin 4 | --------------------------------------------------------------------------------