some improvements

This commit is contained in:
FlorianMichael 2021-09-10 17:55:16 +02:00
parent 4afc98c195
commit 98ea2cbbf9
14 changed files with 25 additions and 91 deletions

View File

@ -14,58 +14,29 @@ archivesBaseName = mod_id
java.toolchain.languageVersion = JavaLanguageVersion.of(8)
compileJava.options.encoding = "UTF-8"
println('Java: ' + System.getProperty('java.version') + ' JVM: ' + System.getProperty('java.vm.version') + '(' + System.getProperty('java.vendor') + ') Arch: ' + System.getProperty('os.arch'))
minecraft {
// The mappings can be changed at any time and must be in the following format.
// Channel: Version:
// snapshot YYYYMMDD Snapshot are built nightly.
// stable # Stables are built at the discretion of the MCP team.
// official MCVersion Official field/method names from Mojang mapping files
// parchment YYYY.MM.DD-MCVer Javadocs and parameters layered on top of Mojmaps from the ParchmentMC team.
//
// You must be aware of the Mojang license when using the 'official' / 'parchment' mappings.
// See more information here: https://github.com/MinecraftForge/MCPConfig/blob/master/Mojang.md
//
// Use non-default mappings at your own risk. They may not always work.
// Simply re-run your setup task after changing the mappings to update your workspace.
mappings channel: mappings_channel, version: mappings_version
// Default run configurations.
// These can be tweaked, removed, or duplicated as needed.
runs {
client {
workingDirectory project.file("run")
// Recommended logging data for a userdev environment
// The markers can be added/remove as needed separated by commas.
// "SCAN": For mods scan.
// "REGISTRIES": For firing of registry events.
// "REGISTRYDUMP": For getting the contents of all registries.
property 'forge.logging.markers', 'REGISTRIES'
// Recommended logging level for the console
property "forge.logging.console.level", "debug"
// mixin
property 'mixin.debug.export', 'true'
property "mixin.hotSwap", "true"
property "fml.coreMods.load", "de.enzaxd.viaforge.injection.MixinLoader"
// These arguments allow for optional authentication with Mojang servers.
// If you want to authenticate, put these properties in GRADLE_HOME/gradle.properties.
// By default, this is C:\Users\<your username>\.gradle\gradle.properties on Windows or ~/.gradle/gradle.properties on Linux/MacOS.
if (project.hasProperty('mc_uuid')) {
// Your UUID, trimmed / without the dashes
if (project.hasProperty('mc_uuid'))
args '--uuid', project.getProperty('mc_uuid')
}
if (project.hasProperty('mc_username')) {
// Your Minecraft in-game username, not email
if (project.hasProperty('mc_username'))
args '--username', project.getProperty('mc_username')
}
if (project.hasProperty('mc_accessToken')) {
// Your current access token. When it expires, you need to retrieve a new one and regenerate your run configurations.
// You may be able to find it in your .minecraft folder in launcher_accounts.json or launcher_profiles.json.
if (project.hasProperty('mc_accessToken'))
args '--accessToken', project.getProperty('mc_accessToken')
}
args '-mixin.config=' + 'mixins.' + project.getProperty('mod_id') + '.json'
@ -91,32 +62,11 @@ configurations {
}
dependencies {
// Specify the version of Minecraft to use, If this is any group other then "net.minecraft" it is assumed
// that the dep is a ForgeGradle "patcher" dependency. And it"s patches will be applied.
// The userdev artifact is a special name and will get all sorts of transformations applied to it.
minecraft "net.minecraftforge:forge:${minecraft_version}-${forge_version}"
// You may put jars on which you depend on in ./libs or you may define them like so..
// compile "some.group:artifact:version:classifier"
// compile "some.group:artifact:version"
// Real examples
// compile "com.mod-buildcraft:buildcraft:6.0.8:dev" // adds buildcraft to the dev env
// compile "com.googlecode.efficient-java-matrix-library:ejml:0.24" // adds ejml to the dev env
// The "provided" configuration is for optional dependencies that exist at compile-time but might not at runtime.
// provided "com.mod-buildcraft:buildcraft:6.0.8:dev"
// These dependencies get remapped to your current MCP mappings
// deobf "com.mod-buildcraft:buildcraft:6.0.8:dev"
// For more info...
// http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html
// http://www.gradle.org/docs/current/userguide/dependency_management.html
include "org.spongepowered:mixin:${mixin_version}"
include "com.viaversion:viaversion:4.0.2-SNAPSHOT"
include "com.viaversion:viabackwards:4.0.2-SNAPSHOT"
include "com.viaversion:viaversion:${viaversion_version}"
include "com.viaversion:viabackwards:${viabackwards_version}"
include "org.yaml:snakeyaml:1.29"
annotationProcessor "org.spongepowered:mixin:${mixin_version}:processor"

View File

@ -13,5 +13,7 @@ mod_name=Viaforge
mod_version=1.0.0
mod_base_package=de.enzaxd
# Dependencies
mixin_version=0.8.3
mixin_version=0.8.3
viaversion_version=4.0.2-SNAPSHOT
viabackwards_version=4.0.2-SNAPSHOT

View File

@ -8,7 +8,7 @@ import de.enzaxd.viaforge.loader.VRBackwardsLoader;
import de.enzaxd.viaforge.loader.VRProviderLoader;
import de.enzaxd.viaforge.platform.VRInjector;
import de.enzaxd.viaforge.platform.VRPlatform;
import de.enzaxd.viaforge.utils.JLoggerToLog4j;
import de.enzaxd.viaforge.util.JLoggerToLog4j;
import io.netty.channel.DefaultEventLoopGroup;
import io.netty.channel.EventLoop;
import org.apache.logging.log4j.LogManager;

View File

@ -2,7 +2,7 @@ package de.enzaxd.viaforge.gui;
import com.mojang.realmsclient.gui.ChatFormatting;
import de.enzaxd.viaforge.ViaForge;
import de.enzaxd.viaforge.protocols.ProtocolCollection;
import de.enzaxd.viaforge.protocol.ProtocolCollection;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.GuiScreen;
@ -93,7 +93,7 @@ public class GuiProtocolSelector extends GuiScreen {
ProtocolCollection.values()[i].getVersion().getVersion() ? ChatFormatting.GREEN.toString() :
ChatFormatting.DARK_RED.toString()) + ProtocolCollection.getProtocolById(
ProtocolCollection.values()[i].getVersion().getVersion()).getName(),
width / 2, i2 + 2, -1);
width / 2, i2, -1);
}
}
}

