Examples of DyeColor


Examples of org.bukkit.DyeColor

    int x1 = 2;
    int x2 = x1 + 12;
    int z1 = 2;
    int z2 = z1 + 12;
   
    DyeColor coreColor = odds.getRandomColor();
    DyeColor detailColor = odds.getRandomColor();
   
    Material emptyMaterial = Material.AIR;
    for (int i = 0; i < 7; i++) {
      int y = y1 + i * 2;
      chunk.setClayWalls(x1 + i, x2 - i, y, y + 2, z1 + i, z2 - i, coreColor);
View Full Code Here

Examples of org.bukkit.DyeColor

    // if we have not placed something in the center... place a "ART!" like thingy
    if (somethingInTheCenter) {
     
      // simple glass or colored blocks?
      boolean crystalArt = chunkOdds.playOdds(Odds.oddsLikely);
      DyeColor solidColor = chunkOdds.getRandomColor();
      boolean multiColorArt = chunkOdds.playOdds(Odds.oddsLikely);
     
      // now the "art"
      for (int x = 6; x < 10; x++)
        for (int y = y1 + 4; y < y1 + 8; y++)
          for (int z = 6; z < 10; z++) {
           
            // pick a color
            DyeColor blockColor = multiColorArt ? chunkOdds.getRandomColor() : solidColor;
           
            // place a block
            if (chunkOdds.flipCoin())
              chunk.setThinGlass(x, y, z, blockColor);
            else
View Full Code Here

Examples of org.bukkit.DyeColor

  private final static Material matLog = Material.LOG;
 
  public void generateCampground(WorldGenerator generator, RealChunk chunk, DataContext context, Odds odds, int baseY) {
   
    // what are we made of?
    DyeColor matColor = odds.getRandomColor();
    boolean matCamo = odds.playOdds(Odds.oddsSomewhatUnlikely);
   
    // direction?
    if (odds.flipCoin()) {
     
View Full Code Here

Examples of org.bukkit.DyeColor

   
    // string please
    if (attachString(chunk, balloonX, attachY, balloonY1, balloonZ)) {
     
      // pick the colors
      DyeColor primaryColor = getPrimaryColor(generator, odds);
      DyeColor secondaryColor = getSecondaryColor(generator, odds);
     
      // draw the balloon
      chunk.setWool(balloonX, balloonX + 1, balloonY1, balloonY1 + 2, balloonZ, balloonZ + 1, primaryColor);
     
      chunk.setWool(balloonX - 1, balloonX + 2, balloonY1 + 2, balloonY1 + 4, balloonZ - 1, balloonZ + 2, primaryColor);
View Full Code Here

Examples of org.bukkit.DyeColor

   
    // are we attached?
    if (strung) {
     
      // pick the colors
      DyeColor primaryColor = getPrimaryColor(generator, odds);
      DyeColor secondaryColor = getSecondaryColor(generator, odds);
     
      // draw the bottom of the blimp
      chunk.setCircle(8, 8, 3, balloonY1 - 1, Material.WOOL, primaryColor);
      chunk.setCircle(8, 8, 4, balloonY1, balloonY1 + 3, Material.WOOL, primaryColor);
      chunk.setCircle(8, 8, 5, balloonY1 + 3, balloonY1 + 7, Material.WOOL, primaryColor);
      chunk.setCircle(8, 8, 6, balloonY1 + 7, Material.WOOL, primaryColor);
     
      // middle of the blimp
      int step = 2 + odds.getRandomInt(4);
      int y = balloonY1 + 8;
      do {
        DyeColor color = primaryColor;
        if (y % step != 0)
          color = secondaryColor;
        chunk.setCircle(8, 8, 6, y, Material.WOOL, color);
        y++;
      } while (y < balloonY2 - 3);
View Full Code Here

Examples of org.bukkit.DyeColor

      List<Entity> entities = entity.getNearbyEntities(radius, 2, radius);
      for (Entity i : entities) {
        if (EntityType.SHEEP.equals(i.getType())) {
          Sheep sheep = (Sheep) i;
          if ((shears > 0) && (!sheep.isSheared())) {
            DyeColor color = sheep.getColor();
            byte data = color.getData();
            wool[data] += 1 + ((int) (Math.random() * 2.0));
            sheep.setSheared(true);
            --shears;
          }
        }
 
View Full Code Here

Examples of org.bukkit.DyeColor

    public static BannerPattern fromNBT(List<CompoundTag> tag) {
        BannerPattern.Builder builder = BannerPattern.builder();
        for (CompoundTag layer : tag) {
            BannerPattern.LayerTexture type = BannerPattern.LayerTexture.getByCode(layer.getString("Pattern"));
            DyeColor color = DyeColor.getByDyeData((byte) layer.getInt("Color"));
            builder.layer(type, color);
        }
        return builder.build();
    }
View Full Code Here

Examples of org.bukkit.DyeColor

          if (mat == null)
            return def;
          tdat.setMaterial(mat);
        } else if (dat instanceof Wool) {
          Wool wdat = (Wool) dat;
          DyeColor color = parseEnum(DyeColor.class, text, null);
          if (color == null)
            return def;
          wdat.setColor(color);
        } else if (dat instanceof Tree) {
          Tree tdat = (Tree) dat;
View Full Code Here

Examples of org.bukkit.DyeColor

      else css.write(String.format("{ background-position: -%dpx -%dpx; }\n",
        terrain_png_size * (x % 16), terrain_png_size * (x / 16)));

      if ((bd.getMaterial().getNewData((byte) 0) instanceof Colorable))
      {
        DyeColor color = DyeColor.getByWoolData(bd.getData());
        String hex = ColorConverter.dyeToHex(color);
        css.write(String.format("%s { color: %s; }\n", selector, hex));
      }
    }

View Full Code Here

Examples of org.bukkit.DyeColor

  public String getDisplayName()
  {
    String bname = getMaterial().name().replaceAll("_+", " ");
    if ((getMaterial().getNewData((byte) 0) instanceof Colorable))
    {
      DyeColor color = DyeColor.getByWoolData(getData());
      ChatColor chatColor = ColorConverter.dyeToChat(color);

      String colorName = color.name().replaceAll("_+", " ");
      bname = chatColor + colorName + " " + bname + ChatColor.RESET;

    }
    return bname;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.