本文整理了Java中net.minecraft.entity.Entity.isRiding()
方法的一些代码示例,展示了Entity.isRiding()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Entity.isRiding()
方法的具体详情如下:
包路径:net.minecraft.entity.Entity
类名称:Entity
方法名:isRiding
暂无
代码示例来源:origin: Vazkii/Botania
public void mountEntity(Entity e) {
BlockPos nextDest = getNextDestination();
if(e.isRiding() || world.isRemote || nextDest == null || !isValidBinding())
return;
EntityPlayerMover mover = new EntityPlayerMover(world, pos, nextDest);
world.spawnEntity(mover);
e.startRiding(mover);
if(!(e instanceof EntityItem)) {
mover.playSound(ModSounds.lightRelay, 0.2F, (float) Math.random() * 0.3F + 0.7F);
}
if(e instanceof EntityPlayerMP) {
PlayerHelper.grantCriterion((EntityPlayerMP) e, new ResourceLocation(LibMisc.MOD_ID, "main/luminizer_ride"), "code_triggered");
}
}
代码示例来源:origin: AppliedEnergistics/Applied-Energistics-2
if( entity.isRiding() )
代码示例来源:origin: ValkyrienWarfare/Valkyrien-Warfare-Revamped
@Override
public Entity getLowestRidingEntity() {
Entity entity;
for (entity = this; entity.isRiding(); entity = entity.getRidingEntity()) {
}
return null;
}
代码示例来源:origin: CyclopsMC/EvilCraft
@Override
public void applyEntityCollision(Entity entityIn) {
if (!this.world.isRemote) {
if (!entityIn.noClip && !this.noClip) {
Entity controlling = this.getControllingPassenger();
if (entityIn != controlling) {
if (entityIn instanceof EntityLivingBase
&& !(entityIn instanceof EntityPlayer)
&& controlling == null
&& !entityIn.isRiding()) {
entityIn.startRiding(this);
}
}
}
}
}
代码示例来源:origin: SleepyTrousers/EnderIO
private static boolean doTeleport(@Nonnull World world, @Nonnull Entity entity, double targetX, double targetY, double targetZ) {
if (entity instanceof EntityLivingBase) {
return doTeleport(world, (EntityLivingBase) entity, targetX, targetY, targetZ);
}
if (entity.isRiding()) {
entity.dismountRidingEntity();
}
if (entity.isBeingRidden()) {
entity.removePassengers();
}
entity.setPositionAndRotation(targetX, targetY, targetZ, entity.rotationYaw, entity.rotationPitch);
return true;
}
代码示例来源:origin: vadis365/TheErebus
@Override
public void onEntityCollidedWithBlock(World worldIn, BlockPos pos, IBlockState state, Entity entityIn) {
if (!entityIn.isRiding() && !entityIn.isBeingRidden() && entityIn.timeUntilPortal <= 0) {
if (entityIn.dimension == 0)
TeleporterHandler.transferToErebus(entityIn);
else
TeleporterHandler.transferToOverworld(entityIn);
if (entityIn != null)
entityIn.timeUntilPortal = ConfigHandler.INSTANCE.portalCooldown * 20;
return;
}
}
代码示例来源:origin: CoFH/CoFHCore
public static void transferEntityToDimension(Entity entity, double x, double y, double z, int dimension, PlayerList manager) {
if (entity instanceof EntityPlayerMP) {
transferPlayerToDimension((EntityPlayerMP) entity, dimension, manager);
return;
}
WorldServer worldserver = manager.getServerInstance().getWorld(entity.dimension);
entity.dimension = dimension;
WorldServer worldserver1 = manager.getServerInstance().getWorld(entity.dimension);
worldserver.removeEntityDangerously(entity);
if (entity.isBeingRidden()) {
entity.removePassengers();
}
if (entity.isRiding()) {
entity.dismountRidingEntity();
}
entity.isDead = false;
transferEntityToWorld(entity, x, y, z, worldserver, worldserver1);
}
代码示例来源:origin: CoFH/CoFHCore
public static void transferEntityToDimension(Entity entity, int dimension, PlayerList manager) {
if (entity instanceof EntityPlayerMP) {
transferPlayerToDimension((EntityPlayerMP) entity, dimension, manager);
return;
}
WorldServer worldserver = manager.getServerInstance().getWorld(entity.dimension);
entity.dimension = dimension;
WorldServer worldserver1 = manager.getServerInstance().getWorld(entity.dimension);
worldserver.removeEntityDangerously(entity);
if (entity.isBeingRidden()) {
entity.removePassengers();
}
if (entity.isRiding()) {
entity.dismountRidingEntity();
}
entity.isDead = false;
transferEntityToWorld(entity, worldserver, worldserver1);
}
代码示例来源:origin: McJtyMods/DeepResonance
@Override
public void render(Entity entity, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scale) {
this.isSneak = entity.isSneaking();
this.isRiding = entity.isRiding();
代码示例来源:origin: Vazkii/Quark
if(shootingEntity.isRiding())
shootingEntity.dismountRidingEntity();
代码示例来源:origin: TeamWizardry/Wizardry
if ((!entity.onGround || !entity.isSneaking() || !(entity instanceof EntityPlayer)) && !entity.isRiding()) {
double d15 = entity.posX - d10;
double d16 = entity.posY - d11;
代码示例来源:origin: ValkyrienWarfare/Valkyrien-Warfare-Revamped
entity instanceof EntityPlayer && !entity.isRiding()) {
if (dy != origDy) {
内容来源于网络,如有侵权,请联系作者删除!