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


Java NBTTagCompound.getUniqueId方法代碼示例

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


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

示例1: readEntityFromNBT

import net.minecraft.nbt.NBTTagCompound; //導入方法依賴的package包/類
@Override
protected void readEntityFromNBT(NBTTagCompound compound) {
	ticksExisted = compound.getInteger("Age");
	duration = compound.getInteger("Duration");
	waitTime = compound.getInteger("WaitTime");
	reapplicationDelay = compound.getInteger("ReapplicationDelay");
	durationOnUse = compound.getInteger("DurationOnUse");
	radiusOnUse = compound.getFloat("RadiusOnUse");
	radiusPerTick = compound.getFloat("RadiusPerTick");
	setRadius(compound.getFloat("Radius"));
	setColor(compound.getInteger("Color"));
	ownerUniqueId = compound.getUniqueId("OwnerUUID");

	ItemStack stack = new ItemStack(compound.getCompoundTag("Brew"));
	if (stack.isEmpty()) {
		this.setDead();
	} else {
		this.setBrew(stack);
	}
}
 
開發者ID:Um-Mitternacht,項目名稱:Bewitchment,代碼行數:21,代碼來源:EntityBrewLinger.java

示例2: readAttributeModifierFromNBT

import net.minecraft.nbt.NBTTagCompound; //導入方法依賴的package包/類
/**
 * Creates an AttributeModifier from an NBTTagCompound
 */
@Nullable
public static AttributeModifier readAttributeModifierFromNBT(NBTTagCompound compound)
{
    UUID uuid = compound.getUniqueId("UUID");

    try
    {
        return new AttributeModifier(uuid, compound.getString("Name"), compound.getDouble("Amount"), compound.getInteger("Operation"));
    }
    catch (Exception exception)
    {
        LOGGER.warn("Unable to create attribute: {}", new Object[] {exception.getMessage()});
        return null;
    }
}
 
開發者ID:F1r3w477,項目名稱:CustomWorldGen,代碼行數:19,代碼來源:SharedMonsterAttributes.java

示例3: readFromNBT

import net.minecraft.nbt.NBTTagCompound; //導入方法依賴的package包/類
@Override
public void readFromNBT(NBTTagCompound compound)
{
	super.readFromNBT(compound);
	stacks = new ItemStack[2];
	if (compound.hasKey("analyzingStack"))
	{
		setStack(0, new ItemStack(compound.getCompoundTag("analyzingStack")));
	}
	if (compound.hasKey("parchmentStack"))
	{
		setStack(1, new ItemStack(compound.getCompoundTag("parchmentStack")));
	}
	progress = compound.getInteger("age");

	if (compound.hasKey("stackOwner"))
	{
		stackOwner = compound.getUniqueId("stackOwner");
	}

	hasValidStack = compound.getBoolean("hasValidStack");
}
 
開發者ID:raphydaphy,項目名稱:ArcaneMagic,代碼行數:23,代碼來源:TileEntityAnalyzer.java

示例4: readFromNBT

import net.minecraft.nbt.NBTTagCompound; //導入方法依賴的package包/類
@Override
public void readFromNBT(NBTTagCompound compound) {
    super.readFromNBT(compound);
    storage.readFromNBT(compound);
    if (compound.hasKey("Player")) {
        playerUUID = compound.getUniqueId("Player");
    }
    if (compound.hasKey("items")) {
        itemStackHandler.deserializeNBT((NBTTagCompound) compound.getTag("items"));
    }
    if (compound.hasKey("redstone")) {
        hasRedstone = compound.getBoolean("redstone");
    }
    if (compound.hasKey("Name")) {
        playerName = compound.getString("Name");
    }
}
 
開發者ID:CreeperShift,項目名稱:WirelessCharger,代碼行數:18,代碼來源:TilePersonalCharger.java

示例5: readAttributeModifierFromNBT

import net.minecraft.nbt.NBTTagCompound; //導入方法依賴的package包/類
@Nullable

    /**
     * Creates an AttributeModifier from an NBTTagCompound
     */
    public static AttributeModifier readAttributeModifierFromNBT(NBTTagCompound compound)
    {
        UUID uuid = compound.getUniqueId("UUID");

        try
        {
            return new AttributeModifier(uuid, compound.getString("Name"), compound.getDouble("Amount"), compound.getInteger("Operation"));
        }
        catch (Exception exception)
        {
            LOGGER.warn("Unable to create attribute: {}", new Object[] {exception.getMessage()});
            return null;
        }
    }
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:20,代碼來源:SharedMonsterAttributes.java

示例6: 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

示例7: readEntityFromNBT

import net.minecraft.nbt.NBTTagCompound; //導入方法依賴的package包/類
@Override
public void readEntityFromNBT(NBTTagCompound compound) {
    super.readEntityFromNBT(compound);
    NBTTagCompound sub = compound.getCompoundTag("randores");
    this.id = sub.getUniqueId("id");
    this.index = sub.getInteger("index");
    this.hadEffect = sub.getBoolean("hadEffect");
    this.hasEffect = sub.getBoolean("hasEffect");
}
 
開發者ID:Randores,項目名稱:Randores2,代碼行數:10,代碼來源:RandoresArrow.java

示例8: readFromNBT

