當前位置: 首頁>>代碼示例>>Java>>正文


Java Material.STAINED_CLAY屬性代碼示例

本文整理匯總了Java中org.bukkit.Material.STAINED_CLAY屬性的典型用法代碼示例。如果您正苦於以下問題:Java Material.STAINED_CLAY屬性的具體用法?Java Material.STAINED_CLAY怎麽用?Java Material.STAINED_CLAY使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在org.bukkit.Material的用法示例。


在下文中一共展示了Material.STAINED_CLAY屬性的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: onProjectileHit

@EventHandler
public void onProjectileHit(ProjectileHitEvent event)
{
    if (event.getEntity().getType() != EntityType.SNOWBALL || !event.getEntity().hasMetadata("paintball-ball") || !event.getEntity().getMetadata("paintball-ball").get(0).asString().equals(this.uuid.toString()))
        return;

    for (Block block : getNearbyBlocks(event.getEntity().getLocation(), 2))
    {
        if (block.getType() == Material.AIR || block.getType() == Material.SIGN || block.getType() == Material.SIGN_POST || block.getType() == Material.WALL_SIGN)
            continue;

        if (this.isBlockGloballyUsed(block.getLocation()))
            continue;

        SimpleBlock simpleBlock = new SimpleBlock(Material.STAINED_CLAY, DyeColor.values()[new Random().nextInt(DyeColor.values().length)].getWoolData());
        this.addBlockToUse(block.getLocation(), simpleBlock);

        block.setType(simpleBlock.getType());
        block.setData(simpleBlock.getData());
    }

    event.getEntity().remove();
}
 
開發者ID:SamaGames,項目名稱:Hub,代碼行數:23,代碼來源:PaintballDisplayer.java

示例2: prepareElements

private void prepareElements() {
    int y = 0;
    int x = 0;
    for ( int i = 0; i < size.getX(); i++ ) {
        GUILabel label = new GUILabel( " ", Material.STAINED_CLAY, (byte) 9 );
        label.setPosition( new Vector2i( ( position.getX() + x ), position.getY() + y ) );
        parent.add( label );
        barElements.add( label );

        if ( position.getX() + x > 7 ) {
            y++;
            x = 0;
        }
        else x++;
    }
    activeElement = barElements.get( 0 );
}
 
開發者ID:LegendOnline,項目名稱:InventoryAPI,代碼行數:17,代碼來源:GUIProgressBar.java

示例3: setMaterial

@SuppressWarnings("deprecation")
private void setMaterial(GameStatus gs, Block attachedBlock) {
	String material = SkyWarsReloaded.getCfg().getSignJoinMaterial();
	Material sMat;
	if (material.equalsIgnoreCase("wool")) {
		sMat = Material.WOOL;
	} else if (material.equalsIgnoreCase("clay")) {
		sMat = Material.STAINED_CLAY;
	} else if (material.equalsIgnoreCase("glass")) {
		sMat = Material.STAINED_GLASS;
	} else {
		sMat = null;
	}
	if (sMat != null) {
		if (gs == GameStatus.JOINABLE) {
			attachedBlock.setType(sMat);
			attachedBlock.setData((byte) 5);
		} else if (gs == GameStatus.FULL || gs == GameStatus.INPROGRESS) {
			attachedBlock.setType(sMat);
			attachedBlock.setData((byte) 14);
		} else if (gs == GameStatus.RESTARTING) {
			attachedBlock.setType(sMat);
			attachedBlock.setData((byte) 11);
		}
	}
}
 
開發者ID:smessie,項目名稱:SkyWarsReloaded,代碼行數:26,代碼來源:GameController.java

示例4: tickPoison

public void tickPoison() {
    poisonTicks--;
    Location loc = entity.getLocation().add(0, entity.getEyeHeight() * 0.6, 0);
    BlockData data = new BlockData(Material.STAINED_CLAY, (byte) DyeColor.BLUE.getWoolData());
    RParticles.showWithData(ParticleEffect.BLOCK_CRACK, loc, data, 10);
    double multiplier = 0.001;
    switch (poisonTier) {
        default:
        case 1:
            multiplier = 0.01;
            break;
        case 2:
            multiplier = 0.015;
            break;
        case 3:
            multiplier = 0.020;
            break;
        case 4:
            multiplier = 0.030;
            break;
        case 5:
            multiplier = 0.050;
            break;
    }
    int amount = (int) (multiplier * hp);
    if (amount < 1)
        amount = 1;
    damage(amount, null, DamageType.ENVIRONMENTAL_INSTANT);
}
 
開發者ID:edasaki,項目名稱:ZentrelaRPG,代碼行數:29,代碼來源:MobData.java

示例5: createClay

public static ItemStack createClay(String displayname, List<String> lore, DyeColor dye) {
    ItemStack item = new ItemStack(Material.STAINED_CLAY, 1, dye.getWoolData());
    ItemMeta meta = item.getItemMeta();
    meta.addItemFlags(ItemFlag.HIDE_POTION_EFFECTS, ItemFlag.HIDE_ATTRIBUTES,
            ItemFlag.HIDE_DESTROYS, ItemFlag.HIDE_ENCHANTS, ItemFlag.HIDE_PLACED_ON, ItemFlag.HIDE_UNBREAKABLE);
    meta.setDisplayName(displayname);
    ArrayList<String> colorLore = new ArrayList<>();
    if (lore != null) {
        lore.forEach(str -> colorLore.add(Utils.colorize(str)));
        meta.setLore(colorLore);
    }

    item.setItemMeta(meta);
    return item;
}
 
開發者ID:cadox8,項目名稱:WC,代碼行數:15,代碼來源:ItemUtil.java


注:本文中的org.bukkit.Material.STAINED_CLAY屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。