Java 类net.minecraft.server.management.PreYggdrasilConverter 实例源码

项目:DecompiledMinecraft    文件:EntityTameable.java   
/**
 * (abstract) Protected helper method to read subclass entity data from NBT.
 */
public void readEntityFromNBT(NBTTagCompound tagCompund)
{
    super.readEntityFromNBT(tagCompund);
    String s = "";

    if (tagCompund.hasKey("OwnerUUID", 8))
    {
        s = tagCompund.getString("OwnerUUID");
    }
    else
    {
        String s1 = tagCompund.getString("Owner");
        s = PreYggdrasilConverter.getStringUUIDFromName(s1);
    }

    if (s.length() > 0)
    {
        this.setOwnerId(s);
        this.setTamed(true);
    }

    this.aiSit.setSitting(tagCompund.getBoolean("Sitting"));
    this.setSitting(tagCompund.getBoolean("Sitting"));
}
项目:DecompiledMinecraft    文件:EntityTameable.java   
/**
 * (abstract) Protected helper method to read subclass entity data from NBT.
 */
public void readEntityFromNBT(NBTTagCompound tagCompund)
{
    super.readEntityFromNBT(tagCompund);
    String s = "";

    if (tagCompund.hasKey("OwnerUUID", 8))
    {
        s = tagCompund.getString("OwnerUUID");
    }
    else
    {
        String s1 = tagCompund.getString("Owner");
        s = PreYggdrasilConverter.getStringUUIDFromName(s1);
    }

    if (s.length() > 0)
    {
        this.setOwnerId(s);
        this.setTamed(true);
    }

    this.aiSit.setSitting(tagCompund.getBoolean("Sitting"));
    this.setSitting(tagCompund.getBoolean("Sitting"));
}
项目:BaseClient    文件:EntityTameable.java   
/**
 * (abstract) Protected helper method to read subclass entity data from NBT.
 */
public void readEntityFromNBT(NBTTagCompound tagCompund)
{
    super.readEntityFromNBT(tagCompund);
    String s = "";

    if (tagCompund.hasKey("OwnerUUID", 8))
    {
        s = tagCompund.getString("OwnerUUID");
    }
    else
    {
        String s1 = tagCompund.getString("Owner");
        s = PreYggdrasilConverter.getStringUUIDFromName(s1);
    }

    if (s.length() > 0)
    {
        this.setOwnerId(s);
        this.setTamed(true);
    }

    this.aiSit.setSitting(tagCompund.getBoolean("Sitting"));
    this.setSitting(tagCompund.getBoolean("Sitting"));
}
项目:BaseClient    文件:EntityTameable.java   
/**
 * (abstract) Protected helper method to read subclass entity data from NBT.
 */
public void readEntityFromNBT(NBTTagCompound tagCompund)
{
    super.readEntityFromNBT(tagCompund);
    String s = "";

    if (tagCompund.hasKey("OwnerUUID", 8))
    {
        s = tagCompund.getString("OwnerUUID");
    }
    else
    {
        String s1 = tagCompund.getString("Owner");
        s = PreYggdrasilConverter.getStringUUIDFromName(s1);
    }

    if (s.length() > 0)
    {
        this.setOwnerId(s);
        this.setTamed(true);
    }

    this.aiSit.setSitting(tagCompund.getBoolean("Sitting"));
    this.setSitting(tagCompund.getBoolean("Sitting"));
}
项目:ARKCraft-Code    文件:DinoTameableTest.java   
/**
 * (abstract) Protected helper method to read subclass entity data from NBT.
 */
public void readEntityFromNBT(NBTTagCompound tagCompund)
{
    super.readEntityFromNBT(tagCompund);
    String s = "";
    if (tagCompund.hasKey("OwnerUUID", 8))
    {
        s = tagCompund.getString("OwnerUUID");
    }
    else
    {
        String s1 = tagCompund.getString("Owner");
        s = PreYggdrasilConverter.func_152719_a(s1);
    }
    if (s.length() > 0)
    {
        this.setOwnerId(s);
        this.setTamed(true);
    }
    // this.aiSit.setSitting(tagCompund.getBoolean("Sitting"));
    // this.setSitting(tagCompund.getBoolean("Sitting"));
}
项目:Cauldron    文件:EntityTameable.java   
public void readEntityFromNBT(NBTTagCompound p_70037_1_)
{
    super.readEntityFromNBT(p_70037_1_);
    String s = "";

    if (p_70037_1_.hasKey("OwnerUUID", 8))
    {
        s = p_70037_1_.getString("OwnerUUID");
    }
    else
    {
        String s1 = p_70037_1_.getString("Owner");
        s = PreYggdrasilConverter.func_152719_a(s1);
    }

    if (s.length() > 0)
    {
        this.func_152115_b(s);
        this.setTamed(true);
    }

    this.aiSit.setSitting(p_70037_1_.getBoolean("Sitting"));
    this.setSitting(p_70037_1_.getBoolean("Sitting"));
}
项目:Cauldron    文件:EntityTameable.java   
public void readEntityFromNBT(NBTTagCompound p_70037_1_)
{
    super.readEntityFromNBT(p_70037_1_);
    String s = "";

    if (p_70037_1_.hasKey("OwnerUUID", 8))
    {
        s = p_70037_1_.getString("OwnerUUID");
    }
    else
    {
        String s1 = p_70037_1_.getString("Owner");
        s = PreYggdrasilConverter.func_152719_a(s1);
    }

    if (s.length() > 0)
    {
        this.func_152115_b(s);
        this.setTamed(true);
    }

    this.aiSit.setSitting(p_70037_1_.getBoolean("Sitting"));
    this.setSitting(p_70037_1_.getBoolean("Sitting"));
}
项目:Backmemed    文件:EntityTameable.java   
/**
 * (abstract) Protected helper method to read subclass entity data from NBT.
 */
