ModMenu + configs
This commit is contained in:
parent
a82126762c
commit
079a01cc7c
|
@ -21,6 +21,14 @@ dependencies {
|
|||
|
||||
// PSA: Some older mods, compiled on Loom 0.2.1, might have outdated Maven POMs.
|
||||
// You may need to force-disable transitiveness on them.
|
||||
modApi "me.sargunvohra.mcmods:autoconfig1u:3.2.0-unstable"
|
||||
include "me.sargunvohra.mcmods:autoconfig1u:3.2.0-unstable"
|
||||
modApi "me.shedaniel.cloth:config-2:4.6.0"
|
||||
include "me.shedaniel.cloth:config-2:4.6.0"
|
||||
|
||||
|
||||
modImplementation "io.github.prospector:modmenu:1.14.5+build.30"
|
||||
|
||||
}
|
||||
|
||||
processResources {
|
||||
|
|
|
@ -0,0 +1,20 @@
|
|||
package io.gitlab.jfronny.quickmeth;
|
||||
|
||||
|
||||
import me.sargunvohra.mcmods.autoconfig1u.ConfigData;
|
||||
import me.sargunvohra.mcmods.autoconfig1u.annotation.Config;
|
||||
import me.sargunvohra.mcmods.autoconfig1u.annotation.ConfigEntry.Gui.RequiresRestart;
|
||||
import me.sargunvohra.mcmods.autoconfig1u.shadowed.blue.endless.jankson.Comment;
|
||||
|
||||
@Config(name = "quickmeth")
|
||||
public class Cfg implements ConfigData {
|
||||
@Comment("Corrupts methods in MathHelper. This will impact many things but most notably movement")
|
||||
@RequiresRestart
|
||||
public boolean corruptGenericMath = true;
|
||||
@Comment("Corrupts methods in OctavePerlinNoiseSampler and PerlinNoiseSampler. This will mostly impact world generation")
|
||||
@RequiresRestart
|
||||
public boolean corruptPerlinNoise = true;
|
||||
@Comment("Corrupts methods in SimplexNoiseSampler. I am actually not sure what this breaks")
|
||||
@RequiresRestart
|
||||
public boolean corruptSimplexNoise = true;
|
||||
}
|
|
@ -0,0 +1,61 @@
|
|||
package io.gitlab.jfronny.quickmeth;
|
||||
|
||||
import io.gitlab.jfronny.quickmeth.mixin.MathHelperMixin;
|
||||
import io.gitlab.jfronny.quickmeth.mixin.MixinOctavePerlinNoiseSampler;
|
||||
import io.gitlab.jfronny.quickmeth.mixin.MixinPerlinNoiseSampler;
|
||||
import io.gitlab.jfronny.quickmeth.mixin.MixinSimplexNoiseSampler;
|
||||
import org.objectweb.asm.tree.ClassNode;
|
||||
import org.spongepowered.asm.mixin.extensibility.IMixinConfigPlugin;
|
||||
import org.spongepowered.asm.mixin.extensibility.IMixinInfo;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
|
||||
public class MixinPlugin implements IMixinConfigPlugin {
|
||||
@Override
|
||||
public void onLoad(String mixinPackage) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRefMapperConfig() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@SuppressWarnings("ReferenceToMixin")
|
||||
@Override
|
||||
public boolean shouldApplyMixin(String targetClassName, String mixinClassName) {
|
||||
if (Objects.equals(mixinClassName, MathHelperMixin.class.getName()))
|
||||
return quickmeth.cfg.corruptGenericMath;
|
||||
else if (Objects.equals(mixinClassName, MixinOctavePerlinNoiseSampler.class.getName()))
|
||||
return quickmeth.cfg.corruptPerlinNoise;
|
||||
else if (Objects.equals(mixinClassName, MixinPerlinNoiseSampler.class.getName()))
|
||||
return quickmeth.cfg.corruptPerlinNoise;
|
||||
else if (Objects.equals(mixinClassName, MixinSimplexNoiseSampler.class.getName()))
|
||||
return quickmeth.cfg.corruptSimplexNoise;
|
||||
else
|
||||
throw new IllegalStateException("Unrecognized mixin! This should never happen");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void acceptTargets(Set<String> myTargets, Set<String> otherTargets) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getMixins() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preApply(String targetClassName, ClassNode targetClass, String mixinClassName, IMixinInfo mixinInfo) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postApply(String targetClassName, ClassNode targetClass, String mixinClassName, IMixinInfo mixinInfo) {
|
||||
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
package io.gitlab.jfronny.quickmeth;
|
||||
|
||||
import io.github.prospector.modmenu.api.ConfigScreenFactory;
|
||||
import io.github.prospector.modmenu.api.ModMenuApi;
|
||||
import me.sargunvohra.mcmods.autoconfig1u.AutoConfig;
|
||||
|
||||
public class ModMenu implements ModMenuApi {
|
||||
@Override
|
||||
public ConfigScreenFactory<?> getModConfigScreenFactory() {
|
||||
return screen -> AutoConfig.getConfigScreen(Cfg.class, screen).get();
|
||||
}
|
||||
}
|
|
@ -1,9 +1,17 @@
|
|||
package io.gitlab.jfronny.quickmeth;
|
||||
|
||||
import me.sargunvohra.mcmods.autoconfig1u.AutoConfig;
|
||||
import me.sargunvohra.mcmods.autoconfig1u.serializer.JanksonConfigSerializer;
|
||||
import net.fabricmc.api.ModInitializer;
|
||||
import net.minecraft.util.math.MathHelper;
|
||||
|
||||
public class quickmeth implements ModInitializer {
|
||||
public static Cfg cfg;
|
||||
static {
|
||||
AutoConfig.register(Cfg.class, JanksonConfigSerializer::new);
|
||||
cfg = AutoConfig.getConfigHolder(Cfg.class).getConfig();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onInitialize() {
|
||||
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 1.2 KiB |
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"text.autoconfig.quickmeth.title": "QuickMäth",
|
||||
"text.autoconfig.quickmeth.option.corruptGenericMath": "Corrupt generic math",
|
||||
"text.autoconfig.quickmeth.option.corruptPerlinNoise": "Corrupt perlin noise",
|
||||
"text.autoconfig.quickmeth.option.corruptSimplexNoise": "Corrupt simplex noise"
|
||||
}
|
|
@ -17,10 +17,14 @@
|
|||
"entrypoints": {
|
||||
"main": [
|
||||
"io.gitlab.jfronny.quickmeth.quickmeth"
|
||||
],
|
||||
"modmenu": [
|
||||
"io.gitlab.jfronny.quickmeth.ModMenu"
|
||||
]
|
||||
|
||||
},
|
||||
"mixins": [
|
||||
"io.gitlab.jfronny.quickmeth.mixins.json"
|
||||
"quickmeth.mixins.json"
|
||||
],
|
||||
"depends": {
|
||||
"fabricloader": ">=0.9.0+build.204",
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
"minVersion": "0.8",
|
||||
"package": "io.gitlab.jfronny.quickmeth.mixin",
|
||||
"compatibilityLevel": "JAVA_8",
|
||||
"plugin": "io.gitlab.jfronny.quickmeth.MixinPlugin",
|
||||
"mixins": [
|
||||
"MathHelperMixin",
|
||||
"MixinOctavePerlinNoiseSampler",
|
Loading…
Reference in New Issue