Posted February 22, 20196 yr In 1.12 I was using block.getActualState() to activate "cosmetic-only" properties in one of my blocks. Basically, the block change texture (choosing from 5 different ones) depending on a values stored by the block tile entity. The on-disk metadata of that block was always zero In 1.13 getActualState is gone: should I actualy change the blockstate of the block every time the value in the TE change (causing chunk updates on the server for no reasons) or is there any other way to do so? I known extended block states exist but I don't understand how to use then with my blockstate jsons thank you guys!
February 23, 20196 yr The method getActualState() no longer exists due to the flattening. Now you can either treat your states as blockstate like fences do, use extended states, or use TEs.
February 23, 20196 yr Author Yeah I noticed that. I was looking into extended states but from what I understand I can only work with unlisted properties in extended states, that is, properties that are not in the block json blockstate file. Unless I'm wrong :) In my blockstate I have a TYPE property with values between 0 (default/black texture) and 4 (red texture), the color to use is stored in the block TE. In 1.12.2 my getMetaFromState() always returned 0 (so TYPE=0), leaving getActualState() to set TYPE to the color stored by the TE Can I do this with extended states? Thank you!
February 24, 20196 yr Author I'm sorry, I know that my property name is a bit misleading. Those are not 5 different blocks, it's basically a chest that show how full it is by changing it's texture. The TE compute the value for the TYPE property (0/black = empty, 4/red = full, and values in between) and my old getActualState() return the corresponding value for the blockstate json property. Could this be done using extended state and my current blockstate json or should I call world.setBlockState() every time the amount of stuff in the chest change between one TYPE and the other?
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.