当前位置: 首页>>代码示例>>Java>>正文


Java Teleporter.PortalPosition方法代码示例

本文整理汇总了Java中net.minecraft.world.Teleporter.PortalPosition方法的典型用法代码示例。如果您正苦于以下问题:Java Teleporter.PortalPosition方法的具体用法?Java Teleporter.PortalPosition怎么用?Java Teleporter.PortalPosition使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.minecraft.world.Teleporter的用法示例。


在下文中一共展示了Teleporter.PortalPosition方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: removeStalePortalLocations

import net.minecraft.world.Teleporter; //导入方法依赖的package包/类
/**
 * called periodically to remove out-of-date portal locations from the cache list. Argument par1 is a
 * WorldServer.getTotalWorldTime() value.
 */
@Override
public void removeStalePortalLocations(long worldTime)
{
    if (worldTime % 100L == 0L)
    {
        long i = worldTime - 300L;
        ObjectIterator<Teleporter.PortalPosition> objectiterator = this.destinationCoordinateCache.values().iterator();

        while (objectiterator.hasNext())
        {
            Teleporter.PortalPosition teleporter$portalposition = (Teleporter.PortalPosition)objectiterator.next();

            if (teleporter$portalposition == null || teleporter$portalposition.lastUpdateTime < i)
            {
                objectiterator.remove();
            }
        }
    }
}
 
开发者ID:Ohrm,项目名称:Malgra,代码行数:24,代码来源:TeleporterResearch.java

示例2: removeStalePortalLocations

import net.minecraft.world.Teleporter; //导入方法依赖的package包/类
/**
 * called periodically to remove out-of-date portal locations from the cache list. Argument par1 is a
 * WorldServer.getTotalWorldTime() value.
 */
@Override
public void removeStalePortalLocations(long worldTime)
{
	if (worldTime % 100L == 0L)
	{
		long i = worldTime - 600L;
		ObjectIterator<Teleporter.PortalPosition> objectiterator = this.destinationCoordinateCache.values().iterator();

		while (objectiterator.hasNext())
		{
			Teleporter.PortalPosition teleporter$portalposition = (Teleporter.PortalPosition)objectiterator.next();

			if (teleporter$portalposition == null || teleporter$portalposition.lastUpdateTime < i)
			{
				objectiterator.remove();
			}
		}
	}
}
 
开发者ID:Deadrik,项目名称:TFC2,代码行数:24,代码来源:TeleporterPaths.java

示例3: removeStalePortalLocations

import net.minecraft.world.Teleporter; //导入方法依赖的package包/类
/**
 * called periodically to remove out-of-date portal locations from the cache list. Argument par1 is a
 * WorldServer.getTotalWorldTime() value.
 */
@Override
public void removeStalePortalLocations(long worldTime) {
    if (worldTime % 100L == 0L) {
        long i = worldTime - 300L;
        ObjectIterator<Teleporter.PortalPosition> objectiterator = this.destinationCoordinateCache.values().iterator();

        while (objectiterator.hasNext()) {
            Teleporter.PortalPosition teleporter$portalposition = (Teleporter.PortalPosition)objectiterator.next();

            if (teleporter$portalposition == null || teleporter$portalposition.lastUpdateTime < i) {
                objectiterator.remove();
            }
        }
    }
}
 
开发者ID:Wehavecookies56,项目名称:Kingdom-Keys-Re-Coded,代码行数:20,代码来源:DimensionTeleporter.java

示例4: removeStalePortalLocations

import net.minecraft.world.Teleporter; //导入方法依赖的package包/类
/**
 * called periodically to remove out-of-date portal locations from the cache
 * list. Argument par1 is a WorldServer.getTotalWorldTime() value.
 */
@Override
public void removeStalePortalLocations(long p_85189_1_) {
	if (p_85189_1_ % 100L == 0L) {
		Iterator iterator = this.destinationCoordinateKeys.iterator();
		long j = p_85189_1_ - 600L;

		while (iterator.hasNext()) {
			Long olong = (Long) iterator.next();
			Teleporter.PortalPosition portalposition = (Teleporter.PortalPosition) this.destinationCoordinateCache.getValueByKey(olong.longValue());

			if (portalposition == null || portalposition.lastUpdateTime < j) {
				iterator.remove();
				this.destinationCoordinateCache.remove(olong.longValue());
			}
		}
	}
}
 
开发者ID:NovaViper,项目名称:ZeroQuest,代码行数:22,代码来源:TeleporterNillax.java

示例5: removeStalePortalLocations

import net.minecraft.world.Teleporter; //导入方法依赖的package包/类
@SuppressWarnings("rawtypes")
@Override
public void removeStalePortalLocations(long worldTime)
{
	if (worldTime % 100L == 0L)
	{
		long i = worldTime - 300L;
		ObjectIterator<Teleporter.PortalPosition> objectiterator = destinationCoordinateCache.values().iterator();

		while (objectiterator.hasNext())
		{
			Teleporter.PortalPosition teleporter$portalposition = objectiterator.next();

			if (teleporter$portalposition == null || teleporter$portalposition.lastUpdateTime < i)
				objectiterator.remove();
		}
	}
}
 
