fix desync from tunnel arrow (for real this time)
This commit is contained in:
2 files changed
+6
-10
No files matched your search
+1
-1
@@ -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
|
||||
|
||||
@@ -27,19 +27,23 @@ public class tunnelArrow extends baseArrow{
|
||||
public void tick() {
|
||||
super.tick();
|
||||
if (inGround) {
|
||||
if (!level().isClientSide) {
|
||||
explode();
|
||||
}
|
||||
discard();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void doPostHurtEffects(@NotNull LivingEntity pTarget) {
|
||||
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());
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user