Skip to content
This repository has been archived by the owner on Apr 21, 2023. It is now read-only.

Commit

Permalink
Merge branch 'ver/1.19.2' of https://github.com/PrismarineTeam/Prisma…
Browse files Browse the repository at this point in the history
…rine into dev/rewrite-chunk-system
  • Loading branch information
AlphaKR93 committed Sep 3, 2022
2 parents ab63c97 + 9b35b38 commit f5c9689
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 13 deletions.
2 changes: 1 addition & 1 deletion patches/api/0001-Pufferfish-API-Changes.patch
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: AlphaKR93 <alphakr93@outlook.com>
Date: Fri, 2 Sep 2022 03:57:36 +0000
Date: Fri, 2 Sep 2022 18:48:27 +0000
Subject: [PATCH] Pufferfish API Changes

Original by Kevin Raneri <kevin.raneri@gmail.com>
Expand Down
2 changes: 1 addition & 1 deletion patches/api/0002-Purpur-API-Changes.patch
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: AlphaKR93 <alphakr93@outlook.com>
Date: Fri, 2 Sep 2022 03:59:49 +0000
Date: Fri, 2 Sep 2022 18:50:16 +0000
Subject: [PATCH] Purpur API Changes

Original by PurpurMC Team
Expand Down
2 changes: 1 addition & 1 deletion patches/server/0001-Pufferfish-Server-Changes.patch
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: AlphaKR93 <alphakr93@outlook.com>
Date: Fri, 2 Sep 2022 03:57:36 +0000
Date: Fri, 2 Sep 2022 18:48:27 +0000
Subject: [PATCH] Pufferfish Server Changes

Original by Kevin Raneri <kevin.raneri@gmail.com>
Expand Down
35 changes: 29 additions & 6 deletions patches/server/0004-Purpur-Server-Changes.patch
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: AlphaKR93 <alphakr93@outlook.com>
Date: Fri, 2 Sep 2022 03:59:49 +0000
Date: Fri, 2 Sep 2022 18:50:16 +0000
Subject: [PATCH] Purpur Server Changes

Original by PurpurMC Team
Expand Down Expand Up @@ -3817,7 +3817,7 @@ index d9933cf321f24390e25a68a2d5a532ea1043d0b7..57521ebccc29bca13ea4f763feca32c7

public abstract class Entity implements Nameable, EntityAccess, CommandSource {
-
+ protected static javax.script.ScriptEngine scriptEngine = new javax.script.ScriptEngineManager().getEngineByName("rhino"); // Purpur
+ public static javax.script.ScriptEngine scriptEngine = new javax.script.ScriptEngineManager().getEngineByName("rhino"); // Purpur
// CraftBukkit start
private static final int CURRENT_LEVEL = 2;
public boolean preserveMotion = true; // Paper - keep initial motion on first setPositionRotation
Expand Down Expand Up @@ -10628,7 +10628,7 @@ index 16a55f94bda9f959548772c8916b4dc3eb045d47..aa1c929d948cea8f6212330f922eb5f1

@Override
diff --git a/src/main/java/net/minecraft/world/entity/monster/AbstractSkeleton.java b/src/main/java/net/minecraft/world/entity/monster/AbstractSkeleton.java
index b8abee145fc92faddef98da913eca7715b6bfc03..e542407894f58fb8c0339a7a6d2e7b2cb5891eb4 100644
index b8abee145fc92faddef98da913eca7715b6bfc03..0cfe5cb3ce0ac8554bbdb68c6658369306ce634c 100644
--- a/src/main/java/net/minecraft/world/entity/monster/AbstractSkeleton.java
+++ b/src/main/java/net/minecraft/world/entity/monster/AbstractSkeleton.java
@@ -65,16 +65,19 @@ public abstract class AbstractSkeleton extends Monster implements RangedAttackMo
Expand Down Expand Up @@ -10710,6 +10710,15 @@ index b8abee145fc92faddef98da913eca7715b6bfc03..e542407894f58fb8c0339a7a6d2e7b2c
}
}

@@ -202,7 +179,7 @@ public abstract class AbstractSkeleton extends Monster implements RangedAttackMo
double d2 = target.getZ() - this.getZ();
double d3 = Math.sqrt(d0 * d0 + d2 * d2);

