try to fix server side crashes (again)

This commit is contained in:
2026-03-28 18:01:27 +01:00
parent 40c83d029e
commit 2ce0182cb2
4 changed files with 13 additions and 16 deletions
@@ -1,5 +1,6 @@
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;
@@ -8,6 +9,8 @@ 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) {
@@ -24,7 +27,7 @@ public class ShrineOfRemembranceBlock extends Block {
Player player, InteractionHand hand,
net.minecraft.world.phys.BlockHitResult hit) {
if (level.isClientSide) {
net.minecraft.client.Minecraft.getInstance().setScreen(new net.fretux.ascend.client.screen.ShrineScreen());
DistExecutor.unsafeRunWhenOn(Dist.CLIENT, () -> () -> ClientPacketHandlers.openShrineScreen(false));
return InteractionResult.SUCCESS;
}
return InteractionResult.CONSUME;