當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。