Skip to content

Commit

Permalink
Add config option for rewritten block collisions
Browse files Browse the repository at this point in the history
  • Loading branch information
Samsuik committed Jun 9, 2024
1 parent 457d46e commit f32f705
Show file tree
Hide file tree
Showing 30 changed files with 123 additions and 117 deletions.
26 changes: 16 additions & 10 deletions patches/server/0063-Rewrite-and-Optimise-Block-Collisions.patch
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
From 825e5830ed1deae7609afa687322c4be18b054b2 Mon Sep 17 00:00:00 2001
From 6c73bfce363fd21231c5db80f93cbfbab3080852 Mon Sep 17 00:00:00 2001
From: Samsuik <[email protected]>
Date: Sat, 17 Jun 2023 15:47:14 +0100
Subject: [PATCH] Rewrite and Optimise Block Collisions


diff --git a/src/main/java/me/samsuik/blossom/configuration/BlossomConfig.java b/src/main/java/me/samsuik/blossom/configuration/BlossomConfig.java
index ab9adf86f..872867ee4 100644
index ab9adf86f..802cc1bfa 100644
--- a/src/main/java/me/samsuik/blossom/configuration/BlossomConfig.java
+++ b/src/main/java/me/samsuik/blossom/configuration/BlossomConfig.java
@@ -357,4 +357,9 @@ public class BlossomConfig {
@@ -357,4 +357,11 @@ public class BlossomConfig {
activationRangeDelay = Math.max(getInt("mobs.activation-range-delay", 0) + 1, 1);
}

+ public static boolean extendedCollisionSearch;
+ private static void ExtendedCollisionSearch() {
+ public static boolean useFastBlockCollisions;
+ private static void RewriteBlockCollisions() {
+ extendedCollisionSearch = getBoolean("tnt.extended-collision-search", false);
+ useFastBlockCollisions = getBoolean("tnt.use-fast-block-collisions", true);
+ }
+
}
Expand Down Expand Up @@ -924,34 +926,38 @@ index 2f7ccceef..0baab1f19 100644

if (this.S > 0.0F && flag1 && (d6 != d0 || d8 != d2)) {
diff --git a/src/main/java/net/minecraft/server/EntityFallingBlock.java b/src/main/java/net/minecraft/server/EntityFallingBlock.java
index f0e3a96e3..0adb22084 100644
index f0e3a96e3..d5e7555b7 100644
--- a/src/main/java/net/minecraft/server/EntityFallingBlock.java
+++ b/src/main/java/net/minecraft/server/EntityFallingBlock.java
@@ -84,6 +84,12 @@ public class EntityFallingBlock extends Entity {
@@ -84,6 +84,14 @@ public class EntityFallingBlock extends Entity {
}
}
// Blossom end
+ // Blossom start
+ @Override
+ public void move(double d0, double d1, double d2) {
+ super.move_cannon(d0, d1, d2);
+ if (me.samsuik.blossom.configuration.BlossomConfig.useFastBlockCollisions) {
+ super.move_cannon(d0, d1, d2);
+ }
+ }
+ // Blossom end

public void t_() {
Block block = this.block.getBlock();
diff --git a/src/main/java/net/minecraft/server/EntityTNTPrimed.java b/src/main/java/net/minecraft/server/EntityTNTPrimed.java
index 0e1319f47..e9d30e37e 100644
index 0e1319f47..be9bbbe3c 100644
--- a/src/main/java/net/minecraft/server/EntityTNTPrimed.java
+++ b/src/main/java/net/minecraft/server/EntityTNTPrimed.java
@@ -100,6 +100,12 @@ public class EntityTNTPrimed extends Entity {
@@ -100,6 +100,14 @@ public class EntityTNTPrimed extends Entity {
}
*/
// Blossom end
+ // Blossom start
+ @Override
+ public void move(double d0, double d1, double d2) {
+ super.move_cannon(d0, d1, d2);
+ if (me.samsuik.blossom.configuration.BlossomConfig.useFastBlockCollisions) {
+ super.move_cannon(d0, d1, d2);
+ }
+ }
+ // Blossom end

Expand Down
20 changes: 10 additions & 10 deletions patches/server/0065-Defence-Patches.patch
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
From 918f7dcd2a83f557c2d8387c2010d137b9e8c337 Mon Sep 17 00:00:00 2001
From 82df20eeb706da4e4e1805533a3dccc565ca5eb0 Mon Sep 17 00:00:00 2001
From: Samsuik <[email protected]>
Date: Mon, 19 Jun 2023 18:57:22 +0100
Subject: [PATCH] Defence Patches


diff --git a/src/main/java/me/samsuik/blossom/configuration/BlossomConfig.java b/src/main/java/me/samsuik/blossom/configuration/BlossomConfig.java
index 872867ee4..ad476841c 100644
index 802cc1bfa..fa29797bc 100644
--- a/src/main/java/me/samsuik/blossom/configuration/BlossomConfig.java
+++ b/src/main/java/me/samsuik/blossom/configuration/BlossomConfig.java
@@ -362,4 +362,17 @@ public class BlossomConfig {
extendedCollisionSearch = getBoolean("tnt.extended-collision-search", false);
@@ -364,4 +364,17 @@ public class BlossomConfig {
useFastBlockCollisions = getBoolean("tnt.use-fast-block-collisions", true);
}

+ public static boolean fixSlimeBlockDefence;
Expand Down Expand Up @@ -40,7 +40,7 @@ index 331bafa03..9b418ac91 100644
}

diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
index 83e8eb1fa..5b2a31d4d 100644
index 0baab1f19..55556b235 100644
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
@@ -676,7 +676,7 @@ public abstract class Entity implements ICommandListener {
Expand All @@ -53,11 +53,11 @@ index 83e8eb1fa..5b2a31d4d 100644
moveX *= 0.25D;
moveY *= 0.05000000074505806D;
diff --git a/src/main/java/net/minecraft/server/EntityFallingBlock.java b/src/main/java/net/minecraft/server/EntityFallingBlock.java
index 0adb22084..39bb76091 100644
index d5e7555b7..4c2258bb7 100644
--- a/src/main/java/net/minecraft/server/EntityFallingBlock.java
+++ b/src/main/java/net/minecraft/server/EntityFallingBlock.java
@@ -90,6 +90,21 @@ public class EntityFallingBlock extends Entity {
super.move_cannon(d0, d1, d2);
@@ -92,6 +92,21 @@ public class EntityFallingBlock extends Entity {
}
}
// Blossom end
+ // Blossom start
Expand All @@ -78,7 +78,7 @@ index 0adb22084..39bb76091 100644

public void t_() {
Block block = this.block.getBlock();
@@ -102,6 +117,12 @@ public class EntityFallingBlock extends Entity {
@@ -104,6 +119,12 @@ public class EntityFallingBlock extends Entity {
this.lastZ = this.locZ;
BlockPosition blockposition;

Expand All @@ -91,7 +91,7 @@ index 0adb22084..39bb76091 100644
if (this.ticksLived++ == 0) {
blockposition = new BlockPosition(this);
if (this.world.getType(blockposition).getBlock() == block && !CraftEventFactory.callEntityChangeBlockEvent(this, blockposition.getX(), blockposition.getY(), blockposition.getZ(), Blocks.AIR, 0).isCancelled()) {
@@ -144,7 +165,7 @@ public class EntityFallingBlock extends Entity {
@@ -146,7 +167,7 @@ public class EntityFallingBlock extends Entity {
if (this.world.getType(blockposition).getBlock() != Blocks.PISTON_EXTENSION) {
this.die();
if (!this.e) {
Expand Down
6 changes: 3 additions & 3 deletions patches/server/0066-Allow-Disabling-Light-Updates.patch
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
From 2631a472bc63cadb207f22f7e8dad00f1a12b416 Mon Sep 17 00:00:00 2001
From fa40dfa22e0992c09493672e2510fada841ec317 Mon Sep 17 00:00:00 2001
From: Samsuik <[email protected]>
Date: Mon, 19 Jun 2023 19:04:35 +0100
Subject: [PATCH] Allow Disabling Light Updates


diff --git a/src/main/java/me/samsuik/blossom/configuration/BlossomConfig.java b/src/main/java/me/samsuik/blossom/configuration/BlossomConfig.java
index ad476841c..cedc33260 100644
index fa29797bc..2739a57e1 100644
--- a/src/main/java/me/samsuik/blossom/configuration/BlossomConfig.java
+++ b/src/main/java/me/samsuik/blossom/configuration/BlossomConfig.java
@@ -375,4 +375,11 @@ public class BlossomConfig {
@@ -377,4 +377,11 @@ public class BlossomConfig {
leftShootingThreshold = getDouble("tnt.left-shooting-threshold", 80.0);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
From dd93e20fea05e796f4680e678b388adb6557a5d8 Mon Sep 17 00:00:00 2001
From e2f126f5a1145a4c28c2fc11a2a4af8cb90a68ff Mon Sep 17 00:00:00 2001
From: Samsuik <[email protected]>
Date: Wed, 21 Jun 2023 15:46:57 +0100
Subject: [PATCH] Move EntityFallingBlock blockposition up


diff --git a/src/main/java/net/minecraft/server/EntityFallingBlock.java b/src/main/java/net/minecraft/server/EntityFallingBlock.java
index 6cd75692f..051e34b7b 100644
index 4c2258bb7..dca1cf232 100644
--- a/src/main/java/net/minecraft/server/EntityFallingBlock.java
+++ b/src/main/java/net/minecraft/server/EntityFallingBlock.java
@@ -157,8 +157,8 @@ public class EntityFallingBlock extends Entity {
@@ -159,8 +159,8 @@ public class EntityFallingBlock extends Entity {
this.motY *= 0.9800000190734863D;
this.motZ *= 0.9800000190734863D;
if (!this.world.isClientSide) {
Expand All @@ -18,7 +18,7 @@ index 6cd75692f..051e34b7b 100644
this.motX *= 0.699999988079071D;
this.motZ *= 0.699999988079071D;
this.motY *= -0.5D;
@@ -204,7 +204,7 @@ public class EntityFallingBlock extends Entity {
@@ -206,7 +206,7 @@ public class EntityFallingBlock extends Entity {
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions patches/server/0075-Simplify-farmland-moisture.patch
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
From bb700ebcd2631b63517944a0e63c75cf8c341508 Mon Sep 17 00:00:00 2001
From 13fcdffa29a1a763e544d05f4e106ebb65aa7383 Mon Sep 17 00:00:00 2001
From: Samsuik <[email protected]>
Date: Thu, 29 Jun 2023 01:03:40 +0100
Subject: [PATCH] Simplify farmland moisture


diff --git a/src/main/java/me/samsuik/blossom/configuration/BlossomConfig.java b/src/main/java/me/samsuik/blossom/configuration/BlossomConfig.java
index cedc33260..e4912b41c 100644
index 2739a57e1..343d94c58 100644
--- a/src/main/java/me/samsuik/blossom/configuration/BlossomConfig.java
+++ b/src/main/java/me/samsuik/blossom/configuration/BlossomConfig.java
@@ -382,4 +382,11 @@ public class BlossomConfig {
@@ -384,4 +384,11 @@ public class BlossomConfig {
ignoreNonPlayerLight = getBoolean("player.ignore-non-player-light-updates", false);
}

Expand Down
8 changes: 4 additions & 4 deletions patches/server/0076-AntiXray-Replacement-DuskBerry.patch
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From b55c072cc22a2b475c302e3117a3a0cbc0fb6dbc Mon Sep 17 00:00:00 2001
From 5ec628435fabd1cee76f95ee26504e514528041d Mon Sep 17 00:00:00 2001
From: Samsuik <[email protected]>
Date: Fri, 30 Jun 2023 15:13:08 +0100
Subject: [PATCH] AntiXray Replacement: DuskBerry
Expand Down Expand Up @@ -339,10 +339,10 @@ index 60dc31dd7..c77a46cf1 100644
}
}
diff --git a/src/main/java/net/minecraft/server/EntityFallingBlock.java b/src/main/java/net/minecraft/server/EntityFallingBlock.java
index 051e34b7b..fd5b71bef 100644
index dca1cf232..359a00e60 100644
--- a/src/main/java/net/minecraft/server/EntityFallingBlock.java
+++ b/src/main/java/net/minecraft/server/EntityFallingBlock.java
@@ -127,7 +127,7 @@ public class EntityFallingBlock extends Entity {
@@ -129,7 +129,7 @@ public class EntityFallingBlock extends Entity {
blockposition = new BlockPosition(this);
if (this.world.getType(blockposition).getBlock() == block && !CraftEventFactory.callEntityChangeBlockEvent(this, blockposition.getX(), blockposition.getY(), blockposition.getZ(), Blocks.AIR, 0).isCancelled()) {
this.world.setAir(blockposition);
Expand All @@ -351,7 +351,7 @@ index 051e34b7b..fd5b71bef 100644
} else if (!this.world.isClientSide) {
this.die();
return;
@@ -170,7 +170,7 @@ public class EntityFallingBlock extends Entity {
@@ -172,7 +172,7 @@ public class EntityFallingBlock extends Entity {
return;
}
this.world.setTypeAndData(blockposition, this.block, 3);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
From d2690651d950c94661683988894702b1b85d8a76 Mon Sep 17 00:00:00 2001
From 22f7898453387c2690aa8ff7ca12f7f150dc972d Mon Sep 17 00:00:00 2001
From: Samsuik <[email protected]>
Date: Sat, 1 Jul 2023 22:55:49 +0100
Subject: [PATCH] Fix wrong comparison operator used in entity height nerf


diff --git a/src/main/java/net/minecraft/server/EntityFallingBlock.java b/src/main/java/net/minecraft/server/EntityFallingBlock.java
index fd5b71bef..c09c71d68 100644
index 359a00e60..63e50ed4d 100644
--- a/src/main/java/net/minecraft/server/EntityFallingBlock.java
+++ b/src/main/java/net/minecraft/server/EntityFallingBlock.java
@@ -144,7 +144,7 @@ public class EntityFallingBlock extends Entity {
@@ -146,7 +146,7 @@ public class EntityFallingBlock extends Entity {
// PaperSpigot end

// PaperSpigot start - Drop falling blocks above the specified height
Expand All @@ -18,10 +18,10 @@ index fd5b71bef..c09c71d68 100644
this.a(new ItemStack(block, 1, block.getDropData(this.block)), 0.0F);
}
diff --git a/src/main/java/net/minecraft/server/EntityTNTPrimed.java b/src/main/java/net/minecraft/server/EntityTNTPrimed.java
index e9d30e37e..8620b4872 100644
index be9bbbe3c..55ee4cfca 100644
--- a/src/main/java/net/minecraft/server/EntityTNTPrimed.java
+++ b/src/main/java/net/minecraft/server/EntityTNTPrimed.java
@@ -116,7 +116,7 @@ public class EntityTNTPrimed extends Entity {
@@ -118,7 +118,7 @@ public class EntityTNTPrimed extends Entity {
this.move(this.motX, this.motY, this.motZ);

// PaperSpigot start - Drop TNT entities above the specified height
Expand Down
18 changes: 9 additions & 9 deletions patches/server/0081-Cache-Sand-Layer-Movement.patch
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
From e3da8706c18bbd0446000cc51a85e8c091262f88 Mon Sep 17 00:00:00 2001
From 11030797b7d2cd8a6f2646bfdf62e1c190e8d3a5 Mon Sep 17 00:00:00 2001
From: Samsuik <[email protected]>
Date: Tue, 4 Jul 2023 00:40:02 +0100
Subject: [PATCH] Cache Sand Layer Movement


diff --git a/src/main/java/me/samsuik/blossom/configuration/BlossomConfig.java b/src/main/java/me/samsuik/blossom/configuration/BlossomConfig.java
index e4912b41c..a3b6cfef4 100644
index 343d94c58..bebf86cc9 100644
--- a/src/main/java/me/samsuik/blossom/configuration/BlossomConfig.java
+++ b/src/main/java/me/samsuik/blossom/configuration/BlossomConfig.java
@@ -389,4 +389,9 @@ public class BlossomConfig {
@@ -391,4 +391,9 @@ public class BlossomConfig {
farmlandOnlyCheckWaterWhenUnused = getBoolean("crops.farmland-only-look-for-water-when-unused", false);
}

Expand All @@ -19,7 +19,7 @@ index e4912b41c..a3b6cfef4 100644
+
}
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
index b99db7de2..12899a603 100644
index aee4cec57..6599c0142 100644
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
@@ -68,7 +68,7 @@ public abstract class Entity implements ICommandListener {
Expand Down Expand Up @@ -49,18 +49,18 @@ index b99db7de2..12899a603 100644
return new Vec3D(this.locX, this.locY, this.locZ);
}
diff --git a/src/main/java/net/minecraft/server/EntityFallingBlock.java b/src/main/java/net/minecraft/server/EntityFallingBlock.java
index c09c71d68..7d92fcd34 100644
index 63e50ed4d..b9ce5d0c9 100644
--- a/src/main/java/net/minecraft/server/EntityFallingBlock.java
+++ b/src/main/java/net/minecraft/server/EntityFallingBlock.java
@@ -87,6 +87,7 @@ public class EntityFallingBlock extends Entity {
// Blossom start
@Override
public void move(double d0, double d1, double d2) {
+ if (me.samsuik.blossom.configuration.BlossomConfig.groupedSandMovement && mimic()) return; // Blossom
super.move_cannon(d0, d1, d2);
}
// Blossom end
@@ -105,6 +106,54 @@ public class EntityFallingBlock extends Entity {
if (me.samsuik.blossom.configuration.BlossomConfig.useFastBlockCollisions) {
super.move_cannon(d0, d1, d2);
}
@@ -107,6 +108,54 @@ public class EntityFallingBlock extends Entity {
}
}
// Blossom end
Expand Down
6 changes: 3 additions & 3 deletions patches/server/0083-Projectile-Timeout.patch
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
From aed786f4f4c4be05ee49b02a9961ba8f9a88e4c7 Mon Sep 17 00:00:00 2001
From 89cb08e61803e4b016d97414c667f8dc3cfa52d5 Mon Sep 17 00:00:00 2001
From: Samsuik <[email protected]>
Date: Thu, 6 Jul 2023 23:04:57 +0100
Subject: [PATCH] Projectile Timeout


diff --git a/src/main/java/me/samsuik/blossom/configuration/BlossomConfig.java b/src/main/java/me/samsuik/blossom/configuration/BlossomConfig.java
index a3b6cfef4..8ece602ac 100644
index bebf86cc9..52ab6bb08 100644
--- a/src/main/java/me/samsuik/blossom/configuration/BlossomConfig.java
+++ b/src/main/java/me/samsuik/blossom/configuration/BlossomConfig.java
@@ -394,4 +394,9 @@ public class BlossomConfig {
@@ -396,4 +396,9 @@ public class BlossomConfig {
groupedSandMovement = getBoolean("sand.group-sand-layer-movement", false);
}

Expand Down
6 changes: 3 additions & 3 deletions patches/server/0089-Configure-Durable-Blocks.patch
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
From 765a97aa6f006980d8563aa8304689a753d07d99 Mon Sep 17 00:00:00 2001
From 9bc351adcd89fad819b8fb1f791b3268553f24c5 Mon Sep 17 00:00:00 2001
From: Samsuik <[email protected]>
Date: Sat, 8 Jul 2023 21:49:22 +0100
Subject: [PATCH] Configure Durable Blocks


diff --git a/src/main/java/me/samsuik/blossom/configuration/BlossomConfig.java b/src/main/java/me/samsuik/blossom/configuration/BlossomConfig.java
index 9ef760e5f..62ecbb65d 100644
index b311899a5..200e44895 100644
--- a/src/main/java/me/samsuik/blossom/configuration/BlossomConfig.java
+++ b/src/main/java/me/samsuik/blossom/configuration/BlossomConfig.java
@@ -401,4 +401,9 @@ public class BlossomConfig {
@@ -403,4 +403,9 @@ public class BlossomConfig {
projectileTimeout = getInt("projectiles.time-out", 1200);
}

Expand Down
6 changes: 3 additions & 3 deletions patches/server/0092-Configure-Player-Knockback.patch
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
From 28b9e6feccb5a8e1fe9d22cde929a55a7e7fc1dd Mon Sep 17 00:00:00 2001
From d571039e0fb196b3607a65fb3f81feaef73ca8bf Mon Sep 17 00:00:00 2001
From: Samsuik <[email protected]>
Date: Sun, 9 Jul 2023 23:54:44 +0100
Subject: [PATCH] Configure Player Knockback


diff --git a/src/main/java/me/samsuik/blossom/configuration/BlossomConfig.java b/src/main/java/me/samsuik/blossom/configuration/BlossomConfig.java
index 62ecbb65d..9b39178d9 100644
index 200e44895..578c64a8c 100644
--- a/src/main/java/me/samsuik/blossom/configuration/BlossomConfig.java
+++ b/src/main/java/me/samsuik/blossom/configuration/BlossomConfig.java
@@ -406,4 +406,44 @@ public class BlossomConfig {
@@ -408,4 +408,44 @@ public class BlossomConfig {
requireTNTToBlowUpDurableBlocks = getBoolean("explosions.durability.require-tnt-to-blow-up-durable-blocks", true);
}

Expand Down
8 changes: 4 additions & 4 deletions patches/server/0094-Configure-Armour-Damage-Rate.patch
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
From ffc650224e9d33fcc14def40914c101161c8e865 Mon Sep 17 00:00:00 2001
From 10b95de0e434d429eee6da37b90e59fa779fa410 Mon Sep 17 00:00:00 2001
From: Samsuik <[email protected]>
Date: Mon, 10 Jul 2023 00:40:54 +0100
Subject: [PATCH] Configure Armour Damage Rate


diff --git a/src/main/java/me/samsuik/blossom/configuration/BlossomConfig.java b/src/main/java/me/samsuik/blossom/configuration/BlossomConfig.java
index 9b39178d9..2e83826cc 100644
index 578c64a8c..47dcb9e4a 100644
--- a/src/main/java/me/samsuik/blossom/configuration/BlossomConfig.java
+++ b/src/main/java/me/samsuik/blossom/configuration/BlossomConfig.java
@@ -446,4 +446,13 @@ public class BlossomConfig {
@@ -448,4 +448,13 @@ public class BlossomConfig {
altKBCalculation = getBoolean("player.knockback.alternate-knockback", false);
}

Expand All @@ -23,7 +23,7 @@ index 9b39178d9..2e83826cc 100644
+
}
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
index 45208ce65..1c1439c2c 100644
index 80de90003..518869f4e 100644
--- a/src/main/java/net/minecraft/server/EntityLiving.java
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
@@ -1159,6 +1159,19 @@ public abstract class EntityLiving extends Entity {
Expand Down
Loading

0 comments on commit f32f705

Please sign in to comment.