當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。