Check if player can destroy block using an tool

Prevents players to destroy blocks when holding a sword or trident in creative
This commit is contained in:
Alexander Medvedev committed 2025-03-04 19:45:39 +01:00
1 parent cccdf53e7c
commit e055dd740c
24 files changed
+3497 -123

No files matched your search

+3 -1
View File
@@ -64,7 +64,9 @@ impl ExperienceOrbEntity {
#[async_trait]
impl EntityBase for ExperienceOrbEntity {
async fn tick(&self, _: &Server) {
async fn tick(&self, server: &Server) {
self.entity.tick(server).await;
let age = self
.orb_age
.fetch_add(1, std::sync::atomic::Ordering::Relaxed);