Examples of ChestWindow


Examples of org.spout.vanilla.inventory.window.block.chest.ChestWindow

  @Override
  public boolean open(Player player) {
    ChestOpenEvent event = player.getEngine().getEventManager().callEvent(new ChestOpenEvent(this, player));
    if (!event.isCancelled()) {
      // Finally open the window
      player.get(WindowHolder.class).openWindow(new ChestWindow(player, this));
      SoundEffects.RANDOM_CHESTOPEN.playGlobal(player.getPhysics().getPosition());
      super.open(player);
      return true;
    }
    return false;
View Full Code Here

Examples of org.spout.vanilla.inventory.window.block.chest.ChestWindow

    if (event instanceof PlayerInteractEntityEvent) {
      final PlayerInteractEntityEvent pie = (PlayerInteractEntityEvent) event;
      final Player player = (Player) pie.getEntity();
      switch (pie.getAction()) {
        case RIGHT_CLICK:
          player.add(WindowHolder.class).openWindow(new ChestWindow(player, getInventory(), "Minecart"));
      }
    }
    super.onInteract(event);
  }
View Full Code Here

Examples of org.spout.vanilla.inventory.window.block.chest.ChestWindow

    WindowType type = args.popEnumValue("type", WindowType.class);
    args.assertCompletelyParsed();

    switch (type) {
      case CHEST:
        player.get(WindowHolder.class).openWindow(new ChestWindow(player, new Chest()));
        break;
      case CRAFTING_TABLE:
        player.get(WindowHolder.class).openWindow(new CraftingTableWindow(player));
        break;
      case FURNACE:
View Full Code Here

Examples of org.spout.vanilla.inventory.window.block.chest.ChestWindow

    switch (message.getType()) {
      case DEFAULT:
        break;
      case CHEST:
        ChestInventory inventory = new ChestInventory(message.getSlots());
        player.get(WindowHolder.class).openWindow(new ChestWindow(player, inventory, title));
        break;
      case CRAFTING_TABLE:
        player.get(WindowHolder.class).openWindow(new CraftingTableWindow(player, title));
        break;
      case FURNACE:
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.