use of com.simibubi.create.content.contraptions.base.GeneratingKineticTileEntity in project Create by Creators-of-Create.
the class IWrenchable method onWrenched.
default InteractionResult onWrenched(BlockState state, UseOnContext context) {
Level world = context.getLevel();
BlockState rotated = getRotatedBlockState(state, context.getClickedFace());
if (!rotated.canSurvive(world, context.getClickedPos()))
return InteractionResult.PASS;
KineticTileEntity.switchToBlockState(world, context.getClickedPos(), updateAfterWrenched(rotated, context));
BlockEntity te = context.getLevel().getBlockEntity(context.getClickedPos());
if (te instanceof GeneratingKineticTileEntity) {
((GeneratingKineticTileEntity) te).reActivateSource = true;
}
if (world.getBlockState(context.getClickedPos()) != state)
playRotateSound(world, context.getClickedPos());
return InteractionResult.SUCCESS;
}
Aggregations