diff --git a/gradle.properties b/gradle.properties index 680e2b34..255f3563 100644 --- a/gradle.properties +++ b/gradle.properties @@ -20,7 +20,7 @@ loader_version_range=[4,) mod_id=mystias_izakaya mod_name=Mystia's Izakaya mod_license=GPLv3 -mod_version=0.1.0-rc2 +mod_version=0.1.0-rc3 mod_group_id=org.hiedacamellia.mystiasizakaya mod_authors=HiedaCamellia mod_description= \ No newline at end of file diff --git a/src/generated/resources/.cache/4d80d66209c237eb485b194bd690dcf7e272ba36 b/src/generated/resources/.cache/4d80d66209c237eb485b194bd690dcf7e272ba36 index 9b457129..b72fee83 100644 --- a/src/generated/resources/.cache/4d80d66209c237eb485b194bd690dcf7e272ba36 +++ b/src/generated/resources/.cache/4d80d66209c237eb485b194bd690dcf7e272ba36 @@ -1,2 +1,2 @@ -// 1.21 2024-09-03T23:08:01.8919636 Languages: zh_cn for mod: mystias_izakaya -5531b58ced64a027efef04bacae322a4c6d56cb4 assets/mystias_izakaya/lang/zh_cn.json +// 1.21 2024-09-06T21:17:50.8570258 Languages: zh_cn for mod: mystias_izakaya +fd29b5966bc5b85ab15935276be72f549f3eaa3a assets/mystias_izakaya/lang/zh_cn.json diff --git a/src/generated/resources/.cache/51e7974fc121251e1ad37761566173ab4e2c1b25 b/src/generated/resources/.cache/51e7974fc121251e1ad37761566173ab4e2c1b25 index beddf2c4..323ab946 100644 --- a/src/generated/resources/.cache/51e7974fc121251e1ad37761566173ab4e2c1b25 +++ b/src/generated/resources/.cache/51e7974fc121251e1ad37761566173ab4e2c1b25 @@ -1,2 +1,2 @@ -// 1.21 2024-09-03T23:08:01.892963 Languages: en_us for mod: mystias_izakaya -2c6023acc129d79c40c68d3d0d276508361b0fe7 assets/mystias_izakaya/lang/en_us.json +// 1.21 2024-09-06T21:17:50.8590255 Languages: en_us for mod: mystias_izakaya +421f5570905649e79dcfa370b77bed8756d6edd0 assets/mystias_izakaya/lang/en_us.json diff --git a/src/generated/resources/assets/mystias_izakaya/lang/en_us.json b/src/generated/resources/assets/mystias_izakaya/lang/en_us.json index 7d653bd0..2f14b1d1 100644 --- a/src/generated/resources/assets/mystias_izakaya/lang/en_us.json +++ b/src/generated/resources/assets/mystias_izakaya/lang/en_us.json @@ -339,6 +339,19 @@ "message.mystiasizakaya.checkout.fail": "Insufficient balance", "message.mystiasizakaya.checkout.success": "Checkout success", "message.mystiasizakaya.telephone.colddown": "Please wait %s seconds", + "mystias_izakaya.configuration.debug": "Debug Mode", + "mystias_izakaya.configuration.debug.tooltip": "Set to true to enable debug info", + "mystias_izakaya.configuration.max_overturn": "Maximum Overturn", + "mystias_izakaya.configuration.max_overturn.tooltip": "The maximum number of turnovers to store", + "mystias_izakaya.configuration.section.mystias.izakaya.client.toml": "Client Configuration", + "mystias_izakaya.configuration.section.mystias.izakaya.client.toml.title": "Mysita's Izakaya Client Configuration", + "mystias_izakaya.configuration.section.mystias.izakaya.common.toml": "Common Configuration", + "mystias_izakaya.configuration.section.mystias.izakaya.common.toml.title": "Mystia's Izakaya Common Configuration", + "mystias_izakaya.configuration.show_balance": "Show Balance", + "mystias_izakaya.configuration.show_balance.tooltip": "Set to true to display balance in the HUD", + "mystias_izakaya.configuration.tele_cooldown": "Telephone Cooldown", + "mystias_izakaya.configuration.tele_cooldown.tooltip": "The cooldown time for the telephone(tick)", + "mystias_izakaya.configuration.title": "Mystia's Izakaya Configuration", "network.mystiasizakaya.failed": "Failed to handle network data: %s", "status.mystias_izakaya.free": "Free", "status.mystias_izakaya.outputblocked": "Output Blocked", diff --git a/src/generated/resources/assets/mystias_izakaya/lang/zh_cn.json b/src/generated/resources/assets/mystias_izakaya/lang/zh_cn.json index c5f23b9e..7a7d5a4d 100644 --- a/src/generated/resources/assets/mystias_izakaya/lang/zh_cn.json +++ b/src/generated/resources/assets/mystias_izakaya/lang/zh_cn.json @@ -337,6 +337,19 @@ "message.mystiasizakaya.checkout.fail": "余额不足", "message.mystiasizakaya.checkout.success": "购买成功", "message.mystiasizakaya.telephone.colddown": "冷却中: %s秒", + "mystias_izakaya.configuration.debug": "调试模式", + "mystias_izakaya.configuration.debug.tooltip": "设置为true以启用调试信息", + "mystias_izakaya.configuration.max_overturn": "最大流水数", + "mystias_izakaya.configuration.max_overturn.tooltip": "要存储的最大流水次数", + "mystias_izakaya.configuration.section.mystias.izakaya.client.toml": "客户端配置", + "mystias_izakaya.configuration.section.mystias.izakaya.client.toml.title": "夜雀食堂 客户端配置", + "mystias_izakaya.configuration.section.mystias.izakaya.common.toml": "通用配置", + "mystias_izakaya.configuration.section.mystias.izakaya.common.toml.title": "夜雀食堂 通用配置", + "mystias_izakaya.configuration.show_balance": "显示余额", + "mystias_izakaya.configuration.show_balance.tooltip": "设置为true以在hud中显示余额", + "mystias_izakaya.configuration.tele_cooldown": "电话冷却时间", + "mystias_izakaya.configuration.tele_cooldown.tooltip": "电话的冷却时间(刻)", + "mystias_izakaya.configuration.title": "夜雀食堂 配置", "network.mystiasizakaya.failed": "无法处理网络数据: %s", "status.mystias_izakaya.free": "空闲", "status.mystias_izakaya.outputblocked": "输出受阻", diff --git a/src/generated/resources/data/mystias_izakaya/advancement/recipes/misc/ledger.json b/src/generated/resources/data/mystias_izakaya/advancement/recipes/misc/ledger.json new file mode 100644 index 00000000..f981866a --- /dev/null +++ b/src/generated/resources/data/mystias_izakaya/advancement/recipes/misc/ledger.json @@ -0,0 +1,32 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_book": { + "conditions": { + "items": [ + { + "items": "minecraft:book" + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "mystias_izakaya:ledger" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_book" + ] + ], + "rewards": { + "recipes": [ + "mystias_izakaya:ledger" + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/data/mystias_izakaya/advancement/recipes/misc/table.json b/src/generated/resources/data/mystias_izakaya/advancement/recipes/misc/table.json new file mode 100644 index 00000000..54c4ddb3 --- /dev/null +++ b/src/generated/resources/data/mystias_izakaya/advancement/recipes/misc/table.json @@ -0,0 +1,32 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_planks": { + "conditions": { + "items": [ + { + "items": "#minecraft:planks" + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "mystias_izakaya:table" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_planks" + ] + ], + "rewards": { + "recipes": [ + "mystias_izakaya:table" + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/data/mystias_izakaya/advancement/recipes/misc/telephone.json b/src/generated/resources/data/mystias_izakaya/advancement/recipes/misc/telephone.json new file mode 100644 index 00000000..9910b2b2 --- /dev/null +++ b/src/generated/resources/data/mystias_izakaya/advancement/recipes/misc/telephone.json @@ -0,0 +1,32 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_ender_pearl": { + "conditions": { + "items": [ + { + "items": "minecraft:ender_pearl" + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "mystias_izakaya:telephone" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_ender_pearl" + ] + ], + "rewards": { + "recipes": [ + "mystias_izakaya:telephone" + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/data/mystias_izakaya/recipe/ledger.json b/src/generated/resources/data/mystias_izakaya/recipe/ledger.json new file mode 100644 index 00000000..44ddc666 --- /dev/null +++ b/src/generated/resources/data/mystias_izakaya/recipe/ledger.json @@ -0,0 +1,19 @@ +{ + "type": "minecraft:crafting_shapeless", + "category": "misc", + "ingredients": [ + { + "item": "minecraft:book" + }, + { + "item": "minecraft:paper" + }, + { + "item": "minecraft:paper" + } + ], + "result": { + "count": 1, + "id": "mystias_izakaya:ledger" + } +} \ No newline at end of file diff --git a/src/generated/resources/data/mystias_izakaya/recipe/table.json b/src/generated/resources/data/mystias_izakaya/recipe/table.json new file mode 100644 index 00000000..3cccfee1 --- /dev/null +++ b/src/generated/resources/data/mystias_izakaya/recipe/table.json @@ -0,0 +1,20 @@ +{ + "type": "minecraft:crafting_shaped", + "category": "misc", + "key": { + "#": { + "tag": "minecraft:wooden_slabs" + }, + "X": { + "tag": "minecraft:wooden_fences" + } + }, + "pattern": [ + "#", + "X" + ], + "result": { + "count": 1, + "id": "mystias_izakaya:table" + } +} \ No newline at end of file diff --git a/src/generated/resources/data/mystias_izakaya/recipe/telephone.json b/src/generated/resources/data/mystias_izakaya/recipe/telephone.json new file mode 100644 index 00000000..1a8943f3 --- /dev/null +++ b/src/generated/resources/data/mystias_izakaya/recipe/telephone.json @@ -0,0 +1,23 @@ +{ + "type": "minecraft:crafting_shaped", + "category": "misc", + "key": { + "#": { + "tag": "minecraft:planks" + }, + "S": { + "item": "minecraft:iron_ingot" + }, + "X": { + "item": "minecraft:ender_pearl" + } + }, + "pattern": [ + "SXS", + "###" + ], + "result": { + "count": 1, + "id": "mystias_izakaya:telephone" + } +} \ No newline at end of file diff --git a/src/main/java/org/hiedacamellia/mystiasizakaya/Config.java b/src/main/java/org/hiedacamellia/mystiasizakaya/Config.java deleted file mode 100644 index 9004a473..00000000 --- a/src/main/java/org/hiedacamellia/mystiasizakaya/Config.java +++ /dev/null @@ -1,45 +0,0 @@ -package org.hiedacamellia.mystiasizakaya; - -import net.neoforged.bus.api.SubscribeEvent; -import net.neoforged.fml.common.EventBusSubscriber; -import net.neoforged.fml.event.config.ModConfigEvent; -import net.neoforged.neoforge.common.ModConfigSpec; - -// An example config class. This is not required, but it's a good idea to have one to keep your config organized. -// Demonstrates how to use Neo's config APIs -@EventBusSubscriber(modid = MystiasIzakaya.MODID, bus = EventBusSubscriber.Bus.MOD) -public class Config -{ - private static final ModConfigSpec.Builder BUILDER = new ModConfigSpec.Builder(); - - private static final ModConfigSpec.BooleanValue DEBUG = BUILDER - .comment("Set to true to enable debug info") - .comment("设置为true以启用调试信息") - .define("debug", true); - - public static final ModConfigSpec.BooleanValue SHOW_BALANCE = BUILDER - .comment("Set to true to display balance in the hud ( deprecated ) ") - .comment("设置为true以在hud中显示余额(弃用)") - .define("show_balance", false); - - public static final ModConfigSpec.IntValue MAX_OVERTURN = BUILDER - .comment("The maximum number of turnovers to store") - .comment("要存储的最大流水次数") - .defineInRange("max_overturn", 10, 0, Integer.MAX_VALUE); - - public static final ModConfigSpec.IntValue TELE_COOLDOWN = BUILDER - .comment("The cooldown time for the telephone(tick)") - .comment("电话的冷却时间(刻)") - .defineInRange("tele_cooldown", 12000, 0, Integer.MAX_VALUE); - - static final ModConfigSpec SPEC = BUILDER.build(); - - public static boolean debug; - - - @SubscribeEvent - static void onLoad(final ModConfigEvent event) - { - debug = DEBUG.get(); - } -} diff --git a/src/main/java/org/hiedacamellia/mystiasizakaya/MystiasIzakaya.java b/src/main/java/org/hiedacamellia/mystiasizakaya/MystiasIzakaya.java index c410dbf6..14529685 100644 --- a/src/main/java/org/hiedacamellia/mystiasizakaya/MystiasIzakaya.java +++ b/src/main/java/org/hiedacamellia/mystiasizakaya/MystiasIzakaya.java @@ -5,10 +5,15 @@ import net.neoforged.fml.ModContainer; import net.neoforged.fml.common.Mod; import net.neoforged.fml.config.ModConfig; -import net.neoforged.neoforge.common.NeoForge; +import net.neoforged.fml.loading.FMLLoader; +import net.neoforged.neoforge.client.gui.ConfigurationScreen; +import net.neoforged.neoforge.client.gui.IConfigScreenFactory; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; +import org.hiedacamellia.mystiasizakaya.core.config.ClientConfig; +import org.hiedacamellia.mystiasizakaya.core.config.CommonConfig; import org.hiedacamellia.mystiasizakaya.core.data.Data; +import org.hiedacamellia.mystiasizakaya.core.event.MIEvent; import org.hiedacamellia.mystiasizakaya.registries.*; @Mod("mystias_izakaya") @@ -19,6 +24,7 @@ public class MystiasIzakaya { public MystiasIzakaya(IEventBus modEventBus, ModContainer modContainer) { modEventBus.addListener(Data::onGatherData); + modEventBus.addListener(MIEvent::onCommonSetup); MIBlock.BLOCKS.register(modEventBus); MIBlockEntitiy.REGISTRY.register(modEventBus); @@ -29,6 +35,10 @@ public MystiasIzakaya(IEventBus modEventBus, ModContainer modContainer) MIAttachment.ATTACHMENTS.register(modEventBus); MIDatacomponet.DATA_COMPONENTS.register(modEventBus); - modContainer.registerConfig(ModConfig.Type.COMMON, Config.SPEC); + modContainer.registerConfig(ModConfig.Type.COMMON, CommonConfig.SPEC); + modContainer.registerConfig(ModConfig.Type.CLIENT, ClientConfig.SPEC); + if(FMLLoader.getDist().isClient()) + modContainer.registerExtensionPoint(IConfigScreenFactory.class, ConfigurationScreen::new); + } } diff --git a/src/main/java/org/hiedacamellia/mystiasizakaya/content/client/overlay/BalanceOverlay.java b/src/main/java/org/hiedacamellia/mystiasizakaya/content/client/overlay/BalanceOverlay.java index 7670a505..88d22171 100644 --- a/src/main/java/org/hiedacamellia/mystiasizakaya/content/client/overlay/BalanceOverlay.java +++ b/src/main/java/org/hiedacamellia/mystiasizakaya/content/client/overlay/BalanceOverlay.java @@ -9,7 +9,8 @@ import net.neoforged.bus.api.SubscribeEvent; import net.neoforged.fml.common.EventBusSubscriber; import net.neoforged.neoforge.client.event.RenderGuiEvent; -import org.hiedacamellia.mystiasizakaya.Config; +import org.hiedacamellia.mystiasizakaya.core.config.ClientConfig; +import org.hiedacamellia.mystiasizakaya.core.config.CommonConfig; import org.hiedacamellia.mystiasizakaya.registries.MIAttachment; @EventBusSubscriber({ Dist.CLIENT }) @@ -25,7 +26,7 @@ public static void eventHandler(RenderGuiEvent.Pre event) { .format(entity.getData(MIAttachment.MI_BALANCE).balance()) + "\u5186"; int strlength = Minecraft.getInstance().font.width(text); - if (Config.SHOW_BALANCE.get()) + if (ClientConfig.SHOW_BALANCE.get()) event.getGuiGraphics().drawString(Minecraft.getInstance().font, text, w - 20 - strlength, h - 11, -1, false); diff --git a/src/main/java/org/hiedacamellia/mystiasizakaya/core/codec/record/MITurnover.java b/src/main/java/org/hiedacamellia/mystiasizakaya/core/codec/record/MITurnover.java index 44b9364c..9b55ef73 100644 --- a/src/main/java/org/hiedacamellia/mystiasizakaya/core/codec/record/MITurnover.java +++ b/src/main/java/org/hiedacamellia/mystiasizakaya/core/codec/record/MITurnover.java @@ -11,7 +11,7 @@ import net.minecraft.world.entity.player.Player; import net.neoforged.neoforge.network.PacketDistributor; import net.neoforged.neoforge.network.handling.IPayloadContext; -import org.hiedacamellia.mystiasizakaya.Config; +import org.hiedacamellia.mystiasizakaya.core.config.CommonConfig; import org.hiedacamellia.mystiasizakaya.MystiasIzakaya; import org.hiedacamellia.mystiasizakaya.registries.MIAttachment; import org.jetbrains.annotations.NotNull; @@ -73,7 +73,7 @@ public MITurnover deleteTurnover(String key){ } public MITurnover deleteOverStack(){ - int stack = Config.MAX_OVERTURN.get(); + int stack = CommonConfig.MAX_OVERTURN.get(); List k = new ArrayList<>(this.k()); List v = new ArrayList<>(this.v()); while(k.size() > stack){ diff --git a/src/main/java/org/hiedacamellia/mystiasizakaya/core/command/Showbalance.java b/src/main/java/org/hiedacamellia/mystiasizakaya/core/command/Showbalance.java index 8be7267d..25bcd109 100644 --- a/src/main/java/org/hiedacamellia/mystiasizakaya/core/command/Showbalance.java +++ b/src/main/java/org/hiedacamellia/mystiasizakaya/core/command/Showbalance.java @@ -10,7 +10,8 @@ import net.neoforged.fml.common.EventBusSubscriber; import net.neoforged.neoforge.common.util.FakePlayerFactory; import net.neoforged.neoforge.event.RegisterCommandsEvent; -import org.hiedacamellia.mystiasizakaya.Config; +import org.hiedacamellia.mystiasizakaya.core.config.ClientConfig; +import org.hiedacamellia.mystiasizakaya.core.config.CommonConfig; @EventBusSubscriber public class Showbalance { @@ -28,7 +29,7 @@ public static void registerCommand(RegisterCommandsEvent event) { { boolean set = BoolArgumentType.getBool(arguments, "logic"); - Config.SHOW_BALANCE.set(set); + ClientConfig.SHOW_BALANCE.set(set); } return 0; diff --git a/src/main/java/org/hiedacamellia/mystiasizakaya/core/config/ClientConfig.java b/src/main/java/org/hiedacamellia/mystiasizakaya/core/config/ClientConfig.java new file mode 100644 index 00000000..a7a5137d --- /dev/null +++ b/src/main/java/org/hiedacamellia/mystiasizakaya/core/config/ClientConfig.java @@ -0,0 +1,14 @@ +package org.hiedacamellia.mystiasizakaya.core.config; + +import net.neoforged.neoforge.common.ModConfigSpec; + +public class ClientConfig { + private static final ModConfigSpec.Builder BUILDER = new ModConfigSpec.Builder(); + + public static final ModConfigSpec.BooleanValue SHOW_BALANCE = BUILDER + .comment("Set to true to display balance in the hud") + .comment("设置为true以在hud中显示余额") + .define("show_balance", false); + + public static final ModConfigSpec SPEC = BUILDER.build(); +} diff --git a/src/main/java/org/hiedacamellia/mystiasizakaya/core/config/CommonConfig.java b/src/main/java/org/hiedacamellia/mystiasizakaya/core/config/CommonConfig.java new file mode 100644 index 00000000..d5d88194 --- /dev/null +++ b/src/main/java/org/hiedacamellia/mystiasizakaya/core/config/CommonConfig.java @@ -0,0 +1,25 @@ +package org.hiedacamellia.mystiasizakaya.core.config; + +import net.neoforged.neoforge.common.ModConfigSpec; + +public class CommonConfig +{ + private static final ModConfigSpec.Builder BUILDER = new ModConfigSpec.Builder(); + + public static final ModConfigSpec.BooleanValue DEBUG = BUILDER + .comment("Set to true to enable debug info") + .comment("设置为true以启用调试信息") + .define("debug", true); + + public static final ModConfigSpec.IntValue MAX_OVERTURN = BUILDER + .comment("The maximum number of turnovers to store") + .comment("要存储的最大流水次数") + .defineInRange("max_overturn", 10, 0, Integer.MAX_VALUE); + + public static final ModConfigSpec.IntValue TELE_COOLDOWN = BUILDER + .comment("The cooldown time for the telephone(tick)") + .comment("电话的冷却时间(刻)") + .defineInRange("tele_cooldown", 12000, 0, Integer.MAX_VALUE); + + public static final ModConfigSpec SPEC = BUILDER.build(); +} diff --git a/src/main/java/org/hiedacamellia/mystiasizakaya/core/data/lang/ChineseLanguageProvider.java b/src/main/java/org/hiedacamellia/mystiasizakaya/core/data/lang/ChineseLanguageProvider.java index 94f51f96..99301d98 100644 --- a/src/main/java/org/hiedacamellia/mystiasizakaya/core/data/lang/ChineseLanguageProvider.java +++ b/src/main/java/org/hiedacamellia/mystiasizakaya/core/data/lang/ChineseLanguageProvider.java @@ -724,6 +724,19 @@ protected void addTranslations() { add("block.mystias_izakaya.telephone", "电话"); add("tooltip.mystias_izakaya.telephone","你可以使用这个物品购买你想要的任何东西"); + add("mystias_izakaya.configuration.debug", "调试模式"); + add("mystias_izakaya.configuration.max_overturn", "最大流水数"); + add("mystias_izakaya.configuration.show_balance", "显示余额"); + add("mystias_izakaya.configuration.tele_cooldown", "电话冷却时间"); + add("mystias_izakaya.configuration.section.mystias.izakaya.common.toml", "通用配置"); + add("mystias_izakaya.configuration.show_balance.tooltip", "设置为true以在hud中显示余额"); + add("mystias_izakaya.configuration.title", "夜雀食堂 配置"); + add("mystias_izakaya.configuration.section.mystias.izakaya.common.toml.title", "夜雀食堂 通用配置"); + add("mystias_izakaya.configuration.max_overturn.tooltip", "要存储的最大流水次数"); + add("mystias_izakaya.configuration.tele_cooldown.tooltip", "电话的冷却时间(刻)"); + add("mystias_izakaya.configuration.debug.tooltip", "设置为true以启用调试信息"); + add("mystias_izakaya.configuration.section.mystias.izakaya.client.toml","客户端配置"); + add("mystias_izakaya.configuration.section.mystias.izakaya.client.toml.title", "夜雀食堂 客户端配置"); } } diff --git a/src/main/java/org/hiedacamellia/mystiasizakaya/core/data/lang/EnglishLanguageProvider.java b/src/main/java/org/hiedacamellia/mystiasizakaya/core/data/lang/EnglishLanguageProvider.java index 85fd88a1..52608eb8 100644 --- a/src/main/java/org/hiedacamellia/mystiasizakaya/core/data/lang/EnglishLanguageProvider.java +++ b/src/main/java/org/hiedacamellia/mystiasizakaya/core/data/lang/EnglishLanguageProvider.java @@ -726,7 +726,22 @@ protected void addTranslations() { add("item.mystias_izakaya.ledger", "Ledger"); add("tooltip.mystias_izakaya.ledger","You can use this item overview your turnover§nRight click table to bound tables§nRight click Item Frame to bound Menu"); add("block.mystias_izakaya.telephone", "Telephone"); - add("tooltip.mystias_izakaya.telephone","You can use this item to buy any things you want"); + add("tooltip.mystias_izakaya.telephone", "You can use this item to buy any things you want"); + + add("mystias_izakaya.configuration.debug", "Debug Mode"); + add("mystias_izakaya.configuration.max_overturn", "Maximum Overturn"); + add("mystias_izakaya.configuration.show_balance", "Show Balance"); + add("mystias_izakaya.configuration.tele_cooldown", "Telephone Cooldown"); + add("mystias_izakaya.configuration.section.mystias.izakaya.common.toml", "Common Configuration"); + add("mystias_izakaya.configuration.show_balance.tooltip", "Set to true to display balance in the HUD"); + add("mystias_izakaya.configuration.title", "Mystia's Izakaya Configuration"); + add("mystias_izakaya.configuration.section.mystias.izakaya.common.toml.title", "Mystia's Izakaya Common Configuration"); + add("mystias_izakaya.configuration.max_overturn.tooltip", "The maximum number of turnovers to store"); + add("mystias_izakaya.configuration.tele_cooldown.tooltip", "The cooldown time for the telephone(tick)"); + add("mystias_izakaya.configuration.debug.tooltip", "Set to true to enable debug info"); + add("mystias_izakaya.configuration.section.mystias.izakaya.client.toml","Client Configuration"); + add("mystias_izakaya.configuration.section.mystias.izakaya.client.toml.title", "Mysita's Izakaya Client Configuration"); + } } diff --git a/src/main/java/org/hiedacamellia/mystiasizakaya/core/debug/Debug.java b/src/main/java/org/hiedacamellia/mystiasizakaya/core/debug/Debug.java index a272ea67..8931ae72 100644 --- a/src/main/java/org/hiedacamellia/mystiasizakaya/core/debug/Debug.java +++ b/src/main/java/org/hiedacamellia/mystiasizakaya/core/debug/Debug.java @@ -6,7 +6,7 @@ import net.minecraft.world.entity.player.Player; import net.minecraft.world.level.Level; import net.neoforged.fml.loading.FMLEnvironment; -import org.hiedacamellia.mystiasizakaya.Config; +import org.hiedacamellia.mystiasizakaya.core.config.CommonConfig; import org.hiedacamellia.mystiasizakaya.MystiasIzakaya; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -14,7 +14,7 @@ public class Debug { private static String prefix = "[§a夜雀食堂§r]"; - private static Boolean debugConfig = Config.debug; + private static Boolean debugConfig = CommonConfig.DEBUG.get(); private static Logger logger = LoggerFactory.getLogger(MystiasIzakaya.MODID); public static Logger getLogger(){ diff --git a/src/main/java/org/hiedacamellia/mystiasizakaya/core/event/MIEvent.java b/src/main/java/org/hiedacamellia/mystiasizakaya/core/event/MIEvent.java index af75e907..99b03b62 100644 --- a/src/main/java/org/hiedacamellia/mystiasizakaya/core/event/MIEvent.java +++ b/src/main/java/org/hiedacamellia/mystiasizakaya/core/event/MIEvent.java @@ -1,15 +1,11 @@ package org.hiedacamellia.mystiasizakaya.core.event; -import net.neoforged.bus.api.SubscribeEvent; -import net.neoforged.fml.common.EventBusSubscriber; import net.neoforged.fml.event.lifecycle.FMLCommonSetupEvent; import org.hiedacamellia.mystiasizakaya.core.debug.Debug; -@EventBusSubscriber public class MIEvent { - @SubscribeEvent public static void onCommonSetup(final FMLCommonSetupEvent event) { Debug.getLogger().debug("Ciallo~(∠・ω< )⌒★"); } diff --git a/src/main/java/org/hiedacamellia/mystiasizakaya/core/network/TelephoneUiButton.java b/src/main/java/org/hiedacamellia/mystiasizakaya/core/network/TelephoneUiButton.java index 3ba78495..46bbdc41 100644 --- a/src/main/java/org/hiedacamellia/mystiasizakaya/core/network/TelephoneUiButton.java +++ b/src/main/java/org/hiedacamellia/mystiasizakaya/core/network/TelephoneUiButton.java @@ -17,7 +17,7 @@ import net.neoforged.neoforge.items.ItemHandlerHelper; import net.neoforged.neoforge.network.PacketDistributor; import net.neoforged.neoforge.network.handling.IPayloadContext; -import org.hiedacamellia.mystiasizakaya.Config; +import org.hiedacamellia.mystiasizakaya.core.config.CommonConfig; import org.hiedacamellia.mystiasizakaya.MystiasIzakaya; import org.hiedacamellia.mystiasizakaya.core.codec.record.MIBalance; import org.hiedacamellia.mystiasizakaya.core.codec.record.MICost; @@ -79,7 +79,7 @@ public static void handleButtonAction(Player entity, BlockPos pos, List