Java 类net.minecraft.network.play.server.S35PacketUpdateTileEntity 实例源码

项目:DecompiledMinecraft    文件:NetHandlerPlayClient.java   
/**
 * Updates the NBTTagCompound metadata of instances of the following entitytypes: Mob spawners, command blocks,
 * beacons, skulls, flowerpot
 */
public void handleUpdateTileEntity(S35PacketUpdateTileEntity packetIn)
{
    PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);

    if (this.gameController.theWorld.isBlockLoaded(packetIn.getPos()))
    {
        TileEntity tileentity = this.gameController.theWorld.getTileEntity(packetIn.getPos());
        int i = packetIn.getTileEntityType();

        if (i == 1 && tileentity instanceof TileEntityMobSpawner || i == 2 && tileentity instanceof TileEntityCommandBlock || i == 3 && tileentity instanceof TileEntityBeacon || i == 4 && tileentity instanceof TileEntitySkull || i == 5 && tileentity instanceof TileEntityFlowerPot || i == 6 && tileentity instanceof TileEntityBanner)
        {
            tileentity.readFromNBT(packetIn.getNbtCompound());
        }
    }
}
项目:BaseClient    文件:NetHandlerPlayClient.java   
/**
 * Updates the NBTTagCompound metadata of instances of the following entitytypes: Mob spawners, command blocks,
 * beacons, skulls, flowerpot
 */
public void handleUpdateTileEntity(S35PacketUpdateTileEntity packetIn)
{
    PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);

    if (this.gameController.theWorld.isBlockLoaded(packetIn.getPos()))
    {
        TileEntity tileentity = this.gameController.theWorld.getTileEntity(packetIn.getPos());
        int i = packetIn.getTileEntityType();

        if (i == 1 && tileentity instanceof TileEntityMobSpawner || i == 2 && tileentity instanceof TileEntityCommandBlock || i == 3 && tileentity instanceof TileEntityBeacon || i == 4 && tileentity instanceof TileEntitySkull || i == 5 && tileentity instanceof TileEntityFlowerPot || i == 6 && tileentity instanceof TileEntityBanner)
        {
            tileentity.readFromNBT(packetIn.getNbtCompound());
        }
    }
}
项目:BaseClient    文件:NetHandlerPlayClient.java   
/**
 * Updates the NBTTagCompound metadata of instances of the following
 * entitytypes: Mob spawners, command blocks, beacons, skulls, flowerpot
 */
public void handleUpdateTileEntity(S35PacketUpdateTileEntity packetIn) {
    PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);

    if (this.gameController.theWorld.isBlockLoaded(packetIn.getPos())) {
        TileEntity tileentity = this.gameController.theWorld.getTileEntity(packetIn.getPos());
        int i = packetIn.getTileEntityType();

        if (i == 1 && tileentity instanceof TileEntityMobSpawner
                || i == 2 && tileentity instanceof TileEntityCommandBlock
                || i == 3 && tileentity instanceof TileEntityBeacon
                || i == 4 && tileentity instanceof TileEntitySkull
                || i == 5 && tileentity instanceof TileEntityFlowerPot
                || i == 6 && tileentity instanceof TileEntityBanner) {
            tileentity.readFromNBT(packetIn.getNbtCompound());
        }
    }
}
项目:ExtraUtilities    文件:TileEntityGenerator.java   
@SideOnly(Side.CLIENT)
public void onDataPacket(final NetworkManager net, final S35PacketUpdateTileEntity pkt) {
    if (!this.worldObj.isRemote) {
        return;
    }
    final NBTTagCompound tags = pkt.func_148857_g();
    if (tags.hasKey("d")) {
        if (tags.getByte("d") != this.rotation) {
            this.worldObj.markBlockForUpdate(this.x(), this.y(), this.z());
        }
        this.rotation = tags.getByte("d");
    }
    if (tags.hasKey("s")) {
        this.playSound = tags.getBoolean("s");
        Sounds.refresh();
    }
}
项目:Steam-and-Steel    文件:TileGlassFluidTank.java   
@Override
public Packet getDescriptionPacket()
{
    NBTTagCompound tag = new NBTTagCompound();
    writeToNBT(tag);
    return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord, this.blockMetadata, tag);
}
项目:DecompiledMinecraft    文件:TileEntityBanner.java   
/**
 * Allows for a specialized description packet to be created. This is often used to sync tile entity data from the
 * server to the client easily. For example this is used by signs to synchronise the text to be displayed.
 */
