当前位置: 首页>>代码示例>>Java>>正文


Java S35PacketUpdateTileEntity类代码示例

本文整理汇总了Java中net.minecraft.network.play.server.S35PacketUpdateTileEntity的典型用法代码示例。如果您正苦于以下问题:Java S35PacketUpdateTileEntity类的具体用法?Java S35PacketUpdateTileEntity怎么用?Java S35PacketUpdateTileEntity使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


S35PacketUpdateTileEntity类属于net.minecraft.network.play.server包,在下文中一共展示了S35PacketUpdateTileEntity类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: handleUpdateTileEntity

import net.minecraft.network.play.server.S35PacketUpdateTileEntity; //导入依赖的package包/类
/**
 * 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());
        }
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:20,代码来源:NetHandlerPlayClient.java

示例2: handleUpdateTileEntity

import net.minecraft.network.play.server.S35PacketUpdateTileEntity; //导入依赖的package包/类
/**
 * 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());
		}
	}
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:22,代码来源:NetHandlerPlayClient.java

示例3: onDataPacket

import net.minecraft.network.play.server.S35PacketUpdateTileEntity; //导入依赖的package包/类
@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();
    }
}
 
开发者ID:sameer,项目名称:ExtraUtilities,代码行数:18,代码来源:TileEntityGenerator.java

示例4: getDescriptionPacket

import net.minecraft.network.play.server.S35PacketUpdateTileEntity; //导入依赖的package包/类
@Override
public Packet getDescriptionPacket()
{
	NBTTagCompound tag = new NBTTagCompound();
	writeToNBT(tag);
	return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord, this.blockMetadata, tag);
}
 
开发者ID:grand-mine-inc,项目名称:Steam-and-Steel,代码行数:8,代码来源:TileGlassFluidTank.java

示例5: getDescriptionPacket

import net.minecraft.network.play.server.S35PacketUpdateTileEntity; //导入依赖的package包/类
/**
 * 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);
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:11,代码来源:TileEntityBanner.java

示例6: getDescriptionPacket

import net.minecraft.network.play.server.S35PacketUpdateTileEntity; //导入依赖的package包/类
/**
 * 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);
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:12,代码来源:TileEntityMobSpawner.java

示例7: getDescriptionPacket

import net.minecraft.network.play.server.S35PacketUpdateTileEntity; //导入依赖的package包/类
/**
 * 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);
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:13,代码来源:TileEntityFlowerPot.java

示例8: getDescriptionPacket

import net.minecraft.network.play.server.S35PacketUpdateTileEntity; //导入依赖的package包/类
/**
 * 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);
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:11,代码来源:TileEntityCommandBlock.java

示例9: getDescriptionPacket

import net.minecraft.network.play.server.S35PacketUpdateTileEntity; //导入依赖的package包/类
/**
 * 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);
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:11,代码来源:TileEntitySkull.java

示例10: getDescriptionPacket

import net.minecraft.network.play.server.S35PacketUpdateTileEntity; //导入依赖的package包/类
/**
 * 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);
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:11,代码来源:TileEntityBeacon.java

示例11: getDescriptionPacket

import net.minecraft.network.play.server.S35PacketUpdateTileEntity; //导入依赖的package包/类
@Override
public Packet getDescriptionPacket() 
{
  NBTTagCompound tag = new NBTTagCompound();
  writeToNBT(tag);
  return new S35PacketUpdateTileEntity(this.pos, 1, tag);
}
 
开发者ID:ImagicTheCat,项目名称:FundamentalChemistry,代码行数:8,代码来源:TileChemicalStorage.java

示例12: getDescriptionPacket

import net.minecraft.network.play.server.S35PacketUpdateTileEntity; //导入依赖的package包/类
@Override
public Packet getDescriptionPacket()
{
    NBTTagCompound nbt = new NBTTagCompound();
    writeToNBT(nbt);
    return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord, 1, nbt);
}
 
开发者ID:Wahazar,项目名称:TFCPrimitiveTech,代码行数:8,代码来源:TileEntityWoodenPressWet.java

示例13: onDataPacket

import net.minecraft.network.play.server.S35PacketUpdateTileEntity; //导入依赖的package包/类
@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;
    }
}
 
开发者ID:sameer,项目名称:ExtraUtilities,代码行数:10,代码来源:TileEntityBlockColorData.java

示例14: getDescriptionPacket

import net.minecraft.network.play.server.S35PacketUpdateTileEntity; //导入依赖的package包/类
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);
}
 
开发者ID:sameer,项目名称:ExtraUtilities,代码行数:8,代码来源:TileEnderCollector.java

示例15: onDataPacket

import net.minecraft.network.play.server.S35PacketUpdateTileEntity; //导入依赖的package包/类
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;
    }
}
 
开发者ID:sameer,项目名称:ExtraUtilities,代码行数:11,代码来源:TileEnderCollector.java


注:本文中的net.minecraft.network.play.server.S35PacketUpdateTileEntity类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。