Jump to content

Burn Time for Custom Furnace


skip999

Recommended Posts

Hello,

I have been working on a custom furnace. I have everything working except an implementation of a fuel burn time. I have no idea how to implement this however. I tried implementing something, but it crashed and burned (pardon the pun) to say the least. What is even more frustrating is the few tutorials on how to do a custom furnace simply state to review the vanilla furnace on how to do this. I have reviewed the source code and still have no idea how to do it. I have implemented some of the logic that I'm fairly certain you need to implement to make it work, but that's about as far as I have gotten. Here is a link to my repository:

 

https://github.com/skiprocks999/Amulets-of-Infinity/tree/Block-Library/ContInfBlockLib

 

The reliant classes are:

>"AlloyForgeContainer"

>"AlloyForgeScreen"

>"AlloyForgeTileEntity"

 

Any help would be appreciated

 

Link to comment
Share on other sites

Burn time comes from items. Each item tells the furnace how much "fuel time" it is worth.

 

Check AbstractFurnaceTileEntity around line 296 for a method named getBurnTime.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

How would I blit two different animations on the same gui screen. I tried having two different blit commands handling the two different animations, but they result in something cursed to say the least. I even tried one blit line in the background and one in the foreground, but to no avail. For reference, here are the two blit lines I am using:

image.png.6943893e81f6e216b74dc457c60fa767.png

 

I was poking around in the AbstractGUI class and noticed a method called innerBlit. Would it be something to do with that?

 

For reference, the ProgressionScaled() methods merely return an int value, and do not interact with each other. 

 

 

Edited by skip999
Link to comment
Share on other sites

Howdy

 

Your code should work fine as you've posted it above, if you get the parameters correct.

The custom furnace I've written uses these:

 

// draw the cook progress bar
		double cookProgress = containerFurnace.fractionOfCookTimeComplete();  // from 0.0 to 1.0
		blit(guiLeft + COOK_BAR_XPOS, guiTop + COOK_BAR_YPOS, COOK_BAR_ICON_U, COOK_BAR_ICON_V,
         (int)(cookProgress * COOK_BAR_WIDTH), COOK_BAR_HEIGHT);

// draw the fuel burn-time-left icon
			double burnRemaining = containerFurnace.fractionOfFuelRemaining(i);
			int yOffset = (int)((1.0 - burnRemaining) * FLAME_HEIGHT);
			blit(guiLeft + FLAME_XPOS + FLAME_X_SPACING * i, guiTop + FLAME_YPOS + yOffset,
              FLAME_ICON_U, FLAME_ICON_V + yOffset, FLAME_WIDTH, FLAME_HEIGHT - yOffset);

 

-TGG

 

 

 

 

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

×   Pasted as rich text.   Restore formatting

  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.

Announcements



×
×
  • Create New...

Important Information

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