Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

Making a grinder - basically, it turns ores into dusts (not original, deal with it), but anyway, it smelts fine and whatnot (not changed it from the furnace code) but there is ONE thing I cannot figure out:

 

The progress bars don't update.

 

Here's the GuiGrinderBlock.java code:

 

https://gist.github.com/anonymous/cf9d3555889a9aa302d6

 

 

And here's the actual image (for co-ordinates reference):

http://puu.sh/8tGzs.png

 

It's 256x256 and I can't see what my issue is.

 

If you need any more code, please ask and it'll be provided.

Making a grinder - basically, it turns ores into dusts (not original, deal with it), but anyway, it smelts fine and whatnot (not changed it from the furnace code) but there is ONE thing I cannot figure out:

 

The progress bars don't update.

 

Here's the GuiGrinderBlock.java code:

 

https://gist.github.com/anonymous/cf9d3555889a9aa302d6

 

 

And here's the actual image (for co-ordinates reference):

http://puu.sh/8tGzs.png

 

It's 256x256 and I can't see what my issue is.

 

If you need any more code, please ask and it'll be provided.

 

Looks like server and client aren't synced...(Made the same mistake ;D)

 

Try to add something like this to your container:

(simpleController is my tileEntity, you will have to change it to match your entity)

public void detectAndSendChanges(){
    
        super.detectAndSendChanges();

        for (int i = 0; i < this.crafters.size(); ++i)
        {
            ICrafting icrafting = (ICrafting)this.crafters.get(i);

            if (this.lastDimensionEnergy != this.simpleController.dimensionEnergy)
            {
                icrafting.sendProgressBarUpdate(this, 0, this.simpleController.dimensionEnergy);
            }

            if (this.lastEnergy != this.simpleController.energy)
            {
                icrafting.sendProgressBarUpdate(this, 1, this.simpleController.energy);
            }
            
            if (this.lastTimeUntillTp != this.simpleController.timeUntillTp)
            {
                icrafting.sendProgressBarUpdate(this, 2, this.simpleController.timeUntillTp);
            }
            
        }

        this.lastDimensionEnergy = this.simpleController.dimensionEnergy;
        this.lastEnergy = this.simpleController.energy;
        this.lastTimeUntillTp =this.simpleController.timeUntillTp;
        //this.lastItemBurnTime = this.tileFurnace.currentItemBurnTime;
    }


@SideOnly(Side.CLIENT)
public void updateProgressBar(int slot, int value){
	if(slot==0)this.simpleController.dimensionEnergy=value;
	if(slot==1)this.simpleController.energy=value;
	if(slot==2)this.simpleController.timeUntillTp=value;
}

 

If you tried to do this and it doesn't work could you please post your code?

 

IF it works, don't forget to press the thank you button.

 

Here could be your advertisement!

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...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.