Inventory-Profiles icon indicating copy to clipboard operation
Inventory-Profiles copied to clipboard

Index out of bounds with open chest and profile switching

Open Remodor opened this issue 3 years ago • 1 comments

When switching the profile while looking in an open chest I get an index out of bounds exception. Tried it with different profiles. Happens most of the times. If more information is needed, let me know.

Thank you!

Unreported exception thrown!
java.lang.IndexOutOfBoundsException: Index 56 out of bounds for length 46
	at java.base/jdk.internal.util.Preconditions.outOfBounds(Preconditions.java:64)
	at java.base/jdk.internal.util.Preconditions.outOfBoundsCheckIndex(Preconditions.java:70)
	at java.base/jdk.internal.util.Preconditions.checkIndex(Preconditions.java:266)
	at java.base/java.util.Objects.checkIndex(Objects.java:359)
	at java.base/java.util.ArrayList.get(ArrayList.java:427)
	at net.minecraft.class_2371.get(class_2371.java:47)
	at org.anti_ad.mc.ipnext.event.ProfileSwitchHandler$ProfileMonitor.findAndSwap(Unknown Source)
	at org.anti_ad.mc.ipnext.event.ProfileSwitchHandler.applyProfile(Unknown Source)
	at org.anti_ad.mc.ipnext.event.ProfileSwitchHandler.onTickInGame(Unknown Source)
	at org.anti_ad.mc.ipnext.event.ClientEventHandler.onTickInGame(Unknown Source)
	at org.anti_ad.mc.ipnext.event.ClientEventHandler.onTick(Unknown Source)
	at net.minecraft.class_310.handler$zlo000$tick2(class_310.java)
	at net.minecraft.class_310.method_1574(class_310.java:1907)
	at net.minecraft.class_310.method_1523(class_310.java:1135)
	at net.minecraft.class_310.method_1514(class_310.java:768)
	at net.minecraft.client.main.Main.method_44604(Main.java:244)
	at net.minecraft.client.main.Main.main(Main.java:51)
	at net.fabricmc.loader.impl.game.minecraft.MinecraftGameProvider.launch(MinecraftGameProvider.java:461)
	at net.fabricmc.loader.impl.launch.knot.Knot.launch(Knot.java:74)
	at net.fabricmc.loader.impl.launch.knot.KnotClient.main(KnotClient.java:23)

Remodor avatar Nov 22 '22 01:11 Remodor

Well I've never tested it with opened chest but it makes lots of sense to be able to apply a profile from a chest.

But making it pickup items from chests will require substantial changes.....

I'll definitely fix the exception but I'm not sure it will start picking items from the opened chest.

blackd avatar Nov 22 '22 01:11 blackd