mirror of
https://github.com/darksaid98/draggable_lists.git
synced 2026-12-03 06:28:46 +00:00
First commit and add config options
This commit is contained in:
45 files changed
+1533
No files matched your search
@@ -0,0 +1,33 @@
|
||||
architectury {
|
||||
common(rootProject.enabled_platforms.split(","))
|
||||
}
|
||||
|
||||
loom {
|
||||
accessWidenerPath = file("src/main/resources/draggable.accesswidener")
|
||||
}
|
||||
|
||||
dependencies {
|
||||
// We depend on fabric loader here to use the fabric @Environment annotations and get the mixin dependencies
|
||||
// Do NOT use other classes from fabric loader
|
||||
modImplementation "net.fabricmc:fabric-loader:${rootProject.fabric_loader_version}"
|
||||
// Remove the next line if you don't want to depend on the API
|
||||
modApi "dev.architectury:architectury:${rootProject.architectury_version}"
|
||||
|
||||
modApi("me.shedaniel.cloth:cloth-config-fabric:${rootProject.cloth_config_version}") {
|
||||
exclude(group: "net.fabricmc.fabric-api")
|
||||
}
|
||||
}
|
||||
|
||||
publishing {
|
||||
publications {
|
||||
mavenCommon(MavenPublication) {
|
||||
artifactId = rootProject.archives_base_name
|
||||
from components.java
|
||||
}
|
||||
}
|
||||
|
||||
// See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing.
|
||||
repositories {
|
||||
// Add repositories to publish to here.
|
||||
}
|
||||
}
|
||||
@@ -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 |
Reference in new issue
Block a user