Skip to content

Commit

Permalink
update MaFgLib version
Browse files Browse the repository at this point in the history
  • Loading branch information
TexBlock committed May 23, 2024
1 parent ace20df commit 058ea84
Show file tree
Hide file tree
Showing 8 changed files with 187 additions and 40 deletions.
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ loom.platform=forge
yarn_mappings=1.16.5+build.10

# Mod Properties
mod_version=0.1.3
mod_version=0.1.4
maven_group=org.thinkingstudio.rocknroller
archives_base_name=RocknRoller
mod_id=rocknroller
Expand All @@ -21,4 +21,4 @@ loom.platform=forge
curseforge_id=916852

# Dependencies
malilib_version=0.1.10-mc1.16.5
malilib_version=0.1.12-mc1.16.5
18 changes: 3 additions & 15 deletions src/main/java/fi/dy/masa/itemscroller/ItemScroller.java
Original file line number Diff line number Diff line change
@@ -1,26 +1,14 @@
package fi.dy.masa.itemscroller;

import fi.dy.masa.itemscroller.gui.GuiConfigs;
import fi.dy.masa.malilib.compat.forge.ForgePlatformUtils;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.loading.FMLLoader;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import fi.dy.masa.malilib.event.InitializationHandler;

@Mod(Reference.MOD_ID)
public class ItemScroller {
public static final Logger logger = LogManager.getLogger(Reference.MOD_ID);

public ItemScroller() {
if (FMLLoader.getDist().isClient()) {
ForgePlatformUtils.getInstance().getClientModIgnoredServerOnly();
InitializationHandler.getInstance().registerInitializationHandler(new InitHandler());
ForgePlatformUtils.getInstance().getMod(Reference.MOD_ID).registerModConfigScreen((screen) -> {
GuiConfigs gui = new GuiConfigs();
gui.setParent(screen);
return gui;
});
}
public static void onInitialize()
{
InitializationHandler.getInstance().registerInitializationHandler(new InitHandler());
}
}
2 changes: 1 addition & 1 deletion src/main/java/fi/dy/masa/itemscroller/gui/GuiConfigs.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public class GuiConfigs extends GuiConfigsBase

public GuiConfigs()
{
super(10, 50, Reference.MOD_ID, null, "itemscroller.gui.title.configs");
super(10, 50, Reference.MOD_ID, null, "itemscroller.gui.title.configs", Reference.MOD_NAME, Reference.MOD_VERSION);
}

@Override
Expand Down

This file was deleted.

34 changes: 34 additions & 0 deletions src/main/java/org/thinkingstudio/rocknroller/RocknRoller.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package org.thinkingstudio.rocknroller;

import fi.dy.masa.itemscroller.ItemScroller;
import fi.dy.masa.itemscroller.Reference;
import fi.dy.masa.itemscroller.event.RenderEventHandler;
import fi.dy.masa.itemscroller.gui.GuiConfigs;
import net.minecraftforge.client.event.GuiScreenEvent;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.loading.FMLLoader;
import org.thinkingstudio.mafglib.util.ForgePlatformUtils;

@Mod(Reference.MOD_ID)
public class RocknRoller {
public RocknRoller() {
if (FMLLoader.getDist().isClient()) {
// Make sure the mod being absent on the other network side does not cause
// the client to display the server as incompatible
ForgePlatformUtils.getInstance().getClientModIgnoredServerOnly();
ItemScroller.onInitialize();

// Config Screen
ForgePlatformUtils.getInstance().registerModConfigScreen(Reference.MOD_ID, (screen) -> {
GuiConfigs gui = new GuiConfigs();
gui.setParent(screen);
return gui;
});

MinecraftForge.EVENT_BUS.<GuiScreenEvent.DrawScreenEvent.Post>addListener(event -> {
RenderEventHandler.instance().onDrawScreenPost(event.getGui().getMinecraft());
});
}
}
}
2 changes: 1 addition & 1 deletion src/main/resources/assets/rocknroller/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@
"itemscroller.gui.label.trades": "Trades",
"itemscroller.gui.label.trade_uses": "Trade uses: %d / %d",

"itemscroller.gui.title.configs": "Item Scroller Configs"
"itemscroller.gui.title.configs": "%s Configs - %s"
}
146 changes: 146 additions & 0 deletions src/main/resources/assets/rocknroller/lang/zh_cn.json

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion src/main/resources/rocknroller.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
"MixinAbstractInventoryScreen",
"MixinClientPlayerInteractionManager",
"MixinCraftingScreenHandler",
"MixinForgeHooksClient",
"MixinMerchantScreen",
"MixinMerchantScreenHandler",
"MixinScreen"
Expand Down

0 comments on commit 058ea84

Please sign in to comment.