Skip to content
Permalink
Browse files

Add a special arrow launch speed config option

  • Loading branch information...
mcmonkey4eva committed Jul 13, 2016
1 parent 2a2be0f commit b0a034240c874116d94f3845cf1392060f2973ef
Showing with 6 additions and 3 deletions.
  1. +4 −3 src/main/java/org/mcmonkey/sentinel/SentinelTrait.java
  2. +2 −0 src/main/resources/config.yml
@@ -362,9 +362,10 @@ public void swingWeapon() {
public HashMap.SimpleEntry<Location, Vector> getLaunchDetail(Location target, Vector lead) {
double speeda;
npc.faceLocation(target);
double angt = -1;
double angt = Double.POSITIVE_INFINITY;
Location start = getLivingEntity().getEyeLocation().clone().add(getLivingEntity().getEyeLocation().getDirection());
for (speeda = 20; speeda <= 45; speeda += 5) {
double sbase = SentinelPlugin.instance.getConfig().getDouble("random.shoot speed minimum", 20);
for (speeda = sbase; speeda <= sbase + 15; speeda += 5) {
angt = SentinelUtilities.getArrowAngle(start, target, speeda, 20);
if (!Double.isInfinite(angt)) {
break;
@@ -380,7 +381,7 @@ public void swingWeapon() {
if (deltaXZ == 0) {
deltaXZ = 0.1;
}
for (speeda = 20; speeda < 45; speeda += 5) {
for (speeda = sbase; speeda <= sbase + 15; speeda += 5) {
angt = SentinelUtilities.getArrowAngle(start, to, speeda, 20);
if (!Double.isInfinite(angt)) {
break;
@@ -42,6 +42,8 @@ random:
workaround drops: false
# Whether to permit death messages to show for Sentinel NPC deaths.
death messages: true
# How fast to try to shoot things (EG arrows).
shoot speed minimum: 20

# How fast to recalculate, in ticks.
update rate: 10

0 comments on commit b0a0342

Please sign in to comment.
You can’t perform that action at this time.