Package com.bergerkiller.bukkit.tc.properties

Examples of com.bergerkiller.bukkit.tc.properties.CartProperties


  @EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
  public void onVehicleEnter(VehicleEnterEvent event) {
    MinecartMember<?> member = MinecartMemberStore.get(event.getVehicle());
    if (member != null && member.isInteractable()) {
      CartProperties prop = member.getProperties();
      if (event.getEntered() instanceof Player) {
        Player player = (Player) event.getEntered();
        if (prop.getPlayersEnter() && (prop.isPublic() || prop.hasOwnership(player))) {
          prop.showEnterMessage(player);
        } else {
          event.setCancelled(true);
        }
      } else if (member.getGroup().getProperties().mobCollision != CollisionMode.ENTER) {
        event.setCancelled(true);
View Full Code Here


        return false;
      }
      Permission.COMMAND_PROPERTIES.handle(sender);
      //editing?
      Player player = (Player) sender;
      CartProperties cprop = CartProperties.getEditing(player);
      if (cprop == null) {
        Localization.EDIT_NOSELECT.message(player);
        return true;
      }
      String cmd = args[0];
      args = StringUtil.remove(args, 0);
      if (command.equalsIgnoreCase("train")) {
        TrainProperties prop = cprop.getTrainProperties();
        if (prop.hasOwnership(player)) {
          return TrainCommands.execute(player, prop, cmd, args);
        } else {
          Localization.EDIT_NOTOWNED.message(player);
          return true;
        }
      } else if (command.equalsIgnoreCase("cart")) {
        CartProperties prop = cprop;
        if (prop.hasOwnership(player)) {
          return CartCommands.execute(player, prop, cmd, args);
        } else {
          Localization.EDIT_NOTOWNED.message(player);
          return true;
        }
View Full Code Here

    return super.handle(group, text, event);
  }

  @Override
  public boolean handle(MinecartMember<?> member, String text, SignActionEvent event) {
    CartProperties prop = member.getProperties();
    String lower = text.toLowerCase();
    if (match(playerEnter, lower)) {
      return prop.getPlayersEnter();
    } else if (match(playerExit, lower)) {
      return prop.getPlayersExit();
    }
    return false;
  }
View Full Code Here

  }

  @Override
  public boolean click(SignActionEvent info, Player player) {
    //get the train this player is editing
    CartProperties cprop = CartProperties.getEditing(player);
    if (cprop == null) {
      if (Permission.COMMAND_PROPERTIES.has(player)) {
        Localization.EDIT_NOSELECT.message(player);
      } else {
        Localization.EDIT_NOTALLOWED.message(player);
      }
      return true;
    }
    IProperties prop;
    if (info.isTrainSign()) {
      prop = cprop.getTrainProperties();
    } else if (info.isCartSign()) {
      prop = cprop;
    } else {
      return false;
    }
View Full Code Here

TOP

Related Classes of com.bergerkiller.bukkit.tc.properties.CartProperties

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.