Fix log didn't drop ItemStack if it destroyed

This commit is contained in:
Ste3et_C0st 2021-04-11 19:27:16 +02:00
parent dbcd8baac3
commit 3dc190e76e
2 changed files with 9 additions and 1 deletions

View File

@ -7,7 +7,7 @@
<furniture.tag></furniture.tag>
</properties>
<version>3.4.6${furniture.tag}</version>
<version>3.4.7${furniture.tag}</version>
<build>
<defaultGoal>clean package install</defaultGoal>
<sourceDirectory>src</sourceDirectory>

View File

@ -55,6 +55,14 @@ public class log extends Furniture implements Listener{
if(getObjID().getSQLAction().equals(SQLAction.REMOVE)) return;
if(player == null) return;
if(canBuild(player)) {
fEntity entity = entityByCustomName(this.mode + "");
if(entity != null) {
if(entity.getItemInMainHand() != null) {
if(entity.getItemInMainHand().getType() != Material.AIR) {
player.getWorld().dropItemNaturally(getCenter().add(0, 1, 0), entity.getItemInMainHand());
}
}
}
this.destroy(player);
}
}