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


Java Variant类代码示例

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


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

示例1: test

import org.bukkit.entity.Horse.Variant; //导入依赖的package包/类
@Test
public void test() {
	final Object[] random = {
			// Java
			(byte) 127, (short) 2000, -1600000, 1L << 40, -1.5f, 13.37,
			"String",
			
			// Skript
			Color.BLACK, StructureType.RED_MUSHROOM, WeatherType.THUNDER,
			new Date(System.currentTimeMillis()), new Timespan(1337), new Time(12000), new Timeperiod(1000, 23000),
			new Experience(15), new Direction(0, Math.PI, 10), new Direction(new double[] {0, 1, 0}),
			new EntityType(new SimpleEntityData(HumanEntity.class), 300), new CreeperData(), new SimpleEntityData(Snowball.class), new HorseData(Variant.SKELETON_HORSE), new WolfData(), new XpOrbData(50),
			
			// Bukkit - simple classes only
			GameMode.ADVENTURE, Biome.EXTREME_HILLS, DamageCause.FALL,
			
			// there is also at least one variable for each class on my test server which are tested whenever the server shuts down.
	};
	
	for (final Object o : random) {
		Classes.serialize(o); // includes a deserialisation test
	}
}
 
开发者ID:nfell2009,项目名称:Skript,代码行数:24,代码来源:ClassesTest.java

示例2: init

import org.bukkit.entity.Horse.Variant; //导入依赖的package包/类
@Override
	protected boolean init(final Literal<?>[] exprs, final int matchedPattern, final ParseResult parseResult) {
		variant = Variant.values()[matchedPattern];
//		if (variant == Variant.HORSE) {
//			// TODO color and style // rem: toString
//		}
		return true;
	}
 
开发者ID:nfell2009,项目名称:Skript,代码行数:9,代码来源:HorseData.java

示例3: deserialize

import org.bukkit.entity.Horse.Variant; //导入依赖的package包/类
@Override
protected boolean deserialize(final String s) {
	final String[] split = s.split(",");
	if (split.length != 3)
		return false;
	try {
		variant = split[0].isEmpty() ? null : Variant.valueOf(split[0]);
		color = split[1].isEmpty() ? null : Color.valueOf(split[1]);
		style = split[2].isEmpty() ? null : Style.valueOf(split[2]);
	} catch (final IllegalArgumentException e) {
		return false;
	}
	return true;
}
 
开发者ID:nfell2009,项目名称:Skript,代码行数:15,代码来源:HorseData.java

示例4: MobApocalypyse

import org.bukkit.entity.Horse.Variant; //导入依赖的package包/类
public void MobApocalypyse(BlockBreakEvent event){
    int j,k,l,notUse=0,Quantity;
    Location loc = event.getBlock().getLocation();
    World world = loc.getWorld();
    event.getPlayer().addPotionEffect(new PotionEffect(PotionEffectType.BLINDNESS,20*60,1));
    event.getPlayer().addPotionEffect(new PotionEffect(PotionEffectType.CONFUSION,20*60,1));
    int X = (event.getBlock().getX())+2;
    int Y = event.getBlock().getY();
    int Z = (event.getBlock().getZ())-2;
    for (j=X;j>X-5;j--){
        for (k=Z;k<Z+5;k++){
            for (l=Y+2;l<Y+3;l++){
                if (notUse==0 || notUse==2 || notUse==4 || notUse==10 || notUse==12 || notUse==14 || notUse==20 || notUse==22 || notUse==24){
                    Location loc2 = new Location(world,j,l,k);
                    for (Quantity=0;Quantity<1;Quantity++){
                    world.spawnEntity(loc2,EntityType.CREEPER);
                    world.spawnEntity(loc2,EntityType.ZOMBIE);
                        Horse undead = (Horse) world.spawnEntity(loc,EntityType.HORSE);
                        undead.setVariant(Variant.UNDEAD_HORSE);
                        Horse SKELETON = (Horse) world.spawnEntity(loc,EntityType.HORSE);
                        SKELETON.setVariant(Variant.SKELETON_HORSE);
                    }
                }

            }
            notUse++;
        }
    }
}
 
开发者ID:josegrobles,项目名称:LuckyBlocksBukkit,代码行数:30,代码来源:LuckyBlocksActionController.java

示例5: deserialize

import org.bukkit.entity.Horse.Variant; //导入依赖的package包/类
@Override
public void deserialize(IDataNode dataNode) throws DeserializeException {
    _color = dataNode.getEnum("color", Color.WHITE, Color.class);
    _variant = dataNode.getEnum("variant", Variant.HORSE, Variant.class);
    _style = dataNode.getEnum("style", Style.NONE, Style.class);
    _domestication = dataNode.getInteger("dom");
    _maxDomestication = dataNode.getInteger("max-dom");
    _hasChest = dataNode.getBoolean("chest");
    _jumpStrength = dataNode.getDouble("jump", 1.0D);
}
 
开发者ID:JCThePants,项目名称:NucleusFramework,代码行数:11,代码来源:HorseAnimal.java

示例6: loadData

import org.bukkit.entity.Horse.Variant; //导入依赖的package包/类
@Override
public void loadData(ConfigurationSection section) {
	this.colour = Color.valueOf(section.getString("color", Color.BLACK.name()));
	this.style = Style.valueOf(section.getString("style", Style.NONE.name()));
	this.variant = Variant.valueOf(section.getString("variant", Variant.HORSE.name()));
	super.loadData(section);
}
 
开发者ID:CodingBadgers,项目名称:MineKart,代码行数:8,代码来源:HorseMountData.java

示例7: HorseData

import org.bukkit.entity.Horse.Variant; //导入依赖的package包/类
public HorseData(final @Nullable Variant variant) {
	this.variant = variant;
}
 
开发者ID:nfell2009,项目名称:Skript,代码行数:4,代码来源:HorseData.java

示例8: getHorseVariant

import org.bukkit.entity.Horse.Variant; //导入依赖的package包/类
public Variant getHorseVariant() {
	return variant;
}
 
开发者ID:CodingBadgers,项目名称:MineKart,代码行数:4,代码来源:HorseMountData.java

示例9: getVariant

import org.bukkit.entity.Horse.Variant; //导入依赖的package包/类
Horse.Variant getVariant(); 
开发者ID:deathcap,项目名称:BedrockAPI,代码行数:2,代码来源:Horse.java

示例10: setVariant

import org.bukkit.entity.Horse.Variant; //导入依赖的package包/类
void setVariant(Horse.Variant variant); 
开发者ID:deathcap,项目名称:BedrockAPI,代码行数:2,代码来源:Horse.java


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