Skip to content

Commit

Permalink
Workaround for Nuit's Vanishing issues
Browse files Browse the repository at this point in the history
  • Loading branch information
GirafiStudios committed Jan 27, 2021
1 parent c05193a commit 04fd1a4
Showing 1 changed file with 6 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,7 @@ public static void onTarget(LivingSetAttackTargetEvent event) {

@Override
public void onUnequip(String identifier, int index, LivingEntity livingEntity, @Nonnull ItemStack stack) {
//this.setNotInvisible(livingEntity); //TODO. Is for some reason called every tick. Causes issues on servers
}

@Override
public boolean canUnequip(String identifier, LivingEntity livingEntity, @Nonnull ItemStack stack) {
return !livingEntity.isInvisible(); //Temporary workaround
this.setNotInvisible(livingEntity); //TODO. Is for some reason called every tick. Causes issues on servers
}

@Override
Expand All @@ -62,9 +57,11 @@ public void curioTick(String identifier, int index, LivingEntity livingEntity, @
if (!isLivingEntityMoving(livingEntity)) {
INVISIBLE.replace(livingEntity, true);
if (!world.isRemote) {
stack.damageItem(1, livingEntity, (entity) -> {
entity.sendBreakAnimation(entity.getActiveHand());
});
if (world.rand.nextDouble() <= 0.50D) {
stack.damageItem(1, livingEntity, (entity) -> {
entity.sendBreakAnimation(entity.getActiveHand());
});
}
livingEntity.setInvisible(true);
}
} else {
Expand Down

0 comments on commit 04fd1a4

Please sign in to comment.