new particle textures & new algorithm for arrow particle position

This commit is contained in:
Jenny 2025-01-26 12:46:29 +01:00
parent 69a58f1ba9
commit 6be0064866
Signed by: Jenny
GPG Key ID: 4A98012FB1C39311
6 changed files with 17 additions and 16 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. # 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.8.7 mod_version=0.8.8
# 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

View File

@ -26,7 +26,6 @@ public class concussiveArrow extends baseArrow{
super.tick(); super.tick();
if (this.inGround) { if (this.inGround) {
this.level().explode(this, getX(), getY(), getZ(), 8.0f, Level.ExplosionInteraction.NONE); this.level().explode(this, getX(), getY(), getZ(), 8.0f, Level.ExplosionInteraction.NONE);
//this.level().explode(this, null, new NilExplosionCalculator(), this.getX(), this.getY(), this.getZ(), 8, false, Level.ExplosionInteraction.NONE);
this.discard(); this.discard();
} }
} }
@ -45,11 +44,14 @@ public class concussiveArrow extends baseArrow{
@Override @Override
public void spawnParticles(float partialTicks) { public void spawnParticles(float partialTicks) {
for (int i = 1; i <= ConfigClient.calcPCount(3); i++) { for (int i = 1; i <= ConfigClient.calcPCount(3); i++) {
Vec3 pos = getPosition(partialTicks); double m = (double) level().getRandom().nextIntBetweenInclusive(- 100, 100) / 100;
double x = pos.x + (double) level().getRandom().nextInt(-5, 6) / 10; Vec3 DeltaMovement = getDeltaMovement();
double y = pos.y + (double) level().getRandom().nextInt(-5, 6) / 10; Vec3 pos = new Vec3(
double z = pos.z + (double) level().getRandom().nextInt(-5, 6) / 10; (double) level().getRandom().nextIntBetweenInclusive(-5, 5) / 10,
level().addParticle(particles.CONCUSSIVE_ARROW_PARTICLE.get(), x, y, z, this.getDeltaMovement().x, this.getDeltaMovement().y, this.getDeltaMovement().z); 0,
(double) level().getRandom().nextIntBetweenInclusive(-5, 5) / 10
).normalize().multiply(m, m, m).add(getPosition(partialTicks));
level().addParticle(particles.CONCUSSIVE_ARROW_PARTICLE.get(), pos.x, pos.y, pos.z, DeltaMovement.x, DeltaMovement.y, DeltaMovement.z);
} }
} }
} }

View File

@ -24,9 +24,6 @@ public class tntArrow extends baseArrow {
@Override @Override
public void tick() { public void tick() {
super.tick(); super.tick();
if (level().isClientSide()) {
//spawnParticles();
}
if (this.inGround) { if (this.inGround) {
this.level().explode(this, this.getX(), this.getY(), this.getZ(), 2, Level.ExplosionInteraction.TNT); this.level().explode(this, this.getX(), this.getY(), this.getZ(), 2, Level.ExplosionInteraction.TNT);
this.discard(); this.discard();
@ -47,11 +44,14 @@ public class tntArrow extends baseArrow {
@Override @Override
public void spawnParticles(float partialTicks) { public void spawnParticles(float partialTicks) {
for (int i = 1; i <= ConfigClient.calcPCount(3); i++) { for (int i = 1; i <= ConfigClient.calcPCount(3); i++) {
Vec3 pos = getPosition(partialTicks); double m = (double) level().getRandom().nextIntBetweenInclusive(- 100, 100) / 100;
double x = pos.x + (double) level().getRandom().nextInt(-5, 6) / 10; Vec3 DeltaMovement = getDeltaMovement();
double y = pos.y + (double) level().getRandom().nextInt(-5, 6) / 10; Vec3 pos = new Vec3(
double z = pos.z + (double) level().getRandom().nextInt(-5, 6) / 10; (double) level().getRandom().nextIntBetweenInclusive(-5, 5) / 10,
level().addParticle(particles.TNT_ARROW_PARTICLE.get(), x, y, z, this.getDeltaMovement().x, this.getDeltaMovement().y, this.getDeltaMovement().z); 0,
(double) level().getRandom().nextIntBetweenInclusive(-5, 5) / 10
).normalize().multiply(m, m, m).add(getPosition(partialTicks));
level().addParticle(particles.TNT_ARROW_PARTICLE.get(), pos.x, pos.y, pos.z, DeltaMovement.x, DeltaMovement.y, DeltaMovement.z);
} }
} }
} }

View File

@ -18,7 +18,6 @@ public class ArrowParticle extends TextureSheetParticle {
this.xd = xd; this.xd = xd;
this.yd = yd; this.yd = yd;
this.zd = zd; this.zd = zd;
this.quadSize *= 0.85F;
this.quadSizeStart = this.quadSize; this.quadSizeStart = this.quadSize;
this.lifetime = 20; this.lifetime = 20;
this.setSpriteFromAge(spriteSet); this.setSpriteFromAge(spriteSet);

Binary file not shown.

Before

Width:  |  Height:  |  Size: 123 B

After

Width:  |  Height:  |  Size: 132 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 123 B

After

Width:  |  Height:  |  Size: 132 B