Example #1
0
  public static Item createAtLocation(Point3D location, int graphic, int amount) {
    long serial = ObjectRegistry.get().registerItemSerial();

    Item item = new Item(serial, graphic);
    item.setLocation(location);
    item.setAmount(amount);
    ObjectRegistry.get().registerObject(item);

    return item;
  }
Example #2
0
  public static Item createEquipped(Mobile on, int graphic, int hue) {
    long serial = ObjectRegistry.get().registerItemSerial();

    Item item = new Item(serial, graphic);
    item.setParent(on);
    item.setHue(hue);
    item.setLocation(new Point3D(0, 0, 0));
    ObjectRegistry.get().registerObject(item);
    on.equipItem(item);

    return item;
  }
Example #3
0
  public static Item createInContainer(Item container, int graphic, int amount) {
    long serial = ObjectRegistry.get().registerItemSerial();
    if (container == null) {
      log.severe("tried to create item in null-container");
      return null;
    }

    Item item = new Item(serial, graphic);
    item.setLocation(container.getRandomContainerLocation());
    item.setParent(container);
    item.setAmount(amount);
    ObjectRegistry.get().registerObject(item);
    container.addChild(item, item.getLocation());

    return item;
  }