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


Java Material.getId方法代码示例

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


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

示例1: getMaterialStatistic

import org.bukkit.Material; //导入方法依赖的package包/类
public static net.minecraft.stats.StatBase getMaterialStatistic(org.bukkit.Statistic stat, Material material) {
    try {
        if (stat == Statistic.MINE_BLOCK) {
            return StatList.mineBlockStatArray[material.getId()];
        }
        if (stat == Statistic.CRAFT_ITEM) {
            return StatList.objectCraftStats[material.getId()];
        }
        if (stat == Statistic.USE_ITEM) {
            return StatList.objectUseStats[material.getId()];
        }
        if (stat == Statistic.BREAK_ITEM) {
            return StatList.objectBreakStats[material.getId()];
        }
    } catch (ArrayIndexOutOfBoundsException e) {
        return null;
    }
    return null;
}
 
开发者ID:UraniumMC,项目名称:Uranium,代码行数:20,代码来源:CraftStatistic.java

示例2: setPlayerSpawnBlock

import org.bukkit.Material; //导入方法依赖的package包/类
/**
 * @param playerSpawnBlock the playerSpawnBlock to set
 * @return true if block is found otherwise false
 */
@SuppressWarnings("deprecation")
public boolean setPlayerSpawnBlock(Material playerSpawnBlock) {
    if (bedrock == null) {
        return false;
    }
    playerSpawn = null;
    // Run through the schematic and try and find the spawnBlock
    for (IslandBlock islandBlock : islandBlocks) {
        if (islandBlock.getTypeId() == playerSpawnBlock.getId()) {
            playerSpawn = islandBlock.getVector().subtract(bedrock).add(new Vector(0.5D,0D,0.5D));
            // Set the block to air
            islandBlock.setTypeId((short)0);
            return true;
        }
    }
    return false;
}
 
开发者ID:tastybento,项目名称:bskyblock,代码行数:22,代码来源:Schematic.java

示例3: ParticleData

import org.bukkit.Material; //导入方法依赖的package包/类
/**
 * Construct a new particle data
 *
 * @param material Material of the item/block
 * @param data Data value of the item/block
 */
@SuppressWarnings("deprecation")
public ParticleData(Material material, byte data) {
    this.material = material;
    this.data = data;
    this.packetData = new int[] { material.getId(), data };
}
 
开发者ID:upperlevel,项目名称:uppercore,代码行数:13,代码来源:ParticleData.java

示例4: ParticleData

import org.bukkit.Material; //导入方法依赖的package包/类
/**
 * Construct a new particle data
 * 
 * @param material Material of the item/block
 * @param data Data value of the item/block
 */
@SuppressWarnings("deprecation")
public ParticleData(Material material, byte data) {
	this.material = material;
	this.data = data;
	this.packetData = new int[] { material.getId(), data };
}
 
开发者ID:MohibMirza,项目名称:RPGPlus,代码行数:13,代码来源:ParticleEffect.java

示例5: ParticleData

import org.bukkit.Material; //导入方法依赖的package包/类
/**
 * Construct a new particle data
 *
 * @param material Material of the item/block
 * @param data     Data value of the item/block
 */
@SuppressWarnings("deprecation")
public ParticleData(Material material, byte data) {
	this.material = material;
	this.data = data;
	this.packetData = new int[]{material.getId(), data};
}
 
开发者ID:SamaGames,项目名称:Absorption,代码行数:13,代码来源:ParticleEffect.java

示例6: ParticleData

import org.bukkit.Material; //导入方法依赖的package包/类
/**
 * Construct a new particle data
 *
 * @param material Material of the item/block
 * @param data     Data value of the item/block
 */
@SuppressWarnings("deprecation")
public ParticleData(Material material, byte data) {
    this.material = material;
    this.data = data;
    this.packetData = new int[]{material.getId(), data};
}
 
开发者ID:SamaGames,项目名称:SamaGamesAPI,代码行数:13,代码来源:ParticleEffect.java

示例7: ParticleData

import org.bukkit.Material; //导入方法依赖的package包/类
@SuppressWarnings("deprecation")
public ParticleData(Material material, byte data) {
    super();
    this.material = material;
    this.data = data;
    this.packetData = new int[]{material.getId(), data};
}
 
