Package com.bergerkiller.bukkit.common

Examples of com.bergerkiller.bukkit.common.FromToCounter


    final boolean hasPing = ping != null && ping.length > 0;
    if (!hasText && !hasPing) {
      return;
    }
    // Initialize all counters
    FromToCounter counterX = new FromToCounter(x1, x2);
    FromToCounter counterY = new FromToCounter(y1, y2);
    FromToCounter textCounter = new FromToCounter();
    FromToCounter pingCounter = new FromToCounter();
    if (hasText) {
      textCounter.reset(0, text.length - 1);
    }
    if (hasPing) {
      pingCounter.reset(0, ping.length - 1);
    }
    // Start processing the area
    while (counterX.hasNext()) {
      counterX.next();
      counterY.reset();
      while (counterY.hasNext()) {
        counterY.next();
        if (textCounter.hasNext()) {
          if (pingCounter.hasNext()) {
            // Text and ping are available
            set(counterX.get(), counterY.get(), text[textCounter.next()], ping[pingCounter.next()]);
          } else {
            // Only text is available
            setText(counterX.get(), counterY.get(), text[textCounter.next()]);
          }
        } else if (pingCounter.hasNext()) {
          // Only ping is available
          setPing(counterX.get(), counterY.get(), ping[pingCounter.next()]);
        }
      }
    }
  }
View Full Code Here


   */
  public void fillArea(int x1, int y1, int x2, int y2, String text, int ping) {
    boundsCheck(x1, y1);
    boundsCheck(x2, y2);
    // Initialize all counters
    FromToCounter counterX = new FromToCounter(x1, x2);
    FromToCounter counterY = new FromToCounter(y1, y2);
    // Start processing the area
    while (counterX.hasNext()) {
      counterX.next();
      counterY.reset();
      while (counterY.hasNext()) {
        counterY.next();
        set(counterX.get(), counterY.get(), text, ping);
      }
    }
  }
View Full Code Here

TOP

Related Classes of com.bergerkiller.bukkit.common.FromToCounter

Copyright © 2018 www.massapicom. 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.