Fix #251
This commit is contained in:
@@ -16,6 +16,7 @@ import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.world.entity.item.ItemEntity;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.item.Items;
|
||||
import net.minecraft.world.level.block.entity.BlockEntityType;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.phys.Vec3;
|
||||
@@ -82,6 +83,9 @@ public class BlastFurnaceHatchBlockEntity extends SmartBlockEntity implements IH
|
||||
public void dropItems(){
|
||||
|
||||
if(level.getBlockState(getBlockPos().below()).isAir()){
|
||||
if (inventory.getItem(0).getItem() == Items.AIR){
|
||||
return;
|
||||
} else {
|
||||
Vec3 dropVec = VecHelper.getCenterOf(worldPosition)
|
||||
.add(0, -12 / 16f, 0);
|
||||
ItemEntity dropped = new ItemEntity(level, dropVec.x, dropVec.y, dropVec.z, inventory.getItem(0).copy());
|
||||
@@ -91,6 +95,7 @@ public class BlastFurnaceHatchBlockEntity extends SmartBlockEntity implements IH
|
||||
inventory.setStackInSlot(0, ItemStack.EMPTY);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void read(CompoundTag compound, HolderLookup.Provider registries, boolean clientPacket) {
|
||||
|
||||
Reference in New Issue
Block a user