开发者ID:Shynixn,项目名称:BlockBall,代码行数:8,代码来源:ParticleEffect.java

示例8: ParticleData

import org.bukkit.Material; //导入方法依赖的package包/类
/**
 * Construct a new particle data
 * 
 * @param material Material of the item/block
 * @param data Data value of the item/block
 */
@SuppressWarnings("deprecation")
public ParticleData(Material material, byte data){
	this.material = material;
	this.data = data;
	this.packetData = new int[]{material.getId(), data};
}
 
开发者ID:Borlea,项目名称:EchoPet,代码行数:13,代码来源:ParticleEffect.java

示例9: setBlock

import org.bukkit.Material; //导入方法依赖的package包/类
void setBlock(int x, int y, int z, byte[][] chunk, Material material) {
    if (chunk[y >> 4] == null)
        chunk[y >> 4] = new byte[16 * 16 * 16];
    if (!(y <= 256 && y >= 0 && x <= 16 && x >= 0 && z <= 16 && z >= 0))
        return;
    try {
        chunk[y >> 4][((y & 0xF) << 8) | (z << 4) | x] = (byte) material.getId();
    } catch (Exception e) {
        e.printStackTrace();
    }
}
 
开发者ID:IzzelAliz,项目名称:TalentZzzz,代码行数:12,代码来源:Generator.java

示例10: isAirlike

import org.bukkit.Material; //导入方法依赖的package包/类
public static boolean isAirlike(Material m) {
    switch (m.getId()) {
        case 0: //air
        case 78: //snow layer
        case 51: //fire
        case 50: //torch
        case 59: //wheat
        case 39: //mushroom
        case 40: //mushroom
        case 55: //redstone wire
        case 70: //stone pressure
        case 72: //wood pressure
        case 106: //vines
        case 141: //carrots
        case 142: //potatoes
        case 175: //flowers
        case 31: //grasses
        case 32: //dead shrub
        case 323: //sign (item, just in case)
        case 63: //standing sign
        case 68: //wall-mounted sign
        case 69: //lever
        case 77: //stone button
        case 143: //wood button
        case 75: //redstone torch on
        case 76: //redstone torch off
        case 65: //ladder
        case 66: //rail
        case 83: //sugar cane
        case 171: // carpet
            return true;
        default:
            return false;
    }
}
 
开发者ID:edasaki,项目名称:ZentrelaCore,代码行数:36,代码来源:RParticles.java

示例11: isDupeBlock

import org.bukkit.Material; //导入方法依赖的package包/类
@SuppressWarnings("deprecation")
private boolean isDupeBlock(Material type) {
	return Material.PISTON_EXTENSION == type || Material.PISTON_STICKY_BASE == type || Material.PISTON_BASE == type
		|| Material.PISTON_MOVING_PIECE == type || Material.PUMPKIN == type || Material.DISPENSER == type
		|| Material.DROPPER == type || type.getId() == 165;
}
 
开发者ID:jiongjionger,项目名称:NeverLag,代码行数:7,代码来源:AntiInfiniteRail.java

示例12: BlockSpec

import org.bukkit.Material; //导入方法依赖的package包/类
public BlockSpec( Material type ) {
    this.type = type.getId();
}
 
开发者ID:lukas81298,项目名称:FlexMC,代码行数:4,代码来源:BlockSpec.java

示例13: ItemSpec

import org.bukkit.Material; //导入方法依赖的package包/类
public ItemSpec( Material type ) {
    this.type = type.getId();
}
 
开发者ID:lukas81298,项目名称:FlexMC,代码行数:4,代码来源:ItemSpec.java

示例14: getIdFromMaterial

import org.bukkit.Material; //导入方法依赖的package包/类
/**
 * Handle changes for minecraft 1.13.
 * Returns the id of the given material
 *
 * @param material material
 * @return id
 */
public static int getIdFromMaterial(Material material) {
    return material.getId();
}
 
开发者ID:Shynixn,项目名称:PetBlocks,代码行数:11,代码来源:MaterialCompatibility12.java


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