fix desync from tunnel arrow (for real this time)
This commit is contained in:
parent
c4c0403100
commit
9f2fb2158f
@ -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.
|
# The license of the mod. Review your options at https://choosealicense.com/. All Rights Reserved is the default.
|
||||||
mod_license=All Rights Reserved
|
mod_license=All Rights Reserved
|
||||||
# The mod version. See https://semver.org/
|
# 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.
|
# 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.
|
# This should match the base package used for the mod sources.
|
||||||
# See https://maven.apache.org/guides/mini/guide-naming-conventions.html
|
# See https://maven.apache.org/guides/mini/guide-naming-conventions.html
|
||||||
|
@ -27,19 +27,23 @@ public class tunnelArrow extends baseArrow{
|
|||||||
public void tick() {
|
public void tick() {
|
||||||
super.tick();
|
super.tick();
|
||||||
if (inGround) {
|
if (inGround) {
|
||||||
explode();
|
if (!level().isClientSide) {
|
||||||
|
explode();
|
||||||
|
}
|
||||||
discard();
|
discard();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void doPostHurtEffects(@NotNull LivingEntity pTarget) {
|
protected void doPostHurtEffects(@NotNull LivingEntity pTarget) {
|
||||||
explode();
|
if (!level().isClientSide) {
|
||||||
|
explode();
|
||||||
|
}
|
||||||
discard();
|
discard();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void explode() {
|
protected void explode() {
|
||||||
sync();
|
// sync();
|
||||||
Vec3 rot = getTargetVec( - getXRot(), - getYRot(), 0);
|
Vec3 rot = getTargetVec( - getXRot(), - getYRot(), 0);
|
||||||
for (int i = 0; i < explosionCount; i++) {
|
for (int i = 0; i < explosionCount; i++) {
|
||||||
Vec3 pos = position().add(rot.multiply(i * spacing, i * spacing, i * spacing));
|
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);
|
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());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user