Skip to content

Commit

Permalink
Updated image item drop location
Browse files Browse the repository at this point in the history
- Updated ItemService#onAttack() listener

> Related to #10
  • Loading branch information
josemmo committed Dec 26, 2021
1 parent 5710f5a commit dcbea17
Showing 1 changed file with 2 additions and 1 deletion.
Expand Up @@ -154,8 +154,9 @@ public boolean onAttack(@NotNull Player player, @NotNull Block block, @NotNull B
if (player.getGameMode() == GameMode.SURVIVAL && image.hasFlag(FakeImage.FLAG_DROPPABLE)) {
ImageFile imageFile = Objects.requireNonNull(image.getFile());
ItemStack imageItem = getImageItem(imageFile, 1, image.getWidth(), image.getHeight());
Location dropLocation = location.clone().add(0.5, -0.5, 0.5).add(face.getDirection());
Bukkit.getScheduler().scheduleSyncDelayedTask(plugin, () -> {
block.getWorld().dropItem(location, imageItem);
block.getWorld().dropItem(dropLocation, imageItem);
});
}

Expand Down

0 comments on commit dcbea17

Please sign in to comment.