Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-12-20 05:20:07 +01:00
Added method to fake a block change request for a player.
Dieser Commit ist enthalten in:
Ursprung
80a1a4ac82
Commit
bdcee9025c
@ -7,6 +7,7 @@ import net.minecraft.server.EntityPlayer;
|
|||||||
import net.minecraft.server.ItemInWorldManager;
|
import net.minecraft.server.ItemInWorldManager;
|
||||||
import net.minecraft.server.Packet200Statistic;
|
import net.minecraft.server.Packet200Statistic;
|
||||||
import net.minecraft.server.Packet3Chat;
|
import net.minecraft.server.Packet3Chat;
|
||||||
|
import net.minecraft.server.Packet53BlockChange;
|
||||||
import net.minecraft.server.Packet54PlayNoteBlock;
|
import net.minecraft.server.Packet54PlayNoteBlock;
|
||||||
import net.minecraft.server.Packet6SpawnPosition;
|
import net.minecraft.server.Packet6SpawnPosition;
|
||||||
import net.minecraft.server.ServerConfigurationManager;
|
import net.minecraft.server.ServerConfigurationManager;
|
||||||
@ -147,6 +148,19 @@ 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 sendBlockChange(Location loc, Material material, byte data) {
|
||||||
|
sendBlockChange(loc, material.getId(), data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void sendBlockChange(Location loc, int material, byte data) {
|
||||||
|
Packet53BlockChange packet = new Packet53BlockChange(
|
||||||
|
loc.getBlockX(), loc.getBlockY(), loc.getBlockZ(),
|
||||||
|
((CraftWorld) loc.getWorld()).getHandle());
|
||||||
|
packet.d = material;
|
||||||
|
packet.e = data;
|
||||||
|
getHandle().netServerHandler.sendPacket(packet);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean teleport(Location location) {
|
public boolean teleport(Location location) {
|
||||||
WorldServer oldWorld = ((CraftWorld)getWorld()).getHandle();
|
WorldServer oldWorld = ((CraftWorld)getWorld()).getHandle();
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren