9
0
mirror of https://github.com/Samsuik/Sakura.git synced 2025-12-28 11:19:08 +00:00

more refractoring

This commit is contained in:
Samsuik
2025-06-24 11:09:29 +01:00
parent f63aae3731
commit 0604473aad
3 changed files with 9 additions and 9 deletions

View File

@@ -1,4 +1,4 @@
package me.samsuik.sakura.explosion.special;
package me.samsuik.sakura.explosion;
import ca.spottedleaf.moonrise.common.util.WorldUtil;
import ca.spottedleaf.moonrise.patches.chunk_system.level.entity.ChunkEntitySlices;
@@ -161,15 +161,15 @@ public abstract class SpecialisedExplosion<T extends Entity> extends ServerExplo
if (distanceFromBottom <= 1.0) {
double x = entity.getX() - pos.x;
double y = entity.getEyeY() - pos.y; // Sakura - physics version api
double y = entity.getEyeY() - pos.y; // Sakura - configure cannon physics
double z = entity.getZ() - pos.z;
double distance = Math.sqrt(x * x + y * y + z * z);
// Sakura start - physics version api
// Sakura start - configure cannon physics
if (this.physics.before(1_17_0)) {
distanceFromBottom = (float) distanceFromBottom;
distance = (float) distance;
}
// Sakura end - physics version api
// Sakura end - configure cannon physics
if (distance != 0.0D) {
x /= distance;

View File

@@ -1,4 +1,4 @@
package me.samsuik.sakura.explosion.special;
package me.samsuik.sakura.explosion;
import ca.spottedleaf.moonrise.common.list.IteratorSafeOrderedReferenceSet;
import it.unimi.dsi.fastutil.objects.ObjectArrayList;
@@ -35,12 +35,12 @@ public final class TntExplosion extends SpecialisedExplosion<PrimedTnt> {
this.bounds = new AABB(center, center);
}
// Sakura start - physics version api
// Sakura start - configure cannon physics
@Override
protected double getExplosionOffset() {
return this.physics.before(1_10_0) ? (double) 0.49f : super.getExplosionOffset();
}
// Sakura end - physics version api
// Sakura end - configure cannon physics
@Override
protected int getExplosionCount() {