Fix compressed sieve not dropping sieve mesh

This commit is contained in:
thedarkcolour 2024-04-21 12:09:10 -07:00
parent 209f328aee
commit 09323117ad
No known key found for this signature in database
GPG Key ID: 86B37B3575FD5976

View File

@ -21,13 +21,13 @@ package thedarkcolour.exdeorum.block;
import net.minecraft.core.BlockPos;
import net.minecraft.world.level.BlockGetter;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.entity.BlockEntity;
import net.minecraft.world.level.block.entity.BlockEntityType;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.phys.shapes.CollisionContext;
import net.minecraft.world.phys.shapes.Shapes;
import net.minecraft.world.phys.shapes.VoxelShape;
import thedarkcolour.exdeorum.blockentity.SieveBlockEntity;
import thedarkcolour.exdeorum.blockentity.AbstractSieveBlockEntity;
import thedarkcolour.exdeorum.registry.EBlockEntities;
import java.util.function.Supplier;
@ -58,7 +58,7 @@ public class SieveBlock extends EBlock {
public void onRemove(BlockState state, Level level, BlockPos pos, BlockState newState, boolean pIsMoving) {
if (!level.isClientSide) {
if (!state.is(newState.getBlock())) {
if (level.getBlockEntity(pos) instanceof SieveBlockEntity sieve) {
if (level.getBlockEntity(pos) instanceof AbstractSieveBlockEntity sieve) {
var mesh = sieve.getLogic().getMesh();
if (!mesh.isEmpty()) {