Jump to content
  • Home
  • Files
  • Docs
  • Merch
Topics
  • All Content

  • This Topic
  • This Forum

  • Advanced Search
  • Existing user? Sign In  

    Sign In



    • Not recommended on shared computers


    • Forgot your password?

  • Sign Up
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • Shift-clicking container discards items
1.13 Update Notes for Mod Creators
Sign in to follow this  
Followers 1
McJty

Shift-clicking container discards items

By McJty, March 15, 2015 in Modder Support

  • Reply to this topic
  • Start new topic

Recommended Posts

McJty    2

McJty

McJty    2

  • Creeper Killer
  • McJty
  • Members
  • 2
  • 129 posts
Posted March 15, 2015

There is an annoying bug in RFTools that I cannot reproduce in my dev env so it is somewhat hard to debug. But basically if people shift-click a stack of items into some of my containers (for which the slots only accept one item) then one item of the stack is inserted and the rest is lost. If I do it in my dev env then the items of the stack are nicely distributed to all available slots of the machine and the remainder goes somewhere in the player inventory. Nothing is lost. I'm at a loss as what I could be doing wrong. My transferStackInSlot implementation can be found here:

 

https://github.com/McJty/RFTools/blob/master/src/main/java/com/mcjty/container/GenericContainer.java

 

Anyone who has any insight into what might be wrong?

 

Thanks!

  • Quote

Share this post


Link to post
Share on other sites

Abastro    123

Abastro

Abastro    123

  • World Shaper
  • Abastro
  • Forge Modder
  • 123
  • 1075 posts
Posted March 15, 2015

To solve this issue, It is necessary to know what the container with the bug is and some screenshots for that.

  • Quote

Share this post


Link to post
Share on other sites

McJty    2

McJty

McJty    2

  • Creeper Killer
  • McJty
  • Members
  • 2
  • 129 posts
Posted March 15, 2015

Ok, here two screenshots. Before shift-click and after shift-click. Notice how it works fine for me. It doesn't for many people and I don't know why:

 

And here is the code for this particular container: https://github.com/McJty/RFTools/blob/master/src/main/java/com/mcjty/rftools/blocks/screens/ScreenContainer.java

 

CTBEokN.png

1FcKnJr.png

 

  • Quote

Share this post


Link to post
Share on other sites

McJty    2

McJty

McJty    2

  • Creeper Killer
  • McJty
  • Members
  • 2
  • 129 posts
Posted March 15, 2015

Nobody has any idea on this? This bug is hitting several of my containers (every container for which the slot in the container only allows one item but the stack itself can contain multiple items).

  • Quote

Share this post


Link to post
Share on other sites

shadowfacts    100

shadowfacts

shadowfacts    100

  • Dragon Slayer
  • shadowfacts
  • Forge Modder
  • 100
  • 588 posts
Posted March 15, 2015

You need to figure out exactly how to reproduce this bug, this would make it much, much easier to find the issue.

  • Quote

Share this post


Link to post
Share on other sites

McJty    2

McJty

McJty    2

  • Creeper Killer
  • McJty
  • Members
  • 2
  • 129 posts
Posted March 15, 2015

Well reproducing it is easy enough. Exactly like I did in the screenshot. Shift-click on a stack. In my dev environment the stack gets evenly distributed on the slots (like the second screenshot shows). In many modpacks however (like FTB Infinity) the first slot of the container gets one item and the rest of the stack is discared (lost).

  • Quote

Share this post


Link to post
Share on other sites

Abastro    123

Abastro

Abastro    123

  • World Shaper
  • Abastro
  • Forge Modder
  • 123
  • 1075 posts
Posted March 16, 2015

You should try to find what mod is making the issue.

  • Quote

Share this post


Link to post
Share on other sites

McJty    2

McJty

McJty    2

  • Creeper Killer
  • McJty
  • Members
  • 2
  • 129 posts
Posted March 16, 2015

Actually I found the problem. It is not a mod that is causing the issue. It is a mod that is 'FIXING' the issue. Apparently in my local dev env I have a CoFHlib that patches a bug in Minecraft's mergeItemStack() which apparently doesn't respect the maximum number of items in inventory slots. So in my dev env it was fixed because CoFHlib was fixing it. But apparently in some modpacks there is no CoFHlib or perhaps another version of CoFHlib which does not fix this. So I solved the issue by implementing the fix locally in my mod.

 

Thanks for helping though.

  • Quote

Share this post


Link to post
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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  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.

  • Insert image from URL
×
  • Desktop
  • Tablet
  • Phone
Sign in to follow this  
Followers 1
Go To Topic Listing



  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • DragonITA
      [1.14.4]What are API/Library and how to make a custom/own API/Library?

      By DragonITA · Posted 17 minutes ago

      Hi, a exemple: i just installed Tabula and i see, that i should install a Library or a API, iChunc or something else, else the mod wont work. Question: What is a Library/API and how to make a own?
    • Kangoro
      Mc Forge 1.14.4

      By Kangoro · Posted 39 minutes ago

      Where do I find it? and i copy paste here or in other web and link here?
    • thedarkcolour
      [1.14] Patching method with coremod in TreeFeature causes IncompatibleClassChangeError

      By thedarkcolour · Posted 50 minutes ago

      Now it just freezes with no error at all.
    • thedarkcolour
      [1.14] Patching method with coremod in TreeFeature causes IncompatibleClassChangeError

      By thedarkcolour · Posted 51 minutes ago

      I just realized what I've done. I forgot to make the BeeNestGenerator method static. I'll check if that fixes it.
    • thedarkcolour
      [1.14] Patching method with coremod in TreeFeature causes IncompatibleClassChangeError

      By thedarkcolour · Posted 55 minutes ago

      BeeNestGenerator class
  • Topics

    • DragonITA
      0
      [1.14.4]What are API/Library and how to make a custom/own API/Library?

      By DragonITA
      Started 17 minutes ago

    • Kangoro
      4
      Mc Forge 1.14.4

      By Kangoro
      Started Yesterday at 05:17 PM

    • thedarkcolour
      13
      [1.14] Patching method with coremod in TreeFeature causes IncompatibleClassChangeError

      By thedarkcolour
      Started 11 hours ago

    • Pixelboss4d
      2
      1.89 crash forge

      By Pixelboss4d
      Started 2 hours ago

    • Junior240
      4
      I'm having trouble with Java on !MAC!

      By Junior240
      Started November 9

  • Who's Online (See full list)

    • imacatlolol
    • MoeBoy76
    • Puddingsworth
    • Choco
    • Kangoro
    • tomatoBhutan
    • plugsmustard
    • LexManos
    • Simon_kungen
    • DragonITA
    • loordgek
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • Shift-clicking container discards items
  • Theme
  • Contact Us
  • Discord

Copyright © 2019 ForgeDevelopment LLC · Ads by Curse Powered by Invision Community