本文整理了Java中net.minecraft.entity.Entity.getRidingEntity()
方法的一些代码示例,展示了Entity.getRidingEntity()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Entity.getRidingEntity()
方法的具体详情如下:
包路径:net.minecraft.entity.Entity
类名称:Entity
方法名:getRidingEntity
暂无
代码示例来源:origin: AppliedEnergistics/Applied-Energistics-2
return this.teleportEntity( entity.getRidingEntity(), link );
代码示例来源:origin: ValkyrienWarfare/Valkyrien-Warfare-Revamped
@Override
public Entity getLowestRidingEntity() {
Entity entity;
for (entity = this; entity.isRiding(); entity = entity.getRidingEntity()) {
}
return null;
}
代码示例来源:origin: SleepyTrousers/EnderIO
private void cleanupUnspawnedEntity(Entity entity) {
if (entity != null) {
final Entity ridingEntity = entity.getRidingEntity();
if (ridingEntity != null) {
ridingEntity.setDead();
}
for (Entity passenger : entity.getPassengers()) {
passenger.setDead();
}
}
}
代码示例来源:origin: JurassiCraftTeam/JurassiCraft2
@SubscribeEvent
public void fall(LivingFallEvent e){
e.setCanceled(e.getEntity().getRidingEntity() instanceof HelicopterEntity);
}
@SubscribeEvent
代码示例来源:origin: PrinceOfAmber/Cyclic
break;
Entity ridingEntity = entity.getRidingEntity();
if (ridingEntity != null) {
代码示例来源:origin: JurassiCraftTeam/JurassiCraft2
public String getIfExists(int seatID, boolean reset) {
String string = this.dataManager.get(WATCHER_SEATS).getString(str(seatID));
if (!string.equals("")) {
if (!(this.world.getEntityByID(Integer.parseInt(string)) != null
&& this.world.getEntityByID(Integer.parseInt(string)).getRidingEntity() == this)) {
if (reset)
setSeat(str(seatID), "");
return "";
} else {
return string;
}
}
return "";
}
代码示例来源:origin: PrinceOfAmber/Cyclic
@SubscribeEvent
public void onEnderTeleportEvent(EnderTeleportEvent event) {
if (mountedPearl) {
Entity rider = event.getEntity();
if (rider != null && rider instanceof EntityPlayer && rider.getRidingEntity() != null) {
EntityPlayer playerRider = (EntityPlayer) rider;
Entity maybeHorse = playerRider.getRidingEntity();
//take the players horse and set its position to the target
event.getEntity().getRidingEntity().setPositionAndUpdate(event.getTargetX(), event.getTargetY(), event.getTargetZ());
playerRider.getEntityData().setInteger(KEY_MOUNTENTITY, maybeHorse.getEntityId());
}
}
}
}
代码示例来源:origin: JurassiCraftTeam/JurassiCraft2
@Override
public boolean attackEntityAsMob(Entity entity) {
if (entity instanceof DinosaurEntity && ((DinosaurEntity) entity).isCarcass()) {
this.setAnimation(EntityAnimation.EATING.get());
} else {
this.setAnimation(EntityAnimation.ATTACKING.get());
}
while (entity.getRidingEntity() != null) {
entity = entity.getRidingEntity();
}
float damage = (float) this.getEntityAttribute(SharedMonsterAttributes.ATTACK_DAMAGE).getAttributeValue();
if (entity.attackEntityFrom(new DinosaurDamageSource("mob", this), damage)) {
if (entity instanceof DinosaurEntity && ((DinosaurEntity) entity).isCarcass()) {
DinosaurEntity dinosaur = (DinosaurEntity) entity;
if (dinosaur.herd != null && this.herd != null && dinosaur.herd.fleeing && dinosaur.herd.enemies.contains(this)) {
this.herd.enemies.removeAll(dinosaur.herd.members);
for (DinosaurEntity member : this.herd) {
if (member.getAttackTarget() != null && dinosaur.herd.members.contains(member.getAttackTarget())) {
member.setAttackTarget(null);
}
}
this.herd.state = Herd.State.IDLE;
}
}
return true;
}
return false;
}
代码示例来源:origin: PrinceOfAmber/Cyclic
public static void launch(Entity entity, float rotationPitch, float rotationYaw, float power) {
float mountPower = (float) (power + 0.5);
double velX = -MathHelper.sin(rotationYaw / 180.0F * (float) Math.PI) * MathHelper.cos(rotationPitch / 180.0F * (float) Math.PI) * power;
double velZ = MathHelper.cos(rotationYaw / 180.0F * (float) Math.PI) * MathHelper.cos(rotationPitch / 180.0F * (float) Math.PI) * power;
double velY = -MathHelper.sin((rotationPitch) / 180.0F * (float) Math.PI) * power;
// launch the player up and forward at minimum angle
// regardless of look vector
if (velY < 0) {
velY *= -1;// make it always up never down
}
Entity ridingEntity = entity.getRidingEntity();
if (ridingEntity != null) {
// boost power a bit, horses are heavy as F
ridingEntity.motionY = 0;
ridingEntity.fallDistance = 0;
ridingEntity.addVelocity(velX * mountPower, velY * mountPower, velZ * mountPower);
}
else {
entity.motionY = 0;
entity.fallDistance = 0;
entity.addVelocity(velX, velY, velZ);
}
}
代码示例来源:origin: SleepyTrousers/EnderIO
world.playEvent(2004, pos, 0);
entityliving.spawnExplosionParticle();
final Entity ridingEntity = entity.getRidingEntity();
if (ridingEntity != null) {
ridingEntity.setLocationAndAngles(entity.posX, entity.posY, entity.posZ, entity.rotationYaw, 0.0F);
代码示例来源:origin: Vazkii/Psi
while(riding != null) {
riding.setPosition(eidosAnchor.x, eidosAnchor.y, eidosAnchor.z);
riding = riding.getRidingEntity();
while(riding != null) {
riding.setPosition(vec.x, vec.y, vec.z);
riding = riding.getRidingEntity();
代码示例来源:origin: SquidDev-CC/plethora
if (entityHit == entityHit.getRidingEntity() && !entityHit.canRiderInteract()) {
if (closestDistance == 0.0D) {
closestEntity = entityHit;
代码示例来源:origin: MatterOverdrive/MatterOverdrive-Legacy-Edition
if (!canHurtCaster && (entity1 == this.shootingEntity || entity1 == this.shootingEntity.getRidingEntity())) {
continue;
代码示例来源:origin: vadis365/TheErebus
setRotationAngles(f, f1, f2, f3, f4, f5, entity);
int b = entity.getRidingEntity() != null ? 1 : 0;
内容来源于网络,如有侵权,请联系作者删除!