Jump to content

Recommended Posts

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
  • Created
  • Last Reply

Top Posters In This Topic

Posted

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

Posted

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.

 

 

 

Posted

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)

Posted

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

 

Posted

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?

Posted

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.

Posted

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

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