From 6fd08404fcd7b0d00b8d0017712dc34964908021 Mon Sep 17 00:00:00 2001 From: luxtracon Date: Fri, 24 May 2024 19:21:58 +0200 Subject: [PATCH] fix Snull Entity Halite Dust interaction --- .../com/axanthic/icaria/common/entity/SnullEntity.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/axanthic/icaria/common/entity/SnullEntity.java b/src/main/java/com/axanthic/icaria/common/entity/SnullEntity.java index f125f489d..dbabfa924 100644 --- a/src/main/java/com/axanthic/icaria/common/entity/SnullEntity.java +++ b/src/main/java/com/axanthic/icaria/common/entity/SnullEntity.java @@ -61,12 +61,12 @@ public SnullEntity(EntityType pType, Level pLevel) { } public boolean doHide() { - return !this.onCooldown() && !this.onHide() && !this.onShow() && this.getHealth() < 4.0F; + return !this.onCooldown() && !this.onHide() && !this.onShow(); } @Override public boolean hurt(DamageSource pSource, float pAmount) { - if (this.doHide()) { + if (this.doHide() && this.getHealth() < 4.0F) { this.setHide(this.maxHide); } @@ -289,7 +289,10 @@ public InteractionResult mobInteract(Player pPlayer, InteractionHand pHand) { if (!this.level().isClientSide()) { pPlayer.awardStat(Stats.ITEM_USED.get(IcariaItems.HALITE_DUST.get())); this.hurt(this.damageSources().generic(), 1.0F); - this.setHide(this.maxHide); + if (this.doHide()) { + this.setHide(this.maxHide); + } + if (!pPlayer.isCreative()) { itemStack.shrink(1); }