Entity class rename
This commit is contained in:
parent
4fb81c1c1f
commit
57548290e9
16 changed files with 144 additions and 147 deletions
|
@ -38,12 +38,12 @@ import net.minecraft.world.World;
|
|||
import ru.betterend.registry.EndBiomes;
|
||||
import ru.betterend.registry.EndItems;
|
||||
|
||||
public class EntityCubozoa extends SchoolingFishEntity {
|
||||
public class CubozoaEntity extends SchoolingFishEntity {
|
||||
public static final int VARIANTS = 2;
|
||||
private static final TrackedData<Byte> VARIANT = DataTracker.registerData(EntityCubozoa.class, TrackedDataHandlerRegistry.BYTE);
|
||||
private static final TrackedData<Byte> SCALE = DataTracker.registerData(EntityCubozoa.class, TrackedDataHandlerRegistry.BYTE);
|
||||
private static final TrackedData<Byte> VARIANT = DataTracker.registerData(CubozoaEntity.class, TrackedDataHandlerRegistry.BYTE);
|
||||
private static final TrackedData<Byte> SCALE = DataTracker.registerData(CubozoaEntity.class, TrackedDataHandlerRegistry.BYTE);
|
||||
|
||||
public EntityCubozoa(EntityType<EntityCubozoa> entityType, World world) {
|
||||
public CubozoaEntity(EntityType<CubozoaEntity> entityType, World world) {
|
||||
super(entityType, world);
|
||||
}
|
||||
|
||||
|
@ -97,9 +97,9 @@ public class EntityCubozoa extends SchoolingFishEntity {
|
|||
return this.dataTracker.get(SCALE) / 32F + 0.75F;
|
||||
}
|
||||
|
||||
public static boolean canSpawn(EntityType<EntityCubozoa> type, ServerWorldAccess world, SpawnReason spawnReason, BlockPos pos, Random random) {
|
||||
public static boolean canSpawn(EntityType<CubozoaEntity> type, ServerWorldAccess world, SpawnReason spawnReason, BlockPos pos, Random random) {
|
||||
Box box = new Box(pos).expand(16);
|
||||
List<EntityCubozoa> list = world.getEntitiesByClass(EntityCubozoa.class, box, (entity) -> {
|
||||
List<CubozoaEntity> list = world.getEntitiesByClass(CubozoaEntity.class, box, (entity) -> {
|
||||
return true;
|
||||
});
|
||||
return list.size() < 9;
|
||||
|
@ -141,7 +141,7 @@ public class EntityCubozoa extends SchoolingFishEntity {
|
|||
}
|
||||
|
||||
static class CubozoaMoveControl extends MoveControl {
|
||||
CubozoaMoveControl(EntityCubozoa owner) {
|
||||
CubozoaMoveControl(CubozoaEntity owner) {
|
||||
super(owner);
|
||||
}
|
||||
|
|
@ -37,8 +37,8 @@ import ru.betterend.registry.EndSounds;
|
|||
import ru.betterend.util.BlocksHelper;
|
||||
import ru.betterend.util.MHelper;
|
||||
|
||||
public class EntityDragonfly extends AnimalEntity implements Flutterer {
|
||||
public EntityDragonfly(EntityType<EntityDragonfly> entityType, World world) {
|
||||
public class DragonflyEntity extends AnimalEntity implements Flutterer {
|
||||
public DragonflyEntity(EntityType<DragonflyEntity> entityType, World world) {
|
||||
super(entityType, world);
|
||||
this.moveControl = new FlightMoveControl(this, 20, true);
|
||||
this.lookControl = new DragonflyLookControl(this);
|
||||
|
@ -137,11 +137,11 @@ public class EntityDragonfly extends AnimalEntity implements Flutterer {
|
|||
}
|
||||
|
||||
public boolean canStart() {
|
||||
return EntityDragonfly.this.navigation.isIdle() && EntityDragonfly.this.random.nextInt(10) == 0;
|
||||
return DragonflyEntity.this.navigation.isIdle() && DragonflyEntity.this.random.nextInt(10) == 0;
|
||||
}
|
||||
|
||||
public boolean shouldContinue() {
|
||||
return EntityDragonfly.this.navigation.isFollowingPath();
|
||||
return DragonflyEntity.this.navigation.isFollowingPath();
|
||||
}
|
||||
|
||||
public void start() {
|
||||
|
@ -149,9 +149,9 @@ public class EntityDragonfly extends AnimalEntity implements Flutterer {
|
|||
if (vec3d != null) {
|
||||
BlockPos pos = new BlockPos(vec3d);
|
||||
try {
|
||||
Path path = EntityDragonfly.this.navigation.findPathTo(pos, 1);
|
||||
Path path = DragonflyEntity.this.navigation.findPathTo(pos, 1);
|
||||
if (path != null) {
|
||||
EntityDragonfly.this.navigation.startMovingAlong(path, 1.0D);
|
||||
DragonflyEntity.this.navigation.startMovingAlong(path, 1.0D);
|
||||
}
|
||||
}
|
||||
catch (Exception e) {}
|
||||
|
@ -160,29 +160,29 @@ public class EntityDragonfly extends AnimalEntity implements Flutterer {
|
|||
}
|
||||
|
||||
private Vec3d getRandomLocation() {
|
||||
int h = BlocksHelper.downRay(EntityDragonfly.this.world, EntityDragonfly.this.getBlockPos(), 16);
|
||||
Vec3d rotation = EntityDragonfly.this.getRotationVec(0.0F);
|
||||
Vec3d airPos = TargetFinder.findAirTarget(EntityDragonfly.this, 8, 7, rotation, 1.5707964F, 2, 1);
|
||||
int h = BlocksHelper.downRay(DragonflyEntity.this.world, DragonflyEntity.this.getBlockPos(), 16);
|
||||
Vec3d rotation = DragonflyEntity.this.getRotationVec(0.0F);
|
||||
Vec3d airPos = TargetFinder.findAirTarget(DragonflyEntity.this, 8, 7, rotation, 1.5707964F, 2, 1);
|
||||
if (airPos != null) {
|
||||
if (isInVoid(airPos)) {
|
||||
for (int i = 0; i < 8; i++) {
|
||||
airPos = TargetFinder.findAirTarget(EntityDragonfly.this, 16, 7, rotation, MHelper.PI2, 2, 1);
|
||||
airPos = TargetFinder.findAirTarget(DragonflyEntity.this, 16, 7, rotation, MHelper.PI2, 2, 1);
|
||||
if (airPos != null && !isInVoid(airPos)) {
|
||||
return airPos;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
if (h > 5 && airPos.getY() >= EntityDragonfly.this.getBlockPos().getY()) {
|
||||
if (h > 5 && airPos.getY() >= DragonflyEntity.this.getBlockPos().getY()) {
|
||||
airPos = new Vec3d(airPos.x, airPos.y - h * 0.5, airPos.z);
|
||||
}
|
||||
return airPos;
|
||||
}
|
||||
return TargetFinder.findGroundTarget(EntityDragonfly.this, 8, 4, -2, rotation, 1.5707963705062866D);
|
||||
return TargetFinder.findGroundTarget(DragonflyEntity.this, 8, 4, -2, rotation, 1.5707963705062866D);
|
||||
}
|
||||
|
||||
private boolean isInVoid(Vec3d pos) {
|
||||
int h = BlocksHelper.downRay(EntityDragonfly.this.world, new BlockPos(pos), 128);
|
||||
int h = BlocksHelper.downRay(DragonflyEntity.this.world, new BlockPos(pos), 128);
|
||||
return h > 100;
|
||||
}
|
||||
}
|
||||
|
@ -192,7 +192,7 @@ public class EntityDragonfly extends AnimalEntity implements Flutterer {
|
|||
return EndEntities.DRAGONFLY.create(world);
|
||||
}
|
||||
|
||||
public static boolean canSpawn(EntityType<EntityDragonfly> type, ServerWorldAccess world, SpawnReason spawnReason, BlockPos pos, Random random) {
|
||||
public static boolean canSpawn(EntityType<DragonflyEntity> type, ServerWorldAccess world, SpawnReason spawnReason, BlockPos pos, Random random) {
|
||||
int y = world.getChunk(pos).sampleHeightmap(Type.WORLD_SURFACE, pos.getX() & 15, pos.getY() & 15);
|
||||
return y > 0 && pos.getY() >= y;
|
||||
}
|
|
@ -29,14 +29,14 @@ import net.minecraft.world.World;
|
|||
import ru.betterend.registry.EndBiomes;
|
||||
import ru.betterend.registry.EndItems;
|
||||
|
||||
public class EntityEndFish extends SchoolingFishEntity {
|
||||
public class EndFishEntity extends SchoolingFishEntity {
|
||||
public static final int VARIANTS_NORMAL = 5;
|
||||
public static final int VARIANTS_SULPHUR = 3;
|
||||
public static final int VARIANTS = VARIANTS_NORMAL + VARIANTS_SULPHUR;
|
||||
private static final TrackedData<Byte> VARIANT = DataTracker.registerData(EntityEndFish.class, TrackedDataHandlerRegistry.BYTE);
|
||||
private static final TrackedData<Byte> SCALE = DataTracker.registerData(EntityEndFish.class, TrackedDataHandlerRegistry.BYTE);
|
||||
private static final TrackedData<Byte> VARIANT = DataTracker.registerData(EndFishEntity.class, TrackedDataHandlerRegistry.BYTE);
|
||||
private static final TrackedData<Byte> SCALE = DataTracker.registerData(EndFishEntity.class, TrackedDataHandlerRegistry.BYTE);
|
||||
|
||||
public EntityEndFish(EntityType<EntityEndFish> entityType, World world) {
|
||||
public EndFishEntity(EntityType<EndFishEntity> entityType, World world) {
|
||||
super(entityType, world);
|
||||
}
|
||||
|
||||
|
@ -126,9 +126,9 @@ public class EntityEndFish extends SchoolingFishEntity {
|
|||
return this.dataTracker.get(SCALE) / 32F + 0.75F;
|
||||
}
|
||||
|
||||
public static boolean canSpawn(EntityType<EntityEndFish> type, ServerWorldAccess world, SpawnReason spawnReason, BlockPos pos, Random random) {
|
||||
public static boolean canSpawn(EntityType<EndFishEntity> type, ServerWorldAccess world, SpawnReason spawnReason, BlockPos pos, Random random) {
|
||||
Box box = new Box(pos).expand(16);
|
||||
List<EntityEndFish> list = world.getEntitiesByClass(EntityEndFish.class, box, (entity) -> { return true; });
|
||||
List<EndFishEntity> list = world.getEntitiesByClass(EndFishEntity.class, box, (entity) -> { return true; });
|
||||
return list.size() < 9;
|
||||
}
|
||||
|
|
@ -44,11 +44,11 @@ import ru.betterend.util.BlocksHelper;
|
|||
import ru.betterend.util.MHelper;
|
||||
import ru.betterend.world.biome.EndBiome;
|
||||
|
||||
public class EntityEndSlime extends SlimeEntity {
|
||||
private static final TrackedData<Byte> VARIANT = DataTracker.registerData(EntityEndSlime.class, TrackedDataHandlerRegistry.BYTE);
|
||||
public class EndSlimeEntity extends SlimeEntity {
|
||||
private static final TrackedData<Byte> VARIANT = DataTracker.registerData(EndSlimeEntity.class, TrackedDataHandlerRegistry.BYTE);
|
||||
private static final Mutable POS = new Mutable();
|
||||
|
||||
public EntityEndSlime(EntityType<EntityEndSlime> entityType, World world) {
|
||||
public EndSlimeEntity(EntityType<EndSlimeEntity> entityType, World world) {
|
||||
super(entityType, world);
|
||||
this.moveControl = new EndSlimeMoveControl(this);
|
||||
}
|
||||
|
@ -128,7 +128,7 @@ public class EntityEndSlime extends SlimeEntity {
|
|||
for (int l = 0; l < k; ++l) {
|
||||
float g = ((float) (l % 2) - 0.5F) * f;
|
||||
float h = ((float) (l / 2) - 0.5F) * f;
|
||||
EntityEndSlime slimeEntity = (EntityEndSlime) this.getType().create(this.world);
|
||||
EndSlimeEntity slimeEntity = (EndSlimeEntity) this.getType().create(this.world);
|
||||
if (this.isPersistent()) {
|
||||
slimeEntity.setPersistent();
|
||||
}
|
||||
|
@ -198,7 +198,7 @@ public class EntityEndSlime extends SlimeEntity {
|
|||
return this.dataTracker.get(VARIANT) == 0;
|
||||
}
|
||||
|
||||
public static boolean canSpawn(EntityType<EntityEndSlime> type, ServerWorldAccess world, SpawnReason spawnReason, BlockPos pos, Random random) {
|
||||
public static boolean canSpawn(EntityType<EndSlimeEntity> type, ServerWorldAccess world, SpawnReason spawnReason, BlockPos pos, Random random) {
|
||||
return random.nextInt(16) == 0 || isPermanentBiome(world, pos) || (notManyEntities(world, pos, 32, 3) && isWaterNear(world, pos, 32, 8));
|
||||
}
|
||||
|
||||
|
@ -209,7 +209,7 @@ public class EntityEndSlime extends SlimeEntity {
|
|||
|
||||
private static boolean notManyEntities(ServerWorldAccess world, BlockPos pos, int radius, int maxCount) {
|
||||
Box box = new Box(pos).expand(radius);
|
||||
List<EntityEndSlime> list = world.getEntitiesByClass(EntityEndSlime.class, box, (entity) -> { return true; });
|
||||
List<EndSlimeEntity> list = world.getEntitiesByClass(EndSlimeEntity.class, box, (entity) -> { return true; });
|
||||
return list.size() <= maxCount;
|
||||
}
|
||||
|
||||
|
@ -235,17 +235,17 @@ public class EntityEndSlime extends SlimeEntity {
|
|||
}
|
||||
|
||||
public boolean canStart() {
|
||||
if (EntityEndSlime.this.hasVehicle()) {
|
||||
if (EndSlimeEntity.this.hasVehicle()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
float yaw = EntityEndSlime.this.getHeadYaw();
|
||||
float speed = EntityEndSlime.this.getMovementSpeed();
|
||||
float yaw = EndSlimeEntity.this.getHeadYaw();
|
||||
float speed = EndSlimeEntity.this.getMovementSpeed();
|
||||
if (speed > 0.1) {
|
||||
float dx = MathHelper.sin(-yaw * 0.017453292F);
|
||||
float dz = MathHelper.cos(-yaw * 0.017453292F);
|
||||
BlockPos pos = EntityEndSlime.this.getBlockPos().add(dx * speed * 4, 0, dz * speed * 4);
|
||||
int down = BlocksHelper.downRay(EntityEndSlime.this.world, pos, 16);
|
||||
BlockPos pos = EndSlimeEntity.this.getBlockPos().add(dx * speed * 4, 0, dz * speed * 4);
|
||||
int down = BlocksHelper.downRay(EndSlimeEntity.this.world, pos, 16);
|
||||
return down < 5;
|
||||
}
|
||||
|
||||
|
@ -253,28 +253,28 @@ public class EntityEndSlime extends SlimeEntity {
|
|||
}
|
||||
|
||||
public void tick() {
|
||||
((EndSlimeMoveControl) EntityEndSlime.this.getMoveControl()).move(1.0D);
|
||||
((EndSlimeMoveControl) EndSlimeEntity.this.getMoveControl()).move(1.0D);
|
||||
}
|
||||
}
|
||||
|
||||
class SwimmingGoal extends Goal {
|
||||
public SwimmingGoal() {
|
||||
this.setControls(EnumSet.of(Goal.Control.JUMP, Goal.Control.MOVE));
|
||||
EntityEndSlime.this.getNavigation().setCanSwim(true);
|
||||
EndSlimeEntity.this.getNavigation().setCanSwim(true);
|
||||
}
|
||||
|
||||
public boolean canStart() {
|
||||
return (EntityEndSlime.this.isTouchingWater()
|
||||
|| EntityEndSlime.this.isInLava())
|
||||
&& EntityEndSlime.this.getMoveControl() instanceof EndSlimeMoveControl;
|
||||
return (EndSlimeEntity.this.isTouchingWater()
|
||||
|| EndSlimeEntity.this.isInLava())
|
||||
&& EndSlimeEntity.this.getMoveControl() instanceof EndSlimeMoveControl;
|
||||
}
|
||||
|
||||
public void tick() {
|
||||
if (EntityEndSlime.this.getRandom().nextFloat() < 0.8F) {
|
||||
EntityEndSlime.this.getJumpControl().setActive();
|
||||
if (EndSlimeEntity.this.getRandom().nextFloat() < 0.8F) {
|
||||
EndSlimeEntity.this.getJumpControl().setActive();
|
||||
}
|
||||
|
||||
((EndSlimeMoveControl) EntityEndSlime.this.getMoveControl()).move(1.2D);
|
||||
((EndSlimeMoveControl) EndSlimeEntity.this.getMoveControl()).move(1.2D);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -287,21 +287,21 @@ public class EntityEndSlime extends SlimeEntity {
|
|||
}
|
||||
|
||||
public boolean canStart() {
|
||||
return EntityEndSlime.this.getTarget() == null
|
||||
&& (EntityEndSlime.this.onGround
|
||||
|| EntityEndSlime.this.isTouchingWater()
|
||||
|| EntityEndSlime.this.isInLava()
|
||||
|| EntityEndSlime.this.hasStatusEffect(StatusEffects.LEVITATION))
|
||||
&& EntityEndSlime.this.getMoveControl() instanceof EndSlimeMoveControl;
|
||||
return EndSlimeEntity.this.getTarget() == null
|
||||
&& (EndSlimeEntity.this.onGround
|
||||
|| EndSlimeEntity.this.isTouchingWater()
|
||||
|| EndSlimeEntity.this.isInLava()
|
||||
|| EndSlimeEntity.this.hasStatusEffect(StatusEffects.LEVITATION))
|
||||
&& EndSlimeEntity.this.getMoveControl() instanceof EndSlimeMoveControl;
|
||||
}
|
||||
|
||||
public void tick() {
|
||||
if (--this.timer <= 0) {
|
||||
this.timer = 40 + EntityEndSlime.this.getRandom().nextInt(60);
|
||||
this.targetYaw = (float) EntityEndSlime.this.getRandom().nextInt(360);
|
||||
this.timer = 40 + EndSlimeEntity.this.getRandom().nextInt(60);
|
||||
this.targetYaw = (float) EndSlimeEntity.this.getRandom().nextInt(360);
|
||||
}
|
||||
|
||||
((EndSlimeMoveControl) EntityEndSlime.this.getMoveControl()).look(this.targetYaw, false);
|
||||
((EndSlimeMoveControl) EndSlimeEntity.this.getMoveControl()).look(this.targetYaw, false);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -313,7 +313,7 @@ public class EntityEndSlime extends SlimeEntity {
|
|||
}
|
||||
|
||||
public boolean canStart() {
|
||||
LivingEntity livingEntity = EntityEndSlime.this.getTarget();
|
||||
LivingEntity livingEntity = EndSlimeEntity.this.getTarget();
|
||||
if (livingEntity == null) {
|
||||
return false;
|
||||
}
|
||||
|
@ -321,7 +321,7 @@ public class EntityEndSlime extends SlimeEntity {
|
|||
return false;
|
||||
}
|
||||
else {
|
||||
return livingEntity instanceof PlayerEntity && ((PlayerEntity) livingEntity).abilities.invulnerable ? false : EntityEndSlime.this.getMoveControl() instanceof EndSlimeMoveControl;
|
||||
return livingEntity instanceof PlayerEntity && ((PlayerEntity) livingEntity).abilities.invulnerable ? false : EndSlimeEntity.this.getMoveControl() instanceof EndSlimeMoveControl;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -331,7 +331,7 @@ public class EntityEndSlime extends SlimeEntity {
|
|||
}
|
||||
|
||||
public boolean shouldContinue() {
|
||||
LivingEntity livingEntity = EntityEndSlime.this.getTarget();
|
||||
LivingEntity livingEntity = EndSlimeEntity.this.getTarget();
|
||||
if (livingEntity == null) {
|
||||
return false;
|
||||
}
|
||||
|
@ -347,8 +347,8 @@ public class EntityEndSlime extends SlimeEntity {
|
|||
}
|
||||
|
||||
public void tick() {
|
||||
EntityEndSlime.this.lookAtEntity(EntityEndSlime.this.getTarget(), 10.0F, 10.0F);
|
||||
((EndSlimeMoveControl) EntityEndSlime.this.getMoveControl()).look(EntityEndSlime.this.yaw, EntityEndSlime.this.canAttack());
|
||||
EndSlimeEntity.this.lookAtEntity(EndSlimeEntity.this.getTarget(), 10.0F, 10.0F);
|
||||
((EndSlimeMoveControl) EndSlimeEntity.this.getMoveControl()).look(EndSlimeEntity.this.yaw, EndSlimeEntity.this.canAttack());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -357,7 +357,7 @@ public class EntityEndSlime extends SlimeEntity {
|
|||
private int ticksUntilJump;
|
||||
private boolean jumpOften;
|
||||
|
||||
public EndSlimeMoveControl(EntityEndSlime slime) {
|
||||
public EndSlimeMoveControl(EndSlimeEntity slime) {
|
||||
super(slime);
|
||||
this.targetYaw = 180.0F * slime.yaw / 3.1415927F;
|
||||
}
|
||||
|
@ -384,19 +384,19 @@ public class EntityEndSlime extends SlimeEntity {
|
|||
if (this.entity.isOnGround()) {
|
||||
this.entity.setMovementSpeed((float) (this.speed * this.entity.getAttributeValue(EntityAttributes.GENERIC_MOVEMENT_SPEED)));
|
||||
if (this.ticksUntilJump-- <= 0) {
|
||||
this.ticksUntilJump = EntityEndSlime.this.getTicksUntilNextJump();
|
||||
this.ticksUntilJump = EndSlimeEntity.this.getTicksUntilNextJump();
|
||||
if (this.jumpOften) {
|
||||
this.ticksUntilJump /= 3;
|
||||
}
|
||||
|
||||
EntityEndSlime.this.getJumpControl().setActive();
|
||||
if (EntityEndSlime.this.makesJumpSound()) {
|
||||
EntityEndSlime.this.playSound(EntityEndSlime.this.getJumpSound(), EntityEndSlime.this.getSoundVolume(), getJumpSoundPitch());
|
||||
EndSlimeEntity.this.getJumpControl().setActive();
|
||||
if (EndSlimeEntity.this.makesJumpSound()) {
|
||||
EndSlimeEntity.this.playSound(EndSlimeEntity.this.getJumpSound(), EndSlimeEntity.this.getSoundVolume(), getJumpSoundPitch());
|
||||
}
|
||||
}
|
||||
else {
|
||||
EntityEndSlime.this.sidewaysSpeed = 0.0F;
|
||||
EntityEndSlime.this.forwardSpeed = 0.0F;
|
||||
EndSlimeEntity.this.sidewaysSpeed = 0.0F;
|
||||
EndSlimeEntity.this.forwardSpeed = 0.0F;
|
||||
this.entity.setMovementSpeed(0.0F);
|
||||
}
|
||||
}
|
||||
|
@ -408,8 +408,8 @@ public class EntityEndSlime extends SlimeEntity {
|
|||
}
|
||||
|
||||
private float getJumpSoundPitch() {
|
||||
float f = EntityEndSlime.this.isSmall() ? 1.4F : 0.8F;
|
||||
return ((EntityEndSlime.this.random.nextFloat() - EntityEndSlime.this.random.nextFloat()) * 0.2F + 1.0F) * f;
|
||||
float f = EndSlimeEntity.this.isSmall() ? 1.4F : 0.8F;
|
||||
return ((EndSlimeEntity.this.random.nextFloat() - EndSlimeEntity.this.random.nextFloat()) * 0.2F + 1.0F) * f;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -29,8 +29,8 @@ import net.minecraft.world.World;
|
|||
import ru.betterend.registry.EndSounds;
|
||||
import ru.betterend.util.MHelper;
|
||||
|
||||
public class EntityShadowWalker extends HostileEntity {
|
||||
public EntityShadowWalker(EntityType<EntityShadowWalker> entityType, World world) {
|
||||
public class ShadowWalkerEntity extends HostileEntity {
|
||||
public ShadowWalkerEntity(EntityType<ShadowWalkerEntity> entityType, World world) {
|
||||
super(entityType, world);
|
||||
}
|
||||
|
||||
|
@ -112,20 +112,20 @@ public class EntityShadowWalker extends HostileEntity {
|
|||
return attack;
|
||||
}
|
||||
|
||||
public static boolean canSpawn(EntityType<EntityShadowWalker> type, ServerWorldAccess world, SpawnReason spawnReason, BlockPos pos, Random random) {
|
||||
public static boolean canSpawn(EntityType<ShadowWalkerEntity> type, ServerWorldAccess world, SpawnReason spawnReason, BlockPos pos, Random random) {
|
||||
if (HostileEntity.canSpawnInDark(type, world, spawnReason, pos, random)) {
|
||||
Box box = new Box(pos).expand(16);
|
||||
List<EntityShadowWalker> entities = world.getEntitiesByClass(EntityShadowWalker.class, box, (entity) -> { return true; });
|
||||
List<ShadowWalkerEntity> entities = world.getEntitiesByClass(ShadowWalkerEntity.class, box, (entity) -> { return true; });
|
||||
return entities.size() < 6;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private final class AttackGoal extends MeleeAttackGoal {
|
||||
private final EntityShadowWalker walker;
|
||||
private final ShadowWalkerEntity walker;
|
||||
private int ticks;
|
||||
|
||||
public AttackGoal(EntityShadowWalker walker, double speed, boolean pauseWhenMobIdle) {
|
||||
public AttackGoal(ShadowWalkerEntity walker, double speed, boolean pauseWhenMobIdle) {
|
||||
super(walker, speed, pauseWhenMobIdle);
|
||||
this.walker = walker;
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
package ru.betterend.entity;
|
||||
package ru.betterend.entity.model;
|
||||
|
||||
import java.util.function.Function;
|
||||
|
|
@ -5,10 +5,9 @@ import net.minecraft.client.render.RenderLayer;
|
|||
import net.minecraft.client.render.VertexConsumer;
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.util.math.MathHelper;
|
||||
import ru.betterend.entity.BlockBenchModel;
|
||||
import ru.betterend.entity.EntityCubozoa;
|
||||
import ru.betterend.entity.CubozoaEntity;
|
||||
|
||||
public class ModelEntityCubozoa extends BlockBenchModel<EntityCubozoa> {
|
||||
public class CubozoaEntityModel extends BlockBenchModel<CubozoaEntity> {
|
||||
private final ModelPart model;
|
||||
private final ModelPart main_cube_r1;
|
||||
private final ModelPart tentacle_center_1;
|
||||
|
@ -22,7 +21,7 @@ public class ModelEntityCubozoa extends BlockBenchModel<EntityCubozoa> {
|
|||
private float scaleY;
|
||||
private float scaleXZ;
|
||||
|
||||
public ModelEntityCubozoa() {
|
||||
public CubozoaEntityModel() {
|
||||
super(RenderLayer::getEntityTranslucent);
|
||||
|
||||
textureWidth = 48;
|
||||
|
@ -83,7 +82,7 @@ public class ModelEntityCubozoa extends BlockBenchModel<EntityCubozoa> {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void setAngles(EntityCubozoa entity, float limbAngle, float limbDistance, float animationProgress, float headYaw, float headPitch) {
|
||||
public void setAngles(CubozoaEntity entity, float limbAngle, float limbDistance, float animationProgress, float headYaw, float headPitch) {
|
||||
float sin = MathHelper.sin(animationProgress * 0.13F);
|
||||
scaleY = sin * 0.1F + 0.9F;
|
||||
scaleXZ = MathHelper.sin(animationProgress * 0.13F + 3.14F) * 0.1F + 0.9F;
|
|
@ -4,10 +4,9 @@ import net.minecraft.client.model.ModelPart;
|
|||
import net.minecraft.client.render.RenderLayer;
|
||||
import net.minecraft.client.render.VertexConsumer;
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import ru.betterend.entity.BlockBenchModel;
|
||||
import ru.betterend.entity.EntityDragonfly;
|
||||
import ru.betterend.entity.DragonflyEntity;
|
||||
|
||||
public class ModelEntityDragonfly extends BlockBenchModel<EntityDragonfly> {
|
||||
public class DragonflyEntityModel extends BlockBenchModel<DragonflyEntity> {
|
||||
private final ModelPart model;
|
||||
private final ModelPart head;
|
||||
private final ModelPart tail;
|
||||
|
@ -19,7 +18,7 @@ public class ModelEntityDragonfly extends BlockBenchModel<EntityDragonfly> {
|
|||
private final ModelPart legs_1;
|
||||
private final ModelPart legs_2;
|
||||
|
||||
public ModelEntityDragonfly() {
|
||||
public DragonflyEntityModel() {
|
||||
super(RenderLayer::getEntityCutout);
|
||||
|
||||
textureWidth = 64;
|
||||
|
@ -82,7 +81,7 @@ public class ModelEntityDragonfly extends BlockBenchModel<EntityDragonfly> {
|
|||
|
||||
|
||||
@Override
|
||||
public void setAngles(EntityDragonfly entity, float limbAngle, float limbDistance, float animationProgress, float headYaw, float headPitch) {
|
||||
public void setAngles(DragonflyEntity entity, float limbAngle, float limbDistance, float animationProgress, float headYaw, float headPitch) {
|
||||
float progress = animationProgress * 2F;
|
||||
|
||||
wing_1.roll = 0.3491F + (float) Math.sin(progress) * 0.3491F;
|
|
@ -4,10 +4,9 @@ import net.minecraft.client.model.ModelPart;
|
|||
import net.minecraft.client.render.RenderLayer;
|
||||
import net.minecraft.client.render.VertexConsumer;
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import ru.betterend.entity.BlockBenchModel;
|
||||
import ru.betterend.entity.EntityEndFish;
|
||||
import ru.betterend.entity.EndFishEntity;
|
||||
|
||||
public class ModelEntityEndFish extends BlockBenchModel<EntityEndFish> {
|
||||
public class EndFishEntityModel extends BlockBenchModel<EndFishEntity> {
|
||||
private final ModelPart model;
|
||||
private final ModelPart fin_top;
|
||||
private final ModelPart fin_bottom;
|
||||
|
@ -15,7 +14,7 @@ public class ModelEntityEndFish extends BlockBenchModel<EntityEndFish> {
|
|||
private final ModelPart fin_right;
|
||||
private final ModelPart fin_left;
|
||||
|
||||
public ModelEntityEndFish() {
|
||||
public EndFishEntityModel() {
|
||||
super(RenderLayer::getEntityCutout);
|
||||
|
||||
textureWidth = 32;
|
||||
|
@ -58,7 +57,7 @@ public class ModelEntityEndFish extends BlockBenchModel<EntityEndFish> {
|
|||
|
||||
|
||||
@Override
|
||||
public void setAngles(EntityEndFish entity, float limbAngle, float limbDistance, float animationProgress, float headYaw, float headPitch) {
|
||||
public void setAngles(EndFishEntity entity, float limbAngle, float limbDistance, float animationProgress, float headYaw, float headPitch) {
|
||||
float s1 = (float) Math.sin(animationProgress * 0.1);
|
||||
float s2 = (float) Math.sin(animationProgress * 0.05);
|
||||
flipper.yaw = s1 * 0.3F;
|
|
@ -7,10 +7,10 @@ import net.minecraft.client.render.RenderLayer;
|
|||
import net.minecraft.client.render.VertexConsumer;
|
||||
import net.minecraft.client.render.entity.model.CompositeEntityModel;
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import ru.betterend.entity.EntityEndSlime;
|
||||
import ru.betterend.entity.EndSlimeEntity;
|
||||
import ru.betterend.util.MHelper;
|
||||
|
||||
public class EndSlimeEntityModel<T extends EntityEndSlime> extends CompositeEntityModel<T> {
|
||||
public class EndSlimeEntityModel<T extends EndSlimeEntity> extends CompositeEntityModel<T> {
|
||||
private final ModelPart flower;
|
||||
private final ModelPart crop;
|
||||
private final ModelPart innerCube;
|
||||
|
|
|
@ -10,23 +10,23 @@ import net.minecraft.client.render.entity.feature.EyesFeatureRenderer;
|
|||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.util.Identifier;
|
||||
import ru.betterend.BetterEnd;
|
||||
import ru.betterend.entity.EntityCubozoa;
|
||||
import ru.betterend.entity.model.ModelEntityCubozoa;
|
||||
import ru.betterend.entity.CubozoaEntity;
|
||||
import ru.betterend.entity.model.CubozoaEntityModel;
|
||||
|
||||
public class RendererEntityCubozoa extends MobEntityRenderer<EntityCubozoa, ModelEntityCubozoa> {
|
||||
public class RendererEntityCubozoa extends MobEntityRenderer<CubozoaEntity, CubozoaEntityModel> {
|
||||
private static final Identifier[] TEXTURE = new Identifier[2];
|
||||
private static final RenderLayer[] GLOW = new RenderLayer[2];
|
||||
|
||||
public RendererEntityCubozoa(EntityRenderDispatcher entityRenderDispatcher) {
|
||||
super(entityRenderDispatcher, new ModelEntityCubozoa(), 0.5f);
|
||||
this.addFeature(new EyesFeatureRenderer<EntityCubozoa, ModelEntityCubozoa>(this) {
|
||||
super(entityRenderDispatcher, new CubozoaEntityModel(), 0.5f);
|
||||
this.addFeature(new EyesFeatureRenderer<CubozoaEntity, CubozoaEntityModel>(this) {
|
||||
@Override
|
||||
public RenderLayer getEyesTexture() {
|
||||
return GLOW[0];
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render(MatrixStack matrices, VertexConsumerProvider vertexConsumers, int light, EntityCubozoa entity, float limbAngle, float limbDistance, float tickDelta, float animationProgress, float headYaw, float headPitch) {
|
||||
public void render(MatrixStack matrices, VertexConsumerProvider vertexConsumers, int light, CubozoaEntity entity, float limbAngle, float limbDistance, float tickDelta, float animationProgress, float headYaw, float headPitch) {
|
||||
VertexConsumer vertexConsumer = vertexConsumers.getBuffer(GLOW[entity.getVariant()]);
|
||||
this.getContextModel().render(matrices, vertexConsumer, 15728640, OverlayTexture.DEFAULT_UV, 1.0F, 1.0F, 1.0F, 1.0F);
|
||||
}
|
||||
|
@ -34,13 +34,13 @@ public class RendererEntityCubozoa extends MobEntityRenderer<EntityCubozoa, Mode
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void scale(EntityCubozoa entity, MatrixStack matrixStack, float f) {
|
||||
protected void scale(CubozoaEntity entity, MatrixStack matrixStack, float f) {
|
||||
float scale = entity.getScale();
|
||||
matrixStack.scale(scale, scale, scale);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Identifier getTexture(EntityCubozoa entity) {
|
||||
public Identifier getTexture(CubozoaEntity entity) {
|
||||
return TEXTURE[entity.getVariant()];
|
||||
}
|
||||
|
||||
|
|
|
@ -6,16 +6,16 @@ import net.minecraft.client.render.entity.MobEntityRenderer;
|
|||
import net.minecraft.client.render.entity.feature.EyesFeatureRenderer;
|
||||
import net.minecraft.util.Identifier;
|
||||
import ru.betterend.BetterEnd;
|
||||
import ru.betterend.entity.EntityDragonfly;
|
||||
import ru.betterend.entity.model.ModelEntityDragonfly;
|
||||
import ru.betterend.entity.DragonflyEntity;
|
||||
import ru.betterend.entity.model.DragonflyEntityModel;
|
||||
|
||||
public class RendererEntityDragonfly extends MobEntityRenderer<EntityDragonfly, ModelEntityDragonfly> {
|
||||
public class RendererEntityDragonfly extends MobEntityRenderer<DragonflyEntity, DragonflyEntityModel> {
|
||||
private static final Identifier TEXTURE = BetterEnd.makeID("textures/entity/dragonfly.png");
|
||||
private static final RenderLayer GLOW = RenderLayer.getEyes(BetterEnd.makeID("textures/entity/dragonfly_glow.png"));
|
||||
|
||||
public RendererEntityDragonfly(EntityRenderDispatcher entityRenderDispatcher) {
|
||||
super(entityRenderDispatcher, new ModelEntityDragonfly(), 0.5f);
|
||||
this.addFeature(new EyesFeatureRenderer<EntityDragonfly, ModelEntityDragonfly>(this) {
|
||||
super(entityRenderDispatcher, new DragonflyEntityModel(), 0.5f);
|
||||
this.addFeature(new EyesFeatureRenderer<DragonflyEntity, DragonflyEntityModel>(this) {
|
||||
@Override
|
||||
public RenderLayer getEyesTexture() {
|
||||
return GLOW;
|
||||
|
@ -24,7 +24,7 @@ public class RendererEntityDragonfly extends MobEntityRenderer<EntityDragonfly,
|
|||
}
|
||||
|
||||
@Override
|
||||
public Identifier getTexture(EntityDragonfly entity) {
|
||||
public Identifier getTexture(DragonflyEntity entity) {
|
||||
return TEXTURE;
|
||||
}
|
||||
}
|
|
@ -10,23 +10,23 @@ import net.minecraft.client.render.entity.feature.EyesFeatureRenderer;
|
|||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.util.Identifier;
|
||||
import ru.betterend.BetterEnd;
|
||||
import ru.betterend.entity.EntityEndFish;
|
||||
import ru.betterend.entity.model.ModelEntityEndFish;
|
||||
import ru.betterend.entity.EndFishEntity;
|
||||
import ru.betterend.entity.model.EndFishEntityModel;
|
||||
|
||||
public class RendererEntityEndFish extends MobEntityRenderer<EntityEndFish, ModelEntityEndFish> {
|
||||
private static final Identifier[] TEXTURE = new Identifier[EntityEndFish.VARIANTS];
|
||||
private static final RenderLayer[] GLOW = new RenderLayer[EntityEndFish.VARIANTS];
|
||||
public class RendererEntityEndFish extends MobEntityRenderer<EndFishEntity, EndFishEntityModel> {
|
||||
private static final Identifier[] TEXTURE = new Identifier[EndFishEntity.VARIANTS];
|
||||
private static final RenderLayer[] GLOW = new RenderLayer[EndFishEntity.VARIANTS];
|
||||
|
||||
public RendererEntityEndFish(EntityRenderDispatcher entityRenderDispatcher) {
|
||||
super(entityRenderDispatcher, new ModelEntityEndFish(), 0.5f);
|
||||
this.addFeature(new EyesFeatureRenderer<EntityEndFish, ModelEntityEndFish>(this) {
|
||||
super(entityRenderDispatcher, new EndFishEntityModel(), 0.5f);
|
||||
this.addFeature(new EyesFeatureRenderer<EndFishEntity, EndFishEntityModel>(this) {
|
||||
@Override
|
||||
public RenderLayer getEyesTexture() {
|
||||
return GLOW[0];
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render(MatrixStack matrices, VertexConsumerProvider vertexConsumers, int light, EntityEndFish entity, float limbAngle, float limbDistance, float tickDelta, float animationProgress, float headYaw, float headPitch) {
|
||||
public void render(MatrixStack matrices, VertexConsumerProvider vertexConsumers, int light, EndFishEntity entity, float limbAngle, float limbDistance, float tickDelta, float animationProgress, float headYaw, float headPitch) {
|
||||
VertexConsumer vertexConsumer = vertexConsumers.getBuffer(GLOW[entity.getVariant()]);
|
||||
this.getContextModel().render(matrices, vertexConsumer, 15728640, OverlayTexture.DEFAULT_UV, 1.0F, 1.0F, 1.0F, 1.0F);
|
||||
}
|
||||
|
@ -34,18 +34,18 @@ public class RendererEntityEndFish extends MobEntityRenderer<EntityEndFish, Mode
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void scale(EntityEndFish entity, MatrixStack matrixStack, float f) {
|
||||
protected void scale(EndFishEntity entity, MatrixStack matrixStack, float f) {
|
||||
float scale = entity.getScale();
|
||||
matrixStack.scale(scale, scale, scale);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Identifier getTexture(EntityEndFish entity) {
|
||||
public Identifier getTexture(EndFishEntity entity) {
|
||||
return TEXTURE[entity.getVariant()];
|
||||
}
|
||||
|
||||
static {
|
||||
for (int i = 0; i < EntityEndFish.VARIANTS; i++) {
|
||||
for (int i = 0; i < EndFishEntity.VARIANTS; i++) {
|
||||
TEXTURE[i] = BetterEnd.makeID("textures/entity/end_fish/end_fish_" + i + ".png");
|
||||
GLOW[i] = RenderLayer.getEyes(BetterEnd.makeID("textures/entity/end_fish/end_fish_" + i + "_glow.png"));
|
||||
}
|
||||
|
|
|
@ -14,24 +14,24 @@ import net.minecraft.client.util.math.MatrixStack;
|
|||
import net.minecraft.util.Identifier;
|
||||
import net.minecraft.util.math.MathHelper;
|
||||
import ru.betterend.BetterEnd;
|
||||
import ru.betterend.entity.EntityEndSlime;
|
||||
import ru.betterend.entity.EndSlimeEntity;
|
||||
import ru.betterend.entity.model.EndSlimeEntityModel;
|
||||
|
||||
public class RendererEntityEndSlime extends MobEntityRenderer<EntityEndSlime, EndSlimeEntityModel<EntityEndSlime>> {
|
||||
public class RendererEntityEndSlime extends MobEntityRenderer<EndSlimeEntity, EndSlimeEntityModel<EndSlimeEntity>> {
|
||||
private static final Identifier TEXTURE[] = new Identifier[4];
|
||||
private static final RenderLayer GLOW[] = new RenderLayer[4];
|
||||
|
||||
public RendererEntityEndSlime(EntityRenderDispatcher entityRenderDispatcher) {
|
||||
super(entityRenderDispatcher, new EndSlimeEntityModel<EntityEndSlime>(false), 0.25F);
|
||||
this.addFeature(new OverlayFeatureRenderer<EntityEndSlime>(this));
|
||||
this.addFeature(new EyesFeatureRenderer<EntityEndSlime, EndSlimeEntityModel<EntityEndSlime>>(this) {
|
||||
super(entityRenderDispatcher, new EndSlimeEntityModel<EndSlimeEntity>(false), 0.25F);
|
||||
this.addFeature(new OverlayFeatureRenderer<EndSlimeEntity>(this));
|
||||
this.addFeature(new EyesFeatureRenderer<EndSlimeEntity, EndSlimeEntityModel<EndSlimeEntity>>(this) {
|
||||
@Override
|
||||
public RenderLayer getEyesTexture() {
|
||||
return GLOW[0];
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render(MatrixStack matrices, VertexConsumerProvider vertexConsumers, int light, EntityEndSlime entity, float limbAngle, float limbDistance, float tickDelta, float animationProgress, float headYaw, float headPitch) {
|
||||
public void render(MatrixStack matrices, VertexConsumerProvider vertexConsumers, int light, EndSlimeEntity entity, float limbAngle, float limbDistance, float tickDelta, float animationProgress, float headYaw, float headPitch) {
|
||||
VertexConsumer vertexConsumer = vertexConsumers.getBuffer(GLOW[entity.getSlimeType()]);
|
||||
this.getContextModel().render(matrices, vertexConsumer, 15728640, OverlayTexture.DEFAULT_UV, 1.0F, 1.0F, 1.0F, 1.0F);
|
||||
if (entity.isLake()) {
|
||||
|
@ -42,18 +42,18 @@ public class RendererEntityEndSlime extends MobEntityRenderer<EntityEndSlime, En
|
|||
}
|
||||
|
||||
@Override
|
||||
public Identifier getTexture(EntityEndSlime entity) {
|
||||
public Identifier getTexture(EndSlimeEntity entity) {
|
||||
return TEXTURE[entity.getSlimeType()];
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render(EntityEndSlime slimeEntity, float f, float g, MatrixStack matrixStack, VertexConsumerProvider vertexConsumerProvider, int i) {
|
||||
public void render(EndSlimeEntity slimeEntity, float f, float g, MatrixStack matrixStack, VertexConsumerProvider vertexConsumerProvider, int i) {
|
||||
this.shadowRadius = 0.25F * (float) slimeEntity.getSize();
|
||||
super.render(slimeEntity, f, g, matrixStack, vertexConsumerProvider, i);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void scale(EntityEndSlime slimeEntity, MatrixStack matrixStack, float f) {
|
||||
protected void scale(EndSlimeEntity slimeEntity, MatrixStack matrixStack, float f) {
|
||||
matrixStack.scale(0.999F, 0.999F, 0.999F);
|
||||
matrixStack.translate(0.0D, 0.0010000000474974513D, 0.0D);
|
||||
float h = (float) slimeEntity.getSize();
|
||||
|
@ -62,7 +62,7 @@ public class RendererEntityEndSlime extends MobEntityRenderer<EntityEndSlime, En
|
|||
matrixStack.scale(j * h, 1.0F / j * h, j * h);
|
||||
}
|
||||
|
||||
private final class OverlayFeatureRenderer<T extends EntityEndSlime> extends FeatureRenderer<T, EndSlimeEntityModel<T>> {
|
||||
private final class OverlayFeatureRenderer<T extends EndSlimeEntity> extends FeatureRenderer<T, EndSlimeEntityModel<T>> {
|
||||
private final EndSlimeEntityModel<T> modelOrdinal = new EndSlimeEntityModel<T>(true);
|
||||
private final EndSlimeEntityModel<T> modelLake = new EndSlimeEntityModel<T>(true);
|
||||
|
||||
|
|
|
@ -5,17 +5,17 @@ import net.minecraft.client.render.entity.EntityRenderDispatcher;
|
|||
import net.minecraft.client.render.entity.model.PlayerEntityModel;
|
||||
import net.minecraft.util.Identifier;
|
||||
import ru.betterend.BetterEnd;
|
||||
import ru.betterend.entity.EntityShadowWalker;
|
||||
import ru.betterend.entity.ShadowWalkerEntity;
|
||||
|
||||
public class RendererEntityShadowWalker extends BipedEntityRenderer<EntityShadowWalker, PlayerEntityModel<EntityShadowWalker>> {
|
||||
public class RendererEntityShadowWalker extends BipedEntityRenderer<ShadowWalkerEntity, PlayerEntityModel<ShadowWalkerEntity>> {
|
||||
private static final Identifier TEXTURE = BetterEnd.makeID("textures/entity/shadow_walker.png");
|
||||
|
||||
public RendererEntityShadowWalker(EntityRenderDispatcher entityRenderDispatcher) {
|
||||
super(entityRenderDispatcher, new PlayerEntityModel<EntityShadowWalker>(0.0F, false), 0.5F);
|
||||
super(entityRenderDispatcher, new PlayerEntityModel<ShadowWalkerEntity>(0.0F, false), 0.5F);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Identifier getTexture(EntityShadowWalker zombieEntity) {
|
||||
public Identifier getTexture(ShadowWalkerEntity zombieEntity) {
|
||||
return TEXTURE;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,27 +13,27 @@ import net.minecraft.util.Identifier;
|
|||
import net.minecraft.util.registry.Registry;
|
||||
import ru.betterend.BetterEnd;
|
||||
import ru.betterend.config.Configs;
|
||||
import ru.betterend.entity.EntityCubozoa;
|
||||
import ru.betterend.entity.EntityDragonfly;
|
||||
import ru.betterend.entity.EntityEndFish;
|
||||
import ru.betterend.entity.EntityEndSlime;
|
||||
import ru.betterend.entity.EntityShadowWalker;
|
||||
import ru.betterend.entity.CubozoaEntity;
|
||||
import ru.betterend.entity.DragonflyEntity;
|
||||
import ru.betterend.entity.EndFishEntity;
|
||||
import ru.betterend.entity.EndSlimeEntity;
|
||||
import ru.betterend.entity.ShadowWalkerEntity;
|
||||
import ru.betterend.util.MHelper;
|
||||
import ru.betterend.util.SpawnHelper;
|
||||
|
||||
public class EndEntities {
|
||||
public static final EntityType<EntityDragonfly> DRAGONFLY = register("dragonfly", SpawnGroup.AMBIENT, 0.6F, 0.5F, EntityDragonfly::new, EntityDragonfly.createMobAttributes(), true, MHelper.color(32, 42, 176), MHelper.color(115, 225, 249));
|
||||
public static final EntityType<EntityEndSlime> END_SLIME = register("end_slime", SpawnGroup.MONSTER, 2F, 2F, EntityEndSlime::new, EntityEndSlime.createMobAttributes(), false, MHelper.color(28, 28, 28), MHelper.color(99, 11, 99));
|
||||
public static final EntityType<EntityEndFish> END_FISH = register("end_fish", SpawnGroup.WATER_AMBIENT, 0.5F, 0.5F, EntityEndFish::new, EntityEndFish.createMobAttributes(), true, MHelper.color(3, 50, 76), MHelper.color(120, 206, 255));
|
||||
public static final EntityType<EntityShadowWalker> SHADOW_WALKER = register("shadow_walker", SpawnGroup.MONSTER, 0.6F, 1.95F, EntityShadowWalker::new, EntityShadowWalker.createMobAttributes(), true, MHelper.color(30, 30, 30), MHelper.color(5, 5, 5));
|
||||
public static final EntityType<EntityCubozoa> CUBOZOA = register("cubozoa", SpawnGroup.WATER_AMBIENT, 0.6F, 1F, EntityCubozoa::new, EntityCubozoa.createMobAttributes(), true, MHelper.color(151, 77, 181), MHelper.color(93, 176, 238));
|
||||
public static final EntityType<DragonflyEntity> DRAGONFLY = register("dragonfly", SpawnGroup.AMBIENT, 0.6F, 0.5F, DragonflyEntity::new, DragonflyEntity.createMobAttributes(), true, MHelper.color(32, 42, 176), MHelper.color(115, 225, 249));
|
||||
public static final EntityType<EndSlimeEntity> END_SLIME = register("end_slime", SpawnGroup.MONSTER, 2F, 2F, EndSlimeEntity::new, EndSlimeEntity.createMobAttributes(), false, MHelper.color(28, 28, 28), MHelper.color(99, 11, 99));
|
||||
public static final EntityType<EndFishEntity> END_FISH = register("end_fish", SpawnGroup.WATER_AMBIENT, 0.5F, 0.5F, EndFishEntity::new, EndFishEntity.createMobAttributes(), true, MHelper.color(3, 50, 76), MHelper.color(120, 206, 255));
|
||||
public static final EntityType<ShadowWalkerEntity> SHADOW_WALKER = register("shadow_walker", SpawnGroup.MONSTER, 0.6F, 1.95F, ShadowWalkerEntity::new, ShadowWalkerEntity.createMobAttributes(), true, MHelper.color(30, 30, 30), MHelper.color(5, 5, 5));
|
||||
public static final EntityType<CubozoaEntity> CUBOZOA = register("cubozoa", SpawnGroup.WATER_AMBIENT, 0.6F, 1F, CubozoaEntity::new, CubozoaEntity.createMobAttributes(), true, MHelper.color(151, 77, 181), MHelper.color(93, 176, 238));
|
||||
|
||||
public static void register() {
|
||||
SpawnHelper.restrictionAir(DRAGONFLY, EntityDragonfly::canSpawn);
|
||||
SpawnHelper.restrictionLand(END_SLIME, EntityEndSlime::canSpawn);
|
||||
SpawnHelper.restrictionWater(END_FISH, EntityEndFish::canSpawn);
|
||||
SpawnHelper.restrictionLand(SHADOW_WALKER, EntityShadowWalker::canSpawn);
|
||||
SpawnHelper.restrictionWater(CUBOZOA, EntityCubozoa::canSpawn);
|
||||
SpawnHelper.restrictionAir(DRAGONFLY, DragonflyEntity::canSpawn);
|
||||
SpawnHelper.restrictionLand(END_SLIME, EndSlimeEntity::canSpawn);
|
||||
SpawnHelper.restrictionWater(END_FISH, EndFishEntity::canSpawn);
|
||||
SpawnHelper.restrictionLand(SHADOW_WALKER, ShadowWalkerEntity::canSpawn);
|
||||
SpawnHelper.restrictionWater(CUBOZOA, CubozoaEntity::canSpawn);
|
||||
}
|
||||
|
||||
protected static <T extends Entity> EntityType<T> register(String name, SpawnGroup group, float width, float height, EntityFactory<T> entity) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue