diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/sneakyassassins/SneakyAssassins.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/sneakyassassins/SneakyAssassins.java index 320c5963e..531d77586 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/sneakyassassins/SneakyAssassins.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/sneakyassassins/SneakyAssassins.java @@ -14,6 +14,7 @@ import nautilus.game.arcade.kit.*; import org.bukkit.*; import org.bukkit.entity.*; import org.bukkit.event.*; +import org.bukkit.event.player.*; import java.util.*; @@ -123,6 +124,13 @@ public class SneakyAssassins extends SoloGame event.AddMod(GetName(), "Sword Damage", damage - event.GetDamage(), false); } + @EventHandler(ignoreCancelled = true) + public void onPlayerInteractEntity(PlayerInteractEntityEvent event) + { + if(event.getRightClicked() instanceof Villager) + event.setCancelled(true); + } + public NpcManager getNpcManager() { return _npcManager; diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/sneakyassassins/powerups/ArmorPowerUp.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/sneakyassassins/powerups/ArmorPowerUp.java index 7b5df25fa..3034531e2 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/sneakyassassins/powerups/ArmorPowerUp.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/sneakyassassins/powerups/ArmorPowerUp.java @@ -39,11 +39,13 @@ public class ArmorPowerUp extends PowerUp @Override public void powerUpPlayer(Player player) { - powerUpArmor(player); - powerUpArmor(player); + if(powerUpArmor(player) || powerUpArmor(player)) + player.sendMessage("Your armor was upgraded!"); + else + player.sendMessage("Your armor is already fully upgraded!"); } - private void powerUpArmor(Player player) + private boolean powerUpArmor(Player player) { ItemStack[] armor = player.getInventory().getArmorContents(); @@ -65,8 +67,10 @@ public class ArmorPowerUp extends PowerUp armor[choice] = new ItemStack(ARMOR_PROGRESSION.get(choice).get(nextLevel)); player.getInventory().setArmorContents(armor); - return; + return true; } } + + return false; } } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/sneakyassassins/powerups/WeaponPowerUp.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/sneakyassassins/powerups/WeaponPowerUp.java index 030d33d93..95ab59acb 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/sneakyassassins/powerups/WeaponPowerUp.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/sneakyassassins/powerups/WeaponPowerUp.java @@ -33,8 +33,12 @@ public class WeaponPowerUp extends PowerUp int newSwordType = Math.min(SWORD_PROGRESSION.size() - 1, swordType + 1); player.getInventory().setItem(swordSlot, new ItemStack(SWORD_PROGRESSION.get(newSwordType))); + player.sendMessage("You sword was upgraded!"); + return; } } + + player.sendMessage("Your sword is already fully upgraded!"); } } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkRevealer.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkRevealer.java index 1611856a6..9fbc69cd4 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkRevealer.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkRevealer.java @@ -66,8 +66,48 @@ public class PerkRevealer extends Perk implements IThrown Manager.GetProjectile().AddThrow(ent, player, this, -1, true, true, true, false, 1d); } + @EventHandler + public void onUpdate(UpdateEvent event) + { + if(event.getType() == UpdateType.SEC) + { + for(Iterator> it = getRevealedPlayers().entrySet().iterator(); it.hasNext();) + { + Map.Entry entry = it.next(); + + if(!entry.getKey().isOnline()) + it.remove(); + else if(entry.getValue()._expirationSeconds <= 0) + { + it.remove(); + + Manager.GetDisguise().disguise(entry.getValue()._disguise); + } + else + entry.getValue()._expirationSeconds--; + } + } + } + @Override public void Collide(LivingEntity target, Block block, ProjectileUser data) + { + explode(data); + } + + @Override + public void Idle(ProjectileUser data) + { + explode(data); + } + + @Override + public void Expire(ProjectileUser data) + { + explode(data); + } + + private void explode(ProjectileUser data) { FireworkEffect effect = FireworkEffect .builder() @@ -103,41 +143,6 @@ public class PerkRevealer extends Perk implements IThrown data.GetThrown().remove(); } - @EventHandler - public void onUpdate(UpdateEvent event) - { - if(event.getType() == UpdateType.SEC) - { - for(Iterator> it = getRevealedPlayers().entrySet().iterator(); it.hasNext();) - { - Map.Entry entry = it.next(); - - if(!entry.getKey().isOnline()) - it.remove(); - else if(entry.getValue()._expirationSeconds <= 0) - { - it.remove(); - - Manager.GetDisguise().disguise(entry.getValue()._disguise); - } - else - entry.getValue()._expirationSeconds--; - } - } - } - - @Override - public void Idle(ProjectileUser data) - { - - } - - @Override - public void Expire(ProjectileUser data) - { - - } - public Map getRevealedPlayers() { return _revealedPlayers;