fix desync from tunnel arrow (for real this time)

This commit is contained in:
Jenny 2025-01-29 04:51:11 +01:00
parent c4c0403100
commit 9f2fb2158f
Signed by: Jenny
GPG Key ID: 2072A14E40940632
2 changed files with 8 additions and 12 deletions

View File

@ -38,7 +38,7 @@ mod_name=Enhanced Explosives
# The license of the mod. Review your options at https://choosealicense.com/. All Rights Reserved is the default.
mod_license=All Rights Reserved
# The mod version. See https://semver.org/
mod_version=0.9.3
mod_version=0.9.4
# The group ID for the mod. It is only important when publishing as an artifact to a Maven repository.
# This should match the base package used for the mod sources.
# See https://maven.apache.org/guides/mini/guide-naming-conventions.html

View File

@ -27,19 +27,23 @@ public class tunnelArrow extends baseArrow{
public void tick() {
super.tick();
if (inGround) {
explode();
if (!level().isClientSide) {
explode();
}
discard();
}
}
@Override
protected void doPostHurtEffects(@NotNull LivingEntity pTarget) {
explode();
if (!level().isClientSide) {
explode();
}
discard();
}
protected void explode() {
sync();
// sync();
Vec3 rot = getTargetVec( - getXRot(), - getYRot(), 0);
for (int i = 0; i < explosionCount; i++) {
Vec3 pos = position().add(rot.multiply(i * spacing, i * spacing, i * spacing));
@ -69,12 +73,4 @@ public class tunnelArrow extends baseArrow{
level().addParticle(particles.TUNNEL_ARROW_PARTICLE.get(), pos.x, pos.y, pos.z, DeltaMovement.x, DeltaMovement.y, DeltaMovement.z);
}
}
public void sync() {
if (!level().isClientSide) {
setPos(position());
setRot(getYRot(), getXRot());
setDeltaMovement(getDeltaMovement());
}
}
}