Skip to content

Commit b6ca717

Browse files
committed
use internal blockstate for BlockEntity#block
this fixes moving piston blockentity returning its moved state
1 parent c2c1f98 commit b6ca717

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/mixins/java/org/spongepowered/common/mixin/api/minecraft/world/level/block/entity/BlockEntityMixin_API.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ public abstract class BlockEntityMixin_API implements BlockEntity {
6363
@Shadow @Final private net.minecraft.world.level.block.entity.BlockEntityType<?> type;
6464
@Shadow protected net.minecraft.world.level.Level level;
6565
@Shadow protected boolean remove;
66+
@Shadow private net.minecraft.world.level.block.state.BlockState blockState;
6667
@Shadow public abstract BlockPos shadow$getBlockPos();
6768
@Shadow public abstract CompoundTag shadow$saveWithFullMetadata(HolderLookup.Provider $$0);
6869
@Shadow @Final protected BlockPos worldPosition;
@@ -179,7 +180,7 @@ public final BlockEntityType type() {
179180

180181
@Override
181182
public BlockState block() {
182-
return (BlockState) this.level.getBlockState(this.shadow$getBlockPos());
183+
return (BlockState) this.blockState;
183184
}
184185

185186
@Override

0 commit comments

Comments
 (0)