当前位置: 首页>>代码示例>>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;未经允许,请勿转载。