Update for 1.19.1
This commit is contained in:
parent
059b13881e
commit
25b49918e3
|
@ -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") {
|
||||
|
|
|
@ -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
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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");
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue