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

项目:ExSartagine    文件:TileEntityCooker.java   
@Override
public SPacketUpdateTileEntity getUpdatePacket() {
    NBTTagCompound nbt = new NBTTagCompound();
    this.writeToNBT(nbt);

    return new SPacketUpdateTileEntity(getPos(), 0, nbt);
}
项目:ExSartagine    文件:TileEntityRange.java   
@Override
public SPacketUpdateTileEntity getUpdatePacket() {
    NBTTagCompound nbt = new NBTTagCompound();
    this.writeToNBT(nbt);

    return new SPacketUpdateTileEntity(getPos(), 0, nbt);
}
项目:CustomWorldGen    文件:EntityPlayerMP.java   
private void sendTileEntityUpdate(TileEntity p_147097_1_)
{
    if (p_147097_1_ != null)
    {
        SPacketUpdateTileEntity spacketupdatetileentity = p_147097_1_.getUpdatePacket();

        if (spacketupdatetileentity != null)
        {
            this.connection.sendPacket(spacketupdatetileentity);
        }
    }
}
项目:RunicArcana    文件:TileEntityChalkBase.java   
@Nullable
@Override
public SPacketUpdateTileEntity getUpdatePacket() {
    NBTTagCompound tagCom = new NBTTagCompound();
    this.writeUpdateTag(tagCom);
    return new SPacketUpdateTileEntity(pos, getBlockMetadata(),tagCom);
}
项目:GeneralLaymansAestheticSpyingScreen    文件:TileEntityGlassBase.java   
@Override
public void onDataPacket(NetworkManager net, SPacketUpdateTileEntity pkt)
{
    onChunkUnload();
    readFromNBT(pkt.getNbtCompound());
    onLoad();
}
项目:uniquecrops    文件:TileArtisia.java   
@Override
public void onDataPacket(NetworkManager net, SPacketUpdateTileEntity packet) {

    if (packet != null && packet.getNbtCompound() != null)
        readCustomNBT(packet.getNbtCompound());

    markBlockForRenderUpdate();
}
项目:MeeCreeps    文件:PortalTileEntity.java   
@Nullable
@Override
public SPacketUpdateTileEntity getUpdatePacket() {
    NBTTagCompound nbtTag = new NBTTagCompound();
    nbtTag.setInteger("timeout", timeout);
    nbtTag.setInteger("start", Config.portalTimeout - timeout);
    nbtTag.setByte("portalSide", (byte) portalSide.ordinal());
    return new SPacketUpdateTileEntity(getPos(), 1, nbtTag);
}
项目:Backmemed    文件:EntityPlayerMP.java   
private void sendTileEntityUpdate(TileEntity p_147097_1_)
{
    if (p_147097_1_ != null)
    {
        SPacketUpdateTileEntity spacketupdatetileentity = p_147097_1_.getUpdatePacket();

        if (spacketupdatetileentity != null)
        {
            this.connection.sendPacket(spacketupdatetileentity);
        }
    }
}
项目:ArcaneMagic    文件:TileEntityAnimaConjurer.java   
@Override
public SPacketUpdateTileEntity getUpdatePacket()
{
    NBTTagCompound nbtTag = new NBTTagCompound();
    this.writeToNBT(nbtTag);
    return new SPacketUpdateTileEntity(pos, 1, nbtTag);
}
项目:WirelessCharger    文件:TilePersonalCharger.java   
@Nullable
@Override
public SPacketUpdateTileEntity getUpdatePacket() {
    NBTTagCompound nbtTagCompound = new NBTTagCompound();
    this.writeToNBT(nbtTagCompound);
    return new SPacketUpdateTileEntity(getPos(), 1, nbtTagCompound);
}
项目:PurificatiMagicae    文件:TileCodeStorage.java   
@Override
@SideOnly(Side.CLIENT)
public void onDataPacket(NetworkManager net, SPacketUpdateTileEntity pkt)
{
    super.onDataPacket(net, pkt);
    setOpened(pkt.getNbtCompound().getBoolean("opened"));
}
项目:ProjectEon    文件:TileEntityBase.java   
@Nullable
@Override
public SPacketUpdateTileEntity getUpdatePacket() {
    NBTTagCompound network = getNetworkNBT(true);
    if(network == null) return null;

    return new SPacketUpdateTileEntity(pos, 0, network);
}
项目:Machines-and-Stuff    文件:GeneratorBase.java   
@Nullable
@Override
public SPacketUpdateTileEntity getUpdatePacket() {
    NBTTagCompound tag = new NBTTagCompound();
    writeToNBT(tag);
    return new SPacketUpdateTileEntity(getPos(), 0, tag);
}
项目:Machines-and-Stuff    文件:TileEntityMachineBase.java   
@Nullable
@Override
public SPacketUpdateTileEntity getUpdatePacket() {
    NBTTagCompound tag = new NBTTagCompound();
    writeToNBT(tag);
    return new SPacketUpdateTileEntity(getPos(), 0, tag);
}
项目:Machines-and-Stuff    文件:TileEntityAccumulator.java   
@Nullable
@Override
public SPacketUpdateTileEntity getUpdatePacket() {
    NBTTagCompound tag = new NBTTagCompound();
    writeToNBT(tag);
    return new SPacketUpdateTileEntity(getPos(), 0, tag);
}
项目:uniquecrops    文件:TileArtisia.java   
@Nullable
@Override
public SPacketUpdateTileEntity getUpdatePacket() {

    NBTTagCompound nbtTag = new NBTTagCompound();
    this.writeCustomNBT(nbtTag);

    return new SPacketUpdateTileEntity(getPos(), 1, nbtTag);
}
项目:BetterBeginningsReborn    文件:TileEntityBB.java   
@Override
   public SPacketUpdateTileEntity getUpdatePacket()
   {
NBTTagCompound tag = new NBTTagCompound();
writeToNBT(tag);
return new SPacketUpdateTileEntity(pos, 1, tag);
   }
