mirror of
https://github.com/Sollace/Unicopia.git
synced 2024-12-17 23:48:00 +01:00
Add a natural decay to corruption
This commit is contained in:
parent
f4579d21f5
commit
5fbe0f1fb9
2 changed files with 19 additions and 1 deletions
|
@ -24,7 +24,6 @@ import net.minecraft.entity.EntityPose;
|
||||||
import net.minecraft.entity.EntityType;
|
import net.minecraft.entity.EntityType;
|
||||||
import net.minecraft.entity.EquipmentSlot;
|
import net.minecraft.entity.EquipmentSlot;
|
||||||
import net.minecraft.entity.LightningEntity;
|
import net.minecraft.entity.LightningEntity;
|
||||||
import net.minecraft.entity.attribute.EntityAttributeInstance;
|
|
||||||
import net.minecraft.entity.damage.DamageSource;
|
import net.minecraft.entity.damage.DamageSource;
|
||||||
import net.minecraft.entity.player.PlayerEntity;
|
import net.minecraft.entity.player.PlayerEntity;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
|
@ -407,6 +407,25 @@ public class Pony extends Living<PlayerEntity> implements Copyable<Pony>, Update
|
||||||
this.hasShades = hasShades;
|
this.hasShades = hasShades;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!isClient() && !UItems.ALICORN_AMULET.isApplicable(entity)) {
|
||||||
|
if (entity.age % (10 * ItemTracker.SECONDS) == 0) {
|
||||||
|
if (entity.world.random.nextInt(100) == 0) {
|
||||||
|
corruption.add(-1);
|
||||||
|
setDirty();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (entity.getHealth() >= entity.getMaxHealth() - 1 && !entity.getHungerManager().isNotFull()) {
|
||||||
|
corruption.add(-entity.world.random.nextInt(4));
|
||||||
|
setDirty();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (entity.hurtTime == 1) {
|
||||||
|
corruption.add(1);
|
||||||
|
setDirty();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
tickers.forEach(Tickable::tick);
|
tickers.forEach(Tickable::tick);
|
||||||
|
|
||||||
super.tick();
|
super.tick();
|
||||||
|
|
Loading…
Reference in a new issue