diff options
author | sk89q <the.sk89q@gmail.com> | 2011-06-09 23:08:00 -0700 |
---|---|---|
committer | sk89q <the.sk89q@gmail.com> | 2011-06-09 23:08:00 -0700 |
commit | e45c502ec1e0e8378085c554008a1a3407f98015 (patch) | |
tree | 5e60f0ca7016541aafedab780beb9cb45f70334a /src/main/java | |
parent | 846bd468d4e93937a4604324363e4e7269e9bf54 (diff) | |
download | craftbukkit-e45c502ec1e0e8378085c554008a1a3407f98015.tar craftbukkit-e45c502ec1e0e8378085c554008a1a3407f98015.tar.gz craftbukkit-e45c502ec1e0e8378085c554008a1a3407f98015.tar.lz craftbukkit-e45c502ec1e0e8378085c554008a1a3407f98015.tar.xz craftbukkit-e45c502ec1e0e8378085c554008a1a3407f98015.zip |
Moved playSound/Effect(Player, ...) to Player.playEffect(Location, ...) to be consistent, and because the code didn't really do what the Javadoc said.
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/org/bukkit/craftbukkit/CraftWorld.java | 12 | ||||
-rw-r--r-- | src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java | 8 |
2 files changed, 14 insertions, 6 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java index 60d4f6f4..785ca2d5 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -648,16 +648,16 @@ public class CraftWorld implements World { world.pvpMode = pvp; } - public void playEffect(Player player, Effect sound, int data) { - playEffect(player.getLocation(), sound, data, 0); + public void playEffect(Player player, Effect effect, int data) { + playEffect(player.getLocation(), effect, data, 0); } - public void playEffect(Location location, Effect sound, int data) { - playEffect(location, sound, data, 64); + public void playEffect(Location location, Effect effect, int data) { + playEffect(location, effect, data, 64); } - public void playEffect(Location location, Effect sound, int data, int radius) { - int packetData = sound.getId(); + public void playEffect(Location location, Effect effect, int data, int radius) { + int packetData = effect.getId(); Packet61 packet = new Packet61(packetData, location.getBlockX(), location.getBlockY(), location.getBlockZ(), data); int distance; for (Player player : getPlayers()) { diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java index ef9822e9..ecc8d117 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -11,6 +11,7 @@ import net.minecraft.server.Packet3Chat; import net.minecraft.server.Packet51MapChunk; import net.minecraft.server.Packet53BlockChange; import net.minecraft.server.Packet54PlayNoteBlock; +import net.minecraft.server.Packet61; import net.minecraft.server.Packet6SpawnPosition; import net.minecraft.server.ServerConfigurationManager; import net.minecraft.server.WorldServer; @@ -18,6 +19,7 @@ import net.minecraft.server.ChunkCoordIntPair; import net.minecraft.server.Packet9Respawn; import net.minecraft.server.World; import org.bukkit.Achievement; +import org.bukkit.Effect; import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.Statistic; @@ -153,6 +155,12 @@ public class CraftPlayer extends CraftHumanEntity implements Player { new Packet54PlayNoteBlock(loc.getBlockX(), loc.getBlockY(), loc.getBlockZ(), instrument, note)); } + 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); + getHandle().netServerHandler.sendPacket(packet); + } + public void sendBlockChange(Location loc, Material material, byte data) { sendBlockChange(loc, material.getId(), data); } |