Update Rhino to 1.7.14 (#1285)

This commit is contained in:
skbeh
2023-03-15 11:53:58 +08:00
committed by GitHub
parent db11753bb6
commit ea72a33dad
2 changed files with 20 additions and 9 deletions

View File

@@ -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;