public Packet getDescriptionPacket()
{
    NBTTagCompound nbttagcompound = new NBTTagCompound();
    this.writeToNBT(nbttagcompound);
    return new S35PacketUpdateTileEntity(this.pos, 6, nbttagcompound);
}
项目:DecompiledMinecraft    文件:TileEntityMobSpawner.java   
/**
 * Allows for a specialized description packet to be created. This is often used to sync tile entity data from the
 * server to the client easily. For example this is used by signs to synchronise the text to be displayed.
 */
public Packet getDescriptionPacket()
{
    NBTTagCompound nbttagcompound = new NBTTagCompound();
    this.writeToNBT(nbttagcompound);
    nbttagcompound.removeTag("SpawnPotentials");
    return new S35PacketUpdateTileEntity(this.pos, 1, nbttagcompound);
}
项目:DecompiledMinecraft    文件:TileEntityFlowerPot.java   
/**
 * Allows for a specialized description packet to be created. This is often used to sync tile entity data from the
 * server to the client easily. For example this is used by signs to synchronise the text to be displayed.
 */
public Packet getDescriptionPacket()
{
    NBTTagCompound nbttagcompound = new NBTTagCompound();
    this.writeToNBT(nbttagcompound);
    nbttagcompound.removeTag("Item");
    nbttagcompound.setInteger("Item", Item.getIdFromItem(this.flowerPotItem));
    return new S35PacketUpdateTileEntity(this.pos, 5, nbttagcompound);
}
项目:DecompiledMinecraft    文件:TileEntityCommandBlock.java   
/**
 * Allows for a specialized description packet to be created. This is often used to sync tile entity data from the
 * server to the client easily. For example this is used by signs to synchronise the text to be displayed.
 */
public Packet getDescriptionPacket()
{
    NBTTagCompound nbttagcompound = new NBTTagCompound();
    this.writeToNBT(nbttagcompound);
    return new S35PacketUpdateTileEntity(this.pos, 2, nbttagcompound);
}
项目:DecompiledMinecraft    文件:TileEntitySkull.java   
/**
 * Allows for a specialized description packet to be created. This is often used to sync tile entity data from the
 * server to the client easily. For example this is used by signs to synchronise the text to be displayed.
 */
public Packet getDescriptionPacket()
{
    NBTTagCompound nbttagcompound = new NBTTagCompound();
    this.writeToNBT(nbttagcompound);
    return new S35PacketUpdateTileEntity(this.pos, 4, nbttagcompound);
}
项目:DecompiledMinecraft    文件:TileEntityBeacon.java   
/**
 * Allows for a specialized description packet to be created. This is often used to sync tile entity data from the
 * server to the client easily. For example this is used by signs to synchronise the text to be displayed.
 */
public Packet getDescriptionPacket()
{
    NBTTagCompound nbttagcompound = new NBTTagCompound();
    this.writeToNBT(nbttagcompound);
    return new S35PacketUpdateTileEntity(this.pos, 3, nbttagcompound);
}
项目:DecompiledMinecraft    文件:TileEntityBanner.java   
/**
 * Allows for a specialized description packet to be created. This is often used to sync tile entity data from the
 * server to the client easily. For example this is used by signs to synchronise the text to be displayed.
 */
public Packet getDescriptionPacket()
{
    NBTTagCompound nbttagcompound = new NBTTagCompound();
    this.writeToNBT(nbttagcompound);
    return new S35PacketUpdateTileEntity(this.pos, 6, nbttagcompound);
}
项目:DecompiledMinecraft    文件:TileEntityMobSpawner.java   
/**
 * Allows for a specialized description packet to be created. This is often used to sync tile entity data from the
 * server to the client easily. For example this is used by signs to synchronise the text to be displayed.
 */
public Packet getDescriptionPacket()
{
    NBTTagCompound nbttagcompound = new NBTTagCompound();
    this.writeToNBT(nbttagcompound);
    nbttagcompound.removeTag("SpawnPotentials");
    return new S35PacketUpdateTileEntity(this.pos, 1, nbttagcompound);
}
项目:DecompiledMinecraft    文件:TileEntityFlowerPot.java   
/**
 * Allows for a specialized description packet to be created. This is often used to sync tile entity data from the
 * server to the client easily. For example this is used by signs to synchronise the text to be displayed.
 */
