Add back a patch

This commit is contained in:
Telesphoreo 2023-09-25 19:06:18 -05:00
parent 0e2564c3fa
commit 227341fc66
No known key found for this signature in database
GPG Key ID: 9D1991811E093C02
20 changed files with 16 additions and 25 deletions

4
Jenkinsfile vendored
View File

@ -35,8 +35,8 @@ pipeline {
post {
always {
archiveArtifacts artifacts: 'build/libs/scissors-*.jar', fingerprint: true
// junit 'Scissors-Server/build/test-results/test/*.xml'
// junit 'Scissors-API/build/test-results/test/*.xml'
junit 'Scissors-Server/build/test-results/test/*.xml'
junit 'Scissors-API/build/test-results/test/*.xml'
cleanWs()
}
}

View File

@ -15,4 +15,5 @@
#minecraft net/minecraft/network/chat/ComponentUtils
#minecraft net/minecraft/network/chat/contents/EntityDataSource
minecraft net/minecraft/network/chat/HoverEvent
minecraft net/minecraft/world/level/block/entity/DecoratedPotBlockEntity
minecraft net/minecraft/world/level/block/entity/DecoratedPotBlockEntity
minecraft net/minecraft/advancements/critereon/MinMaxBounds

View File

@ -2,7 +2,7 @@ group=me.totalfreedom.scissors
version=1.20.2-R0.1-SNAPSHOT
mcVersion=1.20.2
paperRef=5cbce366b28af1ace0b61db5afbe7dcebab7a6b0
paperRef=298c47857ba33c6d2e42ece4e85b3ed4143298e8
org.gradle.caching=true
org.gradle.parallel=true

View File

@ -5,7 +5,7 @@ Subject: [PATCH] Build changes
diff --git a/build.gradle.kts b/build.gradle.kts
index f1ade7432ae6fae1bceb90f975448ab43543942f..10ec7e0e6f91ee537834229f419332b1fae19773 100644
index 683159586641dd9aa42ae96fa51602469755723f..1806f60a0529c2d193bd54ea8f59ff2749e821eb 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -13,8 +13,12 @@ configurations.named(log4jPlugins.compileClasspathConfigurationName) {
@ -45,7 +45,7 @@ index f1ade7432ae6fae1bceb90f975448ab43543942f..10ec7e0e6f91ee537834229f419332b1
"Implementation-Vendor" to date, // Paper
"Specification-Title" to "Bukkit",
"Specification-Version" to project.version,
@@ -149,7 +161,7 @@ fun TaskContainer.registerRunTask(
@@ -156,7 +168,7 @@ fun TaskContainer.registerRunTask(
name: String,
block: JavaExec.() -> Unit
): TaskProvider<JavaExec> = register<JavaExec>(name) {

View File

@ -1,11 +1,11 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Luna <lunahatesgogle@gmail.com>
Date: Sun, 2 Apr 2023 16:29:51 -0300
From: Telesphoreo <me@telesphoreo.me>
Date: Mon, 25 Sep 2023 18:58:34 -0500
Subject: [PATCH] Patch large selector distance crash
diff --git a/src/main/java/net/minecraft/advancements/critereon/MinMaxBounds.java b/src/main/java/net/minecraft/advancements/critereon/MinMaxBounds.java
index 8897496323378080135127f53db004d576476c21..109fbcddd1814013692b1200d37fea09d069cfd5 100644
index 8897496323378080135127f53db004d576476c21..a4de9cfcbe7d7d6b05feb3a6be683437e9b00c2b 100644
--- a/src/main/java/net/minecraft/advancements/critereon/MinMaxBounds.java
+++ b/src/main/java/net/minecraft/advancements/critereon/MinMaxBounds.java
@@ -131,7 +131,7 @@ public interface MinMaxBounds<T extends Number> {
@ -13,21 +13,12 @@ index 8897496323378080135127f53db004d576476c21..109fbcddd1814013692b1200d37fea09
public static final Codec<MinMaxBounds.Doubles> CODEC = MinMaxBounds.createCodec(Codec.DOUBLE, MinMaxBounds.Doubles::new);
- private Doubles(Optional<Double> optional, Optional<Double> optional2) {
+ public Doubles(Optional<Double> optional, Optional<Double> optional2) {
+ public Doubles(Optional<Double> optional, Optional<Double> optional2) { // Scissors - private -> public
this(optional, optional2, squareOpt(optional), squareOpt(optional2));
}
@@ -143,7 +143,7 @@ public interface MinMaxBounds<T extends Number> {
}
}
- private static Optional<Double> squareOpt(Optional<Double> optional) {
+ public static Optional<Double> squareOpt(Optional<Double> optional) {
return optional.map((double_) -> {
return double_ * double_;
});
diff --git a/src/main/java/net/minecraft/commands/arguments/selector/EntitySelector.java b/src/main/java/net/minecraft/commands/arguments/selector/EntitySelector.java
index 73c15a0c56a103ba4e62f0a51af8d42566b07245..ef54de7a77cda9793c723ce58403fb1a610a7956 100644
index 73c15a0c56a103ba4e62f0a51af8d42566b07245..0ea61a4c58bd6d126aff9872ba9c4dc27fb7c099 100644
--- a/src/main/java/net/minecraft/commands/arguments/selector/EntitySelector.java
+++ b/src/main/java/net/minecraft/commands/arguments/selector/EntitySelector.java
@@ -5,11 +5,13 @@ import com.mojang.brigadier.exceptions.CommandSyntaxException;
@ -40,20 +31,19 @@ index 73c15a0c56a103ba4e62f0a51af8d42566b07245..ef54de7a77cda9793c723ce58403fb1a
import java.util.function.Function;
import java.util.function.Predicate;
import javax.annotation.Nullable;
+import me.totalfreedom.scissors.MathUtility; // Scissors
+import me.totalfreedom.scissors.MathUtility;
import net.minecraft.advancements.critereon.MinMaxBounds;
import net.minecraft.commands.CommandSourceStack;
import net.minecraft.commands.arguments.EntityArgument;
@@ -60,9 +62,27 @@ public class EntitySelector {
@@ -60,9 +62,26 @@ public class EntitySelector {
this.includesEntities = includesNonPlayers;
this.worldLimited = localWorldOnly;
this.predicate = basePredicate;
- this.range = distance;
+
+ // Scissors start - Patch large selector distance crash
+ this.range = new MinMaxBounds.Doubles(
+ distance.min().isPresent() ? Optional.of(Math.min(distance.min().get(), 1024)) : null,
+ distance.max().isPresent() ? Optional.of(Math.min(distance.max().get(), 1024)) : null
+ Optional.of(distance.min().get() != null ? Math.min(distance.min().get(), 1024) : null),
+ Optional.of(distance.max().get() != null ? Math.min(distance.max().get(), 1024) : null)
+ );
this.position = positionOffset;
- this.aabb = box;