Posted August 3, 20169 yr In Eclipse I'm getting an error on the getValue. The error is: The method getValue(IProperty<T>) in the type IBlockState is not applicable for the arguments (int) In the same file I define the field like this: protected static PropertyInteger burningSides; @Override public int getLightValue(IBlockAccess world, BlockPos pos) { int lightValue = 0; IBlockState state = getActualState(getDefaultState(), world, pos); int burningSides = (Integer)state.getValue(burningSides); switch (burningSides) { case 4: lightValue += (int)((four_side_light_value - three_side_light_value) / (4.0 - 3.0) * burningSides); case 3: lightValue += (int)((three_side_light_value - two_side_light_value) / (3.0 - 2.0) * burningSides); case 2: lightValue += (int)((two_side_light_value - one_side_light_value) / (2.0 - 1.0) * burningSides); case 1: lightValue += one_side_light_value; break; default: break; } lightValue = MathHelper.clamp_int(lightValue, 0, four_side_light_value); return lightValue; } How do I deal with this? I'm following a where this same code does not generate an error. Dev of MoleculeCraft https://github.com/Messorix/MoleculeCraft
August 3, 20169 yr [s]Why not try[/s] [code state.getValue(player).intValue(); Why are you casting to Integer and not int. 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.
August 3, 20169 yr Author Fixed it. The problem was that the property-name and the int name were the same so it couldn't differantiate (is that how you spell that? ) Dev of MoleculeCraft https://github.com/Messorix/MoleculeCraft
August 3, 20169 yr Differentiate 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.