HaiDozo Posted June 3, 2016 Posted June 3, 2016 I've been searching, on and off, for DAYS for a tutorial on how to make a block. I've searched this forum and also google, with no luck. I'm looking for a tutorial for 1.9 using blockstates and not using deprecated methods like registerBlock() or setBlockTextureName(). I'm sure there's a tutorial somewhere, right? Anyone know? Quote
pickaxe_engineer Posted June 3, 2016 Posted June 3, 2016 Hi May the luck was not on your side, but within two seconds of googling I found this: http://modwiki.temporal-reality.com/mw/index.php/Main_Page Happy coding Sincerely -pick Quote Since English is not my mother tongue, my sentences may are confusing. I'm coding java for a long time now - just MC and forge stop me sometimes.
HaiDozo Posted June 3, 2016 Author Posted June 3, 2016 Hi May the luck was not on your side, but within two seconds of googling I found this: http://modwiki.temporal-reality.com/mw/index.php/Main_Page Happy coding Sincerely -pick Great, thanks! It might help me with stuff, however looking at the block tutorial, I've already done what's in the tutorial and it's not working. The block is not ingame, neither as /give or in the creative menu (which I have put it in). I do have an item working so I have the basics done and working. My code (simplified) is like: The main class calls proxy stuff. CommonProxy.preInit() calls BlockManager.createBlocks() which does: [snip...] GameRegistry.register(clinkerBrickBlock = new ClinkerBricks()); and the block class is: [snip imports...] public class ClinkerBricks extends Block{ public ClinkerBricks() { this("clinker_bricks", Material.rock); } public ClinkerBricks(String name, Material material) { super(material); this.setRegistryName(name); this.setUnlocalizedName(this.getRegistryName().toString()); this.setCreativeTab(CreativeTabs.tabBlock); } } That's the correct chain of events to register a block, right? Registering it twice crashes with "already registered that name" error, so the registering goes through, but it doesn't show up ingame. I don't even care about textures right now, I just wanna see that sweet, sweet black/magenta checker pattern This is so basic that I'm embarrased, but I'm not getting it to work Any thoughts? Quote
HaiDozo Posted June 3, 2016 Author Posted June 3, 2016 Did you register an ItemBlock? Because if you don't, your Block can only exist placed down in the world. Ah! I did not do that. Didn't know it was a thing. Looking for tutorials about the relation of blocks and ItemBlock: can't find any My google-fu must suck, or are there generally not many detailed tutorials available? I took a shot in the dark: saw something about registering ItemBlock(this) so I threw GameRegistry.register(new ItemBlock(this), getRegistryName()); into the constructor of my block and it works! Textures next! It's going slow but I'm making progress! Thansk again! Quote
Recommended Posts
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.