Started by
DJ_999
on
Topic category: Help with Minecraft modding (Java Edition)
Alright, so I wanted to make a hydrothermal vent which has 4 blockstates, which are determined by the block below.
Type :
Water
Magma
Lava
None
The state can also be determined by the hydrothermal vent below, which then duplicates the state to the hydrothermal vents above.
The state is also supposed to determine particles coming off of the block.
Now, i keep encountering a problem where the states dont copy from the vent below, but if there is water / lava / magma / anything else below it just copies the corresponding stage!
package net.mcreator.tridacnae.procedures;/* imports omitted */public class HydrothermalOpeningOnTickUpdateProcedure {public static void execute(LevelAccessor world, double x, double y, double z) {if ((world.getBlockState(BlockPos.containing(x, y - 1, z))).getBlock() == TridacnaeModBlocks.HYDROTHERMAL_OPENING.get()) {if (((world.getBlockState(BlockPos.containing(x, y - 1, z))).getBlock().getStateDefinition().getProperty("type") instanceof EnumProperty _getep3 ? (world.getBlockState(BlockPos.containing(x, y - 1, z))).getValue(_getep3).toString() : "").equals("water")) {{String _value = "water";BlockPos _pos = BlockPos.containing(x, y, z);BlockState _bs = world.getBlockState(_pos);if (_bs.getBlock().getStateDefinition().getProperty("type") instanceof EnumProperty _enumProp && _enumProp.getValue(_value).isPresent())world.setBlock(_pos, _bs.setValue(_enumProp, (Enum) _enumProp.getValue(_value).get()), 3);}} else if (((world.getBlockState(BlockPos.containing(x, y - 1, z))).getBlock().getStateDefinition().getProperty("type") instanceof EnumProperty _getep6? (world.getBlockState(BlockPos.containing(x, y - 1, z))).getValue(_getep6).toString(): "").equals("lava")) {{String _value = "lava";BlockPos _pos = BlockPos.containing(x, y, z);BlockState _bs = world.getBlockState(_pos);if (_bs.getBlock().getStateDefinition().getProperty("type") instanceof EnumProperty _enumProp && _enumProp.getValue(_value).isPresent())world.setBlock(_pos, _bs.setValue(_enumProp, (Enum) _enumProp.getValue(_value).get()), 3);}} else if (((world.getBlockState(BlockPos.containing(x, y - 1, z))).getBlock().getStateDefinition().getProperty("type") instanceof EnumProperty _getep9? (world.getBlockState(BlockPos.containing(x, y - 1, z))).getValue(_getep9).toString(): "").equals("magma")) {{String _value = "magma";BlockPos _pos = BlockPos.containing(x, y, z);BlockState _bs = world.getBlockState(_pos);if (_bs.getBlock().getStateDefinition().getProperty("type") instanceof EnumProperty _enumProp && _enumProp.getValue(_value).isPresent())world.setBlock(_pos, _bs.setValue(_enumProp, (Enum) _enumProp.getValue(_value).get()), 3);}}} else {if ((world.getBlockState(BlockPos.containing(x, y - 1, z))).getBlock() == Blocks.WATER) {{String _value = "water";BlockPos _pos = BlockPos.containing(x, y, z);BlockState _bs = world.getBlockState(_pos);if (_bs.getBlock().getStateDefinition().getProperty("type") instanceof EnumProperty _enumProp && _enumProp.getValue(_value).isPresent())world.setBlock(_pos, _bs.setValue(_enumProp, (Enum) _enumProp.getValue(_value).get()), 3);}} else if ((world.getBlockState(BlockPos.containing(x, y - 1, z))).getBlock() == Blocks.LAVA) {{String _value = "lava";BlockPos _pos = BlockPos.containing(x, y, z);BlockState _bs = world.getBlockState(_pos);if (_bs.getBlock().getStateDefinition().getProperty("type") instanceof EnumProperty _enumProp && _enumProp.getValue(_value).isPresent())world.setBlock(_pos, _bs.setValue(_enumProp, (Enum) _enumProp.getValue(_value).get()), 3);}} else if ((world.getBlockState(BlockPos.containing(x, y - 1, z))).getBlock() == Blocks.MAGMA_BLOCK) {{String _value = "magma";BlockPos _pos = BlockPos.containing(x, y, z);BlockState _bs = world.getBlockState(_pos);if (_bs.getBlock().getStateDefinition().getProperty("type") instanceof EnumProperty _enumProp && _enumProp.getValue(_value).isPresent())world.setBlock(_pos, _bs.setValue(_enumProp, (Enum) _enumProp.getValue(_value).get()), 3);}} else {{String _value = "none";BlockPos _pos = BlockPos.containing(x, y, z);BlockState _bs = world.getBlockState(_pos);if (_bs.getBlock().getStateDefinition().getProperty("type") instanceof EnumProperty _enumProp && _enumProp.getValue(_value).isPresent())world.setBlock(_pos, _bs.setValue(_enumProp, (Enum) _enumProp.getValue(_value).get()), 3);}}}if ((world.getBlockState(BlockPos.containing(x, y + 1, z))).getBlock() == Blocks.LAVA || !world.getBlockState(BlockPos.containing(x, y + 1, z)).canOcclude() || (world.getBlockState(BlockPos.containing(x, y + 1, z))).getBlock() == Blocks.AIR|| (world.getBlockState(BlockPos.containing(x, y + 1, z))).getBlock() == Blocks.WATER) {if (((world.getBlockState(BlockPos.containing(x, y, z))).getBlock().getStateDefinition().getProperty("type") instanceof EnumProperty _getep29 ? (world.getBlockState(BlockPos.containing(x, y, z))).getValue(_getep29).toString() : "").equals("water")) {if (world instanceof ServerLevel _level)_level.sendParticles((SimpleParticleType) (TridacnaeModParticleTypes.MIST.get()), x, (y + 1), z, 1, 0.1, 0.2, 0.1, 1);} else if (((world.getBlockState(BlockPos.containing(x, y, z))).getBlock().getStateDefinition().getProperty("type") instanceof EnumProperty _getep32 ? (world.getBlockState(BlockPos.containing(x, y, z))).getValue(_getep32).toString() : "").equals("lava")) {if (world instanceof ServerLevel _level)_level.sendParticles((SimpleParticleType) (TridacnaeModParticleTypes.LAVA_MIST.get()), x, (y + 1), z, 1, 0.1, 0.2, 0.1, 1);} else if (((world.getBlockState(BlockPos.containing(x, y, z))).getBlock().getStateDefinition().getProperty("type") instanceof EnumProperty _getep35 ? (world.getBlockState(BlockPos.containing(x, y, z))).getValue(_getep35).toString() : "").equals("magma")) {if (world instanceof ServerLevel _level)_level.sendParticles((SimpleParticleType) (TridacnaeModParticleTypes.TAR.get()), x, (y + 1), z, 1, 0.1, 0.2, 0.1, 1);}}}}
image of the code :