Jump to content

[1.12.2] [Solved] Adding/Changing Block properties in world.


Recommended Posts

Posted (edited)

I am trying to see if I would be able to add new properties to a block that already exists in the world, or change the values of a block property in the world.
Currently any time I try to run my code to test, it freezes at the initalization of the Propertys

 

public static final PropertyInteger tempProp = PropertyInteger.create("temp", 0, 2000000000);
public static final PropertyBool sourceProp = PropertyBool.create("tempSource");
	

 

The reason I am wanting to do this is to make an api to handle block temps, and adding/updating temps on blocks in the world. 

What we were currently planning on doing, was to have certain blocks be sources of a temp, like lava or torches, and that would slowly heat up blocks around it until all the blocks in a certain area had a temp value, and have a few events check every second to update the players temp and what not. 

 

The updates would be slow, but also somewhat realistic, lighting a fire wont instantly make the room hot, it would take a bit to warm up.

The only way that I could think to make this happen was to store the temps on the blocks and check the properties when we are looking for them.

 

**SOLVED**

 

Dont make the number so high, since it makes each of the files the max is too high it adds 4 billions states, I changed it to 2k and it works

Edited by Elrol_Arrowsend
Solved
Posted
28 minutes ago, Elrol_Arrowsend said:

2000000000

When you apply this and the boolean value do you have any idea how many IBlockState values are created?

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Posted
3 minutes ago, Elrol_Arrowsend said:

or does it make every blockstate value  between the max and the min?

It makes every blockstate value at startup. 2,000,000,000 is way too many. That's 4,000,000,000 block states for blocks that dont have other properties. Imagine redstone. Also this wont work in 1.14 so you'd be better off with a chunk capability that stores an integer for every block position.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

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.