mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-10 10:17:38 +01:00
Moved playSound/Effect(Player, ...) to Player.playEffect(Location, ...) to be consistent, and because the code didn't really do what the Javadoc said.
By: sk89q <the.sk89q@gmail.com>
This commit is contained in:
parent
7b6df709cf
commit
2f20b4ba3c
@ -648,16 +648,16 @@ public class CraftWorld implements World {
|
|||||||
world.pvpMode = pvp;
|
world.pvpMode = pvp;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void playEffect(Player player, Effect sound, int data) {
|
public void playEffect(Player player, Effect effect, int data) {
|
||||||
playEffect(player.getLocation(), sound, data, 0);
|
playEffect(player.getLocation(), effect, data, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void playEffect(Location location, Effect sound, int data) {
|
public void playEffect(Location location, Effect effect, int data) {
|
||||||
playEffect(location, sound, data, 64);
|
playEffect(location, effect, data, 64);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void playEffect(Location location, Effect sound, int data, int radius) {
|
public void playEffect(Location location, Effect effect, int data, int radius) {
|
||||||
int packetData = sound.getId();
|
int packetData = effect.getId();
|
||||||
Packet61 packet = new Packet61(packetData, location.getBlockX(), location.getBlockY(), location.getBlockZ(), data);
|
Packet61 packet = new Packet61(packetData, location.getBlockX(), location.getBlockY(), location.getBlockZ(), data);
|
||||||
int distance;
|
int distance;
|
||||||
for (Player player : getPlayers()) {
|
for (Player player : getPlayers()) {
|
||||||
|
@ -11,6 +11,7 @@ import net.minecraft.server.Packet3Chat;
|
|||||||
import net.minecraft.server.Packet51MapChunk;
|
import net.minecraft.server.Packet51MapChunk;
|
||||||
import net.minecraft.server.Packet53BlockChange;
|
import net.minecraft.server.Packet53BlockChange;
|
||||||
import net.minecraft.server.Packet54PlayNoteBlock;
|
import net.minecraft.server.Packet54PlayNoteBlock;
|
||||||
|
import net.minecraft.server.Packet61;
|
||||||
import net.minecraft.server.Packet6SpawnPosition;
|
import net.minecraft.server.Packet6SpawnPosition;
|
||||||
import net.minecraft.server.ServerConfigurationManager;
|
import net.minecraft.server.ServerConfigurationManager;
|
||||||
import net.minecraft.server.WorldServer;
|
import net.minecraft.server.WorldServer;
|
||||||
@ -18,6 +19,7 @@ import net.minecraft.server.ChunkCoordIntPair;
|
|||||||
import net.minecraft.server.Packet9Respawn;
|
import net.minecraft.server.Packet9Respawn;
|
||||||
import net.minecraft.server.World;
|
import net.minecraft.server.World;
|
||||||
import org.bukkit.Achievement;
|
import org.bukkit.Achievement;
|
||||||
|
import org.bukkit.Effect;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.Statistic;
|
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));
|
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) {
|
public void sendBlockChange(Location loc, Material material, byte data) {
|
||||||
sendBlockChange(loc, material.getId(), data);
|
sendBlockChange(loc, material.getId(), data);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user