Jump to content

[1.8][Solved]Loading Variants of the same block


WitherDoggie

Recommended Posts

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

Link to comment
Share on other sites

  • Replies 62
  • Created
  • Last Reply

Top Posters In This Topic

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

Link to comment
Share on other sites

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.

 

 

 

Link to comment
Share on other sites

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

 

Link to comment
Share on other sites

I've written this model loading code to load my variants, but the blocks still show up as un-textured blocks. The models don't load either. The log is saying that it can't find the blockstate files, but I checked and they are in the blockstate folder. What am I doing wrong?

 

ClientProxy:

http://pastebin.com/XXK2yivY

 

Log:

http://pastebin.com/ZG4ZYH6h

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

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.