This repository was archived by the owner on Oct 1, 2025. It is now read-only.
forked from mrTeroblaze/GTItemUntranslator
-
Notifications
You must be signed in to change notification settings - Fork 0
Removing libs, adding dependencies, client language check and commets translation to English #1
Open
mrTeroblaze
wants to merge
58
commits into
master
Choose a base branch
from
feature/remove-libs-deps-lang-check-comms-translate
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
58 commits
Select commit
Hold shift + click to select a range
f393090
bump 0.2.0
mrTeroblaze 2624a1b
test build 0.2.1-test
mrTeroblaze d50b67e
test build 0.2.2-test
mrTeroblaze c43503b
test build 0.2.3-test
mrTeroblaze 182092a
test build 0.2.4-test
mrTeroblaze c336ced
test build 0.2.5-test
mrTeroblaze 40388a7
bump 0.3.0
mrTeroblaze 1d331cd
test build 0.3.1-test
mrTeroblaze 164c8ae
test build 0.3.2-test
mrTeroblaze 809833c
test build 0.3.3-test
mrTeroblaze 8452143
test build 0.3.4-test
mrTeroblaze 2a42c7d
test build 0.3.5-test
mrTeroblaze a36eb2d
test build 0.3.6-test
mrTeroblaze 403e368
test build 0.3.7-test
mrTeroblaze cb6981d
test build 0.3.8-test
mrTeroblaze a655143
test build 0.3.9-test
mrTeroblaze 3260a14
test build 0.3.10-test
mrTeroblaze 7e6f042
test build 0.3.11-test
mrTeroblaze 3dbc18a
test build 0.3.12-test
mrTeroblaze 04478ee
test build 0.3.13-test
mrTeroblaze 239d2d2
test build 0.3.14-test
mrTeroblaze c74c717
test build 0.3.15-test
mrTeroblaze e50a3d2
test build 0.3.16-test
mrTeroblaze a41492a
test build 0.3.17-test
mrTeroblaze 9092644
test build 0.3.18-test
mrTeroblaze 376c06c
test build 0.3.19-test
mrTeroblaze 3834ac2
test build 0.3.20-test
mrTeroblaze f1a7cda
test build 0.3.21-test
mrTeroblaze 3dac090
test build 0.3.22-test
mrTeroblaze 3d8aa59
test build 0.3.23-test
mrTeroblaze 02285fa
test build 0.3.24-test
mrTeroblaze 0928751
test build 0.3.25-test
mrTeroblaze 9f69e79
test build 0.3.26-test
mrTeroblaze acc9df3
test build 0.3.27-test
mrTeroblaze e96dbe7
test build 0.3.28-test
mrTeroblaze b1e6eee
test build 0.3.29-test
mrTeroblaze 7975486
test build 0.3.30-test
mrTeroblaze ac7328e
test build 0.3.31-test
mrTeroblaze 720304d
test build 0.3.32-test
mrTeroblaze e5a86ef
test build 0.3.33-test
mrTeroblaze 2d437eb
test build 0.3.34-test
mrTeroblaze 38345e7
test build 0.3.35-test
mrTeroblaze 8dd546c
test build 0.3.36-test
mrTeroblaze d7b7f53
test build 0.3.37-test
mrTeroblaze f51c501
test build 0.3.38-test
mrTeroblaze 835b93f
test build 0.3.39-test
mrTeroblaze b834d38
test build 0.3.40-test
mrTeroblaze 3fb6c82
test build 0.3.41-test
mrTeroblaze 8c6410d
test build 0.3.42-test
mrTeroblaze 893c106
test build 0.3.43-test
mrTeroblaze d582fb9
test build 0.3.44-test
mrTeroblaze bdbf314
test build 0.3.45-test
mrTeroblaze 1252071
test build 0.3.46-test
mrTeroblaze f58b108
test build 0.3.47-test
mrTeroblaze d068044
test build 0.3.48-test
mrTeroblaze 1034982
bump 0.4.0
mrTeroblaze 77cac23
removed libs and added them in dependencies, added client language check
mrTeroblaze 30083af
Merge branch 'master' into feature/remove-libs-deps-lang-check-comms-…
sisyphussy File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 0 additions & 40 deletions
40
src/main/java/com/teroblaze/gtitemuntranslator/CommandGTIP.java
This file was deleted.
Oops, something went wrong.
46 changes: 46 additions & 0 deletions
46
src/main/java/com/teroblaze/gtitemuntranslator/CommandTIPP.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| package com.teroblaze.gtitemuntranslator; | ||
|
|
||
| import net.minecraft.command.CommandBase; | ||
| import net.minecraft.command.ICommandSender; | ||
| import net.minecraft.util.ChatComponentText; | ||
|
|
||
| public class CommandTIPP extends CommandBase { | ||
|
|
||
| @Override | ||
| public String getCommandName() { | ||
| return "tipp"; | ||
| } | ||
|
|
||
| @Override | ||
| public String getCommandUsage(ICommandSender sender) { | ||
| return "/tipp <on|off>"; | ||
| } | ||
|
|
||
| @Override | ||
| public void processCommand(ICommandSender sender, String[] args) { | ||
| if (args.length != 1) { | ||
| sender.addChatMessage(new ChatComponentText("Usage: " + getCommandUsage(sender))); | ||
| return; | ||
| } | ||
| if ("on".equalsIgnoreCase(args[0])) { | ||
| GTItemUntranslator.tooltipsEnabled = true; | ||
| GTItemUntranslator.config.get("general", "tooltipsEnabled", true) | ||
| .set(GTItemUntranslator.tooltipsEnabled); | ||
| GTItemUntranslator.config.save(); | ||
| sender.addChatMessage(new ChatComponentText("GT Original tooltip names: ON")); | ||
| } else if ("off".equalsIgnoreCase(args[0])) { | ||
| GTItemUntranslator.tooltipsEnabled = false; | ||
| GTItemUntranslator.config.get("general", "tooltipsEnabled", true) | ||
| .set(GTItemUntranslator.tooltipsEnabled); | ||
| GTItemUntranslator.config.save(); | ||
| sender.addChatMessage(new ChatComponentText("GT Original tooltip names: OFF")); | ||
| } else { | ||
| sender.addChatMessage(new ChatComponentText("Usage: " + getCommandUsage(sender))); | ||
| } | ||
| } | ||
|
|
||
| @Override | ||
| public int getRequiredPermissionLevel() { | ||
| return 0; | ||
| } | ||
| } |
46 changes: 46 additions & 0 deletions
46
src/main/java/com/teroblaze/gtitemuntranslator/CommandWTIPP.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| package com.teroblaze.gtitemuntranslator; | ||
|
|
||
| import net.minecraft.command.CommandBase; | ||
| import net.minecraft.command.ICommandSender; | ||
| import net.minecraft.util.ChatComponentText; | ||
|
|
||
| public class CommandWTIPP extends CommandBase { | ||
|
|
||
| @Override | ||
| public String getCommandName() { | ||
| return "wtipp"; | ||
| } | ||
|
|
||
| @Override | ||
| public String getCommandUsage(ICommandSender sender) { | ||
| return "/wtipp <on|off>"; | ||
| } | ||
|
|
||
| @Override | ||
| public void processCommand(ICommandSender sender, String[] args) { | ||
| if (args.length != 1) { | ||
| sender.addChatMessage(new ChatComponentText("Usage: " + getCommandUsage(sender))); | ||
| return; | ||
| } | ||
| if ("on".equalsIgnoreCase(args[0])) { | ||
| GTItemUntranslator.wailaEnabled = true; | ||
| GTItemUntranslator.config.get("general", "wailaEnabled", true) | ||
| .set(GTItemUntranslator.wailaEnabled); | ||
| GTItemUntranslator.config.save(); | ||
| sender.addChatMessage(new ChatComponentText("GT Waila original names: ON")); | ||
| } else if ("off".equalsIgnoreCase(args[0])) { | ||
| GTItemUntranslator.wailaEnabled = false; | ||
| GTItemUntranslator.config.get("general", "wailaEnabled", true) | ||
| .set(GTItemUntranslator.wailaEnabled); | ||
| GTItemUntranslator.config.save(); | ||
| sender.addChatMessage(new ChatComponentText("GT Waila original names: OFF")); | ||
| } else { | ||
| sender.addChatMessage(new ChatComponentText("Usage: " + getCommandUsage(sender))); | ||
| } | ||
| } | ||
|
|
||
| @Override | ||
| public int getRequiredPermissionLevel() { | ||
| return 0; | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,12 +1,16 @@ | ||
| package com.teroblaze.gtitemuntranslator; | ||
|
|
||
| import java.io.File; | ||
|
|
||
| import net.minecraft.command.ICommandManager; | ||
| import net.minecraft.command.ServerCommandManager; | ||
| import net.minecraft.server.MinecraftServer; | ||
| import net.minecraftforge.common.MinecraftForge; | ||
| import net.minecraftforge.common.config.Configuration; | ||
|
|
||
| import cpw.mods.fml.common.Mod; | ||
| import cpw.mods.fml.common.event.FMLInitializationEvent; | ||
| import cpw.mods.fml.common.event.FMLInterModComms; | ||
| import cpw.mods.fml.common.event.FMLPostInitializationEvent; | ||
| import cpw.mods.fml.common.event.FMLPreInitializationEvent; | ||
| import cpw.mods.fml.common.event.FMLServerStartedEvent; | ||
|
|
@@ -16,29 +20,60 @@ | |
| modid = GTItemUntranslator.MODID, | ||
| name = GTItemUntranslator.NAME, | ||
| version = GTItemUntranslator.VERSION, | ||
| dependencies = "required-after:gregtech", | ||
| dependencies = "required-after:gregtech;after:Waila", | ||
| acceptedMinecraftVersions = "[1.7.10]") | ||
| public class GTItemUntranslator { | ||
|
|
||
| public static final String MODID = "gtitemuntranslator"; | ||
| public static final String NAME = "GT Item Untranslator"; | ||
| public static final String VERSION = "1.0.0"; | ||
|
|
||
| /** Global flags for enabling/disabling features */ | ||
| public static boolean tooltipsEnabled = true; | ||
| public static boolean wailaEnabled = true; | ||
|
|
||
| /** Forge configuration handler */ | ||
| public static Configuration config; | ||
|
|
||
| @Mod.Instance(MODID) | ||
| public static GTItemUntranslator INSTANCE; | ||
|
|
||
| @Mod.EventHandler | ||
| public void preInit(FMLPreInitializationEvent event) { | ||
| System.out.println("[" + NAME + "] PRE-INIT started."); | ||
|
|
||
| // Load Forge config | ||
| File configFile = event.getSuggestedConfigurationFile(); | ||
| config = new Configuration(configFile); | ||
| config.load(); | ||
|
|
||
| // Read feature toggles from config | ||
| tooltipsEnabled = config | ||
| .getBoolean("tooltipsEnabled", Configuration.CATEGORY_GENERAL, true, "Show English tooltips in inventory"); | ||
| wailaEnabled = config | ||
| .getBoolean("wailaEnabled", Configuration.CATEGORY_GENERAL, true, "Show English tooltips in Waila"); | ||
|
|
||
| // Initialize language store | ||
| OriginalLanguageStore.init(); | ||
| System.out.println("[" + NAME + "] PRE-INIT completed."); | ||
| } | ||
|
|
||
| @Mod.EventHandler | ||
| public void init(FMLInitializationEvent event) { | ||
| System.out.println("[" + NAME + "] INIT started. Registering event handlers."); | ||
|
|
||
| // Register tooltip handler for inventory tooltips | ||
| MinecraftForge.EVENT_BUS.register(new TooltipEventHandler()); | ||
| System.out.println("[" + NAME + "] Event handlers registered."); | ||
|
|
||
| // Register Waila integration if Waila is installed | ||
| try { | ||
| FMLInterModComms | ||
| .sendMessage("Waila", "register", "com.teroblaze.gtitemuntranslator.waila.WailaRegister.register"); | ||
| System.out.println("[" + NAME + "] Waila integration registered."); | ||
| } catch (Throwable t) { | ||
| System.err.println("[" + NAME + "] Waila not found or integration failed."); | ||
| } | ||
| } | ||
|
|
||
| @Mod.EventHandler | ||
|
|
@@ -48,14 +83,18 @@ public void postInit(FMLPostInitializationEvent event) { | |
|
|
||
| @Mod.EventHandler | ||
| public void onServerStarted(FMLServerStartedEvent event) { | ||
| System.out.println("[" + NAME + "] Server started. Registering /gtip command."); | ||
| System.out.println("[" + NAME + "] Server started. Registering commands."); | ||
|
|
||
| // Register commands for toggling features | ||
| MinecraftServer server = MinecraftServer.getServer(); | ||
| ICommandManager commandManager = server.getCommandManager(); | ||
| if (commandManager instanceof ServerCommandManager) { | ||
| ((ServerCommandManager) commandManager).registerCommand(new CommandGTIP()); | ||
| System.out.println("[" + NAME + "] /gtip command registered."); | ||
| ((ServerCommandManager) commandManager).registerCommand(new CommandTIPP()); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Commands should be registered in |
||
| ((ServerCommandManager) commandManager).registerCommand(new CommandWTIPP()); | ||
| System.out.println("[" + NAME + "] /tipp and /wtipp commands registered."); | ||
| } | ||
|
|
||
| // Ensure language store is initialized | ||
| if (!OriginalLanguageStore.isInitialized()) { | ||
| System.err.println("[" + NAME + "] ERROR: Language store failed to initialize!"); | ||
| OriginalLanguageStore.init(); | ||
|
|
@@ -64,7 +103,16 @@ public void onServerStarted(FMLServerStartedEvent event) { | |
|
|
||
| @Mod.EventHandler | ||
| public void onServerStopped(FMLServerStoppedEvent event) { | ||
| System.out.println("[" + NAME + "] Server stopped. Unloading language store."); | ||
| System.out.println("[" + NAME + "] Server stopped. Saving config and unloading language store."); | ||
|
|
||
| // Save current feature toggles to config | ||
| config.get(Configuration.CATEGORY_GENERAL, "tooltipsEnabled", tooltipsEnabled) | ||
| .set(tooltipsEnabled); | ||
| config.get(Configuration.CATEGORY_GENERAL, "wailaEnabled", wailaEnabled) | ||
| .set(wailaEnabled); | ||
| config.save(); | ||
|
|
||
| // Cleanup language store | ||
| OriginalLanguageStore.unload(); | ||
| System.out.println("[" + NAME + "] Cleanup finished."); | ||
| } | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
consider using loggers