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

Hello,

I have been working on implementing a custom furnace block in forge 1.15.2. I have run into a slight snag that I cannot seem to figure out however. For reference, my block will take two inputs and produce 1 output. I have been able to figure out everything but how to set up the serializer properly. Specifically, in the Serializer class's read method, how would I read from the PacketBuffer if I have more than one input. I cannot seem to find any information on this. I have included my best guess at the correct approach. Am I on the right track?

 

image.png.b48b5d3207e469a2e0677aef432df27a.png

Reading those variables entirely depends on how you created the write() method. For reference, the vanilla classes such as CookingRecipeSerializer are a good template. The only difference is they return the recipe from factory:

return this.factory.create(recipeId, etc.)

If you have variables such as cooking time and experience returned, they should also be written and read.

Edited by urbanxx001

That looks right. You can test it and see if everything is functioning correctly. There might also be a way to read/write the ingredients as a single array, but it would be the same amount of code.

Edited by urbanxx001

  • Author

Ah okay I see how the buffer works now. Thanks! So it should look something like this: image.png.1f2ff6a7d6a6985ce646455482400713.png

Edited by skip999

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.