修复了波塞克散射模式伤害
This commit is contained in:
parent
26f63be31f
commit
cc8bbcdade
3 changed files with 22 additions and 17 deletions
|
@ -19,6 +19,6 @@ public class TargetCustomModEntities {
|
|||
|
||||
public static final RegistryObject<EntityType<ProjectileEntity>> PROJECTILE =
|
||||
ENTITY_TYPES.register("projectile",
|
||||
() -> EntityType.Builder.<ProjectileEntity>of(ProjectileEntity::new, MobCategory.MISC).setTrackingRange(0).sized(0.5f, 0.5f).build("projectile"));
|
||||
() -> EntityType.Builder.<ProjectileEntity>of(ProjectileEntity::new, MobCategory.MISC).sized(0.5f, 0.5f).build("projectile"));
|
||||
|
||||
}
|
||||
|
|
|
@ -2,6 +2,7 @@ package net.mcreator.target.procedures;
|
|||
|
||||
import net.mcreator.target.entity.BocekarrowEntity;
|
||||
import net.mcreator.target.entity.ProjectileEntity;
|
||||
import net.mcreator.target.init.TargetModAttributes;
|
||||
import net.mcreator.target.init.TargetModEntities;
|
||||
import net.mcreator.target.init.TargetModItems;
|
||||
import net.mcreator.target.network.TargetModVariables;
|
||||
|
@ -62,12 +63,7 @@ public class BowlooseProcedure {
|
|||
}
|
||||
} else {
|
||||
for (int index0 = 0; index0 < 10; index0++) {
|
||||
if (!entity.level().isClientSide() && entity instanceof LivingEntity living) {
|
||||
ProjectileEntity projectile = new ProjectileEntity(entity.level(), living);
|
||||
projectile.setPos(living.getX(), living.getEyeY() - 0.1, living.getZ());
|
||||
projectile.shoot(living.getLookAngle().x, living.getLookAngle().y, living.getLookAngle().z, (float) (4 * power), 2);
|
||||
entity.level().addFreshEntity(projectile);
|
||||
}
|
||||
BulletFireNormalProcedure.execute(entity);
|
||||
}
|
||||
|
||||
if (!entity.level().isClientSide() && entity.getServer() != null) {
|
||||
|
|
|
@ -36,14 +36,22 @@ public class BulletFireNormalProcedure {
|
|||
|
||||
if (!entity.level().isClientSide() && entity instanceof LivingEntity living) {
|
||||
float damage;
|
||||
float headshot = (float) heldItem.getOrCreateTag().getDouble("headshot");
|
||||
float velocity = 4 * (float) heldItem.getOrCreateTag().getDouble("power");
|
||||
|
||||
if (heldItem.getItem() == TargetModItems.BOCEK.get()) {
|
||||
damage = (float) heldItem.getOrCreateTag().getDouble("speed") * (float) heldItem.getOrCreateTag().getDouble("damageadd");
|
||||
|
||||
damage = 0.2f * (float) heldItem.getOrCreateTag().getDouble("speed") * (float) heldItem.getOrCreateTag().getDouble("damageadd");
|
||||
|
||||
ProjectileEntity projectile = new ProjectileEntity(entity.level(), living, damage, headshot);
|
||||
|
||||
projectile.setPos((living.getX() + (-0.5) * living.getLookAngle().x), (living.getEyeY() - 0.1 + (-0.5) * living.getLookAngle().y), (living.getZ() + (-0.5) * living.getLookAngle().z));
|
||||
projectile.shoot(living.getLookAngle().x, living.getLookAngle().y, living.getLookAngle().z, velocity, 2);
|
||||
entity.level().addFreshEntity(projectile);
|
||||
|
||||
} else {
|
||||
damage = (float) (heldItem.getOrCreateTag().getDouble("damage") + heldItem.getOrCreateTag().getDouble("adddamage"))
|
||||
* (float) heldItem.getOrCreateTag().getDouble("damageadd");
|
||||
}
|
||||
|
||||
float headshot = (float) heldItem.getOrCreateTag().getDouble("headshot");
|
||||
|
||||
ProjectileEntity projectile = new ProjectileEntity(entity.level(), living, damage, headshot);
|
||||
|
||||
|
@ -53,4 +61,5 @@ public class BulletFireNormalProcedure {
|
|||
entity.level().addFreshEntity(projectile);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue