Jump to content

Mod Loading Order/Creating Blocks at Runtime


TheMasterGabriel

Recommended Posts

It's not fake, exactly. It's real. If another mod gives the player the ability to teleport to any dimension, they could go there. But as there's nothing there (void generation) and because the data that is there isn't really "permanent" they can't screw anything up.

 

For your use--as you intend to actually save the blocks in that dimension and use them as real blocks--you'll want a better pos->pos hash function.  I can't make any suggestions though.  You could try a 4D to 3D projection (you're trying to map [dim, x, y, z] to [x, y, z] with as few collisions as possible, but knowing that the data set is going to be relatively sparse: more likely for a block to exist at x+1, y+1, or z+1 than it will at dim+1 or x+2971,z+4128).

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.

Link to comment
Share on other sites

13 minutes ago, Draco18s said:

You could try a 4D to 3D projection

 

Hmm, that's a really interesting idea. And it would certainly reduce the possibility of a collision. Although I might run into the problem with the hash extending beyond the MC world size. I'll give it a go, and see if I can come up with something along the way.

Link to comment
Share on other sites

Although thinking about it some more, I don't really need to project 4D to 3D. I just need a 4D vector that hashes to a long value between the min/max values of BlockPos#toLong. Any idea what those min/max values are? I assume they would just be 

(new BlockPos(-2999984, 0, -2999984)).toLong()

and

(new BlockPos(2999984, 255, 2999984)).toLong()

. I'm not sure though. The bit math is beyond me.

Link to comment
Share on other sites

The thing is, for positions that are near each other in the same dimension, you'll want coordinates that get hashed to be near each other as well: so that large patches of your block don't chunk-load hundreds of storage dimension chunks. 

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.

Link to comment
Share on other sites

On 3/21/2017 at 1:43 PM, diesieben07 said:

In case of LIQUID delegate to the forge liquid model.

1

Is there an actual Liquid model that I can get a list of quads from? All I can seem to find is Vanilla's BlockFluidRenderer. I see that Forge adds ModelFluid, but I'm not sure how to fetch the baked model.

 

On 3/25/2017 at 1:19 AM, Draco18s said:

you'll want coordinates that get hashed to be near each other as well

 

I hadn't thought about that. Yes, I agree. I'll have to work that into it as well.

Link to comment
Share on other sites

I'm still trying to figure out how to make my block look like the block it is supposed to be copying. As of now, everything but fluids render correctly. I was just wondering if I could fetch a fluid model as easily as I can fetch the model for an ordinary block.

23 minutes ago, diesieben07 said:

You call IModel::bake

 

So I'm doing this within my block model's getQuads method? If yes, where do I get the parameters for the method. If not, then where.

Also, I wouldn't think I needed to create a new ModelFluid instance when I wanted to render my block. Do I have to manually cache them, or is there a list somewhere already? The same applies for BakedFluid (are they cached somewhere where I can access them?).

Link to comment
Share on other sites

Alright, I tried to no avail. It's strange, however. It looks like all the baking is done, as I tried it with a print statement and it ran. However, the block is still invisible. Here is a pastebin link to my code if you have any idea what I'm doing wrong/not understanding.

 

Also, is it possible to make it so that the breaking texture for my block is copied as well? Currently, the breaking texture is just the missing texture.

Edited by TheMasterGabriel
Link to comment
Share on other sites

2 hours ago, TheMasterGabriel said:

However, the block is still invisible.

 
 

Alright, I think I found the problem. It looks like ModelFluid and BakedFluid are only compatible with Forge's fluid system. They require IExtendedBlockStates, which Forge's fluid have but the vanilla ones do not. When Forge's fluid model doesn't have an IExtendedBlockState (ModelFluid#bake is hardcoded to pass null), it just returns the "inventory" model (which is probably used for Forge's universal bucket). The reason my block was invisible was because that quad list was supposed to be rendered in the inventory, not in the world. (The returned list only has 1 quad, as oppose to the 6 it should have). If I can't find an alternative, I might end up having to write my own baked model for vanilla liquids (or any modded fluid that isn't made with the Forge stuff).

Edited by TheMasterGabriel
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.