View File

@ -2,7 +2,7 @@ package de.enzaxd.viaforge.injection.mixins;
import de.enzaxd.viaforge.ViaForge;
import de.enzaxd.viaforge.gui.GuiProtocolSelector;
import de.enzaxd.viaforge.protocols.ProtocolCollection;
import de.enzaxd.viaforge.protocol.ProtocolCollection;
import net.minecraft.client.gui.*;
import net.minecraft.client.multiplayer.GuiConnecting;
import net.minecraft.client.multiplayer.ServerData;

View File

@ -2,7 +2,7 @@ package de.enzaxd.viaforge.injection.mixins;
import de.enzaxd.viaforge.ViaForge;
import de.enzaxd.viaforge.gui.GuiProtocolSelector;
import de.enzaxd.viaforge.protocols.ProtocolCollection;
import de.enzaxd.viaforge.protocol.ProtocolCollection;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.GuiMainMenu;
import net.minecraft.client.gui.GuiScreen;

View File

@ -2,7 +2,7 @@ package de.enzaxd.viaforge.injection.mixins;
import de.enzaxd.viaforge.ViaForge;
import de.enzaxd.viaforge.gui.GuiProtocolSelector;
import de.enzaxd.viaforge.protocols.ProtocolCollection;
import de.enzaxd.viaforge.protocol.ProtocolCollection;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.GuiMultiplayer;
import net.minecraft.client.gui.GuiScreen;

View File

@ -2,7 +2,7 @@ package de.enzaxd.viaforge.injection.mixins;
import de.enzaxd.viaforge.ViaForge;
import de.enzaxd.viaforge.gui.GuiProtocolSelector;
import de.enzaxd.viaforge.protocols.ProtocolCollection;
import de.enzaxd.viaforge.protocol.ProtocolCollection;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.client.gui.GuiScreenAddServer;

View File

@ -2,7 +2,7 @@ package de.enzaxd.viaforge.injection.mixins;
import de.enzaxd.viaforge.ViaForge;
import de.enzaxd.viaforge.gui.GuiProtocolSelector;
import de.enzaxd.viaforge.protocols.ProtocolCollection;
import de.enzaxd.viaforge.protocol.ProtocolCollection;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.client.gui.GuiScreenServerList;

View File

@ -10,8 +10,8 @@ import com.viaversion.viaversion.libs.gson.JsonObject;
import com.viaversion.viaversion.libs.kyori.adventure.text.serializer.gson.GsonComponentSerializer;
import com.viaversion.viaversion.libs.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer;
import de.enzaxd.viaforge.ViaForge;
import de.enzaxd.viaforge.utils.FutureTaskId;
import de.enzaxd.viaforge.utils.JLoggerToLog4j;
import de.enzaxd.viaforge.util.FutureTaskId;
import de.enzaxd.viaforge.util.JLoggerToLog4j;
import io.netty.util.concurrent.Future;
import io.netty.util.concurrent.GenericFutureListener;
import org.apache.logging.log4j.LogManager;

View File

@ -1,4 +1,4 @@
package de.enzaxd.viaforge.protocols;
package de.enzaxd.viaforge.protocol;
import com.viaversion.viaversion.api.protocol.version.ProtocolVersion;

View File

@ -1,4 +1,4 @@
package de.enzaxd.viaforge.utils;
package de.enzaxd.viaforge.util;
import com.viaversion.viaversion.api.platform.PlatformTask;

View File

@ -1,4 +1,4 @@
package de.enzaxd.viaforge.utils;
package de.enzaxd.viaforge.util;
import java.text.MessageFormat;
import java.util.logging.Level;

View File

@ -1,18 +0,0 @@
[
{
"modid": "viaforge",
"name": "Viaforge",
"description": "Client-side loader for ViaVersion and ViaBackwards.",
"version": "1.0.0",
"mcversion": "1.12.2",
"url": "",
"updateUrl": "",
"authorList": [
"enzaxd"
],
"credits": "",
"logoFile": "",
"screenshots": [],
"dependencies": []
}
]