當前位置: 首頁>>代碼示例>>Java>>正文


Java SPacketUpdateTileEntity類代碼示例

本文整理匯總了Java中net.minecraft.network.play.server.SPacketUpdateTileEntity的典型用法代碼示例。如果您正苦於以下問題:Java SPacketUpdateTileEntity類的具體用法?Java SPacketUpdateTileEntity怎麽用?Java SPacketUpdateTileEntity使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


SPacketUpdateTileEntity類屬於net.minecraft.network.play.server包,在下文中一共展示了SPacketUpdateTileEntity類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getUpdatePacket

import net.minecraft.network.play.server.SPacketUpdateTileEntity; //導入依賴的package包/類
@Override
public SPacketUpdateTileEntity getUpdatePacket() {
	NBTTagCompound nbt = new NBTTagCompound();
	this.writeToNBT(nbt);

	return new SPacketUpdateTileEntity(getPos(), 0, nbt);
}
 
開發者ID:ArtixAllMighty,項目名稱:ExSartagine,代碼行數:8,代碼來源:TileEntityCooker.java

示例2: sendTileEntityUpdate

import net.minecraft.network.play.server.SPacketUpdateTileEntity; //導入依賴的package包/類
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);
        }
    }
}
 
開發者ID:F1r3w477,項目名稱:CustomWorldGen,代碼行數:13,代碼來源:EntityPlayerMP.java

示例3: getUpdatePacket

import net.minecraft.network.play.server.SPacketUpdateTileEntity; //導入依賴的package包/類
@Nullable
@Override
public SPacketUpdateTileEntity getUpdatePacket() {
    NBTTagCompound tagCom = new NBTTagCompound();
    this.writeUpdateTag(tagCom);
    return new SPacketUpdateTileEntity(pos, getBlockMetadata(),tagCom);
}
 
開發者ID:Drazuam,項目名稱:RunicArcana,代碼行數:8,代碼來源:TileEntityChalkBase.java

示例4: onDataPacket

import net.minecraft.network.play.server.SPacketUpdateTileEntity; //導入依賴的package包/類
@Override
public void onDataPacket(NetworkManager net, SPacketUpdateTileEntity pkt)
{
    onChunkUnload();
    readFromNBT(pkt.getNbtCompound());
    onLoad();
}
 
開發者ID:iChun,項目名稱:GeneralLaymansAestheticSpyingScreen,代碼行數:8,代碼來源:TileEntityGlassBase.java

示例5: onDataPacket

import net.minecraft.network.play.server.SPacketUpdateTileEntity; //導入依賴的package包/類
@Override
public void onDataPacket(NetworkManager net, SPacketUpdateTileEntity packet) {
	
	if (packet != null && packet.getNbtCompound() != null)
		readCustomNBT(packet.getNbtCompound());
	
	markBlockForRenderUpdate();
}
 
開發者ID:bafomdad,項目名稱:uniquecrops,代碼行數:9,代碼來源:TileArtisia.java

示例6: getUpdatePacket

import net.minecraft.network.play.server.SPacketUpdateTileEntity; //導入依賴的package包/類
@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);
}
 
開發者ID:McJty,項目名稱:MeeCreeps,代碼行數:10,代碼來源:PortalTileEntity.java

示例7: getUpdatePacket

import net.minecraft.network.play.server.SPacketUpdateTileEntity; //導入依賴的package包/類
@Override
public SPacketUpdateTileEntity getUpdatePacket()
{
	NBTTagCompound nbtTag = new NBTTagCompound();
	this.writeToNBT(nbtTag);
	return new SPacketUpdateTileEntity(pos, 1, nbtTag);
}
 
開發者ID:raphydaphy,項目名稱:ArcaneMagic,代碼行數:8,代碼來源:TileEntityAnimaConjurer.java

示例8: getUpdatePacket

import net.minecraft.network.play.server.SPacketUpdateTileEntity; //導入依賴的package包/類
@Nullable
@Override
public SPacketUpdateTileEntity getUpdatePacket() {
    NBTTagCompound nbtTagCompound = new NBTTagCompound();
    this.writeToNBT(nbtTagCompound);
    return new SPacketUpdateTileEntity(getPos(), 1, nbtTagCompound);
}
 
開發者ID:CreeperShift,項目名稱:WirelessCharger,代碼行數:8,代碼來源:TilePersonalCharger.java

示例9: onDataPacket

import net.minecraft.network.play.server.SPacketUpdateTileEntity; //導入依賴的package包/類
@Override
@SideOnly(Side.CLIENT)
public void onDataPacket(NetworkManager net, SPacketUpdateTileEntity pkt)
{
    super.onDataPacket(net, pkt);
    setOpened(pkt.getNbtCompound().getBoolean("opened"));
}
 
開發者ID:PearXTeam,項目名稱:PurificatiMagicae,代碼行數:8,代碼來源:TileCodeStorage.java

示例10: getUpdatePacket

import net.minecraft.network.play.server.SPacketUpdateTileEntity; //導入依賴的package包/類
@Nullable
@Override
public SPacketUpdateTileEntity getUpdatePacket() {
    NBTTagCompound network = getNetworkNBT(true);
    if(network == null) return null;

    return new SPacketUpdateTileEntity(pos, 0, network);
}
 
開發者ID:Guichaguri,項目名稱:ProjectEon,代碼行數:9,代碼來源:TileEntityBase.java

示例11: getUpdatePacket

import net.minecraft.network.play.server.SPacketUpdateTileEntity; //導入依賴的package包/類
@Nullable
@Override
public SPacketUpdateTileEntity getUpdatePacket() {
    NBTTagCompound tag = new NBTTagCompound();
    writeToNBT(tag);
    return new SPacketUpdateTileEntity(getPos(), 0, tag);
}
 
開發者ID:jaredlll08,項目名稱:Machines-and-Stuff,代碼行數:8,代碼來源:GeneratorBase.java

示例12: getUpdatePacket

import net.minecraft.network.play.server.SPacketUpdateTileEntity; //導入依賴的package包/類
@Nullable
@Override
public SPacketUpdateTileEntity getUpdatePacket() {
	
	NBTTagCompound nbtTag = new NBTTagCompound();
	this.writeCustomNBT(nbtTag);
	
	return new SPacketUpdateTileEntity(getPos(), 1, nbtTag);
}
 
開發者ID:bafomdad,項目名稱:uniquecrops,代碼行數:10,代碼來源:TileArtisia.java

示例13: getUpdatePacket

import net.minecraft.network.play.server.SPacketUpdateTileEntity; //導入依賴的package包/類
@Override
   public SPacketUpdateTileEntity getUpdatePacket()
   {
NBTTagCompound tag = new NBTTagCompound();
writeToNBT(tag);
return new SPacketUpdateTileEntity(pos, 1, tag);
   }
 
開發者ID:einsteinsci,項目名稱:BetterBeginningsReborn,代碼行數:8,代碼來源:TileEntityBB.java

示例14: getUpdatePacket

import net.minecraft.network.play.server.SPacketUpdateTileEntity; //導入依賴的package包/類
@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;
    }
}
 
開發者ID:F1r3w477,項目名稱:CustomWorldGen,代碼行數:15,代碼來源:TileEntityCommandBlock.java

示例15: handleUpdateTileEntity

import net.minecraft.network.play.server.SPacketUpdateTileEntity; //導入依賴的package包/類
/**
 * 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();
        }
    }
}
 
開發者ID:F1r3w477,項目名稱:CustomWorldGen,代碼行數:35,代碼來源:NetHandlerPlayClient.java


注:本文中的net.minecraft.network.play.server.SPacketUpdateTileEntity類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。