Java 类net.minecraft.network.packet.Packet132TileEntityData 实例源码

项目:CcmBurialServicesInc    文件:GraveTE.java   
public Packet getDescriptionPacket()
{
    NBTTagCompound root = new NBTTagCompound();

    NBTTagList nbttaglist = root.getTagList("contents");
    for (ItemStack itemStack : contents)
    {
        nbttaglist.appendTag(itemStack == null ? new NBTTagCompound() : itemStack.writeToNBT(new NBTTagCompound()));
    }
    root.setTag("contents", nbttaglist);
    root.setString("username", username);
    root.setCompoundTag("holding", holding == null ? new NBTTagCompound() : holding.writeToNBT(new NBTTagCompound()));
    root.setString("text", BSConstants.TEXT_JOINER.join(text));
    root.setInteger("age", age);

    return new Packet132TileEntityData(xCoord, yCoord, zCoord, 15, root);
}
项目:Billund    文件:TileEntityBillund.java   
@Override
public void onDataPacket( INetworkManager net, Packet132TileEntityData packet )
{
    switch( packet.actionType )
    {
        case 0:
        {
            this.readFromNBT( packet.data );
worldObj.markBlockForUpdate( xCoord, yCoord, zCoord );
            break;
        }
        default:
        {
            break;
        }
    }
}
项目:RuneCraftery    文件:NetClientHandler.java   
public void func_72468_a(Packet132TileEntityData p_72468_1_) {
   if(this.field_72563_h.field_71441_e.func_72899_e(p_72468_1_.field_73334_a, p_72468_1_.field_73332_b, p_72468_1_.field_73333_c)) {
      TileEntity var2 = this.field_72563_h.field_71441_e.func_72796_p(p_72468_1_.field_73334_a, p_72468_1_.field_73332_b, p_72468_1_.field_73333_c);
      if(var2 != null) {
         if(p_72468_1_.field_73330_d == 1 && var2 instanceof TileEntityMobSpawner) {
            var2.func_70307_a(p_72468_1_.field_73331_e);
         } else if(p_72468_1_.field_73330_d == 2 && var2 instanceof TileEntityCommandBlock) {
            var2.func_70307_a(p_72468_1_.field_73331_e);
         } else if(p_72468_1_.field_73330_d == 3 && var2 instanceof TileEntityBeacon) {
            var2.func_70307_a(p_72468_1_.field_73331_e);
         } else if(p_72468_1_.field_73330_d == 4 && var2 instanceof TileEntitySkull) {
            var2.func_70307_a(p_72468_1_.field_73331_e);
         }
      }
   }

}
项目:Amitcraft    文件:TileEntityArmorStand.java   
@Override
public Packet getDescriptionPacket() {
    NBTTagCompound dataTag = new NBTTagCompound();
    NBTTagList itemList = new NBTTagList();
    for (int i = 0; i < this.inventory.length; i++) {
        ItemStack stack = this.inventory[i];
        if (stack != null) {
            NBTTagCompound tag = new NBTTagCompound();
            tag.setByte("Slot", (byte) i);
            stack.writeToNBT(tag);
            itemList.appendTag(tag);
        }
    }
    dataTag.setTag("AmitStandInventory", itemList);
    return new Packet132TileEntityData(this.xCoord, this.yCoord, this.zCoord, 1, dataTag);
}
项目:ExtraCells1    文件:TileEntityTerminalFluid.java   
public void onDataPacket(INetworkManager net, Packet132TileEntityData packet)
{
    super.onDataPacket(net, packet);
    readFromNBT(packet.data);

    NBTTagCompound fluids = packet.data.getCompoundTag("fluids");
    fluidsInNetwork = new ArrayList<SpecialFluidStack>();
    int[] fluidIDs = fluids.getIntArray("FluidIDs");
    for (int i = 0; i < fluidIDs.length; i++)
    {
        fluidsInNetwork.add(new SpecialFluidStack(fluidIDs[i], fluids.getLong("FluidAmount#" + i)));
    }

    NBTTagCompound craftableFluids = packet.data.getCompoundTag("craftablefluids");
    craftableFluidsInNetwork = new ArrayList<Fluid>();
    int[] craftableFluidIDs = craftableFluids.getIntArray("FluidIDs");
    for (int i = 0; i < craftableFluidIDs.length; i++)
    {
        craftableFluidsInNetwork.add(FluidRegistry.getFluid(craftableFluidIDs[i]));
    }
    currentFluid = FluidRegistry.getFluid(packet.data.getInteger("currentFluid"));
    powerStatus = packet.data.getBoolean("powered");
    networkReady = packet.data.getBoolean("ready");
    worldObj.updateAllLightTypes(xCoord, yCoord, zCoord);
}
项目:CcmBurialServicesInc    文件:GraveTE.java   
public void onDataPacket(INetworkManager net, Packet132TileEntityData pkt)
{
    NBTTagList nbttaglist = pkt.data.getTagList("contents");
    contents = new ItemStack[nbttaglist.tagCount()];
    for (int i = 0; i < nbttaglist.tagCount(); ++i)
    {
        contents[i] = ItemStack.loadItemStackFromNBT((NBTTagCompound) nbttaglist.tagAt(i));
    }
    username = pkt.data.getString("username");
    holding = ItemStack.loadItemStackFromNBT(pkt.data.getCompoundTag("holding"));
    text = pkt.data.getString("text").split("\n");
    age = pkt.data.getInteger("age");
}
项目:Runes-And-Silver    文件:TileEntityEskimoSpawner.java   
/**
 * Overriden in a sign to provide the text.
 */
