本文整理汇总了Java中org.bukkit.Material.SAND属性的典型用法代码示例。如果您正苦于以下问题:Java Material.SAND属性的具体用法?Java Material.SAND怎么用?Java Material.SAND使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.bukkit.Material
的用法示例。
在下文中一共展示了Material.SAND属性的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onBlockPhysics
@EventHandler(priority = EventPriority.MONITOR)
public void onBlockPhysics(BlockPhysicsEvent event) {
if (event.isCancelled()) {
return;
}
if (event.getBlock().getType() != Material.SAND && event.getBlock().getType() != Material.GRAVEL) {
return;
}
if (!DeprecatedMethods.applyPhysics(event.getBlock())) {
return;
}
BlockUpdate.Update(event.getBlock());
}
示例2: smeltCheck
public boolean smeltCheck(Inventory inv, ItemStack item)
{
boolean canSmelt = true;
if(item == null)
canSmelt = false;
else if(item.getType() == Material.PORK)
inv.setItem(2, new ItemStack(Material.GRILLED_PORK));
else if(item.getType() == Material.RAW_BEEF)
inv.setItem(2, new ItemStack(Material.COOKED_BEEF));
else if(item.getType() == Material.RAW_CHICKEN)
inv.setItem(2, new ItemStack(Material.COOKED_CHICKEN));
else if(item.getType() == Material.RAW_FISH)
inv.setItem(2, new ItemStack(Material.COOKED_FISH, 1, item.getDurability()));
else if(item.getType() == Material.POTATO_ITEM)
inv.setItem(2, new ItemStack(Material.BAKED_POTATO));
else if(item.getType() == Material.MUTTON)
inv.setItem(2, new ItemStack(Material.COOKED_MUTTON));
else if(item.getType() == Material.RABBIT)
inv.setItem(2, new ItemStack(Material.COOKED_RABBIT));
else if(item.getType() == Material.SAND)
inv.setItem(2, new ItemStack(Material.GLASS));
else if(item.getType() == Material.CLAY_BALL)
inv.setItem(2, new ItemStack(Material.CLAY_BRICK));
else if(item.getType() == Material.LOG)
inv.setItem(2, new ItemStack(Material.COAL, 1, (short)1));
else if(item.getType() == Material.LOG_2)
inv.setItem(2, new ItemStack(Material.COAL, 1, (short)1));
else
canSmelt = false;
return canSmelt;
}
示例3: isWall
public static boolean isWall(Block b) {
if (b.getType()==Material.SAND || b.getType()==Material.GRAVEL)
return true;
else
return false;
}