diff --git a/build.gradle.kts b/build.gradle.kts index 1c49486c94..ecfc0abe25 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -194,6 +194,7 @@ abstract class RebasePatches : BaseTask() { companion object { val regex = Pattern.compile("Patch failed at ([0-9]{4}) (.*)") + val continuationRegex = Pattern.compile("^\\s{1}.+\$") const val subjectPrefix = "Subject: [PATCH] " } @@ -223,8 +224,19 @@ abstract class RebasePatches : BaseTask() { val failedSubjectFragment = matcher.group(2) val failed = unapplied.single { p -> p.useLines { lines -> - val subjectLine = lines.single { it.startsWith(subjectPrefix) } - .substringAfter(subjectPrefix) + val collect = mutableListOf() + for (line in lines) { + if (line.startsWith(subjectPrefix)) { + collect += line + } else if (collect.size == 1) { + if (continuationRegex.matcher(line).matches()) { + collect += line + } else { + break + } + } + } + val subjectLine = collect.joinToString("").substringAfter(subjectPrefix) subjectLine.startsWith(failedSubjectFragment) } } diff --git a/patches/unapplied/server/Add-configurable-entity-despawn-distances.patch b/patches/server/Add-configurable-entity-despawn-distances.patch similarity index 97% rename from patches/unapplied/server/Add-configurable-entity-despawn-distances.patch rename to patches/server/Add-configurable-entity-despawn-distances.patch index e9bd8df5e8..3fee0c272b 100644 --- a/patches/unapplied/server/Add-configurable-entity-despawn-distances.patch +++ b/patches/server/Add-configurable-entity-despawn-distances.patch @@ -8,7 +8,7 @@ diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/n index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/entity/Mob.java +++ b/src/main/java/net/minecraft/world/entity/Mob.java -@@ -0,0 +0,0 @@ public abstract class Mob extends LivingEntity implements Targeting { +@@ -0,0 +0,0 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Targeti if (entityhuman != null) { double d0 = entityhuman.distanceToSqr((Entity) this); diff --git a/patches/unapplied/server/Allow-for-toggling-of-spawn-chunks.patch b/patches/server/Allow-for-toggling-of-spawn-chunks.patch similarity index 100% rename from patches/unapplied/server/Allow-for-toggling-of-spawn-chunks.patch rename to patches/server/Allow-for-toggling-of-spawn-chunks.patch diff --git a/patches/unapplied/server/Drop-falling-block-and-tnt-entities-at-the-specified.patch b/patches/server/Drop-falling-block-and-tnt-entities-at-the-specified.patch similarity index 93% rename from patches/unapplied/server/Drop-falling-block-and-tnt-entities-at-the-specified.patch rename to patches/server/Drop-falling-block-and-tnt-entities-at-the-specified.patch index 1e5cc99259..0374b5c0a4 100644 --- a/patches/unapplied/server/Drop-falling-block-and-tnt-entities-at-the-specified.patch +++ b/patches/server/Drop-falling-block-and-tnt-entities-at-the-specified.patch @@ -10,8 +10,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java +++ b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java @@ -0,0 +0,0 @@ public class FallingBlockEntity extends Entity { - } - + ++this.time; + this.applyGravity(); this.move(MoverType.SELF, this.getDeltaMovement()); + // Paper start - Configurable falling blocks height nerf + if (this.level().paperConfig().fixes.fallingBlockHeightNerf.test(v -> this.getY() > v)) { @@ -31,8 +31,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java +++ b/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java @@ -0,0 +0,0 @@ public class PrimedTnt extends Entity implements TraceableEntity { - } - + if (this.level().spigotConfig.maxTntTicksPerTick > 0 && ++this.level().spigotConfig.currentPrimedTnt > this.level().spigotConfig.maxTntTicksPerTick) { return; } // Spigot + this.applyGravity(); this.move(MoverType.SELF, this.getDeltaMovement()); + // Paper start - Configurable TNT height nerf + if (this.level().paperConfig().fixes.tntEntityHeightNerf.test(v -> this.getY() > v)) {