本文整理汇总了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);
}
}
示例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;
}
}
示例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");
}
示例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");
}
}
示例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;
}
}
示例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();
}
}
示例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");
}
示例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));
}
}
示例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;
}
}
示例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));
}
}
}
示例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");
}
示例12: RandoresItemData
import net.minecraft.nbt.NBTTagCompound; //导入方法依赖的package包/类
public RandoresItemData(NBTTagCompound compound) {
this(compound.getInteger("index"), compound.getUniqueId("id"));
}
示例13: deserializeNBT
import net.minecraft.nbt.NBTTagCompound; //导入方法依赖的package包/类
@Override
public void deserializeNBT(NBTTagCompound nbt)
{
uuid = nbt.getUniqueId("key");
}
示例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();
}
示例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");
}