当前位置: 首页>>代码示例>>Java>>正文


Java NBTTagCompound.setUniqueId方法代码示例

本文整理汇总了Java中net.minecraft.nbt.NBTTagCompound.setUniqueId方法的典型用法代码示例。如果您正苦于以下问题:Java NBTTagCompound.setUniqueId方法的具体用法?Java NBTTagCompound.setUniqueId怎么用?Java NBTTagCompound.setUniqueId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.minecraft.nbt.NBTTagCompound的用法示例。


在下文中一共展示了NBTTagCompound.setUniqueId方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: writeEntityToNBT

import net.minecraft.nbt.NBTTagCompound; //导入方法依赖的package包/类
@Override
protected void writeEntityToNBT(NBTTagCompound compound) {
	compound.setInteger("Age", ticksExisted);
	compound.setInteger("Duration", duration);
	compound.setInteger("WaitTime", waitTime);
	compound.setInteger("ReapplicationDelay", reapplicationDelay);
	compound.setInteger("DurationOnUse", durationOnUse);
	compound.setFloat("RadiusOnUse", radiusOnUse);
	compound.setFloat("RadiusPerTick", radiusPerTick);
	compound.setFloat("Radius", getRadius());
	compound.setInteger("Color", getColor());

	ItemStack stack = getBrew();
	if (!stack.isEmpty()) {
		compound.setTag("Brew", stack.writeToNBT(new NBTTagCompound()));
	}

	if (ownerUniqueId != null) {
		compound.setUniqueId("OwnerUUID", ownerUniqueId);
	}
}
 
开发者ID:Um-Mitternacht,项目名称:Bewitchment,代码行数:22,代码来源:EntityBrewLinger.java

示例2: writeEntityToNBT

import net.minecraft.nbt.NBTTagCompound; //导入方法依赖的package包/类
/**
 * (abstract) Protected helper method to write subclass entity data to NBT.
 */
