当前位置: 首页>>代码示例>>Java>>正文


Java Rabbit类代码示例

本文整理汇总了Java中org.bukkit.entity.Rabbit的典型用法代码示例。如果您正苦于以下问题:Java Rabbit类的具体用法?Java Rabbit怎么用?Java Rabbit使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Rabbit类属于org.bukkit.entity包,在下文中一共展示了Rabbit类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: typeFromInt

import org.bukkit.entity.Rabbit; //导入依赖的package包/类
private static Rabbit.Type typeFromInt(int i){
	switch(i){
		case 1:
			return Rabbit.Type.BLACK;
		case 2:
			return Rabbit.Type.BLACK_AND_WHITE;
		case 3:
			return Rabbit.Type.BROWN;
		case 4:
			return Rabbit.Type.GOLD;
		case 5:
			return Rabbit.Type.SALT_AND_PEPPER;
		case 6:
			return Rabbit.Type.THE_KILLER_BUNNY;
		case 7:
			return Rabbit.Type.WHITE;
		default:
			break;
	}
	return Rabbit.Type.BLACK;
}
 
开发者ID:nfell2009,项目名称:Skript,代码行数:22,代码来源:RabbitData.java

示例2: RabbitMenu

import org.bukkit.entity.Rabbit; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
public RabbitMenu(Plot plot, Rabbit rabbit) {
    super(plot, rabbit);

    //type
    ItemStack type = new ItemStack(Material.BONE);
    ItemMeta typeMeta = type.getItemMeta();
    typeMeta.setDisplayName(ChatColor.GREEN + "Change type");
    type.setItemMeta(typeMeta);

    insertItem(type, event -> {
        new RabbitTypeMenu(rabbit).open((Player) event.getWhoClicked());

        event.setCancelled(true);
    }, 0);
}
 
开发者ID:stefvanschie,项目名称:buildinggame,代码行数:19,代码来源:RabbitMenu.java

示例3: isPet

import org.bukkit.entity.Rabbit; //导入依赖的package包/类
private boolean isPet(Entity entity) {
    if (entity instanceof ArmorStand) {
        final ArmorStand stand = (ArmorStand) entity;
        final int xidentifier = (int) stand.getBodyPose().getZ();
        final int identifier = (int) stand.getRightArmPose().getX();
        if (xidentifier == 2877 && identifier == 2877) {
            return true;
        }
    } else if (entity instanceof Rabbit && entity.getCustomName() != null && entity.getCustomName().equals("PetBlockIdentifier")) {
        return true;
    }
    return false;
}
 
开发者ID:Shynixn,项目名称:PetBlocks,代码行数:14,代码来源:ClearLagListener.java

示例4: isDeadBall

import org.bukkit.entity.Rabbit; //导入依赖的package包/类
private boolean isDeadBall(Entity entity) {
    if (!this.isBall(entity)) {
        if (entity instanceof ArmorStand) {
            final ArmorStand stand = (ArmorStand) entity;
            final int xidentifier = (int) stand.getBodyPose().getZ();
            final int identifier = (int) stand.getRightArmPose().getX();
            if (xidentifier == 2777 && identifier == 2777) {
                return true;
            }
        } else if (entity instanceof Rabbit && entity.getCustomName() != null && entity.getCustomName().equals("MyBallsIdentifier")) {
            return true;
        }
    }
    return false;
}
 
开发者ID:Shynixn,项目名称:BlockBall,代码行数:16,代码来源:BallListener.java

示例5: fromMagic

import org.bukkit.entity.Rabbit; //导入依赖的package包/类
protected static Rabbit.Type fromMagic(int magicValue) {
    if (magicValue < INVERSE.length) {
        return INVERSE[magicValue];
    } else if (magicValue == 99) {
        return Rabbit.Type.THE_KILLER_BUNNY;
    }
    // a default
    return Rabbit.Type.BROWN;
}
 
开发者ID:Borlea,项目名称:EchoPet,代码行数:10,代码来源:EntityRabbitPet.java

示例6: fromMagic

import org.bukkit.entity.Rabbit; //导入依赖的package包/类
protected static Rabbit.Type fromMagic(int magicValue){
	if(magicValue < INVERSE.length){
		return INVERSE[magicValue];
	}else if(magicValue == 99){ return Rabbit.Type.THE_KILLER_BUNNY; }
	// a default
	return Rabbit.Type.BROWN;
}
 
开发者ID:Borlea,项目名称:EchoPet,代码行数:8,代码来源:EntityRabbitPet.java

示例7: onLoad

import org.bukkit.entity.Rabbit; //导入依赖的package包/类
@Override
public void onLoad() {
    add(Rabbit.Type.BROWN, "Brown", "BR");
    add(Rabbit.Type.WHITE, "White", "WH", "W");
    add(Rabbit.Type.BLACK, "Black", "BL", "B");
    add(Rabbit.Type.BLACK_AND_WHITE, "Black and White", "BW", "Black White");
    add(Rabbit.Type.GOLD, "Gold", "GO", "G");
    add(Rabbit.Type.SALT_AND_PEPPER, "Salt and Pepper", "SP", "Salt", "Pepper", "Salt Pepper");
    add(Rabbit.Type.THE_KILLER_BUNNY, "The Killer Bunny", "TKB", "KB", "K", "Killer", "Killer Bunny", "KillerB");
}
 
