Package org.bukkit

Examples of org.bukkit.Material


    }
    List<String> tags = new ArrayList<String>();
    for (int i = 0; i < blocks.length; i++){
      String mat;
      try{
        Material temp = Material.getMaterial(i);
        if (!temp.isBlock()) continue;
        mat = temp.toString();
      }
      catch(Exception e){
        mat = "?";
      }
      tags.clear();
View Full Code Here


        final org.bukkit.block.Block block = event.getBlock();
        if (block == null) return;
        final int blockY = block.getY();

        final Material mat = block.getType();

        final MovingData data = MovingData.getData(player);
        if (!creativeFly.isEnabled(player) && !survivalFly.isEnabled(player)) return;

        if (!data.hasSetBack() || blockY + 1D < data.getSetBackY()) return;
View Full Code Here

  public boolean check(final Player player, final Block block, final String[] lines) {
    // TODO: Might want to reset time + hash ?
    final long time = System.currentTimeMillis();
    tags.clear();
    final BlockPlaceData data = BlockPlaceData.getData(player);
    Material mat = block.getType();
    if (mat == Material.SIGN_POST || mat == Material.WALL_SIGN) {
      mat = Material.SIGN;
    }
    if (data.autoSignPlacedHash != BlockPlaceListener.getBlockPlaceHash(block, mat)){
      tags.add("block_mismatch");
View Full Code Here

import fr.neatmonster.nocheatplus.config.RawConfigFile;

public class TestConfig {
 
  private void testReadMaterial(String input, Material expectedMat) {
    Material mat = RawConfigFile.parseMaterial(input);
    if (expectedMat != mat) {
      fail("Expected " + expectedMat + " for input '" + input + "', got instead: " + mat);
    }
  }
View Full Code Here

    } else return entityHeight;
  }

  @Override
  public AlmostBoolean isBlockSolid(final int id) {
    @SuppressWarnings("deprecation")
    final Material mat = Material.getMaterial(id);
    if (mat == null) {
      return AlmostBoolean.MAYBE;
    }
    else {
      return AlmostBoolean.match(mat.isSolid());
    }
  }
View Full Code Here

    }
  }

  @Override
  public AlmostBoolean isBlockLiquid(final int id) {
    @SuppressWarnings("deprecation")
    final Material mat = Material.getMaterial(id);
    if (mat == null) return AlmostBoolean.MAYBE;
    switch (mat) {
      case STATIONARY_LAVA:
      case STATIONARY_WATER:
View Full Code Here

      data.instantEatInteract = data.lastClickTime = time;
      return false;
    }
    // Check exceptions.
    final InventoryConfig cc = InventoryConfig.getConfig(player);
    final Material mat = stack == null ? null : stack.getType();
    if (mat != null){
      if (cc.fastConsumeWhitelist){
        if (!cc.fastConsumeItems.contains(mat)){
          return false;
        }
View Full Code Here

        // @tags
        // None
        // -->
        if (mechanism.matches("item_type") && mechanism.requireObject(dItem.class)) {
            dItem item = mechanism.getValue().asType(dItem.class);
            Material mat = item.getMaterial().getMaterial();
            int data = item.getMaterial().getData((byte)0);
            switch (getEntity().getType()) {
                case DROPPED_ITEM:
                    ((org.bukkit.entity.Item) getEntity()).getItemStack().setType(mat);
                    ((ItemController.ItemNPC) getEntity()).setType(mat, data);
View Full Code Here

        }
    }

    @EventHandler
    public void onBlockCanBuild(BlockCanBuildEvent event) {
        Material mat = event.getMaterial();

        if (mat.equals(Material.CACTUS)) {
            event.setBuildable(true);
        }
    }
View Full Code Here

   *
   * FIXME: this allocates new MaterialTypes even for a search
   */
  private MaterialTypeImpl match(String item, Byte data) {
   
    Material material;
    if (numIdPattern.matcher(item).matches()) {
      int id = Integer.parseInt(item);
     
      material = Material.getMaterial(id);
      if (material == null)
View Full Code Here

TOP

Related Classes of org.bukkit.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.