- entityarrow.shoot(d0, d1 + d3 * 0.20000000298023224D, d2, 1.6F, (float) (14 - this.level.getDifficulty().getId() * 4));
+ entityarrow.shoot(d0, d1 + d3 * 0.20000000298023224D, d2, 1.6F, this.level.purpurConfig.skeletonBowAccuracyMap.getOrDefault(this.level.getDifficulty().getId(), (float) (14 - this.level.getDifficulty().getId() * 4))); // Purpur
// CraftBukkit start
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()) {
@@ -233,7 +210,7 @@ public abstract class AbstractSkeleton extends Monster implements RangedAttackMo
this.reassessWeaponGoal();
// Paper start
Expand Down Expand Up @@ -21179,16 +21188,17 @@ index 0000000000000000000000000000000000000000..d44b8ce90db7c6c27f71aa841d6fb64b
+}
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
new file mode 100644
index 0000000000000000000000000000000000000000..45eebbc1993b53b4d01317c6089b619f026d53ed
index 0000000000000000000000000000000000000000..3cf1451569128640fe5d6d9fc0fdc550de75c091
--- /dev/null
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
@@ -0,0 +1,3148 @@
@@ -0,0 +1,3162 @@
+package org.purpurmc.purpur;
+
+import gg.pufferfish.pufferfish.PufferfishConfig;
+import net.minecraft.core.Registry;
+import net.minecraft.resources.ResourceLocation;
+import net.minecraft.util.Mth;
+import net.minecraft.world.entity.Entity;
+import net.minecraft.world.entity.EntityType;
+import net.minecraft.world.item.DyeColor;
+import net.minecraft.world.item.Item;
Expand All @@ -21205,7 +21215,6 @@ index 0000000000000000000000000000000000000000..45eebbc1993b53b4d01317c6089b619f
+import org.bukkit.ChatColor;
+import org.bukkit.World;
+import org.bukkit.configuration.ConfigurationSection;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
Expand Down Expand Up @@ -23612,6 +23621,8 @@ index 0000000000000000000000000000000000000000..45eebbc1993b53b4d01317c6089b619f
+ public boolean skeletonAlwaysDropExp = false;
+ public double skeletonHeadVisibilityPercent = 0.5D;
+ public int skeletonFeedWitherRoses = 0;
+ public String skeletonBowAccuracy = "14 - difficulty * 4";
+ public Map<Integer, Float> skeletonBowAccuracyMap = new HashMap<>();
+ private void skeletonSettings() {
+ skeletonRidable = getBoolean("mobs.skeleton.ridable", skeletonRidable);
+ skeletonRidableInWater = getBoolean("mobs.skeleton.ridable-in-water", skeletonRidableInWater);
Expand All @@ -23626,6 +23637,18 @@ index 0000000000000000000000000000000000000000..45eebbc1993b53b4d01317c6089b619f
+ skeletonAlwaysDropExp = getBoolean("mobs.skeleton.always-drop-exp", skeletonAlwaysDropExp);
+ skeletonHeadVisibilityPercent = getDouble("mobs.skeleton.head-visibility-percent", skeletonHeadVisibilityPercent);
+ skeletonFeedWitherRoses = getInt("mobs.skeleton.feed-wither-roses", skeletonFeedWitherRoses);
+ skeletonBowAccuracy = getString("mobs.skeleton.bow-accuracy", skeletonBowAccuracy);
+ for (int i = 1; i < 4; i++) {
+ float divergence;
+ try {
+ Entity.scriptEngine.eval("difficulty = " + i);
+ divergence = ((Double)Entity.scriptEngine.eval(skeletonBowAccuracy)).floatValue();
+ } catch (Exception e) {
+ e.printStackTrace();
+ continue;
+ }
+ skeletonBowAccuracyMap.put(i, divergence);
+ }
+ }
+
+ public boolean skeletonHorseRidableInWater = true;
Expand Down
6 changes: 3 additions & 3 deletions patches/server/0005-Fix-Purpur-patches.patch
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ index 5dab2eea9e9c50e41c7971daefc3bbe819583207..7d310183e7715aac4f442948ef210b47

@Override
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
index 45eebbc1993b53b4d01317c6089b619f026d53ed..2d6f30f668ad4cbfc8d8066c2a82d50645f4f361 100644
index 3cf1451569128640fe5d6d9fc0fdc550de75c091..ec27ed30b36542198b7bd8473c88bfd79426248f 100644
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
@@ -1073,10 +1073,12 @@ public class PurpurWorldConfig {
Expand Down Expand Up @@ -217,7 +217,7 @@ index 45eebbc1993b53b4d01317c6089b619f026d53ed..2d6f30f668ad4cbfc8d8066c2a82d506
}

public boolean ghastRidable = false;
@@ -2627,10 +2631,12 @@ public class PurpurWorldConfig {
@@ -2641,10 +2645,12 @@ public class PurpurWorldConfig {
public boolean tadpoleRidable = false;
public boolean tadpoleRidableInWater = false;
public boolean tadpoleControllable = true;
Expand All @@ -230,7 +230,7 @@ index 45eebbc1993b53b4d01317c6089b619f026d53ed..2d6f30f668ad4cbfc8d8066c2a82d506
}

public boolean traderLlamaRidable = false;
@@ -2841,10 +2847,12 @@ public class PurpurWorldConfig {
@@ -2855,10 +2861,12 @@ public class PurpurWorldConfig {
public boolean wardenRidable = false;
public boolean wardenRidableInWater = false;
public boolean wardenControllable = true;
Expand Down
2 changes: 1 addition & 1 deletion upstream-data
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
purpur = ff8e329e9dc69bc397dfccc7ea3bd70b520174bc
purpur = dca1dec832262574c133ac1db4e4b97a735c2020
pufferfish = 3888607ea6f8424c4a8e393d93cd21932e4500ea

0 comments on commit f5c9689

Please sign in to comment.