chore: remove player electrocution on block usage
This commit is contained in:
1 parent
632772b666
commit
a558428b58
1 file changed
-16
@@ -65,13 +65,6 @@ public class MagicalCrafterBlock extends BlockWithEntity {
|
|||||||
if (!world.isClient) {
|
if (!world.isClient) {
|
||||||
MagicMod.LOGGER.info("Block was used at location {}", pos.toShortString());
|
MagicMod.LOGGER.info("Block was used at location {}", pos.toShortString());
|
||||||
|
|
||||||
MagicMod.LOGGER.info("Electrocuting player...");
|
|
||||||
BlockPos playerPos = player.getBlockPos();
|
|
||||||
LightningEntity lightningEntity = new LightningEntity(EntityType.LIGHTNING_BOLT, world);
|
|
||||||
lightningEntity.setPosition(playerPos.toCenterPos());
|
|
||||||
world.spawnEntity(lightningEntity);
|
|
||||||
MagicMod.LOGGER.info("Player electrocuted.");
|
|
||||||
|
|
||||||
NamedScreenHandlerFactory screenFactory = state.createScreenHandlerFactory(world, pos);
|
NamedScreenHandlerFactory screenFactory = state.createScreenHandlerFactory(world, pos);
|
||||||
if (screenFactory != null) {
|
if (screenFactory != null) {
|
||||||
player.openHandledScreen(screenFactory);
|
player.openHandledScreen(screenFactory);
|
||||||
@@ -84,15 +77,6 @@ public class MagicalCrafterBlock extends BlockWithEntity {
|
|||||||
return ActionResult.SUCCESS;
|
return ActionResult.SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
// @Override
|
|
||||||
// public NamedScreenHandlerFactory createScreenHandlerFactory(BlockState state, World world, BlockPos pos) {
|
|
||||||
// return new SimpleNamedScreenHandlerFactory(
|
|
||||||
// ((syncId, playerInventory, player) ->
|
|
||||||
// new MagicalCraftingScreenHandler(syncId, playerInventory, ScreenHandlerContext.create(world, pos))),
|
|
||||||
// Text.translatable("container.magical_crafting_table")
|
|
||||||
// );
|
|
||||||
// }
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BlockEntity createBlockEntity(BlockPos pos, BlockState state) {
|
public BlockEntity createBlockEntity(BlockPos pos, BlockState state) {
|
||||||
return new MagicalCrafterBlockEntity(pos, state);
|
return new MagicalCrafterBlockEntity(pos, state);
|
||||||
|
|||||||
Reference in new issue
Block a user