Java 类net.minecraft.util.ChatComponentStyle 实例源码
项目:TextFormatting
文件:ColorData.java
public static IChatComponent removeCommandComponents( IChatComponent mainComp )
{
List siblings = getChatComponentSiblings( ( ChatComponentStyle ) mainComp );
for ( int i = 0; i < siblings.size(); ++i )
{
IChatComponent comp = ( IChatComponent ) siblings.get( i );
removeCommandComponents( comp );
}
if ( mainComp.getChatStyle().getChatClickEvent() != null )
{
mainComp.getChatStyle().setChatClickEvent( null );
}
return mainComp;
}
项目:TextFormatting
文件:ColorData.java
private static List getChatComponentSiblings( ChatComponentStyle comp )
{
String field = ObfuscatedField.fromMcp( "net/minecraft/util/ChatComponentStyle", "siblings" ).srgName;
return ( List ) ReflectionHelper.getPrivateValue( ChatComponentStyle.class, comp, field );
}
项目:TextFormatting
文件:SignGui.java
private static List getChatComponentSiblings( ChatComponentStyle comp )
{
String field = ObfuscatedField.fromMcp( "net/minecraft/util/ChatComponentStyle", "siblings" ).srgName;
return ( List ) ReflectionHelper.getPrivateValue( ChatComponentStyle.class, comp, field );
}