Skip to content

Commit

Permalink
use cachedState instead of world.getBlockState
Browse files Browse the repository at this point in the history
  • Loading branch information
Ivan-Khar committed Dec 3, 2023
1 parent 4201a39 commit 184a583
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class GiantClamBlockEntity(pos: BlockPos, state: BlockState) : BlockEntity(Hybri

private fun <E> predicate(event: AnimationState<E>): PlayState where E : BlockEntity?, E : GeoAnimatable {
return if (world != null) {
if(world!!.getBlockState(pos).get(GiantClamBlock.CLAM_HAS_PEARL)) event.controller.setAnimation(OPEN_ANIMATION)
if(cachedState.get(GiantClamBlock.CLAM_HAS_PEARL)) event.controller.setAnimation(OPEN_ANIMATION)
else event.controller.setAnimation(CLOSED_ANIMATION)

PlayState.CONTINUE
Expand Down

0 comments on commit 184a583

Please sign in to comment.