diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/GadgetManager.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/GadgetManager.java index 2a686f3e5..599769eba 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/GadgetManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/GadgetManager.java @@ -10,6 +10,7 @@ import mineplex.core.gadget.commands.AmmoCommand; import mineplex.core.gadget.commands.UnlockCosmeticsCommand; import mineplex.core.gadget.gadgets.item.*; import mineplex.core.gadget.gadgets.outfit.*; +import mineplex.core.gadget.gadgets.outfit.windupsuit.*; import mineplex.core.gadget.set.*; import org.bukkit.Bukkit; import org.bukkit.Location; @@ -169,6 +170,7 @@ public class GadgetManager extends MiniPlugin private MountManager _mountManager; private PacketHandler _packetManager; private HologramManager _hologramManager; + private OutfitWindUpSuitBoosterManager _boosterManager; private NautHashMap> _gadgets; @@ -200,6 +202,7 @@ public class GadgetManager extends MiniPlugin _packetManager = packetHandler; _mountManager = mountManager; _hologramManager = hologramManager; + _boosterManager = new OutfitWindUpSuitBoosterManager(this); CreateGadgets(); createSets(); @@ -633,6 +636,11 @@ public class GadgetManager extends MiniPlugin return _inventoryManager; } + public OutfitWindUpSuitBoosterManager getBoosterManager() + { + return _boosterManager; + } + public boolean collideEvent(Player shooter, Gadget gadget, Player other) { GadgetCollideEntityEvent collideEvent = new GadgetCollideEntityEvent(shooter, gadget, other); diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/commands/AmmoCommand.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/commands/AmmoCommand.java index 2c7049252..e611c1398 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/commands/AmmoCommand.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/commands/AmmoCommand.java @@ -24,6 +24,13 @@ public class AmmoCommand extends CommandBase @Override public void Execute(Player caller, String[] args) { + boolean testServer = _plugin.getPlugin().getConfig().getString("serverstatus.group").equalsIgnoreCase("Testing"); + + if(!testServer) + { + UtilPlayer.message(caller, F.elem("This command can only be used on test servers!")); + } + if(args.length == 2) { String gadgetName = args[0]; @@ -111,5 +118,4 @@ public class AmmoCommand extends CommandBase } return null; } - } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/commands/UnlockCosmeticsCommand.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/commands/UnlockCosmeticsCommand.java index 33edd3fa4..9a84ffc50 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/commands/UnlockCosmeticsCommand.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/commands/UnlockCosmeticsCommand.java @@ -23,8 +23,12 @@ public class UnlockCosmeticsCommand extends CommandBase @Override public void Execute(Player caller, String[] args) { + boolean testServer = _plugin.getPlugin().getConfig().getString("serverstatus.group").equalsIgnoreCase("Testing"); - // TODO ADD TO SPECIFIC TARGET PLAYER + if(!testServer) + { + UtilPlayer.message(caller, F.elem("This command can only be used on test servers!")); + } // Adds all cosmetic types if (args.length == 0) @@ -71,5 +75,4 @@ public class UnlockCosmeticsCommand extends CommandBase } UtilPlayer.message(caller, F.main("Cosmetics", "Added all the " + gadgetType.name() + " cosmetics!")); } - } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/outfit/OutfitWindUpSuit.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/outfit/windupsuit/OutfitWindUpSuit.java similarity index 65% rename from Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/outfit/OutfitWindUpSuit.java rename to Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/outfit/windupsuit/OutfitWindUpSuit.java index d9625847a..ac0836fe0 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/outfit/OutfitWindUpSuit.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/outfit/windupsuit/OutfitWindUpSuit.java @@ -1,4 +1,4 @@ -package mineplex.core.gadget.gadgets.outfit; +package mineplex.core.gadget.gadgets.outfit.windupsuit; import mineplex.core.common.util.*; import mineplex.core.gadget.GadgetManager; @@ -11,41 +11,44 @@ import org.bukkit.event.EventHandler; import org.bukkit.event.player.PlayerMoveEvent; import org.bukkit.event.player.PlayerToggleSneakEvent; import org.bukkit.inventory.ItemStack; -import org.bukkit.potion.PotionEffect; import org.bukkit.potion.PotionEffectType; import java.util.HashMap; -import java.util.HashSet; +import java.util.Iterator; public class OutfitWindUpSuit extends OutfitGadget { - private HashMap _colorPhase = new HashMap(); + private HashMap _colorPhase = new HashMap(); + private HashMap _percentage = new HashMap(); - private HashSet _booster = new HashSet(); + private OutfitWindUpSuitBoosterManager _boosterManager; - public OutfitWindUpSuit(GadgetManager manager, String name, int cost, ArmorSlot slot, Material mat, byte data) + public OutfitWindUpSuit(GadgetManager manager, String name, int cost, ArmorSlot slot, Material mat, byte data, OutfitWindUpSuitBoosterManager boosterManager) { super(manager, name, UtilText.splitLineToArray(C.cGray + "Placeholder", LineFormat.LORE), cost, slot, mat, data); + _boosterManager = boosterManager; } @Override public void EnableCustom(Player player) { ApplyArmor(player); - _colorPhase.put(player.getName(), 0); + _colorPhase.put(player, 0); + _percentage.put(player, 0); } @Override public void DisableCustom(Player player) { RemoveArmor(player); - _colorPhase.remove(player.getName()); + _colorPhase.remove(player); + _percentage.remove(player); - if (_booster.contains(player)) - _booster.remove(player); + if (_boosterManager.hasEffects(player)) + _boosterManager.removeEffects(player); if (UtilPlayer.hasWorldBorder(player)) UtilPlayer.removeWorldBorder(player); @@ -68,11 +71,15 @@ public class OutfitWindUpSuit extends OutfitGadget if (!IsActive(player)) return; - // Checks if player has jump and speed effects (booster) - if (player.hasPotionEffect(PotionEffectType.JUMP) && player.hasPotionEffect(PotionEffectType.SPEED)) + // Checks if player has effects + if (_boosterManager.hasEffects(player)) return; - int phase = _colorPhase.get(player.getName()); + int phase = _colorPhase.get(player); + int percentage = _percentage.get(player); + + if (phase == 4 || percentage == 888) + return; Color color = getColor(player); @@ -84,22 +91,26 @@ public class OutfitWindUpSuit extends OutfitGadget if (phase == 0) { updateNextColor(color, colors[phase], player, phase); + percentage += 5; } else if (phase == 1) { updateNextColor(color, colors[phase], player, phase); + percentage += 5; } else if (phase == 2) { updateNextColor(color, colors[phase], player, phase); + percentage += 5; } else if (phase == 3) { - _booster.add(player); UtilPlayer.sendRedScreen(player, 100000); + percentage = 888; + _colorPhase.put(player, phase + 1); } - else - return; + _percentage.put(player, percentage); + sendPercentageChange(player); } // Activates boost (Jump + Speed 3 for 90 seconds) @@ -112,20 +123,17 @@ public class OutfitWindUpSuit extends OutfitGadget if (!IsActive(player)) return; - int phase = _colorPhase.get(player.getName()); + int phase = _colorPhase.get(player); - if(phase != 3) + if(phase != 4) return; - _colorPhase.put(player.getName(), 0); + _colorPhase.put(player, 0); + _percentage.put(player, 0); + sendPercentageChange(player); updateColor(player, UtilColor.defaultLeatherColor); - _booster.remove(player); - UtilPlayer.sendRedScreen(player, 0); - PotionEffect speed = new PotionEffect(PotionEffectType.SPEED, 20 * 90, 2, false); - PotionEffect jump = new PotionEffect(PotionEffectType.JUMP, 20 * 90, 2, false); - player.addPotionEffect(speed); - player.addPotionEffect(jump); + _boosterManager.applyEffects(player); } // Plays fast music when player is red @@ -135,12 +143,25 @@ public class OutfitWindUpSuit extends OutfitGadget if (event.getType() != UpdateType.TICK) return; - if (event.getTick() % 5 != 0) - return; - - for (Player player : _booster) + for (Iterator i = _boosterManager.getPlayers().iterator(); i.hasNext();) { - player.playSound(player.getLocation(), Sound.NOTE_BASS_DRUM, 1f, 1f); + Player player = i.next(); + // Checks if effects are over + if (_boosterManager.getTicks(player) >= 1800) + { + _boosterManager.removeEffects(player); + } + else + { + _boosterManager.incrementTicks(player); + } + } + + for (Player player : _colorPhase.keySet()) + { + if (_colorPhase.get(player) == 4) + if (event.getTick() % 5 == 0) + player.playSound(player.getLocation(), Sound.NOTE_BASS_DRUM, 1f, 1f); } } @@ -156,7 +177,6 @@ public class OutfitWindUpSuit extends OutfitGadget private void updateColor(Player player, Color color) { - ItemStack stack = getStack(player); if (stack == null) @@ -170,12 +190,6 @@ public class OutfitWindUpSuit extends OutfitGadget } UtilColor.applyColor(stack, color); - - /*LeatherArmorMeta meta = (LeatherArmorMeta) stack.getItemMeta(); - - meta.setColor(color); - - stack.setItemMeta(meta);*/ } private void updateNextColor(Color original, Color finalColor, Player player, int phase) @@ -184,7 +198,7 @@ public class OutfitWindUpSuit extends OutfitGadget Color nextColor = UtilColor.getNextColor(original, finalColor, 5); if (nextColor.getRed() == finalColor.getRed() && nextColor.getGreen() == finalColor.getGreen() && nextColor.getBlue() == finalColor.getBlue()) - _colorPhase.put(player.getName(), phase + 1); + _colorPhase.put(player, phase + 1); updateColor(player, nextColor); } @@ -215,4 +229,13 @@ public class OutfitWindUpSuit extends OutfitGadget return stack; } + private void sendPercentageChange(Player player) + { + if (!_percentage.containsKey(player)) + return; + + // 888 = Max number of color changes (100%) + double percent = ((_percentage.get(player) * 100d) / 888d) / 100d; + UtilTextBottom.displayProgress(C.Bold + getSet().getName(), percent, "", player); + } } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/outfit/windupsuit/OutfitWindUpSuitBoosterManager.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/outfit/windupsuit/OutfitWindUpSuitBoosterManager.java new file mode 100644 index 000000000..bbbe726ce --- /dev/null +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/outfit/windupsuit/OutfitWindUpSuitBoosterManager.java @@ -0,0 +1,129 @@ +package mineplex.core.gadget.gadgets.outfit.windupsuit; + +import mineplex.core.common.util.UtilFirework; +import mineplex.core.common.util.UtilPlayer; +import mineplex.core.gadget.GadgetManager; +import mineplex.core.gadget.types.OutfitGadget; +import mineplex.core.noteblock.INoteVerifier; +import mineplex.core.noteblock.NBSReader; +import mineplex.core.noteblock.NotePlayer; +import mineplex.core.noteblock.NoteSong; +import org.bukkit.Color; +import org.bukkit.FireworkEffect; +import org.bukkit.entity.Player; +import org.bukkit.potion.PotionEffect; +import org.bukkit.potion.PotionEffectType; + +import java.io.DataInputStream; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.util.HashMap; +import java.util.Set; + +public class OutfitWindUpSuitBoosterManager +{ + + private GadgetManager _gadget; + + private HashMap _players = new HashMap(); + private HashMap _notePlayers = new HashMap(); + + public OutfitWindUpSuitBoosterManager(GadgetManager gadget) + { + _gadget = gadget; + } + + public void applyEffects(Player player) + { + if (hasEffects(player)) + return; + + _players.put(player, 0); + + // Applies potion effects + PotionEffect speed = new PotionEffect(PotionEffectType.SPEED, 1800, 2, false); + PotionEffect jump = new PotionEffect(PotionEffectType.JUMP, 1800, 2, false); + player.addPotionEffect(speed); + player.addPotionEffect(jump); + + // Resets red screen + UtilPlayer.sendRedScreen(player, 0); + + // Plays firework effect + UtilFirework.playFirework(player.getLocation(), FireworkEffect.builder().withColor(Color.RED).withFade(Color.BLACK).flicker(true).build()); + + // Starts the song + playSong(player); + } + + public void removeEffects(Player player) + { + if (!hasEffects(player)) + return; + + _players.remove(player); + + // Removes potion effetcs + player.removePotionEffect(PotionEffectType.JUMP); + player.removePotionEffect(PotionEffectType.SPEED); + + // Stops song + if (_notePlayers.containsKey(player)) + { + NotePlayer notePlayer = _notePlayers.get(player); + notePlayer.cancel(); + _notePlayers.remove(player); + } + } + + public boolean hasEffects(Player player) + { + return _players.containsKey(player); + } + + public Set getPlayers() + { + return _players.keySet(); + } + + public int getTicks(Player player) + { + if (!hasEffects(player)) + return -1; + return _players.get(player); + } + + public void incrementTicks(Player player) + { + _players.put(player, getTicks(player) + 1); + } + + private void playSong(Player player) + { + String songName = "tetris.nbs"; + try + { + File songFile = new File("../../update/songs/" + songName); + if (songFile.exists()) + { + NoteSong song = NBSReader.loadSong(new DataInputStream(new FileInputStream(songFile)), songFile.getName().replace("_", " ").replace(".nbs", "")); + if (song != null) + { + NotePlayer notePlayer = new NotePlayer(_gadget.getPlugin(), song, new INoteVerifier() { + @Override + public boolean shouldPlay(Player toPlay) { + return true; + } + }, 0.5F, true, player); + _notePlayers.put(player, notePlayer); + } + } + } + catch (FileNotFoundException e) + { + e.printStackTrace(); + } + } + +} diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/outfit/OutfitWindUpSuitBoots.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/outfit/windupsuit/OutfitWindUpSuitBoots.java similarity index 70% rename from Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/outfit/OutfitWindUpSuitBoots.java rename to Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/outfit/windupsuit/OutfitWindUpSuitBoots.java index f107ba0c1..54541e2c8 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/outfit/OutfitWindUpSuitBoots.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/outfit/windupsuit/OutfitWindUpSuitBoots.java @@ -1,4 +1,4 @@ -package mineplex.core.gadget.gadgets.outfit; +package mineplex.core.gadget.gadgets.outfit.windupsuit; import mineplex.core.gadget.GadgetManager; import org.bukkit.Material; @@ -8,7 +8,7 @@ public class OutfitWindUpSuitBoots extends OutfitWindUpSuit public OutfitWindUpSuitBoots(GadgetManager manager) { - super(manager, "Wind Up Boots", -2, ArmorSlot.Boots, Material.LEATHER_BOOTS, (byte)0); + super(manager, "Wind Up Boots", -2, ArmorSlot.Boots, Material.LEATHER_BOOTS, (byte)0, manager.getBoosterManager()); } } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/outfit/OutfitWindUpSuitChestplate.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/outfit/windupsuit/OutfitWindUpSuitChestplate.java similarity index 69% rename from Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/outfit/OutfitWindUpSuitChestplate.java rename to Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/outfit/windupsuit/OutfitWindUpSuitChestplate.java index c390eb7cc..bf1f8c5e2 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/outfit/OutfitWindUpSuitChestplate.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/outfit/windupsuit/OutfitWindUpSuitChestplate.java @@ -1,4 +1,4 @@ -package mineplex.core.gadget.gadgets.outfit; +package mineplex.core.gadget.gadgets.outfit.windupsuit; import mineplex.core.gadget.GadgetManager; import org.bukkit.Material; @@ -8,7 +8,7 @@ public class OutfitWindUpSuitChestplate extends OutfitWindUpSuit public OutfitWindUpSuitChestplate(GadgetManager manager) { - super(manager, "Wind Up Shirt", -2, ArmorSlot.Chest, Material.LEATHER_CHESTPLATE, (byte)0); + super(manager, "Wind Up Shirt", -2, ArmorSlot.Chest, Material.LEATHER_CHESTPLATE, (byte)0, manager.getBoosterManager()); } } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/outfit/OutfitWindUpSuitHelmet.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/outfit/windupsuit/OutfitWindUpSuitHelmet.java similarity index 70% rename from Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/outfit/OutfitWindUpSuitHelmet.java rename to Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/outfit/windupsuit/OutfitWindUpSuitHelmet.java index 1a9c565a7..c801db220 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/outfit/OutfitWindUpSuitHelmet.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/outfit/windupsuit/OutfitWindUpSuitHelmet.java @@ -1,4 +1,4 @@ -package mineplex.core.gadget.gadgets.outfit; +package mineplex.core.gadget.gadgets.outfit.windupsuit; import mineplex.core.gadget.GadgetManager; import org.bukkit.Material; @@ -8,7 +8,7 @@ public class OutfitWindUpSuitHelmet extends OutfitWindUpSuit public OutfitWindUpSuitHelmet(GadgetManager manager) { - super(manager, "Wind Up Hat", -2, ArmorSlot.Helmet, Material.LEATHER_HELMET, (byte)0); + super(manager, "Wind Up Hat", -2, ArmorSlot.Helmet, Material.LEATHER_HELMET, (byte)0, manager.getBoosterManager()); } } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/outfit/OutfitWindUpSuitLeggings.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/outfit/windupsuit/OutfitWindUpSuitLeggings.java similarity index 70% rename from Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/outfit/OutfitWindUpSuitLeggings.java rename to Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/outfit/windupsuit/OutfitWindUpSuitLeggings.java index cbb14917d..0f57f3875 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/outfit/OutfitWindUpSuitLeggings.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/outfit/windupsuit/OutfitWindUpSuitLeggings.java @@ -1,4 +1,4 @@ -package mineplex.core.gadget.gadgets.outfit; +package mineplex.core.gadget.gadgets.outfit.windupsuit; import mineplex.core.gadget.GadgetManager; import org.bukkit.Material; @@ -8,7 +8,7 @@ public class OutfitWindUpSuitLeggings extends OutfitWindUpSuit public OutfitWindUpSuitLeggings(GadgetManager manager) { - super(manager, "Wind Up Pants", -2, ArmorSlot.Legs, Material.LEATHER_LEGGINGS, (byte)0); + super(manager, "Wind Up Pants", -2, ArmorSlot.Legs, Material.LEATHER_LEGGINGS, (byte)0, manager.getBoosterManager()); } } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/set/SetWindUpSuit.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/set/SetWindUpSuit.java index 0ee7f9562..f82f33e46 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/set/SetWindUpSuit.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/set/SetWindUpSuit.java @@ -1,10 +1,10 @@ package mineplex.core.gadget.set; import mineplex.core.gadget.GadgetManager; -import mineplex.core.gadget.gadgets.outfit.OutfitWindUpSuitBoots; -import mineplex.core.gadget.gadgets.outfit.OutfitWindUpSuitChestplate; -import mineplex.core.gadget.gadgets.outfit.OutfitWindUpSuitHelmet; -import mineplex.core.gadget.gadgets.outfit.OutfitWindUpSuitLeggings; +import mineplex.core.gadget.gadgets.outfit.windupsuit.OutfitWindUpSuitBoots; +import mineplex.core.gadget.gadgets.outfit.windupsuit.OutfitWindUpSuitChestplate; +import mineplex.core.gadget.gadgets.outfit.windupsuit.OutfitWindUpSuitHelmet; +import mineplex.core.gadget.gadgets.outfit.windupsuit.OutfitWindUpSuitLeggings; import mineplex.core.gadget.types.GadgetSet; public class SetWindUpSuit extends GadgetSet diff --git a/Plugins/Mineplex.Core/src/mineplex/core/noteblock/NotePlayer.java b/Plugins/Mineplex.Core/src/mineplex/core/noteblock/NotePlayer.java index 941bc1dd9..dfe6bf995 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/noteblock/NotePlayer.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/noteblock/NotePlayer.java @@ -20,6 +20,13 @@ public class NotePlayer private volatile boolean _loop; private volatile int _tick; private volatile boolean _finished; + private volatile Player[] _players = null; + + public NotePlayer(JavaPlugin plugin, NoteSong song, INoteVerifier verifier, float volumeMult, boolean loop, Player... players) + { + this(plugin, song, verifier, volumeMult, loop); + _players = players; + } public NotePlayer(JavaPlugin plugin, NoteSong song, INoteVerifier verifier, float volumeMult, boolean loop) { @@ -92,7 +99,7 @@ public class NotePlayer private void playTick(int tick) { - Player[] playerArray = UtilServer.getPlayers(); + Player[] playerArray = (_players != null) ? _players : UtilServer.getPlayers(); List players = new ArrayList<>(playerArray.length); for (Player player : playerArray) { @@ -108,7 +115,8 @@ public class NotePlayer float volume = _volumeMult * (layer.getVolume() / 100F); for (Player player : players) { - player.playSound(player.getEyeLocation(), UtilNote.getInstrumentSound(note.getInstrument()), volume, (float) UtilNote.getPitch(note.getNote() - 33)); + if (!_finished) + player.playSound(player.getEyeLocation(), UtilNote.getInstrumentSound(note.getInstrument()), volume, (float) UtilNote.getPitch(note.getNote() - 33)); } } } @@ -116,7 +124,6 @@ public class NotePlayer public void cancel() { - _finished = true; + _finished = true; } - }