import net.minecraft.nbt.NBTTagCompound; //導入方法依賴的package包/類
@Override
public void readFromNBT(NBTTagCompound nbt) {
    this.seed = nbt.getLong("seed");
    this.id = nbt.getUniqueId("id");
    NBTTagCompound compound = nbt.getCompoundTag("pluginSeeds");
    this.pluginSeeds.clear();
    for(String key : compound.getKeySet()) {
        this.pluginSeeds.put(key, compound.getLong(key));
    }
}
 
開發者ID:Randores,項目名稱:Randores2,代碼行數:11,代碼來源:RandoresWorldData.java

示例9: 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

示例10: readFromNBT

import net.minecraft.nbt.NBTTagCompound; //導入方法依賴的package包/類
public void readFromNBT(NBTTagList listOfPlayers) {
	int howManyTimesToLoop = listOfPlayers.tagCount();
	for (int i = 0; i < howManyTimesToLoop; i++) {
		NBTTagCompound nbt = listOfPlayers.getCompoundTagAt(i);
		LocalDateTime enterTime = LocalDateTime.ofInstant(Instant.ofEpochMilli(nbt.getLong("enterTime")), ZoneId.systemDefault());
		UUID player = nbt.getUniqueId("PlayerUUID");
		if (nbt.getBoolean("HasLeft")) {
			LocalDateTime leaveTime = LocalDateTime.ofInstant(Instant.ofEpochMilli(nbt.getLong("LeaveTime")), ZoneId.systemDefault());
			Duration stayTime = Duration.ofMillis(nbt.getLong("StayTime"));
			playersInChunk.add(new PlayerInChunk(enterTime, leaveTime, stayTime, player));
		} else {
			playersInChunk.add(new PlayerInChunk(enterTime, player));
		}
	}
}
 
開發者ID:coehlrich,項目名稱:chunk-logger,代碼行數:16,代碼來源:ChunkListOfPlayers.java

示例11: ActionOptions

import net.minecraft.nbt.NBTTagCompound; //導入方法依賴的package包/類
public ActionOptions(NBTTagCompound tagCompound) {
    NBTTagList list = tagCompound.getTagList("options", Constants.NBT.TAG_STRING);
    actionOptions = new ArrayList<>();
    for (int i = 0 ; i < list.tagCount() ; i++) {
        actionOptions.add(new MeeCreepActionType(list.getStringTagAt(i)));
    }

    list = tagCompound.getTagList("maybe", Constants.NBT.TAG_STRING);
    maybeActionOptions = new ArrayList<>();
    for (int i = 0 ; i < list.tagCount() ; i++) {
        maybeActionOptions.add(new MeeCreepActionType(list.getStringTagAt(i)));
    }

    list = tagCompound.getTagList("drops", Constants.NBT.TAG_COMPOUND);
    drops = new ArrayList<>();
    for (int i = 0 ; i < list.tagCount() ; i++) {
        NBTTagCompound tc = list.getCompoundTagAt(i);
        BlockPos p = BlockPos.fromLong(tc.getLong("p"));
        NBTTagCompound itemTag = tc.getCompoundTag("i");
        ItemStack stack = new ItemStack(itemTag);
        drops.add(Pair.of(p, stack));
    }

    dimension = tagCompound.getInteger("dim");
    targetPos = BlockPos.fromLong(tagCompound.getLong("pos"));
    targetSide = EnumFacing.VALUES[tagCompound.getByte("targetSide")];
    if (tagCompound.hasKey("player")) {
        playerId = tagCompound.getUniqueId("player");
    } else {
        playerId = null;
    }
    actionId = tagCompound.getInteger("actionId");
    timeout = tagCompound.getInteger("timeout");
    stage = Stage.getByCode(tagCompound.getString("stage"));
    if (tagCompound.hasKey("task")) {
        task = new MeeCreepActionType(tagCompound.getString("task"));
    }
    if (tagCompound.hasKey("fqid")) {
        furtherQuestionId = tagCompound.getString("fqid");
    } else {
        furtherQuestionId = null;
    }
    paused = tagCompound.getBoolean("paused");
}
 
開發者ID:McJty,項目名稱:MeeCreeps,代碼行數:45,代碼來源:ActionOptions.java

示例12: RandoresItemData

import net.minecraft.nbt.NBTTagCompound; //導入方法依賴的package包/類
public RandoresItemData(NBTTagCompound compound) {
    this(compound.getInteger("index"), compound.getUniqueId("id"));
}
 
開發者ID:Randores,項目名稱:Randores2,代碼行數:4,代碼來源:RandoresItemData.java

示例13: deserializeNBT

import net.minecraft.nbt.NBTTagCompound; //導入方法依賴的package包/類
@Override
public void deserializeNBT(NBTTagCompound nbt)
{
    uuid = nbt.getUniqueId("key");
}
 
開發者ID:PearXTeam,項目名稱:PurificatiMagicae,代碼行數:6,代碼來源:AuraContainer.java

示例14: 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

示例15: readEntityFromNBT

import net.minecraft.nbt.NBTTagCompound; //導入方法依賴的package包/類
/**
 * (abstract) Protected helper method to read subclass entity data from NBT.
 */
protected void readEntityFromNBT(NBTTagCompound compound)
{
    this.field_190553_a = compound.getInteger("Warmup");
    this.field_190558_f = compound.getUniqueId("OwnerUUID");
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:9,代碼來源:EntityEvokerFangs.java


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