public Packet getDescriptionPacket()
{
    NBTTagCompound nbttagcompound = new NBTTagCompound();
    this.writeToNBT(nbttagcompound);
    nbttagcompound.removeTag("Item");
    nbttagcompound.setInteger("Item", Item.getIdFromItem(this.flowerPotItem));
    return new S35PacketUpdateTileEntity(this.pos, 5, nbttagcompound);
}
项目:DecompiledMinecraft    文件:TileEntityCommandBlock.java   
/**
 * Allows for a specialized description packet to be created. This is often used to sync tile entity data from the
 * server to the client easily. For example this is used by signs to synchronise the text to be displayed.
 */
public Packet getDescriptionPacket()
{
    NBTTagCompound nbttagcompound = new NBTTagCompound();
    this.writeToNBT(nbttagcompound);
    return new S35PacketUpdateTileEntity(this.pos, 2, nbttagcompound);
}
项目:DecompiledMinecraft    文件:TileEntitySkull.java   
/**
 * Allows for a specialized description packet to be created. This is often used to sync tile entity data from the
 * server to the client easily. For example this is used by signs to synchronise the text to be displayed.
 */
public Packet getDescriptionPacket()
{
    NBTTagCompound nbttagcompound = new NBTTagCompound();
    this.writeToNBT(nbttagcompound);
    return new S35PacketUpdateTileEntity(this.pos, 4, nbttagcompound);
}
项目:DecompiledMinecraft    文件:TileEntityBeacon.java   
/**
 * Allows for a specialized description packet to be created. This is often used to sync tile entity data from the
 * server to the client easily. For example this is used by signs to synchronise the text to be displayed.
 */
public Packet getDescriptionPacket()
{
    NBTTagCompound nbttagcompound = new NBTTagCompound();
    this.writeToNBT(nbttagcompound);
    return new S35PacketUpdateTileEntity(this.pos, 3, nbttagcompound);
}
项目:FundamentalChemistry    文件:TileChemicalStorage.java   
@Override
public Packet getDescriptionPacket() 
{
  NBTTagCompound tag = new NBTTagCompound();
  writeToNBT(tag);
  return new S35PacketUpdateTileEntity(this.pos, 1, tag);
}
项目:FundamentalChemistry    文件:TileLaserRelay.java   
@Override
public Packet getDescriptionPacket() 
{
  NBTTagCompound tag = new NBTTagCompound();
  writeToNBT(tag);
  return new S35PacketUpdateTileEntity(this.pos, 1, tag);
}
项目:BaseClient    文件:TileEntityBanner.java   
/**
 * Allows for a specialized description packet to be created. This is often used to sync tile entity data from the
 * server to the client easily. For example this is used by signs to synchronise the text to be displayed.
 */
public Packet getDescriptionPacket()
{
    NBTTagCompound nbttagcompound = new NBTTagCompound();
    this.writeToNBT(nbttagcompound);
    return new S35PacketUpdateTileEntity(this.pos, 6, nbttagcompound);
}
项目:BaseClient    文件:TileEntityMobSpawner.java   
/**
 * Allows for a specialized description packet to be created. This is often used to sync tile entity data from the
 * server to the client easily. For example this is used by signs to synchronise the text to be displayed.
 */
public Packet getDescriptionPacket()
{
    NBTTagCompound nbttagcompound = new NBTTagCompound();
    this.writeToNBT(nbttagcompound);
    nbttagcompound.removeTag("SpawnPotentials");
    return new S35PacketUpdateTileEntity(this.pos, 1, nbttagcompound);
}
项目:BaseClient    文件:TileEntityFlowerPot.java   
/**
 * Allows for a specialized description packet to be created. This is often used to sync tile entity data from the
 * server to the client easily. For example this is used by signs to synchronise the text to be displayed.
 */