public void writeEntityToNBT(NBTTagCompound compound)
{
    super.writeEntityToNBT(compound);
    compound.setInteger("playerGameType", this.interactionManager.getGameType().getID());
    Entity entity = this.getLowestRidingEntity();

    if (this.getRidingEntity() != null && entity != this & entity.getRecursivePassengersByType(EntityPlayerMP.class).size() == 1)
    {
        NBTTagCompound nbttagcompound = new NBTTagCompound();
        NBTTagCompound nbttagcompound1 = new NBTTagCompound();
        entity.writeToNBTOptional(nbttagcompound1);
        nbttagcompound.setUniqueId("Attach", this.getRidingEntity().getUniqueID());
        nbttagcompound.setTag("Entity", nbttagcompound1);
        compound.setTag("RootVehicle", nbttagcompound);
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:20,代码来源:EntityPlayerMP.java

示例3: writeEntityToNBT

import net.minecraft.nbt.NBTTagCompound; //导入方法依赖的package包/类
/**
 * (abstract) Protected helper method to write subclass entity data to NBT.
 */
public void writeEntityToNBT(NBTTagCompound compound)
{
    super.writeEntityToNBT(compound);
    compound.setInteger("playerGameType", this.interactionManager.getGameType().getID());
    Entity entity = this.getLowestRidingEntity();
    Entity entity1 = this.getRidingEntity();

    if (entity1 != null && entity != this & entity.getRecursivePassengersByType(EntityPlayerMP.class).size() == 1)
    {
        NBTTagCompound nbttagcompound = new NBTTagCompound();
        NBTTagCompound nbttagcompound1 = new NBTTagCompound();
        entity.writeToNBTOptional(nbttagcompound1);
        nbttagcompound.setUniqueId("Attach", entity1.getUniqueID());
        nbttagcompound.setTag("Entity", nbttagcompound1);
        compound.setTag("RootVehicle", nbttagcompound);
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:21,代码来源:EntityPlayerMP.java

示例4: writeEntityToNBT

import net.minecraft.nbt.NBTTagCompound; //导入方法依赖的package包/类
@Override
public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) {
	super.writeEntityToNBT(par1NBTTagCompound);

	par1NBTTagCompound.setByte("Team", (byte) this.getEntTeam());
	par1NBTTagCompound.setByte("Level", (byte) this.getLevel());
	par1NBTTagCompound.setShort("Progress", (byte) this.getProgress());
	par1NBTTagCompound.setShort("Sapper", this.dataManager.get(SAPPED));
	par1NBTTagCompound.setShort("Construction", this.dataManager.get(CONSTRUCTING).shortValue());
	par1NBTTagCompound.setByte("WrenchBonus", (byte) this.wrenchBonusTime);
	par1NBTTagCompound.setBoolean("Redeploy", this.redeploy);
	par1NBTTagCompound.setBoolean("EngMade", this.engMade);
	par1NBTTagCompound.setByte("TicksOwnerless", (byte) this.ticksNoOwner);
	if (this.getOwnerId() != null) {
		par1NBTTagCompound.setUniqueId("Owner", this.getOwnerId());
		par1NBTTagCompound.setString("OwnerName", this.ownerName);
	}
	if (this.isDisabled())
       {
		par1NBTTagCompound.setBoolean("NoAI", false);
       }
}
 
开发者ID:rafradek,项目名称:Mods,代码行数:23,代码来源:EntityBuilding.java

示例5: addEntitiesToWorld

import net.minecraft.nbt.NBTTagCompound; //导入方法依赖的package包/类
private void addEntitiesToWorld(World worldIn, BlockPos pos, Mirror mirrorIn, Rotation rotationIn, @Nullable StructureBoundingBox aabb)
{
    for (Template.EntityInfo template$entityinfo : this.entities)
    {
        BlockPos blockpos = transformedBlockPos(template$entityinfo.blockPos, mirrorIn, rotationIn).add(pos);

        if (aabb == null || aabb.isVecInside(blockpos))
        {
            NBTTagCompound nbttagcompound = template$entityinfo.entityData;
            Vec3d vec3d = transformedVec3d(template$entityinfo.pos, mirrorIn, rotationIn);
            Vec3d vec3d1 = vec3d.addVector((double)pos.getX(), (double)pos.getY(), (double)pos.getZ());
            NBTTagList nbttaglist = new NBTTagList();
            nbttaglist.appendTag(new NBTTagDouble(vec3d1.x));
            nbttaglist.appendTag(new NBTTagDouble(vec3d1.y));
            nbttaglist.appendTag(new NBTTagDouble(vec3d1.z));
            nbttagcompound.setTag("Pos", nbttaglist);
            nbttagcompound.setUniqueId("UUID", UUID.randomUUID());
            Entity entity;

            try
            {
                entity = EntityList.createEntityFromNBT(nbttagcompound, worldIn);
            }
            catch (Exception var15)
            {
                entity = null;
            }

            if (entity != null)
            {
                float f = entity.getMirroredYaw(mirrorIn);
                f = f + (entity.rotationYaw - entity.getRotatedYaw(rotationIn));
                entity.setLocationAndAngles(vec3d1.x, vec3d1.y, vec3d1.z, f, entity.rotationPitch);
                worldIn.spawnEntity(entity);
            }
        }
    }
}
 
开发者ID:kenijey,项目名称:harshencastle,代码行数:39,代码来源:HarshenTemplate.java

示例6: writeEntityToNBT

import net.minecraft.nbt.NBTTagCompound; //导入方法依赖的package包/类
@Override
public void writeEntityToNBT(NBTTagCompound compound) {
    super.writeEntityToNBT(compound);
    if (destination != null) {
        compound.setTag("destination", destination.getCompound());
    }
    if (playerId != null) {
        compound.setUniqueId("playerId", playerId);
    }
}
 
开发者ID:McJty,项目名称:MeeCreeps,代码行数:11,代码来源:EntityProjectile.java

示例7: writeEntityToNBT

import net.minecraft.nbt.NBTTagCompound; //导入方法依赖的package包/类
@Override
public void writeEntityToNBT(NBTTagCompound compound) {
    super.writeEntityToNBT(compound);
    NBTTagCompound sub = new NBTTagCompound();
    sub.setUniqueId("id", this.id);
    sub.setInteger("index", this.index);
    sub.setBoolean("hadEffect", this.hadEffect);
    sub.setBoolean("hasEffect", this.hasEffect);
    compound.setTag("randores", sub);
}
 
开发者ID:Randores,项目名称:Randores2,代码行数:11,代码来源:RandoresArrow.java

示例8: writeToNBT

import net.minecraft.nbt.NBTTagCompound; //导入方法依赖的package包/类
@Override
public NBTTagCompound writeToNBT(NBTTagCompound compound) {
    super.writeToNBT(compound);
    storage.writeToNBT(compound);
    if (playerUUID != null) {
        compound.setUniqueId("Player", playerUUID);
    }
    if(playerName != null) {
        compound.setString("Name", playerName);
    }
    compound.setBoolean("redstone", hasRedstone);
    compound.setTag("items", itemStackHandler.serializeNBT());
    return compound;
}
 
开发者ID:CreeperShift,项目名称:WirelessCharger,代码行数:15,代码来源:TilePersonalCharger.java

示例9: serializeNBT

import net.minecraft.nbt.NBTTagCompound; //导入方法依赖的package包/类
@Override
public NBTTagCompound serializeNBT()
{
    NBTTagCompound tag = new NBTTagCompound();
    tag.setUniqueId("key", getKey());
    return tag;
}
 
开发者ID:PearXTeam,项目名称:PurificatiMagicae,代码行数:8,代码来源:AuraContainer.java

示例10: sendQuantumChange

import net.minecraft.nbt.NBTTagCompound; //导入方法依赖的package包/类
public static void sendQuantumChange(UUID uuid, ItemStack stack, int slot) {
	NBTTagCompound tag = new NBTTagCompound();
	tag.setTag("stack", stack.writeToNBT(new NBTTagCompound()));
	tag.setUniqueId("uuid", uuid);
	tag.setInteger("slot", slot);
	PacketHandler.NETWORK.sendToAll(new ServerToClientPacket(PacketHandler.Q_SYNC_CHANGE, tag));
}
 
开发者ID:ArekkuusuJerii,项目名称:Solar,代码行数:8,代码来源:PacketHelper.java

示例11: sendQuantumChanges

import net.minecraft.nbt.NBTTagCompound; //导入方法依赖的package包/类
public static void sendQuantumChanges(UUID uuid) {
	NBTTagCompound tag = new NBTTagCompound();
	NBTTagList list = new NBTTagList();
	QuantumHandler.getEntanglement(uuid).forEach(stack -> {
		list.appendTag(stack.writeToNBT(new NBTTagCompound()));
	});
	tag.setTag("list", list);
	tag.setUniqueId("uuid", uuid);
	PacketHandler.NETWORK.sendToAll(new ServerToClientPacket(PacketHandler.Q_SYNC_SOME, tag));
}
 
开发者ID:ArekkuusuJerii,项目名称:Solar,代码行数:11,代码来源:PacketHelper.java

示例12: writeEntityToNBT

import net.minecraft.nbt.NBTTagCompound; //导入方法依赖的package包/类
@Override
public void writeEntityToNBT(NBTTagCompound tag) {
	super.writeEntityToNBT(tag);
	tag.setIntArray("AmmoC", ammoCount);
	tag.setBoolean("UnlimitedAmmo", this.unlimitedAmmo);
	tag.setByte("Team", (byte) this.getEntTeam());
	tag.setBoolean("Natural", this.natural);
	/*NBTTagList list = new NBTTagList();

	for (int i = 0; i < this.loadout.getSlots(); i++) {
		ItemStack itemstack = this.loadout.getStackInSlot(i);

		if (!itemstack.isEmpty()) {
			NBTTagCompound nbttagcompound = new NBTTagCompound();
			nbttagcompound.setByte("Slot", (byte) i);
			itemstack.writeToNBT(nbttagcompound);
			list.appendTag(nbttagcompound);
		}
	}
	tag.setTag("Loadout", list);*/
	tag.setTag("Loadout", this.loadout.serializeNBT());
	tag.setTag("LoadoutHeld", loadoutHeld.serializeNBT());
	tag.setTag("Refill", this.refill.getStackInSlot(0).serializeNBT());
	if (this.tradeOffers != null)
		tag.setTag("Offers", this.tradeOffers.getRecipiesAsTags());
	if(this.usedSlot == -1)
		this.usedSlot = this.getDefaultSlot();
	tag.setByte("Slot", (byte) this.usedSlot);
	tag.setByte("PSlot", (byte) this.preferredSlot);
	if(this.lastTrader!=null){
		tag.setUniqueId("TraderFollow", this.lastTrader.getUniqueID());
		tag.setInteger("TraderFollowTicks", this.traderFollowTicks);
	}
	if (this.getOwnerId() != null) {
		tag.setUniqueId("Owner", this.getOwnerId());
		tag.setString("OwnerName", this.ownerName);
	}
	
}
 
开发者ID:rafradek,项目名称:Mods,代码行数:40,代码来源:EntityTF2Character.java

示例13: addEntitiesToWorld

import net.minecraft.nbt.NBTTagCompound; //导入方法依赖的package包/类
private void addEntitiesToWorld(World worldIn, BlockPos pos, Mirror mirrorIn, Rotation rotationIn, @Nullable StructureBoundingBox aabb)
{
    for (Template.EntityInfo template$entityinfo : this.entities)
    {
        BlockPos blockpos = transformedBlockPos(template$entityinfo.blockPos, mirrorIn, rotationIn).add(pos);

        if (aabb == null || aabb.isVecInside(blockpos))
        {
            NBTTagCompound nbttagcompound = template$entityinfo.entityData;
            Vec3d vec3d = transformedVec3d(template$entityinfo.pos, mirrorIn, rotationIn);
            Vec3d vec3d1 = vec3d.addVector((double)pos.getX(), (double)pos.getY(), (double)pos.getZ());
            NBTTagList nbttaglist = new NBTTagList();
            nbttaglist.appendTag(new NBTTagDouble(vec3d1.xCoord));
            nbttaglist.appendTag(new NBTTagDouble(vec3d1.yCoord));
            nbttaglist.appendTag(new NBTTagDouble(vec3d1.zCoord));
            nbttagcompound.setTag("Pos", nbttaglist);
            nbttagcompound.setUniqueId("UUID", UUID.randomUUID());
            Entity entity;

            try
            {
                entity = EntityList.createEntityFromNBT(nbttagcompound, worldIn);
            }
            catch (Exception var15)
            {
                entity = null;
            }

            if (entity != null)
            {
                float f = entity.getMirroredYaw(mirrorIn);
                f = f + (entity.rotationYaw - entity.getRotatedYaw(rotationIn));
                entity.setLocationAndAngles(vec3d1.xCoord, vec3d1.yCoord, vec3d1.zCoord, f, entity.rotationPitch);
                worldIn.spawnEntityInWorld(entity);
            }
        }
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:39,代码来源:Template.java

示例14: writeEntityToNBT

import net.minecraft.nbt.NBTTagCompound; //导入方法依赖的package包/类
/**
 * (abstract) Protected helper method to write subclass entity data to NBT.
 */
protected void writeEntityToNBT(NBTTagCompound compound)
{
    if (this.field_190539_a != null)
    {
        NBTTagCompound nbttagcompound = new NBTTagCompound();
        UUID uuid = this.field_190539_a.getUniqueID();
        nbttagcompound.setUniqueId("OwnerUUID", uuid);
        compound.setTag("Owner", nbttagcompound);
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:14,代码来源:EntityLlamaSpit.java

示例15: getCompound

import net.minecraft.nbt.NBTTagCompound; //导入方法依赖的package包/类
public NBTTagCompound getCompound()
{
    NBTTagCompound nbttagcompound = new NBTTagCompound();

    if (this.dragonUniqueId != null)
    {
        nbttagcompound.setUniqueId("DragonUUID", this.dragonUniqueId);
    }

    nbttagcompound.setBoolean("DragonKilled", this.dragonKilled);
    nbttagcompound.setBoolean("PreviouslyKilled", this.previouslyKilled);

    if (this.exitPortalLocation != null)
    {
        nbttagcompound.setTag("ExitPortalLocation", NBTUtil.createPosTag(this.exitPortalLocation));
    }

    NBTTagList nbttaglist = new NBTTagList();
    Iterator iterator = this.gateways.iterator();

    while (iterator.hasNext())
    {
        int i = ((Integer)iterator.next()).intValue();
        nbttaglist.appendTag(new NBTTagInt(i));
    }

    nbttagcompound.setTag("Gateways", nbttaglist);
    return nbttagcompound;
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:30,代码来源:DragonFightManager.java


注:本文中的net.minecraft.nbt.NBTTagCompound.setUniqueId方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。