本文整理汇总了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;
}
示例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;
}
示例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 };
}
示例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 };
}
示例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};
}
示例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};
}
示例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};
}
示例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};
}
示例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();
}
}
示例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;
}
}
示例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;
}
示例12: BlockSpec
import org.bukkit.Material; //导入方法依赖的package包/类
public BlockSpec( Material type ) {
this.type = type.getId();
}
示例13: ItemSpec
import org.bukkit.Material; //导入方法依赖的package包/类
public ItemSpec( Material type ) {
this.type = type.getId();
}
示例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();
}