本文整理汇总了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
}
}
示例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;
}
示例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;
}
示例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++;
}
}
}
示例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);
}
示例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);
}
示例7: HorseData
import org.bukkit.entity.Horse.Variant; //导入依赖的package包/类
public HorseData(final @Nullable Variant variant) {
this.variant = variant;
}
示例8: getHorseVariant
import org.bukkit.entity.Horse.Variant; //导入依赖的package包/类
public Variant getHorseVariant() {
return variant;
}
示例9: getVariant
import org.bukkit.entity.Horse.Variant; //导入依赖的package包/类
Horse.Variant getVariant();
示例10: setVariant
import org.bukkit.entity.Horse.Variant; //导入依赖的package包/类
void setVariant(Horse.Variant variant);