本文整理汇总了Java中org.bukkit.util.EulerAngle类的典型用法代码示例。如果您正苦于以下问题:Java EulerAngle类的具体用法?Java EulerAngle怎么用?Java EulerAngle使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
EulerAngle类属于org.bukkit.util包,在下文中一共展示了EulerAngle类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: spawn
import org.bukkit.util.EulerAngle; //导入依赖的package包/类
public void spawn(Location location) {
final PetBlockSpawnEvent event = new PetBlockSpawnEvent(this);
Bukkit.getPluginManager().callEvent(event);
if (!event.isCanceled()) {
NMSRegistry.accessWorldGuardSpawn(location);
this.rabbit.spawn(location);
final net.minecraft.server.v1_8_R1.World mcWorld = ((org.bukkit.craftbukkit.v1_8_R1.CraftWorld) location.getWorld()).getHandle();
this.setPosition(location.getX(), location.getY(), location.getZ());
mcWorld.addEntity(this, SpawnReason.CUSTOM);
final net.minecraft.server.v1_8_R1.NBTTagCompound compound = new net.minecraft.server.v1_8_R1.NBTTagCompound();
compound.setBoolean("invulnerable", true);
compound.setBoolean("Invisible", true);
compound.setBoolean("PersistenceRequired", true);
compound.setBoolean("ShowArms", true);
compound.setBoolean("NoBasePlate", true);
this.a(compound);
((ArmorStand)this.getArmorStand()).setBodyPose(new EulerAngle(0, 0, 2878));
((ArmorStand)this.getArmorStand()).setLeftArmPose(new EulerAngle(2878, 0, 0));
((ArmorStand)this.getArmorStand()).setMetadata("keep", this.getKeepField());
NMSRegistry.rollbackWorldGuardSpawn(location);
((ArmorStand)this.getArmorStand()).setCustomNameVisible(true);
((ArmorStand)this.getArmorStand()).setCustomName(this.petMeta.getPetDisplayName());
((ArmorStand)this.getArmorStand()).setRemoveWhenFarAway(false);
((LivingEntity) this.rabbit.getEntity()).setRemoveWhenFarAway(false);
this.health = ConfigPet.getInstance().getCombat_health();
if (this.petMeta == null)
return;
PetBlockHelper.setItemConsideringAge(this);
}
}
示例2: kick
import org.bukkit.util.EulerAngle; //导入依赖的package包/类
/**
* Kicks the ball with the given strength parameters
*
* @param entity entity
* @param horizontalStrength horizontalStrength
* @param verticalStrength verticalStrength
*/
@Override
public void kick(Entity entity, double horizontalStrength, double verticalStrength) {
BallKickEvent event = null;
if (entity instanceof Player) {
event = new BallKickEvent((Player) entity, this);
Bukkit.getPluginManager().callEvent(new BallKickEvent((Player) entity, this));
}
if (event == null || !event.isCancelled()) {
this.startVector = this.slime.getSpigotEntity().getLocation().toVector().subtract(entity.getLocation().toVector()).normalize().multiply(horizontalStrength);
this.startVector.setY(verticalStrength);
try {
this.slime.getSpigotEntity().setVelocity(this.startVector.clone());
} catch (final IllegalArgumentException ex) {
}
if (this.isRotating)
this.getSpigotEntity().setHeadPose(new EulerAngle(1, this.getSpigotEntity().getHeadPose().getY(), this.getSpigotEntity().getHeadPose().getZ()));
this.rvalue = this.random.nextInt(5) + 9;
this.jumps = this.random.nextInt(5) + 5;
}
}
示例3: pass
import org.bukkit.util.EulerAngle; //导入依赖的package包/类
/**
* Passes the ball with the given strength parameters
*
* @param entity entity
* @param horizontalStrength horizontalStrength
* @param verticalStrength verticalStrength
*/
@Override
public void pass(Entity entity, double horizontalStrength, double verticalStrength) {
BallKickEvent event = null;
if (entity instanceof Player) {
event = new BallKickEvent((Player) entity, this);
Bukkit.getPluginManager().callEvent(new BallKickEvent((Player) entity, this));
}
if (event == null || !event.isCancelled()) {
this.startVector = this.slime.getSpigotEntity().getLocation().toVector().subtract(entity.getLocation().toVector()).normalize().multiply(horizontalStrength * 0.8);
this.startVector.setY(verticalStrength * 0.5);
try {
this.slime.getSpigotEntity().setVelocity(this.startVector.clone());
} catch (final IllegalArgumentException ex) {
}
if (this.isRotating)
this.getSpigotEntity().setHeadPose(new EulerAngle(1, this.getSpigotEntity().getHeadPose().getY(), this.getSpigotEntity().getHeadPose().getZ()));
this.rvalue = this.random.nextInt(5) + 9;
this.jumps = this.random.nextInt(5) + 5;
}
}
示例4: spawn
import org.bukkit.util.EulerAngle; //导入依赖的package包/类
@Override
public void spawn(Location location) {
NMSRegistry.accessWorldGuardSpawn(location);
final net.minecraft.server.v1_8_R1.World mcWorld = ((CraftWorld) location.getWorld()).getHandle();
this.setPosition(location.getX(), location.getY(), location.getZ());
mcWorld.addEntity(this, SpawnReason.CUSTOM);
final NBTTagCompound compound = new NBTTagCompound();
compound.setBoolean("invulnerable", true);
compound.setBoolean("Invisible", true);
compound.setBoolean("PersistenceRequired", true);
compound.setBoolean("NoBasePlate", true);
this.a(compound);
this.slime = new CustomRabbit(location.getWorld(), true, this);
this.slime.spawn(location);
this.getSpigotEntity().setHeadPose(new EulerAngle(0, 0, 0));
this.getSpigotEntity().setBodyPose(new EulerAngle(0, 0, 2778));
this.getSpigotEntity().setRightArmPose(new EulerAngle(2778, 0, 0));
NMSRegistry.rollbackWorldGuardSpawn(location);
}
示例5: spawn
import org.bukkit.util.EulerAngle; //导入依赖的package包/类
@Override
public void spawn(Location location) {
NMSRegistry.accessWorldGuardSpawn(location);
final World mcWorld = ((CraftWorld) location.getWorld()).getHandle();
this.setPosition(location.getX(), location.getY(), location.getZ());
mcWorld.addEntity(this, SpawnReason.CUSTOM);
final NBTTagCompound compound = new NBTTagCompound();
compound.setBoolean("invulnerable", true);
compound.setBoolean("Invisible", true);
compound.setBoolean("PersistenceRequired", true);
compound.setBoolean("NoBasePlate", true);
this.a(compound);
this.slime = new CustomRabbit(location.getWorld(), true, this);
this.slime.spawn(location);
this.getSpigotEntity().setHeadPose(new EulerAngle(0, 0, 0));
this.getSpigotEntity().setBodyPose(new EulerAngle(0, 0, 2778));
this.getSpigotEntity().setRightArmPose(new EulerAngle(2778, 0, 0));
NMSRegistry.rollbackWorldGuardSpawn(location);
}
示例6: kick
import org.bukkit.util.EulerAngle; //导入依赖的package包/类
/**
* Kicks the ball with the given strength parameters
*
* @param entity entity
* @param horizontalStrength horizontalStrength
* @param verticalStrength verticalStrength
*/
@Override
public void kick(Entity entity, double horizontalStrength, double verticalStrength) {
BallKickEvent event = null;
if (entity instanceof Player) {
event = new BallKickEvent((Player) entity, this);
Bukkit.getPluginManager().callEvent(new BallKickEvent((Player) entity, this));
}
if (event == null || !event.isCancelled()) {
this.startVector = this.slime.getSpigotEntity().getLocation().toVector().subtract(entity.getLocation().toVector()).normalize().multiply(horizontalStrength);
this.startVector.setY(verticalStrength);
try {
this.slime.getSpigotEntity().setVelocity(this.startVector.clone());
} catch (final IllegalArgumentException ex) {
}
if (this.isRotating)
this.getSpigotEntity().setHeadPose(new EulerAngle(1, this.getSpigotEntity().getHeadPose().getY(), this.getSpigotEntity().getHeadPose().getZ()));
this.rvalue = random.nextInt(5) + 9;
this.jumps = random.nextInt(5) + 5;
}
}
示例7: pass
import org.bukkit.util.EulerAngle; //导入依赖的package包/类
/**
* Passes the ball with the given strength parameters
*
* @param entity entity
* @param horizontalStrength horizontalStrength
* @param verticalStrength verticalStrength
*/
@Override
public void pass(Entity entity, double horizontalStrength, double verticalStrength) {
BallKickEvent event = null;
if (entity instanceof Player) {
event = new BallKickEvent((Player) entity, this);
Bukkit.getPluginManager().callEvent(new BallKickEvent((Player) entity, this));
}
if (event == null || !event.isCancelled()) {
this.startVector = this.slime.getSpigotEntity().getLocation().toVector().subtract(entity.getLocation().toVector()).normalize().multiply(horizontalStrength * 0.8);
this.startVector.setY(verticalStrength * 0.5);
try {
this.slime.getSpigotEntity().setVelocity(this.startVector.clone());
} catch (final IllegalArgumentException ex) {
}
if (this.isRotating)
this.getSpigotEntity().setHeadPose(new EulerAngle(1, this.getSpigotEntity().getHeadPose().getY(), this.getSpigotEntity().getHeadPose().getZ()));
this.rvalue = random.nextInt(5) + 9;
this.jumps = random.nextInt(5) + 5;
}
}
示例8: spawn
import org.bukkit.util.EulerAngle; //导入依赖的package包/类
@Override
public void spawn(Location location) {
NMSRegistry.accessWorldGuardSpawn(location);
final net.minecraft.server.v1_8_R3.World mcWorld = ((CraftWorld) location.getWorld()).getHandle();
this.setPosition(location.getX(), location.getY(), location.getZ());
mcWorld.addEntity(this, SpawnReason.CUSTOM);
final NBTTagCompound compound = new NBTTagCompound();
compound.setBoolean("invulnerable", true);
compound.setBoolean("Invisible", true);
compound.setBoolean("PersistenceRequired", true);
compound.setBoolean("NoBasePlate", true);
this.a(compound);
this.slime = new CustomRabbit(location.getWorld(), this);
this.slime.spawn(location);
this.getSpigotEntity().setHeadPose(new EulerAngle(0, 0, 0));
this.getSpigotEntity().setBodyPose(new EulerAngle(0, 0, 2778));
this.getSpigotEntity().setRightArmPose(new EulerAngle(2778, 0, 0));
NMSRegistry.rollbackWorldGuardSpawn(location);
}
示例9: spawn
import org.bukkit.util.EulerAngle; //导入依赖的package包/类
@Override
public void spawn(Location location) {
NMSRegistry.accessWorldGuardSpawn(location);
final net.minecraft.server.v1_8_R2.World mcWorld = ((CraftWorld) location.getWorld()).getHandle();
this.setPosition(location.getX(), location.getY(), location.getZ());
mcWorld.addEntity(this, SpawnReason.CUSTOM);
final NBTTagCompound compound = new NBTTagCompound();
compound.setBoolean("invulnerable", true);
compound.setBoolean("Invisible", true);
compound.setBoolean("PersistenceRequired", true);
compound.setBoolean("NoBasePlate", true);
this.a(compound);
this.slime = new CustomRabbit(location.getWorld(), true, this);
this.slime.spawn(location);
this.getSpigotEntity().setHeadPose(new EulerAngle(0, 0, 0));
this.getSpigotEntity().setBodyPose(new EulerAngle(0, 0, 2778));
this.getSpigotEntity().setRightArmPose(new EulerAngle(2778, 0, 0));
NMSRegistry.rollbackWorldGuardSpawn(location);
}
示例10: spawnTracker
import org.bukkit.util.EulerAngle; //导入依赖的package包/类
private void spawnTracker() {
Player p = (Player) getTarget();
ItemStack skull = new ItemStack(Material.SKULL_ITEM, 1, (short) 3);
SkullMeta sm = (SkullMeta) skull.getItemMeta();
sm.setOwner(playerWithTrackerHead);
skull.setItemMeta(sm);
World w = p.getWorld();
armorStand = w.spawnEntity(p.getLocation(), EntityType.ARMOR_STAND);
/*slime = w.spawnEntity(p.getLocation(), EntityType.SLIME);
((Slime) slime).setInvulnerable(true);
((Slime) slime).setAI(false);
((Slime) slime).setSize(2);
slime.setPassenger(armorStand);*/
p.setPassenger(armorStand);
((ArmorStand) armorStand).setHelmet(skull);
((ArmorStand) armorStand).setVisible(false);
((ArmorStand) armorStand).setSmall(true);
((ArmorStand) armorStand).setBodyPose(new EulerAngle(0.0, 3.57, 0.0));
}
示例11: change
import org.bukkit.util.EulerAngle; //导入依赖的package包/类
@Override
public void change(Event e, Object[] delta, Changer.ChangeMode mode) {
if (mode == Changer.ChangeMode.SET) {
try {
if (en.getSingle(e) instanceof ArmorStand) {
ArmorStand arstand = (ArmorStand) en.getSingle(e);
double x = 0, y = 0, z = 0;
Location loc2 = (Location) delta[0];
x = Math.toRadians(loc2.getPitch());
y = Math.toRadians(loc2.getYaw());
EulerAngle a = new EulerAngle(x, y, z);
arstand.setHeadPose(a);
}
} catch (NullPointerException ex) {
}
}
}
示例12: getEulerAngleFromDegree
import org.bukkit.util.EulerAngle; //导入依赖的package包/类
public static EulerAngle getEulerAngleFromDegree(Axis axis, EulerAngle ea, int angle, boolean relative) {
switch (axis) {
case PITCH:
double x = Math.toRadians(angle);
if (relative)
x += ea.getX();
return ea.setX(x);
case YAW:
double y = Math.toRadians(angle);
if (relative)
y += ea.getY();
return ea.setY(y);
case ROLL:
double z = Math.toRadians(angle);
if (relative)
z += ea.getZ();
return ea.setZ(z);
}
return null;
}
示例13: translatePlayerLook
import org.bukkit.util.EulerAngle; //导入依赖的package包/类
public boolean translatePlayerLook(BodyPart part, Location location) {
Vector v = location.getDirection();
EulerAngle ea = new EulerAngle(v.getX(), v.getY(), v.getZ());
switch (part) {
case HEAD:
this.as.setHeadPose(ea);
return true;
case BODY:
this.as.setBodyPose(ea);
return true;
case LEFTARM:
this.as.setLeftArmPose(ea);
return true;
case LEFTLEG:
this.as.setLeftLegPose(ea);
return true;
case RIGHTARM:
this.as.setRightArmPose(ea);
return true;
case RIGHTLEG:
this.as.setRightLegPose(ea);
return true;
default:
return false;
}
}
示例14: clone
import org.bukkit.util.EulerAngle; //导入依赖的package包/类
@Override
public EntityExtraData clone() {
EntityArmorStandData copy = new EntityArmorStandData();
copy.itemInHand = itemInHand == null ? null : itemInHand.clone();
copy.boots = boots == null ? null : boots.clone();
copy.leggings = leggings == null ? null : leggings.clone();
copy.chestplate = chestplate == null ? null : chestplate.clone();
copy.helmet = helmet == null ? null : helmet.clone();
copy.bodyPose = bodyPose == null ? null : new EulerAngle(bodyPose.getX(), bodyPose.getY(), bodyPose.getZ());
copy.leftArmPose = leftArmPose == null ? null : new EulerAngle(leftArmPose.getX(), leftArmPose.getY(), leftArmPose.getZ());
copy.rightArmPose = rightArmPose == null ? null : new EulerAngle(rightArmPose.getX(), rightArmPose.getY(), rightArmPose.getZ());
copy.leftLegPose = leftLegPose == null ? null : new EulerAngle(leftLegPose.getX(), leftLegPose.getY(), leftLegPose.getZ());
copy.rightLegPose = rightLegPose == null ? null : new EulerAngle(rightLegPose.getX(), rightLegPose.getY(), rightLegPose.getZ());
copy.headPose = headPose == null ? null : new EulerAngle(headPose.getX(), headPose.getY(), headPose.getZ());
copy.hasGravity = hasGravity;
copy.isVisible = isVisible;
copy.hasArms = hasArms;
copy.isSmall = isSmall;
return copy;
}
示例15: Pot
import org.bukkit.util.EulerAngle; //导入依赖的package包/类
Pot(Location loc) {
this.trueLoc = loc;
int turn = 5;
Location temp = loc.clone().add(0, 0.5, 0);
for (int i = 0; i < 360 / turn; i++) {
temp.setYaw(temp.getYaw() + turn);
spawnYaw(1, temp);
}
for (int i = 0; i < 360 / turn; i++) {
this.armorStands.get(i).setItemInHand(new ItemStack(Material.FISHING_ROD, 1));
this.armorStands.get(i).setRightArmPose(new EulerAngle(Math.toRadians(135), Math.toRadians(90), 0));
this.armorStands.get(i).setSmall(true);
}
spawn(1, loc.clone().add(0, 0.75, 0));
this.armorStands.get(360 / turn).setItemInHand(new ItemStack(Material.STICK, 1));
this.armorStands.get(360 / turn).setRightArmPose(new EulerAngle(Math.toRadians(90), Math.toRadians(90), Math.toRadians(90)));
this.armorStands.get(360 / turn).setSmall(true);
}