本文整理汇总了Java中org.bukkit.Material.REDSTONE属性的典型用法代码示例。如果您正苦于以下问题:Java Material.REDSTONE属性的具体用法?Java Material.REDSTONE怎么用?Java Material.REDSTONE使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.bukkit.Material
的用法示例。
在下文中一共展示了Material.REDSTONE属性的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: GUICounter
public GUICounter() {
label = new GUILabel( "§a" + count, Material.REDSTONE );
label.setPosition( position );
label.setAmount( count );
addEvent( new GUIEvent() {
@Override
public void onClick( ComponentClickEvent event ) {
if ( event.getClick() == ClickType.LEFT ) {
count += steps;
if ( count < 64 ) {
label.setAmount( count );
label.setTitle( "§a" + GUICounter.this.count );
label.draw();
}
}
else if ( event.getClick() == ClickType.RIGHT ) {
count -= steps;
if ( count > 0 ) {
label.setAmount( count );
label.setTitle( "§a" + GUICounter.this.count );
label.draw();
}
}
}
} );
}
示例2: isInteractableItem
/**
* checks if this item is interactable
*/
public static boolean isInteractableItem(ItemStack item) {
if (item == null || item.getType() == Material.AIR) {
return false;
}
if (item.getType().isBlock()) {
return true;
}
if (item.getType() == Material.REDSTONE || item.getType() == Material.WATER_BUCKET || item.getType() == Material.LAVA_BUCKET) {
return true;
}
if (item.getType() == Material.MONSTER_EGG) {
return true;
}
if (item.getType() == Material.EGG || item.getType() == Material.SNOW_BALL || item.getType() == Material.BOW || item.getType() == Material.ENDER_PEARL || item.getType() == Material.EYE_OF_ENDER || item.getType() == Material.POTION || item.getType() == Material.SPLASH_POTION || item.getType() == Material.EXP_BOTTLE || item.getType() == Material.FIREWORK_CHARGE) {
return true;
}
if (item.getType().isEdible()) {
return true;
}
return false;
}
示例3: isBrewingIngredient
private static boolean isBrewingIngredient(ItemStack item) {
if (item.getType() == Material.NETHER_STALK) {
return true;
}
if (item.getType() == Material.SPECKLED_MELON) {
return true;
}
if (item.getType() == Material.GHAST_TEAR) {
return true;
}
if (item.getType() == Material.RABBIT_FOOT) {
return true;
}
if (item.getType() == Material.BLAZE_POWDER) {
return true;
}
if (item.getType() == Material.SPIDER_EYE) {
return true;
}
if (item.getType() == Material.SUGAR) {
return true;
}
if (item.getType() == Material.MAGMA_CREAM) {
return true;
}
if (item.getType() == Material.GLOWSTONE_DUST) {
return true;
}
if (item.getType() == Material.REDSTONE) {
return true;
}
if (item.getType() == Material.FERMENTED_SPIDER_EYE) {
return true;
}
if (item.getType() == Material.GOLDEN_CARROT) {
return true;
}
if (item.getType() == Material.RAW_FISH && item.getData().getData() == 3) {
return true;
}
if (item.getType() == Material.SULPHUR) {
return true;
}
return false;
}