hpfxd / PandaSpigot

Fork of Paper for 1.8.8 focused on improved performance and stability.
GNU General Public License v3.0
238 stars 65 forks source link

Container.getSlot(Container.java:109). #144

Closed HanielCota closed 11 months ago

HanielCota commented 1 year ago

I just caught click with button that defends in minecraft

[20:47:30 FATAL]: Error executing task java.util.concurrent.ExecutionException: java.lang.IndexOutOfBoundsException: Index: 49, Size: 45 at java.util.concurrent.FutureTask.report(FutureTask.java:122) ~[?:1.8.0_312] at java.util.concurrent.FutureTask.get(FutureTask.java:192) ~[?:1.8.0_312] at net.minecraft.server.v1_8_R3.SystemUtils.a(SystemUtils.java:12) ~[patched_1.8.8.jar:git-PandaSpigot-"098345f"] at net.minecraft.server.v1_8_R3.MinecraftServer.B(MinecraftServer.java:881) ~[patched_1.8.8.jar:git-PandaSpigot-"098345f"] at net.minecraft.server.v1_8_R3.DedicatedServer.B(DedicatedServer.java:412) ~[patched_1.8.8.jar:git-PandaSpigot-"098345f"] at net.minecraft.server.v1_8_R3.MinecraftServer.A(MinecraftServer.java:815) ~[patched_1.8.8.jar:git-PandaSpigot-"098345f"] at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:648) ~[patched_1.8.8.jar:git-PandaSpigot-"098345f"] at net.minecraft.server.v1_8_R3.MinecraftServer.lambda$spin$0(MinecraftServer.java:133) ~[patched_1.8.8.jar:git-PandaSpigot-"098345f"] at java.lang.Thread.run(Thread.java:748) [?:1.8.0_312] Caused by: java.lang.IndexOutOfBoundsException: Index: 49, Size: 45 at java.util.ArrayList.rangeCheck(ArrayList.java:659) ~[?:1.8.0_312] at java.util.ArrayList.get(ArrayList.java:435) ~[?:1.8.0_312] at net.minecraft.server.v1_8_R3.Container.getSlot(Container.java:109) ~[patched_1.8.8.jar:git-PandaSpigot-"098345f"] at net.minecraft.server.v1_8_R3.PlayerConnection.a(PlayerConnection.java:1732) ~[patched_1.8.8.jar:git-PandaSpigot-"098345f"] at net.minecraft.server.v1_8_R3.PacketPlayInWindowClick.a(PacketPlayInWindowClick.java:17) ~[patched_1.8.8.jar:git-PandaSpigot-"098345f"] at net.minecraft.server.v1_8_R3.PacketPlayInWindowClick.a(PacketPlayInWindowClick.java:5) ~[patched_1.8.8.jar:git-PandaSpigot-"098345f"] at net.minecraft.server.v1_8_R3.PlayerConnectionUtils$1.run(PlayerConnectionUtils.java:9) ~[patched_1.8.8.jar:git-PandaSpigot-"098345f"] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) ~[?:1.8.0_312] at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[?:1.8.0_312] at net.minecraft.server.v1_8_R3.SystemUtils.a(SystemUtils.java:11) ~[patched_1.8.8.jar:git-PandaSpigot-"098345f"]

andreasdc commented 1 year ago

By the way it could be optimized image

HanielCota commented 1 year ago

By the way it could be optimized imagem

Where is this print from?

andreasdc commented 1 year ago

Spark

HanielCota commented 1 year ago

Ward

HanielCota commented 1 year ago

Fix?

andreasdc commented 1 year ago

Way to reproduce?

jose27iwnl commented 1 year ago

Can u please provide the code And a full log?

HanielCota commented 1 year ago

I had made the fix and sent it to Ryan but he didn't put it here...

andreasdc commented 1 year ago

What fix?

HanielCota commented 1 year ago

// PandaSpigot start - Fix IndexOutOfBoundsException from Container

public Slot getSlot(int i) {
    if (i >= 0 && i < this.c.size()) {
        return (Slot) this.c.get(i);
    }
    return null;
}
// PandaSpigot end

public ItemStack b(EntityHuman entityhuman, int i) {
    Slot slot = (Slot) this.c.get(i);

    return slot != null ? slot.getItem() : null;
}

Line 109

net.minecraft

andreasdc commented 1 year ago

Ok but how did you get this error?

jose27iwnl commented 1 year ago

I had made the fix and sent it to Ryan but he didn't put it here...

Can you provide the code u used when it gave you the error?

HanielCota commented 1 year ago

It was vanilla and just opened a chest in the game

andreasdc commented 1 year ago

It was vanilla and just opened a chest in the game

How to reproduce it?

HanielCota commented 1 year ago

As I said, I just downloaded the last jar and went to start developing things for version 1.8, but then I had to create a design, so I took items from the creative and put them in the trunk so I could have an idea of ​​how the menu would be made, apart from that it was all vanilla and there was no code it was 0 plugins

uRyanxD commented 11 months ago

Closing this issue due to being unable to reproduce and no other cases reported.