tweaked manticore and vortex
This commit is contained in:
1 parent
bb43425edc
commit
d34830a99b
4 files changed
+48
-8
No files matched your search
+3
-3
@@ -12,9 +12,9 @@ import net.minecraft.util.Mth;
|
||||
import org.joml.Matrix4f;
|
||||
|
||||
public class WindVortexRenderer extends EntityRenderer<WindVortexEntity> {
|
||||
private static final int RINGS = 8;
|
||||
private static final int SEGMENTS_PER_RING = 9;
|
||||
private static final int ARC_STEPS = 4;
|
||||
private static final int RINGS = 10;
|
||||
private static final int SEGMENTS_PER_RING = 12;
|
||||
private static final int ARC_STEPS = 6;
|
||||
private static final float BASE_RADIUS = 0.35F;
|
||||
|
||||
public WindVortexRenderer(EntityRendererProvider.Context context) {
|
||||
|
||||
+21
-1
@@ -222,13 +222,15 @@ public class ManticoreEntity extends Monster implements GeoEntity {
|
||||
this.tickQueenSummonCleanup();
|
||||
|
||||
this.tickPlayerSummon();
|
||||
this.tickQueenSummonTarget();
|
||||
|
||||
LivingEntity target = this.getTarget();
|
||||
if (target != null && target.isAlive()) {
|
||||
if (this.onGround() && this.takeoffCooldown <= 0 && this.distanceToSqr(target) > 6.0D) {
|
||||
this.takeoff();
|
||||
}
|
||||
if (this.tickCount % SWARM_RETARGET_INTERVAL == 0) {
|
||||
if (!this.isPlayerSummoned() && !this.isQueenSummoned()
|
||||
&& this.tickCount % SWARM_RETARGET_INTERVAL == 0) {
|
||||
this.spreadSwarmTarget(target);
|
||||
}
|
||||
}
|
||||
@@ -253,6 +255,24 @@ public class ManticoreEntity extends Monster implements GeoEntity {
|
||||
}
|
||||
if (target != null && target.isAlive() && this.canTargetEntity(target)) {
|
||||
this.setTarget(target);
|
||||
} else if (this.getTarget() != null && !this.canTargetEntity(this.getTarget())) {
|
||||
this.setTarget(null);
|
||||
}
|
||||
}
|
||||
|
||||
private void tickQueenSummonTarget() {
|
||||
if (this.summonerId == null || !(this.level() instanceof ServerLevel serverLevel)) {
|
||||
return;
|
||||
}
|
||||
Entity entity = serverLevel.getEntity(this.summonerId);
|
||||
if (!(entity instanceof QueenEntity queen) || !queen.isAlive()) {
|
||||
return;
|
||||
}
|
||||
LivingEntity target = queen.getTarget();
|
||||
if (target != null && target.isAlive() && this.canTargetEntity(target)) {
|
||||
this.setTarget(target);
|
||||
} else {
|
||||
this.setTarget(null);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+21
-1
@@ -69,6 +69,9 @@ public class WindVortexEntity extends Entity {
|
||||
|
||||
private static final double BASE_RADIUS = 0.35D;
|
||||
private static final double DRIFT_FRICTION = 0.995D;
|
||||
private static final double FALL_ACCELERATION = 0.006D;
|
||||
private static final double MAX_FALL_SPEED = 0.08D;
|
||||
private static final double MINIMUM_DOWNWARD_DRIFT = 0.012D;
|
||||
private static final int FADE_OUT_TICKS = 8;
|
||||
|
||||
public enum VortexMode {
|
||||
@@ -175,8 +178,25 @@ public class WindVortexEntity extends Entity {
|
||||
this.travelling = false;
|
||||
this.noPhysics = false;
|
||||
this.setDeltaMovement(this.travelVelocity);
|
||||
this.travelVelocity = Vec3.ZERO;
|
||||
}
|
||||
} else if (!lensVortex) {
|
||||
Vec3 current = this.getDeltaMovement();
|
||||
double downwardSpeed = Math.min(MAX_FALL_SPEED, Math.max(MINIMUM_DOWNWARD_DRIFT,
|
||||
-current.y + FALL_ACCELERATION));
|
||||
Vec3 drift = new Vec3(
|
||||
current.x * DRIFT_FRICTION,
|
||||
-downwardSpeed,
|
||||
current.z * DRIFT_FRICTION);
|
||||
Vec3 from = this.position();
|
||||
Vec3 to = from.add(drift);
|
||||
HitResult blockHit = this.level().clip(
|
||||
new ClipContext(from, to, ClipContext.Block.COLLIDER, ClipContext.Fluid.NONE, this));
|
||||
if (blockHit.getType() != HitResult.Type.MISS) {
|
||||
this.fadeOut();
|
||||
return;
|
||||
}
|
||||
this.setDeltaMovement(drift);
|
||||
this.move(net.minecraft.world.entity.MoverType.SELF, drift);
|
||||
} else {
|
||||
Vec3 drift = this.getDeltaMovement().multiply(DRIFT_FRICTION, DRIFT_FRICTION, DRIFT_FRICTION);
|
||||
this.setDeltaMovement(drift);
|
||||
|
||||
@@ -36,8 +36,8 @@
|
||||
"charge": 1.4
|
||||
},
|
||||
"antarchy:vortex": {
|
||||
"energy_budget": 0.2,
|
||||
"charge": 1.6
|
||||
"energy_budget": 0.9,
|
||||
"charge": 12.0
|
||||
}
|
||||
},
|
||||
"carvers": {
|
||||
@@ -88,7 +88,7 @@
|
||||
},
|
||||
{
|
||||
"type": "antarchy:vortex",
|
||||
"weight": 2,
|
||||
"weight": 1,
|
||||
"minCount": 1,
|
||||
"maxCount": 1
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user