mirror of
https://github.com/Samsuik/Sakura.git
synced 2025-12-29 19:59:08 +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.7 KiB
Diff
31 lines
1.7 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 289e935a2e6dfa5d45b9c913b8ed320e1a170f93..5920491a3857f3e75d02a33a1c3eae8907dc5241 100644
|
|
--- a/src/main/java/me/samsuik/sakura/explosion/special/SpecialisedExplosion.java
|
|
+++ b/src/main/java/me/samsuik/sakura/explosion/special/SpecialisedExplosion.java
|
|
@@ -224,6 +224,7 @@ public abstract class SpecialisedExplosion<T extends Entity> extends Explosion {
|
|
moveZ += z;
|
|
}
|
|
|
|
+ entity.hasImpulse = true; // Sakura - set entity impulse on explosion
|
|
entity.setDeltaMovement(moveX, moveY, moveZ);
|
|
}
|
|
}
|
|
diff --git a/src/main/java/net/minecraft/world/level/Explosion.java b/src/main/java/net/minecraft/world/level/Explosion.java
|
|
index f248d8a3e63bb6f33001518e3481c7e7c75cac1b..10260736ac47e15cb55f43c4dd720cbbe7fe4e15 100644
|
|
--- a/src/main/java/net/minecraft/world/level/Explosion.java
|
|
+++ b/src/main/java/net/minecraft/world/level/Explosion.java
|
|
@@ -786,6 +786,7 @@ public class Explosion {
|
|
// Paper end - knockback events
|
|
}
|
|
// CraftBukkit end
|
|
+ entity.hasImpulse = true; // Sakura - set entity impulse on explosion
|
|
entity.setDeltaMovement(entity.getDeltaMovement().add(vec3d1));
|
|
if (entity instanceof Player) {
|
|
Player entityhuman = (Player) entity;
|