本文整理匯總了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;
}