public Packet getDescriptionPacket()
{
    NBTTagCompound nbttagcompound = new NBTTagCompound();
    this.writeToNBT(nbttagcompound);
    nbttagcompound.removeTag("SpawnPotentials");
    return new Packet132TileEntityData(this.xCoord, this.yCoord, this.zCoord, 1, nbttagcompound);
}
项目:Runes-And-Silver    文件:TileEntityEskimoSkeletonSpawner.java   
/**
 * Overriden in a sign to provide the text.
 */
public Packet getDescriptionPacket()
{
    NBTTagCompound nbttagcompound = new NBTTagCompound();
    this.writeToNBT(nbttagcompound);
    nbttagcompound.removeTag("SpawnPotentials");
    return new Packet132TileEntityData(this.xCoord, this.yCoord, this.zCoord, 1, nbttagcompound);
}
项目:Runes-And-Silver    文件:TileEntityForestWalkerSpawner.java   
/**
 * Overriden in a sign to provide the text.
 */
public Packet getDescriptionPacket()
{
    NBTTagCompound nbttagcompound = new NBTTagCompound();
    this.writeToNBT(nbttagcompound);
    nbttagcompound.removeTag("SpawnPotentials");
    return new Packet132TileEntityData(this.xCoord, this.yCoord, this.zCoord, 1, nbttagcompound);
}
项目:Billund    文件:TileEntityBillund.java   
@Override
public Packet getDescriptionPacket()
{
    NBTTagCompound nbttagcompound = new NBTTagCompound();
    this.writeToNBT( nbttagcompound );
    return new Packet132TileEntityData( this.xCoord, this.yCoord, this.zCoord, 0, nbttagcompound );
}
项目:AutoCrafter2000    文件:AutoCrafterTile.java   
@Override
public Packet getDescriptionPacket()
{
    Packet132TileEntityData packet = new Packet132TileEntityData(xCoord, yCoord, zCoord, 5, new NBTTagCompound());
    packet.data.setInteger("redstoneMode", redstoneMode);
    packet.data.setInteger("crafts", crafts);
    return packet;
}
项目:Package    文件:TileCore.java   
@Override
public void onDataPacket(INetworkManager manager, Packet132TileEntityData packet) {
    switch (packet.actionType) {
        case DATA_CLIENT:
            readFromNBT(packet.data);
            break;
        case DATA_POKE:
            onPoke();
            break;
        case DATA_DATA:
            onData(packet.data);
            break;
    }
}
项目:RuneCraftery    文件:NetClientHandler.java   
public void handleTileEntityData(Packet132TileEntityData par1Packet132TileEntityData)
{
    if (this.mc.theWorld.blockExists(par1Packet132TileEntityData.xPosition, par1Packet132TileEntityData.yPosition, par1Packet132TileEntityData.zPosition))
    {
        TileEntity tileentity = this.mc.theWorld.getBlockTileEntity(par1Packet132TileEntityData.xPosition, par1Packet132TileEntityData.yPosition, par1Packet132TileEntityData.zPosition);

        if (tileentity != null)
        {
            if (par1Packet132TileEntityData.actionType == 1 && tileentity instanceof TileEntityMobSpawner)
            {
                tileentity.readFromNBT(par1Packet132TileEntityData.data);
            }
            else if (par1Packet132TileEntityData.actionType == 2 && tileentity instanceof TileEntityCommandBlock)
            {
                tileentity.readFromNBT(par1Packet132TileEntityData.data);
            }
            else if (par1Packet132TileEntityData.actionType == 3 && tileentity instanceof TileEntityBeacon)
            {
                tileentity.readFromNBT(par1Packet132TileEntityData.data);
            }
            else if (par1Packet132TileEntityData.actionType == 4 && tileentity instanceof TileEntitySkull)
            {
                tileentity.readFromNBT(par1Packet132TileEntityData.data);
            }
            else
            {
                tileentity.onDataPacket(netManager,  par1Packet132TileEntityData);
            }
        }
    }
}
项目:RuneCraftery    文件:TileEntityMobSpawner.java   
/**
 * Overriden in a sign to provide the text.
 */
public Packet getDescriptionPacket()
{
    NBTTagCompound nbttagcompound = new NBTTagCompound();
    this.writeToNBT(nbttagcompound);
    nbttagcompound.removeTag("SpawnPotentials");
    return new Packet132TileEntityData(this.xCoord, this.yCoord, this.zCoord, 1, nbttagcompound);
}
项目:RuneCraftery    文件:TileEntityCommandBlock.java   
/**
 * Overriden in a sign to provide the text.
 */
public Packet getDescriptionPacket()
{
    NBTTagCompound nbttagcompound = new NBTTagCompound();
    this.writeToNBT(nbttagcompound);
    return new Packet132TileEntityData(this.xCoord, this.yCoord, this.zCoord, 2, nbttagcompound);
}
项目:RuneCraftery    文件:TileEntitySkull.java   
/**
 * Overriden in a sign to provide the text.
 */
public Packet getDescriptionPacket()
{
    NBTTagCompound nbttagcompound = new NBTTagCompound();
    this.writeToNBT(nbttagcompound);
    return new Packet132TileEntityData(this.xCoord, this.yCoord, this.zCoord, 4, nbttagcompound);
}
项目:RuneCraftery    文件:TileEntityBeacon.java   
/**
 * Overriden in a sign to provide the text.
 */
public Packet getDescriptionPacket()
{
    NBTTagCompound nbttagcompound = new NBTTagCompound();
    this.writeToNBT(nbttagcompound);
    return new Packet132TileEntityData(this.xCoord, this.yCoord, this.zCoord, 3, nbttagcompound);
}
项目:Magitech    文件:TileEntityMagiCrucible.java   
public Packet getDescriptionPacket() {
    NBTTagCompound nbt = new NBTTagCompound();
    if (magitank.getFluid() != null) {
        nbt.setInteger("Magi", magitank.getFluid().amount);
    }
    return new Packet132TileEntityData(xCoord, yCoord, zCoord, 0, nbt);
}
项目:AtomTech    文件:TileEntityCoalGenerator.java   
@Override
public Packet getDescriptionPacket()
{
    NBTTagCompound tag = new NBTTagCompound();
    this.writeToNBT(tag);
    return new Packet132TileEntityData(this.xCoord, this.yCoord, this.zCoord, 0, tag);
}
项目:AtomTech    文件:TileEntityLaptop.java   
@Override
public Packet getDescriptionPacket()
{
    NBTTagCompound tag = new NBTTagCompound();
    this.writeToNBT(tag);
    return new Packet132TileEntityData(this.xCoord, this.yCoord, this.zCoord, 0, tag);
}
项目:BetterNutritionMod    文件:NetClientHandler.java   
public void handleTileEntityData(Packet132TileEntityData par1Packet132TileEntityData)
{
    if (this.mc.theWorld.blockExists(par1Packet132TileEntityData.xPosition, par1Packet132TileEntityData.yPosition, par1Packet132TileEntityData.zPosition))
    {
        TileEntity tileentity = this.mc.theWorld.getBlockTileEntity(par1Packet132TileEntityData.xPosition, par1Packet132TileEntityData.yPosition, par1Packet132TileEntityData.zPosition);

        if (tileentity != null)
        {
            if (par1Packet132TileEntityData.actionType == 1 && tileentity instanceof TileEntityMobSpawner)
            {
                tileentity.readFromNBT(par1Packet132TileEntityData.data);
            }
            else if (par1Packet132TileEntityData.actionType == 2 && tileentity instanceof TileEntityCommandBlock)
            {
                tileentity.readFromNBT(par1Packet132TileEntityData.data);
            }
            else if (par1Packet132TileEntityData.actionType == 3 && tileentity instanceof TileEntityBeacon)
            {
                tileentity.readFromNBT(par1Packet132TileEntityData.data);
            }
            else if (par1Packet132TileEntityData.actionType == 4 && tileentity instanceof TileEntitySkull)
            {
                tileentity.readFromNBT(par1Packet132TileEntityData.data);
            }
            else
            {
                tileentity.onDataPacket(netManager,  par1Packet132TileEntityData);
            }
        }
    }
}
项目:BetterNutritionMod    文件:TileEntityMobSpawner.java   
/**
 * Overriden in a sign to provide the text.
 */
