Search in sources :

Example 16 with SPacketUpdateTileEntity

use of net.minecraft.network.play.server.SPacketUpdateTileEntity in project Railcraft by Railcraft.

the class PacketBuilder method sendTileEntityPacket.

public void sendTileEntityPacket(TileEntity tile) {
    if (tile.getWorld() instanceof WorldServer) {
        WorldServer world = (WorldServer) tile.getWorld();
        SPacketUpdateTileEntity packet = tile.getUpdatePacket();
        if (packet != null)
            PacketDispatcher.sendToWatchers(packet, world, tile.getPos().getX(), tile.getPos().getZ());
    }
}
Also used : WorldServer(net.minecraft.world.WorldServer) SPacketUpdateTileEntity(net.minecraft.network.play.server.SPacketUpdateTileEntity)

Example 17 with SPacketUpdateTileEntity

use of net.minecraft.network.play.server.SPacketUpdateTileEntity in project Witchworks by Um-Mitternacht.

the class TileMod method getUpdatePacket.

@Override
public final SPacketUpdateTileEntity getUpdatePacket() {
    final NBTTagCompound tag = getUpdateTag();
    writeDataNBT(tag);
    return new SPacketUpdateTileEntity(pos, 0, tag);
}
Also used : NBTTagCompound(net.minecraft.nbt.NBTTagCompound) SPacketUpdateTileEntity(net.minecraft.network.play.server.SPacketUpdateTileEntity)

Example 18 with SPacketUpdateTileEntity

use of net.minecraft.network.play.server.SPacketUpdateTileEntity in project SecurityCraft by Geforce132.

the class TileEntityKeypadChest method getUpdatePacket.

@Override
public SPacketUpdateTileEntity getUpdatePacket() {
    NBTTagCompound tag = new NBTTagCompound();
    writeToNBT(tag);
    return new SPacketUpdateTileEntity(pos, 1, tag);
}
Also used : NBTTagCompound(net.minecraft.nbt.NBTTagCompound) SPacketUpdateTileEntity(net.minecraft.network.play.server.SPacketUpdateTileEntity)

Example 19 with SPacketUpdateTileEntity

use of net.minecraft.network.play.server.SPacketUpdateTileEntity in project SecurityCraft by Geforce132.

the class TileEntityOwnable method getUpdatePacket.

@Override
public SPacketUpdateTileEntity getUpdatePacket() {
    NBTTagCompound tag = new NBTTagCompound();
    writeToNBT(tag);
    return new SPacketUpdateTileEntity(pos, 1, tag);
}
Also used : NBTTagCompound(net.minecraft.nbt.NBTTagCompound) SPacketUpdateTileEntity(net.minecraft.network.play.server.SPacketUpdateTileEntity)

Example 20 with SPacketUpdateTileEntity

use of net.minecraft.network.play.server.SPacketUpdateTileEntity in project MorePlanets by SteveKunG.

the class TileEntityVeinPortal method getUpdatePacket.

@Override
public SPacketUpdateTileEntity getUpdatePacket() {
    NBTTagCompound nbt = new NBTTagCompound();
    nbt.setLong("Age", this.age);
    nbt.setBoolean("Middle", this.isMiddle);
    nbt.setBoolean("SpawnedBoss", this.spawnedBoss);
    nbt.setInteger("DelayToTeleport", this.delayToTeleport);
    return new SPacketUpdateTileEntity(this.pos, -1, nbt);
}
Also used : NBTTagCompound(net.minecraft.nbt.NBTTagCompound) SPacketUpdateTileEntity(net.minecraft.network.play.server.SPacketUpdateTileEntity)

Aggregations

SPacketUpdateTileEntity (net.minecraft.network.play.server.SPacketUpdateTileEntity)20 NBTTagCompound (net.minecraft.nbt.NBTTagCompound)19 Nullable (javax.annotation.Nullable)3 WorldServer (net.minecraft.world.WorldServer)1 NotNull (org.jetbrains.annotations.NotNull)1