Skip to content

Commit

Permalink
fixed rift spectator crash #620
Browse files Browse the repository at this point in the history
  • Loading branch information
mrsterner committed Jun 16, 2024
1 parent f2ab00d commit 775d0fd
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
package ladysnake.requiem.common.block.obelisk;

import ladysnake.requiem.Requiem;
import ladysnake.requiem.api.v1.block.ObeliskDescriptor;
import ladysnake.requiem.api.v1.block.ObeliskRune;
import ladysnake.requiem.api.v1.block.VagrantTargetableBlock;
import ladysnake.requiem.api.v1.remnant.RemnantComponent;
Expand Down Expand Up @@ -103,7 +104,10 @@ public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEnt
@Override
public @Nullable NamedScreenHandlerFactory createScreenHandlerFactory(BlockState state, World world, BlockPos pos) {
if (world.getBlockEntity(pos) instanceof RunestoneBlockEntity controller) {
return new RiftScreenHandlerFactory(controller.getDescriptor().orElseThrow(), controller::canBeUsedBy);
Optional<ObeliskDescriptor> optionalObeliskDescriptor = controller.getDescriptor();
if (optionalObeliskDescriptor.isPresent()) {
return new RiftScreenHandlerFactory(optionalObeliskDescriptor.get(), controller::canBeUsedBy);
}
}
return null;
}
Expand Down

0 comments on commit 775d0fd

Please sign in to comment.