コード例 #1
0
  @Override
  public void processCommand(ICommandSender sender, String[] params) {

    MinecraftServer var3 = MinecraftServer.getServer();
    EntityPlayerMP var4;

    var4 = getCommandSenderAsPlayer(sender);

    int t0ID =
        TFC_Climate.getTreeLayer(
            var4.worldObj, (int) var4.posX, (int) var4.posY, (int) var4.posZ, 0);
    int t1ID =
        TFC_Climate.getTreeLayer(
            var4.worldObj, (int) var4.posX, (int) var4.posY, (int) var4.posZ, 1);
    int t2ID =
        TFC_Climate.getTreeLayer(
            var4.worldObj, (int) var4.posX, (int) var4.posY, (int) var4.posZ, 2);

    String t0 = EnumTree.values()[t0ID].name();
    String t1 = EnumTree.values()[t1ID].name();
    String t2 = EnumTree.values()[t2ID].name();

    throw new PlayerNotFoundException("Tree 0: " + t0 + "   Tree 1: " + t1 + "   Tree 2: " + t2);
  }
コード例 #2
0
ファイル: ClientProxy.java プロジェクト: dotpixel/TFCraft
  @Override
  public int foliageColorMultiplier(IBlockAccess par1IBlockAccess, int i, int j, int k) {
    // int var5 = 0;
    // int var6 = 0;
    // int var7 = 0;
    int[] rgb = {0, 0, 0};
    float temperature =
        TFC_Climate.getHeightAdjustedTempSpecificDay(
            getCurrentWorld(), TFC_Time.getDayOfYear(), i, j, k);
    // float rainfall = TFC_Climate.getRainfall(getCurrentWorld(),i,j,k);

    int meta = par1IBlockAccess.getBlockMetadata(i, j, k);
    if (par1IBlockAccess.getBlock(i, j, k) == TFCBlocks.fruitTreeLeaves)
    //			if(TFC_Time.currentMonth >= TFC_Time.September && TFC_Time.currentMonth <
    // TFC_Time.December)
    //			{
    //				int var10 = ColorizerFoliageTFC.getFoliageYellow();
    //				rgb = applyColor(var10, rgb);
    //
    //				int x = (rgb[0] / 9 & 255) << 16 | (rgb[1] / 9 & 255) << 8 | rgb[2] / 9 & 255;
    //				return x;
    //			}
    //			else
    {
      for (int var8 = -1; var8 <= 1; ++var8) {
        for (int var9 = -1; var9 <= 1; ++var9) {
          int var10 = TFC_Climate.getFoliageColor(getCurrentWorld(), i + var8, j, k + var9);
          rgb = applyColor(var10, rgb);
        }
      }
      int x = (rgb[0] / 9 & 255) << 16 | (rgb[1] / 9 & 255) << 8 | rgb[2] / 9 & 255;
      return x;
    } else if (par1IBlockAccess.getBlock(i, j, k) == TFCBlocks.Vine) {
      if (TFC_Time.getSeasonAdjustedMonth(k) >= 6
          && TFC_Time.getSeasonAdjustedMonth(k) < 9
          && !(TFC_Climate.getCacheManager(getCurrentWorld()).getEVTLayerAt(i, k).floatdata1 < 0.8)
          && TFC_Climate.getHeightAdjustedTemp(getCurrentWorld(), i, j, k) < 30) {
        int color = 0;
        for (int var8 = -1; var8 <= 1; ++var8) {
          for (int var9 = -1; var9 <= 1; ++var9) {
            color = (TFC_Climate.getFoliageColor(getCurrentWorld(), i + var8, j, k + var9));
            rgb = applyColor(color, rgb);
          }
        }
        int x = (rgb[0] / 9 & 255) << 16 | (rgb[1] / 9 & 255) << 8 | rgb[2] / 9 & 255;
        return x;
      } else if (TFC_Time.getSeasonAdjustedMonth(k) >= 11
          || TFC_Time.getSeasonAdjustedMonth(k) <= 0
              && !(TFC_Climate.getCacheManager(getCurrentWorld()).getEVTLayerAt(i, k).floatdata1
                  < 0.8)
              && TFC_Climate.getHeightAdjustedTemp(getCurrentWorld(), i, j, k) < 30) {
        for (int var8 = -1; var8 <= 1; ++var8) {
          for (int var9 = -1; var9 <= 1; ++var9) {
            int color = (TFC_Climate.getFoliageColor(getCurrentWorld(), i + var8, j, k + var9));
            rgb = applyColor(color, rgb);
          }
        }
        int x = (rgb[0] / 9 & 255) << 16 | (rgb[1] / 9 & 255) << 8 | rgb[2] / 9 & 255;
        return x;
      } else if (TFC_Time.getSeasonAdjustedMonth(k) >= 9
          && !(TFC_Climate.getCacheManager(getCurrentWorld()).getEVTLayerAt(i, k).floatdata1 < 0.8)
          && TFC_Climate.getHeightAdjustedTemp(getCurrentWorld(), i, j, k) < 30) {
        for (int var8 = -1; var8 <= 1; ++var8) {
          for (int var9 = -1; var9 <= 1; ++var9) {
            int color = ColorizerFoliageTFC.getFoliageDead();
            rgb = applyColor(color, rgb);
          }
        }
        int x = (rgb[0] / 9 & 255) << 16 | (rgb[1] / 9 & 255) << 8 | rgb[2] / 9 & 255;
        return x;
      } else {
        for (int var8 = -1; var8 <= 1; ++var8) {
          for (int var9 = -1; var9 <= 1; ++var9) {
            int color = (TFC_Climate.getFoliageColor(getCurrentWorld(), i + var8, j, k + var9));
            rgb = applyColor(color, rgb);
          }
        }
        int x = (rgb[0] / 9 & 255) << 16 | (rgb[1] / 9 & 255) << 8 | rgb[2] / 9 & 255;
        return x;
      }
    } else if (TFC_Time.getSeasonAdjustedMonth(k) >= 6 && EnumTree.values()[meta].isEvergreen) {
      for (int var8 = -1; var8 <= 1; ++var8) {
        for (int var9 = -1; var9 <= 1; ++var9) {
          int var10 =
              TFC_Climate.getFoliageColorEvergreen(getCurrentWorld(), i + var8, j, k + var9);
          rgb = applyColor(var10, rgb);
        }
      }
      int x = (rgb[0] / 9 & 255) << 16 | (rgb[1] / 9 & 255) << 8 | rgb[2] / 9 & 255;
      return x;
    } else if (temperature <= 10
        && TFC_Time.getSeasonAdjustedMonth(k) >= 6
        && TFC_Time.getSeasonAdjustedMonth(k) < 9
        && (meta == 4 || meta == 7 || meta == 5 || meta == 14)) {
      int color = 0;
      // Get the fade multiplie
      for (int var8 = -1; var8 <= 1; ++var8) {
        for (int var9 = -1; var9 <= 1; ++var9) {
          color = ColorizerFoliageTFC.getFoliageYellow();
          rgb = applyColor(color, rgb);
        }
      }
      int x = (rgb[0] / 9 & 255) << 16 | (rgb[1] / 9 & 255) << 8 | rgb[2] / 9 & 255;
      return x;
    } else if (temperature <= 10
        && TFC_Time.getSeasonAdjustedMonth(k) >= 6
        && TFC_Time.getSeasonAdjustedMonth(k) < 9
        && (meta == 6)) {
      for (int var8 = -1; var8 <= 1; ++var8) {
        for (int var9 = -1; var9 <= 1; ++var9) {
          int var10 = ColorizerFoliageTFC.getFoliageRed();
          rgb = applyColor(var10, rgb);
        }
      }
      int x = (rgb[0] / 9 & 255) << 16 | (rgb[1] / 9 & 255) << 8 | rgb[2] / 9 & 255;
      return x;
    } else if (temperature <= 10
        && TFC_Time.getSeasonAdjustedMonth(k) >= 6
        && TFC_Time.getSeasonAdjustedMonth(k) < 9
        && !(meta == 15)) {
      for (int var8 = -1; var8 <= 1; ++var8) {
        for (int var9 = -1; var9 <= 1; ++var9) {
          int var10 = ColorizerFoliageTFC.getFoliageOrange();
          rgb = applyColor(var10, rgb);
        }
      }
      int x = (rgb[0] / 9 & 255) << 16 | (rgb[1] / 9 & 255) << 8 | rgb[2] / 9 & 255;
      return x;
    } else if (temperature <= 8 && TFC_Time.getSeasonAdjustedMonth(k) >= 6 && !(meta == 15)) {
      for (int var8 = -1; var8 <= 1; ++var8) {
        for (int var9 = -1; var9 <= 1; ++var9) {
          int var10 = ColorizerFoliageTFC.getFoliageDead();
          rgb = applyColor(var10, rgb);
        }
      }
      int x = (rgb[0] / 9 & 255) << 16 | (rgb[1] / 9 & 255) << 8 | rgb[2] / 9 & 255;
      return x;
    } else {
      for (int var8 = -1; var8 <= 1; ++var8) {
        for (int var9 = -1; var9 <= 1; ++var9) {
          int var10 = TFC_Climate.getFoliageColor(getCurrentWorld(), i + var8, j, k + var9);
          rgb = applyColor(var10, rgb);
        }
      }
      int x = (rgb[0] / 9 & 255) << 16 | (rgb[1] / 9 & 255) << 8 | rgb[2] / 9 & 255;
      return x;
    }
  }