Package org.spout.vanilla.component.entity.player

Examples of org.spout.vanilla.component.entity.player.HUD


      return;
    }

    Player player = ((Client) plugin.getEngine()).getPlayer();

    HUD HUD = player.add(org.spout.vanilla.component.entity.player.HUD.class);
    HUD.setDefault(VanillaArmorWidget.class);
    HUD.setDefault(VanillaQuickbar.class);
    HUD.setDefault(VanillaCrosshair.class);
    HUD.setDefault(VanillaExpBar.class);
    HUD.setDefault(VanillaDrowning.class);
    HUD.setDefault(VanillaHunger.class);
    HUD.setupHUD();
    HUD.openHUD();

    // TODO remove comments when Spout only uses fallback
    //player.add(PlayerMovementExecutor.class);

    // Remove Head and default Camera
View Full Code Here


    if (name.startsWith("quickbar_")) {
      Player player = (Player) source;
      PlayerInventory inventory = player.get(PlayerInventory.class);
      if (inventory != null) {
        QuickbarInventory quickbar = inventory.getQuickbar();
        HUD hud = player.get(HUD.class);
        int newSlot = quickbar.getSelectedSlot().getIndex();
        if (name.endsWith("left")) {
          newSlot++;
          if (newSlot > 8) {
            newSlot = 0;
          }
        } else if (name.endsWith("right")) {
          newSlot--;
          if (newSlot < 0) {
            newSlot = 8;
          }
        } else {
          newSlot = Integer.parseInt(name.substring(name.indexOf('_') + 1)) - 1;
        }

        quickbar.setSelectedSlot(newSlot);
        hud.getQuickbar().update();
      }
    }
  }
View Full Code Here

      case CLIENT:
        if (!(getOwner() instanceof Player)) {
          return;
        }

        HUD HUD = getOwner().get(org.spout.vanilla.component.entity.player.HUD.class);
        HUD.getHungerMeter().animate();

        break;
    }
  }
View Full Code Here

        final float maxSecsBubbles = VanillaData.AIR_SECS.getDefaultValue();
        final float secsBubbles = getData().get(VanillaData.AIR_SECS);
        if (secsBubbles == maxSecsBubbles) {
          hideBubbles();
        } else {
          HUD hud = getOwner().get(HUD.class);
          if (hud != null) {
            hud.getAirMeter().update();
          }
        }
        break;
    }
  }
View Full Code Here

  /**
   * Hide bubbles in the GUI
   */
  public void hideBubbles() {
    HUD hud = owner.get(HUD.class);
    if (hud != null) {
      hud.getAirMeter().hide();
    }
  }
View Full Code Here

  /**
   * Show bubbles in the GUI
   */
  public void showBubbles() {
    HUD hud = owner.get(HUD.class);
    if (hud != null) {
      hud.getAirMeter().show();
    }
  }
View Full Code Here

TOP

Related Classes of org.spout.vanilla.component.entity.player.HUD

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.