Skip to content
This repository has been archived by the owner on Dec 28, 2024. It is now read-only.

Commit

Permalink
Personalisation changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Jordyrat committed Sep 11, 2024
1 parent 63f0540 commit 0977f2c
Show file tree
Hide file tree
Showing 14 changed files with 45 additions and 48 deletions.
4 changes: 2 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ plugins {
id("com.bnorm.power.kotlin-power-assert") version "0.13.0"
}

val group = "com.examplemod"
val group = "com.ratons"
val mixinGroup = "$group.mixin"

// the modid and version here are used on the compiled far
val modid = "examplemod"
val modid = "ratons"
val version = "0.0.1"

val skyHanniVersion = "0.27.Beta.4"
Expand Down
2 changes: 1 addition & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ plugins {
}


rootProject.name = "ExampleMod"
rootProject.name = "Rat-ons"
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
package com.examplemod
package com.ratons

import at.hannibal2.skyhanni.events.LorenzTickEvent
import at.hannibal2.skyhanni.events.SecondPassedEvent
import com.examplemod.commands.Commands
import com.examplemod.config.Features
import com.examplemod.features.misc.ExampleFeature
import com.ratons.commands.Commands
import com.ratons.config.Features
import com.ratons.features.misc.ExampleFeature
import io.github.notenoughupdates.moulconfig.managed.ManagedConfig
import net.minecraft.client.Minecraft
import net.minecraft.client.gui.GuiScreen
import net.minecraftforge.common.MinecraftForge
import net.minecraftforge.fml.common.Loader
import net.minecraftforge.fml.common.Mod
import net.minecraftforge.fml.common.event.FMLInitializationEvent
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
Expand All @@ -18,13 +15,13 @@ import org.apache.logging.log4j.Logger
import java.io.File

@Mod(
modid = ExampleMod.MOD_ID,
modid = Ratons.MOD_ID,
clientSideOnly = true,
useMetadata = true,
version = ExampleMod.VERSION,
version = Ratons.VERSION,
dependencies = "before:skyhanni",
)
class ExampleMod {
class Ratons {

@Mod.EventHandler
fun init(event: FMLInitializationEvent) {
Expand Down Expand Up @@ -56,13 +53,13 @@ class ExampleMod {
}

companion object {
const val MOD_ID = "examplemod"
const val MOD_ID = "ratons"
const val VERSION = "0.0.1"

const val HIDE_MOD_ID: Boolean = false
const val HIDE_MOD_ID: Boolean = true

@JvmField
val logger: Logger = LogManager.getLogger("ExampleMod")
val logger: Logger = LogManager.getLogger("Ratons")

@JvmField
val modules: MutableList<Any> = ArrayList()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.examplemod.commands
package com.ratons.commands

import at.hannibal2.skyhanni.SkyHanniMod
import at.hannibal2.skyhanni.data.GuiEditManager
Expand All @@ -7,7 +7,7 @@ import at.hannibal2.skyhanni.utils.StringUtils.splitLines
import at.hannibal2.skyhanni.utils.chat.Text
import at.hannibal2.skyhanni.utils.chat.Text.hover
import at.hannibal2.skyhanni.utils.chat.Text.suggest
import com.examplemod.ExampleMod
import com.ratons.Ratons
import io.github.notenoughupdates.moulconfig.gui.GuiScreenElementWrapper
import net.minecraft.command.CommandBase
import net.minecraft.command.ICommandSender
Expand All @@ -17,8 +17,8 @@ import net.minecraftforge.client.ClientCommandHandler
object Commands {

fun init() {
registerCommand("emconfig", "Opens the config GUI", openMainMenu)
registerCommand("emhelp", "Shows all commands", ::commandHelp)
registerCommand("rat", "Opens the config GUI", openMainMenu)
registerCommand("rathelp", "Shows all commands", ::commandHelp)
}

private val openMainMenu: (Array<String>) -> Unit = {
Expand All @@ -35,7 +35,7 @@ object Commands {
private data class CommandInfo(val name: String, val description: String)

private fun openConfigGui(search: String? = null) {
val editor = ExampleMod.managedConfig.getEditor()
val editor = Ratons.managedConfig.getEditor()

search?.let { editor.search(search) }
SkyHanniMod.screenToOpen = GuiScreenElementWrapper(editor)
Expand Down Expand Up @@ -65,9 +65,9 @@ object Commands {
if (args.size == 1) {
val searchTerm = args[0].lowercase()
filter = { it.lowercase().contains(searchTerm) }
title = "SillyMod commands with '§e$searchTerm§7'"
title = "Rat-ons commands with '§e$searchTerm§7'"
} else {
title = "All SillyMod commands"
title = "All Rat-ons commands"
}

val components = mutableListOf<ChatComponentText>()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.examplemod.config;
package com.ratons.config;

import at.hannibal2.skyhanni.config.core.config.Position;
import com.google.gson.annotations.Expose;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.examplemod.config;
package com.ratons.config;

import com.examplemod.ExampleMod;
import com.ratons.Ratons;
import com.google.gson.annotations.Expose;
import io.github.notenoughupdates.moulconfig.Config;
import io.github.notenoughupdates.moulconfig.annotations.Category;
Expand All @@ -14,12 +14,12 @@ public boolean shouldAutoFocusSearchbar() {

@Override
public String getTitle() {
return "ExampleMod " + ExampleMod.VERSION;
return "Ratons " + Ratons.VERSION;
}

@Override
public void saveNow() {
ExampleMod.Companion.getManagedConfig().saveToFile();
Ratons.Companion.getManagedConfig().saveToFile();
}

@Expose
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
package com.examplemod.features.misc
package com.ratons.features.misc

import at.hannibal2.skyhanni.events.GuiRenderEvent
import at.hannibal2.skyhanni.utils.RenderUtils.renderString
import com.examplemod.ExampleMod
import com.ratons.Ratons
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent

@Suppress("SkyHanniModuleInspection")
object ExampleFeature {

private val config get() = ExampleMod.feature.exampleCategory
private val config get() = Ratons.feature.exampleCategory

@SubscribeEvent
fun onRenderOverlay(event: GuiRenderEvent.GuiOverlayRenderEvent) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.examplemod.mixins.init;
package com.ratons.mixins.init;

import org.spongepowered.asm.lib.tree.ClassNode;
import org.spongepowered.asm.mixin.extensibility.IMixinConfigPlugin;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.examplemod.mixins.transformers;
package com.ratons.mixins.transformers;

import com.examplemod.ExampleMod;
import com.ratons.Ratons;
import net.minecraft.client.gui.GuiMainMenu;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
Expand All @@ -13,6 +13,6 @@ public class MixinGuiMainMenu {

@Inject(method = "initGui", at = @At("HEAD"))
public void onInitGui(CallbackInfo ci) {
ExampleMod.logger.info("Hello from Main Menu!");
Ratons.logger.info("Hello from Main Menu!");
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.examplemod.mixins.transformers.modidhider;
package com.ratons.mixins.transformers.modidhider;

import com.examplemod.ExampleMod;
import com.ratons.Ratons;
import net.minecraftforge.fml.common.network.handshake.FMLHandshakeMessage;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
Expand All @@ -20,7 +20,7 @@ public abstract class MixinFMLHandshakeMessageModList {

@Inject(method = "<init>(Ljava/util/List;)V", at = @At(value = "RETURN"))
public void onInitLast(List modList, CallbackInfo ci) {
if (!ExampleMod.HIDE_MOD_ID) return;
modList().remove(ExampleMod.MOD_ID);
if (!Ratons.HIDE_MOD_ID) return;
modList().remove(Ratons.MOD_ID);
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.examplemod.mixins.transformers.modidhider;
package com.ratons.mixins.transformers.modidhider;

import com.examplemod.ExampleMod;
import com.ratons.Ratons;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Pseudo;
import org.spongepowered.asm.mixin.injection.At;
Expand All @@ -12,7 +12,7 @@
public class MixinSkytilsFunnny {
@Inject(method = "joinedSkyblock*", at = @At("HEAD"), expect = 0, cancellable = true, remap = false)
public void onJoinedSkyblockHead(CallbackInfo ci) {
if (!ExampleMod.HIDE_MOD_ID) return;
if (!Ratons.HIDE_MOD_ID) return;
ci.cancel();
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.examplemod.mixins.transformers.skyhanni;
package com.ratons.mixins.transformers.skyhanni;

import at.hannibal2.skyhanni.api.event.SkyHanniEvents;
import com.examplemod.ExampleMod;
import com.ratons.Ratons;
import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
Expand All @@ -21,7 +21,7 @@ public abstract class MixinSkyHanniEvents {

@Inject(method = "init*", at = @At(value = "HEAD"), remap = false)
private void init(List<?> instances, CallbackInfo ci) {
for (Object module : ExampleMod.modules) {
for (Object module : Ratons.modules) {
for (Method method : module.getClass().getDeclaredMethods()) {
registerMethod(method, module);
}
Expand Down
6 changes: 3 additions & 3 deletions src/main/resources/mcmod.info
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
[
{
"modid": "${modid}",
"name": "Example Mod",
"description": "A mod that is used as an example.",
"name": "Rat-ons",
"description": "Silly little mod with silly little features.",
"version": "${version}",
"mcversion": "1.8.9",
"url": "",
"updateUrl": "",
"authorList": [
"You"
"Jordyrat"
],
"credits": "",
"logoFile": "",
Expand Down

0 comments on commit 0977f2c

Please sign in to comment.