diff --git a/plugin.yml b/plugin.yml index 540b549..bc3c253 100644 --- a/plugin.yml +++ b/plugin.yml @@ -1,5 +1,5 @@ name: Vivecraft-Spigot-Extensions -version: '1.12-r2' +version: '1.12-r3' main: org.vivecraft.VSE website: http://www.vivecraft.org/ author: jrbudda, jaron780 diff --git a/src/org/vivecraft/listeners/VivecraftCombatListener.java b/src/org/vivecraft/listeners/VivecraftCombatListener.java index 05e2b85..0fd3055 100644 --- a/src/org/vivecraft/listeners/VivecraftCombatListener.java +++ b/src/org/vivecraft/listeners/VivecraftCombatListener.java @@ -33,10 +33,10 @@ public void onProjectileLaunch(ProjectileLaunchEvent event) { return; Player pl = (Player)proj.getShooter(); - VivePlayer vp = (VivePlayer)VSE.vivePlayers.get(pl.getUniqueId()); + final VivePlayer vp = (VivePlayer)VSE.vivePlayers.get(pl.getUniqueId()); - int hand = 0; - if (proj instanceof CraftArrow) hand = 1; + final int hand = proj instanceof CraftArrow ? 1 : 0; + //TODO: check for seated mode. if ((vp == null) && (this.vse.getConfig().getBoolean("general.debug"))) { @@ -46,11 +46,16 @@ public void onProjectileLaunch(ProjectileLaunchEvent event) { //this only works if the incoming speed is at max (based! on draw time) //TODO: properly scale in all cases. - proj.teleport(vp.getControllerPos(hand)); + if(proj.getType() == EntityType.ARROW && vp.getDraw() != 0) { proj.setVelocity(proj.getVelocity().multiply(vp.getDraw())); } - + vse.getServer().getScheduler().scheduleSyncDelayedTask(vse, new Runnable() { + @Override + public void run() { + proj.teleport(vp.getControllerPos(hand)); + } + }, 1); } @EventHandler(ignoreCancelled = true, priority = EventPriority.LOW)