Update for 1.19
This commit is contained in:
parent
0b3323fb9c
commit
5ed982b453
|
@ -22,7 +22,7 @@ build_test:
|
|||
image: gradle:jdk17
|
||||
stage: deploy
|
||||
script:
|
||||
- gradle --build-cache build publish -Pmaven="$CI_API_V4_URL/projects/$CI_PROJECT_ID/packages/maven"
|
||||
- gradle --build-cache deployDebug -Pmaven="$CI_API_V4_URL/projects/$CI_PROJECT_ID/packages/maven"
|
||||
- mv build/libs/* ./
|
||||
- mv build/devlibs/*-dev.jar ./
|
||||
- rm *-maven.jar *-sources.jar
|
||||
|
@ -52,7 +52,7 @@ deploy:
|
|||
- if: $CI_COMMIT_TAG && '$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME =~ /^master/'
|
||||
stage: deploy
|
||||
script:
|
||||
- gradle --build-cache build publish modrinth -Prelease -Pmaven="$CI_API_V4_URL/projects/$CI_PROJECT_ID/packages/maven"
|
||||
- gradle --build-cache build publish modrinth modrinthSyncBody -Prelease -Pmaven="$CI_API_V4_URL/projects/$CI_PROJECT_ID/packages/maven"
|
||||
- rm build/libs/*
|
||||
- rm build/devlibs/*
|
||||
- gradle --build-cache -Pflavor=curseforge build curseforge -Prelease
|
||||
|
|
2
LICENSE
2
LICENSE
|
@ -1,6 +1,6 @@
|
|||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2020 JFronny
|
||||
Copyright (c) 2022 JFronny
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
|
|
@ -9,10 +9,10 @@ repositories {
|
|||
dependencies {
|
||||
modRuntimeOnly "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
|
||||
|
||||
modApi("me.shedaniel.cloth:cloth-config-fabric:6.2.57") {
|
||||
modApi("me.shedaniel.cloth:cloth-config-fabric:7.0.65") {
|
||||
exclude(group: "net.fabricmc.fabric-api")
|
||||
}
|
||||
modImplementation "com.terraformersmc:modmenu:3.1.0"
|
||||
modImplementation "com.terraformersmc:modmenu:4.0.0-beta.4"
|
||||
}
|
||||
|
||||
if (flavor == "curseforge") {
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
# https://fabricmc.net/develop/
|
||||
minecraft_version=1.18.2
|
||||
minecraft_version=1.19
|
||||
yarn_mappings=build.1
|
||||
loader_version=0.13.3
|
||||
loader_version=0.14.6
|
||||
maven_group=io.gitlab.jfronny
|
||||
archives_base_name=breakme
|
||||
|
||||
fabric_version=0.47.8+1.18.2
|
||||
fabric_version=0.55.1+1.19
|
||||
|
||||
modrinth_id=ibgLmpmd
|
||||
modrinth_optional_dependencies=mOgUt4GM
|
||||
|
|
|
@ -8,7 +8,7 @@ import me.shedaniel.autoconfig.gui.registry.api.GuiRegistryAccess;
|
|||
import me.shedaniel.clothconfig2.api.AbstractConfigListEntry;
|
||||
import me.shedaniel.clothconfig2.api.ConfigEntryBuilder;
|
||||
import net.fabricmc.api.ClientModInitializer;
|
||||
import net.minecraft.text.TranslatableText;
|
||||
import net.minecraft.text.*;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.Collections;
|
||||
|
@ -29,7 +29,7 @@ public class BreakMeClient implements ClientModInitializer {
|
|||
private List<AbstractConfigListEntry> get(String i13n, Field field, Object config, Object defaults, GuiRegistryAccess guiProvider) {
|
||||
return Collections.singletonList(
|
||||
builder.startSelector(
|
||||
new TranslatableText(i13n),
|
||||
Text.translatable(i13n),
|
||||
BreakMe.getProviders(),
|
||||
getUnsafely(field, config, getUnsafely(field, defaults))
|
||||
).setDefaultValue(() -> "None")
|
||||
|
|
|
@ -12,25 +12,25 @@ import java.util.NoSuchElementException;
|
|||
|
||||
public class ClassFinder {
|
||||
public static List<Class<?>> find(String packageName) throws NoSuchElementException, IOException {
|
||||
String path = packageName.replace('.', '/');
|
||||
ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
|
||||
Path p = FabricLoader.getInstance()
|
||||
.getModContainer(BreakMe.MOD_ID)
|
||||
.orElseThrow(FileNotFoundException::new)
|
||||
.findPath(path)
|
||||
.orElseThrow(FileNotFoundException::new);
|
||||
return findInternal(p, classLoader);
|
||||
.findPath(".")
|
||||
.orElseThrow(FileNotFoundException::new)
|
||||
.toAbsolutePath();
|
||||
return findInternal(p, p.resolve(packageName.replace('.', '/')), classLoader);
|
||||
}
|
||||
|
||||
private static List<Class<?>> findInternal(Path path, ClassLoader classLoader) throws IOException {
|
||||
private static List<Class<?>> findInternal(Path rootPath, Path path, ClassLoader classLoader) throws IOException {
|
||||
List<Class<?>> result = new ArrayList<>();
|
||||
Files.list(path).forEach(s -> {
|
||||
try {
|
||||
if (Files.isDirectory(s)) {
|
||||
result.addAll(findInternal(s, classLoader));
|
||||
result.addAll(findInternal(rootPath, s, classLoader));
|
||||
} else if (s.getFileName().toString().endsWith(".class")) {
|
||||
String p = s.toString().replace('/', '.');
|
||||
result.add(classLoader.loadClass(p.substring(1, p.length() - 6)));
|
||||
String p = rootPath.relativize(s).toString().replace('/', '.');
|
||||
result.add(classLoader.loadClass(p.substring(0, p.length() - ".class".length())));
|
||||
}
|
||||
} catch (Throwable e) {
|
||||
BreakMe.LOGGER.error("Could not scan classpath for crash method", e);
|
||||
|
|
Loading…
Reference in New Issue