项目:CustomWorldGen    文件:TileEntityCommandBlock.java   
@Nullable
public SPacketUpdateTileEntity getUpdatePacket()
{
    if (this.isSendToClient())
    {
        this.setSendToClient(false);
        NBTTagCompound nbttagcompound = this.writeToNBT(new NBTTagCompound());
        return new SPacketUpdateTileEntity(this.pos, 2, nbttagcompound);
    }
    else
    {
        return null;
    }
}
项目:CustomWorldGen    文件:NetHandlerPlayClient.java   
/**
 * Updates the NBTTagCompound metadata of instances of the following entitytypes: Mob spawners, command blocks,
 * beacons, skulls, flowerpot
 */
public void handleUpdateTileEntity(SPacketUpdateTileEntity 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();
        boolean flag = i == 2 && tileentity instanceof TileEntityCommandBlock;

        if (i == 1 && tileentity instanceof TileEntityMobSpawner || flag || i == 3 && tileentity instanceof TileEntityBeacon || i == 4 && tileentity instanceof TileEntitySkull || i == 5 && tileentity instanceof TileEntityFlowerPot || i == 6 && tileentity instanceof TileEntityBanner || i == 7 && tileentity instanceof TileEntityStructure || i == 8 && tileentity instanceof TileEntityEndGateway || i == 9 && tileentity instanceof TileEntitySign)
        {
            tileentity.readFromNBT(packetIn.getNbtCompound());
        }
        else
        {
            if(tileentity == null)
            {
                LOGGER.error("Received invalid update packet for null tile entity at {} with data: {}", packetIn.getPos(), packetIn.getNbtCompound());
                return;
            }
            tileentity.onDataPacket(netManager, packetIn);
        }

        if (flag && this.gameController.currentScreen instanceof GuiCommandBlock)
        {
            ((GuiCommandBlock)this.gameController.currentScreen).updateGui();
        }
    }
}
项目:Backmemed    文件:PlayerChunkMapEntry.java   
private void sendBlockEntity(@Nullable TileEntity be)
{
    if (be != null)
    {
        SPacketUpdateTileEntity spacketupdatetileentity = be.getUpdatePacket();

        if (spacketupdatetileentity != null)
        {
            this.sendPacket(spacketupdatetileentity);
        }
    }
}
项目:rezolve    文件:TileEntityBase.java   
@Override
  public SPacketUpdateTileEntity getUpdatePacket() {
NBTTagCompound tagCompound = new NBTTagCompound();
this.writeToNBT(tagCompound);
return new SPacketUpdateTileEntity(pos, 1, tagCompound);
  }
