Skip to content

Commit

Permalink
Fix pushedByFluid default
Browse files Browse the repository at this point in the history
  • Loading branch information
Samsuik committed Nov 24, 2023
1 parent 1a67430 commit 1c4d48c
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 9 deletions.
12 changes: 10 additions & 2 deletions patches/server/0020-Optimised-Explosions.patch
Original file line number Diff line number Diff line change
Expand Up @@ -142,10 +142,10 @@ index 0000000000000000000000000000000000000000..3f6f34cc617efaad420485a7f613cfca
+}
diff --git a/src/main/java/me/samsuik/sakura/explosion/SakuraExplosion.java b/src/main/java/me/samsuik/sakura/explosion/SakuraExplosion.java
new file mode 100644
index 0000000000000000000000000000000000000000..2749e740d043ecaf8cca78c4527a8aab51548611
index 0000000000000000000000000000000000000000..a605a56ec780f871362fc9abc9bb315572ef254b
--- /dev/null
+++ b/src/main/java/me/samsuik/sakura/explosion/SakuraExplosion.java
@@ -0,0 +1,383 @@
@@ -0,0 +1,391 @@
+package me.samsuik.sakura.explosion;
+
+import net.minecraft.core.BlockPos;
Expand Down Expand Up @@ -198,6 +198,14 @@ index 0000000000000000000000000000000000000000..2749e740d043ecaf8cca78c4527a8aab
+
+ @Override
+ public void explode() {
+ if (this.radius < 0.1F) {
+ for (int i = 1; i < source.getStacked() && !wasCanceled; ++i) {
+ this.finalizeExplosion(false);
+ }
+
+ return;
+ }
+
+ PrimedTnt origin = (PrimedTnt) source;
+ List<Vec3> positions = new ArrayList<>(origin.getStacked());
+
Expand Down
4 changes: 2 additions & 2 deletions patches/server/0023-isPushedByFluid-API.patch
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ Subject: [PATCH] isPushedByFluid API


diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 97b11192592f67c976dc5567cfeaad55e7780c18..02d4d2599340d22d8d501b2466b12f0f3216451b 100644
index 97b11192592f67c976dc5567cfeaad55e7780c18..9feef1fd078cd0ca59f4cc6a7346d8eaa24a15e1 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -661,6 +661,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
discard();
}
// Sakura end
+ public boolean pushedByFluid; // Sakura
+ public boolean pushedByFluid = true; // Sakura

public boolean isLegacyTrackingEntity = false;

Expand Down
10 changes: 5 additions & 5 deletions patches/server/0040-Configure-cannon-physics-by-version.patch
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ index ae2eede559bd9fe7e500ce180f2ac102a95d3856..7ced5ae768cbea9ee0a7bab2365fbaef
if (xSmaller && z != 0.0) {
z = performAABBCollisionsZ(axisalignedbb, z, aabbs);
diff --git a/src/main/java/me/samsuik/sakura/explosion/SakuraExplosion.java b/src/main/java/me/samsuik/sakura/explosion/SakuraExplosion.java
index 2749e740d043ecaf8cca78c4527a8aab51548611..abcb601f3cfcf6a353d5929c6c4c2f36e89a5106 100644
index a605a56ec780f871362fc9abc9bb315572ef254b..19713d18421f5bdd20fa362b4cc4eeb68289ff23 100644
--- a/src/main/java/me/samsuik/sakura/explosion/SakuraExplosion.java
+++ b/src/main/java/me/samsuik/sakura/explosion/SakuraExplosion.java
@@ -236,10 +236,17 @@ public class SakuraExplosion extends Explosion {
@@ -244,10 +244,17 @@ public class SakuraExplosion extends Explosion {
if (distanceFromBottom > 1.0) continue;

double x = entity.getX() - pos.x;
Expand All @@ -58,7 +58,7 @@ index 2749e740d043ecaf8cca78c4527a8aab51548611..abcb601f3cfcf6a353d5929c6c4c2f36
if (distance == 0.0D) continue;

x /= distance;
@@ -284,10 +291,17 @@ public class SakuraExplosion extends Explosion {
@@ -292,10 +299,17 @@ public class SakuraExplosion extends Explosion {

if (distanceFromBottom <= 1.0) {
double x = entity.getX() - pos.x;
Expand All @@ -78,7 +78,7 @@ index 2749e740d043ecaf8cca78c4527a8aab51548611..abcb601f3cfcf6a353d5929c6c4c2f36
x /= distance;
y /= distance;
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 50259042ebafe520342bdb1a4b7e6b9138b8acbd..adf8be12b754c3d9b16ef4a7c675dd2c05cc6eae 100644
index eab1b1043f27c3f996e820b3b50e2689c84e8822..cd67b7fb3aa460cbfd794c90f1a3e3fb661fe037 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -377,7 +377,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
Expand All @@ -93,7 +93,7 @@ index 50259042ebafe520342bdb1a4b7e6b9138b8acbd..adf8be12b754c3d9b16ef4a7c675dd2c
@@ -662,6 +662,13 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
}
// Sakura end
public boolean pushedByFluid; // Sakura
public boolean pushedByFluid = true; // Sakura
+ // Sakura start - physics version
+ protected me.samsuik.sakura.physics.PhysicsVersion physics = me.samsuik.sakura.physics.PhysicsVersion.LATEST;
+
Expand Down

0 comments on commit 1c4d48c

Please sign in to comment.