Package org.spout.api.material

Examples of org.spout.api.material.Material


  }

  @Override
  public float getCost(BlockSource source, PathPoint point) {
    Vector3f pos = point.getVector();
    Material above = source.getMaterialAt(pos.add(UP));
    Material below = source.getMaterialAt(pos.add(DOWN));
    Material in = source.getMaterialAt(pos);
    if (above == VanillaMaterials.WEB || in == VanillaMaterials.WEB) {
      return 1F;
    }
    if (below == VanillaMaterials.SOUL_SAND || below == VanillaMaterials.ICE) {
      return 1F;
View Full Code Here


  }

  @Override
  public boolean isPassable(BlockSource source, PathPoint point) {
    Vector3f pos = point.getVector();
    Material above = source.getMaterialAt(pos.add(UP));
    Material below = source.getMaterialAt(pos.add(DOWN));
    Material in = source.getMaterialAt(pos);
    if (!(below instanceof BlockMaterial) || !canStandOn(below)) {
      return false;
    }
    return !(!canStandIn(above) || !canStandIn(in));
  }
View Full Code Here

      if (!(trunk.getMaterial() instanceof Log)) {
        return;
      }
      trunk = trunk.translate(BlockFace.TOP);
    }
    Material trunkMaterial = trunk.getMaterial();
    if (expectHeight == 3) {
      trunk = b;
      for (int i = 0; i < expectHeight + 1; i++) {
        trunk.setMaterial(BlockMaterial.AIR);
        trunk = trunk.translate(BlockFace.TOP);
View Full Code Here

      // Set velocity y to above (0.2)
      velocity = velocity.mul(1.0, 0.0, 1.0).add(0.0, 0.2, 0.0);
      velocity = velocity.add(0.045 * rand.nextGaussian(), 0.045 * rand.nextGaussian(), 0.045 * rand.nextGaussian());

      Effect shootEffect;
      Material material = item.getMaterial();
      //TODO: Implement the following 'special' shoot cases:
      // - eggs, arrows, fireballs and snowballs
      // - potions, exp. bottles, monster eggs
      // - armor,

      if (material.equals(VanillaMaterials.ARROW)) {
        shootEffect = GeneralEffects.RANDOM_BOW;
        toLaunch = new Arrow();
      } else if (material.equals(VanillaMaterials.EGG)) {
        shootEffect = GeneralEffects.RANDOM_BOW;
        //TODO: Spawn
      } else if (material.equals(VanillaMaterials.SNOWBALL)) {
        shootEffect = GeneralEffects.RANDOM_BOW;
        //TODO: Spawn
      } else if (material instanceof PotionItem && ((PotionItem) material).isSplash()) {
        shootEffect = GeneralEffects.RANDOM_BOW;
        //TODO: Spawn
      } else if (material.equals(VanillaMaterials.BOTTLE_O_ENCHANTING)) {
        shootEffect = GeneralEffects.RANDOM_BOW;
        //TODO: Spawn
      } else if (material instanceof SpawnEgg) {
        shootEffect = GeneralEffects.RANDOM_BOW;
        //TODO: Spawn
      } else if (material.equals(VanillaMaterials.FIRE_CHARGE)) {
        shootEffect = GeneralEffects.SHOOT_FIREBALL;
        //TODO: Spawn
      } else {
        shootEffect = GeneralEffects.RANDOM_CLICK1;
        position = position.sub(0.0, 0.3, 0.0);
View Full Code Here

TOP

Related Classes of org.spout.api.material.Material

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.