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


Java World.getSpigotConfig方法代码示例

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


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

示例1: activateEntities

import net.minecraft.world.World; //导入方法依赖的package包/类
/**
 * Find what entities are in range of the players in the world and set
 * active if in range.
 *
 * @param world
 */
public static void activateEntities(World world)
{
    SpigotTimings.entityActivationCheckTimer.startTiming();
    // Cauldron start - proxy world support
    final int miscActivationRange = world.getSpigotConfig().miscActivationRange;
    final int animalActivationRange = world.getSpigotConfig().animalActivationRange;
    final int monsterActivationRange = world.getSpigotConfig().monsterActivationRange;
    // Cauldron end

    int maxRange = Math.max( monsterActivationRange, animalActivationRange );
    maxRange = Math.max( maxRange, miscActivationRange );
    maxRange = Math.min( ( world.getSpigotConfig().viewDistance << 4 ) - 8, maxRange ); // Cauldron

    for ( Entity player : new ArrayList<Entity>( world.playerEntities ) )
    {

        player.activatedTick = MinecraftServer.currentTick;
        growBB( maxBB, player.boundingBox, maxRange, 256, maxRange );
        growBB( miscBB, player.boundingBox, miscActivationRange, 256, miscActivationRange );
        growBB( animalBB, player.boundingBox, animalActivationRange, 256, animalActivationRange );
        growBB( monsterBB, player.boundingBox, monsterActivationRange, 256, monsterActivationRange );

        int i = MathHelper.floor_double( maxBB.minX / 16.0D );
        int j = MathHelper.floor_double( maxBB.maxX / 16.0D );
        int k = MathHelper.floor_double( maxBB.minZ / 16.0D );
        int l = MathHelper.floor_double( maxBB.maxZ / 16.0D );

        for ( int i1 = i; i1 <= j; ++i1 )
        {
            for ( int j1 = k; j1 <= l; ++j1 )
            {
                if ( world.getWorld().isChunkLoaded( i1, j1 ) )
                {
                    activateChunkEntities( world.getChunkFromChunkCoords( i1, j1 ) );
                }
            }
        }
    }
    SpigotTimings.entityActivationCheckTimer.stopTiming();
}
 
开发者ID:UraniumMC,项目名称:Uranium,代码行数:47,代码来源:ActivationRange.java


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