@@ -18,7 +18,7 @@ index e542407894f58fb8c0339a7a6d2e7b2cb5891eb4..0cfe5cb3ce0ac8554bbdb68c66583693
1818 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
1919 if (event.isCancelled()) {
2020diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
21- index c0efea82bacda565876b8a01ed1f520706a2d127..af323d3136ca5d51ac122d5758251db965281020 100644
21+ index c0efea82bacda565876b8a01ed1f520706a2d127..11609d1c8e1dc80886435571d7c6ee1aa97fb177 100644
2222--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
2323+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
2424@@ -2418,6 +2418,8 @@ public class PurpurWorldConfig {
@@ -30,16 +30,26 @@ index c0efea82bacda565876b8a01ed1f520706a2d127..af323d3136ca5d51ac122d5758251db9
3030 private void skeletonSettings() {
3131 skeletonRidable = getBoolean("mobs.skeleton.ridable", skeletonRidable);
3232 skeletonRidableInWater = getBoolean("mobs.skeleton.ridable-in-water", skeletonRidableInWater);
33- @@ -2432,6 +2434,18 @@ public class PurpurWorldConfig {
33+ @@ -2432,6 +2434,28 @@ public class PurpurWorldConfig {
3434 skeletonAlwaysDropExp = getBoolean("mobs.skeleton.always-drop-exp", skeletonAlwaysDropExp);
3535 skeletonHeadVisibilityPercent = getDouble("mobs.skeleton.head-visibility-percent", skeletonHeadVisibilityPercent);
3636 skeletonFeedWitherRoses = getInt("mobs.skeleton.feed-wither-roses", skeletonFeedWitherRoses);
37+ + final String defaultSkeletonBowAccuracy = skeletonBowAccuracy;
3738+ skeletonBowAccuracy = getString("mobs.skeleton.bow-accuracy", skeletonBowAccuracy);
3839+ for (int i = 1; i < 4; i++) {
39- + float divergence;
40+ + final float divergence;
4041+ try {
4142+ Entity.scriptEngine.eval("difficulty = " + i);
42- + divergence = ((Double)Entity.scriptEngine.eval(skeletonBowAccuracy)).floatValue();
43+ + final Object result = Entity.scriptEngine.eval(skeletonBowAccuracy);
44+ + if (result instanceof Long) {
45+ + divergence = ((Long) result).floatValue();
46+ + } else if (result instanceof Double) {
47+ + divergence = ((Double) result).floatValue();
48+ + } else {
49+ + set("mobs.skeleton.bow-accuracy", defaultSkeletonBowAccuracy);
50+ + skeletonBowAccuracy = defaultSkeletonBowAccuracy;
51+ + divergence = ((Long) Entity.scriptEngine.eval(skeletonBowAccuracy)).floatValue();
52+ + }
4353+ } catch (Exception e) {
4454+ e.printStackTrace();
4555+ continue;
0 commit comments