当前位置: 首页>>代码示例>>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;未经允许,请勿转载。