本文整理汇总了Java中org.bukkit.entity.Rabbit.Type方法的典型用法代码示例。如果您正苦于以下问题:Java Rabbit.Type方法的具体用法?Java Rabbit.Type怎么用?Java Rabbit.Type使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.bukkit.entity.Rabbit
的用法示例。
在下文中一共展示了Rabbit.Type方法的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;
}
示例2: 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;
}
示例3: 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;
}
示例4: 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;
}
示例5: getRabbitType
import org.bukkit.entity.Rabbit; //导入方法依赖的package包/类
@Override
public Rabbit.Type getRabbitType(){
return TypeMapping.fromMagic(this.datawatcher.get(TYPE));
}
示例6: setRabbitType
import org.bukkit.entity.Rabbit; //导入方法依赖的package包/类
@Override
public void setRabbitType(Rabbit.Type type){
this.datawatcher.set(TYPE, TypeMapping.toMagic(type));
}
示例7: toMagic
import org.bukkit.entity.Rabbit; //导入方法依赖的package包/类
protected static int toMagic(Rabbit.Type type) {
return NMS_TYPES[type.ordinal()];
}
示例8: set
import org.bukkit.entity.Rabbit; //导入方法依赖的package包/类
private static void set(Rabbit.Type type, int magicValue){
NMS_TYPES[type.ordinal()] = magicValue;
if(magicValue < INVERSE.length){
INVERSE[magicValue] = type;
}
}
示例9: getRabbitType
import org.bukkit.entity.Rabbit; //导入方法依赖的package包/类
@Override
public Rabbit.Type getRabbitType() {
return TypeMapping.fromMagic(this.datawatcher.getByte(18));
}
示例10: getRabbitType
import org.bukkit.entity.Rabbit; //导入方法依赖的package包/类
@Override
public Rabbit.Type getRabbitType() {
return ((IEntityRabbitPet) getEntityPet()).getRabbitType();
}
示例11: setRabbitType
import org.bukkit.entity.Rabbit; //导入方法依赖的package包/类
@Override
public void setRabbitType(Rabbit.Type type) {
this.datawatcher.watch(18, Byte.valueOf((byte) TypeMapping.toMagic(type)));
}
示例12: toMagic
import org.bukkit.entity.Rabbit; //导入方法依赖的package包/类
protected static int toMagic(Rabbit.Type type){
return NMS_TYPES[type.ordinal()];
}
示例13: get
import org.bukkit.entity.Rabbit; //导入方法依赖的package包/类
public static Rabbit.Type get(String string) {
return instance()._get(string);
}
示例14: getName
import org.bukkit.entity.Rabbit; //导入方法依赖的package包/类
public static String getName(Rabbit.Type key) {
return instance()._getName(key);
}
示例15: getDisplayName
import org.bukkit.entity.Rabbit; //导入方法依赖的package包/类
public static String getDisplayName(Rabbit.Type key) {
return instance()._getDisplayName(key);
}