Package com.bergerkiller.bukkit.tc.properties

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


        this.doPhysics(1);
      }
    } catch (GroupUnloadedException ex) {
      //this group is gone
    } catch (Throwable t) {
      final TrainProperties p = getProperties();
      TrainCarts.plugin.log(Level.SEVERE, "Failed to perform physics on train '" + p.getTrainName() + "' at " + p.getLocation() + ":");
      TrainCarts.plugin.handle(t);
    }
  }
View Full Code Here


    if (g1 != g2) {
      if (m1.isDerailed() || m2.isDerailed()) {
        return false;
      }
      //Can the two groups bind?
      TrainProperties prop1 = g1.getProperties();
      TrainProperties prop2 = g2.getProperties();

      //Is a powered minecart required?
      if (prop1.requirePoweredMinecart || prop2.requirePoweredMinecart) {
        if (g1.size(EntityType.MINECART_FURNACE) == 0 && g2.size(EntityType.MINECART_FURNACE) == 0) {
          return false;
View Full Code Here

        sender.sendMessage("Can not edit a train through the console!");
        return true;
      }
      if (args.length == 2) {
        String name = args[1];
        TrainProperties prop = TrainProperties.exists(name) ? TrainProperties.get(name) : null;
        if (prop != null && !prop.isEmpty()) {
          if (prop.hasOwnership((Player) sender)) {
            CartPropertiesStore.setEditing((Player) sender, prop.get(0));
            sender.sendMessage(ChatColor.GREEN + "You are now editing train '" + prop.getTrainName() + "'!")
          } else {
            sender.sendMessage(ChatColor.RED + "You do not own this train and can not edit it!");
          }
          return true;
        } else {
View Full Code Here

        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 false;
  }

  @Override
  public boolean handle(MinecartGroup group, String text, SignActionEvent event) {
    TrainProperties prop = group.getProperties();
    String lower = text.toLowerCase();
    if (match(maxspeed, lower)) {
      return Util.evaluate(prop.getSpeedLimit(), text);
    } else if (match(playerEnter, lower)) {
      return prop.getPlayersEnter();
    } else if (match(playerExit, lower)) {
      return prop.getPlayersExit();
    } else if (match(mobEnter, lower)) {
      return prop.mobCollision == CollisionMode.ENTER;
    }

    // Perform checks on cart properties
View Full Code Here

    return group.getProperties().isTrainRenamed();
  }

  @Override
  public boolean handleArray(MinecartGroup group, String[] text, SignActionEvent event) {
    TrainProperties prop = group.getProperties();
    for (String name : text) {
      if (prop.getTrainName().equals(name)) {
        return true;
      }
    }
    return false;
  }
View Full Code Here

TOP

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

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.