本文整理汇总了Java中net.minecraft.entity.player.EntityPlayer.startRiding方法的典型用法代码示例。如果您正苦于以下问题:Java EntityPlayer.startRiding方法的具体用法?Java EntityPlayer.startRiding怎么用?Java EntityPlayer.startRiding使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.entity.player.EntityPlayer
的用法示例。
在下文中一共展示了EntityPlayer.startRiding方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: songTick
import net.minecraft.entity.player.EntityPlayer; //导入方法依赖的package包/类
@Override
public boolean songTick(EntityPlayer player, ItemStack instrument, int interval, int ticks, int length) {
if (interval == 0 && ticks == 1) {
EnumHand hand = player.getActiveHand();
World world = player.world;
SoundType t = SoundType.getSoundTypeByName(SoundType.AMBIENT.getTag());
if (!world.isRemote) {
EntityHorse horse = new EntityGhostHorse(world);
horse.setHorseSaddled(true);
horse.setTamedBy(player);
horse.setLocationAndAngles(player.posX, player.posY, player.posZ, player.rotationYaw, player.rotationPitch);
world.spawnEntity(horse);
player.startRiding(horse);
NBTTagCompound tag = ItemUtil.getOrCreateTag(instrument);
tag.setInteger("id", horse.getEntityId());
}
player.setActiveHand(hand);
}
return true;
}
示例2: processInitialInteract
import net.minecraft.entity.player.EntityPlayer; //导入方法依赖的package包/类
public boolean processInitialInteract(EntityPlayer player, EnumHand stack)
{
if (player.isSneaking())
{
return false;
}
else
{
if (!this.world.isRemote && this.outOfControlTicks < 60.0F)
{
player.startRiding(this);
}
return true;
}
}
示例3: processInitialInteract
import net.minecraft.entity.player.EntityPlayer; //导入方法依赖的package包/类
public boolean processInitialInteract(EntityPlayer player, EnumHand stack)
{
if (player.isSneaking())
{
return false;
}
else if (this.isBeingRidden())
{
return true;
}
else
{
if (!this.world.isRemote)
{
player.startRiding(this);
}
return true;
}
}
示例4: processInitialInteract
import net.minecraft.entity.player.EntityPlayer; //导入方法依赖的package包/类
public boolean processInitialInteract(EntityPlayer player, @Nullable ItemStack stack, EnumHand hand)
{
if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.entity.minecart.MinecartInteractEvent(this, player, stack, hand))) return true;
if (player.isSneaking())
{
return false;
}
else if (this.isBeingRidden())
{
return true;
}
else
{
if (!this.worldObj.isRemote)
{
player.startRiding(this);
}
return true;
}
}
示例5: processInteract
import net.minecraft.entity.player.EntityPlayer; //导入方法依赖的package包/类
public boolean processInteract(EntityPlayer player, EnumHand hand, @Nullable ItemStack stack)
{
if (!super.processInteract(player, hand, stack))
{
if (this.getSaddled() && !this.worldObj.isRemote && !this.isBeingRidden())
{
player.startRiding(this);
return true;
}
else
{
return false;
}
}
else
{
return true;
}
}
示例6: mountTo
import net.minecraft.entity.player.EntityPlayer; //导入方法依赖的package包/类
protected void mountTo(EntityPlayer player)
{
player.rotationYaw = this.rotationYaw;
player.rotationPitch = this.rotationPitch;
this.setEatingHaystack(false);
this.setRearing(false);
if (!this.world.isRemote)
{
player.startRiding(this);
}
}
示例7: processInteract
import net.minecraft.entity.player.EntityPlayer; //导入方法依赖的package包/类
public boolean processInteract(EntityPlayer player, EnumHand hand)
{
if (!super.processInteract(player, hand))
{
ItemStack itemstack = player.getHeldItem(hand);
if (itemstack.getItem() == Items.NAME_TAG)
{
itemstack.interactWithEntity(player, this, hand);
return true;
}
else if (this.getSaddled() && !this.isBeingRidden())
{
if (!this.world.isRemote)
{
player.startRiding(this);
}
return true;
}
else if (itemstack.getItem() == Items.SADDLE)
{
itemstack.interactWithEntity(player, this, hand);
return true;
}
else
{
return false;
}
}
else
{
return true;
}
}
示例8: processInitialInteract
import net.minecraft.entity.player.EntityPlayer; //导入方法依赖的package包/类
public boolean processInitialInteract(EntityPlayer player, @Nullable ItemStack stack, EnumHand hand)
{
if (!this.worldObj.isRemote && !player.isSneaking() && this.outOfControlTicks < 60.0F)
{
player.startRiding(this);
}
return true;
}
示例9: mountTo
import net.minecraft.entity.player.EntityPlayer; //导入方法依赖的package包/类
private void mountTo(EntityPlayer player)
{
player.rotationYaw = this.rotationYaw;
player.rotationPitch = this.rotationPitch;
this.setEatingHaystack(false);
this.setRearing(false);
if (!this.worldObj.isRemote)
{
player.startRiding(this);
}
}
示例10: processInteract
import net.minecraft.entity.player.EntityPlayer; //导入方法依赖的package包/类
@Override
protected boolean processInteract(EntityPlayer player, EnumHand hand, @Nullable ItemStack stack) {
if(player != null && this.canBeRidden(player) && !this.isBeingRidden()) {
player.startRiding(this);
return true;
}
return false;
}