本文整理匯總了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);
}
}
}