本文整理汇总了Java中net.minecraft.entity.Entity.mountEntity方法的典型用法代码示例。如果您正苦于以下问题:Java Entity.mountEntity方法的具体用法?Java Entity.mountEntity怎么用?Java Entity.mountEntity使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.entity.Entity
的用法示例。
在下文中一共展示了Entity.mountEntity方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: removeEntity
import net.minecraft.entity.Entity; //导入方法依赖的package包/类
/**
* Schedule the entity for removal during the next tick. Marks the entity dead in anticipation.
*/
public void removeEntity(Entity entityIn)
{
if (entityIn.riddenByEntity != null)
{
entityIn.riddenByEntity.mountEntity((Entity)null);
}
if (entityIn.ridingEntity != null)
{
entityIn.mountEntity((Entity)null);
}
entityIn.setDead();
if (entityIn instanceof EntityPlayer)
{
this.playerEntities.remove(entityIn);
this.updateAllPlayersSleepingFlag();
this.onEntityRemoved(entityIn);
}
}
示例2: handleEntityAttach
import net.minecraft.entity.Entity; //导入方法依赖的package包/类
public void handleEntityAttach(S1BPacketEntityAttach packetIn)
{
PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
Entity entity = this.clientWorldController.getEntityByID(packetIn.getEntityId());
Entity entity1 = this.clientWorldController.getEntityByID(packetIn.getVehicleEntityId());
if (packetIn.getLeash() == 0)
{
boolean flag = false;
if (packetIn.getEntityId() == this.gameController.thePlayer.getEntityId())
{
entity = this.gameController.thePlayer;
if (entity1 instanceof EntityBoat)
{
((EntityBoat)entity1).setIsBoatEmpty(false);
}
flag = entity.ridingEntity == null && entity1 != null;
}
else if (entity1 instanceof EntityBoat)
{
((EntityBoat)entity1).setIsBoatEmpty(true);
}
if (entity == null)
{
return;
}
entity.mountEntity(entity1);
if (flag)
{
GameSettings gamesettings = this.gameController.gameSettings;
this.gameController.ingameGUI.setRecordPlaying(I18n.format("mount.onboard", new Object[] {GameSettings.getKeyDisplayString(gamesettings.keyBindSneak.getKeyCode())}), false);
}
}
else if (packetIn.getLeash() == 1 && entity instanceof EntityLiving)
{
if (entity1 != null)
{
((EntityLiving)entity).setLeashedToEntity(entity1, false);
}
else
{
((EntityLiving)entity).clearLeashed(false, false);
}
}
}
示例3: handleEntityAttach
import net.minecraft.entity.Entity; //导入方法依赖的package包/类
public void handleEntityAttach(S1BPacketEntityAttach packetIn) {
PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
Entity entity = this.clientWorldController.getEntityByID(packetIn.getEntityId());
Entity entity1 = this.clientWorldController.getEntityByID(packetIn.getVehicleEntityId());
if (packetIn.getLeash() == 0) {
boolean flag = false;
if (packetIn.getEntityId() == this.gameController.thePlayer.getEntityId()) {
entity = this.gameController.thePlayer;
if (entity1 instanceof EntityBoat) {
((EntityBoat) entity1).setIsBoatEmpty(false);
}
flag = entity.ridingEntity == null && entity1 != null;
} else if (entity1 instanceof EntityBoat) {
((EntityBoat) entity1).setIsBoatEmpty(true);
}
if (entity == null) {
return;
}
entity.mountEntity(entity1);
if (flag) {
GameSettings gamesettings = this.gameController.gameSettings;
this.gameController.ingameGUI.setRecordPlaying(
I18n.format("mount.onboard",
new Object[] {
GameSettings.getKeyDisplayString(gamesettings.keyBindSneak.getKeyCode()) }),
false);
}
} else if (packetIn.getLeash() == 1 && entity instanceof EntityLiving) {
if (entity1 != null) {
((EntityLiving) entity).setLeashedToEntity(entity1, false);
} else {
((EntityLiving) entity).clearLeashed(false, false);
}
}
}