當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。