public Packet getDescriptionPacket()
{
    NBTTagCompound nbttagcompound = new NBTTagCompound();
    this.writeToNBT(nbttagcompound);
    nbttagcompound.removeTag("Item");
    nbttagcompound.setInteger("Item", Item.getIdFromItem(this.flowerPotItem));
    return new S35PacketUpdateTileEntity(this.pos, 5, nbttagcompound);
}
项目:BaseClient    文件:TileEntityCommandBlock.java   
/**
 * Allows for a specialized description packet to be created. This is often used to sync tile entity data from the
 * server to the client easily. For example this is used by signs to synchronise the text to be displayed.
 */
public Packet getDescriptionPacket()
{
    NBTTagCompound nbttagcompound = new NBTTagCompound();
    this.writeToNBT(nbttagcompound);
    return new S35PacketUpdateTileEntity(this.pos, 2, nbttagcompound);
}
项目:BaseClient    文件:TileEntitySkull.java   
/**
 * Allows for a specialized description packet to be created. This is often used to sync tile entity data from the
 * server to the client easily. For example this is used by signs to synchronise the text to be displayed.
 */
public Packet getDescriptionPacket()
{
    NBTTagCompound nbttagcompound = new NBTTagCompound();
    this.writeToNBT(nbttagcompound);
    return new S35PacketUpdateTileEntity(this.pos, 4, nbttagcompound);
}
项目:BaseClient    文件:TileEntityBeacon.java   
/**
 * Allows for a specialized description packet to be created. This is often used to sync tile entity data from the
 * server to the client easily. For example this is used by signs to synchronise the text to be displayed.
 */
public Packet getDescriptionPacket()
{
    NBTTagCompound nbttagcompound = new NBTTagCompound();
    this.writeToNBT(nbttagcompound);
    return new S35PacketUpdateTileEntity(this.pos, 3, nbttagcompound);
}
项目:BaseClient    文件:TileEntityBanner.java   
/**
 * Allows for a specialized description packet to be created. This is often used to sync tile entity data from the
 * server to the client easily. For example this is used by signs to synchronise the text to be displayed.
 */
public Packet getDescriptionPacket()
{
    NBTTagCompound nbttagcompound = new NBTTagCompound();
    this.writeToNBT(nbttagcompound);
    return new S35PacketUpdateTileEntity(this.pos, 6, nbttagcompound);
}
项目:BaseClient    文件:TileEntityMobSpawner.java   
/**
 * Allows for a specialized description packet to be created. This is often used to sync tile entity data from the
 * server to the client easily. For example this is used by signs to synchronise the text to be displayed.
 */
public Packet getDescriptionPacket()
{
    NBTTagCompound nbttagcompound = new NBTTagCompound();
    this.writeToNBT(nbttagcompound);
    nbttagcompound.removeTag("SpawnPotentials");
    return new S35PacketUpdateTileEntity(this.pos, 1, nbttagcompound);
}
项目:BaseClient    文件:TileEntityFlowerPot.java   
/**
 * Allows for a specialized description packet to be created. This is often used to sync tile entity data from the
 * server to the client easily. For example this is used by signs to synchronise the text to be displayed.
 */
public Packet getDescriptionPacket()
{
    NBTTagCompound nbttagcompound = new NBTTagCompound();
    this.writeToNBT(nbttagcompound);
    nbttagcompound.removeTag("Item");
    nbttagcompound.setInteger("Item", Item.getIdFromItem(this.flowerPotItem));
    return new S35PacketUpdateTileEntity(this.pos, 5, nbttagcompound);
}
项目:BaseClient    文件:TileEntityCommandBlock.java   
/**
 * Allows for a specialized description packet to be created. This is often used to sync tile entity data from the
 * server to the client easily. For example this is used by signs to synchronise the text to be displayed.
 */
public Packet getDescriptionPacket()
{
    NBTTagCompound nbttagcompound = new NBTTagCompound();
    this.writeToNBT(nbttagcompound);
    return new S35PacketUpdateTileEntity(this.pos, 2, nbttagcompound);
}
项目:BaseClient    文件:TileEntitySkull.java   
/**
 * Allows for a specialized description packet to be created. This is often used to sync tile entity data from the
 * server to the client easily. For example this is used by signs to synchronise the text to be displayed.
 */
