Jump to content

Game Chrashes on shift click on custom container [1.12.2]


Schleim_time

Recommended Posts

Post your code and crash.

Some tips:

Spoiler

Modder Support:

Spoiler

1. Do not follow tutorials on YouTube, especially TechnoVision (previously called Loremaster) and HarryTalks, due to their promotion of bad practice and usage of outdated code.

2. Always post your code.

3. Never copy and paste code. You won't learn anything from doing that.

4. 

Quote

Programming via Eclipse's hotfixes will get you nowhere

5. Learn to use your IDE, especially the debugger.

6.

Quote

The "picture that's worth 1000 words" only works if there's an obvious problem or a freehand red circle around it.

Support & Bug Reports:

Spoiler

1. Read the EAQ before asking for help. Remember to provide the appropriate log(s).

2. Versions below 1.11 are no longer supported due to their age. Update to a modern version of Minecraft to receive support.

 

 

Link to comment
Share on other sites

9 hours ago, DavidM said:

and

Funny thing is there is no crash and are nor errors, its seems to do an infinity loop or something but idk why, i heard you need to override transferstack or something but i have no plan how to use that. Can you see the minecraft workbench transferstack?

Link to comment
Share on other sites

Post your code then.

Some tips:

Spoiler

Modder Support:

Spoiler

1. Do not follow tutorials on YouTube, especially TechnoVision (previously called Loremaster) and HarryTalks, due to their promotion of bad practice and usage of outdated code.

2. Always post your code.

3. Never copy and paste code. You won't learn anything from doing that.

4. 

Quote

Programming via Eclipse's hotfixes will get you nowhere

5. Learn to use your IDE, especially the debugger.

6.

Quote

The "picture that's worth 1000 words" only works if there's an obvious problem or a freehand red circle around it.

Support & Bug Reports:

Spoiler

1. Read the EAQ before asking for help. Remember to provide the appropriate log(s).

2. Versions below 1.11 are no longer supported due to their age. Update to a modern version of Minecraft to receive support.

 

 

Link to comment
Share on other sites

2 hours ago, DavidM said:

Post your code

 

About Me

Spoiler

My Discord - Cadiboo#8887

My WebsiteCadiboo.github.io

My ModsCadiboo.github.io/projects

My TutorialsCadiboo.github.io/tutorials

Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support.

When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible.

Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org

Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)

Link to comment
Share on other sites

If you just extend Container then you need to override Container#transferStackInSlot, as you've said yourself.

17 hours ago, Schleim_time said:

i cant fint that anymore

It's still very much there on my end, so I don't know what your issue here is. Afaik the method didn't get renamed.

 

 

  • Thanks 1
Link to comment
Share on other sites

2 hours ago, V0idWa1k3r said:

as

Ok i found out how to use that, i have to use that in the container bit o dont understand the syntax of that because its returning an itemstack, why will it still crash on return null instead of doing nothing on shift? Shift isnt important for me, so is it easy to only make that it return nothing? Or what can i do in there? Return an itemstack is weird :/ i also tried return air but it still crashes instead of replacing the slot with air

Link to comment
Share on other sites

1 hour ago, Schleim_time said:

Ok i found out how to use that, i have to use that in the container bit o dont understand the syntax of that because its returning an itemstack, why will it still crash on return null instead of doing nothing on shift?

ItemStacks cannot be null. They cannot be null because a stack of size zero is empty and should be treated as a non-existent stack. 

Quote

Shift isnt important for me, so is it easy to only make that it return nothing? Or what can i do in there? Return an itemstack is weird :/ i also tried return air but it still crashes instead of replacing the slot with air

This is why ItemStack.EMPTY exists. 

Edited by Draco18s

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

I did empty, return null stoops server and crash and return empty do crash without error

1 hour ago, Draco18s said:

ItemStacks cannot be null. They cannot be null because a stack of size zero is empty and should be treated as a non-existent stack. 

This is why ItemStack.EMPTY exists. 

 

