36 lines
1.3 KiB
Java
36 lines
1.3 KiB
Java
package net.fretux.ascend.block;
|
|
|
|
import net.fretux.ascend.client.ClientPacketHandlers;
|
|
import net.minecraft.core.BlockPos;
|
|
import net.minecraft.world.InteractionHand;
|
|
import net.minecraft.world.InteractionResult;
|
|
import net.minecraft.world.entity.player.Player;
|
|
import net.minecraft.world.level.Level;
|
|
import net.minecraft.world.level.block.Block;
|
|
import net.minecraft.world.level.block.RenderShape;
|
|
import net.minecraft.world.level.block.state.BlockState;
|
|
import net.minecraftforge.api.distmarker.Dist;
|
|
import net.minecraftforge.fml.DistExecutor;
|
|
|
|
public class ShrineOfRemembranceBlock extends Block {
|
|
public ShrineOfRemembranceBlock(Properties props) {
|
|
super(props);
|
|
}
|
|
|
|
@Override
|
|
public RenderShape getRenderShape(BlockState state) {
|
|
return RenderShape.MODEL;
|
|
}
|
|
|
|
@Override
|
|
public InteractionResult use(BlockState state, Level level, BlockPos pos,
|
|
Player player, InteractionHand hand,
|
|
net.minecraft.world.phys.BlockHitResult hit) {
|
|
if (level.isClientSide) {
|
|
DistExecutor.unsafeRunWhenOn(Dist.CLIENT, () -> () -> ClientPacketHandlers.openShrineScreen(false));
|
|
return InteractionResult.SUCCESS;
|
|
}
|
|
return InteractionResult.CONSUME;
|
|
}
|
|
}
|