Skip to content

Commit

Permalink
migrate Kyoyu.java -> KyoyuMod.java & forge 1.16.5 litematica/malilib
Browse files Browse the repository at this point in the history
  • Loading branch information
topi-banana committed Nov 29, 2024
1 parent 9816501 commit 20d511b
Show file tree
Hide file tree
Showing 7 changed files with 46 additions and 36 deletions.
8 changes: 6 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@ stonecutter.const('PAPER', project.platform == 'paper')
stonecutter.const('client', project.hasProperty('litematica_version') && project.hasProperty('malilib_version'))
stonecutter.swap("mod_version", "\"${fullArtifactVersion}\";")

println project.name + ' ' + project.hasProperty('litematica_version') && project.hasProperty('malilib_version')


if (use_architectury_loom) {
configurations {
Expand Down Expand Up @@ -144,8 +146,10 @@ dependencies {
}
if (project.hasProperty('malilib_version')) {
modImplementation "maven.modrinth:malilib:${project.malilib_version}"
include(modImplementation(fabricApi.module("fabric-networking-api-v1", project.fabric_api_version)))
include(modImplementation(fabricApi.module("fabric-resource-loader-v0", project.fabric_api_version)))
if (project.platform == 'fabric') {
include(modImplementation(fabricApi.module("fabric-networking-api-v1", project.fabric_api_version)))
include(modImplementation(fabricApi.module("fabric-resource-loader-v0", project.fabric_api_version)))
}
}
}

Expand Down
31 changes: 2 additions & 29 deletions src/main/java/com/vulpeus/kyoyu/Kyoyu.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,36 +3,9 @@
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

//? if FORGE
/* import net.minecraftforge.fml.common.Mod; */

//? if NEOFORGE
/* import net.neoforged.fml.common.Mod; */


//? if FORGE || NEOFORGE
/* @Mod("kyoyu") */
public class Kyoyu
//? if FABRIC
implements net.fabricmc.api.ModInitializer

//? if PAPER
/* extends org.bukkit.plugin.java.JavaPlugin */
{
public class Kyoyu {
public static final String MOD_ID = "kyoyu";
public static final String MOD_VERSION = /*$ mod_version*/ "unknown";

public static final Logger LOGGER = LogManager.getLogger();

//? if FABRIC
@Override public void onInitialize()

//? if FORGE || NEOFORGE
/* public Kyoyu() */
//? if PAPER
/* @Override public void onEnable() */
{
LOGGER.info("Hello, World!");
LOGGER.info("Kyoyu Version : {}", MOD_VERSION);
}
public static final Logger LOGGER = LogManager.getLogger(MOD_ID);
}
30 changes: 30 additions & 0 deletions src/main/java/com/vulpeus/kyoyu/KyoyuMod.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package com.vulpeus.kyoyu;

//? if FORGE
/* import net.minecraftforge.fml.common.Mod; */

//? if NEOFORGE
/* import net.neoforged.fml.common.Mod; */


//? if FORGE || NEOFORGE
/* @Mod("kyoyu") */
public class KyoyuMod
//? if FABRIC
implements net.fabricmc.api.ModInitializer

//? if PAPER
/* extends org.bukkit.plugin.java.JavaPlugin */
{
//? if FABRIC
@Override public void onInitialize()

//? if FORGE || NEOFORGE
/* public KyoyuMod() */
//? if PAPER
/* @Override public void onEnable() */
{
Kyoyu.LOGGER.info("Hello, World!");
Kyoyu.LOGGER.info("KyoyuMod Version : {}", Kyoyu.MOD_VERSION);
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.vulpeus.kyoyu.client.gui;

//? if client {
import com.vulpeus.kyoyu.Kyoyu;
import fi.dy.masa.malilib.gui.GuiBase;
import fi.dy.masa.malilib.util.GuiUtils;
import fi.dy.masa.malilib.util.StringUtils;
Expand All @@ -10,14 +11,12 @@
//? elif >=1.16
/* import net.minecraft.client.util.math.MatrixStack; */

import static com.vulpeus.kyoyu.Kyoyu.MOD_VERSION;

public class Gui_LoadingExplorer extends GuiBase {

@Override
public void init() {
this.setParent(GuiUtils.getCurrentScreen());
this.title = StringUtils.translate("kyoyu.gui.title.title", MOD_VERSION);
this.setTitle(StringUtils.translate("kyoyu.gui.title.title", Kyoyu.MOD_VERSION));
}

@Override
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"environment": "*",
"entrypoints": {
"main": [
"com.vulpeus.kyoyu.Kyoyu"
"com.vulpeus.kyoyu.KyoyuMod"
]
},
"mixins": [
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/plugin.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: ${name}
version: ${version}
main: com.vulpeus.kyoyu.Kyoyu
main: com.vulpeus.kyoyu.KyoyuMod
description: ${description}
author: ${authors}
website: ${homepage}
Expand Down
4 changes: 4 additions & 0 deletions versions/forge-1.16.5/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,7 @@ minecraft_dependency=[1.16, 1.16.5]
# Build Information
# The target mc versions for the mod during mod publishing, separated with \n
game_versions=1.16\n1.16.1\n1.16.2\n1.16.3\n1.16.4\n1.16.5

# Dependencies
malilib_version=2nS83Qf7
litematica_version=0.0.0-dev.20210917

0 comments on commit 20d511b

Please sign in to comment.