├── .github
└── workflows
│ ├── build.yml
│ └── gradle-wrapper-validation.yml
├── .gitignore
├── LICENSE
├── README.md
├── build.gradle.kts
├── gradle.properties
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
├── log4j2.xml
├── root.gradle.kts
├── settings.gradle.kts
├── src
└── main
│ ├── java
│ └── dev
│ │ └── microcontrollers
│ │ └── mixmetica
│ │ ├── Mixmetica.java
│ │ ├── config
│ │ └── MixmeticaConfig.java
│ │ └── mixin
│ │ ├── CapeUtilsMixin.java
│ │ └── HttpUtilsMixin.java
│ └── resources
│ ├── mcmod.info
│ ├── mixins.mixmetica.json
│ └── mixmetica.png
└── versions
├── 1.12.2-1.8.9.txt
└── mainProject
/.github/workflows/build.yml:
--------------------------------------------------------------------------------
1 | name: Run Gradle Build
2 | on: [push, pull_request]
3 | jobs:
4 | gradle:
5 | runs-on: ubuntu-latest
6 | steps:
7 | - name: Checkout source
8 | uses: actions/checkout@v3
9 | - uses: actions/setup-java@v3
10 | name: Setup Java
11 | with:
12 | distribution: temurin
13 | java-version: 17
14 | - name: Setup Gradle
15 | uses: gradle/gradle-build-action@v2
16 | - name: Execute Gradle build
17 | run: ./gradlew build
18 | - uses: actions/upload-artifact@v3
19 | name: Upload built mod JAR
20 | with:
21 | name: mixmetica-artifacts
22 | path: versions/**/build/libs/
--------------------------------------------------------------------------------
/.github/workflows/gradle-wrapper-validation.yml:
--------------------------------------------------------------------------------
1 | name: "Validate Gradle Wrapper"
2 | on: [push, pull_request]
3 |
4 | jobs:
5 | validation:
6 | name: "Validation"
7 | runs-on: ubuntu-latest
8 | steps:
9 | - uses: actions/checkout@v3
10 | - uses: gradle/wrapper-validation-action@v1
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .idea/
2 | .vscode/
3 | run/
4 | build/
5 | .gradle/
6 | libs/
7 |
8 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | GNU LESSER GENERAL PUBLIC LICENSE
2 | Version 3, 29 June 2007
3 |
4 | Copyright (C) 2007 Free Software Foundation, Inc.
5 | Everyone is permitted to copy and distribute verbatim copies
6 | of this license document, but changing it is not allowed.
7 |
8 |
9 | This version of the GNU Lesser General Public License incorporates
10 | the terms and conditions of version 3 of the GNU General Public
11 | License, supplemented by the additional permissions listed below.
12 |
13 | 0. Additional Definitions.
14 |
15 | As used herein, "this License" refers to version 3 of the GNU Lesser
16 | General Public License, and the "GNU GPL" refers to version 3 of the GNU
17 | General Public License.
18 |
19 | "The Library" refers to a covered work governed by this License,
20 | other than an Application or a Combined Work as defined below.
21 |
22 | An "Application" is any work that makes use of an interface provided
23 | by the Library, but which is not otherwise based on the Library.
24 | Defining a subclass of a class defined by the Library is deemed a mode
25 | of using an interface provided by the Library.
26 |
27 | A "Combined Work" is a work produced by combining or linking an
28 | Application with the Library. The particular version of the Library
29 | with which the Combined Work was made is also called the "Linked
30 | Version".
31 |
32 | The "Minimal Corresponding Source" for a Combined Work means the
33 | Corresponding Source for the Combined Work, excluding any source code
34 | for portions of the Combined Work that, considered in isolation, are
35 | based on the Application, and not on the Linked Version.
36 |
37 | The "Corresponding Application Code" for a Combined Work means the
38 | object code and/or source code for the Application, including any data
39 | and utility programs needed for reproducing the Combined Work from the
40 | Application, but excluding the System Libraries of the Combined Work.
41 |
42 | 1. Exception to Section 3 of the GNU GPL.
43 |
44 | You may convey a covered work under sections 3 and 4 of this License
45 | without being bound by section 3 of the GNU GPL.
46 |
47 | 2. Conveying Modified Versions.
48 |
49 | If you modify a copy of the Library, and, in your modifications, a
50 | facility refers to a function or data to be supplied by an Application
51 | that uses the facility (other than as an argument passed when the
52 | facility is invoked), then you may convey a copy of the modified
53 | version:
54 |
55 | a) under this License, provided that you make a good faith effort to
56 | ensure that, in the event an Application does not supply the
57 | function or data, the facility still operates, and performs
58 | whatever part of its purpose remains meaningful, or
59 |
60 | b) under the GNU GPL, with none of the additional permissions of
61 | this License applicable to that copy.
62 |
63 | 3. Object Code Incorporating Material from Library Header Files.
64 |
65 | The object code form of an Application may incorporate material from
66 | a header file that is part of the Library. You may convey such object
67 | code under terms of your choice, provided that, if the incorporated
68 | material is not limited to numerical parameters, data structure
69 | layouts and accessors, or small macros, inline functions and templates
70 | (ten or fewer lines in length), you do both of the following:
71 |
72 | a) Give prominent notice with each copy of the object code that the
73 | Library is used in it and that the Library and its use are
74 | covered by this License.
75 |
76 | b) Accompany the object code with a copy of the GNU GPL and this license
77 | document.
78 |
79 | 4. Combined Works.
80 |
81 | You may convey a Combined Work under terms of your choice that,
82 | taken together, effectively do not restrict modification of the
83 | portions of the Library contained in the Combined Work and reverse
84 | engineering for debugging such modifications, if you also do each of
85 | the following:
86 |
87 | a) Give prominent notice with each copy of the Combined Work that
88 | the Library is used in it and that the Library and its use are
89 | covered by this License.
90 |
91 | b) Accompany the Combined Work with a copy of the GNU GPL and this license
92 | document.
93 |
94 | c) For a Combined Work that displays copyright notices during
95 | execution, include the copyright notice for the Library among
96 | these notices, as well as a reference directing the user to the
97 | copies of the GNU GPL and this license document.
98 |
99 | d) Do one of the following:
100 |
101 | 0) Convey the Minimal Corresponding Source under the terms of this
102 | License, and the Corresponding Application Code in a form
103 | suitable for, and under terms that permit, the user to
104 | recombine or relink the Application with a modified version of
105 | the Linked Version to produce a modified Combined Work, in the
106 | manner specified by section 6 of the GNU GPL for conveying
107 | Corresponding Source.
108 |
109 | 1) Use a suitable shared library mechanism for linking with the
110 | Library. A suitable mechanism is one that (a) uses at run time
111 | a copy of the Library already present on the user's computer
112 | system, and (b) will operate properly with a modified version
113 | of the Library that is interface-compatible with the Linked
114 | Version.
115 |
116 | e) Provide Installation Information, but only if you would otherwise
117 | be required to provide such information under section 6 of the
118 | GNU GPL, and only to the extent that such information is
119 | necessary to install and execute a modified version of the
120 | Combined Work produced by recombining or relinking the
121 | Application with a modified version of the Linked Version. (If
122 | you use option 4d0, the Installation Information must accompany
123 | the Minimal Corresponding Source and Corresponding Application
124 | Code. If you use option 4d1, you must provide the Installation
125 | Information in the manner specified by section 6 of the GNU GPL
126 | for conveying Corresponding Source.)
127 |
128 | 5. Combined Libraries.
129 |
130 | You may place library facilities that are a work based on the
131 | Library side by side in a single library together with other library
132 | facilities that are not Applications and are not covered by this
133 | License, and convey such a combined library under terms of your
134 | choice, if you do both of the following:
135 |
136 | a) Accompany the combined library with a copy of the same work based
137 | on the Library, uncombined with any other library facilities,
138 | conveyed under the terms of this License.
139 |
140 | b) Give prominent notice with the combined library that part of it
141 | is a work based on the Library, and explaining where to find the
142 | accompanying uncombined form of the same work.
143 |
144 | 6. Revised Versions of the GNU Lesser General Public License.
145 |
146 | The Free Software Foundation may publish revised and/or new versions
147 | of the GNU Lesser General Public License from time to time. Such new
148 | versions will be similar in spirit to the present version, but may
149 | differ in detail to address new problems or concerns.
150 |
151 | Each version is given a distinguishing version number. If the
152 | Library as you received it specifies that a certain numbered version
153 | of the GNU Lesser General Public License "or any later version"
154 | applies to it, you have the option of following the terms and
155 | conditions either of that published version or of any later version
156 | published by the Free Software Foundation. If the Library as you
157 | received it does not specify a version number of the GNU Lesser
158 | General Public License, you may choose any version of the GNU Lesser
159 | General Public License ever published by the Free Software Foundation.
160 |
161 | If the Library as you received it specifies that a proxy can decide
162 | whether future versions of the GNU Lesser General Public License shall
163 | apply, that proxy's public statement of acceptance of any version is
164 | permanent authorization for you to choose that version for the
165 | Library.
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Moved to https://codeberg.org/MicrocontrollersDev/Mixmetica
2 |
3 | # Mixmetica
4 |
5 | [](https://modrinth.com/mod/oneconfig)
6 |
7 | A simple mixin mod that adds Arcmetica support directly into OptiFine. No more need for DNS rules.
8 |
9 | Animated capes do not work. All cosmetic types supported.
10 |
11 | [Get cosmetics from Cosmetica (log in using Microsoft)](https://login.cosmetica.cc/microsoft-java)
12 |
13 | ## Download
14 |
15 | Download from [Modrinth](https://modrinth.com/mod/mixmetica).
16 |
17 | ### Discords
18 |
19 | Cosmetica Discord - https://discord.gg/aQh5SJEUBm
20 |
21 | My Discord - https://discord.gg/rejfv9kFJj
22 |
23 | ### Have an issue?
24 |
25 | Mixmetica is an extremely simple mod that modifies OptiFine to redirect their cosmetic URLs to Arcmetica's. If you are experiencing an issue, it is most likely an issue with Cosmetica, and you should report it to them. There is also a possibility it is an OptiFine issue, in which case there is nothing you can do as OptiFine won't fix it and I don't plan on modifying OptiFine any further than this. If you are able to confirm it is a Mixmetica specific issue, or just not sure what the issue is at all, feel free to report it in my Discord server. Both mine and Cosmetica's discord links can be found above.
26 |
27 | ### Notes
28 |
29 | This mod uses OneConfig for its config. OneConfig will automatically be downloaded on launch if it is not already installed.
30 |
--------------------------------------------------------------------------------
/build.gradle.kts:
--------------------------------------------------------------------------------
1 | @file:Suppress("UnstableApiUsage", "PropertyName")
2 |
3 | import cc.polyfrost.gradle.util.noServerRunConfigs
4 | import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
5 |
6 | // Adds support for kotlin, and adds the Polyfrost Gradle Toolkit
7 | // which we use to prepare the environment.
8 | plugins {
9 | kotlin("jvm")
10 | id("cc.polyfrost.multi-version")
11 | id("cc.polyfrost.defaults.repo")
12 | id("cc.polyfrost.defaults.java")
13 | id("cc.polyfrost.defaults.loom")
14 | id("com.github.johnrengelman.shadow")
15 | id("signing")
16 | java
17 | }
18 |
19 | // Gets the mod name, version and id from the `gradle.properties` file.
20 | val mod_name: String by project
21 | val mod_version: String by project
22 | val mod_id: String by project
23 |
24 | // Sets up the variables for when we preprocess to other Minecraft versions.
25 | preprocess {
26 | vars.put("MODERN", if (project.platform.mcMinor >= 16) 1 else 0)
27 | }
28 |
29 | // Sets the mod version to the one specified in `gradle.properties`. Make sure to change this following semver!
30 | version = mod_version
31 | // Sets the group, make sure to change this to your own. It can be a website you own backwards or your GitHub username.
32 | // e.g. com.github. or com.
33 | group = "dev.microcontrollers"
34 |
35 | // Sets the name of the output jar (the one you put in your mods folder and send to other people)
36 | // It outputs all versions of the mod into the `build` directory.
37 | base {
38 | archivesName.set("$mod_name-$platform")
39 | }
40 |
41 | // Configures the Polyfrost Loom, our plugin fork to easily set up the programming environment.
42 | loom {
43 | // Removes the server configs from IntelliJ IDEA, leaving only client runs.
44 | // If you're developing a server-side mod, you can remove this line.
45 | noServerRunConfigs()
46 |
47 | // Adds the tweak class if we are building legacy version of forge as per the documentation (https://docs.polyfrost.cc)
48 | if (project.platform.isLegacyForge) {
49 | launchConfigs.named("client") {
50 | // Loads OneConfig in dev env. Replace other tweak classes with this, but keep any other attributes!
51 | arg("--tweakClass", "cc.polyfrost.oneconfig.loader.stage0.LaunchWrapperTweaker")
52 | }
53 | }
54 | // Configures the mixins if we are building for forge, useful for when we are dealing with cross-platform projects.
55 | if (project.platform.isForge) {
56 | forge {
57 | mixinConfig("mixins.${mod_id}.json")
58 | }
59 | }
60 | // Configures the name of the mixin "refmap" using an experimental loom api.
61 | mixin.defaultRefmapName.set("mixins.${mod_id}.refmap.json")
62 | }
63 |
64 | // Creates the shade/shadow configuration, so we can include libraries inside our mod, rather than having to add them separately.
65 | val shade: Configuration by configurations.creating {
66 | configurations.implementation.get().extendsFrom(this)
67 | }
68 |
69 | // Configures the output directory for when building from the `src/resources` directory.
70 | sourceSets {
71 | main {
72 | output.setResourcesDir(java.classesDirectory)
73 | }
74 | }
75 |
76 | // Adds the Polyfrost maven repository so that we can get the libraries necessary to develop the mod.
77 | repositories {
78 | maven("https://repo.polyfrost.cc/releases")
79 | }
80 |
81 | // Configures the libraries/dependencies for your mod.
82 | dependencies {
83 | shade("org.spongepowered:mixin:0.7.11-SNAPSHOT") {
84 | isTransitive = false
85 | }
86 | annotationProcessor("org.spongepowered:mixin:0.8.5-SNAPSHOT")
87 |
88 | runtimeOnly("me.djtheredstoner:DevAuth-forge-legacy:1.1.2")
89 |
90 | compileOnly("cc.polyfrost:oneconfig-1.8.9-forge:0.2.0-alpha+") // Should not be included in jar
91 | shade("cc.polyfrost:oneconfig-wrapper-launchwrapper:1.0.0-beta+") // Should be included in jar
92 | }
93 |
94 | tasks {
95 | // Processes the `src/resources/mcmod.info or fabric.mod.json` and replaces
96 | // the mod id, name and version with the ones in `gradle.properties`
97 | processResources {
98 | inputs.property("id", mod_id)
99 | inputs.property("name", mod_name)
100 | val java = if (project.platform.mcMinor >= 18) {
101 | 17 // If we are playing on version 1.18, set the java version to 17
102 | } else {
103 | // Else if we are playing on version 1.17, use java 16.
104 | if (project.platform.mcMinor == 17) 16
105 | else 8 // For all previous versions, we **need** java 8 (for Forge support).
106 | }
107 | val compatLevel = "JAVA_${java}"
108 | inputs.property("java", java)
109 | inputs.property("java_level", compatLevel)
110 | inputs.property("version", mod_version)
111 | inputs.property("mcVersionStr", project.platform.mcVersionStr)
112 | filesMatching(listOf("mcmod.info", "mixins.${mod_id}.json", "mods.toml")) {
113 | expand(
114 | mapOf(
115 | "id" to mod_id,
116 | "name" to mod_name,
117 | "java" to java,
118 | "java_level" to compatLevel,
119 | "version" to mod_version,
120 | "mcVersionStr" to project.platform.mcVersionStr
121 | )
122 | )
123 | }
124 | filesMatching("fabric.mod.json") {
125 | expand(
126 | mapOf(
127 | "id" to mod_id,
128 | "name" to mod_name,
129 | "java" to java,
130 | "java_level" to compatLevel,
131 | "version" to mod_version,
132 | "mcVersionStr" to project.platform.mcVersionStr.substringBeforeLast(".") + ".x"
133 | )
134 | )
135 | }
136 | }
137 |
138 | // Configures the resources to include if we are building for forge or fabric.
139 | withType(Jar::class.java) {
140 | if (project.platform.isFabric) {
141 | exclude("mcmod.info", "mods.toml")
142 | } else {
143 | exclude("fabric.mod.json")
144 | if (project.platform.isLegacyForge) {
145 | exclude("mods.toml")
146 | } else {
147 | exclude("mcmod.info")
148 | }
149 | }
150 | }
151 |
152 | // Configures our shadow/shade configuration, so we can
153 | // include some dependencies within our mod jar file.
154 | named("shadowJar") {
155 | archiveClassifier.set("dev") // TODO: machete gets confused by the `dev` prefix.
156 | configurations = listOf(shade)
157 | duplicatesStrategy = DuplicatesStrategy.EXCLUDE
158 | }
159 |
160 | remapJar {
161 | input.set(shadowJar.get().archiveFile)
162 | archiveClassifier.set("")
163 | }
164 |
165 | jar {
166 | // Sets the jar manifest attributes.
167 | if (platform.isLegacyForge) {
168 | manifest.attributes += mapOf(
169 | "ModSide" to "CLIENT", // We aren't developing a server-side mod, so this is fine.
170 | "ForceLoadAsMod" to true, // We want to load this jar as a mod, so we force Forge to do so.
171 | "MixinConfigs" to "mixin.${mod_id}.json", // We want to use our mixin configuration, so we specify it here.
172 | "TweakOrder" to 0,
173 | "TweakClass" to "cc.polyfrost.oneconfig.loader.stage0.LaunchWrapperTweaker"
174 | )
175 | }
176 | dependsOn(shadowJar)
177 | archiveClassifier.set("")
178 | enabled = false
179 | }
180 | }
181 |
--------------------------------------------------------------------------------
/gradle.properties:
--------------------------------------------------------------------------------
1 | # Sets the name of your mod.
2 | mod_name=Mixmetica
3 | # Sets the id of your mod that mod loaders use to recognize it.
4 | mod_id=mixmetica
5 | # Sets the version of your mod. Make sure to update this when you make changes according to semver.
6 | mod_version=2.1.0
7 | # Sets the name of the jar file that you put in your 'mods' folder.
8 | mod_archives_name=Mixmetica
9 |
10 | polyfrost.defaults.loom=1
11 | org.gradle.daemon=true
12 | org.gradle.parallel=true
13 | org.gradle.configureoncommand=true
14 | org.gradle.parallel.threads=4
15 | org.gradle.jvmargs=-Xmx2G
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MicrocontrollersDev/Mixmetica/0bcb950150ce9c0236d4688c6efb043b4fdcea8a/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionBase=GRADLE_USER_HOME
2 | distributionPath=wrapper/dists
3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
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 |
--------------------------------------------------------------------------------
/log4j2.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/root.gradle.kts:
--------------------------------------------------------------------------------
1 | plugins {
2 | kotlin("jvm") version "1.6.21" apply false
3 | id("cc.polyfrost.multi-version.root")
4 | id("com.github.johnrengelman.shadow") version "7.1.2" apply false
5 | }
6 |
7 | preprocess {
8 | "1.12.2-forge"(11202, "srg") {
9 | "1.8.9-forge"(10809, "srg", file("versions/1.12.2-1.8.9.txt"))
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/settings.gradle.kts:
--------------------------------------------------------------------------------
1 | @file:Suppress("PropertyName")
2 |
3 | pluginManagement {
4 | repositories {
5 | gradlePluginPortal()
6 | mavenCentral()
7 | maven("https://repo.polyfrost.cc/releases") // Adds the Polyfrost maven repository to get Polyfrost Gradle Toolkit
8 | }
9 | plugins {
10 | val pgtVersion = "0.1.28" // Sets the default versions for Polyfrost Gradle Toolkit
11 | id("cc.polyfrost.multi-version.root") version pgtVersion
12 | }
13 | }
14 |
15 | val mod_name: String by settings
16 |
17 | // Configures the root project Gradle name based on the value in `gradle.properties`
18 | rootProject.name = mod_name
19 | rootProject.buildFileName = "root.gradle.kts"
20 |
21 | // Adds all of our build target versions to the classpath if we need to add version-specific code.
22 | listOf(
23 | "1.8.9-forge", // Update this if you want to remove/add a version, along with `build.gradle.kts` and `root.gradle.kts`.
24 | "1.12.2-forge"
25 | ).forEach { version ->
26 | include(":$version")
27 | project(":$version").apply {
28 | projectDir = file("versions/$version")
29 | buildFileName = "../../build.gradle.kts"
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/src/main/java/dev/microcontrollers/mixmetica/Mixmetica.java:
--------------------------------------------------------------------------------
1 | package dev.microcontrollers.mixmetica;
2 |
3 | import dev.microcontrollers.mixmetica.config.MixmeticaConfig;
4 | import net.minecraftforge.fml.common.Mod;
5 | import net.minecraftforge.fml.common.event.FMLInitializationEvent;
6 |
7 | @Mod(modid = "mixmetica", name = "Mixmetica", clientSideOnly = true)
8 | public class Mixmetica {
9 | public static MixmeticaConfig config;
10 |
11 | @Mod.EventHandler
12 | public void init(FMLInitializationEvent event) {
13 | config = new MixmeticaConfig();
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/src/main/java/dev/microcontrollers/mixmetica/config/MixmeticaConfig.java:
--------------------------------------------------------------------------------
1 | package dev.microcontrollers.mixmetica.config;
2 |
3 | import cc.polyfrost.oneconfig.config.Config;
4 | import cc.polyfrost.oneconfig.config.annotations.*;
5 | import cc.polyfrost.oneconfig.config.data.InfoType;
6 | import cc.polyfrost.oneconfig.config.data.Mod;
7 | import cc.polyfrost.oneconfig.config.data.ModType;
8 |
9 | import java.awt.Desktop;
10 | import java.io.IOException;
11 | import java.net.URI;
12 | import java.net.URISyntaxException;
13 |
14 | public class MixmeticaConfig extends Config {
15 | @Info(
16 | text = "Mixmetica does not currently support capes.",
17 | type = InfoType.ERROR,
18 | size = 2
19 | )
20 | private boolean animatedCapesError = false;
21 |
22 | @Info(
23 | text = "Cosmetica will ask you to sign into your Microsoft account to authenticate. Disabling cosmetics will require a game restart.",
24 | type = InfoType.INFO,
25 | subcategory = "General",
26 | size = 2
27 | )
28 | private boolean loginAndDisableWarning = false;
29 |
30 | @Button(
31 | name = "Change Cosmetics",
32 | text = "Click",
33 | description = "This will take you to the Cosmetica website where you can log in and manage your cosmetics.",
34 | subcategory = "General"
35 | )
36 | Runnable openCosmetica = () -> {
37 | if (Desktop.isDesktopSupported() && Desktop.getDesktop().isSupported(Desktop.Action.BROWSE)) {
38 | try {
39 | Desktop.getDesktop().browse(new URI("https://login.cosmetica.cc/microsoft-java"));
40 | } catch (IOException | URISyntaxException e) {
41 | throw new RuntimeException(e);
42 | }
43 | }
44 | };
45 |
46 | @Switch(
47 | name = "Disable Cosmetica Cosmetics",
48 | description = "This will revert back to using OptiFine cosmetics.",
49 | subcategory = "General"
50 | )
51 | public static boolean disable = false;
52 |
53 | @Info(
54 | text = "Only use a custom instance if you know what you are doing.",
55 | type = InfoType.WARNING,
56 | subcategory = "Instance",
57 | size = 2
58 | )
59 | private boolean arcmeticaInstanceWarning = false;
60 |
61 | @Info(
62 | text = "If Cosmetica servers are down, use the disable toggle above.",
63 | type = InfoType.INFO,
64 | subcategory = "Status"
65 | )
66 | public static boolean status = false;
67 |
68 | @Button(
69 | name = "Check Cosmetica Status",
70 | text = "Click",
71 | subcategory = "Status"
72 | )
73 | Runnable cosmeticaStatus = () -> {
74 | if (Desktop.isDesktopSupported() && Desktop.getDesktop().isSupported(Desktop.Action.BROWSE)) {
75 | try {
76 | Desktop.getDesktop().browse(new URI("https://status.cosmetica.cc/"));
77 | } catch (IOException | URISyntaxException e) {
78 | throw new RuntimeException(e);
79 | }
80 | }
81 | };
82 |
83 | @Switch(
84 | name = "Use Custom Arcmetica Instance",
85 | subcategory = "Instance"
86 | )
87 | public static boolean customInstance = false;
88 |
89 | @Text(
90 | name = "Arcmetica Instance",
91 | placeholder = "http://",
92 | secure = true,
93 | subcategory = "Instance"
94 | )
95 | public static String instanceLink = "";
96 |
97 | @Button(
98 | name = "Join the Cosmetica Discord",
99 | text = "Click",
100 | subcategory = "Socials"
101 | )
102 | Runnable cosmeticaDiscord = () -> {
103 | if (Desktop.isDesktopSupported() && Desktop.getDesktop().isSupported(Desktop.Action.BROWSE)) {
104 | try {
105 | Desktop.getDesktop().browse(new URI("https://discord.gg/aQh5SJEUBm"));
106 | } catch (IOException | URISyntaxException e) {
107 | throw new RuntimeException(e);
108 | }
109 | }
110 | };
111 |
112 | @Button(
113 | name = "Donate to Cosmetica",
114 | text = "Click",
115 | subcategory = "Socials"
116 | )
117 | Runnable cosmeticaKofi = () -> {
118 | if (Desktop.isDesktopSupported() && Desktop.getDesktop().isSupported(Desktop.Action.BROWSE)) {
119 | try {
120 | Desktop.getDesktop().browse(new URI("https://ko-fi.com/cosmetica"));
121 | } catch (IOException | URISyntaxException e) {
122 | throw new RuntimeException(e);
123 | }
124 | }
125 | };
126 |
127 | @Button(
128 | name = "Join the Mixmetica Discord",
129 | text = "Click",
130 | subcategory = "Socials"
131 | )
132 | Runnable mixmeticaDiscord = () -> {
133 | if (Desktop.isDesktopSupported() && Desktop.getDesktop().isSupported(Desktop.Action.BROWSE)) {
134 | try {
135 | Desktop.getDesktop().browse(new URI("https://discord.gg/rejfv9kFJj"));
136 | } catch (IOException | URISyntaxException e) {
137 | throw new RuntimeException(e);
138 | }
139 | }
140 | };
141 |
142 | @Button(
143 | name = "Check Out My Other Mods",
144 | text = "Click",
145 | subcategory = "Socials"
146 | )
147 | Runnable modrinthProfile = () -> {
148 | if (Desktop.isDesktopSupported() && Desktop.getDesktop().isSupported(Desktop.Action.BROWSE)) {
149 | try {
150 | Desktop.getDesktop().browse(new URI("https://modrinth.com/user/Microcontrollers"));
151 | } catch (IOException | URISyntaxException e) {
152 | throw new RuntimeException(e);
153 | }
154 | }
155 | };
156 |
157 | public MixmeticaConfig() {
158 | super(new Mod("Mixmetica", ModType.UTIL_QOL, "/mixmetica.png"), "mixmetica.json");
159 | initialize();
160 | addDependency("instanceLink", "customInstance");
161 | }
162 | }
163 |
--------------------------------------------------------------------------------
/src/main/java/dev/microcontrollers/mixmetica/mixin/CapeUtilsMixin.java:
--------------------------------------------------------------------------------
1 | package dev.microcontrollers.mixmetica.mixin;
2 |
3 | //import dev.microcontrollers.mixmetica.config.MixmeticaConfig;
4 | //import org.spongepowered.asm.mixin.Dynamic;
5 | //import org.spongepowered.asm.mixin.Mixin;
6 | //import org.spongepowered.asm.mixin.Pseudo;
7 | //import org.spongepowered.asm.mixin.injection.Constant;
8 | //import org.spongepowered.asm.mixin.injection.ModifyConstant;
9 | //
10 | //@Pseudo
11 | //@Mixin(targets = "net.optifine.player.CapeUtils", remap = false)
12 | //public abstract class CapeUtilsMixin {
13 | // @Dynamic
14 | // @ModifyConstant(method = "downloadCape", constant = @Constant(stringValue = "http://s.optifine.net/capes/", ordinal = 0))
15 | // private static String modifyCapeUrl(String originalUrl) {
16 | // if (MixmeticaConfig.disable) return "http://s.optifine.net/capes/";
17 | // String modifiedUrl = "http://23.95.137.176/capes/";
18 | // if (MixmeticaConfig.customInstance) {
19 | // String link = MixmeticaConfig.instanceLink;
20 | // if (link.endsWith("/")) modifiedUrl = link.substring(0, link.length() - 1) + "/capes/";
21 | // }
22 | // modifiedUrl = modifiedUrl + originalUrl.substring(originalUrl.lastIndexOf('/') + 1);
23 | // return modifiedUrl;
24 | // }
25 | //}
26 |
--------------------------------------------------------------------------------
/src/main/java/dev/microcontrollers/mixmetica/mixin/HttpUtilsMixin.java:
--------------------------------------------------------------------------------
1 | package dev.microcontrollers.mixmetica.mixin;
2 |
3 | import dev.microcontrollers.mixmetica.config.MixmeticaConfig;
4 | import org.spongepowered.asm.mixin.Dynamic;
5 | import org.spongepowered.asm.mixin.Mixin;
6 | import org.spongepowered.asm.mixin.Pseudo;
7 | import org.spongepowered.asm.mixin.injection.Constant;
8 | import org.spongepowered.asm.mixin.injection.ModifyConstant;
9 |
10 | @Pseudo
11 | @Mixin(targets = "net.optifine.http.HttpUtils", remap = false)
12 | public abstract class HttpUtilsMixin {
13 | @Dynamic
14 | @ModifyConstant(method = "getPlayerItemsUrl", constant = @Constant(stringValue = "http://s.optifine.net", ordinal = 0))
15 | private static String modifyCapeUrl(String originalUrl) {
16 | if (MixmeticaConfig.disable) return "http://s.optifine.net";
17 | else if (MixmeticaConfig.customInstance) {
18 | String link = MixmeticaConfig.instanceLink;
19 | if (link.endsWith("/")) link = link.substring(0, link.length() - 1);
20 | return link;
21 | }
22 | return "http://23.95.137.176";
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/src/main/resources/mcmod.info:
--------------------------------------------------------------------------------
1 | [
2 | {
3 | "modid": "${id}",
4 | "name": "${name}",
5 | "description": "Mixins into OptiFine to use Arcmetica without needing DNS rules.",
6 | "version": "${version}",
7 | "mcversion": "1.8.9",
8 | "url": "https://modrinth.com/mod/mixmetica",
9 | "updateUrl": "",
10 | "authorList": [
11 | "Microcontrollers"
12 | ],
13 | "credits": "Cosmetica Team",
14 | "logoFile": "mixmetica.png",
15 | "screenshots": [],
16 | "dependencies": []
17 | }
18 | ]
19 |
--------------------------------------------------------------------------------
/src/main/resources/mixins.mixmetica.json:
--------------------------------------------------------------------------------
1 | {
2 | "package": "dev.microcontrollers.mixmetica.mixin",
3 | "refmap": "mixins.mixmetica.refmap.json",
4 | "minVersion": "0.7",
5 | "compatibilityLevel": "JAVA_8",
6 | "client": [
7 | "HttpUtilsMixin"
8 | ]
9 | }
10 |
--------------------------------------------------------------------------------
/src/main/resources/mixmetica.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MicrocontrollersDev/Mixmetica/0bcb950150ce9c0236d4688c6efb043b4fdcea8a/src/main/resources/mixmetica.png
--------------------------------------------------------------------------------
/versions/1.12.2-1.8.9.txt:
--------------------------------------------------------------------------------
1 | net.minecraft.util.text.Style net.minecraft.util.ChatStyle
2 | net.minecraft.util.text.TextComponentBase net.minecraft.util.ChatComponentStyle
3 | net.minecraft.util.text.TextComponentString net.minecraft.util.ChatComponentText
4 | net.minecraft.util.text.TextFormatting net.minecraft.util.EnumChatFormatting
5 | net.minecraft.util.text.event.ClickEvent net.minecraft.event.ClickEvent
6 | net.minecraft.util.text.event.HoverEvent net.minecraft.event.HoverEvent
7 |
8 | net.minecraft.util.text.ITextComponent setStyle() net.minecraft.util.IChatComponent setChatStyle()
9 | net.minecraft.util.text.Style setClickEvent() net.minecraft.util.ChatStyle setChatClickEvent()
10 | net.minecraft.client.entity.EntityPlayerSP sendMessage() net.minecraft.client.entity.EntityPlayerSP addChatComponentMessage()
11 |
--------------------------------------------------------------------------------
/versions/mainProject:
--------------------------------------------------------------------------------
1 | 1.8.9-forge
--------------------------------------------------------------------------------