public Packet getDescriptionPacket()
{
    NBTTagCompound nbttagcompound = new NBTTagCompound();
    this.writeToNBT(nbttagcompound);
    return new S35PacketUpdateTileEntity(this.pos, 4, nbttagcompound);
}
项目:BaseClient    文件:TileEntityBeacon.java   
/**
 * Allows for a specialized description packet to be created. This is often used to sync tile entity data from the
 * server to the client easily. For example this is used by signs to synchronise the text to be displayed.
 */
public Packet getDescriptionPacket()
{
    NBTTagCompound nbttagcompound = new NBTTagCompound();
    this.writeToNBT(nbttagcompound);
    return new S35PacketUpdateTileEntity(this.pos, 3, nbttagcompound);
}
项目:TFCPrimitiveTech    文件:TileEntityWoodenPressWet.java   
@Override
public Packet getDescriptionPacket()
{
    NBTTagCompound nbt = new NBTTagCompound();
    writeToNBT(nbt);
    return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord, 1, nbt);
}
项目:ExtraUtilities    文件:TileEntityBlockColorData.java   
@SideOnly(Side.CLIENT)
public void onDataPacket(final NetworkManager net, final S35PacketUpdateTileEntity pkt) {
    this.readFromNBT(pkt.func_148857_g());
    if (this.worldObj.isRemote && this.rerenderTimer == 0) {
        this.worldObj.markBlockRangeForRenderUpdate(this.xCoord, 0, this.zCoord, this.xCoord + 16, 255, this.zCoord + 16);
        this.rerenderTimer = this.rerenderDelay;
        this.rerenderDelay *= (int)1.1;
    }
}
项目:ExtraUtilities    文件:TileEnderCollector.java   
public Packet getDescriptionPacket() {
    final NBTTagCompound t = new NBTTagCompound();
    if (this.filter != null) {
        t.setTag("Filter", (NBTBase)this.filter.writeToNBT(new NBTTagCompound()));
    }
    return (Packet)new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord, 4, t);
}
项目:ExtraUtilities    文件:TileEnderCollector.java   
public void onDataPacket(final NetworkManager net, final S35PacketUpdateTileEntity pkt) {
    super.onDataPacket(net, pkt);
    final NBTTagCompound tag = pkt.func_148857_g();
    if (tag.hasKey("Filter")) {
        this.filter = ItemStack.loadItemStackFromNBT(tag.getCompoundTag("Filter"));
    }
    else {
        this.filter = null;
    }
}
项目:ExtraUtilities    文件:TileEntityDrum.java   
@SideOnly(Side.CLIENT)
public void onDataPacket(final NetworkManager net, final S35PacketUpdateTileEntity pkt) {
    if (!this.worldObj.isRemote) {
        return;
    }
    this.loadDrumFromNBT(pkt.func_148857_g());
    this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord);
}
项目:ExtraUtilities    文件:TileEntityTransferNode.java   
@SideOnly(Side.CLIENT)
public void onDataPacket(final NetworkManager net, final S35PacketUpdateTileEntity pkt) {
    if (!this.worldObj.isRemote) {
        return;
    }
    if (pkt.func_148857_g().hasKey("d")) {
        if (pkt.func_148857_g().getByte("d") != this.pipe_type) {
            this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord);
        }
        this.pipe_type = pkt.func_148857_g().getByte("d");
    }
}
项目:ExtraUtilities    文件:TileEntityBUD.java   
@SideOnly(Side.CLIENT)
public void onDataPacket(final NetworkManager net, final S35PacketUpdateTileEntity pkt) {
    if (this.worldObj.isRemote) {
        if (pkt.func_148857_g().hasKey("powered")) {
            this.powered = pkt.func_148857_g().getBoolean("powered");
            this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord);
        }
    }
}
项目:ExtraUtilities    文件:TileEntityGenerator.java   
public Packet getDescriptionPacket() {
    final NBTTagCompound t = new NBTTagCompound();
    t.setByte("d", this.rotation);
    t.setBoolean("s", this.coolDown > 0.0);
    this.playSound = (this.coolDown > 0.0);
    return (Packet)new S35PacketUpdateTileEntity(this.x(), this.y(), this.z(), 4, t);
}
项目:MidgarCrusade    文件:TileEntityBookcase.java   
@Override
public Packet getDescriptionPacket()
{
    NBTTagCompound tag = new NBTTagCompound();
    writeToNBT(tag);
    return new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, 1, tag);
}