Skip to content
This repository was archived by the owner on Oct 1, 2025. It is now read-only.
Open
Show file tree
Hide file tree
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 Aug 20, 2025
2624a1b
test build 0.2.1-test
mrTeroblaze Aug 20, 2025
d50b67e
test build 0.2.2-test
mrTeroblaze Aug 20, 2025
c43503b
test build 0.2.3-test
mrTeroblaze Aug 20, 2025
182092a
test build 0.2.4-test
mrTeroblaze Aug 20, 2025
c336ced
test build 0.2.5-test
mrTeroblaze Aug 20, 2025
40388a7
bump 0.3.0
mrTeroblaze Aug 20, 2025
1d331cd
test build 0.3.1-test
mrTeroblaze Aug 22, 2025
164c8ae
test build 0.3.2-test
mrTeroblaze Aug 22, 2025
809833c
test build 0.3.3-test
mrTeroblaze Aug 23, 2025
8452143
test build 0.3.4-test
mrTeroblaze Aug 23, 2025
2a42c7d
test build 0.3.5-test
mrTeroblaze Aug 23, 2025
a36eb2d
test build 0.3.6-test
mrTeroblaze Aug 23, 2025
403e368
test build 0.3.7-test
mrTeroblaze Aug 23, 2025
cb6981d
test build 0.3.8-test
mrTeroblaze Aug 23, 2025
a655143
test build 0.3.9-test
mrTeroblaze Aug 23, 2025
3260a14
test build 0.3.10-test
mrTeroblaze Aug 23, 2025
7e6f042
test build 0.3.11-test
mrTeroblaze Aug 23, 2025
3dbc18a
test build 0.3.12-test
mrTeroblaze Aug 23, 2025
04478ee
test build 0.3.13-test
mrTeroblaze Aug 23, 2025
239d2d2
test build 0.3.14-test
mrTeroblaze Aug 23, 2025
c74c717
test build 0.3.15-test
mrTeroblaze Aug 24, 2025
e50a3d2
test build 0.3.16-test
mrTeroblaze Aug 24, 2025
a41492a
test build 0.3.17-test
mrTeroblaze Aug 24, 2025
9092644
test build 0.3.18-test
mrTeroblaze Aug 24, 2025
376c06c
test build 0.3.19-test
mrTeroblaze Aug 24, 2025
3834ac2
test build 0.3.20-test
mrTeroblaze Aug 24, 2025
f1a7cda
test build 0.3.21-test
mrTeroblaze Aug 24, 2025
3dac090
test build 0.3.22-test
mrTeroblaze Aug 24, 2025
3d8aa59
test build 0.3.23-test
mrTeroblaze Aug 24, 2025
02285fa
test build 0.3.24-test
mrTeroblaze Aug 24, 2025
0928751
test build 0.3.25-test
mrTeroblaze Aug 24, 2025
9f69e79
test build 0.3.26-test
mrTeroblaze Aug 24, 2025
acc9df3
test build 0.3.27-test
mrTeroblaze Aug 24, 2025
e96dbe7
test build 0.3.28-test
mrTeroblaze Aug 24, 2025
b1e6eee
test build 0.3.29-test
mrTeroblaze Aug 24, 2025
7975486
test build 0.3.30-test
mrTeroblaze Aug 24, 2025
ac7328e
test build 0.3.31-test
mrTeroblaze Aug 24, 2025
720304d
test build 0.3.32-test
mrTeroblaze Aug 24, 2025
e5a86ef
test build 0.3.33-test
mrTeroblaze Aug 24, 2025
2d437eb
test build 0.3.34-test
mrTeroblaze Aug 24, 2025
38345e7
test build 0.3.35-test
mrTeroblaze Aug 24, 2025
8dd546c
test build 0.3.36-test
mrTeroblaze Aug 24, 2025
d7b7f53
test build 0.3.37-test
mrTeroblaze Aug 24, 2025
f51c501
test build 0.3.38-test
mrTeroblaze Aug 24, 2025
835b93f
test build 0.3.39-test
mrTeroblaze Aug 24, 2025
b834d38
test build 0.3.40-test
mrTeroblaze Aug 24, 2025
3fb6c82
test build 0.3.41-test
mrTeroblaze Aug 24, 2025
8c6410d
test build 0.3.42-test
mrTeroblaze Aug 24, 2025
893c106
test build 0.3.43-test
mrTeroblaze Aug 24, 2025
d582fb9
test build 0.3.44-test
mrTeroblaze Aug 25, 2025
bdbf314
test build 0.3.45-test
mrTeroblaze Aug 25, 2025
1252071
test build 0.3.46-test
mrTeroblaze Aug 25, 2025
f58b108
test build 0.3.47-test
mrTeroblaze Aug 25, 2025
d068044
test build 0.3.48-test
mrTeroblaze Aug 25, 2025
1034982
bump 0.4.0
mrTeroblaze Aug 25, 2025
77cac23
removed libs and added them in dependencies, added client language check
mrTeroblaze Sep 4, 2025
30083af
Merge branch 'master' into feature/remove-libs-deps-lang-check-comms-…
sisyphussy Sep 5, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,6 @@
*/
dependencies {
//runtimeOnlyNonPublishable("com.github.GTNewHorizons:NotEnoughItems:2.7.69-GTNH:dev")
compile files("libs/gregtech-5.09.51.419.jar")
compileOnly('com.github.GTNewHorizons:GT5-Unofficial:5.09.51.443:dev') {transitive = false}
compileOnly('com.github.GTNewHorizons:waila:1.8.1:dev') {transitive = false}
}
40 changes: 0 additions & 40 deletions src/main/java/com/teroblaze/gtitemuntranslator/CommandGTIP.java

This file was deleted.

46 changes: 46 additions & 0 deletions src/main/java/com/teroblaze/gtitemuntranslator/CommandTIPP.java
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 src/main/java/com/teroblaze/gtitemuntranslator/CommandWTIPP.java
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;
}
}
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;
Expand All @@ -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.");
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

consider using loggers

} catch (Throwable t) {
System.err.println("[" + NAME + "] Waila not found or integration failed.");
}
}

@Mod.EventHandler
Expand All @@ -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());
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commands should be registered in FMLServerStartingEvent, using its #registerServerCommand(ICommand).

((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();
Expand All @@ -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.");
}
Expand Down
Loading