Added DespawnableAnimal
This commit is contained in:
parent
cdbeede9f4
commit
0e31f9b22e
1 changed files with 16 additions and 0 deletions
16
src/main/java/ru/bclib/entity/DespawnableAnimal.java
Normal file
16
src/main/java/ru/bclib/entity/DespawnableAnimal.java
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
package ru.bclib.entity;
|
||||||
|
|
||||||
|
import net.minecraft.world.entity.EntityType;
|
||||||
|
import net.minecraft.world.entity.animal.Animal;
|
||||||
|
import net.minecraft.world.level.Level;
|
||||||
|
|
||||||
|
public abstract class DespawnableAnimal extends Animal {
|
||||||
|
protected DespawnableAnimal(EntityType<? extends Animal> entityType, Level level) {
|
||||||
|
super(entityType, level);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean removeWhenFarAway(double d) {
|
||||||
|
return !this.hasCustomName();
|
||||||
|
}
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue