本文整理了Java中net.minecraft.entity.Entity.startRiding()
方法的一些代码示例,展示了Entity.startRiding()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Entity.startRiding()
方法的具体详情如下:
包路径:net.minecraft.entity.Entity
类名称:Entity
方法名:startRiding
暂无
代码示例来源: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: P3pp3rF1y/AncientWarfare2
@Override
public boolean startRiding(Entity entity, boolean force) {
if (super.startRiding(entity, force)) {
if (entity instanceof EntityPlayerMP) {
EntityPlayerMP player = (EntityPlayerMP) entity;
player.capabilities.allowFlying = true;
}
return true;
}
return false;
}
代码示例来源:origin: AppliedEnergistics/Applied-Energistics-2
passanger.startRiding( entity, true );
代码示例来源:origin: ValkyrienWarfare/Valkyrien-Warfare-Revamped
public void onTick() {
if (!worldObj.isRemote) {
for (Entity e : queuedEntitiesToMount) {
if (e != null) {
e.startRiding(this.wrapper, true);
}
}
queuedEntitiesToMount.clear();
}
// wrapper.isDead = true;
}
代码示例来源:origin: CoFH/ThermalDynamics
public void start(Entity passenger) {
passenger.startRiding(this);
loadRider(passenger);
world.spawnEntity(this);
}
代码示例来源: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: PrinceOfAmber/Cyclic
private void tryPickupNearby() {
//try to find entities to pick up
int range = 1;
// processImpact does not hit entity items so we pushed it over here
// List<EntityLivingBase> targets = world.getEntitiesWithinAABB(EntityLivingBase.class, new AxisAlignedBB(x - RANGE, y - RANGE, z - RANGE, x + RANGE, y + RANGE, z + RANGE));
List<Entity> list = this.world.getEntitiesWithinAABBExcludingEntity(this, this.getEntityBoundingBox().offset(this.motionX, this.motionY, this.motionZ).grow(range, range, range));
for (Entity entityHit : list) {
if (entityHit instanceof EntityItem || entityHit instanceof EntityXPOrb) {
entityHit.startRiding(this);
break;
}
}
}
代码示例来源:origin: Alex-the-666/Ice_and_Fire
public boolean attackEntityAsMob(Entity entityIn) {
int attackDescision = this.getRNG().nextInt(3);
if(attackDescision == 0){
this.setAnimation(ANIMATION_STOMP);
return true;
}else if(attackDescision == 1){
if(!entityIn.isPassenger(this) && entityIn.width < 1.95F && !(entityIn instanceof EntityDragonBase)){
this.setAnimation(ANIMATION_EATPLAYER);
entityIn.startRiding(this, true);
}else{
this.setAnimation(ANIMATION_STOMP);
}
return true;
}else{
this.setAnimation(ANIMATION_KICK);
return true;
}
}
代码示例来源:origin: PenguinSquad/Harvest-Festival
@SubscribeEvent
public void onEntityInteract(PlayerInteractEvent.EntityInteract event) {
EntityPlayer player = event.getEntityPlayer();
if (!player.isBeingRidden() && !blocksPickup(player)) {
Entity entity = event.getTarget();
AnimalStats stats = EntityHelper.getStats(entity);
if (stats != null && stats.performTest(AnimalTest.CAN_CARRY)) {
entity.setEntityInvulnerable(true);
entity.startRiding(player, true);
}
}
}
代码示例来源:origin: Alex-the-666/Ice_and_Fire
if (this.getAnimation() != this.ANIMATION_SHAKEPREY) {
this.setAnimation(this.ANIMATION_SHAKEPREY);
entityIn.startRiding(this);
this.attackDecision = this.getRNG().nextBoolean();
return true;
代码示例来源:origin: Alex-the-666/Ice_and_Fire
if (this.getAnimation() != this.ANIMATION_SHAKEPREY) {
this.setAnimation(this.ANIMATION_SHAKEPREY);
entityIn.startRiding(this);
this.attackDecision = this.getRNG().nextBoolean();
return true;
内容来源于网络,如有侵权,请联系作者删除!