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
gradle.properties
src/main
java/com/jenny/enhancedexplosives
resources/assets/enhancedexplosives/textures/particle

@ -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.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.
# This should match the base package used for the mod sources.
# See https://maven.apache.org/guides/mini/guide-naming-conventions.html

@ -26,7 +26,6 @@ public class concussiveArrow extends baseArrow{
super.tick();
if (this.inGround) {
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();
}
}
@ -45,11 +44,14 @@ public class concussiveArrow extends baseArrow{
@Override
public void spawnParticles(float partialTicks) {
for (int i = 1; i <= ConfigClient.calcPCount(3); i++) {
Vec3 pos = getPosition(partialTicks);
double x = pos.x + (double) level().getRandom().nextInt(-5, 6) / 10;
double y = pos.y + (double) level().getRandom().nextInt(-5, 6) / 10;
double z = pos.z + (double) level().getRandom().nextInt(-5, 6) / 10;
level().addParticle(particles.CONCUSSIVE_ARROW_PARTICLE.get(), x, y, z, this.getDeltaMovement().x, this.getDeltaMovement().y, this.getDeltaMovement().z);
double m = (double) level().getRandom().nextIntBetweenInclusive(- 100, 100) / 100;
Vec3 DeltaMovement = getDeltaMovement();
Vec3 pos = new Vec3(
(double) level().getRandom().nextIntBetweenInclusive(-5, 5) / 10,
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);
}
}
}

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

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

Binary file not shown.

Before

(image error) Size: 123 B

After

(image error) Size: 132 B

Binary file not shown.

Before

(image error) Size: 123 B

After

(image error) Size: 132 B