Inventory Tweaks [1.12 only]

Inventory Tweaks [1.12 only]

127M Downloads

Calculator Mod Incompatibility

SonarSonic opened this issue ยท 17 comments

commented

Hey,
I'm the creator of the Calculator Mod. I've been getting glitches which cause my mod to be unplayable it only ever occurs when Inventory Tweaks is installed. The bug is difficult to explain so there is a video below. I tried using the @IgnoreContainer annotation but It didn't seem to disable the container in any way and logger still showed Inventory Tweaks had loaded it.

I should probably say this only happens with portable items which have containers e.g. Calculators.
Also this doesn't happen every time you open the container about once every 3 times.

Video of glitch
https://youtu.be/jIIrX1poZC4

Basic Calculator Container
http://pastebin.com/hkfpXz5U

commented

Wasn't inv tweaks in the end but it's fixed now.

commented

Okay people are still reporting the glitch. The only people who report it are ones who have Inv-Tweaks installed, any ideas?? Thank you :)
SonarSonic/Calculator#9 (comment)

commented

No idea, I'm not seeing anything using just shift in my shortcut code by default.

commented

do you edit any Minecraft base code?

commented

A bunch of special additions for metainfo about containers, but the only thing that actually changes any base method is the 'stop processing keys when a textbox is selected' code.

commented

So strange :/ Could it be a fault with my code? It's just so strange that it only comes up with inv tweaks

commented

Do you do anything with?

public ItemStack slotClick(int slot, int button, int flag, EntityPlayer player)

or

public boolean func_94530_a(ItemStack stack, Slot slot)

commented

slotClick is called from all over as it's the only way to move items around from the client without absolutely requiring a server-side mod.

I don't see any references to canMergeSlot(94530) in current version at least.

commented
@Override
public ItemStack slotClick(int slot, int button, int flag, EntityPlayer player) {
    if (slot >= 0 && getSlot(slot) != null && getSlot(slot).getStack() == player.getHeldItem()) {
        return null;
    }
    return super.slotClick(slot, button, flag, player);
}
commented

Could this be a problem?

commented

If you're triggering a sort it might cause an infinite loop freeze if that's the only thing you do to prevent moving (and there's something set up with higher priority for that hotbar slot, as usually they aren't changed)

That's not the issue showing up though.

commented

So maybe I should change the way I do that and it will be okay?

Also I override this

public boolean func_94530_a(ItemStack p_94530_1_, Slot p_94530_2_) {
return p_94530_2_.inventory != this.craftResult && super.func_94530_a(p_94530_1_, p_94530_2_);
}

commented

I don't directly use that, or ever send a click that should call it.

commented

okay. I'll change the slot click methods and see if that works

commented

The only thing I can see that looks really suspicious is your definition of slotClick.

InventoryTweaks doesn't do anything unless specifically told to however, either by using the sorting buttons or a hotkey -- and unless you've told it about your container somehow it practically entirely disables itself.

commented

Okay, i'll have a look into replacing that. Thank you.

commented

Removing the method entirely made no difference. I then removed inventory tweaks again and the glitch disappeared again.

EDIT: It's doesn't seem to be happening anymore :/ I think maybe the glitch might have something to do with server lag possibly.
One thing I noticed was that for Calculators I used player.openGui instead of FMLNetworkHandler.openGui but I don't think that would make a difference