Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crashes if the emote spam hits it just right in the good spot #29

Closed
ZeekDaGeek opened this issue Jan 8, 2017 · 2 comments
Closed

Crashes if the emote spam hits it just right in the good spot #29

ZeekDaGeek opened this issue Jan 8, 2017 · 2 comments
Labels
bug Something isn't working as expected

Comments

@ZeekDaGeek
Copy link

"It would totally be fine in 1.10" she said. "The problem is that you're using 1.7.10" she said. LIES LIES AND PROPAGANDA! IT CRASHES!

java.lang.StringIndexOutOfBoundsException: String index out of range: 84
	at java.lang.String.substring(String.java:1950)
	at net.blay09.mods.bmc.handler.RenderHandler.onDrawChatMessagePost(RenderHandler.java:81)
	at net.minecraftforge.fml.common.eventhandler.ASMEventHandler_117_RenderHandler_onDrawChatMessagePost_Post.invoke(.dynamic)
	at net.minecraftforge.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:90)
	at net.minecraftforge.fml.common.eventhandler.EventBus.post(EventBus.java:185)
	at net.blay09.mods.bmc.coremod.CoremodHelper.drawChatMessagePost(CoremodHelper.java:29)
	at net.minecraft.client.gui.GuiNewChat.func_146230_a(SourceFile:97)
	at net.minecraftforge.client.GuiIngameForge.renderChat(GuiIngameForge.java:804)
	at net.minecraftforge.client.GuiIngameForge.func_175180_a(GuiIngameForge.java:197)
	at net.minecraft.client.renderer.EntityRenderer.func_181560_a(EntityRenderer.java:1072)
	at net.minecraft.client.Minecraft.func_71411_J(Minecraft.java:1076)
	at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:371)
	at net.minecraft.client.main.Main.main(SourceFile:124)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:483)
	at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
	at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
@ZeekDaGeek
Copy link
Author

IT CRASHED AGAIN YOU MONSTER! geekRage

@ZeekDaGeek
Copy link
Author

Psstt I think I see the problem:

https://github.com/blay09/BetterMinecraftChat/blob/1.10/src/main/java/net/blay09/mods/bmc/handler/RenderHandler.java#L80

Happens when substring defaults to text.length(). The length of the file is 1 higher then the possible indexes that substring can reference.

					int offset = Math.min(formattedText.length() - 1, image.getIndex() - thisOffset + (wrappedLinesBefore * 2) + 1);

@BlayTheNinth BlayTheNinth added bug Something isn't working as expected fixed in next version labels Jan 27, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working as expected
Projects
None yet
Development

No branches or pull requests

2 participants