public void readEntityFromNBT(NBTTagCompound compound)
{
    super.readEntityFromNBT(compound);
    String s;

    if (compound.hasKey("OwnerUUID", 8))
    {
        s = compound.getString("OwnerUUID");
    }
    else
    {
        String s1 = compound.getString("Owner");
        s = PreYggdrasilConverter.convertMobOwnerIfNeeded(this.getServer(), s1);
    }

    if (!s.isEmpty())
    {
        try
        {
            this.setOwnerId(UUID.fromString(s));
            this.setTamed(true);
        }
        catch (Throwable var4)
        {
            this.setTamed(false);
        }
    }

    if (this.aiSit != null)
    {
        this.aiSit.setSitting(compound.getBoolean("Sitting"));
    }

    this.setSitting(compound.getBoolean("Sitting"));
}
项目:CustomWorldGen    文件:EntityTameable.java   
/**
 * (abstract) Protected helper method to read subclass entity data from NBT.
 */
public void readEntityFromNBT(NBTTagCompound compound)
{
    super.readEntityFromNBT(compound);
    String s;

    if (compound.hasKey("OwnerUUID", 8))
    {
        s = compound.getString("OwnerUUID");
    }
    else
    {
        String s1 = compound.getString("Owner");
        s = PreYggdrasilConverter.convertMobOwnerIfNeeded(this.getServer(), s1);
    }

    if (!s.isEmpty())
    {
        try
        {
            this.setOwnerId(UUID.fromString(s));
            this.setTamed(true);
        }
        catch (Throwable var4)
        {
            this.setTamed(false);
        }
    }

    if (this.aiSit != null)
    {
        this.aiSit.setSitting(compound.getBoolean("Sitting"));
    }

    this.setSitting(compound.getBoolean("Sitting"));
}
项目:CrystalMod    文件:EntityOwnable.java   
/**
    * (abstract) Protected helper method to read subclass entity data from NBT.
    */
   @Override
public void readEntityFromNBT(NBTTagCompound tagCompund)
   {
       super.readEntityFromNBT(tagCompund);
       String s = "";

       if (tagCompund.hasKey("OwnerUUID", 8))
       {
           s = tagCompund.getString("OwnerUUID");
       }
       else
       {
           String s1 = tagCompund.getString("Owner");
           s = PreYggdrasilConverter.convertMobOwnerIfNeeded(this.getServer(), s1);
       }

       if (!s.isEmpty())
       {
           try
           {
               this.setOwnerId(UUID.fromString(s));
               this.setTamed(true);
           }
           catch (Throwable var4)
           {
               this.setTamed(false);
           }
       }

       this.aiSit.setSitting(tagCompund.getBoolean("Sitting"));
       this.setSitting(tagCompund.getBoolean("Sitting"));
   }
项目:ExpandedRailsMod    文件:EntityTameable.java   
/**
 * (abstract) Protected helper method to read subclass entity data from NBT.
 */
public void readEntityFromNBT(NBTTagCompound compound)
{
    super.readEntityFromNBT(compound);
    String s;

    if (compound.hasKey("OwnerUUID", 8))
    {
        s = compound.getString("OwnerUUID");
    }
    else
    {
        String s1 = compound.getString("Owner");
        s = PreYggdrasilConverter.convertMobOwnerIfNeeded(this.getServer(), s1);
    }

    if (!s.isEmpty())
    {
        try
        {
            this.setOwnerId(UUID.fromString(s));
            this.setTamed(true);
        }
        catch (Throwable var4)
        {
            this.setTamed(false);
        }
    }

    if (this.aiSit != null)
    {
        this.aiSit.setSitting(compound.getBoolean("Sitting"));
    }

    this.setSitting(compound.getBoolean("Sitting"));
}
项目:DecompiledMinecraft    文件:EntityHorse.java   
/**
 * (abstract) Protected helper method to read subclass entity data from NBT.
 */
