-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from Maxwell-lt/v1.1.0
V1.1.0
- Loading branch information
Showing
8 changed files
with
96 additions
and
37 deletions.
There are no files selected for viewing
This file contains 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
Binary file not shown.
This file contains 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,16 +1,17 @@ | ||
package maxwell_lt.titlechanger; | ||
|
||
import org.lwjgl.opengl.Display; | ||
|
||
import net.minecraftforge.common.MinecraftForge; | ||
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; | ||
|
||
public class ClientProxy extends CommonProxy { | ||
|
||
@Override | ||
public void preInit(FMLPreInitializationEvent e) { | ||
super.preInit(e); | ||
|
||
if (Config.windowTitle != "") Display.setTitle(Config.windowTitle); | ||
|
||
MinecraftForge.EVENT_BUS.register(new ReplaceTitle()); | ||
|
||
ReplaceTitle.Replace(); | ||
} | ||
|
||
} |
This file contains 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
This file contains 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,36 @@ | ||
package maxwell_lt.titlechanger; | ||
|
||
import net.minecraftforge.fml.common.Loader; | ||
import net.minecraftforge.fml.common.eventhandler.EventPriority; | ||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; | ||
import net.minecraftforge.fml.common.gameevent.TickEvent; | ||
import org.lwjgl.opengl.Display; | ||
import java.text.SimpleDateFormat; | ||
import java.util.Date; | ||
|
||
|
||
public class ReplaceTitle { | ||
|
||
@SubscribeEvent(priority = EventPriority.LOWEST) | ||
public void clientTick(TickEvent.ClientTickEvent e) { | ||
Replace(); | ||
} | ||
|
||
public static void Replace() { | ||
if (Config.windowTitle != "") { | ||
Display.setTitle(processText(Config.windowTitle)); | ||
} | ||
} | ||
|
||
public static String processText(String formatString) { | ||
String mcVersion = Loader.instance().getMinecraftModContainer().getVersion(); | ||
String modCount = Integer.toString(Loader.instance().getModList().size()); | ||
String time = new SimpleDateFormat(Config.timeFormat).format(new Date()).toString(); | ||
|
||
formatString = formatString.replaceAll("%mcver%", mcVersion); | ||
formatString = formatString.replaceAll("%modcount%", modCount); | ||
formatString = formatString.replaceAll("%time%", time); | ||
|
||
return formatString; | ||
} | ||
} |
This file contains 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
This file contains 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,16 +1,16 @@ | ||
[ | ||
{ | ||
"modid": "titlechanger", | ||
"name": "Title Changer", | ||
"description": "Changes the Minecraft window title.", | ||
"version": "1.0", | ||
"mcversion": "1.11.2", | ||
"url": "https://github.com/Maxwell-lt/TitleChanger", | ||
"updateJson": "https://raw.githubusercontent.com/Maxwell-lt/TitleChanger/master/update.json", | ||
"authorList": ["maxwell-lt"], | ||
"credits": "", | ||
"logoFile": "", | ||
"screenshots": [], | ||
"dependencies": [] | ||
} | ||
] | ||
{ | ||
"modid": "${modid}", | ||
"name": "${name}", | ||
"description": "${description}", | ||
"version": "${version}", | ||
"mcversion": "1.11.2", | ||
"url": "${url}", | ||
"updateUrl": "${updatejson}", | ||
"authorList": ["${authors}"], | ||
"credits": "", | ||
"logoFile": "", | ||
"screenshots": [], | ||
"dependencies": [] | ||
} | ||
] |
This file contains 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,13 +1,15 @@ | ||
{ | ||
"homepage": "https://github.com/Maxwell-lt/TitleChanger/", | ||
"1.10.2": { | ||
"1.1.0": "Added runtime replacements", | ||
"1.0": "First version" | ||
}, | ||
"1.11.2": { | ||
"1.1.0": "Added runtime replacements", | ||
"1.0": "First version" | ||
}, | ||
"promos": { | ||
"1.10.2-latest": "1.0", | ||
"1.11.2-latest": "1.0" | ||
"1.10.2-latest": "1.1.0", | ||
"1.11.2-latest": "1.1.0" | ||
} | ||
} |