Esempio n. 1
0
  private DyeColor func_175511_a(EntityAnimal p_175511_1_, EntityAnimal p_175511_2_) {
    int var3 = ((EntitySheep) p_175511_1_).func_175509_cj().getDyeColorValue();
    int var4 = ((EntitySheep) p_175511_2_).func_175509_cj().getDyeColorValue();
    this.inventoryCrafting.get(0).setItemDamage(var3);
    this.inventoryCrafting.get(1).setItemDamage(var4);
    ItemStack var5 =
        CraftingManager.getInstance()
            .findMatchingRecipe(this.inventoryCrafting, ((EntitySheep) p_175511_1_).world);
    int var6;

    if (var5 != null && var5.getItem() == Items.dye) {
      var6 = var5.getMetadata();
    } else {
      var6 = this.world.rand.nextBoolean() ? var3 : var4;
    }

    return DyeColor.getDyeColorForValue(var6);
  }
Esempio n. 2
0
 public DyeColor func_175509_cj() {
   return DyeColor.getDyeColorForInverseValue(this.dataWatcher.getWatchableObjectByte(16) & 15);
 }
Esempio n. 3
0
 public void func_175512_b(DyeColor p_175512_1_) {
   byte var2 = this.dataWatcher.getWatchableObjectByte(16);
   this.dataWatcher.updateObject(
       16, Byte.valueOf((byte) (var2 & 240 | p_175512_1_.getInverseDyeColorValue() & 15)));
 }
Esempio n. 4
0
 /** (abstract) Protected helper method to read subclass entity data from NBT. */
 public void readEntityFromNBT(NBTTagCompound tag) {
   super.readEntityFromNBT(tag);
   this.setSheared(tag.getBoolean("Sheared"));
   this.func_175512_b(DyeColor.getDyeColorForInverseValue(tag.getByte("Color")));
 }