当前位置: 首页>>代码示例>>Java>>正文


Java Material.isBlock方法代码示例

本文整理汇总了Java中org.bukkit.Material.isBlock方法的典型用法代码示例。如果您正苦于以下问题:Java Material.isBlock方法的具体用法?Java Material.isBlock怎么用?Java Material.isBlock使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.bukkit.Material的用法示例。


在下文中一共展示了Material.isBlock方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onRun

import org.bukkit.Material; //导入方法依赖的package包/类
@Override
public void onRun()
{
    // Prevents an excess of particles
    if (last != null && last.getX() == getEntity().getLocation().getX() && last.getZ() == getEntity().getLocation().getZ())
        return;
    last = getEntity().getLocation();

    Block block = this.getEntity().getLocation().add(0, -0.4, 0).getBlock();
    Material type = block.getType();

    // If the step should be displayed or not
    if (type.isBlock() && type.isSolid() && !type.isTransparent()) {
        Location loc = getEntity().getLocation();
        loc.setY(block.getY());
        loc = loc.add(0, 1 + Math.random() / 100, 0);
        Vector dir = VectorUtils.rotateAroundAxisY(getEntity().getLocation().getDirection().setY(0).normalize(), p ? 90 : -90).multiply(0.25);
        display(ParticleEffect.FOOTSTEP, loc.add(dir.getX(), 0, dir.getZ()), 7, 0);

        p = !p;
    }
}
 
开发者ID:SamaGames,项目名称:Hub,代码行数:23,代码来源:StepEffect.java

示例2: BlockDustParticle

import org.bukkit.Material; //导入方法依赖的package包/类
public BlockDustParticle(Config data) {
    super(ParticleType.BLOCK_DUST, data, BLOCK_DUST);
    Config block = data.getConfigRequired("block");
    Material type = block.getMaterialRequired("type");
    if(!type.isBlock())
        throw new InvalidConfigException("Particle must be a block!", "in particle '" + ParticleType.BLOCK_DUST.name() + "'");
    setBlockType(type);
    setBlockData(block.getByte("data", (byte)0));
    bake();
}
 
开发者ID:upperlevel,项目名称:uppercore,代码行数:11,代码来源:BlockDustParticle.java

示例3: parseBlockMaterial

import org.bukkit.Material; //导入方法依赖的package包/类
public static Material parseBlockMaterial(Node node, String text) throws InvalidXMLException {
    Material material = parseMaterial(node, text);
    if(!material.isBlock()) {
        throw new InvalidXMLException("Material " + material.name() + " is not a block", node);
    }
    return material;
}
 
开发者ID:OvercastNetwork,项目名称:ProjectAres,代码行数:8,代码来源:XMLUtils.java

示例4: canSupportBlocks

import org.bukkit.Material; //导入方法依赖的package包/类
/**
 * Does the given {@link Material} support falling blocks placed on top of it?
 *
 * This only counts when the gravity block is placed directly on top of the given material,
 * not when it is already falling and lands on the material.
 */
public static boolean canSupportBlocks(Material material) {
    if(material == null || !material.isBlock() || isLiquid(material)) return false;

    switch(material) {
        case AIR:
        case FIRE:
            return false;
    }

    return true;
}
 
开发者ID:OvercastNetwork,项目名称:ProjectAres,代码行数:18,代码来源:Materials.java

示例5: playBlockPlaceSound

import org.bukkit.Material; //导入方法依赖的package包/类
public static void playBlockPlaceSound(World bukkitWorld, Vector pos, Material material, float volume) {
    if (!material.isBlock()) {
        return;
    }
    playCustomSound(bukkitWorld,
                    pos.toLocation(bukkitWorld),
                    CraftMagicNumbers.getBlock(material).getStepSound().placeSound(),
                    SoundCategory.BLOCKS,
                    volume,
                    1f);
}
 
开发者ID:OvercastNetwork,项目名称:ProjectAres,代码行数:12,代码来源:NMSHacks.java

示例6: apply

import org.bukkit.Material; //导入方法依赖的package包/类
@Override
public boolean apply(Material input) {
    return input.isBlock();
}
 
开发者ID:OvercastNetwork,项目名称:ProjectAres,代码行数:5,代码来源:BlockMaterialMatcher.java

示例7: matches

import org.bukkit.Material; //导入方法依赖的package包/类
@Override
public boolean matches(Material material) {
    return material.isBlock();
}
 
开发者ID:OvercastNetwork,项目名称:ProjectAres,代码行数:5,代码来源:BlockMaterialMatcher.java

示例8: validate

