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


Java NBTTagCompound.hasUniqueId方法代碼示例

本文整理匯總了Java中net.minecraft.nbt.NBTTagCompound.hasUniqueId方法的典型用法代碼示例。如果您正苦於以下問題:Java NBTTagCompound.hasUniqueId方法的具體用法?Java NBTTagCompound.hasUniqueId怎麽用?Java NBTTagCompound.hasUniqueId使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在net.minecraft.nbt.NBTTagCompound的用法示例。


在下文中一共展示了NBTTagCompound.hasUniqueId方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: readEntityFromNBT

import net.minecraft.nbt.NBTTagCompound; //導入方法依賴的package包/類
@Override
public void readEntityFromNBT(NBTTagCompound tag) {
	super.readEntityFromNBT(tag);

	this.setEntTeam(tag.getByte("Team"));
	this.setLevel(tag.getByte("Level"));
	this.setProgress(tag.getByte("Progress"));
	this.dataManager.set(CONSTRUCTING, (int)tag.getShort("Construction"));
	this.wrenchBonusTime=tag.getByte("WrenchBonus");
	this.redeploy=tag.getBoolean("Redeploy");
	this.ticksNoOwner=tag.getByte("Ownerless");
	this.engMade=tag.getBoolean("EngMade");
	if (tag.getByte("Sapper") != 0)
		this.setSapped(this, ItemStack.EMPTY);
	
	if (tag.hasUniqueId("Owner")) {
		UUID ownerID = tag.getUniqueId("Owner");
		this.dataManager.set(OWNER_UUID, Optional.of(ownerID));
		this.ownerName = tag.getString("OwnerName");
		this.getOwner();
		this.enablePersistence();
	}
}
 
開發者ID:rafradek,項目名稱:Mods,代碼行數:24,代碼來源:EntityBuilding.java

示例2: readNBT

import net.minecraft.nbt.NBTTagCompound; //導入方法依賴的package包/類
@Override
void readNBT(NBTTagCompound compound) {
	if(compound.hasUniqueId("key")) {
		UUID key = compound.getUniqueId("key");
		if(world != null) {
			remove();
			this.key = key;
			add();
		} else this.key = key;
	}
}
 
開發者ID:ArekkuusuJerii,項目名稱:Solar,代碼行數:12,代碼來源:TileRelativeBase.java

示例3: readNBT

import net.minecraft.nbt.NBTTagCompound; //導入方法依賴的package包/類
@Override
public void readNBT(NBTTagCompound compound) {
	if(compound.hasUniqueId("key")) {
		setKey(compound.getUniqueId("key"));
	}
}
 
開發者ID:ArekkuusuJerii,項目名稱:Solar,代碼行數:7,代碼來源:TileQuantumBase.java

示例4: DragonFightManager

import net.minecraft.nbt.NBTTagCompound; //導入方法依賴的package包/類
public DragonFightManager(WorldServer worldIn, NBTTagCompound compound)
{
    this.world = worldIn;

    if (compound.hasKey("DragonKilled", 99))
    {
        if (compound.hasUniqueId("DragonUUID"))
        {
            this.dragonUniqueId = compound.getUniqueId("DragonUUID");
        }

        this.dragonKilled = compound.getBoolean("DragonKilled");
        this.previouslyKilled = compound.getBoolean("PreviouslyKilled");

        if (compound.getBoolean("IsRespawning"))
        {
            this.respawnState = DragonSpawnManager.START;
        }

        if (compound.hasKey("ExitPortalLocation", 10))
        {
            this.exitPortalLocation = NBTUtil.getPosFromTag(compound.getCompoundTag("ExitPortalLocation"));
        }
    }
    else
    {
        this.dragonKilled = true;
        this.previouslyKilled = true;
    }

    if (compound.hasKey("Gateways", 9))
    {
        NBTTagList nbttaglist = compound.getTagList("Gateways", 3);

        for (int i = 0; i < nbttaglist.tagCount(); ++i)
        {
            this.gateways.add(Integer.valueOf(nbttaglist.getIntAt(i)));
        }
    }
    else
    {
        this.gateways.addAll(ContiguousSet.<Integer>create(Range.<Integer>closedOpen(Integer.valueOf(0), Integer.valueOf(20)), DiscreteDomain.integers()));
        Collections.shuffle(this.gateways, new Random(worldIn.getSeed()));
    }

    this.portalPattern = FactoryBlockPattern.start().aisle(new String[] {"       ", "       ", "       ", "   #   ", "       ", "       ", "       "}).aisle(new String[] {"       ", "       ", "       ", "   #   ", "       ", "       ", "       "}).aisle(new String[] {"       ", "       ", "       ", "   #   ", "       ", "       ", "       "}).aisle(new String[] {"  ###  ", " #   # ", "#     #", "#  #  #", "#     #", " #   # ", "  ###  "}).aisle(new String[] {"       ", "  ###  ", " ##### ", " ##### ", " ##### ", "  ###  ", "       "}).where('#', BlockWorldState.hasState(BlockMatcher.forBlock(Blocks.BEDROCK))).build();
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:48,代碼來源:DragonFightManager.java

示例5: readEntityFromNBT

import net.minecraft.nbt.NBTTagCompound; //導入方法依賴的package包/類
@Override
public void readEntityFromNBT(NBTTagCompound tag) {
	super.readEntityFromNBT(tag);

	if(tag.hasKey("AmmoC"))
		this.ammoCount = tag.getIntArray("AmmoC");
	if(this.ammoCount.length == 0)
		this.ammoCount = new int[3];
	this.unlimitedAmmo = tag.getBoolean("UnlimitedAmmo");
	this.setEntTeam(tag.getByte("Team"));
	this.natural = tag.getBoolean("Natural");

	if (tag.getTag("Loadout") instanceof NBTTagList) {
		NBTTagList list = (NBTTagList) tag.getTag("Loadout");

		if(list != null){
			for (int i = 0; i < list.tagCount(); ++i) {
				NBTTagCompound nbttagcompound = list.getCompoundTagAt(i);
				int j = nbttagcompound.getByte("Slot");
				this.loadout.setStackInSlot(j, new ItemStack(nbttagcompound));
			}
		}
	}
	else
		this.loadout.deserializeNBT(tag.getCompoundTag("Loadout"));
	this.loadoutHeld.deserializeNBT(tag.getCompoundTag("LoadoutHeld"));
	this.refill.setStackInSlot(0, new ItemStack(tag.getCompoundTag("Refill")));
	
	if (tag.hasKey("Offers")) {
		this.tradeOffers = new MerchantRecipeList();
		this.tradeOffers.readRecipiesFromTags(tag.getCompoundTag("Offers"));
	}
	this.preferredSlot = tag.getByte("PSlot");
	this.switchSlot(tag.getByte("Slot"), true);
	if(tag.hasKey("FollowTrader")){
		this.followID=tag.getUniqueId("FollowTrader");
		this.traderFollowTicks=tag.getInteger("FollowTraderTicks");
	}
	
	if(!this.world.getGameRules().getBoolean("doTF2AI")) {
		this.tasks.taskEntries.clear();
		this.targetTasks.taskEntries.clear();
	}
	
	if (tag.hasUniqueId("Owner")) {
		UUID ownerID = tag.getUniqueId("Owner");
		this.dataManager.set(OWNER_UUID, Optional.of(ownerID));
		this.ownerName = tag.getString("OwnerName");
		this.getOwner();
		this.enablePersistence();
	}
}
 
開發者ID:rafradek,項目名稱:Mods,代碼行數:53,代碼來源:EntityTF2Character.java


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