本文整理匯總了Java中net.minecraft.world.WorldServer.resetUpdateEntityTick方法的典型用法代碼示例。如果您正苦於以下問題:Java WorldServer.resetUpdateEntityTick方法的具體用法?Java WorldServer.resetUpdateEntityTick怎麽用?Java WorldServer.resetUpdateEntityTick使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類net.minecraft.world.WorldServer
的用法示例。
在下文中一共展示了WorldServer.resetUpdateEntityTick方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: travelToDimension
import net.minecraft.world.WorldServer; //導入方法依賴的package包/類
/**
* Teleports the entity to another dimension. Params: Dimension number to teleport to
*/
public void travelToDimension(int dimensionId)
{
if (!this.worldObj.isRemote && !this.isDead)
{
this.worldObj.theProfiler.startSection("changeDimension");
MinecraftServer minecraftserver = MinecraftServer.getServer();
int i = this.dimension;
WorldServer worldserver = minecraftserver.worldServerForDimension(i);
WorldServer worldserver1 = minecraftserver.worldServerForDimension(dimensionId);
this.dimension = dimensionId;
if (i == 1 && dimensionId == 1)
{
worldserver1 = minecraftserver.worldServerForDimension(0);
this.dimension = 0;
}
this.worldObj.removeEntity(this);
this.isDead = false;
this.worldObj.theProfiler.startSection("reposition");
minecraftserver.getConfigurationManager().transferEntityToWorld(this, i, worldserver, worldserver1);
this.worldObj.theProfiler.endStartSection("reloading");
Entity entity = EntityList.createEntityByName(EntityList.getEntityString(this), worldserver1);
if (entity != null)
{
entity.copyDataFromOld(this);
if (i == 1 && dimensionId == 1)
{
BlockPos blockpos = this.worldObj.getTopSolidOrLiquidBlock(worldserver1.getSpawnPoint());
entity.moveToBlockPosAndAngles(blockpos, entity.rotationYaw, entity.rotationPitch);
}
worldserver1.spawnEntityInWorld(entity);
}
this.isDead = true;
this.worldObj.theProfiler.endSection();
worldserver.resetUpdateEntityTick();
worldserver1.resetUpdateEntityTick();
this.worldObj.theProfiler.endSection();
}
}