Fix async sound play causes farms not to work

This commit is contained in:
ceze88 2024-02-10 13:12:11 +01:00
parent ec2c019745
commit 10924217a7
1 changed files with 7 additions and 7 deletions

View File

@ -63,15 +63,15 @@ public class ModuleAutoButcher extends Module {
return;
}
for (LivingEntity entity : entities) {
entity.setMetadata("EFA-TAGGED", new FixedMetadataValue(this.plugin, farm.getLocation()));
XSound.ENTITY_PLAYER_ATTACK_SWEEP.play(entity);
Bukkit.getScheduler().runTask(this.plugin, () -> {
Bukkit.getScheduler().runTask(this.plugin, () -> {
for (LivingEntity entity : entities) {
entity.setMetadata("EFA-TAGGED", new FixedMetadataValue(this.plugin, farm.getLocation()));
XSound.ENTITY_PLAYER_ATTACK_SWEEP.play(entity);
entity.damage(99999999, entity);
Methods.animate(farm.getLocation(), XMaterial.IRON_SWORD);
});
return;
}
}
});
}
@Override