Package com.bergerkiller.bukkit.tc.controller.components

Examples of com.bergerkiller.bukkit.tc.controller.components.RailTracker


    if (member.getEntity().vel.getY() > 0.0) {
      // Only if we came from a vertical rail do we allow this to be used
      // In all other cases, we will no longer be using this (horizontal) rail.
      // If we came from a vertical rail and need to move onto a slope
      // Vertical -> Slope UP
      RailTracker railTracker = member.getRailTracker();
      if (railTracker.getLastRailType() == RailType.VERTICAL) {
        IntVector3 nextPos = pos.add(railTracker.getLastLogic().getDirection());
        Material type = WorldUtil.getBlockType(world, nextPos.x, nextPos.y, nextPos.z);
        int data = WorldUtil.getBlockData(world, nextPos);
        if (this.isRail(type, data)) {
          // Check that the direction of the rail is correct
          Rails rails = CommonUtil.tryCast(BlockUtil.getData(type, data), Rails.class);
          BlockFace lastDirection = railTracker.getLastLogic().getDirection();
          if (rails != null && rails.isOnSlope() && rails.getDirection() == lastDirection) {
            // We got a winner!
            // Some position and velocity adjustment prior to moving between the types
            CommonMinecart<?> entity = member.getEntity();
            entity.loc.xz.set(nextPos.x + 0.5, nextPos.z + 0.5);
View Full Code Here

TOP

Related Classes of com.bergerkiller.bukkit.tc.controller.components.RailTracker

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.