Refactored StaliniumPressBlock for code formatting consistency and improved readability.
This commit is contained in:
@@ -22,6 +22,7 @@ import org.jetbrains.annotations.Nullable;
|
|||||||
|
|
||||||
public class StaliniumPressBlock extends BaseEntityBlock {
|
public class StaliniumPressBlock extends BaseEntityBlock {
|
||||||
public static final MapCodec<StaliniumPressBlock> CODEC = simpleCodec(StaliniumPressBlock::new);
|
public static final MapCodec<StaliniumPressBlock> CODEC = simpleCodec(StaliniumPressBlock::new);
|
||||||
|
|
||||||
public StaliniumPressBlock(Properties properties) {
|
public StaliniumPressBlock(Properties properties) {
|
||||||
super(properties);
|
super(properties);
|
||||||
}
|
}
|
||||||
@@ -33,7 +34,7 @@ public class StaliniumPressBlock extends BaseEntityBlock {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public @Nullable BlockEntity newBlockEntity(BlockPos blockPos, BlockState blockState) {
|
public @Nullable BlockEntity newBlockEntity(BlockPos blockPos, BlockState blockState) {
|
||||||
return net.krituximon.stalinium.block.entity.ModBlockEntities.STALINIUM_PRESS_BE.get().create(blockPos, blockState) ;
|
return net.krituximon.stalinium.block.entity.ModBlockEntities.STALINIUM_PRESS_BE.get().create(blockPos, blockState);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -49,7 +50,6 @@ public class StaliniumPressBlock extends BaseEntityBlock {
|
|||||||
StaliniumPressBlockEntity.drops();
|
StaliniumPressBlockEntity.drops();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
super.onRemove(pState, pLevel, pPos, pNewState, pIsMoving);
|
super.onRemove(pState, pLevel, pPos, pNewState, pIsMoving);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -58,7 +58,7 @@ public class StaliniumPressBlock extends BaseEntityBlock {
|
|||||||
Player pPlayer, InteractionHand pHand, BlockHitResult pHitResult) {
|
Player pPlayer, InteractionHand pHand, BlockHitResult pHitResult) {
|
||||||
if (!pLevel.isClientSide()) {
|
if (!pLevel.isClientSide()) {
|
||||||
BlockEntity entity = pLevel.getBlockEntity(pPos);
|
BlockEntity entity = pLevel.getBlockEntity(pPos);
|
||||||
if(entity instanceof StaliniumPressBlockEntity staliniumPressBlockEntity) {
|
if (entity instanceof StaliniumPressBlockEntity staliniumPressBlockEntity) {
|
||||||
((ServerPlayer) pPlayer).openMenu(new SimpleMenuProvider(staliniumPressBlockEntity, Component.literal("Stalinium Press")), pPos);
|
((ServerPlayer) pPlayer).openMenu(new SimpleMenuProvider(staliniumPressBlockEntity, Component.literal("Stalinium Press")), pPos);
|
||||||
} else {
|
} else {
|
||||||
throw new IllegalStateException("Our Container provider is missing!");
|
throw new IllegalStateException("Our Container provider is missing!");
|
||||||
@@ -70,7 +70,7 @@ public class StaliniumPressBlock extends BaseEntityBlock {
|
|||||||
@Nullable
|
@Nullable
|
||||||
@Override
|
@Override
|
||||||
public <T extends BlockEntity> BlockEntityTicker<T> getTicker(Level level, BlockState state, BlockEntityType<T> blockEntityType) {
|
public <T extends BlockEntity> BlockEntityTicker<T> getTicker(Level level, BlockState state, BlockEntityType<T> blockEntityType) {
|
||||||
if(level.isClientSide()) {
|
if (level.isClientSide()) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user