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.network.chat.Component;
|
||||||
import net.minecraft.world.entity.item.ItemEntity;
|
import net.minecraft.world.entity.item.ItemEntity;
|
||||||
import net.minecraft.world.item.ItemStack;
|
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.entity.BlockEntityType;
|
||||||
import net.minecraft.world.level.block.state.BlockState;
|
import net.minecraft.world.level.block.state.BlockState;
|
||||||
import net.minecraft.world.phys.Vec3;
|
import net.minecraft.world.phys.Vec3;
|
||||||
@@ -82,13 +83,17 @@ public class BlastFurnaceHatchBlockEntity extends SmartBlockEntity implements IH
|
|||||||
public void dropItems(){
|
public void dropItems(){
|
||||||
|
|
||||||
if(level.getBlockState(getBlockPos().below()).isAir()){
|
if(level.getBlockState(getBlockPos().below()).isAir()){
|
||||||
Vec3 dropVec = VecHelper.getCenterOf(worldPosition)
|
if (inventory.getItem(0).getItem() == Items.AIR){
|
||||||
.add(0, -12 / 16f, 0);
|
return;
|
||||||
ItemEntity dropped = new ItemEntity(level, dropVec.x, dropVec.y, dropVec.z, inventory.getItem(0).copy());
|
} else {
|
||||||
dropped.setDefaultPickUpDelay();
|
Vec3 dropVec = VecHelper.getCenterOf(worldPosition)
|
||||||
dropped.setDeltaMovement(0, -.25f, 0);
|
.add(0, -12 / 16f, 0);
|
||||||
level.addFreshEntity(dropped);
|
ItemEntity dropped = new ItemEntity(level, dropVec.x, dropVec.y, dropVec.z, inventory.getItem(0).copy());
|
||||||
inventory.setStackInSlot(0, ItemStack.EMPTY);
|
dropped.setDefaultPickUpDelay();
|
||||||
|
dropped.setDeltaMovement(0, -.25f, 0);
|
||||||
|
level.addFreshEntity(dropped);
|
||||||
|
inventory.setStackInSlot(0, ItemStack.EMPTY);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user