From 8c8c18bb2156401882b95a4411462907c1287278 Mon Sep 17 00:00:00 2001 From: granny Date: Sun, 12 Mar 2023 13:31:57 -0700 Subject: [PATCH 1/3] Updated Upstream (Paper) Upstream has released updates that appear to apply and compile correctly Paper Changes: PaperMC/Paper@18470db Fix getTargetEntity not targeting creative players (#8960) PaperMC/Paper@155aa36 Properly handle load before plugins in legacy loading (#8962) --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index d7d9fcf22d..cf94e99cd6 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,7 +1,7 @@ group = org.purpurmc.purpur version = 1.19.3-R0.1-SNAPSHOT -paperCommit = 4e994669d3073977cda747d60205d94fbc94f2a7 +paperCommit = 155aa36d89b260ef5841615899299756b5983c0a org.gradle.caching = true org.gradle.parallel = true From db11753bb63a2cd43415bb599d9730f3322cbe34 Mon Sep 17 00:00:00 2001 From: William Blake Galbreath Date: Tue, 14 Mar 2023 15:35:25 -0500 Subject: [PATCH 2/3] Fix NPE when no world given to explosions (#1286) --- .../0308-Config-to-remove-explosion-radius-clamp.patch | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/patches/server/0308-Config-to-remove-explosion-radius-clamp.patch b/patches/server/0308-Config-to-remove-explosion-radius-clamp.patch index 374b180c41..d9e386f6b7 100644 --- a/patches/server/0308-Config-to-remove-explosion-radius-clamp.patch +++ b/patches/server/0308-Config-to-remove-explosion-radius-clamp.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Config to remove explosion radius clamp Co-authored-by: Encode42 diff --git a/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java b/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java -index 1e2304347fc369e5d9fe5d4c3cca8856766f5c1a..84b230d979a91dd776e180e5b828b26bdc98ef12 100644 +index 1e2304347fc369e5d9fe5d4c3cca8856766f5c1a..d5aeaac49fcbc32d5276168d910f9e298ae97fd7 100644 --- a/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java +++ b/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java @@ -98,7 +98,7 @@ public class EnderDragon extends Mob implements Enemy { @@ -22,12 +22,12 @@ index 1e2304347fc369e5d9fe5d4c3cca8856766f5c1a..84b230d979a91dd776e180e5b828b26b public EnderDragon(EntityType entitytypes, Level world) { super(EntityType.ENDER_DRAGON, world); -+ this.explosionSource = new Explosion(this.level, this, null, null, Double.NaN, Double.NaN, Double.NaN, Float.NaN, true, Explosion.BlockInteraction.DESTROY); // Purpur - moved instantiation from field ++ this.explosionSource = new Explosion(world, this, null, null, Double.NaN, Double.NaN, Double.NaN, Float.NaN, true, Explosion.BlockInteraction.DESTROY); // Purpur - moved instantiation from field this.subEntities = new EnderDragonPart[]{this.head, this.neck, this.body, this.tail1, this.tail2, this.tail3, this.wing1, this.wing2}; this.setHealth(this.getMaxHealth()); this.noPhysics = true; diff --git a/src/main/java/net/minecraft/world/level/Explosion.java b/src/main/java/net/minecraft/world/level/Explosion.java -index c0d39afe5b80159ed9aaca4ddd4763d707882f2e..3c9e0cee78deeae6b47a186f1bfc47f3956ec9c7 100644 +index de6050c867ac55dd6f0d8243289296781add7157..f74fad1a124daa888e0a05a8a707c4fd3384a6b9 100644 --- a/src/main/java/net/minecraft/world/level/Explosion.java +++ b/src/main/java/net/minecraft/world/level/Explosion.java @@ -86,7 +86,7 @@ public class Explosion { @@ -35,7 +35,7 @@ index c0d39afe5b80159ed9aaca4ddd4763d707882f2e..3c9e0cee78deeae6b47a186f1bfc47f3 this.level = world; this.source = entity; - this.radius = (float) Math.max(power, 0.0); // CraftBukkit - clamp bad values -+ this.radius = (float) (world.purpurConfig.explosionClampRadius ? Math.max(power, 0.0) : power); // CraftBukkit - clamp bad values // Purpur ++ this.radius = (float) (world == null || world.purpurConfig.explosionClampRadius ? Math.max(power, 0.0) : power); // CraftBukkit - clamp bad values // Purpur this.x = x; this.y = y; this.z = z; @@ -44,7 +44,7 @@ index c0d39afe5b80159ed9aaca4ddd4763d707882f2e..3c9e0cee78deeae6b47a186f1bfc47f3 public void explode() { // CraftBukkit start - if (this.radius < 0.1F) { -+ if (this.level.purpurConfig.explosionClampRadius && this.radius < 0.1F) { // Purpur ++ if ((this.level == null || this.level.purpurConfig.explosionClampRadius) && this.radius < 0.1F) { // Purpur return; } // CraftBukkit end From 3c1aad6c5274db62be8cc9fb9dee570b81b8b479 Mon Sep 17 00:00:00 2001 From: Aviana Cruz Date: Sun, 12 Mar 2023 05:28:45 +0000 Subject: [PATCH 3/3] Update Rhino to 1.7.14 --- patches/server/0003-Rebrand.patch | 11 ++++++----- ...0285-Add-skeleton-bow-accuracy-option.patch | 18 ++++++++++++++---- 2 files changed, 20 insertions(+), 9 deletions(-) diff --git a/patches/server/0003-Rebrand.patch b/patches/server/0003-Rebrand.patch index b68d782f57..246ec37255 100644 --- a/patches/server/0003-Rebrand.patch +++ b/patches/server/0003-Rebrand.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Rebrand diff --git a/build.gradle.kts b/build.gradle.kts -index 8d8c5a8bd2a53ac6d9b36e0330a7be6725aa407c..70d512c0c70d2470eaca295b6e35bb3be2f3f6a3 100644 +index 8d8c5a8bd2a53ac6d9b36e0330a7be6725aa407c..0435c1eb5c1fa6f9180ee8dc36a61afbac0f952e 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -7,9 +7,9 @@ plugins { @@ -20,17 +20,18 @@ index 8d8c5a8bd2a53ac6d9b36e0330a7be6725aa407c..70d512c0c70d2470eaca295b6e35bb3b exclude("io.papermc.paper", "paper-api") } // Pufferfish end -@@ -42,6 +42,9 @@ dependencies { +@@ -42,6 +42,10 @@ dependencies { runtimeOnly("mysql:mysql-connector-java:8.0.29") runtimeOnly("com.lmax:disruptor:3.4.4") // Paper -+ implementation("cat.inspiracio:rhino-js-engine:1.7.7.1") // Purpur ++ implementation("org.mozilla:rhino-runtime:1.7.14") // Purpur ++ implementation("org.mozilla:rhino-engine:1.7.14") // Purpur + implementation("dev.omega24:upnp4j:1.0") // Purpur + runtimeOnly("org.apache.maven:maven-resolver-provider:3.8.5") runtimeOnly("org.apache.maven.resolver:maven-resolver-connector-basic:1.7.3") runtimeOnly("org.apache.maven.resolver:maven-resolver-transport-http:1.7.3") -@@ -81,7 +84,7 @@ tasks.jar { +@@ -81,7 +85,7 @@ tasks.jar { attributes( "Main-Class" to "org.bukkit.craftbukkit.Main", "Implementation-Title" to "CraftBukkit", @@ -39,7 +40,7 @@ index 8d8c5a8bd2a53ac6d9b36e0330a7be6725aa407c..70d512c0c70d2470eaca295b6e35bb3b "Implementation-Vendor" to date, // Paper "Specification-Title" to "Bukkit", "Specification-Version" to project.version, -@@ -153,7 +156,7 @@ fun TaskContainer.registerRunTask( +@@ -153,7 +157,7 @@ fun TaskContainer.registerRunTask( name: String, block: JavaExec.() -> Unit ): TaskProvider = register(name) { diff --git a/patches/server/0285-Add-skeleton-bow-accuracy-option.patch b/patches/server/0285-Add-skeleton-bow-accuracy-option.patch index 064218d3ab..a9af452cc9 100644 --- a/patches/server/0285-Add-skeleton-bow-accuracy-option.patch +++ b/patches/server/0285-Add-skeleton-bow-accuracy-option.patch @@ -18,7 +18,7 @@ index e542407894f58fb8c0339a7a6d2e7b2cb5891eb4..0cfe5cb3ce0ac8554bbdb68c66583693 org.bukkit.event.entity.EntityShootBowEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callEntityShootBowEvent(this, this.getMainHandItem(), entityarrow.getPickupItem(), entityarrow, net.minecraft.world.InteractionHand.MAIN_HAND, 0.8F, true); // Paper if (event.isCancelled()) { diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java -index c0efea82bacda565876b8a01ed1f520706a2d127..af323d3136ca5d51ac122d5758251db965281020 100644 +index c0efea82bacda565876b8a01ed1f520706a2d127..11609d1c8e1dc80886435571d7c6ee1aa97fb177 100644 --- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java +++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java @@ -2418,6 +2418,8 @@ public class PurpurWorldConfig { @@ -30,16 +30,26 @@ index c0efea82bacda565876b8a01ed1f520706a2d127..af323d3136ca5d51ac122d5758251db9 private void skeletonSettings() { skeletonRidable = getBoolean("mobs.skeleton.ridable", skeletonRidable); skeletonRidableInWater = getBoolean("mobs.skeleton.ridable-in-water", skeletonRidableInWater); -@@ -2432,6 +2434,18 @@ public class PurpurWorldConfig { +@@ -2432,6 +2434,28 @@ public class PurpurWorldConfig { skeletonAlwaysDropExp = getBoolean("mobs.skeleton.always-drop-exp", skeletonAlwaysDropExp); skeletonHeadVisibilityPercent = getDouble("mobs.skeleton.head-visibility-percent", skeletonHeadVisibilityPercent); skeletonFeedWitherRoses = getInt("mobs.skeleton.feed-wither-roses", skeletonFeedWitherRoses); ++ final String defaultSkeletonBowAccuracy = skeletonBowAccuracy; + skeletonBowAccuracy = getString("mobs.skeleton.bow-accuracy", skeletonBowAccuracy); + for (int i = 1; i < 4; i++) { -+ float divergence; ++ final float divergence; + try { + Entity.scriptEngine.eval("difficulty = " + i); -+ divergence = ((Double)Entity.scriptEngine.eval(skeletonBowAccuracy)).floatValue(); ++ final Object result = Entity.scriptEngine.eval(skeletonBowAccuracy); ++ if (result instanceof Long) { ++ divergence = ((Long) result).floatValue(); ++ } else if (result instanceof Double) { ++ divergence = ((Double) result).floatValue(); ++ } else { ++ set("mobs.skeleton.bow-accuracy", defaultSkeletonBowAccuracy); ++ skeletonBowAccuracy = defaultSkeletonBowAccuracy; ++ divergence = ((Long) Entity.scriptEngine.eval(skeletonBowAccuracy)).floatValue(); ++ } + } catch (Exception e) { + e.printStackTrace(); + continue;