public void readEntityFromNBT(NBTTagCompound tagCompund)
{
    super.readEntityFromNBT(tagCompund);
    this.setEatingHaystack(tagCompund.getBoolean("EatingHaystack"));
    this.setBreeding(tagCompund.getBoolean("Bred"));
    this.setChested(tagCompund.getBoolean("ChestedHorse"));
    this.setHasReproduced(tagCompund.getBoolean("HasReproduced"));
    this.setHorseType(tagCompund.getInteger("Type"));
    this.setHorseVariant(tagCompund.getInteger("Variant"));
    this.setTemper(tagCompund.getInteger("Temper"));
    this.setHorseTamed(tagCompund.getBoolean("Tame"));
    String s = "";

    if (tagCompund.hasKey("OwnerUUID", 8))
    {
        s = tagCompund.getString("OwnerUUID");
    }
    else
    {
        String s1 = tagCompund.getString("Owner");
        s = PreYggdrasilConverter.getStringUUIDFromName(s1);
    }

    if (s.length() > 0)
    {
        this.setOwnerId(s);
    }

    IAttributeInstance iattributeinstance = this.getAttributeMap().getAttributeInstanceByName("Speed");

    if (iattributeinstance != null)
    {
        this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(iattributeinstance.getBaseValue() * 0.25D);
    }

    if (this.isChested())
    {
        NBTTagList nbttaglist = tagCompund.getTagList("Items", 10);
        this.initHorseChest();

        for (int i = 0; i < nbttaglist.tagCount(); ++i)
        {
            NBTTagCompound nbttagcompound = nbttaglist.getCompoundTagAt(i);
            int j = nbttagcompound.getByte("Slot") & 255;

            if (j >= 2 && j < this.horseChest.getSizeInventory())
            {
                this.horseChest.setInventorySlotContents(j, ItemStack.loadItemStackFromNBT(nbttagcompound));
            }
        }
    }

    if (tagCompund.hasKey("ArmorItem", 10))
    {
        ItemStack itemstack = ItemStack.loadItemStackFromNBT(tagCompund.getCompoundTag("ArmorItem"));

        if (itemstack != null && isArmorItem(itemstack.getItem()))
        {
            this.horseChest.setInventorySlotContents(1, itemstack);
        }
    }

    if (tagCompund.hasKey("SaddleItem", 10))
    {
        ItemStack itemstack1 = ItemStack.loadItemStackFromNBT(tagCompund.getCompoundTag("SaddleItem"));

        if (itemstack1 != null && itemstack1.getItem() == Items.saddle)
        {
            this.horseChest.setInventorySlotContents(0, itemstack1);
        }
    }
    else if (tagCompund.getBoolean("Saddle"))
    {
        this.horseChest.setInventorySlotContents(0, new ItemStack(Items.saddle));
    }

    this.updateHorseSlots();
}
项目:DecompiledMinecraft    文件:DedicatedServer.java   
protected boolean convertFiles() throws IOException
{
    boolean flag = false;

    for (int i = 0; !flag && i <= 2; ++i)
    {
        if (i > 0)
        {
            logger.warn("Encountered a problem while converting the user banlist, retrying in a few seconds");
            this.sleepFiveSeconds();
        }

        flag = PreYggdrasilConverter.convertUserBanlist(this);
    }

    boolean flag1 = false;

    for (int j = 0; !flag1 && j <= 2; ++j)
    {
        if (j > 0)
        {
            logger.warn("Encountered a problem while converting the ip banlist, retrying in a few seconds");
            this.sleepFiveSeconds();
        }

        flag1 = PreYggdrasilConverter.convertIpBanlist(this);
    }

    boolean flag2 = false;

    for (int k = 0; !flag2 && k <= 2; ++k)
    {
        if (k > 0)
        {
            logger.warn("Encountered a problem while converting the op list, retrying in a few seconds");
            this.sleepFiveSeconds();
        }

        flag2 = PreYggdrasilConverter.convertOplist(this);
    }

    boolean flag3 = false;

    for (int l = 0; !flag3 && l <= 2; ++l)
    {
        if (l > 0)
        {
            logger.warn("Encountered a problem while converting the whitelist, retrying in a few seconds");
            this.sleepFiveSeconds();
        }

        flag3 = PreYggdrasilConverter.convertWhitelist(this);
    }

    boolean flag4 = false;

    for (int i1 = 0; !flag4 && i1 <= 2; ++i1)
    {
        if (i1 > 0)
        {
            logger.warn("Encountered a problem while converting the player save files, retrying in a few seconds");
            this.sleepFiveSeconds();
        }

        flag4 = PreYggdrasilConverter.convertSaveFiles(this, this.settings);
    }

    return flag || flag1 || flag2 || flag3 || flag4;
}
项目:DecompiledMinecraft    文件:EntityHorse.java   
/**
 * (abstract) Protected helper method to read subclass entity data from NBT.
 */