public Packet getDescriptionPacket()
{
    NBTTagCompound nbttagcompound = new NBTTagCompound();
    this.writeToNBT(nbttagcompound);
    nbttagcompound.removeTag("SpawnPotentials");
    return new Packet132TileEntityData(this.xCoord, this.yCoord, this.zCoord, 1, nbttagcompound);
}
项目:BetterNutritionMod    文件:TileEntityCommandBlock.java   
/**
 * Overriden in a sign to provide the text.
 */
public Packet getDescriptionPacket()
{
    NBTTagCompound nbttagcompound = new NBTTagCompound();
    this.writeToNBT(nbttagcompound);
    return new Packet132TileEntityData(this.xCoord, this.yCoord, this.zCoord, 2, nbttagcompound);
}
项目:BetterNutritionMod    文件:TileEntitySkull.java   
/**
 * Overriden in a sign to provide the text.
 */
public Packet getDescriptionPacket()
{
    NBTTagCompound nbttagcompound = new NBTTagCompound();
    this.writeToNBT(nbttagcompound);
    return new Packet132TileEntityData(this.xCoord, this.yCoord, this.zCoord, 4, nbttagcompound);
}
项目:BetterNutritionMod    文件:TileEntityBeacon.java   
/**
 * Overriden in a sign to provide the text.
 */
