mirror of
https://github.com/GTNewHorizons/CodeChickenCore.git
synced 2026-11-22 13:19:39 +00:00
Workaround for colouring supporters list with ANSI encoding
This commit is contained in:
1 parent
d25ba4df04
commit
aa4e9bc160
4 files changed
+18
-14
No files matched your search
@@ -1,4 +1,4 @@
|
|||||||
[
|
[
|
||||||
{
|
{
|
||||||
"modid": "CodeChickenCore",
|
"modid": "CodeChickenCore",
|
||||||
"name": "CodeChicken Core",
|
"name": "CodeChicken Core",
|
||||||
|
|||||||
@@ -2,6 +2,8 @@ package codechicken.core;
|
|||||||
|
|
||||||
import codechicken.core.internal.CCCEventHandler;
|
import codechicken.core.internal.CCCEventHandler;
|
||||||
|
|
||||||
|
import cpw.mods.fml.common.FMLCommonHandler;
|
||||||
|
import cpw.mods.fml.common.ModContainer;
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
@@ -9,6 +11,7 @@ import net.minecraft.client.Minecraft;
|
|||||||
import net.minecraft.client.gui.GuiScreen;
|
import net.minecraft.client.gui.GuiScreen;
|
||||||
import net.minecraft.network.NetworkManager;
|
import net.minecraft.network.NetworkManager;
|
||||||
import net.minecraft.server.MinecraftServer;
|
import net.minecraft.server.MinecraftServer;
|
||||||
|
import net.minecraft.util.EnumChatFormatting;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
public class ClientUtils extends CommonUtils
|
public class ClientUtils extends CommonUtils
|
||||||
@@ -57,4 +60,10 @@ public class ClientUtils extends CommonUtils
|
|||||||
public static String getWorldSaveName() {
|
public static String getWorldSaveName() {
|
||||||
return mc().isSingleplayer() ? MinecraftServer.getServer().getFolderName() : null;
|
return mc().isSingleplayer() ? MinecraftServer.getServer().getFolderName() : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void enhanceSupportersList(Object mod) {
|
||||||
|
ModContainer mc = FMLCommonHandler.instance().findContainerFor(mod);
|
||||||
|
mc.getMetadata().description = mc.getMetadata().description.replace("Supporters:", EnumChatFormatting.AQUA+"Supporters:");
|
||||||
|
GuiModListScroll.register(mod);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -4,6 +4,8 @@ import java.io.File;
|
|||||||
|
|
||||||
import cpw.mods.fml.common.FMLCommonHandler;
|
import cpw.mods.fml.common.FMLCommonHandler;
|
||||||
import cpw.mods.fml.relauncher.FMLInjectionData;
|
import cpw.mods.fml.relauncher.FMLInjectionData;
|
||||||
|
import net.minecraft.entity.Entity;
|
||||||
|
import net.minecraft.entity.EntityList;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraftforge.common.DimensionManager;
|
import net.minecraftforge.common.DimensionManager;
|
||||||
|
|
||||||
@@ -39,4 +41,10 @@ public class CommonUtils
|
|||||||
|
|
||||||
return child.getPath().substring(parent.getPath().length() + 1);
|
return child.getPath().substring(parent.getPath().length() + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void registerHandledEntity(Class<? extends Entity> entityClass, String identifier)
|
||||||
|
{
|
||||||
|
EntityList.classToStringMapping.put(entityClass, identifier);
|
||||||
|
EntityList.stringToClassMapping.put(identifier, entityClass);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
package codechicken.core;
|
|
||||||
|
|
||||||
import net.minecraft.entity.Entity;
|
|
||||||
import net.minecraft.entity.EntityList;
|
|
||||||
|
|
||||||
public class RegistrationHelper
|
|
||||||
{
|
|
||||||
public static void registerHandledEntity(Class<? extends Entity> entityClass, String identifier)
|
|
||||||
{
|
|
||||||
EntityList.classToStringMapping.put(entityClass, identifier);
|
|
||||||
EntityList.stringToClassMapping.put(identifier, entityClass);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Reference in new issue
Block a user