Link to comment
Share on other sites

1 hour ago, Draco18s said:

ItemStacks cannot be null. They cannot be null because a stack of size zero is empty and should be treated as a non-existent stack. 

This is why ItemStack.EMPTY exists. 

So im only tring to do that shift will not crash, shift dont need a function but i have no plan how to do this, im not understanding the method

Link to comment
Share on other sites

You still haven't post your code...

 

4 hours ago, Schleim_time said:

im not understanding the method

IIRC the method takes in a player and an index indicating who clicked on the slot and which slot he/she clicked on.

The method also handles the inventory manipulation during the shift-click process.

The ItemStack the method returns is the ItemStack that should remain in the slot after the shift-click operation.

Edited by DavidM

Some tips:

Spoiler

Modder Support:

Spoiler

1. Do not follow tutorials on YouTube, especially TechnoVision (previously called Loremaster) and HarryTalks, due to their promotion of bad practice and usage of outdated code.

2. Always post your code.

3. Never copy and paste code. You won't learn anything from doing that.

4. 

Quote

Programming via Eclipse's hotfixes will get you nowhere

5. Learn to use your IDE, especially the debugger.

6.

Quote

The "picture that's worth 1000 words" only works if there's an obvious problem or a freehand red circle around it.

Support & Bug Reports:

Spoiler

1. Read the EAQ before asking for help. Remember to provide the appropriate log(s).

2. Versions below 1.11 are no longer supported due to their age. Update to a modern version of Minecraft to receive support.

 

 

Link to comment
Share on other sites

Thank you david, i will try my best but as first i copied the crafting table one because i also want to do something like that

52 minutes ago, DavidM said:

You still haven't post your code...

 

IIRC the method takes in a player and an index indicating who clicked on the slot and which slot he/she clicked on.

The method also handles the inventory manipulation during the shift-click process.

The ItemStack the method returns is the ItemStack that should remain in the slot after the shift-click operation.

 

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



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • I'm Murray Brenda by name, a single mom of three kid's, got scammed on forex trade, never taught of getting tricked in such a way, was convinced by a social media friend to invest on the forex platform of which i heed to, after 1 week of thinking about the proposal, i invested $5Gs, then the trade increased and i was asked to deposit so i stay on the trade and avoid running loss and i did, it was so hurtful when i realize that i have been scammed, i reached out to the directors and support service, non where responding, i was always asked for more payment after one payment has been made, after having my funds back with the help of AlienWizbot i was so happy and rejoiceful simply because it was at the edge of giving up, i gave the last trial simply because coming from a reliable source i taught of giving it  try, only then did i came to find out the truth about impostors testimony online which has ended many people losing more money to scam, you can reach out to Alienwizbot by sms (+1 6262645164) or E-mail alienwizbot(@)Gmail(.)com, best service ever experienced, do hire him for all kinds of cyber issues or hacks.  
    • so basically ive been trying to make a modded server for 1.7.10 and i follow the tutorial perfectly but every tutorial has something called a bat file in there folder when they install forge client into a folder but it doesn't show for me i only get these options in the folder config, libraries, logs, mods, eula, forge 1.7.10, minecraft server 1.7.10 and server proprieties so im not sure what to do and google hasn't really been helping
    • { "type": "magic_overhaul:rune_inscribing", "base": { "item": "//base item" }, "template": { "item": "//template item" }, "output": { "count": 1, "item": "//output item" } } ^ Ok, where is your recipe JSON placed in your file structure? What's it called? And paste the actual JSON you're testing with, because it needs to be valid.
    • I'm trying to run Forge 1.12.2 on Minecraft  so I can use certain mods, but this error popped up. I've seen multiple errors but I just can't figure this one out. Unable to locate the Java runtime. Error details: 0x00000000 - system: The operation completed successfully. Filename on disk:  Path: . Exists: Directory
    • https://mclo.gs/b422RFc
  • Topics

×
×
  • Create New...

Important Information

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