mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-24 22:26:46 +01:00
placeholder xbow code
This commit is contained in:
parent
e0cf66c421
commit
9eade9abc7
@ -2,12 +2,17 @@ package com.gmail.nossr50.skills.crossbows;
|
|||||||
|
|
||||||
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
|
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
|
||||||
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
|
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
|
||||||
|
import com.gmail.nossr50.datatypes.skills.SubSkillType;
|
||||||
import com.gmail.nossr50.mcMMO;
|
import com.gmail.nossr50.mcMMO;
|
||||||
import com.gmail.nossr50.skills.SkillManager;
|
import com.gmail.nossr50.skills.SkillManager;
|
||||||
import com.gmail.nossr50.skills.archery.Archery;
|
import com.gmail.nossr50.skills.archery.Archery;
|
||||||
|
import com.gmail.nossr50.util.Permissions;
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
|
import org.bukkit.World;
|
||||||
import org.bukkit.entity.Entity;
|
import org.bukkit.entity.Entity;
|
||||||
import org.bukkit.entity.LivingEntity;
|
import org.bukkit.entity.LivingEntity;
|
||||||
|
import org.bukkit.entity.Projectile;
|
||||||
import org.bukkit.event.entity.ProjectileLaunchEvent;
|
import org.bukkit.event.entity.ProjectileLaunchEvent;
|
||||||
|
|
||||||
public class CrossbowManager extends SkillManager {
|
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 firedLocation = (Location) damager.getMetadata(mcMMO.arrowDistanceKey).get(0).value();
|
||||||
Location targetLocation = target.getLocation();
|
Location targetLocation = target.getLocation();
|
||||||
|
|
||||||
if (firedLocation.getWorld() != targetLocation.getWorld()) {
|
if (firedLocation == null || firedLocation.getWorld() != targetLocation.getWorld()) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -43,6 +48,19 @@ public class CrossbowManager extends SkillManager {
|
|||||||
*/
|
*/
|
||||||
public void processProjectileLaunchEvent(ProjectileLaunchEvent projectileLaunchEvent) {
|
public void processProjectileLaunchEvent(ProjectileLaunchEvent projectileLaunchEvent) {
|
||||||
mcMMOPlayer.getPlayer().sendMessage("Pew pew!");
|
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();
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user