Strip control codes in progress bar messages. They cause crashes sometimes.
This commit is contained in:
parent
686db5e5eb
commit
3bbf5c04a6
|
@ -58,6 +58,7 @@ import net.minecraft.network.NetworkManager;
|
|||
import net.minecraft.network.ServerStatusResponse;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.StringUtils;
|
||||
import net.minecraft.world.WorldSettings;
|
||||
import net.minecraft.world.storage.SaveFormatOld;
|
||||
|
||||
|
@ -1010,4 +1011,10 @@ public class FMLClientHandler implements IFMLSidedHandler
|
|||
Display.processMessages();
|
||||
SplashProgress.mutex.release();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String stripSpecialChars(String message)
|
||||
{
|
||||
return StringUtils.stripControlCodes(message);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -632,4 +632,9 @@ public class FMLCommonHandler
|
|||
Runtime.getRuntime().exit(exitCode);
|
||||
}
|
||||
}
|
||||
|
||||
public String stripSpecialChars(String message)
|
||||
{
|
||||
return sidedDelegate != null ? sidedDelegate.stripSpecialChars(message) : message;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -63,4 +63,6 @@ public interface IFMLSidedHandler
|
|||
void allowLogins();
|
||||
|
||||
void processWindowMessages();
|
||||
|
||||
String stripSpecialChars(String message);
|
||||
}
|
||||
|
|
|
@ -71,7 +71,7 @@ public class ProgressManager
|
|||
{
|
||||
if(step >= steps) throw new IllegalStateException("too much steps for ProgressBar " + title);
|
||||
step++;
|
||||
this.message = message;
|
||||
this.message = FMLCommonHandler.instance().stripSpecialChars(message);
|
||||
FMLCommonHandler.instance().processWindowMessages();
|
||||
}
|
||||
|
||||
|
|
|
@ -259,7 +259,7 @@ public class FMLServerHandler implements IFMLSidedHandler
|
|||
{
|
||||
return DedicatedServer.allowPlayerLogins;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void allowLogins() {
|
||||
DedicatedServer.allowPlayerLogins = true;
|
||||
|
@ -270,4 +270,10 @@ public class FMLServerHandler implements IFMLSidedHandler
|
|||
{
|
||||
// NOOP
|
||||
}
|
||||
|
||||
@Override
|
||||
public String stripSpecialChars(String message)
|
||||
{
|
||||
return message;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue