diff --git a/patches/api/0004-Allow-changing-the-tick-rate-of-mob-s-customServerAi.patch b/patches/api/0004-Allow-changing-the-tick-rate-of-mob-s-customServerAi.patch deleted file mode 100644 index 0a95f29..0000000 --- a/patches/api/0004-Allow-changing-the-tick-rate-of-mob-s-customServerAi.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: MrPowerGamerBR -Date: Sun, 25 Aug 2024 22:28:20 -0300 -Subject: [PATCH] Allow changing the tick rate of mob's "customServerAiStep" - - -diff --git a/src/main/java/org/bukkit/entity/Mob.java b/src/main/java/org/bukkit/entity/Mob.java -index 9a10262a952e330f42187d6e4edab5a225bfba62..bbc8f5970249da0fc677c0374d657a5cc93d2daa 100644 ---- a/src/main/java/org/bukkit/entity/Mob.java -+++ b/src/main/java/org/bukkit/entity/Mob.java -@@ -229,4 +229,20 @@ public interface Mob extends LivingEntity, Lootable, io.papermc.paper.entity.Lea - */ - public int getPossibleExperienceReward(); - // Paper end - mob xp reward API -+ -+ // SparklyPaper - allow changing the tick rate of custom server AI steps -+ /** -+ * Gets the tick rate of this entity's "customServerAiStep" function. -+ * -+ * @return the current tick rate -+ */ -+ int getCustomServerAiStepTickRate(); -+ -+ /** -+ * Sets the tick rate of the entity's "customServerAiStep" function. -+ *

-+ * Decreasing the tick rate may improve performance, but watch out that changing the tick rate may break the mob AI! -+ */ -+ void setCustomServerAiStepTickRate(int newValue); -+ // SparklyPaper end - } diff --git a/patches/api/0005-Parallel-world-ticking.patch b/patches/api/0004-Parallel-world-ticking.patch similarity index 100% rename from patches/api/0005-Parallel-world-ticking.patch rename to patches/api/0004-Parallel-world-ticking.patch diff --git a/patches/api/0006-SPARKLYPOWER-Add-custom-blocks.patch b/patches/api/0005-SPARKLYPOWER-Add-custom-blocks.patch similarity index 100% rename from patches/api/0006-SPARKLYPOWER-Add-custom-blocks.patch rename to patches/api/0005-SPARKLYPOWER-Add-custom-blocks.patch diff --git a/patches/server/0023-Allow-changing-the-tick-rate-of-mob-s-customServerAi.patch b/patches/server/0023-Allow-changing-the-tick-rate-of-mob-s-customServerAi.patch deleted file mode 100644 index 33a0204..0000000 --- a/patches/server/0023-Allow-changing-the-tick-rate-of-mob-s-customServerAi.patch +++ /dev/null @@ -1,49 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: MrPowerGamerBR -Date: Sun, 25 Aug 2024 22:25:56 -0300 -Subject: [PATCH] Allow changing the tick rate of mob's "customServerAiStep" - - -diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java -index f36a814bfd90af6457171512c131601b19905737..c09ee64f3777b42d4bd7b57e844f366db5992b4d 100644 ---- a/src/main/java/net/minecraft/world/entity/Mob.java -+++ b/src/main/java/net/minecraft/world/entity/Mob.java -@@ -147,6 +147,7 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab - private float restrictRadius; - - public boolean aware = true; // CraftBukkit -+ public int customServerAiStepTickRate = 1; // SparklyPaper - allow changing the tick rate of custom server AI steps - - protected Mob(EntityType type, Level world) { - super(type, world); -@@ -950,7 +951,7 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab - this.navigation.tick(); - gameprofilerfiller.pop(); - gameprofilerfiller.push("mob tick"); -- this.customServerAiStep(); -+ if (tickCount % customServerAiStepTickRate == 0) this.customServerAiStep(); // SparklyPaper - allow changing the tick rate of custom server AI steps - gameprofilerfiller.pop(); - gameprofilerfiller.push("controls"); - gameprofilerfiller.push("move"); -diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java -index 5f9f7e325e3e0276f7a475c4a4725cc0e1b54afd..71d60f72d645abe074c0641b027e716ad4a0b698 100644 ---- a/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java -+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java -@@ -192,4 +192,17 @@ public abstract class CraftMob extends CraftLivingEntity implements Mob, io.pape - return io.papermc.paper.entity.PaperLeashable.super.setLeashHolder(holder); - } - // Paper end - Leashable API -+ -+ // SparklyPaper - allow changing the tick rate of server AI steps -+ @Override -+ public int getCustomServerAiStepTickRate() { -+ return this.getHandle().customServerAiStepTickRate; -+ } -+ -+ @Override -+ public void setCustomServerAiStepTickRate(int newValue) { -+ com.google.common.base.Preconditions.checkArgument(newValue > 0, "newValue cannot be less than or equal to zero"); -+ this.getHandle().customServerAiStepTickRate = newValue; -+ } -+ // SparklyPaper end - } diff --git a/patches/server/0024-Parallel-world-ticking.patch b/patches/server/0023-Parallel-world-ticking.patch similarity index 99% rename from patches/server/0024-Parallel-world-ticking.patch rename to patches/server/0023-Parallel-world-ticking.patch index e2a7730..acbe549 100644 --- a/patches/server/0024-Parallel-world-ticking.patch +++ b/patches/server/0023-Parallel-world-ticking.patch @@ -851,7 +851,7 @@ index 0368d6ba9cc9fe557d3c7172a87a7a5b15445e47..d9dd9f7902dae41b05ba604a829fbe81 entityplayer1.connection = entityplayer.connection; diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 490ee48346395fcbaf2eb0151e9248f18974fea6..43413e1ee5b0287da5c9a75b6a4d24807b89a656 100644 +index e0827d8bb3fa17d4f590a5342ff41a514f623e68..3d1558d6f40892a1998dd6ea06f86dfd958b0d03 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -851,7 +851,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess diff --git a/patches/server/0025-SPARKLYPOWER-Add-custom-blocks.patch b/patches/server/0024-SPARKLYPOWER-Add-custom-blocks.patch similarity index 100% rename from patches/server/0025-SPARKLYPOWER-Add-custom-blocks.patch rename to patches/server/0024-SPARKLYPOWER-Add-custom-blocks.patch diff --git a/patches/server/0026-SPARKLYPOWER-Remap-SparklyPower-hacky-legacy-NBT-tag.patch b/patches/server/0025-SPARKLYPOWER-Remap-SparklyPower-hacky-legacy-NBT-tag.patch similarity index 100% rename from patches/server/0026-SPARKLYPOWER-Remap-SparklyPower-hacky-legacy-NBT-tag.patch rename to patches/server/0025-SPARKLYPOWER-Remap-SparklyPower-hacky-legacy-NBT-tag.patch