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

Good Evening,

so I was primarily following GrayGhost's MinecraftByExample on Github, to port my custom furnace's to 1.16.5. The problem now is, using custom ContainerScreen, I figured he never implemented, or showed a way how to bring the recipe book to your custom tile entity/container screen. I spend the better part of today to get things working, but ultimately failed on the underlying difference between a "container" type TE, and an actual "smelting" type of TE's super's. As far as I understand it, he wasn't using any kind of crafting TE as base, but rather worked with a build up tutorial structure, using a chest type of container as base. A chest is not a furnace, or not a crafting station in that regard.

So my question is if it is even possible to reimport the recipe book, or make any kind of replacement, before I even start trying a different approach.

  • Author

Can someone at least give me a hint on which file to browse, to get an understanding of importing the recipe book function?

Thank you.

  • 2 weeks later...
  • Author

As always I'd return to conclude my inquiries, if successful. To solve my issue, I just had to create a custom screen, extend any "furnace" type screen to access the recipe book functions(AbstractFurnaceScreen actually turned out to be quite a hassle, so I moved on using FurnaceScreen). To implement the recipe book button into my "ContainerScreenCampfire", I just mimicked and adjusted the client code found in AbstractFurnaceScreen, and then I had to do the following code, to close the screen, and press the right mouse button to simulate returning to the original campfire screen, instead of the furnace screen:

ย 
	public class CustomScreen extends FurnaceScreen {
ย ย  ย 
ย ย  ย private final ResourceLocation guiTexture;
	ย ย  ย public CustomScreen(FurnaceContainer container, PlayerInventory playerInventory, ITextComponent title, ResourceLocation guiTextureIn) {
ย ย  ย ย ย  ย super(container, playerInventory, title);
ย ย  ย ย ย  ย this.guiTexture = guiTextureIn;
ย ย  ย }
ย ย  ย 
ย ย  ย @SuppressWarnings("deprecation")
ย ย  ย @Override
ย ย  ย protected void drawGuiContainerBackgroundLayer(MatrixStack matrixStack, float partialTicks, int x, int y) {
ย ย  ย ย ย  ย 
ย ย  ย ย ย  ย RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F);
ย ย  ย ย ย  ย this.minecraft.getTextureManager().bindTexture(this.guiTexture);
	ย ย  ย  ย  ย int i = this.guiLeft;
ย ย  ย  ย  ย int j = this.guiTop;
ย ย  ย  ย  ย this.blit(matrixStack, i, j, 0, 0, this.xSize, this.ySize);
	ย ย  ย }
	ย ย  ย @Override
ย ย  ย public boolean mouseClicked(double mouseX, double mouseY, int button) {
	ย ย  ย ย ย  ย 
ย ย  ย ย ย  ย if (this.recipeGui.mouseClicked(mouseX, mouseY, button)) {
ย ย  ย ย ย  ย  ย  ย return true;
ย ย  ย ย ย  ย } else {
ย ย  ย ย ย  ย ย ย  ย this.closeScreen();
ย ย  ย ย ย  ย ย ย  ย //KeyBinding.setKeyBindState(minecraft.gameSettings.keyBindings[this.keyBindAttack].getKey(), true);
ย ย  ย ย ย  ย ย ย  ย KeyBinding.onTick(minecraft.gameSettings.keyBindUseItem.getKey());
ย ย  ย ย ย  ย ย ย  ย return false;
ย ย  ย ย ย  ย }
ย ย  ย }
	}

ย 

What's left to do is importing all the client particle, and server side burn time logic functions etc., from my original campfire. But this should be pretty straight forward.

Edited by Cratthorax

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.