fixes
This commit is contained in:
@@ -1,15 +1,15 @@
|
|||||||
|
|
||||||
public static List<string> FindAllFiles(string directoryPath)
|
public static List<string> FindAllFiles(string directoryPath)
|
||||||
{
|
{
|
||||||
return Directory.GetFiles(directoryPath, "*.*", SearchOption.AllDirectories).ToList();
|
return Directory.GetFiles(directoryPath, "*.*", SearchOption.AllDirectories)
|
||||||
|
.Select(file => Path.GetRelativePath(directoryPath, file))
|
||||||
|
.ToList();
|
||||||
}
|
}
|
||||||
|
|
||||||
var replacements = new[]
|
var replacements = new[]
|
||||||
{
|
{
|
||||||
new { Old = "com.example", New = "io.github.cooldev" },
|
//ORDER MATTERS
|
||||||
new { Old = "template", New = "coolmod" },
|
new { Old = "JavaJumper", New = "CoolDev" } //change mod init class and other places where mod name is in PascalCase
|
||||||
new { Old = "Template", New = "Cool Mod" },
|
|
||||||
new { Old = "TempLate", New = "CoolMod" }
|
|
||||||
};
|
};
|
||||||
|
|
||||||
var files = FindAllFiles(Directory.GetCurrentDirectory());
|
var files = FindAllFiles(Directory.GetCurrentDirectory());
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ org.gradle.parallel=false
|
|||||||
mod.version=2.0.0
|
mod.version=2.0.0
|
||||||
mod.group=io.github.jumperonjava
|
mod.group=io.github.jumperonjava
|
||||||
mod.id=template
|
mod.id=template
|
||||||
mod.name=Custom cursor
|
mod.name=Template
|
||||||
|
|
||||||
# Used for the mod metadata
|
# Used for the mod metadata
|
||||||
mod.mc_dep_fabric=[VERSIONED]
|
mod.mc_dep_fabric=[VERSIONED]
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ stonecutter {
|
|||||||
fun mc(loader: String, vararg versions: String) {
|
fun mc(loader: String, vararg versions: String) {
|
||||||
for (version in versions) vers("$version-$loader", version)
|
for (version in versions) vers("$version-$loader", version)
|
||||||
}
|
}
|
||||||
//i would recommend to use neoforge for mc >= 1.20.1
|
//i would recommend to use neoforge for mc > 1.20.1, i haven't tested template for forge on versions higher than that
|
||||||
mc("fabric","1.20.1","1.20.4", "1.21.1", "1.21.3", "1.21.4")
|
mc("fabric","1.20.1","1.20.4", "1.21.1", "1.21.3", "1.21.4")
|
||||||
mc("forge","1.20.1")
|
mc("forge","1.20.1")
|
||||||
//WARNING: neoforge uses mods.toml instead of neoforge.mods.toml for versions 1.20.4 (?) and earlier
|
//WARNING: neoforge uses mods.toml instead of neoforge.mods.toml for versions 1.20.4 (?) and earlier
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.example.template;
|
package com.example.template;
|
||||||
|
|
||||||
|
import net.minecraft.client.gui.DrawContext;
|
||||||
import net.minecraft.client.gui.screen.Screen;
|
import net.minecraft.client.gui.screen.Screen;
|
||||||
import net.minecraft.text.Text;
|
import net.minecraft.text.Text;
|
||||||
|
|
||||||
@@ -10,17 +11,16 @@ public class ConfigScreen extends Screen {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void init() {
|
public void render(DrawContext context, int mouseX, int mouseY, float delta) {
|
||||||
addDrawableChild(((context, mouseX, mouseY, delta) -> {
|
super.render(context, mouseX, mouseY, delta);
|
||||||
context.drawCenteredTextWithShadow(client.textRenderer,
|
context.drawCenteredTextWithShadow(client.textRenderer,
|
||||||
"Hello, world",
|
"Hello, world",
|
||||||
width / 2,
|
width / 2,
|
||||||
height / 2,
|
height / 2,
|
||||||
0xFFFFFFFF);
|
0xFFFFFFFF);
|
||||||
}));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ConfigScreen createCursorEditScreen(Screen parent) {
|
public static ConfigScreen createConfigScreen(Screen parent) {
|
||||||
return new ConfigScreen(parent);
|
return new ConfigScreen(parent);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,10 +7,10 @@ public class TempLateInit
|
|||||||
{
|
{
|
||||||
public static final String MODID = "template";
|
public static final String MODID = "template";
|
||||||
public static final Logger LOGGER = LoggerFactory.getLogger("Template");
|
public static final Logger LOGGER = LoggerFactory.getLogger("Template");
|
||||||
private static ModPlatform PLATFORM = null;
|
public static ModPlatform PLATFORM = null;
|
||||||
|
|
||||||
public static void entrypoint(ModPlatform platform) {
|
public static void entrypoint(ModPlatform platform) {
|
||||||
TempLateInit.PLATFORM = platform;
|
TempLateInit.PLATFORM = platform;
|
||||||
LOGGER.info("Started mod in %s loader", TempLateInit.PLATFORM.getModloader());
|
LOGGER.info("Started mod in %s loader".formatted(TempLateInit.PLATFORM.getModloader()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -12,7 +12,7 @@ public class ExampleMixin {
|
|||||||
|
|
||||||
@Inject(method = "init",at=@At("HEAD"))
|
@Inject(method = "init",at=@At("HEAD"))
|
||||||
void init(CallbackInfo ci){
|
void init(CallbackInfo ci){
|
||||||
TempLateInit.LOGGER.info("Stonecutter example mixin init");
|
TempLateInit.LOGGER.info("Stonecutter example mixin init in %s".formatted(TempLateInit.PLATFORM.getModloader()));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
//? if fabric {
|
//? if fabric {
|
||||||
/*package com.example.platforms.fabric;
|
package com.example.template.platforms.fabric;
|
||||||
|
|
||||||
import com.terraformersmc.modmenu.api.ConfigScreenFactory;
|
import com.terraformersmc.modmenu.api.ConfigScreenFactory;
|
||||||
import com.terraformersmc.modmenu.api.ModMenuApi;
|
import com.terraformersmc.modmenu.api.ModMenuApi;
|
||||||
@@ -7,7 +7,7 @@ import com.example.template.ConfigScreen;
|
|||||||
|
|
||||||
public class ModMenuIntegration implements ModMenuApi {
|
public class ModMenuIntegration implements ModMenuApi {
|
||||||
public ConfigScreenFactory<?> getModConfigScreenFactory() {
|
public ConfigScreenFactory<?> getModConfigScreenFactory() {
|
||||||
return ConfigScreen::createCursorEditScreen;
|
return ConfigScreen::createConfigScreen;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
*///?}
|
//?}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
//? if fabric {
|
//? if fabric {
|
||||||
/*package com.example.platforms.fabric;
|
package com.example.template.platforms.fabric;
|
||||||
|
|
||||||
import com.example.template.ModPlatform;
|
import com.example.template.ModPlatform;
|
||||||
import net.fabricmc.api.ModInitializer;
|
import net.fabricmc.api.ModInitializer;
|
||||||
@@ -24,4 +24,4 @@ public class TempLateFabric implements ModInitializer {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
*///?}
|
//?}
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
//? if forge {
|
//? if forge {
|
||||||
/*package com.example.platforms.forge;
|
/*package com.example.template.platforms.forge;
|
||||||
|
|
||||||
import com.example.template.ConfigScreen;
|
import com.example.template.ConfigScreen;
|
||||||
import com.example.template.TempLateInit;
|
import com.example.template.TempLateInit;
|
||||||
@@ -12,7 +12,7 @@ import net.minecraftforge.fml.common.Mod;
|
|||||||
public class TempLateForge {
|
public class TempLateForge {
|
||||||
public TempLateForge() {
|
public TempLateForge() {
|
||||||
TempLateInit.entrypoint(new ForgePlatform());
|
TempLateInit.entrypoint(new ForgePlatform());
|
||||||
MinecraftForge.registerConfigScreen(ConfigScreen::createCursorEditScreen);
|
MinecraftForge.registerConfigScreen(ConfigScreen::createConfigScreen);
|
||||||
}
|
}
|
||||||
public static class ForgePlatform implements ModPlatform {
|
public static class ForgePlatform implements ModPlatform {
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
//? if neoforge {
|
//? if neoforge {
|
||||||
package com.example.template.platforms.neoforge;
|
/*package com.example.template.platforms.neoforge;
|
||||||
|
|
||||||
import com.example.template.ConfigScreen;
|
import com.example.template.ConfigScreen;
|
||||||
import com.example.template.TempLateInit;
|
import com.example.template.TempLateInit;
|
||||||
@@ -11,8 +11,8 @@ import net.neoforged.fml.common.Mod;
|
|||||||
//? if <1.21 {
|
//? if <1.21 {
|
||||||
import net.neoforged.neoforge.client.ConfigScreenHandler;
|
import net.neoforged.neoforge.client.ConfigScreenHandler;
|
||||||
//?} else {
|
//?} else {
|
||||||
/*import net.neoforged.neoforge.client.gui.IConfigScreenFactory;
|
/^import net.neoforged.neoforge.client.gui.IConfigScreenFactory;
|
||||||
*///?}
|
^///?}
|
||||||
@Mod("template")
|
@Mod("template")
|
||||||
public class TempLateNeoForge {
|
public class TempLateNeoForge {
|
||||||
public TempLateNeoForge() {
|
public TempLateNeoForge() {
|
||||||
@@ -21,12 +21,12 @@ public class TempLateNeoForge {
|
|||||||
//? if <1.21 {
|
//? if <1.21 {
|
||||||
ConfigScreenHandler.ConfigScreenFactory.class,
|
ConfigScreenHandler.ConfigScreenFactory.class,
|
||||||
() -> new ConfigScreenHandler.ConfigScreenFactory(
|
() -> new ConfigScreenHandler.ConfigScreenFactory(
|
||||||
((client, parent) -> ConfigScreen.createCursorEditScreen(parent))
|
((client, parent) -> ConfigScreen.createConfigScreen(parent))
|
||||||
)
|
)
|
||||||
//?} else {
|
//?} else {
|
||||||
/*IConfigScreenFactory.class,
|
/^IConfigScreenFactory.class,
|
||||||
() -> (client, parent) -> CursorEditScreen.createCursorEditScreen(parent)
|
() -> (client, parent) -> ConfigScreen.createConfigScreen(parent)
|
||||||
*///?}
|
^///?}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
public static class NeoForgePlatform implements ModPlatform {
|
public static class NeoForgePlatform implements ModPlatform {
|
||||||
@@ -41,4 +41,4 @@ public class TempLateNeoForge {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//?}
|
*///?}
|
||||||
@@ -14,10 +14,10 @@
|
|||||||
"environment": "*",
|
"environment": "*",
|
||||||
"entrypoints": {
|
"entrypoints": {
|
||||||
"main": [
|
"main": [
|
||||||
"com.example.platforms.fabric.TempLateFabric"
|
"com.example.template.platforms.fabric.TempLateFabric"
|
||||||
],
|
],
|
||||||
"modmenu": [
|
"modmenu": [
|
||||||
"com.example.platforms.fabric.ModMenuIntegration"
|
"com.example.template.platforms.fabric.ModMenuIntegration"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"mixins": [
|
"mixins": [
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
{
|
{
|
||||||
"required": true,
|
"required": true,
|
||||||
"package": "com.example.mixin",
|
"package": "com.example.template.mixin",
|
||||||
"compatibilityLevel": "JAVA_17",
|
"compatibilityLevel": "JAVA_17",
|
||||||
"mixins": [
|
"mixins": [
|
||||||
"com.example.template.mixin.ExampleMixin"
|
"ExampleMixin"
|
||||||
],
|
],
|
||||||
"injectors": {
|
"injectors": {
|
||||||
"defaultRequire": 1
|
"defaultRequire": 1
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"required": true,
|
"required": true,
|
||||||
"package": "com.example.platforms.fabric.mixin",
|
"package": "com.example.template.platforms.fabric.mixin",
|
||||||
"compatibilityLevel": "JAVA_17",
|
"compatibilityLevel": "JAVA_17",
|
||||||
"mixins": [
|
"mixins": [
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"required": true,
|
"required": true,
|
||||||
"package": "com.example.platforms.forge.mixin",
|
"package": "com.example.template.platforms.forge.mixin",
|
||||||
"compatibilityLevel": "JAVA_17",
|
"compatibilityLevel": "JAVA_17",
|
||||||
"mixins": [
|
"mixins": [
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"required": true,
|
"required": true,
|
||||||
"package": "com.example.platforms.neoforge.mixin",
|
"package": "com.example.template.platforms.neoforge.mixin",
|
||||||
"compatibilityLevel": "JAVA_17",
|
"compatibilityLevel": "JAVA_17",
|
||||||
"mixins": [
|
"mixins": [
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ plugins {
|
|||||||
id("com.github.johnrengelman.shadow") version "8.1.1" apply false
|
id("com.github.johnrengelman.shadow") version "8.1.1" apply false
|
||||||
id("me.modmuss50.mod-publish-plugin") version "0.8.4" apply false
|
id("me.modmuss50.mod-publish-plugin") version "0.8.4" apply false
|
||||||
}
|
}
|
||||||
stonecutter active "1.20.4-neoforge" /* [SC] DO NOT EDIT */
|
stonecutter active "1.20.1-fabric" /* [SC] DO NOT EDIT */
|
||||||
stonecutter.automaticPlatformConstants = true
|
stonecutter.automaticPlatformConstants = true
|
||||||
|
|
||||||
// Builds every version into `build/libs/{mod.version}/{loader}`
|
// Builds every version into `build/libs/{mod.version}/{loader}`
|
||||||
|
|||||||
Reference in New Issue
Block a user