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


Java Sandstone类代码示例

本文整理汇总了Java中org.bukkit.material.Sandstone的典型用法代码示例。如果您正苦于以下问题:Java Sandstone类的具体用法?Java Sandstone怎么用?Java Sandstone使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: isBlockSolid

import org.bukkit.material.Sandstone; //导入依赖的package包/类
@Override
public boolean isBlockSolid(PlotBlock block) {
    try {
        Material material = Material.getMaterial(block.id);
        if (material.isBlock() && material.isSolid() && !material.hasGravity()) {
            Class<? extends MaterialData> data = material.getData();
            if (data.equals(MaterialData.class) || data.equals(Tree.class) || data.equals(Sandstone.class) || data.equals(Wool.class) || data.equals(Step.class)) {
                return true;
            }
        }
        return false;
    }
    catch (Exception e) {
        return false;
    }
}
 
开发者ID:Mayomi,项目名称:PlotSquared-Chinese,代码行数:17,代码来源:BukkitUtil.java

示例2: isBlockSolid

import org.bukkit.material.Sandstone; //导入依赖的package包/类
@Override
public boolean isBlockSolid(PlotBlock block) {
    try {
        Material material = Material.getMaterial(block.id);
        if (material.isBlock() && material.isSolid() && !material.hasGravity()) {
            Class<? extends MaterialData> data = material.getData();
            if (data.equals(MaterialData.class) && !material.isTransparent() && material.isOccluding()
                    || data.equals(Tree.class)
                    || data.equals(Sandstone.class)
                    || data.equals(Wool.class)
                    || data.equals(Step.class)
                    || data.equals(WoodenStep.class)) {
                switch (material) {
                    case NOTE_BLOCK:
                    case MOB_SPAWNER:
                        return false;
                    default:
                        return true;
                }
            }
        }
        return false;
    } catch (Exception ignored) {
        return false;
    }
}
 
开发者ID:IntellectualSites,项目名称:PlotSquared,代码行数:27,代码来源:BukkitUtil.java

示例3: Sandstone

import org.bukkit.material.Sandstone; //导入依赖的package包/类
public Sandstone() {
}
 
开发者ID:deathcap,项目名称:BedrockAPI,代码行数:3,代码来源:Sandstone.java

示例4: clone

import org.bukkit.material.Sandstone; //导入依赖的package包/类
public Sandstone clone() {
	return null;
}
 
开发者ID:deathcap,项目名称:BedrockAPI,代码行数:4,代码来源:Sandstone.java

示例5: getMaterialData

import org.bukkit.material.Sandstone; //导入依赖的package包/类
public static MaterialData getMaterialData(String identifier) {
    final String[] split = identifier.replaceAll("\\s+", "_").split("\\W");
    // TODO: Add additional material/name database like essentials/worldedit have
    Material material = matchMaterial(split[0]);

    if (material == null) {
        // try worldedit
        material = getWEMaterial(split[0]);
        if (material == null) return null;
    }

    if (split.length == 1) {
        return new MaterialData(material);
    }

    try {
        final byte rawData = Byte.parseByte(split[1]);
        return new MaterialData(material, rawData);
    } catch (NumberFormatException e) {
        // ignore
    }

    switch (material) {
        case LEAVES:
            return getMaterialData(material, Leaves::new, TreeSpecies.class, split[1]);
        case COAL:
            return getMaterialData(material, Coal::new, CoalType.class, split[1]);
        case LONG_GRASS:
            return getMaterialData(material, LongGrass::new, GrassSpecies.class, split[1]);
        case SANDSTONE:
            return getMaterialData(material, Sandstone::new, SandstoneType.class, split[1]);
        case MONSTER_EGG:
            return getMaterialData(material, SpawnEgg::new, EntityType.class, split[1]);
        case LOG:
            return getMaterialData(material, Tree::new, TreeSpecies.class, split[1]);
        case WOOD_STEP:
            return getMaterialData(material, WoodenStep::new, TreeSpecies.class, split[1]);
        case WOOL:
            return getMaterialData(material, Wool::new, DyeColor.class, split[1]);
        // TODO: Add Dye here when Spigot finally accepts my PR to match other MaterialData types
        default:
            // Couldn't find additional data for this material
            return new MaterialData(material);
    }
}
 
开发者ID:t7seven7t,项目名称:CraftFX,代码行数:46,代码来源:MaterialDataUtil.java


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