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