Moved playSound/Effect(Player, ...) to Player.playEffect(Location, ...) to be consistent, and because the code didn't really do what the Javadoc said.

Dieser Commit ist enthalten in:
sk89q 2011-06-09 23:08:00 -07:00
Ursprung 846bd468d4
Commit e45c502ec1
2 geänderte Dateien mit 14 neuen und 6 gelöschten Zeilen

Datei anzeigen

@ -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()) {

Datei anzeigen

@ -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);
}