|
@@ -2,12 +2,17 @@ package com.gmail.nossr50.skills.crossbows;
|
|
|
|
|
|
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
|
|
|
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
|
|
|
+import com.gmail.nossr50.datatypes.skills.SubSkillType;
|
|
|
import com.gmail.nossr50.mcMMO;
|
|
|
import com.gmail.nossr50.skills.SkillManager;
|
|
|
import com.gmail.nossr50.skills.archery.Archery;
|
|
|
+import com.gmail.nossr50.util.Permissions;
|
|
|
+import org.bukkit.Bukkit;
|
|
|
import org.bukkit.Location;
|
|
|
+import org.bukkit.World;
|
|
|
import org.bukkit.entity.Entity;
|
|
|
import org.bukkit.entity.LivingEntity;
|
|
|
+import org.bukkit.entity.Projectile;
|
|
|
import org.bukkit.event.entity.ProjectileLaunchEvent;
|
|
|
|
|
|
public class CrossbowManager extends SkillManager {
|
|
@@ -29,7 +34,7 @@ public class CrossbowManager extends SkillManager {
|
|
|
Location firedLocation = (Location) damager.getMetadata(mcMMO.arrowDistanceKey).get(0).value();
|
|
|
Location targetLocation = target.getLocation();
|
|
|
|
|
|
- if (firedLocation.getWorld() != targetLocation.getWorld()) {
|
|
|
+ if (firedLocation == null || firedLocation.getWorld() != targetLocation.getWorld()) {
|
|
|
return 1;
|
|
|
}
|
|
|
|
|
@@ -43,6 +48,19 @@ public class CrossbowManager extends SkillManager {
|
|
|
*/
|
|
|
public void processProjectileLaunchEvent(ProjectileLaunchEvent projectileLaunchEvent) {
|
|
|
mcMMOPlayer.getPlayer().sendMessage("Pew pew!");
|
|
|
+
|
|
|
+ //Testing
|
|
|
+ if(Permissions.isSubSkillEnabled(mcMMOPlayer.getPlayer(), SubSkillType.CROSSBOWS_CONE_OF_DEATH)) {
|
|
|
+ coneOfDeathProcessing(projectileLaunchEvent);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ private void coneOfDeathProcessing(ProjectileLaunchEvent projectileLaunchEvent) {
|
|
|
+ Projectile mainProjectile = projectileLaunchEvent.getEntity();
|
|
|
+ World world = mainProjectile.getWorld();
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
|
|
|
|