mirror of
https://github.com/Samsuik/Sakura.git
synced 2025-12-21 07:49:29 +00:00
more refractoring
This commit is contained in:
@@ -5,7 +5,7 @@ Subject: [PATCH] Specialised Explosions
|
||||
|
||||
|
||||
diff --git a/net/minecraft/server/level/ServerLevel.java b/net/minecraft/server/level/ServerLevel.java
|
||||
index fab973cb02218458f23e59665b4f2deb5d54da8d..b9806bdd4d49ed3fd8c17125143703b6a792b10e 100644
|
||||
index fab973cb02218458f23e59665b4f2deb5d54da8d..aa99771955f069d63b90f34e2962f5e5323e8ca8 100644
|
||||
--- a/net/minecraft/server/level/ServerLevel.java
|
||||
+++ b/net/minecraft/server/level/ServerLevel.java
|
||||
@@ -1891,7 +1891,16 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
||||
@@ -16,7 +16,7 @@ index fab973cb02218458f23e59665b4f2deb5d54da8d..b9806bdd4d49ed3fd8c17125143703b6
|
||||
+ // Sakura start - specialised explosions
|
||||
+ final ServerExplosion serverExplosion;
|
||||
+ if (source instanceof net.minecraft.world.entity.item.PrimedTnt tnt) {
|
||||
+ serverExplosion = new me.samsuik.sakura.explosion.special.TntExplosion(this, tnt, damageSource, damageCalculator, vec3, radius, fire, blockInteraction, self -> {
|
||||
+ serverExplosion = new me.samsuik.sakura.explosion.TntExplosion(this, tnt, damageSource, damageCalculator, vec3, radius, fire, blockInteraction, self -> {
|
||||
+ this.notifyPlayersOfExplosion(self, self.center(), smallExplosionParticles, largeExplosionParticles, explosionSound);
|
||||
+ });
|
||||
+ } else {
|
||||
|
||||
@@ -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;
|
||||
@@ -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() {
|
||||
Reference in New Issue
Block a user