package org.litkoit.herobrine_em.blocks.extended; import net.minecraft.block.Block; import net.minecraft.block.BlockState; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.util.ActionResultType; import net.minecraft.util.Hand; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockRayTraceResult; import net.minecraft.util.text.ITextComponent; import net.minecraft.world.World; import org.litkoit.herobrine_em.util.BlockStateModMenager; public class CleanCore extends Block { public CleanCore(Properties p_i48440_1_) { super(p_i48440_1_); } @Override public ActionResultType onBlockActivated(BlockState blockState, World world, BlockPos blockPos, PlayerEntity player, Hand hand, BlockRayTraceResult rayTraceResult) { if (!world.isRemote){ BlockState[][][] blockStates = BlockStateModMenager.getBlockStatesInCube(world, blockPos); player.sendMessage(ITextComponent.getTextComponentOrEmpty(blockStates[0][0][0].toString()), player.getUniqueID()); } return super.onBlockActivated(blockState, world, blockPos, player, hand, rayTraceResult); } }
Forge 1.16.5