public Packet getDescriptionPacket()
{
    NBTTagCompound nbttagcompound = new NBTTagCompound();
    this.writeToNBT(nbttagcompound);
    return new Packet132TileEntityData(this.xCoord, this.yCoord, this.zCoord, 3, nbttagcompound);
}
项目:SimplePowerStorage    文件:TileEntityMachine.java   
@Override
public Packet getDescriptionPacket() {
    NBTTagCompound data = new NBTTagCompound();
    data.setInteger("rotation", getDirectionFacing().ordinal());
    data.setBoolean("working", isWorking());
    data.setInteger("tier", getTier());
    Packet132TileEntityData packet = new Packet132TileEntityData(xCoord, yCoord, zCoord, 0, data);
    return packet;
}
项目:deep-storage-tanks    文件:TileEntityDeepStorageTank.java   
@Override
public Packet getDescriptionPacket() {
    //sideLog(java.util.logging.Level.INFO, "getDescriptionPacket");
    Packet132TileEntityData packet = (Packet132TileEntityData) super.getDescriptionPacket();
    NBTTagCompound tag = packet != null ? packet.customParam1 : new NBTTagCompound();

    if (tank.containsValidLiquid()) {
        //sideLog(java.util.logging.Level.INFO, "Amount: " + ((Integer)tank.getLiquid().amount).toString());
        tag.setTag("tank", tank.getLiquid().writeToNBT(new NBTTagCompound()));
    }       

    return new Packet132TileEntityData(xCoord, yCoord, zCoord, 1, tag);
}
项目:endernet    文件:TileEntityEnderTransmitter.java   
@Override
public Packet getDescriptionPacket() {
    NBTTagCompound tagCompound = new NBTTagCompound();
    writeNBTProgress(tagCompound);
    writeNBTEnderData(tagCompound);
    tagCompound.setByte("c", (byte)clientRenderMessage);
    this.clientRenderMessage = 0;
    return new Packet132TileEntityData(xCoord, yCoord, zCoord, 0, tagCompound);
}
项目:endernet    文件:TileEntityEnderTransmitter.java   
@Override
public void onDataPacket(INetworkManager networkManager, Packet132TileEntityData packet) {
    switch((int)packet.data.getByte("c")) {
        case 1:
            this.spawnSuccessParticles();
            break;
    }
    this.setEnderNetIDClient(packet.data.getInteger("eid"));
    this.isReceiveable = packet.data.getBoolean("r");
    GuiScreen gui = FMLClientHandler.instance().getClient().currentScreen;
    if (gui != null && gui instanceof GuiEnderTransmitter) {
        GuiEnderTransmitter get = (GuiEnderTransmitter)gui;
        get.syncNBTFromClient(packet.data);
    }
}
项目:Fuelsmod    文件:TileMixingTable.java   
@Override
public Packet getDescriptionPacket() {

    NBTTagCompound nbtTag = new NBTTagCompound();
    nbtTag.setInteger("Progress", progress);
    return new Packet132TileEntityData(this.xCoord, this.yCoord, this.zCoord, 1, nbtTag);
}
项目:JLPModJam    文件:TileDreamLand.java   
@Override
public Packet getDescriptionPacket() {

    NBTTagCompound nbtTag = new NBTTagCompound();
    this.writeToNBT(nbtTag);
    return new Packet132TileEntityData(this.xCoord, this.yCoord, this.zCoord, 1, nbtTag);
}
项目:Agriculture    文件:BaseMachineTileEntity.java   
@Override
public Packet getDescriptionPacket()
{
    final NBTTagCompound tag = new NBTTagCompound();
    writeCustomNBT(tag);
    return new Packet132TileEntityData(xCoord, yCoord, zCoord, 1, tag);
}
项目:Agriculture    文件:TileEntityFrier.java   
@Override
public Packet getDescriptionPacket()
{
    final NBTTagCompound tag = new NBTTagCompound();
    writeCustomNBT(tag);
    return new Packet132TileEntityData(xCoord, yCoord, zCoord, 1, tag);
}
项目:Agriculture    文件:TileEntityBrewer.java   
@Override
public Packet getDescriptionPacket()
{
    final NBTTagCompound tag = new NBTTagCompound();
    writeCustomNBT(tag);
    return new Packet132TileEntityData(xCoord, yCoord, zCoord, 1, tag);
}
项目:Agriculture    文件:TileEntityIcebox.java   
@Override
public Packet getDescriptionPacket()
{
    final NBTTagCompound tag = new NBTTagCompound();
    writeCustomNBT(tag);
    return new Packet132TileEntityData(xCoord, yCoord, zCoord, 1, tag);
}
项目:Agriculture    文件:TileEntityOven.java   
@Override
public Packet getDescriptionPacket()
{
    final NBTTagCompound tag = new NBTTagCompound();
    writeCustomNBT(tag);
    return new Packet132TileEntityData(xCoord, yCoord, zCoord, 1, tag);
}
项目:Necromancy    文件:TileEntitySkullWall.java   
/**
 * Overriden in a sign to provide the text.
 */
@Override
public Packet getDescriptionPacket() {
    NBTTagCompound nbttagcompound = new NBTTagCompound();
    this.writeToNBT(nbttagcompound);
    return new Packet132TileEntityData(xCoord, yCoord, zCoord, 4, nbttagcompound);
}
项目:MinecraftSpaceAgency    文件:LaunchControlLogic.java   
@Override
public Packet getDescriptionPacket()
{
    NBTTagCompound tag = new NBTTagCompound();
    writeToNBT(tag);
    return new Packet132TileEntityData(xCoord, yCoord, zCoord, 1, tag);
}
项目:MinecraftSpaceAgency    文件:CommandCenterLogic.java   
@Override
public Packet getDescriptionPacket()
{
    NBTTagCompound tag = new NBTTagCompound();
    writeToNBT(tag);
    return new Packet132TileEntityData(xCoord, yCoord, zCoord, 1, tag);
}
项目:MinecraftSpaceAgency    文件:AssemblerLogic.java   
@Override
public Packet getDescriptionPacket()
{
    NBTTagCompound tag = new NBTTagCompound();
    writeToNBT(tag);
    return new Packet132TileEntityData(xCoord, yCoord, zCoord, 1, tag);
}