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

I'm trying to create a wooden wall block that is a pane type block. I've written the code for the pane block and it works fine. The issue is, I want to create a wall block type for each type of wood in the game without coding each type individually. I have written a wood type class to store the wood types I want to use. How can I get all of the types to load in game using only one registry entry.

 

WoodUtil:

http://pastebin.com/3NG3e6jd

 

Block Class:

http://pastebin.com/jPi6iJb0

 

ModPaneBlock Class:

http://pastebin.com/pERnHT8d

  • Replies 62
  • Views 25.4k
  • Created
  • Last Reply

Top Posters In This Topic

  • Author

Could you have multiple blocks with 16 blockstates each to support them all?

 

I would do this, but I want just one block with 6 different variants.

  • Author

I've redone the WoodWall class. The game doesn't load if I try to make the WoodWall class extend BlockPane, but it does load if I just extend WoodWall from Block. When I extend the class from the Block class, 5 of the 6 blocks show up as type birch which is not what I want.

 

New WoodWall.class

http://pastebin.com/hgw8pkpt

 

ItemBlockMeta.class

http://pastebin.com/iAJxNqdj

 

IMetaBlockName

http://pastebin.com/3h9WdbQY

  • Author

Originally I was going to use a switch statement, but decided against it. The only thing left I can't figure out is why I can't make this a PaneBlock.

  • Author

Originally I was going to use a switch statement, but decided against it.

Why?

 

I don't know. I wasn't really thinking about what I was doing at the time.

 

The only thing left I can't figure out is why I can't make this a PaneBlock.

What's stopping you? (Hint: "it crashes" is not an answer to this question).

 

Nothing is stopping me. I just have to figure out why exactly the game is crashing.

 

 

 

  • Author

I got the blocks working. One last question though. Do I have to make a .json model file for each variant of the block or do I need just one .json file (it'll be more than 1 because of all the direction .jsons  needed for a pane block)

  • Author

If I didn't want 1 blockstate json, would I need 12 model jsons for each variant plus a blockstate json for each variant?

  • Author

I looked through the vanilla blockstates and models for the different stained glass panes. Each variant of the pane has it's own blockstate and each has 12 model jsons. I tried to do this for my panes as well and the models won't load. The inventory models load, but when placed in the world the block models don't load.

 

Block Rendering Class

http://pastebin.com/8Xr4007M

 

Log when launching the game: (not sure if you needed this, but I included it anyway)

http://pastebin.com/wJNir72c

 

BlockState json for oak variant

http://pastebin.com/i4nTMcGw

 

  • Author

There is no error in the log about anything called wood wall.

 

This is why I'm confused. I can't figure it out.

 

Here is what shows up in game.

  • Author

I must have mis-interpreted what you meant. When you said,

And why is registerBlocks called from the ClientProxy only?

I though you meant call if from the CommonProxy as well.

  • Author

I just noticed, you are not specifying any variant for your item model location. This means it will use "normal".

How do I specify a variant? Also, what class could I look in for examples of PaneBlocks with variants?

  • Author

Moved registerBlocks back to the CommonProxy.

 

RegisterRender.RegisterModel is what registers the models for my items.(moved that up to preInit)

 

BlockState Path

C:\Users\Evan\Desktop\forge-1.8.9-11.15.1.1890-1.8.9-mdk\src\main\resources\assets\withermod\blockstates

 

Model Path

C:\Users\Evan\Desktop\forge-1.8.9-11.15.1.1890-1.8.9-mdk\src\main\resources\assets\withermod\blocks/models/block

 

BlockState for woodWall_oak

http://pastebin.com/UuP3E5aT

 

BlockState for woodWall_spruce

http://pastebin.com/7NWf7kAB

 

Models for woodWall_oak

http://pastebin.com/YwdV1RCP

http://pastebin.com/y177VTZu

http://pastebin.com/yDSyfiY2

http://pastebin.com/0BjPGBcu

http://pastebin.com/EY78GRJw

http://pastebin.com/ZHA30tjn

http://pastebin.com/cH8pwMhy

http://pastebin.com/y4jM6QH9

http://pastebin.com/ZHYR2H8s

http://pastebin.com/Rt0nDfhQ

http://pastebin.com/svCA20b1

http://pastebin.com/zUWs1a9U

 

The model files for the spruce variant are the same except for the change in texture.

  • Author

Moved registerBlocks back to the CommonProxy.

 

RegisterRender.RegisterModel is what registers the models for my items.(moved that up to preInit)

 

BlockState Path

C:\Users\Evan\Desktop\forge-1.8.9-11.15.1.1890-1.8.9-mdk\src\main\resources\assets\withermod\blockstates

 

Model Path

C:\Users\Evan\Desktop\forge-1.8.9-11.15.1.1890-1.8.9-mdk\src\main\resources\assets\withermod\blocks/models/block

 

BlockState for woodWall_oak

http://pastebin.com/UuP3E5aT

 

BlockState for woodWall_spruce

http://pastebin.com/7NWf7kAB

 

Models for woodWall_oak

http://pastebin.com/YwdV1RCP

http://pastebin.com/y177VTZu

http://pastebin.com/yDSyfiY2

http://pastebin.com/0BjPGBcu

http://pastebin.com/EY78GRJw

http://pastebin.com/ZHA30tjn

http://pastebin.com/cH8pwMhy

http://pastebin.com/y4jM6QH9

http://pastebin.com/ZHYR2H8s

http://pastebin.com/Rt0nDfhQ

http://pastebin.com/svCA20b1

http://pastebin.com/zUWs1a9U

 

The model files for the spruce variant are the same except for the change in texture.

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.