From 1f64e6c4a607dc0a839dd9cebac71a8977197257 Mon Sep 17 00:00:00 2001 From: Sollace Date: Wed, 30 Aug 2023 21:33:48 +0100 Subject: [PATCH] Fixed creative players being able to break an unbreakable floating artefact entity --- .../unicopia/entity/FloatingArtefactEntity.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/java/com/minelittlepony/unicopia/entity/FloatingArtefactEntity.java b/src/main/java/com/minelittlepony/unicopia/entity/FloatingArtefactEntity.java index c450306e..9c860e09 100644 --- a/src/main/java/com/minelittlepony/unicopia/entity/FloatingArtefactEntity.java +++ b/src/main/java/com/minelittlepony/unicopia/entity/FloatingArtefactEntity.java @@ -186,6 +186,11 @@ public class FloatingArtefactEntity extends Entity implements UDamageSources, Ma @Override public boolean damage(DamageSource damageSource, float amount) { + + if (getWorld().isClient || isInvulnerable()) { + return false; + } + if (isInvulnerableTo(damageSource) || !getStack().getItem().damage(damageSource)) { return false; }