Package org.spout.vanilla.material.map

Examples of org.spout.vanilla.material.map.Map


    }
    ItemStack i = inventory.getQuickbar().getSelectedSlot().get();
    if (i == null || !(i.getMaterial() instanceof Map)) {
      throw new CommandException("Held item is not a map");
    }
    Map m = (Map) i.getMaterial();
    int bx = args.popInteger("bx");
    int by = args.popInteger("by");
    int tx = args.popInteger("tx");
    int ty = args.popInteger("ty");
    int col = args.popInteger("col");
    args.assertCompletelyParsed();

    if (bx < 0 || bx >= m.getWidth()) {
      throw new CommandException("bx component is out of range");
    }
    if (by < 0 || by >= m.getHeight()) {
      throw new CommandException("by component is out of range");
    }
    if (tx < 0 || tx >= m.getWidth()) {
      throw new CommandException("tx component is out of range");
    }
    if (ty < 0 || ty >= m.getHeight()) {
      throw new CommandException("ty component is out of range");
    }
    if (bx > tx) {
      throw new CommandException("bx cannot be greater than tx");
    }
    if (by > ty) {
      throw new CommandException("by cannot be greater than ty");
    }
    for (ProtocolEvent e : m.drawRectangle(i, bx, by, tx, ty, col)) {
      player.getNetwork().callProtocolEvent(e);
    }
  }
View Full Code Here


    }
    ItemStack i = inventory.getQuickbar().getSelectedSlot().get();
    if (i == null || !(i.getMaterial() instanceof Map)) {
      throw new CommandException("Held item is not a map");
    }
    Map m = (Map) i.getMaterial();
    int col = args.popInteger("col");
    for (ProtocolEvent e : m.flood(i, col)) {
      player.getNetwork().callProtocolEvent(e);
    }
  }
View Full Code Here

TOP

Related Classes of org.spout.vanilla.material.map.Map

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.