本文整理汇总了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;
}
}
示例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();
}
示例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;
}
示例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;
}
示例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);
}
示例6: apply
import org.bukkit.Material; //导入方法依赖的package包/类
@Override
public boolean apply(Material input) {
return input.isBlock();
}
示例7: matches
import org.bukkit.Material; //导入方法依赖的package包/类
@Override
public boolean matches(Material material) {
return material.isBlock();
}
示例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);
}
}
示例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");
}
}
示例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");
}
}
示例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");
}
}
示例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");
}
}
示例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");
}
}
示例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");
}
示例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"); }
}