Skip to content

Commit

Permalink
flush
Browse files Browse the repository at this point in the history
  • Loading branch information
Globox1997 committed Nov 21, 2023
1 parent 1d37df8 commit e79345e
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/main/java/net/rpgz/mixin/MobEntityMixin.java
Original file line number Diff line number Diff line change
Expand Up @@ -215,9 +215,10 @@ public ActionResult interactAt(PlayerEntity player, Vec3d hitPos, Hand hand) {
if (this.deathTime > 20) {
if (!this.getWorld().isClient()) {
if (player.getStackInHand(hand).getItem() instanceof ShovelItem) {
if (!this.inventory.isEmpty())
if (!this.inventory.isEmpty()) {
for (int i = 0; i < this.inventory.size(); i++)
player.getInventory().offerOrDrop(this.inventory.getStack(i));
}
this.inventory.clear();
if (!ConfigInit.CONFIG.despawn_immediately_when_empty) {
this.despawnParticlesServer();
Expand All @@ -227,11 +228,13 @@ public ActionResult interactAt(PlayerEntity player, Vec3d hitPos, Hand hand) {
}
if (!this.inventory.isEmpty()) {
if (player.isSneaking()) {
for (int i = 0; i < this.inventory.size(); i++)
for (int i = 0; i < this.inventory.size(); i++) {
player.getInventory().offerOrDrop(this.inventory.getStack(i));
}
this.inventory.clear();
} else
} else {
player.openHandledScreen(new SimpleNamedScreenHandlerFactory((syncId, inv, p) -> new MobEntityScreenHandler(syncId, p.getInventory(), this.inventory), Text.literal("")));
}
return ActionResult.SUCCESS;
}
} else if ((Object) this instanceof PlayerEntity) {
Expand Down

0 comments on commit e79345e

Please sign in to comment.