mirror of
https://github.com/Samsuik/Sakura.git
synced 2025-12-20 23:39: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 1b6b535836d939fe07c509176871af4e76669760..35cddf7c87192341147734794d8580158feb1626 100644
|
|
--- a/src/main/java/me/samsuik/sakura/explosion/special/SpecialisedExplosion.java
|
|
+++ b/src/main/java/me/samsuik/sakura/explosion/special/SpecialisedExplosion.java
|
|
@@ -197,6 +197,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 7fd7149d4c370d6893318b729f93778ef02bc4b1..4960d170a273eff18d2d83cdb7c4772fa020db4f 100644
|
|
--- a/src/main/java/net/minecraft/world/level/Explosion.java
|
|
+++ b/src/main/java/net/minecraft/world/level/Explosion.java
|
|
@@ -829,6 +829,7 @@ public class Explosion {
|
|
entity.addDeltaMovement(d8, d9, d10);
|
|
// Sakura end - reduce deltaMovement allocations
|
|
}
|
|
+ entity.hasImpulse = true; // Sakura - set entity impulse on explosion
|
|
// CraftBukkit end
|
|
if (entity instanceof Player) {
|
|
Player entityhuman = (Player) entity;
|