Jump to content

[1.7.10] Custom inventory glitch causes crash?


zollernwolf

Recommended Posts

Hello. I'm having an issue with a custom inventory I made. Everything works fine for the most part, but when I shift-click to go to remove arrows from the inventory (I'm making a quiver to hold arrows), the whole client crashes ('m using Eclipse, btw).

 

ContainnerQuiver.java: http://pastebin.com/UTiEpBNT

 

This is the exception and its stacktrace that I'm getting:

 

 

Time: 6/18/15 3:35 PM

Description: Updating screen events

 

java.lang.IndexOutOfBoundsException: Index: 41, Size: 38

at java.util.ArrayList.rangeCheck(ArrayList.java:635)

at java.util.ArrayList.get(ArrayList.java:411)

at zollernextras.inventory.ContainerQuiver.mergeItemStack(ContainerQuiver.java:119)

at zollernextras.inventory.ContainerQuiver.transferStackInSlot(ContainerQuiver.java:65)

at net.minecraft.inventory.Container.slotClick(Container.java:279)

at zollernextras.inventory.ContainerQuiver.slotClick(ContainerQuiver.java:97)

at net.minecraft.client.multiplayer.PlayerControllerMP.windowClick(PlayerControllerMP.java:478)

at net.minecraft.client.gui.inventory.GuiContainer.handleMouseClick(GuiContainer.java:676)

at net.minecraft.client.gui.inventory.GuiContainer.mouseClicked(GuiContainer.java:418)

at net.minecraft.client.gui.GuiScreen.handleMouseInput(GuiScreen.java:344)

at net.minecraft.client.gui.GuiScreen.handleInput(GuiScreen.java:313)

at net.minecraft.client.Minecraft.runTick(Minecraft.java:1721)

at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1029)

at net.minecraft.client.Minecraft.run(Minecraft.java:951)

at net.minecraft.client.main.Main.main(Main.java:164)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:606)

at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)

at net.minecraft.launchwrapper.Launch.main(Launch.java:28)

at net.minecraftforge.gradle.GradleStartCommon.launch(Unknown Source)

at GradleStart.main(Unknown Source)

 

 

Any help would be greatly appreciated. Thank you.

Link to comment
Share on other sites

That's what happens when you blindly copy and paste code. In my tutorial, I talk about adding armor slots, which is why there is ARMOR_START etc., but you do not add any armor slots to your inventory container, so all of your array indexes are off by 4: 38, 39, 40, and 41 do not exist, i.e. they are "out of bounds".

 

Please read more carefully, and actually read ALL of the code so you know what's going on, rather than just copying it and hoping for the best.

Link to comment
Share on other sites

That's what happens when you blindly copy and paste code. In my tutorial, I talk about adding armor slots, which is why there is ARMOR_START etc., but you do not add any armor slots to your inventory container, so all of your array indexes are off by 4: 38, 39, 40, and 41 do not exist, i.e. they are "out of bounds".

 

Please read more carefully, and actually read ALL of the code so you know what's going on, rather than just copying it and hoping for the best.

Seriously? No one "blindly copied" anything. I read all of your tutorial, even made the necessary modifications. I asked you questions and showed you this exact code before, to which you said it was fine. I showed every single one of my files and you said they were fine, other than minor things which I have fixed and thanked you for. I asked this professionally and maturely, and you respond with hostility. I really don't understand the purpose of having a "help forum" if no one is willing to actually help. I made no offensive remarks to you - showed no signs of aggression. Yet you respond like someone shot you in the neck. Please try to have a little more courtesy towards others, and understand that not everyone automatically knows how to do something.. I've seen everyone else get help, and they ask just as maturely if not less maturely than I do. I did not "blindly copy and paste" anything. If you recall, I (alphawolf918 on the MC forums) asked you several questions, and learned a lot. You helped me then, even if it was with a bad attitude. Please don't just assume things of people, you do not know anything about them or their intentions. You really should try to have a bit more respect. Life is too short for this kind of hostility, and frankly I don't think I did anything to deserve it.

 

Every time I have ever asked anybody for help, it's been met with hostility. I always do so in a respectable, mature manner. Never once have I complained or asked anyone to do anything for me. I've only ever asked for concepts, and for what I've been doing wrong. All you had to do was tell me what the issue was, nicely, and everything would've been fine. But instead, you respond like an angry child. Yes, I ask a lot of questions - because I want to understand, and yes, that takes a little longer for me than it does for most people, but I can't help that. That is not my fault. I pay attention as much as I can, I READ as much as I can, the fact of the matter is not everything makes sense to me until I see all the steps. Your comments were also quite flawed and very vague - try being a bit more specific with them. My point isn't with your style of coding or tutorials, I appreciate them very much, believe me. My only issue is with the fact that every time I ever try to ask someone for help with modding Minecraft, it's met with aggression. I don't understand that. I came here asking about 1.6.4 stuff before (on my other account that I no longer have the password or e-mail for, hence the new account), and was told to "stop asking things about it", after which my topic was locked. Yet now I see people everywhere asking for it, and getting answers. For 1.6.4, I mean. I finally upgraded to 1.7.10 as suggested, and I still receive this crap from people. I'm always terrified of asking for help for this reason, because I never understand what I've done to deserve such aggression. But I guess I know what the issue is now, and now I also know that I can't ask for help without you treating me like a terrorist. You know, you may understand it just fine, but not everyone is going to be as smart as you are. I already know that I'm not that smart, that I have issues, and I've accepted it. You shouldn't throw something like that in someone's face.

 

