Skip to content

Commit

Permalink
fix Snull Entity Halite Dust interaction
Browse files Browse the repository at this point in the history
  • Loading branch information
luxtracon committed May 24, 2024
1 parent 41aa84c commit 6fd0840
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,12 @@ public SnullEntity(EntityType<? extends SnullEntity> 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);
}

Expand Down Expand Up @@ -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);
}
Expand Down

0 comments on commit 6fd0840

Please sign in to comment.