Skip to content

Commit c685f11

Browse files
committed
fix: fabric.mod.json
1 parent 31b0952 commit c685f11

9 files changed

Lines changed: 278 additions & 0 deletions

File tree

common/build.gradle

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
architectury {
2+
common rootProject.enabled_platforms.split(',')
3+
}
4+
5+
dependencies {
6+
// We depend on Fabric Loader here to use the Fabric @Environment annotations,
7+
// which get remapped to the correct annotations on each platform.
8+
// Do NOT use other classes from Fabric Loader.
9+
modImplementation "net.fabricmc:fabric-loader:$rootProject.fabric_loader_version"
10+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"required": true,
3+
"package": "pro.mikey.autoclicker.mixin",
4+
"compatibilityLevel": "JAVA_21",
5+
"minVersion": "0.8",
6+
"client": [
7+
],
8+
"mixins": [
9+
],
10+
"injectors": {
11+
"defaultRequire": 1
12+
}
13+
}

fabric/build.gradle

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
plugins {
2+
id 'com.github.johnrengelman.shadow'
3+
}
4+
5+
architectury {
6+
platformSetupLoomIde()
7+
fabric()
8+
}
9+
10+
configurations {
11+
common {
12+
canBeResolved = true
13+
canBeConsumed = false
14+
}
15+
compileClasspath.extendsFrom common
16+
runtimeClasspath.extendsFrom common
17+
developmentFabric.extendsFrom common
18+
19+
// Files in this configuration will be bundled into your mod using the Shadow plugin.
20+
// Don't use the `shadow` configuration from the plugin itself as it's meant for excluding files.
21+
shadowBundle {
22+
canBeResolved = true
23+
canBeConsumed = false
24+
}
25+
}
26+
27+
dependencies {
28+
modImplementation "net.fabricmc:fabric-loader:$rootProject.fabric_loader_version"
29+
30+
// Fabric API. This is technically optional, but you probably want it anyway.
31+
modImplementation "net.fabricmc.fabric-api:fabric-api:$rootProject.fabric_api_version"
32+
33+
modApi "com.terraformersmc:modmenu:${project.modmenu}"
34+
common(project(path: ':common', configuration: 'namedElements')) { transitive false }
35+
shadowBundle project(path: ':common', configuration: 'transformProductionFabric')
36+
}
37+
38+
processResources {
39+
inputs.property 'version', project.version
40+
41+
filesMatching('fabric.mod.json') {
42+
expand version: project.version
43+
}
44+
}
45+
46+
shadowJar {
47+
configurations = [project.configurations.shadowBundle]
48+
archiveClassifier = 'dev-shadow'
49+
}
50+
51+
remapJar {
52+
input.set shadowJar.archiveFile
53+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package pro.mikey.autoclicker.fabric.client;
2+
3+
import net.fabricmc.api.ClientModInitializer;
4+
import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientLifecycleEvents;
5+
import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents;
6+
import net.fabricmc.fabric.api.client.keybinding.v1.KeyBindingHelper;
7+
import net.fabricmc.fabric.api.client.rendering.v1.HudRenderCallback;
8+
import pro.mikey.autoclicker.AutoClicker;
9+
10+
public final class AutoClickerFabricClient implements ClientModInitializer {
11+
AutoClicker autoClicker = new AutoClicker();
12+
@Override
13+
public void onInitializeClient() {
14+
ClientTickEvents.END_CLIENT_TICK.register(autoClicker::clientTickEvent);
15+
16+
KeyBindingHelper.registerKeyBinding(AutoClicker.toggleHolding);
17+
KeyBindingHelper.registerKeyBinding(AutoClicker.openConfig);
18+
19+
ClientLifecycleEvents.CLIENT_STARTED.register(autoClicker::clientReady);
20+
HudRenderCallback.EVENT.register(autoClicker::RenderGameOverlayEvent);
21+
}
22+
}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{
2+
"schemaVersion": 1,
3+
"id": "autoclicker",
4+
"version": "${version}",
5+
"name": "Auto Clicker",
6+
"description": "Automatically left and right clicks for you, how kind!",
7+
"authors": [
8+
"ErrorMikey",
9+
"Advanced XRay team"
10+
],
11+
"contact": {
12+
"homepage": "https://mikey.pro/",
13+
"sources": "https://github.com/michaelhillcox/auto-clicker-fabric",
14+
"issues": "https://github.com/michaelhillcox/auto-clicker-fabric/issues"
15+
},
16+
"license": "MIT",
17+
"icon": "assets/autoclicker-fabric/icon.png",
18+
"environment": "client",
19+
"entrypoints": {
20+
"client": [
21+
"pro.mikey.autoclicker.fabric.client.AutoClickerFabricClient"
22+
],
23+
"modmenu" : ["pro.mikey.autoclicker.fabric.client.ModMenuAPIImpl"]
24+
},
25+
"depends": {
26+
"fabricloader": ">=0.16.0",
27+
"fabric": "*",
28+
"minecraft": ">=1.21",
29+
"java": ">=21"
30+
}
31+
}

neoforge/build.gradle

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
plugins {
2+
id 'com.github.johnrengelman.shadow'
3+
}
4+
5+
architectury {
6+
platformSetupLoomIde()
7+
neoForge()
8+
}
9+
10+
configurations {
11+
common {
12+
canBeResolved = true
13+
canBeConsumed = false
14+
}
15+
compileClasspath.extendsFrom common
16+
runtimeClasspath.extendsFrom common
17+
developmentNeoForge.extendsFrom common
18+
19+
// Files in this configuration will be bundled into your mod using the Shadow plugin.
20+
// Don't use the `shadow` configuration from the plugin itself as it's meant for excluding files.
21+
shadowBundle {
22+
canBeResolved = true
23+
canBeConsumed = false
24+
}
25+
}
26+
27+
repositories {
28+
maven {
29+
name = 'NeoForged'
30+
url = 'https://maven.neoforged.net/releases'
31+
}
32+
}
33+
34+
dependencies {
35+
neoForge "net.neoforged:neoforge:$rootProject.neoforge_version"
36+
37+
common(project(path: ':common', configuration: 'namedElements')) { transitive false }
38+
shadowBundle project(path: ':common', configuration: 'transformProductionNeoForge')
39+
}
40+
41+
processResources {
42+
inputs.property 'version', project.version
43+
44+
filesMatching('META-INF/neoforge.mods.toml') {
45+
expand version: project.version
46+
}
47+
}
48+
49+
shadowJar {
50+
configurations = [project.configurations.shadowBundle]
51+
archiveClassifier = 'dev-shadow'
52+
}
53+
54+
remapJar {
55+
input.set shadowJar.archiveFile
56+
}

neoforge/gradle.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
loom.platform = neoforge
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
package pro.mikey.autoclicker.neoforge;
2+
3+
import net.minecraft.client.MinecraftClient;
4+
import net.minecraft.client.gui.screen.Screen;
5+
import net.neoforged.api.distmarker.Dist;
6+
import net.neoforged.bus.api.SubscribeEvent;
7+
import net.neoforged.fml.ModContainer;
8+
import net.neoforged.fml.ModLoadingContext;
9+
import net.neoforged.fml.common.EventBusSubscriber;
10+
import net.neoforged.fml.common.Mod;
11+
12+
import net.neoforged.fml.event.lifecycle.FMLConstructModEvent;
13+
import net.neoforged.fml.event.lifecycle.FMLLoadCompleteEvent;
14+
import net.neoforged.neoforge.client.event.ClientTickEvent;
15+
import net.neoforged.neoforge.client.event.RegisterKeyMappingsEvent;
16+
import net.neoforged.neoforge.client.event.RenderGuiEvent;
17+
import net.neoforged.neoforge.client.gui.IConfigScreenFactory;
18+
import net.neoforged.neoforge.common.NeoForge;
19+
import org.jetbrains.annotations.NotNull;
20+
import pro.mikey.autoclicker.AutoClicker;
21+
import pro.mikey.autoclicker.OptionsScreen;
22+
23+
@Mod(AutoClicker.MOD_ID)
24+
@EventBusSubscriber(value = Dist.CLIENT, modid = AutoClicker.MOD_ID, bus = EventBusSubscriber.Bus.MOD)
25+
public final class AutoClickerNeoForge {
26+
private static final AutoClicker autoClicker = new AutoClicker();
27+
public AutoClickerNeoForge() {
28+
autoClicker.onInitialize();
29+
NeoForge.EVENT_BUS.addListener(this::onClientTick);
30+
NeoForge.EVENT_BUS.addListener(this::onHudRender);
31+
}
32+
33+
@SubscribeEvent
34+
public static void onClientStarted(FMLLoadCompleteEvent event){
35+
autoClicker.clientReady(MinecraftClient.getInstance());
36+
}
37+
38+
@SubscribeEvent
39+
public static void registerBindings(RegisterKeyMappingsEvent event){
40+
event.register(AutoClicker.toggleHolding);
41+
event.register(AutoClicker.openConfig);
42+
}
43+
44+
public void onClientTick(ClientTickEvent.Post event){
45+
autoClicker.clientTickEvent(MinecraftClient.getInstance());
46+
}
47+
48+
public void onHudRender(RenderGuiEvent.Pre event){
49+
autoClicker.RenderGameOverlayEvent(event.getGuiGraphics(), event.getPartialTick());
50+
}
51+
52+
@SubscribeEvent
53+
public static void constructMod(FMLConstructModEvent event){
54+
ModLoadingContext.get().registerExtensionPoint(IConfigScreenFactory.class, () -> new IConfigScreenFactory() {
55+
@Override
56+
public @NotNull Screen createScreen(@NotNull ModContainer arg, @NotNull Screen arg2) {
57+
return (autoClicker.getConfigScreen());
58+
}
59+
});
60+
}
61+
}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
modLoader = "javafml"
2+
loaderVersion = "[4,)"
3+
#issueTrackerURL = ""
4+
license = "Insert License Here"
5+
6+
[[mods]]
7+
modId = "autoclicker"
8+
version = "${version}"
9+
displayName = "Auto Clicker"
10+
authors = "Me!"
11+
description = '''
12+
This is an example description! Tell everyone what your mod is about!
13+
'''
14+
#logoFile = ""
15+
16+
[[dependencies.autoclicker]]
17+
modId = "neoforge"
18+
type = "required"
19+
versionRange = "[21.0,)"
20+
ordering = "NONE"
21+
side = "BOTH"
22+
23+
[[dependencies.autoclicker]]
24+
modId = "minecraft"
25+
type = "required"
26+
versionRange = "[1.21,)"
27+
ordering = "NONE"
28+
side = "BOTH"
29+
30+
[[mixins]]
31+
config = "autoclicker.mixins.json"

0 commit comments

Comments
 (0)