├── .gitignore ├── .idea ├── .gitignore ├── compiler.xml ├── jarRepositories.xml ├── libraries-with-intellij-classes.xml ├── misc.xml ├── modules │ └── CapeSystem.iml └── vcs.xml ├── README.md ├── build.gradle ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── settings.gradle └── src └── main ├── java └── dev │ └── zihasz │ └── zware │ ├── ZWare.java │ ├── managers │ └── CapeManager.java │ ├── mixin │ ├── MixinLoader.java │ └── mixins │ │ └── MixinAbstractClientPlayer.java │ └── utils │ └── CapeUtils.java └── resources ├── assets.zware.capes └── README.txt ├── mcmod.info ├── mixins.zware.json ├── pack.mcmeta └── zware_at.cfg /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | # Created by https://www.toptal.com/developers/gitignore/api/gradle,forgegradle,java,intellij,git,eclipse 3 | # Edit at https://www.toptal.com/developers/gitignore?templates=gradle,forgegradle,java,intellij,git,eclipse 4 | 5 | ### Eclipse ### 6 | .metadata 7 | bin/ 8 | tmp/ 9 | *.tmp 10 | *.bak 11 | *.swp 12 | *~.nib 13 | local.properties 14 | .settings/ 15 | .loadpath 16 | .recommenders 17 | 18 | # External tool builders 19 | .externalToolBuilders/ 20 | 21 | # Locally stored "Eclipse launch configurations" 22 | *.launch 23 | 24 | # PyDev specific (Python IDE for Eclipse) 25 | *.pydevproject 26 | 27 | # CDT-specific (C/C++ Development Tooling) 28 | .cproject 29 | 30 | # CDT- autotools 31 | .autotools 32 | 33 | # Java annotation processor (APT) 34 | .factorypath 35 | 36 | # PDT-specific (PHP Development Tools) 37 | .buildpath 38 | 39 | # sbteclipse plugin 40 | .target 41 | 42 | # Tern plugin 43 | .tern-project 44 | 45 | # TeXlipse plugin 46 | .texlipse 47 | 48 | # STS (Spring Tool Suite) 49 | .springBeans 50 | 51 | # Code Recommenders 52 | .recommenders/ 53 | 54 | # Annotation Processing 55 | .apt_generated/ 56 | .apt_generated_test/ 57 | 58 | # Scala IDE specific (Scala & Java development for Eclipse) 59 | .cache-main 60 | .scala_dependencies 61 | .worksheet 62 | 63 | # Uncomment this line if you wish to ignore the project description file. 64 | # Typically, this file would be tracked if it contains build/dependency configurations: 65 | #.project 66 | 67 | ### Eclipse Patch ### 68 | # Spring Boot Tooling 69 | .sts4-cache/ 70 | 71 | ### ForgeGradle ### 72 | # Minecraft client/server files 73 | run/ 74 | 75 | ### Git ### 76 | # Created by git for backups. To disable backups in Git: 77 | # $ git config --global mergetool.keepBackup false 78 | *.orig 79 | 80 | # Created by git when using merge tools for conflicts 81 | *.BACKUP.* 82 | *.BASE.* 83 | *.LOCAL.* 84 | *.REMOTE.* 85 | *_BACKUP_*.txt 86 | *_BASE_*.txt 87 | *_LOCAL_*.txt 88 | *_REMOTE_*.txt 89 | 90 | ### Intellij ### 91 | # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider 92 | # Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 93 | 94 | # User-specific stuff 95 | .idea/**/workspace.xml 96 | .idea/**/tasks.xml 97 | .idea/**/usage.statistics.xml 98 | .idea/**/dictionaries 99 | .idea/**/shelf 100 | 101 | # Generated files 102 | .idea/**/contentModel.xml 103 | 104 | # Sensitive or high-churn files 105 | .idea/**/dataSources/ 106 | .idea/**/dataSources.ids 107 | .idea/**/dataSources.local.xml 108 | .idea/**/sqlDataSources.xml 109 | .idea/**/dynamic.xml 110 | .idea/**/uiDesigner.xml 111 | .idea/**/dbnavigator.xml 112 | 113 | # Gradle 114 | .idea/**/gradle.xml 115 | .idea/**/libraries 116 | 117 | # Gradle and Maven with auto-import 118 | # When using Gradle or Maven with auto-import, you should exclude module files, 119 | # since they will be recreated, and may cause churn. Uncomment if using 120 | # auto-import. 121 | # .idea/artifacts 122 | # .idea/compiler.xml 123 | # .idea/jarRepositories.xml 124 | # .idea/modules.xml 125 | # .idea/*.iml 126 | # .idea/modules 127 | # *.iml 128 | # *.ipr 129 | 130 | # CMake 131 | cmake-build-*/ 132 | 133 | # Mongo Explorer plugin 134 | .idea/**/mongoSettings.xml 135 | 136 | # File-based project format 137 | *.iws 138 | 139 | # IntelliJ 140 | out/ 141 | 142 | # mpeltonen/sbt-idea plugin 143 | .idea_modules/ 144 | 145 | # JIRA plugin 146 | atlassian-ide-plugin.xml 147 | 148 | # Cursive Clojure plugin 149 | .idea/replstate.xml 150 | 151 | # Crashlytics plugin (for Android Studio and IntelliJ) 152 | com_crashlytics_export_strings.xml 153 | crashlytics.properties 154 | crashlytics-build.properties 155 | fabric.properties 156 | 157 | # Editor-based Rest Client 158 | .idea/httpRequests 159 | 160 | # Android studio 3.1+ serialized cache file 161 | .idea/caches/build_file_checksums.ser 162 | 163 | ### Intellij Patch ### 164 | # Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721 165 | 166 | # *.iml 167 | # modules.xml 168 | # .idea/misc.xml 169 | # *.ipr 170 | 171 | # Sonarlint plugin 172 | # https://plugins.jetbrains.com/plugin/7973-sonarlint 173 | .idea/**/sonarlint/ 174 | 175 | # SonarQube Plugin 176 | # https://plugins.jetbrains.com/plugin/7238-sonarqube-community-plugin 177 | .idea/**/sonarIssues.xml 178 | 179 | # Markdown Navigator plugin 180 | # https://plugins.jetbrains.com/plugin/7896-markdown-navigator-enhanced 181 | .idea/**/markdown-navigator.xml 182 | .idea/**/markdown-navigator-enh.xml 183 | .idea/**/markdown-navigator/ 184 | 185 | # Cache file creation bug 186 | # See https://youtrack.jetbrains.com/issue/JBR-2257 187 | .idea/$CACHE_FILE$ 188 | 189 | # CodeStream plugin 190 | # https://plugins.jetbrains.com/plugin/12206-codestream 191 | .idea/codestream.xml 192 | 193 | ### Java ### 194 | # Compiled class file 195 | *.class 196 | 197 | # Log file 198 | *.log 199 | 200 | # BlueJ files 201 | *.ctxt 202 | 203 | # Mobile Tools for Java (J2ME) 204 | .mtj.tmp/ 205 | 206 | # Package Files # 207 | *.jar 208 | *.war 209 | *.nar 210 | *.ear 211 | *.zip 212 | *.tar.gz 213 | *.rar 214 | 215 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml 216 | hs_err_pid* 217 | 218 | ### Gradle ### 219 | .gradle 220 | build/ 221 | 222 | # Ignore Gradle GUI config 223 | gradle-app.setting 224 | 225 | # Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored) 226 | !gradle-wrapper.jar 227 | 228 | # Cache of project 229 | .gradletasknamecache 230 | 231 | # # Work around https://youtrack.jetbrains.com/issue/IDEA-116898 232 | # gradle/wrapper/gradle-wrapper.properties 233 | 234 | ### Gradle Patch ### 235 | **/build/ 236 | 237 | # End of https://www.toptal.com/developers/gitignore/api/gradle,forgegradle,java,intellij,git,eclipse 238 | -------------------------------------------------------------------------------- /.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # Default ignored files 2 | /shelf/ 3 | /workspace.xml 4 | -------------------------------------------------------------------------------- /.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.idea/jarRepositories.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 9 | 10 | 14 | 15 | 19 | 20 | 24 | 25 | 29 | 30 | 34 | 35 | 39 | 40 | 44 | 45 | 49 | 50 | -------------------------------------------------------------------------------- /.idea/libraries-with-intellij-classes.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 64 | 65 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /.idea/modules/CapeSystem.iml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # CapeSystem 2 | 3 | Basic cape system for Minecraft clients. -------------------------------------------------------------------------------- /build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | repositories { 3 | jcenter() 4 | maven { url = "https://lukflug.github.io/maven/" } 5 | maven { url = "https://maven.minecraftforge.net/" } 6 | maven { url = "https://repo.spongepowered.org/maven" } 7 | } 8 | 9 | dependencies { 10 | classpath 'net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT' 11 | classpath 'org.spongepowered:mixingradle:0.4-SNAPSHOT' 12 | classpath 'com.github.jengelman.gradle.plugins:shadow:1.2.3' 13 | } 14 | } 15 | 16 | apply plugin: 'java' 17 | apply plugin: 'net.minecraftforge.gradle.forge' 18 | apply plugin: 'org.spongepowered.mixin' 19 | apply plugin: 'com.github.johnrengelman.shadow' 20 | 21 | group = project.modGroup 22 | version = project.modVersion 23 | 24 | sourceCompatibility = '1.8' 25 | targetCompatibility = '1.8' 26 | 27 | minecraft { 28 | version = project.forgeVersion 29 | runDir = 'run' 30 | mappings = project.mcpVersion 31 | coreMod = 'dev.zihasz.zware.mixin.MixinLoader' 32 | makeObfSourceJar = false 33 | } 34 | 35 | repositories { 36 | jcenter() 37 | mavenCentral() 38 | maven { url = 'https://repo.spongepowered.org/maven' } 39 | maven { url = 'https://jitpack.io/' } 40 | } 41 | 42 | dependencies { 43 | compile("org.spongepowered:mixin:0.7.4-SNAPSHOT") { 44 | exclude module: 'launchwrapper' 45 | exclude module: 'guava' 46 | exclude module: 'gson' 47 | exclude module: 'commons-io' 48 | } 49 | } 50 | 51 | processResources { 52 | inputs.property 'version', project.version 53 | inputs.property 'mcversion', project.minecraft.version 54 | 55 | from(sourceSets.main.resources.srcDirs) { 56 | include 'mcmod.info' 57 | expand 'version': project.version, 'mcversion': project.minecraft.version 58 | } 59 | 60 | from(sourceSets.main.resources.srcDirs) { exclude 'mcmod.info' } 61 | 62 | rename '(.+_at.cfg)', 'META-INF/$1' 63 | } 64 | 65 | shadowJar { 66 | dependencies { 67 | include(dependency('org.spongepowered:mixin')) 68 | } 69 | exclude 'dummyThing' 70 | exclude 'LICENSE.txt' 71 | classifier = 'release' 72 | } 73 | 74 | mixin { 75 | defaultObfuscationEnv searge 76 | add sourceSets.main, 'mixins.zware.refmap.json' 77 | } 78 | 79 | reobf { 80 | shadowJar { 81 | mappingType = 'SEARGE' 82 | classpath = sourceSets.main.compileClasspath 83 | } 84 | } 85 | 86 | jar { 87 | manifest { 88 | attributes( 89 | 'MixinConfigs': 'mixins.zware.json', 90 | 'tweakClass': 'org.spongepowered.asm.launch.MixinTweaker', 91 | 'TweakOrder': 0, 92 | 'FMLCorePluginContainsFMLMod': 'true', 93 | 'FMLCorePlugin': 'dev.zihasz.zware.mixin.MixinLoader', 94 | 'ForceLoadAsMod': 'true', 95 | 'FMLAT': 'zware_at.cfg' 96 | ) 97 | } 98 | } 99 | 100 | build.dependsOn(shadowJar) -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx6G 2 | org.gradle.daemon=false 3 | 4 | modGroup=dev.zihasz.zware 5 | modVersion=1.0.0 6 | mcpVersion=snapshot_20180814 7 | forgeVersion=1.12.2-14.23.5.2768 -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZWareDevelopment/CapeSystem/5789f726cbfb0c10831ca6919e5f552b31a0ded0/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | zipStoreBase=GRADLE_USER_HOME 4 | zipStorePath=wrapper/dists 5 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.9-bin.zip 6 | -------------------------------------------------------------------------------- /gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | # 4 | # Copyright 2015 the original author or authors. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # https://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | ############################################################################## 20 | ## 21 | ## Gradle start up script for UN*X 22 | ## 23 | ############################################################################## 24 | 25 | # Attempt to set APP_HOME 26 | # Resolve links: $0 may be a link 27 | PRG="$0" 28 | # Need this for relative symlinks. 29 | while [ -h "$PRG" ] ; do 30 | ls=`ls -ld "$PRG"` 31 | link=`expr "$ls" : '.*-> \(.*\)$'` 32 | if expr "$link" : '/.*' > /dev/null; then 33 | PRG="$link" 34 | else 35 | PRG=`dirname "$PRG"`"/$link" 36 | fi 37 | done 38 | SAVED="`pwd`" 39 | cd "`dirname \"$PRG\"`/" >/dev/null 40 | APP_HOME="`pwd -P`" 41 | cd "$SAVED" >/dev/null 42 | 43 | APP_NAME="Gradle" 44 | APP_BASE_NAME=`basename "$0"` 45 | 46 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 47 | DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' 48 | 49 | # Use the maximum available, or set MAX_FD != -1 to use that value. 50 | MAX_FD="maximum" 51 | 52 | warn () { 53 | echo "$*" 54 | } 55 | 56 | die () { 57 | echo 58 | echo "$*" 59 | echo 60 | exit 1 61 | } 62 | 63 | # OS specific support (must be 'true' or 'false'). 64 | cygwin=false 65 | msys=false 66 | darwin=false 67 | nonstop=false 68 | case "`uname`" in 69 | CYGWIN* ) 70 | cygwin=true 71 | ;; 72 | Darwin* ) 73 | darwin=true 74 | ;; 75 | MINGW* ) 76 | msys=true 77 | ;; 78 | NONSTOP* ) 79 | nonstop=true 80 | ;; 81 | esac 82 | 83 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 84 | 85 | 86 | # Determine the Java command to use to start the JVM. 87 | if [ -n "$JAVA_HOME" ] ; then 88 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 89 | # IBM's JDK on AIX uses strange locations for the executables 90 | JAVACMD="$JAVA_HOME/jre/sh/java" 91 | else 92 | JAVACMD="$JAVA_HOME/bin/java" 93 | fi 94 | if [ ! -x "$JAVACMD" ] ; then 95 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 96 | 97 | Please set the JAVA_HOME variable in your environment to match the 98 | location of your Java installation." 99 | fi 100 | else 101 | JAVACMD="java" 102 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 103 | 104 | Please set the JAVA_HOME variable in your environment to match the 105 | location of your Java installation." 106 | fi 107 | 108 | # Increase the maximum file descriptors if we can. 109 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then 110 | MAX_FD_LIMIT=`ulimit -H -n` 111 | if [ $? -eq 0 ] ; then 112 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 113 | MAX_FD="$MAX_FD_LIMIT" 114 | fi 115 | ulimit -n $MAX_FD 116 | if [ $? -ne 0 ] ; then 117 | warn "Could not set maximum file descriptor limit: $MAX_FD" 118 | fi 119 | else 120 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 121 | fi 122 | fi 123 | 124 | # For Darwin, add options to specify how the application appears in the dock 125 | if $darwin; then 126 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 127 | fi 128 | 129 | # For Cygwin or MSYS, switch paths to Windows format before running java 130 | if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then 131 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 132 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 133 | 134 | JAVACMD=`cygpath --unix "$JAVACMD"` 135 | 136 | # We build the pattern for arguments to be converted via cygpath 137 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 138 | SEP="" 139 | for dir in $ROOTDIRSRAW ; do 140 | ROOTDIRS="$ROOTDIRS$SEP$dir" 141 | SEP="|" 142 | done 143 | OURCYGPATTERN="(^($ROOTDIRS))" 144 | # Add a user-defined pattern to the cygpath arguments 145 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 146 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 147 | fi 148 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 149 | i=0 150 | for arg in "$@" ; do 151 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 152 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 153 | 154 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 155 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 156 | else 157 | eval `echo args$i`="\"$arg\"" 158 | fi 159 | i=`expr $i + 1` 160 | done 161 | case $i in 162 | 0) set -- ;; 163 | 1) set -- "$args0" ;; 164 | 2) set -- "$args0" "$args1" ;; 165 | 3) set -- "$args0" "$args1" "$args2" ;; 166 | 4) set -- "$args0" "$args1" "$args2" "$args3" ;; 167 | 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 168 | 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 169 | 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 170 | 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 171 | 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 172 | esac 173 | fi 174 | 175 | # Escape application args 176 | save () { 177 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done 178 | echo " " 179 | } 180 | APP_ARGS=`save "$@"` 181 | 182 | # Collect all arguments for the java command, following the shell quoting and substitution rules 183 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" 184 | 185 | exec "$JAVACMD" "$@" 186 | -------------------------------------------------------------------------------- /gradlew.bat: -------------------------------------------------------------------------------- 1 | @rem 2 | @rem Copyright 2015 the original author or authors. 3 | @rem 4 | @rem Licensed under the Apache License, Version 2.0 (the "License"); 5 | @rem you may not use this file except in compliance with the License. 6 | @rem You may obtain a copy of the License at 7 | @rem 8 | @rem https://www.apache.org/licenses/LICENSE-2.0 9 | @rem 10 | @rem Unless required by applicable law or agreed to in writing, software 11 | @rem distributed under the License is distributed on an "AS IS" BASIS, 12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | @rem See the License for the specific language governing permissions and 14 | @rem limitations under the License. 15 | @rem 16 | 17 | @if "%DEBUG%" == "" @echo off 18 | @rem ########################################################################## 19 | @rem 20 | @rem Gradle startup script for Windows 21 | @rem 22 | @rem ########################################################################## 23 | 24 | @rem Set local scope for the variables with windows NT shell 25 | if "%OS%"=="Windows_NT" setlocal 26 | 27 | set DIRNAME=%~dp0 28 | if "%DIRNAME%" == "" set DIRNAME=. 29 | set APP_BASE_NAME=%~n0 30 | set APP_HOME=%DIRNAME% 31 | 32 | @rem Resolve any "." and ".." in APP_HOME to make it shorter. 33 | for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi 34 | 35 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 36 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" 37 | 38 | @rem Find java.exe 39 | if defined JAVA_HOME goto findJavaFromJavaHome 40 | 41 | set JAVA_EXE=java.exe 42 | %JAVA_EXE% -version >NUL 2>&1 43 | if "%ERRORLEVEL%" == "0" goto execute 44 | 45 | echo. 46 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 47 | echo. 48 | echo Please set the JAVA_HOME variable in your environment to match the 49 | echo location of your Java installation. 50 | 51 | goto fail 52 | 53 | :findJavaFromJavaHome 54 | set JAVA_HOME=%JAVA_HOME:"=% 55 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 56 | 57 | if exist "%JAVA_EXE%" goto execute 58 | 59 | echo. 60 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 61 | echo. 62 | echo Please set the JAVA_HOME variable in your environment to match the 63 | echo location of your Java installation. 64 | 65 | goto fail 66 | 67 | :execute 68 | @rem Setup the command line 69 | 70 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 71 | 72 | 73 | @rem Execute Gradle 74 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* 75 | 76 | :end 77 | @rem End local scope for the variables with windows NT shell 78 | if "%ERRORLEVEL%"=="0" goto mainEnd 79 | 80 | :fail 81 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 82 | rem the _cmd.exe /c_ return code! 83 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 84 | exit /b 1 85 | 86 | :mainEnd 87 | if "%OS%"=="Windows_NT" endlocal 88 | 89 | :omega 90 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'CapeSystem' 2 | 3 | -------------------------------------------------------------------------------- /src/main/java/dev/zihasz/zware/ZWare.java: -------------------------------------------------------------------------------- 1 | package dev.zihasz.zware; 2 | 3 | import dev.zihasz.zware.managers.CapeManager; 4 | import dev.zihasz.zware.mixin.MixinLoader; 5 | import net.minecraftforge.fml.common.Mod; 6 | import net.minecraftforge.fml.common.event.FMLPostInitializationEvent; 7 | import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; 8 | 9 | import java.util.logging.LogManager; 10 | import java.util.logging.Logger; 11 | 12 | @Mod(modid = ZWare.MOD_ID, name = ZWare.MOD_NAME, version = ZWare.MOD_VER) 13 | public class ZWare { 14 | 15 | // Mod Info 16 | public static final String MOD_NAME = "ZWare.cc"; 17 | public static final String MOD_ID = "zwaredotcc"; 18 | public static final String MOD_VER = "v1.0.0"; 19 | 20 | public static final Logger LOGGER = LogManager.getLogManager().getLogger(MOD_NAME); 21 | 22 | public static MixinLoader mixinLoader; 23 | public static CapeManager capeManager; 24 | 25 | // Mod Events 26 | @Mod.EventHandler 27 | public void preInit(FMLPreInitializationEvent event) { 28 | mixinLoader = new MixinLoader(); 29 | } 30 | 31 | @Mod.EventHandler 32 | public void postInit(FMLPostInitializationEvent event) { 33 | capeManager = new CapeManager(); 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/dev/zihasz/zware/managers/CapeManager.java: -------------------------------------------------------------------------------- 1 | package dev.zihasz.zware.managers; 2 | 3 | import dev.zihasz.zware.utils.CapeUtils; 4 | import net.minecraft.util.ResourceLocation; 5 | 6 | import java.io.IOException; 7 | import java.util.HashMap; 8 | import java.util.UUID; 9 | 10 | public class CapeManager { 11 | 12 | public final static String LIGHT_CAPE = "zware/capes/white_cape.png"; 13 | public final static String DARK_CAPE = "zware/capes/dark_cape.png"; 14 | 15 | private HashMap capes = new HashMap(); 16 | private final String capeURL = "https://pastebin.com/raw/W1Ef0Zpw"; 17 | 18 | public CapeManager() { 19 | try { capes = CapeUtils.getCapes(capeURL); } 20 | catch (IOException e) { e.printStackTrace(); } 21 | } 22 | 23 | public boolean hasCape(UUID uuid) { 24 | return capes.containsKey(uuid); 25 | } 26 | 27 | public ResourceLocation getCapeForUUID(UUID uuid) { 28 | if (!hasCape(uuid)) return null; 29 | 30 | return capes.get(uuid); 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/dev/zihasz/zware/mixin/MixinLoader.java: -------------------------------------------------------------------------------- 1 | package dev.zihasz.zware.mixin; 2 | 3 | import net.minecraftforge.fml.relauncher.IFMLLoadingPlugin; 4 | import org.spongepowered.asm.launch.MixinBootstrap; 5 | import org.spongepowered.asm.mixin.MixinEnvironment; 6 | import org.spongepowered.asm.mixin.Mixins; 7 | 8 | import javax.annotation.Nullable; 9 | import java.util.Map; 10 | 11 | public class MixinLoader implements IFMLLoadingPlugin { 12 | 13 | private static boolean isObfuscatedEnvironment = false; 14 | 15 | public MixinLoader() { 16 | MixinBootstrap.init(); 17 | Mixins.addConfiguration("mixins.zware.json"); 18 | MixinEnvironment.getDefaultEnvironment().setObfuscationContext("searge"); 19 | } 20 | 21 | @Override 22 | public String[] getASMTransformerClass() { 23 | return new String[0]; 24 | } 25 | 26 | @Override 27 | public String getModContainerClass() { 28 | return null; 29 | } 30 | 31 | @Nullable 32 | @Override 33 | public String getSetupClass() { 34 | return null; 35 | } 36 | 37 | @Override 38 | public void injectData(Map data) { 39 | isObfuscatedEnvironment = (boolean) data.get("runtimeDeobfuscationEnabled"); 40 | } 41 | 42 | @Override 43 | public String getAccessTransformerClass() { 44 | return null; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/main/java/dev/zihasz/zware/mixin/mixins/MixinAbstractClientPlayer.java: -------------------------------------------------------------------------------- 1 | package dev.zihasz.zware.mixin.mixins; 2 | 3 | import dev.zihasz.zware.ZWare; 4 | import net.minecraft.client.entity.AbstractClientPlayer; 5 | import net.minecraft.client.network.NetworkPlayerInfo; 6 | import net.minecraft.util.ResourceLocation; 7 | import org.spongepowered.asm.mixin.Mixin; 8 | import org.spongepowered.asm.mixin.Shadow; 9 | import org.spongepowered.asm.mixin.injection.At; 10 | import org.spongepowered.asm.mixin.injection.Inject; 11 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; 12 | 13 | import javax.annotation.Nullable; 14 | import java.util.UUID; 15 | 16 | @Mixin(AbstractClientPlayer.class) 17 | public abstract class MixinAbstractClientPlayer { 18 | 19 | @Shadow @Nullable 20 | protected abstract NetworkPlayerInfo getPlayerInfo(); 21 | 22 | @Inject(method = "getLocationCape", at = @At(value = "RETURN"), cancellable = true) 23 | public void getCape(CallbackInfoReturnable cir) { 24 | UUID uuid = getPlayerInfo().getGameProfile().getId(); 25 | 26 | if (ZWare.capeManager.hasCape(uuid)) { 27 | cir.setReturnValue(ZWare.capeManager.getCapeForUUID(uuid)); 28 | } 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/dev/zihasz/zware/utils/CapeUtils.java: -------------------------------------------------------------------------------- 1 | package dev.zihasz.zware.utils; 2 | 3 | import dev.zihasz.zware.managers.CapeManager; 4 | import net.minecraft.client.Minecraft; 5 | import net.minecraft.client.renderer.texture.DynamicTexture; 6 | import net.minecraft.util.ResourceLocation; 7 | 8 | import javax.imageio.ImageIO; 9 | import java.io.BufferedReader; 10 | import java.io.IOException; 11 | import java.io.InputStreamReader; 12 | import java.net.MalformedURLException; 13 | import java.net.URL; 14 | import java.net.URLConnection; 15 | import java.util.HashMap; 16 | import java.util.UUID; 17 | 18 | public class CapeUtils { 19 | 20 | public static HashMap getCapes(String pastebinURL) throws IOException { 21 | 22 | HashMap outMap = new HashMap<>(); 23 | 24 | URL url = new URL(pastebinURL); 25 | URLConnection connection = url.openConnection(); 26 | connection.setRequestProperty("User-Agent", "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.29 Safari/537.36"); 27 | 28 | BufferedReader reader = new BufferedReader(new InputStreamReader(connection.getInputStream())); 29 | String line; 30 | while ((line = reader.readLine()) != null) { 31 | String[] splitLine = line.split(" "); 32 | 33 | if (splitLine.length != 2) 34 | throw new IllegalStateException("Incorrect cape line found"); 35 | 36 | switch (splitLine[1]) { 37 | case "LIGHT": 38 | outMap.put(UUID.fromString(splitLine[0]), new ResourceLocation(CapeManager.LIGHT_CAPE)); 39 | break; 40 | case "DARK": 41 | outMap.put(UUID.fromString(splitLine[0]), new ResourceLocation(CapeManager.DARK_CAPE)); 42 | break; 43 | default: 44 | URL capeURL = new URL(splitLine[1]); 45 | outMap.put(UUID.fromString(splitLine[0]), downloadFromURL(capeURL)); 46 | break; 47 | } 48 | } 49 | 50 | return null; 51 | } 52 | 53 | public static ResourceLocation downloadFromURL(URL url) throws MalformedURLException, IOException 54 | { 55 | return Minecraft.getMinecraft().getTextureManager().getDynamicTextureLocation("zware/capes", new DynamicTexture(ImageIO.read(url))); 56 | } 57 | 58 | } 59 | -------------------------------------------------------------------------------- /src/main/resources/assets.zware.capes/README.txt: -------------------------------------------------------------------------------- 1 | You would obviously have white_cape.png and dark_cape.png here -------------------------------------------------------------------------------- /src/main/resources/mcmod.info: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "modid": "zware", 4 | "name": "ZWare.cc", 5 | "description": "Minecraft Utility mod.", 6 | "version": "${version}", 7 | "mcversion": "${mcversion}", 8 | "url": "", 9 | "updateUrl": "", 10 | "authorList": ["Zihasz", "Hqrion", "Historian"], 11 | "credits": "Your mom :wink:", 12 | "logoFile": "zware.png", 13 | "screenshots": [], 14 | "dependencies": [] 15 | } 16 | ] -------------------------------------------------------------------------------- /src/main/resources/mixins.zware.json: -------------------------------------------------------------------------------- 1 | { 2 | "required": false, 3 | "compatibilityLevel": "JAVA_8", 4 | "package": "dev.zihasz.zware.mixin.mixins", 5 | "refmap": "mixins.zware.refmap.json", 6 | "mixins": [ 7 | "MixinAbstractClientPlayer", 8 | "MixinEntityPlayerSP", 9 | "MixinNetworkManager", 10 | "MixinPlayerControllerMP" 11 | ] 12 | } -------------------------------------------------------------------------------- /src/main/resources/pack.mcmeta: -------------------------------------------------------------------------------- 1 | { 2 | "pack": { 3 | "description": "ZWare.cc", 4 | "pack_format": 3, 5 | "_comment": "ZWare on top!" 6 | } 7 | } -------------------------------------------------------------------------------- /src/main/resources/zware_at.cfg: -------------------------------------------------------------------------------- 1 | #Broad targeting here 2 | public net.minecraft.client.Minecraft * 3 | public net.minecraft.client.Minecraft *() 4 | public net.minecraft.entity.Entity * # All fields 5 | public net.minecraft.client.gui.GuiChat * 6 | public net.minecraft.world.chunk.storage.ExtendedBlockStorage * # All fields 7 | public net.minecraft.world.chunk.Chunk * # All fields 8 | public net.minecraft.client.renderer.RenderGlobal * # All fields 9 | public net.minecraft.client.renderer.RenderGlobal *() # All methods 10 | public net.minecraft.world.chunk.BlockStateContainer * # All fields 11 | public net.minecraft.client.renderer.EntityRenderer * # All fields 12 | public net.minecraft.client.renderer.EntityRenderer *() # All methods 13 | public net.minecraft.server.management.PlayerList * # All fields 14 | public net.minecraft.server.management.PlayerInteractionManager * # All fields 15 | public net.minecraft.client.multiplayer.PlayerControllerMP * # All fields 16 | public net.minecraft.client.multiplayer.PlayerControllerMP *() # All methods 17 | public net.minecraft.network.NetHandlerPlayServer * # All fields 18 | public net.minecraft.world.WorldServer * # All fields 19 | public net.minecraft.server.management.PlayerChunkMap * # All fields 20 | public net.minecraft.server.management.PlayerChunkMap *() # All methods 21 | public-f net.minecraft.server.management.PlayerChunkMapEntry * # All fields 22 | public net.minecraft.server.management.PlayerChunkMapEntry *() # All methods 23 | public net.minecraft.network.play.client.CPacketChatMessage field_149440_a # message 24 | public net.minecraft.network.play.server.SPacketEffect * # All fields 25 | public net.minecraft.network.play.server.SPacketSoundEffect * # All fields 26 | public net.minecraft.network.play.client.CPacketUpdateSign * 27 | public net.minecraft.client.particle.Particle * # All fields 28 | public net.minecraft.world.ChunkCache * # All fields 29 | public net.minecraft.util.ObjectIntIdentityMap * # All fields 30 | public net.minecraft.entity.player.EntityPlayerMP * # All fields 31 | public net.minecraft.block.Block * # All fields 32 | public net.minecraft.world.Explosion * # All fields 33 | #public net.minecraft.client.renderer.VertexBuffer * # All fields 34 | public net.minecraft.entity.player.InventoryPlayer * # All fields 35 | public net.minecraft.entity.item.EntityFallingBlock * # All fields 36 | public net.minecraft.client.renderer.ItemRenderer * 37 | public net.minecraft.network.play.client.CPacketCloseWindow * 38 | public net.minecraft.world.Explosion * # All fields 39 | public net.minecraft.item.ItemStack * # All fields 40 | public net.minecraft.world.chunk.EmptyChunk *() # All methods 41 | public net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher * # All fields 42 | public net.minecraft.entity.player.EntityPlayer * # All fields 43 | public net.minecraft.util.math.BlockPos * # All fields 44 | public net.minecraft.world.border.WorldBorder * # All fields 45 | public net.minecraft.world.border.WorldBorder *() # All methods 46 | public-f net.minecraft.util.math.Vec3i * #All fields 47 | public net.minecraft.client.gui.GuiTextField * 48 | public net.minecraft.client.gui.FontRenderer * 49 | public net.minecraft.client.gui.inventory.GuiEditSign * # All fields 50 | public net.minecraft.client.gui.GuiDisconnected * 51 | public net.minecraft.client.multiplayer.GuiConnecting * 52 | public net.minecraft.network.NetworkManager * 53 | public net.minecraft.network.play.server.SPacketEntityVelocity * 54 | public net.minecraft.network.play.server.SPacketExplosion * 55 | public net.minecraft.network.play.client.CPacketPlayer * 56 | public net.minecraft.network.play.server.SPacketPlayerPosLook * 57 | public net.minecraft.network.play.server.SPacketChat * 58 | public net.minecraft.client.renderer.entity.RenderManager * 59 | public net.minecraft.util.Timer * 60 | public net.minecraft.client.renderer.BufferBuilder * 61 | public net.minecraft.client.renderer.BlockModelRenderer * 62 | public net.minecraft.client.renderer.BlockModelRenderer *() 63 | public net.minecraft.pathfinding.Path * 64 | public net.minecraft.client.gui.GuiBossOverlay * 65 | public net.minecraft.item.ItemTool field_77865_bY # attackDamage --------------------------------------------------------------------------------