コード例 #1
0
  public EntityPainting(World par1World, int par2, int par3, int par4, int par5) {
    this(par1World);
    xPosition = par2;
    yPosition = par3;
    zPosition = par4;
    ArrayList arraylist = new ArrayList();
    EnumArt aenumart[] = EnumArt.values();
    int i = aenumart.length;

    for (int j = 0; j < i; j++) {
      EnumArt enumart = aenumart[j];
      art = enumart;
      func_179_a(par5);

      if (onValidSurface()) {
        arraylist.add(enumart);
      }
    }

    if (arraylist.size() > 0) {
      art = (EnumArt) arraylist.get(rand.nextInt(arraylist.size()));
    }

    func_179_a(par5);
  }
コード例 #2
0
  /** (abstract) Protected helper method to read subclass entity data from NBT. */
  public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) {
    direction = par1NBTTagCompound.getByte("Dir");
    xPosition = par1NBTTagCompound.getInteger("TileX");
    yPosition = par1NBTTagCompound.getInteger("TileY");
    zPosition = par1NBTTagCompound.getInteger("TileZ");
    String s = par1NBTTagCompound.getString("Motive");
    EnumArt aenumart[] = EnumArt.values();
    int i = aenumart.length;

    for (int j = 0; j < i; j++) {
      EnumArt enumart = aenumart[j];

      if (enumart.title.equals(s)) {
        art = enumart;
      }
    }

    if (art == null) {
      art = EnumArt.Kebab;
    }

    func_179_a(direction);
  }