Skip to content

Commit

Permalink
fix: fix crash when loading into world while sitting on toilet
Browse files Browse the repository at this point in the history
  • Loading branch information
TheClashFruit committed Aug 28, 2024
1 parent 0387907 commit c5340f2
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,10 @@ public void pissOnToilet(PlayerEntity player, MechanicalToiletBlock toiletBlock,
if (pissLevel >= 1) {
this.pissLevel -= 1;

if (world.getBlockEntity(toiletPos) instanceof MechanicalToiletBlockEntity toiletEntity) {
toiletEntity.addPiss(10);
if (toiletPos != null) {
if (world.getBlockEntity(toiletPos) instanceof MechanicalToiletBlockEntity toiletEntity) {
toiletEntity.addPiss(10);
}
}
}

Expand Down

0 comments on commit c5340f2

Please sign in to comment.