开发者ID:Shinoow,项目名称:AbyssalCraft,代码行数:19,代码来源:TeleporterAC.java

示例6: removeStalePortalLocations

import net.minecraft.world.Teleporter; //导入方法依赖的package包/类
public void removeStalePortalLocations(long par1) {
    if (par1 % 100L == 0L) {
        Iterator<Long> iterator = this.destinationCoordinateKeys.iterator();
        long j = par1 - 600L;

        while (iterator.hasNext()) {
            Long olong = (Long)iterator.next();
            Teleporter.PortalPosition portalposition = (Teleporter.PortalPosition)this.destinationCoordinateCache.getValueByKey(olong.longValue());

            if (portalposition == null || portalposition.lastUpdateTime < j) {
                iterator.remove();
                this.destinationCoordinateCache.remove(olong.longValue());
            }
        }
    }
}
 
开发者ID:Aurilux,项目名称:Xth-uoth,代码行数:17,代码来源:TeleporterXthuoth.java

示例7: readCachedPortal

import net.minecraft.world.Teleporter; //导入方法依赖的package包/类
private void readCachedPortal(PortalSearchState search) {
	Teleporter.PortalPosition portalposition = destinationCoordinateCache.get(search.longXZPair);
	search.distance = 0.0D;
	search.portalPos = portalposition;
	portalposition.lastUpdateTime = world.getTotalWorldTime();
	search.notCached = false;
}
 
开发者ID:ToroCraft,项目名称:TeleToro,代码行数:8,代码来源:TeletoryTeleporter.java

示例8: removeStalePortalLocations

import net.minecraft.world.Teleporter; //导入方法依赖的package包/类
@Override
public void removeStalePortalLocations(long totalWorldTime) {
	if(totalWorldTime % 100L == 0L) {
		Iterator iterator = destinationCoordinateKeys.iterator();
		long j = totalWorldTime - 600L;
		while(iterator.hasNext()) {
			Long olong = (Long) iterator.next();
			Teleporter.PortalPosition position = (Teleporter.PortalPosition) destinationCoordinateCache.getValueByKey(olong.longValue());
			if(position == null || position.lastUpdateTime < j) {
				iterator.remove();
				destinationCoordinateCache.remove(olong.longValue());
			}
		}
	}
}
 
开发者ID:AgeCraft,项目名称:AgeCraft-Old,代码行数:16,代码来源:AgeTeleporterOld.java

示例9: placeInExistingPortal

import net.minecraft.world.Teleporter; //导入方法依赖的package包/类
@Override
public boolean placeInExistingPortal(Entity entityIn, float rotationYaw)
{
	boolean flag = true;
	int playerX = MathHelper.floor(entityIn.posX);
	int playerZ = MathHelper.floor(entityIn.posZ);
	boolean shouldAddPortalPosition = true;
	boolean foundPortal = false;
	BlockPos object = new BlockPos(entityIn);
	long k = ChunkPos.asLong(playerX, playerZ);

	IslandMap islandMap = Core.getMapForWorld(worldServerInstance, entityIn.getPosition());
	Center closest = islandMap.getClosestCenter(new Point((playerX*8) % 4096,(playerZ*8) % 4096));
	//Check if we already have a portal position cached here
	if (this.destinationCoordinateCache.containsKey(k))
	{
		Teleporter.PortalPosition portalposition = (Teleporter.PortalPosition)this.destinationCoordinateCache.get(k);
		object = portalposition;
		portalposition.lastUpdateTime = this.worldServerInstance.getTotalWorldTime();
		shouldAddPortalPosition = false;
	}
	else //If not then we do a simple search for the closest portal block
	{
		object = this.findPortal(new BlockPos(entityIn));
	}

	//If we found a portal location then we need to move the player to it
	if (object != null)
	{
		if (shouldAddPortalPosition)
		{
			this.destinationCoordinateCache.put(k, new Teleporter.PortalPosition((BlockPos)object, this.worldServerInstance.getTotalWorldTime()));
			//this.destinationCoordinateKeys.add(Long.valueOf(k));
		}

		EnumFacing enumfacing = null;
		BlockPos pos = object;
		PortalAttribute attr = (PortalAttribute) closest.getAttribute(Attribute.Portal);

		if(this.checkRoomForPlayer(pos.north()))
			pos = pos.north();
		else if(this.checkRoomForPlayer(pos.south()))
			pos = pos.south();
		else if(this.checkRoomForPlayer(pos.east()))
			pos = pos.east();
		else if(this.checkRoomForPlayer(pos.west()))
			pos = pos.west();

		entityIn.setLocationAndAngles(pos.getX()+0.5, pos.getY()+0.5, pos.getZ()+0.5, rotationYaw, entityIn.rotationPitch);
		return true;
	}
	else
	{
		return false;
	}
}
 
开发者ID:Deadrik,项目名称:TFC2,代码行数:57,代码来源:TeleporterPaths.java


注:本文中的net.minecraft.world.Teleporter.PortalPosition方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。