优化弹道
This commit is contained in:
parent
8200a17fe9
commit
317e336a6c
3 changed files with 13 additions and 8 deletions
|
@ -3,8 +3,8 @@ package net.mcreator.superbwarfare.client.renderer.entity;
|
|||
import com.mojang.blaze3d.vertex.PoseStack;
|
||||
import com.mojang.blaze3d.vertex.VertexConsumer;
|
||||
import com.mojang.math.Axis;
|
||||
import net.mcreator.superbwarfare.entity.projectile.JavelinMissileEntity;
|
||||
import net.mcreator.superbwarfare.entity.model.JavelinMissileModel;
|
||||
import net.mcreator.superbwarfare.entity.projectile.JavelinMissileEntity;
|
||||
import net.minecraft.client.renderer.MultiBufferSource;
|
||||
import net.minecraft.client.renderer.RenderType;
|
||||
import net.minecraft.client.renderer.entity.EntityRendererProvider;
|
||||
|
@ -36,7 +36,7 @@ public class JavelinMissileRenderer extends GeoEntityRenderer<JavelinMissileEnti
|
|||
@Override
|
||||
public void render(JavelinMissileEntity entityIn, float entityYaw, float partialTicks, PoseStack poseStack, MultiBufferSource bufferIn, int packedLightIn) {
|
||||
poseStack.pushPose();
|
||||
if (entityIn.tickCount > 5) {
|
||||
if (entityIn.tickCount > 3) {
|
||||
poseStack.mulPose(Axis.YP.rotationDegrees(90 - Mth.lerp(partialTicks, entityIn.yRotO, entityIn.getYRot())));
|
||||
poseStack.mulPose(Axis.ZP.rotationDegrees(Mth.lerp(partialTicks, entityIn.xRotO, entityIn.getXRot()) - 90));
|
||||
} else {
|
||||
|
|
|
@ -341,7 +341,7 @@ public class Mle1934Entity extends PathfinderMob implements GeoEntity, ICannonEn
|
|||
}
|
||||
if (stack != null && this.isVehicle() && !stack.is(ModTags.Items.GUN)) {
|
||||
float diffY = entity.getYHeadRot() - this.getYRot();
|
||||
float diffX = entity.getXRot() - 1.3f - this.getXRot();
|
||||
float diffX = entity.getXRot() - 1.2f - this.getXRot();
|
||||
if (diffY > 180.0f) {
|
||||
diffY -= 360.0f;
|
||||
} else if (diffY < -180.0f) {
|
||||
|
|
|
@ -164,18 +164,23 @@ public class JavelinMissileEntity extends ThrowableItemProjectile implements Geo
|
|||
.stream().filter(e -> e.getStringUUID().equals(entityData.get(TARGET_UUID))).findFirst().orElse(null);
|
||||
|
||||
|
||||
if (this.tickCount == 6) {
|
||||
if (this.tickCount == 4) {
|
||||
if (!this.level().isClientSide() && this.level() instanceof ServerLevel serverLevel) {
|
||||
ParticleTool.sendParticle(serverLevel, ParticleTypes.CLOUD, this.xo, this.yo, this.zo, 15, 0.8, 0.8, 0.8, 0.01, true);
|
||||
ParticleTool.sendParticle(serverLevel, ParticleTypes.CAMPFIRE_COSY_SMOKE, this.xo, this.yo, this.zo, 10, 0.8, 0.8, 0.8, 0.01, true);
|
||||
}
|
||||
}
|
||||
|
||||
if (this.tickCount > 5) {
|
||||
if (this.tickCount > 3) {
|
||||
if (entity != null) {
|
||||
if (entityData.get(TOP)) {
|
||||
if (this.position().distanceTo(entity.position()) > 40) {
|
||||
this.look(EntityAnchorArgument.Anchor.EYES, new Vec3(entity.getX(), entity.getY() + 30, entity.getZ()));
|
||||
double px = this.getX();
|
||||
double ex = entity.getX();
|
||||
double pz = this.getZ();
|
||||
double ez = entity.getZ();
|
||||
|
||||
if (Math.sqrt(Math.pow(px - ex, 2) + Math.pow(pz - ez, 2)) > 10) {
|
||||
this.look(EntityAnchorArgument.Anchor.EYES, new Vec3(entity.getX(), entity.getY() + Mth.clamp(4 * this.tickCount, 0, 90), entity.getZ()));
|
||||
} else {
|
||||
this.look(EntityAnchorArgument.Anchor.EYES, new Vec3(entity.getX(), entity.getEyeY() + (entity instanceof EnderDragon ? -3 : 1), entity.getZ()));
|
||||
}
|
||||
|
@ -188,7 +193,7 @@ public class JavelinMissileEntity extends ThrowableItemProjectile implements Geo
|
|||
}
|
||||
}
|
||||
|
||||
if (this.tickCount > 6) {
|
||||
if (this.tickCount > 4) {
|
||||
this.setDeltaMovement(new Vec3(
|
||||
0.7f * this.getDeltaMovement().x + 1.3f * this.getLookAngle().x,
|
||||
0.7f * this.getDeltaMovement().y + 1.3f * this.getLookAngle().y,
|
||||
|
|
Loading…
Add table
Reference in a new issue