From 184a583094edf1886ac4c17a53c0d7a31475f7b0 Mon Sep 17 00:00:00 2001 From: Ivan Kh <47220198+Ivan-Khar@users.noreply.github.com> Date: Sun, 3 Dec 2023 22:37:16 +0300 Subject: [PATCH] use cachedState instead of world.getBlockState --- .../dev/hybridlabs/aquatic/block/entity/GiantClamBlockEntity.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/kotlin/dev/hybridlabs/aquatic/block/entity/GiantClamBlockEntity.kt b/src/main/kotlin/dev/hybridlabs/aquatic/block/entity/GiantClamBlockEntity.kt index 78d65db5e..a040da509 100644 --- a/src/main/kotlin/dev/hybridlabs/aquatic/block/entity/GiantClamBlockEntity.kt +++ b/src/main/kotlin/dev/hybridlabs/aquatic/block/entity/GiantClamBlockEntity.kt @@ -20,7 +20,7 @@ class GiantClamBlockEntity(pos: BlockPos, state: BlockState) : BlockEntity(Hybri private fun predicate(event: AnimationState): 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