chore: bump deps
ci/woodpecker/push/docs Pipeline was successful Details
ci/woodpecker/push/jfmod Pipeline was successful Details

This commit is contained in:
Johannes Frohnmeyer 2023-09-22 18:41:55 +02:00
parent ee554fe748
commit 5ef0ad43ed
Signed by: Johannes
GPG Key ID: E76429612C2929F4
20 changed files with 62 additions and 393 deletions

View File

@ -6,17 +6,19 @@ allprojects {
group = "io.gitlab.jfronny.libjf"
}
val fabricVersion by extra("0.87.1+1.20.2")
val commonsVersion by extra("1.4-SNAPSHOT")
val gsonCompileVersion by extra("1.3-SNAPSHOT")
val modmenuVersion by extra("7.2.1")
val fabricVersion by extra("0.89.1+1.20.2")
val commonsVersion by extra("1.5-SNAPSHOT")
val gsonCompileVersion by extra("1.4-SNAPSHOT")
val modmenuVersion by extra("8.0.0-beta.2")
val annotationsVersion by extra("24.0.1")
val javapoetVersion by extra("1.13.0")
val baseCommonsModules by extra(listOf("http-client", "io", "logging", "logging-slf4j", "serialize", "serialize-gson"))
jfMod {
minecraftVersion = "23w33a"
yarn("build.7")
minecraftVersion = "1.20.2"
yarn("build.1")
loaderVersion = "0.14.22"
modrinth {
@ -38,17 +40,11 @@ allprojects {
dependencies {
// Temporarily disabled since modmenu doesn't support snapshots
// modLocalRuntime("com.terraformersmc:modmenu:$modmenuVersion") {
// exclude("net.fabricmc") // required to work around duplicate fabric loaders
// }
modLocalRuntime("com.terraformersmc:modmenu:$modmenuVersion") {
exclude("net.fabricmc") // required to work around duplicate fabric loaders
}
modLocalRuntime(fabricApi.module("fabric-command-api-v2", fabricVersion))
compileOnly("io.gitlab.jfronny:commons:$commonsVersion")
compileOnly("io.gitlab.jfronny:commons-gson:$commonsVersion")
// temporary workaround for snapshot versions since these were previously provided by modmenu. Remove once out of use!
modLocalRuntime(fabricApi.module("fabric-resource-loader-v0", fabricVersion))
modLocalRuntime(fabricApi.module("fabric-lifecycle-events-v1", fabricVersion))
modLocalRuntime(fabricApi.module("fabric-screen-api-v1", fabricVersion))
modLocalRuntime(fabricApi.module("fabric-key-binding-api-v1", fabricVersion))
baseCommonsModules.forEach { compileOnly("io.gitlab.jfronny:commons-$it:$commonsVersion") }
}
}

View File

@ -1,5 +1,3 @@
import io.gitlab.jfronny.scripts.*
plugins {
id("jfmod.module")
}
@ -11,10 +9,10 @@ base {
dependencies {
val fabricVersion: String by rootProject.extra
val commonsVersion: String by rootProject.extra
val baseCommonsModules: List<String> by rootProject.extra
include(modImplementation(fabricApi.module("fabric-lifecycle-events-v1", fabricVersion))!!)
shadow("io.gitlab.jfronny:commons:$commonsVersion")
shadow("io.gitlab.jfronny:commons-gson:$commonsVersion")
shadow("io.gitlab.jfronny:commons-slf4j:$commonsVersion") {
isTransitive = false
}
baseCommonsModules.forEach { shadow("io.gitlab.jfronny:commons-$it:$commonsVersion") {
if (it == "logging-slf4j") isTransitive = false
} }
}

View File

@ -1,9 +1,9 @@
package io.gitlab.jfronny.libjf;
import io.gitlab.jfronny.commons.log.Level;
import io.gitlab.jfronny.commons.log.Logger;
import io.gitlab.jfronny.commons.log.slf4j.SLF4JLogger;
import io.gitlab.jfronny.commons.serialize.gson.api.v1.GsonHolders;
import io.gitlab.jfronny.commons.logging.Level;
import io.gitlab.jfronny.commons.logging.Logger;
import io.gitlab.jfronny.commons.logging.slf4j.SLF4JLogger;
import io.gitlab.jfronny.commons.serialize.gson.api.v2.GsonHolders;
import io.gitlab.jfronny.libjf.gson.HiddenAnnotationExclusionStrategy;
import net.fabricmc.loader.api.FabricLoader;
import net.fabricmc.loader.api.entrypoint.PreLaunchEntrypoint;

View File

@ -1,6 +1,6 @@
package io.gitlab.jfronny.libjf.gson;
import io.gitlab.jfronny.commons.serialize.gson.api.v1.GsonHolders;
import io.gitlab.jfronny.commons.serialize.gson.api.v2.GsonHolders;
import io.gitlab.jfronny.gson.ExclusionStrategy;
import io.gitlab.jfronny.gson.FieldAttributes;
import net.fabricmc.api.EnvType;
@ -17,6 +17,6 @@ public class HiddenAnnotationExclusionStrategy implements ExclusionStrategy {
}
public static void register() {
GsonHolders.modifyBuilder(builder -> builder.setExclusionStrategies(new HiddenAnnotationExclusionStrategy()));
GsonHolders.applyTransform(builder -> builder.setExclusionStrategies(new HiddenAnnotationExclusionStrategy()));
}
}

View File

@ -25,7 +25,7 @@ dependencies {
implementation(devProject(":libjf-config-core-v2"))
implementation("org.jetbrains:annotations:$annotationsVersion")
implementation("io.gitlab.jfronny:commons:$commonsVersion")
implementation("io.gitlab.jfronny:commons-gson:$commonsVersion")
implementation("io.gitlab.jfronny:commons-serialize-gson:$commonsVersion")
implementation("com.squareup:javapoet:$javapoetVersion")
testAnnotationProcessor(sourceSets.main.get().output)
configurations.testAnnotationProcessor.get().extendsFrom(configurations.implementation.get())

View File

@ -1,6 +1,6 @@
package io.gitlab.jfronny.libjf.config.impl;
import io.gitlab.jfronny.commons.serialize.gson.api.v1.GsonHolders;
import io.gitlab.jfronny.commons.serialize.gson.api.v2.GsonHolders;
import io.gitlab.jfronny.libjf.config.api.v2.Category;
import io.gitlab.jfronny.libjf.config.api.v2.JfConfig;
import io.gitlab.jfronny.libjf.config.api.v2.dsl.CategoryBuilder;

View File

@ -1,6 +1,6 @@
package io.gitlab.jfronny.libjf.config.impl.dsl;
import io.gitlab.jfronny.commons.serialize.gson.api.v1.GsonHolders;
import io.gitlab.jfronny.commons.serialize.gson.api.v2.GsonHolders;
import io.gitlab.jfronny.gson.*;
import io.gitlab.jfronny.gson.stream.*;
import io.gitlab.jfronny.libjf.LibJf;

View File

@ -1,6 +1,6 @@
package io.gitlab.jfronny.libjf.config.impl.dsl;
import io.gitlab.jfronny.commons.serialize.gson.api.v1.GsonHolders;
import io.gitlab.jfronny.commons.serialize.gson.api.v2.GsonHolders;
import io.gitlab.jfronny.commons.throwable.ThrowingConsumer;
import io.gitlab.jfronny.commons.throwable.ThrowingSupplier;
import io.gitlab.jfronny.gson.stream.*;

View File

@ -1,6 +1,6 @@
package io.gitlab.jfronny.libjf.config.impl.ui.tiny;
import io.gitlab.jfronny.commons.serialize.gson.api.v1.GsonHolders;
import io.gitlab.jfronny.commons.serialize.gson.api.v2.GsonHolders;
import io.gitlab.jfronny.libjf.LibJf;
import io.gitlab.jfronny.libjf.config.api.v2.ConfigInstance;
import io.gitlab.jfronny.libjf.config.api.v2.EntryInfo;

View File

@ -1,7 +1,7 @@
package io.gitlab.jfronny.libjf.config.impl.ui.tiny.entry;
import io.gitlab.jfronny.commons.ref.R;
import io.gitlab.jfronny.commons.serialize.gson.api.v1.GsonHolders;
import io.gitlab.jfronny.commons.serialize.gson.api.v2.GsonHolders;
import io.gitlab.jfronny.commons.throwable.Try;
import io.gitlab.jfronny.libjf.LibJf;
import io.gitlab.jfronny.libjf.config.api.v2.ConfigCategory;

View File

@ -1,8 +1,8 @@
package io.gitlab.jfronny.libjf.devutil.mixin;
import com.mojang.authlib.minecraft.UserApiService;
import net.minecraft.client.util.ProfileKeys;
import net.minecraft.client.util.Session;
import net.minecraft.client.session.ProfileKeys;
import net.minecraft.client.session.Session;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;

View File

@ -0,0 +1,18 @@
package io.gitlab.jfronny.libjf.devutil.mixin;
import net.minecraft.client.realms.*;
import net.minecraft.client.realms.exception.RealmsServiceException;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
@Mixin(RealmsClient.class)
public class RealmsClientMixin {
/**
* @author JFronny
* @reason Prevent crash log
*/
@Overwrite
public RealmsClient.CompatibleVersionResponse clientCompatible() throws RealmsServiceException {
return RealmsClient.CompatibleVersionResponse.OTHER;
}
}

View File

@ -6,6 +6,7 @@
"client": [
"MinecraftClientMixin",
"ProfileKeysMixin",
"RealmsClientMixin",
"TitleScreenMixin"
],
"injectors": {

View File

@ -1,6 +1,6 @@
package io.gitlab.jfronny.libjf.translate.impl.google;
import io.gitlab.jfronny.commons.HttpUtils;
import io.gitlab.jfronny.commons.http.client.HttpClient;
import io.gitlab.jfronny.libjf.translate.api.TranslateException;
import io.gitlab.jfronny.libjf.translate.impl.AbstractTranslateService;
import org.apache.commons.lang3.StringEscapeUtils;
@ -31,7 +31,7 @@ public class GoogleTranslateService extends AbstractTranslateService<GoogleTrans
private GoogleTranslateService() throws URISyntaxException, IOException {
Map<String, GoogleTranslateLanguage> knownLanguages = new HashMap<>();
Matcher matcher = LANGUAGE_KEY.matcher(HttpUtils.get("https://translate.google.com/m?mui=tl").sendString());
Matcher matcher = LANGUAGE_KEY.matcher(HttpClient.get("https://translate.google.com/m?mui=tl").sendString());
while (matcher.find()) {
String id = matcher.group(1);
String name = matcher.group(2);
@ -98,6 +98,6 @@ public class GoogleTranslateService extends AbstractTranslateService<GoogleTrans
return null;
String pageUrl = String.format("https://translate.google.com/m?hl=en&sl=%s&tl=%s&ie=UTF-8&prev=_m&q=%s",
translateFrom, translateTo, URLEncoder.encode(textToTranslate.trim(), StandardCharsets.UTF_8));
return HttpUtils.get(pageUrl).sendString();
return HttpClient.get(pageUrl).sendString();
}
}

View File

@ -1,6 +1,6 @@
package io.gitlab.jfronny.libjf.translate.impl.libretranslate;
import io.gitlab.jfronny.commons.HttpUtils;
import io.gitlab.jfronny.commons.http.client.HttpClient;
import io.gitlab.jfronny.gson.reflect.TypeToken;
import io.gitlab.jfronny.libjf.translate.api.TranslateException;
import io.gitlab.jfronny.libjf.translate.impl.AbstractTranslateService;
@ -44,7 +44,7 @@ public class LibreTranslateService extends AbstractTranslateService<LibreTransla
try {
ArrayList<LibreTranslateLanguage> langs = new ArrayList<>();
langs.add(autoDetect);
for (LibreTranslateLanguage.ApiResult lang : HttpUtils.get(host + "/languages").<ArrayList<LibreTranslateLanguage.ApiResult>>sendSerialized(languageListType)) {
for (LibreTranslateLanguage.ApiResult lang : HttpClient.get(host + "/languages").<ArrayList<LibreTranslateLanguage.ApiResult>>sendSerialized(languageListType)) {
LibreTranslateLanguage langR = lang.toLanguage();
langs.add(langR);
languageById.put(lang.code, langR);
@ -62,7 +62,7 @@ public class LibreTranslateService extends AbstractTranslateService<LibreTransla
@Override
protected String performTranslate(String textToTranslate, LibreTranslateLanguage translateFrom, LibreTranslateLanguage translateTo) throws Exception {
LibreTranslateResult result = HttpUtils.post(host + "/translate").bodyForm(Map.of(
LibreTranslateResult result = HttpClient.post(host + "/translate").bodyForm(Map.of(
"q", textToTranslate,
"source", translateFrom.getIdentifier(),
"target", translateTo.getIdentifier()
@ -74,7 +74,7 @@ public class LibreTranslateService extends AbstractTranslateService<LibreTransla
public LibreTranslateLanguage detect(String text) throws TranslateException {
List<LibreTranslateDetectResult> result;
try {
result = HttpUtils.post(host + "/detect").bodyForm(Map.of("q", text)).sendSerialized(translateDetectResultListType);
result = HttpClient.post(host + "/detect").bodyForm(Map.of("q", text)).sendSerialized(translateDetectResultListType);
} catch (IOException | URISyntaxException e) {
throw new TranslateException("Could not detect language", e);
}

View File

@ -9,5 +9,7 @@ base {
}
dependencies {
val commonsVersion: String by rootProject.extra
api(devProject(":libjf-base"))
shadow(compileOnly("io.gitlab.jfronny:commons-unsafe:$commonsVersion")!!)
}

View File

@ -1,6 +1,6 @@
package io.gitlab.jfronny.libjf.unsafe;
import io.gitlab.jfronny.commons.log.Logger;
import io.gitlab.jfronny.commons.logging.Logger;
import net.fabricmc.loader.impl.util.log.Log;
import net.fabricmc.loader.impl.util.log.LogCategory;

View File

@ -1,7 +1,7 @@
package io.gitlab.jfronny.libjf.unsafe;
import io.gitlab.jfronny.commons.log.Level;
import io.gitlab.jfronny.commons.log.Logger;
import io.gitlab.jfronny.commons.logging.Level;
import io.gitlab.jfronny.commons.logging.Logger;
import io.gitlab.jfronny.libjf.LibJf;
import net.fabricmc.loader.api.FabricLoader;
import net.fabricmc.loader.api.LanguageAdapter;

View File

@ -1,5 +1,6 @@
package io.gitlab.jfronny.libjf.unsafe;
import io.gitlab.jfronny.commons.unsafe.Unsafe;
import io.gitlab.jfronny.libjf.LibJf;
import io.gitlab.jfronny.libjf.unsafe.asm.*;
import org.objectweb.asm.tree.ClassNode;

View File

@ -1,347 +0,0 @@
package io.gitlab.jfronny.libjf.unsafe;
import io.gitlab.jfronny.commons.throwable.Try;
import java.lang.reflect.Field;
import java.nio.ByteBuffer;
@SuppressWarnings({"unchecked", "unused"})
public class Unsafe {
public static final sun.misc.Unsafe theUnsafe = Try.orThrow(() -> {
Field unsafeField = Try.orThrow(() -> sun.misc.Unsafe.class.getDeclaredField("theUnsafe"));
unsafeField.setAccessible(true);
return (sun.misc.Unsafe) unsafeField.get(null);
});
public static int getInt(Object o, long offset) {
return theUnsafe.getInt(o, offset);
}
public static void putInt(Object o, long offset, int x) {
theUnsafe.putInt(o, offset, x);
}
public static <T> T getObject(Object o, long offset) {
return (T) theUnsafe.getObject(o, offset);
}
public static void putObject(Object o, long offset, Object x) {
theUnsafe.putObject(o, offset, x);
}
public static boolean getBoolean(Object o, long offset) {
return theUnsafe.getBoolean(o, offset);
}
public static void putBoolean(Object o, long offset, boolean x) {
theUnsafe.putBoolean(o, offset, x);
}
public static byte getByte(Object o, long offset) {
return theUnsafe.getByte(o, offset);
}
public static void putByte(Object o, long offset, byte x) {
theUnsafe.putByte(o, offset, x);
}
public static short getShort(Object o, long offset) {
return theUnsafe.getShort(o, offset);
}
public static void putShort(Object o, long offset, short x) {
theUnsafe.putShort(o, offset, x);
}
public static char getChar(Object o, long offset) {
return theUnsafe.getChar(o, offset);
}
public static void putChar(Object o, long offset, char x) {
theUnsafe.putChar(o, offset, x);
}
public static long getLong(Object o, long offset) {
return theUnsafe.getLong(o, offset);
}
public static void putLong(Object o, long offset, long x) {
theUnsafe.putLong(o, offset, x);
}
public static float getFloat(Object o, long offset) {
return theUnsafe.getFloat(o, offset);
}
public static void putFloat(Object o, long offset, float x) {
theUnsafe.putFloat(o, offset, x);
}
public static double getDouble(Object o, long offset) {
return theUnsafe.getDouble(o, offset);
}
public static void putDouble(Object o, long offset, double x) {
theUnsafe.putDouble(o, offset, x);
}
public static byte getByte(long address) {
return theUnsafe.getByte(address);
}
public static void putByte(long address, byte x) {
theUnsafe.putByte(address, x);
}
public static short getShort(long address) {
return theUnsafe.getShort(address);
}
public static void putShort(long address, short x) {
theUnsafe.putShort(address, x);
}
public static char getChar(long address) {
return theUnsafe.getChar(address);
}
public static void putChar(long address, char x) {
theUnsafe.putChar(address, x);
}
public static int getInt(long address) {
return theUnsafe.getInt(address);
}
public static void putInt(long address, int x) {
theUnsafe.putInt(address, x);
}
public static long getLong(long address) {
return theUnsafe.getLong(address);
}
public static void putLong(long address, long x) {
theUnsafe.putLong(address, x);
}
public static float getFloat(long address) {
return theUnsafe.getFloat(address);
}
public static void putFloat(long address, float x) {
theUnsafe.putFloat(address, x);
}
public static double getDouble(long address) {
return theUnsafe.getDouble(address);
}
public static void putDouble(long address, double x) {
theUnsafe.putDouble(address, x);
}
public static long getAddress(long address) {
return theUnsafe.getAddress(address);
}
public static void putAddress(long address, long x) {
theUnsafe.putAddress(address, x);
}
public static long allocateMemory(long bytes) {
return theUnsafe.allocateMemory(bytes);
}
public static long reallocateMemory(long address, long bytes) {
return theUnsafe.reallocateMemory(address, bytes);
}
public static void setMemory(Object o, long offset, long bytes, byte value) {
theUnsafe.setMemory(o, offset, bytes, value);
}
public static void setMemory(long address, long bytes, byte value) {
theUnsafe.setMemory(address, bytes, value);
}
public static void copyMemory(Object srcBase, long srcOffset, Object destBase, long destOffset, long bytes) {
theUnsafe.copyMemory(srcBase, srcOffset, destBase, destOffset, bytes);
}
public static void copyMemory(long srcAddress, long destAddress, long bytes) {
theUnsafe.copyMemory(srcAddress, destAddress, bytes);
}
public static void freeMemory(long address) {
theUnsafe.freeMemory(address);
}
public static int arrayBaseOffset(Class<?> arrayClass) {
return theUnsafe.arrayBaseOffset(arrayClass);
}
public static int arrayIndexScale(Class<?> arrayClass) {
return theUnsafe.arrayIndexScale(arrayClass);
}
public static int addressSize() {
return theUnsafe.addressSize();
}
public static int pageSize() {
return theUnsafe.pageSize();
}
public static <T> T allocateInstance(Class<T> cls) throws InstantiationException {
return (T) theUnsafe.allocateInstance(cls);
}
public static void throwException(Throwable ee) {
theUnsafe.throwException(ee);
}
public static boolean compareAndSwapObject(Object o, long offset, Object expected, Object x) {
return theUnsafe.compareAndSwapObject(o, offset, expected, x);
}
public static boolean compareAndSwapInt(Object o, long offset, int expected, int x) {
return theUnsafe.compareAndSwapInt(o, offset, expected, x);
}
public static boolean compareAndSwapLong(Object o, long offset, long expected, long x) {
return theUnsafe.compareAndSwapLong(o, offset, expected, x);
}
public static <T> T getObjectVolatile(Object o, long offset) {
return (T) theUnsafe.getObjectVolatile(o, offset);
}
public static void putObjectVolatile(Object o, long offset, Object x) {
theUnsafe.putObjectVolatile(o, offset, x);
}
public static int getIntVolatile(Object o, long offset) {
return theUnsafe.getIntVolatile(o, offset);
}
public static void putIntVolatile(Object o, long offset, int x) {
theUnsafe.putIntVolatile(o, offset, x);
}
public static boolean getBooleanVolatile(Object o, long offset) {
return theUnsafe.getBooleanVolatile(o, offset);
}
public static void putBooleanVolatile(Object o, long offset, boolean x) {
theUnsafe.putBooleanVolatile(o, offset, x);
}
public static byte getByteVolatile(Object o, long offset) {
return theUnsafe.getByteVolatile(o, offset);
}
public static void putByteVolatile(Object o, long offset, byte x) {
theUnsafe.putByteVolatile(o, offset, x);
}
public static short getShortVolatile(Object o, long offset) {
return theUnsafe.getShortVolatile(o, offset);
}
public static void putShortVolatile(Object o, long offset, short x) {
theUnsafe.putShortVolatile(o, offset, x);
}
public static char getCharVolatile(Object o, long offset) {
return theUnsafe.getCharVolatile(o, offset);
}
public static void putCharVolatile(Object o, long offset, char x) {
theUnsafe.putCharVolatile(o, offset, x);
}
public static long getLongVolatile(Object o, long offset) {
return theUnsafe.getLongVolatile(o, offset);
}
public static void putLongVolatile(Object o, long offset, long x) {
theUnsafe.putLongVolatile(o, offset, x);
}
public static float getFloatVolatile(Object o, long offset) {
return theUnsafe.getFloatVolatile(o, offset);
}
public static void putFloatVolatile(Object o, long offset, float x) {
theUnsafe.putFloatVolatile(o, offset, x);
}
public static double getDoubleVolatile(Object o, long offset) {
return theUnsafe.getDoubleVolatile(o, offset);
}
public static void putDoubleVolatile(Object o, long offset, double x) {
theUnsafe.putDoubleVolatile(o, offset, x);
}
public static void putOrderedObject(Object o, long offset, Object x) {
theUnsafe.putOrderedObject(o, offset, x);
}
public static void putOrderedInt(Object o, long offset, int x) {
theUnsafe.putOrderedInt(o, offset, x);
}
public static void putOrderedLong(Object o, long offset, long x) {
theUnsafe.putOrderedLong(o, offset, x);
}
public static void unpark(Object thread) {
theUnsafe.unpark(thread);
}
public static void park(boolean isAbsolute, long time) {
theUnsafe.park(isAbsolute, time);
}
public static int getLoadAverage(double[] loadavg, int nelems) {
return theUnsafe.getLoadAverage(loadavg, nelems);
}
public static int getAndAddInt(Object o, long offset, int delta) {
return theUnsafe.getAndAddInt(o, offset, delta);
}
public static long getAndAddLong(Object o, long offset, long delta) {
return theUnsafe.getAndAddLong(o, offset, delta);
}
public static int getAndSetInt(Object o, long offset, int newValue) {
return theUnsafe.getAndSetInt(o, offset, newValue);
}
public static long getAndSetLong(Object o, long offset, long newValue) {
return theUnsafe.getAndSetLong(o, offset, newValue);
}
public static <T> T getAndSetObject(Object o, long offset, T newValue) {
return (T) theUnsafe.getAndSetObject(o, offset, newValue);
}
public static void loadFence() {
theUnsafe.loadFence();
}
public static void storeFence() {
theUnsafe.storeFence();
}
public static void fullFence() {
theUnsafe.fullFence();
}
public static void invokeCleaner(ByteBuffer directBuffer) {
theUnsafe.invokeCleaner(directBuffer);
}
}