项目:rezolve    文件:TileEntityBase.java   
@Override
public void onDataPacket(NetworkManager net, SPacketUpdateTileEntity pkt) {
        this.readFromNBT(pkt.getNbtCompound());
}
项目:MineCamera    文件:TileEntityPictureFrame.java   
@Override
@Nullable
public SPacketUpdateTileEntity getUpdatePacket() {
    //System.out.println("update");
    return new SPacketUpdateTileEntity(this.pos, 1, this.getUpdateTag());
}
项目:ExPetrum    文件:TileFarmland.java   
@Override
public void onDataPacket(NetworkManager net, SPacketUpdateTileEntity pkt)
{
    this.deserializeNBT(pkt.getNbtCompound());
}
项目:morefurnaces    文件:TileEntityIronFurnace.java   
@Override
public SPacketUpdateTileEntity getUpdatePacket()
{
    return new SPacketUpdateTileEntity(pos, 0, getUpdateTag());
}
项目:pnc-repressurized    文件:TileEntityBase.java   
@Nullable
@Override
public SPacketUpdateTileEntity getUpdatePacket() {
    return new SPacketUpdateTileEntity(this.pos, getBlockMetadata(), getUpdateTag());
}
项目:pnc-repressurized    文件:TileEntityBase.java   
@Override
public void onDataPacket(NetworkManager net, SPacketUpdateTileEntity pkt) {
    super.onDataPacket(net, pkt);
    PacketDescription packet = new PacketDescription(pkt.getNbtCompound());
    packet.handleClientSide(packet, PneumaticCraftRepressurized.proxy.getPlayer());
}
项目:Firma    文件:FirmaOreTileEntity.java   
@Override
@Nullable
   public SPacketUpdateTileEntity getUpdatePacket()
   {
       return new SPacketUpdateTileEntity(this.pos, 0, this.getUpdateTag());
   }
项目:Firma    文件:AnvilTileEntity.java   
@Override
@Nullable
   public SPacketUpdateTileEntity getUpdatePacket()
   {
       return new SPacketUpdateTileEntity(this.pos, 0, this.getUpdateTag());
   }
项目:Backmemed    文件:TileEntityBanner.java   
@Nullable
public SPacketUpdateTileEntity getUpdatePacket()
{
    return new SPacketUpdateTileEntity(this.pos, 6, this.getUpdateTag());
}
项目:CraftingParadiseMod    文件:TileGeneric.java   
@Override
public SPacketUpdateTileEntity getUpdatePacket() {
    NBTTagCompound nbttagcompound = getUpdateTag();
    return new SPacketUpdateTileEntity(this.getPos(), -999, nbttagcompound);
}
项目:HeroUtils    文件:TileEntityCookieJar.java   
@Override
public void onDataPacket(NetworkManager net, SPacketUpdateTileEntity pkt) {
    NBTTagCompound tagCom = pkt.getNbtCompound();
    readUpdateTag(tagCom);
}
项目:Soot    文件:TileEntityEmberBurst.java   
@Nullable
@Override
public SPacketUpdateTileEntity getUpdatePacket() {
    return new SPacketUpdateTileEntity(getPos(), 0, getUpdateTag());
}
项目:Backmemed    文件:TileEntityShulkerBox.java   
@Nullable
public SPacketUpdateTileEntity getUpdatePacket()
{
    return new SPacketUpdateTileEntity(this.pos, 10, this.getUpdateTag());
}
项目:Soot    文件:TileEntityEmberFunnel.java   
@Nullable
@Override
public SPacketUpdateTileEntity getUpdatePacket() {
    return new SPacketUpdateTileEntity(getPos(), 0, getUpdateTag());
}
项目:Soot    文件:TileEntityEmberFunnel.java   
@Override
public void onDataPacket(NetworkManager net, SPacketUpdateTileEntity pkt) {
    readFromNBT(pkt.getNbtCompound());
}
项目:ExSartagine    文件:TileEntityCooker.java   
@Override
public void onDataPacket(NetworkManager net, SPacketUpdateTileEntity pkt) {
    this.readFromNBT(pkt.getNbtCompound());
}
项目:Meltery    文件:TileMeltery.java   
@SideOnly(Side.CLIENT)
@Override
public void onDataPacket(NetworkManager net, SPacketUpdateTileEntity packet) {
    this.readFromNBT(packet.getNbtCompound());
}
项目:CustomWorldGen    文件:TileEntityBeacon.java   
@Nullable
public SPacketUpdateTileEntity getUpdatePacket()
{
    return new SPacketUpdateTileEntity(this.pos, 3, this.getUpdateTag());
}
项目:CustomWorldGen    文件:TileEntityEndGateway.java   
@Nullable
public SPacketUpdateTileEntity getUpdatePacket()
{
    return new SPacketUpdateTileEntity(this.pos, 8, this.getUpdateTag());
}