Added Instrument enum, Note class and get/setNote functions. Thanks xZise!

By: EvilSeph <evilseph@unaligned.org>
This commit is contained in:
CraftBukkit/Spigot
2011-06-17 03:16:18 -04:00
parent 51e0c1409b
commit 5b6c2eb1b3
2 changed files with 36 additions and 2 deletions

View File

@@ -15,8 +15,10 @@ import net.minecraft.server.ServerConfigurationManager;
import net.minecraft.server.WorldServer;
import org.bukkit.Achievement;
import org.bukkit.Effect;
import org.bukkit.Instrument;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.Note;
import org.bukkit.Statistic;
import org.bukkit.craftbukkit.CraftServer;
import org.bukkit.craftbukkit.CraftWorld;
@@ -150,6 +152,10 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
getHandle().netServerHandler.sendPacket(new Packet54PlayNoteBlock(loc.getBlockX(), loc.getBlockY(), loc.getBlockZ(), instrument, note));
}
public void playNote(Location loc, Instrument instrument, Note note) {
getHandle().netServerHandler.sendPacket(new Packet54PlayNoteBlock(loc.getBlockX(), loc.getBlockY(), loc.getBlockZ(), instrument.getType(), note.getId()));
}
public void playEffect(Location loc, Effect effect, int data) {
int packetData = effect.getId();
Packet61 packet = new Packet61(packetData, loc.getBlockX(), loc.getBlockY(), loc.getBlockZ(), data);