Posted February 6, 20187 yr Hi. I'd like to make a mod where you cannot destroy any existing block but you can place blocks you already have (and destroy them). The problem is to differentiate two block of the same type by the fact that is was (or wasn't) in the original world. I looked at blockstate but it seems like it's a dead end (many vanilla block already have their 4 bytes state full). So I thought about re-registering every vanilla block with .setUnbreakable() but we cannot register the same block two times. If someone have an idea, I'll be grateful. Thanks for reading.
February 6, 20187 yr You won't be able to do this without rewriting a majority of Minecraft's internals. Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given.
February 7, 20187 yr Author Damn... A different way would be to store chunks as array of 256 booleans and to check on event if a block is breakable or not. Do you think this would be too costly performance-wise (with some optimizations ofc) ? Edited February 7, 20187 yr by Pink-Panther to -> too
February 7, 20187 yr That's pretty much your only option, yes. Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given.
February 7, 20187 yr I don't think it is really that costly for performance really. You only need to update the "map" when someone places a block and only check the map when someone tries to break a block. And booleans can be stored as a bit map if you need to keep things compressed (cause you probably need to store this as world save data). EDIT: of course you should keep track of breakable blocks, not unbreakable, since I would expect that the player-placed blocks would be much less than the naturally generated ones. Edited February 7, 20187 yr by jabelar Check out my tutorials here: http://jabelarminecraft.blogspot.com/
February 7, 20187 yr Author Thx, I think I will store unbreakable blocks map on disk arranged by regions/chunks. So I'll only load the map when relatives chunks will be loaded and it wont use too much RAM.
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.