开发者ID:GameBoxx,项目名称:GameBoxx,代码行数:11,代码来源:RabbitTypes.java

示例8: intFromType

import org.bukkit.entity.Rabbit; //导入依赖的package包/类
private static int intFromType(Rabbit.Type type){
 	int i = 0;
 	switch(type){
case BLACK:
	i = 1;
	break;
case BLACK_AND_WHITE:
	i = 2;
	break;
case BROWN:
	i = 3;
	break;
case GOLD:
	i = 4;
	break;
case SALT_AND_PEPPER:
	i = 5;
	break;
case THE_KILLER_BUNNY:
	i = 6;
	break;
case WHITE:
	i = 7;
	break;
default:
	break;
 	}
 	return i;
 }
 
开发者ID:nfell2009,项目名称:Skript,代码行数:30,代码来源:RabbitData.java

示例9: isMonster

import org.bukkit.entity.Rabbit; //导入依赖的package包/类
private boolean isMonster(Entity entity)
{
    if(entity instanceof Monster) return true;
    
    EntityType type = entity.getType();
    if(type == EntityType.GHAST || type == EntityType.MAGMA_CUBE || type == EntityType.SHULKER) return true;
    
    if(type == EntityType.RABBIT)
    {
        Rabbit rabbit = (Rabbit)entity;
        if(rabbit.getRabbitType() == Rabbit.Type.THE_KILLER_BUNNY) return true;
    }
    
    return false;
}
 
开发者ID:BigScary,项目名称:GriefPreventionFlags,代码行数:16,代码来源:FlagDef_NoMonsterSpawns.java

示例10: rawset

import org.bukkit.entity.Rabbit; //导入依赖的package包/类
@Override
public void rawset(LuaValue key, LuaValue value) {
    if (key.isstring()) {
        switch (key.checkjstring()) {
            case "type":
                getRabbitTrait().setRabbitType(ScriptUtil.enumValue(value, Rabbit.Type.class));
                break;
        }
    }
    super.rawset(key, value);
}
 
开发者ID:leMaik,项目名称:RpgPlus,代码行数:12,代码来源:RabbitEntityWrapper.java

示例11: on

import org.bukkit.entity.Rabbit; //导入依赖的package包/类
@EventHandler
public void on(CreatureSpawnEvent event) {
    if (!(event.getEntity() instanceof Rabbit)) return;

    Rabbit rabbit  = (Rabbit) event.getEntity();

    // switch to a killer rabbit
    if (random.nextDouble() < .01D) rabbit.setRabbitType(Rabbit.Type.THE_KILLER_BUNNY);
}
 
开发者ID:Eluinhost,项目名称:UberHardcore,代码行数:10,代码来源:RabbitSpawnHandler.java

示例12: RabbitAnimal

import org.bukkit.entity.Rabbit; //导入依赖的package包/类
public RabbitAnimal(Entity entity) {
    PreCon.notNull(entity);
    PreCon.isValid(entity instanceof Rabbit, "org.bukkit.entity.Rabbit expected.");

    Rabbit rabbit = (Rabbit)entity;

    _type = rabbit.getRabbitType();
}
 
开发者ID:JCThePants,项目名称:NucleusFramework,代码行数:9,代码来源:RabbitAnimal.java

示例13: apply

import org.bukkit.entity.Rabbit; //导入依赖的package包/类
@Override
public boolean apply(Entity entity) {
    PreCon.notNull(entity);
    PreCon.isValid(entity instanceof Rabbit, "org.bukkit.entity.Rabbit expected.");

    Rabbit rabbit = (Rabbit)entity;

    rabbit.setRabbitType(_type);

    return true;
}
 
开发者ID:JCThePants,项目名称:NucleusFramework,代码行数:12,代码来源:RabbitAnimal.java

示例14: deserialize

import org.bukkit.entity.Rabbit; //导入依赖的package包/类
@Override
public void deserialize(LoreMetaMap metaMap) {

    LoreMetaItem typeItem = metaMap.get("rabbit-type");
    if (typeItem != null)
        _type = typeItem.enumValue(Rabbit.Type.class);
}
 
开发者ID:JCThePants,项目名称:NucleusFramework,代码行数:8,代码来源:RabbitAnimal.java

示例15: getMovementEntity

import org.bukkit.entity.Rabbit; //导入依赖的package包/类
@Override
public Rabbit getMovementEntity() {
    return this.slime.getSpigotEntity();
}
 
开发者ID:Shynixn,项目名称:BlockBall,代码行数:5,代码来源:CustomArmorstand.java


注:本文中的org.bukkit.entity.Rabbit类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。