First commit and add config options

This commit is contained in:
MrMelon54 committed 2023-06-14 00:49:07 +01:00
commit 63415c3e4b
45 files changed
+1533

No files matched your search

@@ -0,0 +1,27 @@
package com.mrmelon54.Draggable;
import com.mrmelon54.Draggable.config.ConfigStructure;
import me.shedaniel.autoconfig.AutoConfig;
import me.shedaniel.autoconfig.serializer.JanksonConfigSerializer;
import net.minecraft.client.gui.screens.Screen;
import java.util.List;
import java.util.function.Supplier;
public class Draggable {
public static final String MOD_ID = "draggable";
private static ConfigStructure config;
public static ConfigStructure getConfig() {
return config;
}
public static void init() {
AutoConfig.register(ConfigStructure.class, JanksonConfigSerializer::new);
config = AutoConfig.getConfigHolder(ConfigStructure.class).getConfig();
}
public static Supplier<Screen> createConfigScreen(Screen screen) {
return AutoConfig.getConfigScreen(ConfigStructure.class, screen);
}
}
@@ -0,0 +1,27 @@
package com.mrmelon54.Draggable;
import dev.architectury.injectables.annotations.ExpectPlatform;
import dev.architectury.platform.Platform;
import java.nio.file.Path;
public class ExampleExpectPlatform {
/**
* We can use {@link Platform#getConfigFolder()} but this is just an example of {@link ExpectPlatform}.
* <p>
* This must be a <b>public static</b> method. The platform-implemented solution must be placed under a
* platform sub-package, with its class suffixed with {@code Impl}.
* <p>
* Example:
* Expect: net.examplemod.ExampleExpectPlatform#getConfigDirectory()
* Actual Fabric: net.examplemod.fabric.ExampleExpectPlatformImpl#getConfigDirectory()
* Actual Forge: net.examplemod.forge.ExampleExpectPlatformImpl#getConfigDirectory()
* <p>
* <a href="https://plugins.jetbrains.com/plugin/16210-architectury">You should also get the IntelliJ plugin to help with @ExpectPlatform.</a>
*/
@ExpectPlatform
public static Path getConfigDirectory() {
// Just throw an error, the content should get replaced at runtime.
throw new AssertionError();
}
}
@@ -0,0 +1,11 @@
package com.mrmelon54.Draggable.config;
import me.shedaniel.autoconfig.ConfigData;
import me.shedaniel.autoconfig.annotation.Config;
@Config(name = "draggable-resource-packs")
@Config.Gui.Background("minecraft:textures/block/brain_coral_block.png")
public class ConfigStructure implements ConfigData {
public boolean disableResourcePackArrows = true;
public boolean disableServerArrows = true;
}
@@ -0,0 +1,15 @@
package com.mrmelon54.Draggable.mixin;
import net.minecraft.client.gui.screens.TitleScreen;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
@Mixin(TitleScreen.class)
public class MixinTitleScreen {
@Inject(at = @At("HEAD"), method = "init()V")
private void init(CallbackInfo info) {
System.out.println("Hello from example architectury common mixin!");
}
}
@@ -0,0 +1,3 @@
{
"accessWidener": "draggable.accesswidener"
}
@@ -0,0 +1,7 @@
{
"text.autoconfig.draggable.title": "Draggable",
"text.autoconfig.draggable.option.disableResourcePackArrows": "Disable Resource Pack Arrows",
"text.autoconfig.draggable.option.disableDatapackArrows": "Disable Datapack Arrows",
"text.autoconfig.draggable.option.disableServerArrows": "Disable Server Arrows",
"text.autoconfig.draggable.option.disableLevelArrows": "Disable Level Arrows"
}
@@ -0,0 +1,14 @@
{
"required": true,
"package": "com.mrmelon54.Draggable.mixin",
"compatibilityLevel": "JAVA_17",
"minVersion": "0.8",
"client": [
"MixinTitleScreen"
],
"mixins": [
],
"injectors": {
"defaultRequire": 1
}
}
@@ -0,0 +1 @@
accessWidener v2 named
Binary file not shown.

After

Width:  |  Height:  |  Size: 7.0 KiB