Have a blessed day.

 

 

Link to comment
Share on other sites

I really, really, don't see why you are so pissed. I get it, some people on this forums are a bit strict. But cmon, no need to make a big fuss about it. CoolAlias was in no way hostile towards you. He told you why you got the problem, and how to fix it. Plus, your code really does look like copy and paste. The proper way to follow a tutorial is not to copy and paste but to type it yourself. Obviously you copy and pasted because the comments are still there. CoolAlias has a reason to say you copied and pasted blindly. And if you read carefully, how did you miss the armor slot section. Your statement just sounds like a load of bs to me. If you stop acting so defensively towards people that are actually trying to help you, maybe you won't get crap answers.

 

Also, if you think I am against you, I'm not im just trying to help.

-Tiffit

Link to comment
Share on other sites

Whoa whoa whoa chill buddy. None of that was hostile, though perhaps you could interpret it that way.

 

I am merely trying to emphasize that you should read code more carefully, and assumed (wrongly, apparently) that you had just copied and pasted it because you left in the ARMOR_SLOT index.

 

I couldn't possibly know that you are alphawolf918 on a different forum when you go by a different name here, and Container code is almost always nearly identical, thus the assumption above.

 

Sorry you interpreted my post as hostile. I use CAPS for emphasis, not hostility.

 

EDIT: Also yes, I have seen that 1.6.4 is not supported at all here. I tried to answer someone's question (about 1.6.4) once, and my comment was deleted and the topic locked. I don't get that, but that's just a fact of MinecraftForge.net.

Link to comment
Share on other sites

Don't tell me to chill, I have every reason to feel the way that I do. Yes, I left your comments so I could reference them without having to re-load the entire page. Firefox hates me lately. That's not a crime. I appreciate your apology, and thank you for responding peacefully. I'm attempting to work out the bugs now, but if I have another issue, I would like to be able to ask about it without anyone making any false assumptions or treating me any differently because of said assumptions. I have every right in the world to respond the way that I am, and I have a bunch of people backing me up on that.

I really, really, don't see why you are so pissed. I get it, some people on this forums are a bit strict. But cmon, no need to make a big fuss about it. CoolAlias was in no way hostile towards you. He told you why you got the problem, and how to fix it. Plus, your code really does look like copy and paste. The proper way to follow a tutorial is not to copy and paste but to type it yourself. Obviously you copy and pasted because the comments are still there. CoolAlias has a reason to say you copied and pasted blindly. And if you read carefully, how did you miss the armor slot section. Your statement just sounds like a load of bs to me. If you stop acting so defensively towards people that are actually trying to help you, maybe you won't get crap answers.

 

Also, if you think I am against you, I'm not im just trying to help.

-Tiffit

This doesn't concern you, and you know nothing about me. Please let coolAlias and I work this out maturely, without you escalating the problem - thank you.

 

edit:

 

I left the armor stuff because I didn't want to touch something or remove something until it worked 100%, it's just a safety thing I do. And I've asked for stuff on the minecraftforum site too with the same response. Usually I respond with a "thank you" despite how I get treated, but enough is enough after a while. I deserve to learn just as much as anybody else.

Link to comment
Share on other sites

Don't tell me to chill, I have every reason to feel the way that I do. Yes, I left your comments so I could reference them without having to re-load the entire page. Firefox hates me lately. That's not a crime. I appreciate your apology, and thank you for responding peacefully. I'm attempting to work out the bugs now, but if I have another issue, I would like to be able to ask about it without anyone making any false assumptions or treating me any differently because of said assumptions. I have every right in the world to respond the way that I am, and I have a bunch of people backing me up on that.

Of course you have your reasons, but are you not also making assumptions about the tone of responses? Certainly some are outright hostile, yet others which may seem hostile are, in fact, not.

 

And just as you have your reasons for assuming that a tone is hostile (e.g. you have received many hostile responses in the past), so too we have our reasons for assuming you blindly copied and pasted the code - we see it all the time, day in and day out, and 99% of the time it is a correct assumption.

 

Anyway, just pointing out that we all have our reasons for what we do, and they are not always obvious to other people, which leads to unfortunate situations such as this.

 

But at least your problem has been resolved. I hope you continue to ask questions in a mature fashion in the future, and hopefully you will not receive negative responses.

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.