Make sure our Ambient Creatures can Despawn (paulevsGitch/BetterNether#438)

This commit is contained in:
Frank 2021-11-28 22:04:14 +01:00
parent 7bc0f9d63d
commit ae615748b3
2 changed files with 10 additions and 9 deletions

View file

@ -1,5 +1,7 @@
package ru.betterend.entity;
import java.util.EnumSet;
import net.minecraft.core.BlockPos;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.sounds.SoundEvent;
@ -21,7 +23,6 @@ import net.minecraft.world.entity.ai.navigation.FlyingPathNavigation;
import net.minecraft.world.entity.ai.navigation.PathNavigation;
import net.minecraft.world.entity.ai.util.AirAndWaterRandomPos;
import net.minecraft.world.entity.ai.util.HoverRandomPos;
import net.minecraft.world.entity.animal.Animal;
import net.minecraft.world.entity.animal.FlyingAnimal;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.level.Level;
@ -30,14 +31,13 @@ import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.pathfinder.BlockPathTypes;
import net.minecraft.world.level.pathfinder.Path;
import net.minecraft.world.phys.Vec3;
import ru.bclib.entity.DespawnableAnimal;
import ru.bclib.util.BlocksHelper;
import ru.bclib.util.MHelper;
import ru.betterend.registry.EndEntities;
import ru.betterend.registry.EndSounds;
import java.util.EnumSet;
public class DragonflyEntity extends Animal implements FlyingAnimal {
public class DragonflyEntity extends DespawnableAnimal implements FlyingAnimal {
public DragonflyEntity(EntityType<DragonflyEntity> entityType, Level world) {
super(entityType, world);
this.moveControl = new FlyingMoveControl(this, 20, true);

View file

@ -1,5 +1,9 @@
package ru.betterend.entity;
import java.util.EnumSet;
import org.jetbrains.annotations.Nullable;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Registry;
import net.minecraft.nbt.CompoundTag;
@ -27,7 +31,6 @@ import net.minecraft.world.entity.ai.navigation.FlyingPathNavigation;
import net.minecraft.world.entity.ai.navigation.PathNavigation;
import net.minecraft.world.entity.ai.util.AirAndWaterRandomPos;
import net.minecraft.world.entity.ai.util.HoverRandomPos;
import net.minecraft.world.entity.animal.Animal;
import net.minecraft.world.entity.animal.FlyingAnimal;
import net.minecraft.world.entity.item.ItemEntity;
import net.minecraft.world.entity.player.Player;
@ -38,7 +41,7 @@ import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.block.state.properties.BlockStateProperties;
import net.minecraft.world.level.pathfinder.BlockPathTypes;
import net.minecraft.world.phys.Vec3;
import org.jetbrains.annotations.Nullable;
import ru.bclib.entity.DespawnableAnimal;
import ru.bclib.util.BlocksHelper;
import ru.bclib.util.MHelper;
import ru.betterend.BetterEnd;
@ -47,9 +50,7 @@ import ru.betterend.registry.EndBlocks;
import ru.betterend.registry.EndEntities;
import ru.betterend.registry.EndItems;
import java.util.EnumSet;
public class SilkMothEntity extends Animal implements FlyingAnimal {
public class SilkMothEntity extends DespawnableAnimal implements FlyingAnimal {
private BlockPos hivePos;
private BlockPos entrance;
private Level hiveWorld;