public void readEntityFromNBT(NBTTagCompound tagCompund)
{
    super.readEntityFromNBT(tagCompund);
    this.setEatingHaystack(tagCompund.getBoolean("EatingHaystack"));
    this.setBreeding(tagCompund.getBoolean("Bred"));
    this.setChested(tagCompund.getBoolean("ChestedHorse"));
    this.setHasReproduced(tagCompund.getBoolean("HasReproduced"));
    this.setHorseType(tagCompund.getInteger("Type"));
    this.setHorseVariant(tagCompund.getInteger("Variant"));
    this.setTemper(tagCompund.getInteger("Temper"));
    this.setHorseTamed(tagCompund.getBoolean("Tame"));
    String s = "";

    if (tagCompund.hasKey("OwnerUUID", 8))
    {
        s = tagCompund.getString("OwnerUUID");
    }
    else
    {
        String s1 = tagCompund.getString("Owner");
        s = PreYggdrasilConverter.getStringUUIDFromName(s1);
    }

    if (s.length() > 0)
    {
        this.setOwnerId(s);
    }

    IAttributeInstance iattributeinstance = this.getAttributeMap().getAttributeInstanceByName("Speed");

    if (iattributeinstance != null)
    {
        this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(iattributeinstance.getBaseValue() * 0.25D);
    }

    if (this.isChested())
    {
        NBTTagList nbttaglist = tagCompund.getTagList("Items", 10);
        this.initHorseChest();

        for (int i = 0; i < nbttaglist.tagCount(); ++i)
        {
            NBTTagCompound nbttagcompound = nbttaglist.getCompoundTagAt(i);
            int j = nbttagcompound.getByte("Slot") & 255;

            if (j >= 2 && j < this.horseChest.getSizeInventory())
            {
                this.horseChest.setInventorySlotContents(j, ItemStack.loadItemStackFromNBT(nbttagcompound));
            }
        }
    }

    if (tagCompund.hasKey("ArmorItem", 10))
    {
        ItemStack itemstack = ItemStack.loadItemStackFromNBT(tagCompund.getCompoundTag("ArmorItem"));

        if (itemstack != null && isArmorItem(itemstack.getItem()))
        {
            this.horseChest.setInventorySlotContents(1, itemstack);
        }
    }

    if (tagCompund.hasKey("SaddleItem", 10))
    {
        ItemStack itemstack1 = ItemStack.loadItemStackFromNBT(tagCompund.getCompoundTag("SaddleItem"));

        if (itemstack1 != null && itemstack1.getItem() == Items.saddle)
        {
            this.horseChest.setInventorySlotContents(0, itemstack1);
        }
    }
    else if (tagCompund.getBoolean("Saddle"))
    {
        this.horseChest.setInventorySlotContents(0, new ItemStack(Items.saddle));
    }

    this.updateHorseSlots();
}
项目:BaseClient    文件:EntityHorse.java   
/**
 * (abstract) Protected helper method to read subclass entity data from NBT.
 */
public void readEntityFromNBT(NBTTagCompound tagCompund)
{
    super.readEntityFromNBT(tagCompund);
    this.setEatingHaystack(tagCompund.getBoolean("EatingHaystack"));
    this.setBreeding(tagCompund.getBoolean("Bred"));
    this.setChested(tagCompund.getBoolean("ChestedHorse"));
    this.setHasReproduced(tagCompund.getBoolean("HasReproduced"));
    this.setHorseType(tagCompund.getInteger("Type"));
    this.setHorseVariant(tagCompund.getInteger("Variant"));
    this.setTemper(tagCompund.getInteger("Temper"));
    this.setHorseTamed(tagCompund.getBoolean("Tame"));
    String s = "";

    if (tagCompund.hasKey("OwnerUUID", 8))
    {
        s = tagCompund.getString("OwnerUUID");
    }
    else
    {
        String s1 = tagCompund.getString("Owner");
        s = PreYggdrasilConverter.getStringUUIDFromName(s1);
    }

    if (s.length() > 0)
    {
        this.setOwnerId(s);
    }

    IAttributeInstance iattributeinstance = this.getAttributeMap().getAttributeInstanceByName("Speed");

    if (iattributeinstance != null)
    {
        this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(iattributeinstance.getBaseValue() * 0.25D);
    }

    if (this.isChested())
    {
        NBTTagList nbttaglist = tagCompund.getTagList("Items", 10);
        this.initHorseChest();

        for (int i = 0; i < nbttaglist.tagCount(); ++i)
        {
            NBTTagCompound nbttagcompound = nbttaglist.getCompoundTagAt(i);
            int j = nbttagcompound.getByte("Slot") & 255;

            if (j >= 2 && j < this.horseChest.getSizeInventory())
            {
                this.horseChest.setInventorySlotContents(j, ItemStack.loadItemStackFromNBT(nbttagcompound));
            }
        }
    }

    if (tagCompund.hasKey("ArmorItem", 10))
    {
        ItemStack itemstack = ItemStack.loadItemStackFromNBT(tagCompund.getCompoundTag("ArmorItem"));

        if (itemstack != null && isArmorItem(itemstack.getItem()))
        {
            this.horseChest.setInventorySlotContents(1, itemstack);
        }
    }

    if (tagCompund.hasKey("SaddleItem", 10))
    {
        ItemStack itemstack1 = ItemStack.loadItemStackFromNBT(tagCompund.getCompoundTag("SaddleItem"));

        if (itemstack1 != null && itemstack1.getItem() == Items.saddle)
        {
            this.horseChest.setInventorySlotContents(0, itemstack1);
        }
    }
    else if (tagCompund.getBoolean("Saddle"))
    {
        this.horseChest.setInventorySlotContents(0, new ItemStack(Items.saddle));
    }

    this.updateHorseSlots();
}
项目:BaseClient    文件:EntityHorse.java   
/**
 * (abstract) Protected helper method to read subclass entity data from NBT.
 */
public void readEntityFromNBT(NBTTagCompound tagCompund)
{
    super.readEntityFromNBT(tagCompund);
    this.setEatingHaystack(tagCompund.getBoolean("EatingHaystack"));
    this.setBreeding(tagCompund.getBoolean("Bred"));
    this.setChested(tagCompund.getBoolean("ChestedHorse"));
    this.setHasReproduced(tagCompund.getBoolean("HasReproduced"));
    this.setHorseType(tagCompund.getInteger("Type"));
    this.setHorseVariant(tagCompund.getInteger("Variant"));
    this.setTemper(tagCompund.getInteger("Temper"));
    this.setHorseTamed(tagCompund.getBoolean("Tame"));
    String s = "";

    if (tagCompund.hasKey("OwnerUUID", 8))
    {
        s = tagCompund.getString("OwnerUUID");
    }
    else
    {
        String s1 = tagCompund.getString("Owner");
        s = PreYggdrasilConverter.getStringUUIDFromName(s1);
    }

    if (s.length() > 0)
    {
        this.setOwnerId(s);
    }

    IAttributeInstance iattributeinstance = this.getAttributeMap().getAttributeInstanceByName("Speed");

    if (iattributeinstance != null)
    {
        this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(iattributeinstance.getBaseValue() * 0.25D);
    }

    if (this.isChested())
    {
        NBTTagList nbttaglist = tagCompund.getTagList("Items", 10);
        this.initHorseChest();

        for (int i = 0; i < nbttaglist.tagCount(); ++i)
        {
            NBTTagCompound nbttagcompound = nbttaglist.getCompoundTagAt(i);
            int j = nbttagcompound.getByte("Slot") & 255;

            if (j >= 2 && j < this.horseChest.getSizeInventory())
            {
                this.horseChest.setInventorySlotContents(j, ItemStack.loadItemStackFromNBT(nbttagcompound));
            }
        }
    }

    if (tagCompund.hasKey("ArmorItem", 10))
    {
        ItemStack itemstack = ItemStack.loadItemStackFromNBT(tagCompund.getCompoundTag("ArmorItem"));

        if (itemstack != null && isArmorItem(itemstack.getItem()))
        {
            this.horseChest.setInventorySlotContents(1, itemstack);
        }
    }

    if (tagCompund.hasKey("SaddleItem", 10))
    {
        ItemStack itemstack1 = ItemStack.loadItemStackFromNBT(tagCompund.getCompoundTag("SaddleItem"));

        if (itemstack1 != null && itemstack1.getItem() == Items.saddle)
        {
            this.horseChest.setInventorySlotContents(0, itemstack1);
        }
    }
    else if (tagCompund.getBoolean("Saddle"))
    {
        this.horseChest.setInventorySlotContents(0, new ItemStack(Items.saddle));
    }

    this.updateHorseSlots();
}
项目:Backmemed    文件:AbstractHorse.java   
/**
 * (abstract) Protected helper method to read subclass entity data from NBT.
 */
public void readEntityFromNBT(NBTTagCompound compound)
{
    super.readEntityFromNBT(compound);
    this.setEatingHaystack(compound.getBoolean("EatingHaystack"));
    this.setBreeding(compound.getBoolean("Bred"));
    this.setTemper(compound.getInteger("Temper"));
    this.setHorseTamed(compound.getBoolean("Tame"));
    String s;

    if (compound.hasKey("OwnerUUID", 8))
    {
        s = compound.getString("OwnerUUID");
    }
    else
    {
        String s1 = compound.getString("Owner");
        s = PreYggdrasilConverter.convertMobOwnerIfNeeded(this.getServer(), s1);
    }

    if (!s.isEmpty())
    {
        this.setOwnerUniqueId(UUID.fromString(s));
    }

    IAttributeInstance iattributeinstance = this.getAttributeMap().getAttributeInstanceByName("Speed");

    if (iattributeinstance != null)
    {
        this.getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(iattributeinstance.getBaseValue() * 0.25D);
    }

    if (compound.hasKey("SaddleItem", 10))
    {
        ItemStack itemstack = new ItemStack(compound.getCompoundTag("SaddleItem"));

        if (itemstack.getItem() == Items.SADDLE)
        {
            this.horseChest.setInventorySlotContents(0, itemstack);
        }
    }

    this.updateHorseSlots();
}
项目:CustomWorldGen    文件:EntityHorse.java   
/**
 * (abstract) Protected helper method to read subclass entity data from NBT.
 */
public void readEntityFromNBT(NBTTagCompound compound)
{
    super.readEntityFromNBT(compound);
    this.setEatingHaystack(compound.getBoolean("EatingHaystack"));
    this.setBreeding(compound.getBoolean("Bred"));
    this.setChested(compound.getBoolean("ChestedHorse"));
    this.setHasReproduced(compound.getBoolean("HasReproduced"));
    this.setType(HorseType.getArmorType(compound.getInteger("Type")));
    this.setHorseVariant(compound.getInteger("Variant"));
    this.setTemper(compound.getInteger("Temper"));
    this.setHorseTamed(compound.getBoolean("Tame"));
    this.setSkeletonTrap(compound.getBoolean("SkeletonTrap"));
    this.skeletonTrapTime = compound.getInteger("SkeletonTrapTime");
    String s;

    if (compound.hasKey("OwnerUUID", 8))
    {
        s = compound.getString("OwnerUUID");
    }
    else
    {
        String s1 = compound.getString("Owner");
        s = PreYggdrasilConverter.convertMobOwnerIfNeeded(this.getServer(), s1);
    }

    if (!s.isEmpty())
    {
        this.setOwnerUniqueId(UUID.fromString(s));
    }

    IAttributeInstance iattributeinstance = this.getAttributeMap().getAttributeInstanceByName("Speed");

    if (iattributeinstance != null)
    {
        this.getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(iattributeinstance.getBaseValue() * 0.25D);
    }

    if (this.isChested())
    {
        NBTTagList nbttaglist = compound.getTagList("Items", 10);
        this.initHorseChest();

        for (int i = 0; i < nbttaglist.tagCount(); ++i)
        {
            NBTTagCompound nbttagcompound = nbttaglist.getCompoundTagAt(i);
            int j = nbttagcompound.getByte("Slot") & 255;

            if (j >= 2 && j < this.horseChest.getSizeInventory())
            {
                this.horseChest.setInventorySlotContents(j, ItemStack.loadItemStackFromNBT(nbttagcompound));
            }
        }
    }

    if (compound.hasKey("ArmorItem", 10))
    {
        ItemStack itemstack = ItemStack.loadItemStackFromNBT(compound.getCompoundTag("ArmorItem"));

        if (itemstack != null && HorseArmorType.isHorseArmor(itemstack.getItem()))
        {
            this.horseChest.setInventorySlotContents(1, itemstack);
        }
    }

    if (compound.hasKey("SaddleItem", 10))
    {
        ItemStack itemstack1 = ItemStack.loadItemStackFromNBT(compound.getCompoundTag("SaddleItem"));

        if (itemstack1 != null && itemstack1.getItem() == Items.SADDLE)
        {
            this.horseChest.setInventorySlotContents(0, itemstack1);
        }
    }

    this.updateHorseSlots();
}
项目:CustomWorldGen    文件:DedicatedServer.java   
protected boolean convertFiles() throws IOException
{
    boolean flag = false;

    for (int i = 0; !flag && i <= 2; ++i)
    {
        if (i > 0)
        {
            LOGGER.warn("Encountered a problem while converting the user banlist, retrying in a few seconds");
            this.sleepFiveSeconds();
        }

        flag = PreYggdrasilConverter.convertUserBanlist(this);
    }

    boolean flag1 = false;

    for (int j = 0; !flag1 && j <= 2; ++j)
    {
        if (j > 0)
        {
            LOGGER.warn("Encountered a problem while converting the ip banlist, retrying in a few seconds");
            this.sleepFiveSeconds();
        }

        flag1 = PreYggdrasilConverter.convertIpBanlist(this);
    }

    boolean flag2 = false;

    for (int k = 0; !flag2 && k <= 2; ++k)
    {
        if (k > 0)
        {
            LOGGER.warn("Encountered a problem while converting the op list, retrying in a few seconds");
            this.sleepFiveSeconds();
        }

        flag2 = PreYggdrasilConverter.convertOplist(this);
    }

    boolean flag3 = false;

    for (int l = 0; !flag3 && l <= 2; ++l)
    {
        if (l > 0)
        {
            LOGGER.warn("Encountered a problem while converting the whitelist, retrying in a few seconds");
            this.sleepFiveSeconds();
        }

        flag3 = PreYggdrasilConverter.convertWhitelist(this);
    }

    boolean flag4 = false;

    for (int i1 = 0; !flag4 && i1 <= 2; ++i1)
    {
        if (i1 > 0)
        {
            LOGGER.warn("Encountered a problem while converting the player save files, retrying in a few seconds");
            this.sleepFiveSeconds();
        }

        flag4 = PreYggdrasilConverter.convertSaveFiles(this, this.settings);
    }

    return flag || flag1 || flag2 || flag3 || flag4;
}
项目:UsefulPets    文件:PetEntity.java   
@Override
public void readEntityFromNBT( NBTTagCompound tag )
{
    super.readEntityFromNBT( tag );

    String str;
    if ( ( str = tag.getString( "Owner" ) ) != null )
    {
        setOwnerUUID( PreYggdrasilConverter.func_152719_a( str ) );
    }
    if ( ( str = tag.getString( "OwnerID" ) ) != null )
    {
        setOwnerUUID( tag.getString( "OwnerID" ) );
    }
    setPetType( PetType.forName( tag.getString( "Type" ) ) );
    setLevel( tag.getInteger( "Level" ) );
    setFreeSkillPoints( tag.getInteger( "FreeSkillPoints" ) );
    skills.clear();
    int[] theSkills = ( ( NBTTagIntArray ) tag.getTag( "Skills" ) ).func_150302_c();
    for ( int id : theSkills )
    {
        skills.add( id );
    }
    dataWatcher.updateObject( DATA_SKILLS, getSkillsStack() );
    if ( tag.getTag( "Inventory" ) != null )
    {
        NBTTagList list = ( NBTTagList ) tag.getTag( "Inventory" );
        for ( int i = 0; i < Math.min( 12, list.tagCount() ); ++i )
        {
            NBTTagCompound compound = ( NBTTagCompound ) list.getCompoundTagAt( i );
            if ( compound.hasNoTags() )
            {
                continue;
            }

            ItemStack stack = ItemStack.loadItemStackFromNBT( compound );
            inv.setInventorySlotContents( i, stack );
        }
    }

    setSitting( tag.getBoolean( "Sitting" ) );
    setHunger( tag.getFloat( "Hunger" ) );
    setSaturation( tag.getFloat( "Saturation" ) );

    // New with 1.0
    if ( tag.hasKey( "Texture" ) )
    {
        setTexture( tag.getString( "Texture" ) );
    }
    else
    {
        setTexture( type.textures.get( 0 ) );
    }
}
项目:ExpandedRailsMod    文件:EntityHorse.java   
/**
 * (abstract) Protected helper method to read subclass entity data from NBT.
 */
public void readEntityFromNBT(NBTTagCompound compound)
{
    super.readEntityFromNBT(compound);
    this.setEatingHaystack(compound.getBoolean("EatingHaystack"));
    this.setBreeding(compound.getBoolean("Bred"));
    this.setChested(compound.getBoolean("ChestedHorse"));
    this.setHasReproduced(compound.getBoolean("HasReproduced"));
    this.setType(HorseType.getArmorType(compound.getInteger("Type")));
    this.setHorseVariant(compound.getInteger("Variant"));
    this.setTemper(compound.getInteger("Temper"));
    this.setHorseTamed(compound.getBoolean("Tame"));
    this.setSkeletonTrap(compound.getBoolean("SkeletonTrap"));
    this.skeletonTrapTime = compound.getInteger("SkeletonTrapTime");
    String s;

    if (compound.hasKey("OwnerUUID", 8))
    {
        s = compound.getString("OwnerUUID");
    }
    else
    {
        String s1 = compound.getString("Owner");
        s = PreYggdrasilConverter.convertMobOwnerIfNeeded(this.getServer(), s1);
    }

    if (!s.isEmpty())
    {
        this.setOwnerUniqueId(UUID.fromString(s));
    }

    IAttributeInstance iattributeinstance = this.getAttributeMap().getAttributeInstanceByName("Speed");

    if (iattributeinstance != null)
    {
        this.getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(iattributeinstance.getBaseValue() * 0.25D);
    }

    if (this.isChested())
    {
        NBTTagList nbttaglist = compound.getTagList("Items", 10);
        this.initHorseChest();

        for (int i = 0; i < nbttaglist.tagCount(); ++i)
        {
            NBTTagCompound nbttagcompound = nbttaglist.getCompoundTagAt(i);
            int j = nbttagcompound.getByte("Slot") & 255;

            if (j >= 2 && j < this.horseChest.getSizeInventory())
            {
                this.horseChest.setInventorySlotContents(j, ItemStack.loadItemStackFromNBT(nbttagcompound));
            }
        }
    }

    if (compound.hasKey("ArmorItem", 10))
    {
        ItemStack itemstack = ItemStack.loadItemStackFromNBT(compound.getCompoundTag("ArmorItem"));

        if (itemstack != null && HorseArmorType.isHorseArmor(itemstack.getItem()))
        {
            this.horseChest.setInventorySlotContents(1, itemstack);
        }
    }

    if (compound.hasKey("SaddleItem", 10))
    {
        ItemStack itemstack1 = ItemStack.loadItemStackFromNBT(compound.getCompoundTag("SaddleItem"));

        if (itemstack1 != null && itemstack1.getItem() == Items.SADDLE)
        {
            this.horseChest.setInventorySlotContents(0, itemstack1);
        }
    }

    this.updateHorseSlots();
}
项目:Cauldron    文件:DedicatedServer.java   
protected boolean func_152368_aE() throws IOException
{
    boolean flag = false;
    int i;

    for (i = 0; !flag && i <= 2; ++i)
    {
        if (i > 0)
        {
            field_155771_h.warn("Encountered a problem while converting the user banlist, retrying in a few seconds");
            this.func_152369_aG();
        }

        flag = PreYggdrasilConverter.func_152724_a(this);
    }

    boolean flag1 = false;

    for (i = 0; !flag1 && i <= 2; ++i)
    {
        if (i > 0)
        {
            field_155771_h.warn("Encountered a problem while converting the ip banlist, retrying in a few seconds");
            this.func_152369_aG();
        }

        flag1 = PreYggdrasilConverter.func_152722_b(this);
    }

    boolean flag2 = false;

    for (i = 0; !flag2 && i <= 2; ++i)
    {
        if (i > 0)
        {
            field_155771_h.warn("Encountered a problem while converting the op list, retrying in a few seconds");
            this.func_152369_aG();
        }

        flag2 = PreYggdrasilConverter.func_152718_c(this);
    }

    boolean flag3 = false;

    for (i = 0; !flag3 && i <= 2; ++i)
    {
        if (i > 0)
        {
            field_155771_h.warn("Encountered a problem while converting the whitelist, retrying in a few seconds");
            this.func_152369_aG();
        }

        flag3 = PreYggdrasilConverter.func_152710_d(this);
    }

    boolean flag4 = false;

    for (i = 0; !flag4 && i <= 2; ++i)
    {
        if (i > 0)
        {
            field_155771_h.warn("Encountered a problem while converting the player save files, retrying in a few seconds");
            this.func_152369_aG();
        }

        flag4 = PreYggdrasilConverter.func_152723_a(this, this.settings);
    }

    return flag || flag1 || flag2 || flag3 || flag4;
}
项目:Cauldron    文件:DedicatedServer.java   
protected boolean func_152368_aE() throws IOException
{
    boolean flag = false;
    int i;

    for (i = 0; !flag && i <= 2; ++i)
    {
        if (i > 0)
        {
            field_155771_h.warn("Encountered a problem while converting the user banlist, retrying in a few seconds");
            this.func_152369_aG();
        }

        flag = PreYggdrasilConverter.func_152724_a(this);
    }

    boolean flag1 = false;

    for (i = 0; !flag1 && i <= 2; ++i)
    {
        if (i > 0)
        {
            field_155771_h.warn("Encountered a problem while converting the ip banlist, retrying in a few seconds");
            this.func_152369_aG();
        }

        flag1 = PreYggdrasilConverter.func_152722_b(this);
    }

    boolean flag2 = false;

    for (i = 0; !flag2 && i <= 2; ++i)
    {
        if (i > 0)
        {
            field_155771_h.warn("Encountered a problem while converting the op list, retrying in a few seconds");
            this.func_152369_aG();
        }

        flag2 = PreYggdrasilConverter.func_152718_c(this);
    }

    boolean flag3 = false;

    for (i = 0; !flag3 && i <= 2; ++i)
    {
        if (i > 0)
        {
            field_155771_h.warn("Encountered a problem while converting the whitelist, retrying in a few seconds");
            this.func_152369_aG();
        }

        flag3 = PreYggdrasilConverter.func_152710_d(this);
    }

    boolean flag4 = false;

    for (i = 0; !flag4 && i <= 2; ++i)
    {
        if (i > 0)
        {
            field_155771_h.warn("Encountered a problem while converting the player save files, retrying in a few seconds");
            this.func_152369_aG();
        }

        flag4 = PreYggdrasilConverter.func_152723_a(this, this.settings);
    }

    return flag || flag1 || flag2 || flag3 || flag4;
}
项目:TurtleMod    文件:EntityTurtle.java   
/**
 * (abstract) Protected helper method to read subclass entity data from NBT.
 */
public void readEntityFromNBT(NBTTagCompound compound)
{

    super.readEntityFromNBT(compound);
    setUpsideDown(compound.getBoolean("upsideDown"));
    String s;

    if (compound.hasKey("OwnerUUID", 8))
    {
        s = compound.getString("OwnerUUID");
    }
    else
    {
        String s1 = compound.getString("Owner");
        s = PreYggdrasilConverter.convertMobOwnerIfNeeded(this.getServer(), s1);
    }

    if (!s.isEmpty())
    {
        try
        {
            this.setOwnerId(UUID.fromString(s));
            this.setTamed(true);
        }
        catch (Throwable var4)
        {
            this.setTamed(false);
        }
    }

    /*
    if (this.aiSit != null)
    {
        this.aiSit.setSitting(compound.getBoolean("Sitting"));
    }


    this.setSitting(compound.getBoolean("Sitting"));
    */
}