Jump to content

[SOLVED] Serve Packet Error


NovaViper

Recommended Posts

I'm testing my mod on the server on eclipse, when I open up the inventory of my entity and try to place items into the pet's inventory, this is the error I get:

[09:59:44] [server thread/WARN]: Failed to handle packet for /127.0.0.1:52049
java.lang.IndexOutOfBoundsException: Index: 48, Size: 45
at java.util.ArrayList.rangeCheck(Unknown Source) ~[?:1.7.0_67]
at java.util.ArrayList.get(Unknown Source) ~[?:1.7.0_67]
at net.minecraft.inventory.Container.slotClick(Container.java:300) ~[Container.class:?]
at net.minecraft.network.NetHandlerPlayServer.processClickWindow(NetHandlerPlayServer.java:955) ~[NetHandlerPlayServer.class:?]
at net.minecraft.network.play.client.C0EPacketClickWindow.processPacket(C0EPacketClickWindow.java:41) ~[C0EPacketClickWindow.class:?]
at net.minecraft.network.play.client.C0EPacketClickWindow.processPacket(C0EPacketClickWindow.java:113) ~[C0EPacketClickWindow.class:?]
at net.minecraft.network.NetworkManager.processReceivedPackets(NetworkManager.java:241) ~[NetworkManager.class:?]
at net.minecraft.network.NetworkSystem.networkTick(NetworkSystem.java:182) [NetworkSystem.class:?]
at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:726) [MinecraftServer.class:?]
at net.minecraft.server.dedicated.DedicatedServer.updateTimeLightAndEntities(DedicatedServer.java:349) [DedicatedServer.class:?]
at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:614) [MinecraftServer.class:?]
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:485) [MinecraftServer.class:?]
at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:752) [MinecraftServer$2.class:?]
[09:59:44] [server thread/INFO]: Player16 lost connection: TextComponent{text='Internal server error', siblings=[], style=Style{hasParent=false, color=null, bold=null, italic=null, underlined=null, obfuscated=null, clickEvent=null, hoverEvent=null}}
[09:59:44] [server thread/INFO]: Player16 left the game

 

The pet's inventory is 3x5, it works perfectly on the client but it crashes on the server when I try to move anything. How do I fix this error?

Main Developer and Owner of Zero Quest

Visit the Wiki for more information

If I helped anyone, please give me a applaud and a thank you!

Link to comment
Share on other sites

I looked at the source code and my guess is that the SlotPack class is suppose to act the same way as the normal Slot class but it goes into the entity and finds the inventory variable instead of going into InventoryPlayer

Main Developer and Owner of Zero Quest

Visit the Wiki for more information

If I helped anyone, please give me a applaud and a thank you!

Link to comment
Share on other sites

I also have a question, is it possible for me to have only one inventory class in the EntityCustomTameable main class for all of the entities extending to that class, and have those subclasses using the same Inventory class?

Main Developer and Owner of Zero Quest

Visit the Wiki for more information

If I helped anyone, please give me a applaud and a thank you!

Link to comment
Share on other sites

For instance, I have the AI classes and some variables that are to be used by all entities that extend to the class, EntityCustomTameable. Is it possible for me do to the same thing with the inventories? Such as but the drop inventory method in the EntityCustomTameable class so I don't have to place that same method into every entity file. But also but the Inventory variable inside the EntityCustomTameable class.

Main Developer and Owner of Zero Quest

Visit the Wiki for more information

If I helped anyone, please give me a applaud and a thank you!

Link to comment
Share on other sites

Thanks, I'll tell if everything goes well when I run the changes on the server (I had to setup eclipse again because I restored my computer to a certain point that made the files for starting up the client disappear.)

Main Developer and Owner of Zero Quest

Visit the Wiki for more information

If I helped anyone, please give me a applaud and a thank you!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.