Posted January 23, 201510 yr Hi, When I am trying to add fuel in my fuel storage, the fuel bar goes up and up till it reached the max. But when I use it to make a new item and try to refill the storage to the max, it always stay 1 px from the edge of the max storage. It's cause I've set that my "Ice shard" (fuel) add's 50 each time, the max fuel is 10 000. And when I use it, it counts down. But then my fuel is for example 9958, not 9950 or 1000 or something else ending on a "50". And when I try to add a new Ice shard to my storage, it cannot take another Ice shard because it has a value of 50. So, can't go to the max fuel storage (10 000). And only when it's at 10 000, the texture of the storage is complete. What is my idea to fix this: Change the amount when it reaches the texture of "complete" So, like this needs 9950 before you see it's fully loaded, not 10 000. But I really don't know how to do this. Thanks for helping. Code: Tileentity: http://pastebin.com/dAUtk7HU Creator of the Master Chef Mod and many more to come. If I helped you, please click the 'thank you' button.
January 23, 201510 yr I would just check if the fuel is smaller than maxFuel-50 before adding 50 to fuel. If not I would set fuel to maxFuel. Here could be your advertisement!
January 24, 201510 yr Author Hi, Could you please give me more info on what to do? Cause I think I don't really get you. Maybe you could give me an example? It isn't nessesary. Thanks. Creator of the Master Chef Mod and many more to come. If I helped you, please click the 'thank you' button.
January 24, 201510 yr if (this.hasItemPower(this.slots[2]) && this.dualPower < (this.maxPower - this.getItemPower(this.slots[2]))) { this.dualPower += getItemPower(this.slots[2]); if(this.slots[2] != null) { flag1 = true; this.slots[2].stackSize--; if(this.slots[2].stackSize == 0) { this.slots[2] = this.slots[2].getItem().getContainerItem(this.slots[2]); } } } else if (this.hasItemPower(this.slots[2]) && this.dualPower < (this.maxPower)) { this.dualPower = this.maxPower; if(this.slots[2] != null) { flag1 = true; this.slots[2].stackSize--; if(this.slots[2].stackSize == 0) { this.slots[2] = this.slots[2].getItem().getContainerItem(this.slots[2]); } } Is what i would do. (Yeah, you will lose some itemPower, if you really want you can store it the remaining foodPower a new variable, that is added to the dualPower as soon as it is smaller than the maxPower) But why do you even care? Have you ever tried to fill a pot up until its 100% full irl? Or even until its 120% full? No sane person would try to do that. Here could be your advertisement!
January 24, 201510 yr Author Hi, I've found another way to do this. I've changed something in the gui class. And yes, I should not have wanted that you are losing fuel. Here is the file of the gui if you want to see what I did: Old gui code: http://pastebin.com/mFktZAWf New gui code: http://pastebin.com/1NLY9JV9 But still thank you Jacky2611! Creator of the Master Chef Mod and many more to come. If I helped you, please click the 'thank you' button.
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.