Update for 1.19.1

This commit is contained in:
Johannes Frohnmeyer 2022-07-28 15:30:07 +02:00
parent 059b13881e
commit 25b49918e3
Signed by: Johannes
GPG Key ID: E76429612C2929F4
5 changed files with 21 additions and 22 deletions

View File

@ -9,10 +9,10 @@ repositories {
dependencies {
modRuntimeOnly "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
modApi("me.shedaniel.cloth:cloth-config-fabric:7.0.65") {
modApi("me.shedaniel.cloth:cloth-config-fabric:7.0.73") {
exclude(group: "net.fabricmc.fabric-api")
}
modImplementation "com.terraformersmc:modmenu:4.0.0-beta.4"
modImplementation "com.terraformersmc:modmenu:4.0.5"
}
if (flavor == "curseforge") {

View File

@ -1,13 +1,13 @@
# https://fabricmc.net/develop/
minecraft_version=1.19
minecraft_version=1.19.1
yarn_mappings=build.1
loader_version=0.14.6
loader_version=0.14.8
maven_group=io.gitlab.jfronny
archives_base_name=breakme
fabric_version=0.55.1+1.19
fabric_version=0.58.5+1.19.1
modrinth_id=ibgLmpmd
modrinth_optional_dependencies=mOgUt4GM
modrinth_id=breakme
modrinth_optional_dependencies=modmenu, cloth-config
curseforge_id=400842
curseforge_optional_dependencies=modmenu, cloth-config

View File

@ -9,6 +9,7 @@ import java.nio.file.Path;
import java.util.ArrayList;
import java.util.List;
import java.util.NoSuchElementException;
import java.util.stream.Stream;
public class ClassFinder {
public static List<Class<?>> find(String packageName) throws NoSuchElementException, IOException {
@ -24,18 +25,20 @@ public class ClassFinder {
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(rootPath, s, classLoader));
} else if (s.getFileName().toString().endsWith(".class")) {
String p = rootPath.relativize(s).toString().replace('/', '.');
result.add(classLoader.loadClass(p.substring(0, p.length() - ".class".length())));
try (Stream<Path> files = Files.list(path)) {
files.forEach(s -> {
try {
if (Files.isDirectory(s)) {
result.addAll(findInternal(rootPath, s, classLoader));
} else if (s.getFileName().toString().endsWith(".class")) {
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);
}
} catch (Throwable e) {
BreakMe.LOGGER.error("Could not scan classpath for crash method", e);
}
});
});
}
return result;
}
}

View File

@ -1,14 +1,10 @@
package io.gitlab.jfronny.breakme.crash.safe;
import io.gitlab.jfronny.breakme.crash.CrashProvider;
import net.minecraft.client.MinecraftClient;
import net.minecraft.server.dedicated.command.StopCommand;
public class ExceptionProvider implements CrashProvider {
@Override
public void crash() throws Exception {
MinecraftClient.getInstance().stop();
StopCommand.register(null);
throw new Exception("You did bad, now die");
}