mirror of
https://github.com/Samsuik/Sakura.git
synced 2025-12-19 23:09:32 +00:00
The player velocity was not being talied correctly, and velocity was not sent when explosion effects were disabled in fps settings.
31 lines
1.8 KiB
Diff
31 lines
1.8 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Samsuik <kfian294ma4@gmail.com>
|
|
Date: Mon, 29 Jul 2024 00:18:58 +0100
|
|
Subject: [PATCH] Set entity impulse on explosion
|
|
|
|
|
|
diff --git a/src/main/java/me/samsuik/sakura/explosion/special/SpecialisedExplosion.java b/src/main/java/me/samsuik/sakura/explosion/special/SpecialisedExplosion.java
|
|
index 7d3431dc41246e4967bc11e5605611c78a3153bf..0c5e19770e09e318e8a732f8eac0ccd2ce240577 100644
|
|
--- a/src/main/java/me/samsuik/sakura/explosion/special/SpecialisedExplosion.java
|
|
+++ b/src/main/java/me/samsuik/sakura/explosion/special/SpecialisedExplosion.java
|
|
@@ -198,6 +198,7 @@ public abstract class SpecialisedExplosion<T extends Entity> extends Explosion {
|
|
y *= exposure;
|
|
z *= exposure;
|
|
|
|
+ entity.hasImpulse = true; // Sakura - set entity impulse on explosion
|
|
for (int i = 0; i < potential; ++i) {
|
|
entity.addDeltaMovement(x, y, z);
|
|
}
|
|
diff --git a/src/main/java/net/minecraft/world/level/Explosion.java b/src/main/java/net/minecraft/world/level/Explosion.java
|
|
index 2b76d4eb6ef609c2f53ba6595abc656eb2bff056..1e327955020c73d51d09e1f9976d1c0c6855acf1 100644
|
|
--- a/src/main/java/net/minecraft/world/level/Explosion.java
|
|
+++ b/src/main/java/net/minecraft/world/level/Explosion.java
|
|
@@ -821,6 +821,7 @@ public class Explosion {
|
|
// Sakura end - reduce deltaMovement allocations
|
|
}
|
|
// CraftBukkit end
|
|
+ entity.hasImpulse = true; // Sakura - set entity impulse on explosion
|
|
// Sakura - moved up
|
|
if (entity instanceof Player) {
|
|
Player entityhuman = (Player) entity;
|