import org.bukkit.Material; //导入方法依赖的package包/类
@Override
public void validate(Material material, @Nullable Node node) throws InvalidXMLException {
    if(!material.isBlock()) {
        throw new InvalidXMLException("Material " + material.name() + " is not a block", node);
    }
}
 
开发者ID:OvercastNetwork,项目名称:ProjectAres,代码行数:7,代码来源:MaterialIs.java

示例9: BlockData

import org.bukkit.Material; //导入方法依赖的package包/类
public BlockData(Material material, byte data) throws IllegalArgumentException {
    super(material, data);
    if (!material.isBlock()) {
        throw new IllegalArgumentException("The material is not a block");
    }
}
 
开发者ID:Shynixn,项目名称:BlockBall,代码行数:7,代码来源:ParticleEffect.java

示例10: BlockData

import org.bukkit.Material; //导入方法依赖的package包/类
/**
 * Construct a new block data
 * 
 * @param material Material of the block
 * @param data Data value of the block
 * @throws IllegalArgumentException If the material is not a block
 * @see ParticleData#ParticleData(Material, byte)
 */
public BlockData(Material material, byte data) throws IllegalArgumentException {
	super(material, data);
	if (!material.isBlock()) {
		throw new IllegalArgumentException("The material is not a block");
	}
}
 
开发者ID:MohibMirza,项目名称:RPGPlus,代码行数:15,代码来源:ParticleEffect.java

示例11: BlockData

import org.bukkit.Material; //导入方法依赖的package包/类
/**
 * Construct a new block data
 *
 * @param material Material of the block
 * @param data     Data value of the block
 * @throws IllegalArgumentException If the material is not a block
 * @see ParticleData#ParticleData(Material, byte)
 */
public BlockData(Material material, byte data) throws IllegalArgumentException {
	super(material, data);
	if (!material.isBlock()) {
		throw new IllegalArgumentException("The material is not a block");
	}
}
 
开发者ID:SamaGames,项目名称:Absorption,代码行数:15,代码来源:ParticleEffect.java

示例12: BlockData

import org.bukkit.Material; //导入方法依赖的package包/类
/**
 * Construct a new block data
 *
 * @param material Material of the block
 * @param data     Data value of the block
 * @throws IllegalArgumentException If the material is not a block
 * @see ParticleData#ParticleData(Material, byte)
 */
public BlockData(Material material, byte data) throws IllegalArgumentException {
    super(material, data);
    if (!material.isBlock()) {
        throw new IllegalArgumentException("The material is not a block");
    }
}
 
开发者ID:SamaGames,项目名称:SamaGamesAPI,代码行数:15,代码来源:ParticleEffect.java

示例13: BlockData

import org.bukkit.Material; //导入方法依赖的package包/类
/**
 * Construct a new block data
 *
 * @param material Material of the block
 * @param data Data value of the block
 * @throws IllegalArgumentException If the material is not a block
 * @see ParticleData#ParticleData(Material, byte)
 */
public BlockData(Material material, byte data) throws IllegalArgumentException {
    super(material, data);
    if (!material.isBlock()) {
        throw new IllegalArgumentException("The material is not a block");
    }
}
 
开发者ID:cadox8,项目名称:WC,代码行数:15,代码来源:ParticleEffect.java

示例14: ParticleBlockData

import org.bukkit.Material; //导入方法依赖的package包/类
/**
 * Construct a new block data
 *
 * @param material Material of the block
 * @param data Data value of the block
 * @throws IllegalArgumentException If the material is not a block
 * @see ParticleData#ParticleData(Material, byte)
 */
public ParticleBlockData(Material material, byte data) throws IllegalArgumentException {
    super(material, data);
    if (!material.isBlock())
        throw new IllegalArgumentException("The material + '" + material.name() + "' is not a block");
}
 
开发者ID:upperlevel,项目名称:uppercore,代码行数:14,代码来源:ParticleBlockData.java

示例15: BlockData

import org.bukkit.Material; //导入方法依赖的package包/类
/**
 * Construct a new block data
 * 
 * @param material Material of the block
 * @param data Data value of the block
 * @throws IllegalArgumentException If the material is not a block
 * @see ParticleData#ParticleData(Material, byte)
 */
public BlockData(Material material, byte data) throws IllegalArgumentException{
	super(material, data);
	if(!material.isBlock()){ throw new IllegalArgumentException("The material is not a block"); }
}
 
开发者ID:Borlea,项目名称:EchoPet,代码行数:13,代码来源:ParticleEffect.java


注:本文中的org.bukkit.Material.isBlock方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。