本文整理汇总了Java中net.minecraft.server.World.isLoaded方法的典型用法代码示例。如果您正苦于以下问题:Java World.isLoaded方法的具体用法?Java World.isLoaded怎么用?Java World.isLoaded使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.server.World
的用法示例。
在下文中一共展示了World.isLoaded方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: updateNearbyBlocks
import net.minecraft.server.World; //导入方法依赖的package包/类
private void updateNearbyBlocks(World world, int x, int y, int z, int radius, boolean updateSelf)
{
// If the block in question is loaded
if ( world.isLoaded( x, y, z ) )
{
// Get block id
int id = world.getTypeId( x, y, z );
// See if it needs update
if ( updateSelf && obfuscateBlocks[id] )
{
// Send the update
world.notify( x, y, z );
}
// Check other blocks for updates
if ( radius > 0 )
{
updateNearbyBlocks( world, x + 1, y, z, radius - 1, true );
updateNearbyBlocks( world, x - 1, y, z, radius - 1, true );
updateNearbyBlocks( world, x, y + 1, z, radius - 1, true );
updateNearbyBlocks( world, x, y - 1, z, radius - 1, true );
updateNearbyBlocks( world, x, y, z + 1, radius - 1, true );
updateNearbyBlocks( world, x, y, z - 1, radius - 1, true );
}
}
}
示例2: isLoaded
import net.minecraft.server.World; //导入方法依赖的package包/类
private static boolean isLoaded(World world, int x, int y, int z, int radius)
{
return world.isLoaded( x, y, z )
|| ( radius > 0
&& ( isLoaded( world, x + 1, y, z, radius - 1 )
|| isLoaded( world, x - 1, y, z, radius - 1 )
|| isLoaded( world, x, y + 1, z, radius - 1 )
|| isLoaded( world, x, y - 1, z, radius - 1 )
|| isLoaded( world, x, y, z + 1, radius - 1 )
|| isLoaded( world, x, y, z - 1, radius - 1 ) ) );
}
示例3: updateNearbyBlocks
import net.minecraft.server.World; //导入方法依赖的package包/类
private void updateNearbyBlocks(World world, int x, int y, int z, int radius, boolean updateSelf)
{
// If the block in question is loaded
if ( world.isLoaded( x, y, z ) )
{
// Get block id
Block block = world.getType(x, y, z);
// See if it needs update
if ( updateSelf && obfuscateBlocks[Block.getId( block )] )
{
// Send the update
world.notify( x, y, z );
}
// Check other blocks for updates
if ( radius > 0 )
{
updateNearbyBlocks( world, x + 1, y, z, radius - 1, true );
updateNearbyBlocks( world, x - 1, y, z, radius - 1, true );
updateNearbyBlocks( world, x, y + 1, z, radius - 1, true );
updateNearbyBlocks( world, x, y - 1, z, radius - 1, true );
updateNearbyBlocks( world, x, y, z + 1, radius - 1, true );
updateNearbyBlocks( world, x, y, z - 1, radius - 1, true );
}
}
}
示例4: isLoaded
import net.minecraft.server.World; //导入方法依赖的package包/类
private static boolean isLoaded(World world, int x, int y, int z, int radius)
{
return world.isLoaded( x, y, z )
&& ( radius == 0 ||
( isLoaded( world, x + 1, y, z, radius - 1 )
&& isLoaded( world, x - 1, y, z, radius - 1 )
&& isLoaded( world, x, y + 1, z, radius - 1 )
&& isLoaded( world, x, y - 1, z, radius - 1 )
&& isLoaded( world, x, y, z + 1, radius - 1 )
&& isLoaded( world, x, y, z - 1, radius - 1 ) ) );
}