diff --git a/src/main/java/net/mcreator/superbwarfare/entity/DroneEntity.java b/src/main/java/net/mcreator/superbwarfare/entity/DroneEntity.java index b7c2c5130..c4caf404a 100644 --- a/src/main/java/net/mcreator/superbwarfare/entity/DroneEntity.java +++ b/src/main/java/net/mcreator/superbwarfare/entity/DroneEntity.java @@ -186,21 +186,24 @@ public class DroneEntity extends LivingEntity implements GeoEntity { if (!this.onGround()) { if (this.getPersistentData().getBoolean("left")) { this.entityData.set(MOVE_X, -1.5f); - this.entityData.set(ROT_X, Mth.lerp(0.25f, this.entityData.get(ROT_X), 0.5f)); + this.entityData.set(ROT_X, Mth.lerp(0.1f, this.entityData.get(ROT_X), 0.3f)); } if (this.getPersistentData().getBoolean("right")) { this.entityData.set(MOVE_X, 1.5f); - this.entityData.set(ROT_X, Mth.lerp(0.25f, this.entityData.get(ROT_X), -0.5f)); + this.entityData.set(ROT_X, Mth.lerp(0.1f, this.entityData.get(ROT_X), -0.3f)); } if (this.getPersistentData().getBoolean("forward")) { - this.entityData.set(MOVE_Z, this.entityData.get(MOVE_Z) - 0.11f); + this.entityData.set(MOVE_Z, this.entityData.get(MOVE_Z) - 0.1f); this.entityData.set(ROT_Z, Mth.lerp(0.1f, this.entityData.get(ROT_Z), -0.5f)); } if (this.getPersistentData().getBoolean("backward")) { - this.entityData.set(MOVE_Z, this.entityData.get(MOVE_Z) + 0.11f); + this.entityData.set(MOVE_Z, this.entityData.get(MOVE_Z) + 0.1f); this.entityData.set(ROT_Z, Mth.lerp(0.1f, this.entityData.get(ROT_Z), 0.5f)); } + } else { + this.entityData.set(ROT_X, 0f); + this.entityData.set(ROT_Z, 0f); } this.entityData.set(ROT_X, Mth.lerp(0.05f, this.entityData.get(ROT_X), 0)); diff --git a/src/main/java/net/mcreator/superbwarfare/entity/model/DroneModel.java b/src/main/java/net/mcreator/superbwarfare/entity/model/DroneModel.java index f415fc55b..53a57126f 100644 --- a/src/main/java/net/mcreator/superbwarfare/entity/model/DroneModel.java +++ b/src/main/java/net/mcreator/superbwarfare/entity/model/DroneModel.java @@ -53,7 +53,7 @@ public class DroneModel extends GeoModel { ammo1.setHidden(animatable.getEntityData().get(AMMO) <= 0); shell.setHidden(!animatable.getEntityData().get(KAMIKAZE)); - float times = (float) Math.min(Minecraft.getInstance().getDeltaFrameTime(), 0.8); + float times = (float) (0.5f * Math.min(Minecraft.getInstance().getDeltaFrameTime(), 0.8)); rotX = Mth.lerp(0.5f * times, rotX, animatable.getEntityData().get(ROT_X)); rotZ = Mth.lerp(0.5f * times, rotZ, animatable.getEntityData().get(ROT_Z)); diff --git a/src/main/java/net/mcreator/superbwarfare/entity/projectile/RgoGrenadeEntity.java b/src/main/java/net/mcreator/superbwarfare/entity/projectile/RgoGrenadeEntity.java index 94c76d71c..a030387e2 100644 --- a/src/main/java/net/mcreator/superbwarfare/entity/projectile/RgoGrenadeEntity.java +++ b/src/main/java/net/mcreator/superbwarfare/entity/projectile/RgoGrenadeEntity.java @@ -2,6 +2,7 @@ package net.mcreator.superbwarfare.entity.projectile; import net.mcreator.superbwarfare.ModUtils; import net.mcreator.superbwarfare.entity.AnimatedEntity; +import net.mcreator.superbwarfare.entity.DroneEntity; import net.mcreator.superbwarfare.init.ModEntities; import net.mcreator.superbwarfare.init.ModItems; import net.mcreator.superbwarfare.init.ModSounds; @@ -28,6 +29,7 @@ import net.minecraft.world.level.Level; import net.minecraft.world.level.block.BellBlock; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.phys.BlockHitResult; +import net.minecraft.world.phys.EntityHitResult; import net.minecraft.world.phys.HitResult; import net.minecraft.world.phys.Vec3; import net.minecraftforge.network.NetworkHooks; @@ -83,12 +85,14 @@ public class RgoGrenadeEntity extends ThrowableItemProjectile implements GeoEnti if (state.getBlock() instanceof BellBlock bell) { bell.attemptToRing(this.level(), resultPos, blockResult.getDirection()); } - if (this.tickCount > 4) { + if (this.tickCount > 2) { ProjectileTool.causeCustomExplode(this, 135f, 6.75f, 1.5f); } break; case ENTITY: + EntityHitResult entityResult = (EntityHitResult) result; + Entity entity = entityResult.getEntity(); if (this.getOwner() instanceof LivingEntity living) { if (!living.level().isClientSide() && living instanceof ServerPlayer player) { living.level().playSound(null, living.blockPosition(), ModSounds.INDICATION.get(), SoundSource.VOICE, 1, 1); @@ -96,7 +100,7 @@ public class RgoGrenadeEntity extends ThrowableItemProjectile implements GeoEnti ModUtils.PACKET_HANDLER.send(PacketDistributor.PLAYER.with(() -> player), new ClientIndicatorMessage(0, 5)); } } - if (this.tickCount > 4) { + if (this.tickCount > 2 && !(entity instanceof DroneEntity)) { ProjectileTool.causeCustomExplode(this, 150f, 4.75f, 2f); } break; @@ -117,7 +121,7 @@ public class RgoGrenadeEntity extends ThrowableItemProjectile implements GeoEnti } } - if (this.tickCount > 4) { + if (this.tickCount > 2) { if (!this.level().isClientSide() && this.level() instanceof ServerLevel serverLevel) { ParticleTool.sendParticle(serverLevel, ParticleTypes.SMOKE, this.xo, this.yo, this.zo, 1, 0, 0, 0, 0.01, true);