Skip to content
This repository has been archived by the owner on May 13, 2021. It is now read-only.

Steam Chisel doesn't fill in the Steam Filler #20

Open
copygirl opened this issue May 26, 2015 · 4 comments
Open

Steam Chisel doesn't fill in the Steam Filler #20

copygirl opened this issue May 26, 2015 · 4 comments

Comments

@copygirl
Copy link

Additionally, right clicking the steam filler with the chisel causes an NPE. Seems it's trying to open the GUI.

[15:50:51] [Client thread/ERROR] [FML]: OpenGuiHandler exception
java.lang.NullPointerException
    at com.cricketcraft.chisel.inventory.ContainerChisel.<init>(ContainerChisel.java:53) ~[ContainerChisel.class:?]
    at com.cricketcraft.chisel.client.gui.GuiChisel.<init>(GuiChisel.java:32) ~[GuiChisel.class:?]
    at com.cricketcraft.chisel.network.ChiselGuiHandler.getClientGuiElement(ChiselGuiHandler.java:43) ~[ChiselGuiHandler.class:?]
    at cpw.mods.fml.common.network.NetworkRegistry.getLocalGuiContainer(NetworkRegistry.java:265) ~[NetworkRegistry.class:?]
    [...]
@gchpaco
Copy link

gchpaco commented Jun 18, 2015

I have nothing to add about the GUI, but the filler not working is something I've noticed as well. The relevant code from FSP appears to be this:

                    if (this.getSteamShare() > 0 && stack.getItemDamage() > 0) {
                        if (!this.isCharging) {
                            //Steamcraft.log.debug("Charging");
                            this.isCharging = true;
                            worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
                        }
                    } else {
                        if (this.isCharging) {
                            //Steamcraft.log.debug("Not charging");
                            this.isCharging = false;
                            worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
                        }
                    }
                    if (this.getSteamShare() > item.steamPerDurability() && stack.getItemDamage() > 0) {
                        int i = 0;
                        while (i < 4 && (this.getSteamShare() > item.steamPerDurability() && stack.getItemDamage() > 0)) {
                            this.decrSteam(item.steamPerDurability());
                            stack.setItemDamage(stack.getItemDamage() - 1);
                            this.setInventorySlotContents(0, stack);
                            i++;
                        }
                        float currentPerc = getChargingPercent(stack);
                        if (prevPercent != currentPerc && Math.abs(prevPercent - currentPerc) > 0.01) {
                            //log.debug("New percent: "+currentPerc);
                            prevPercent = currentPerc;
                            worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
                        }
                    }

which means the FSP charger is directly messing with the durability of the item in question. Since the steam chisel sets max durability with setMaxDamage(0) in the constructor, I suspect that is the source of the problem.

@TehNut
Copy link
Member

TehNut commented Aug 28, 2015

Nixed the Steam Chisel. For now at least.

@gchpaco
Copy link

gchpaco commented Aug 28, 2015

Fair enough, that API is bizarre.

@TehNut
Copy link
Member

TehNut commented Aug 28, 2015

It's also filled with internal calls. You can't use the API without a deobf copy of the mod in your workspace.

no me gusta

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants