本文整理汇总了Java中net.minecraft.world.WorldServer.getChunkProvider方法的典型用法代码示例。如果您正苦于以下问题:Java WorldServer.getChunkProvider方法的具体用法?Java WorldServer.getChunkProvider怎么用?Java WorldServer.getChunkProvider使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.world.WorldServer
的用法示例。
在下文中一共展示了WorldServer.getChunkProvider方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: isCity
import net.minecraft.world.WorldServer; //导入方法依赖的package包/类
public static <T> boolean isCity(IEventQuery<T> query, T event) {
World world = query.getWorld(event);
WorldServer ws = (WorldServer) world;
if (ws.getChunkProvider().chunkGenerator instanceof ILostChunkGenerator) {
ILostChunkGenerator gen = (ILostChunkGenerator) ws.getChunkProvider().chunkGenerator;
BlockPos pos = query.getPos(event);
ILostChunkInfo chunkInfo = gen.getChunkInfo(pos.getX() >> 4, pos.getZ() >> 4);
return chunkInfo.isCity();
}
return false;
}
示例2: isStreet
import net.minecraft.world.WorldServer; //导入方法依赖的package包/类
public static <T> boolean isStreet(IEventQuery<T> query, T event) {
World world = query.getWorld(event);
WorldServer ws = (WorldServer) world;
if (ws.getChunkProvider().chunkGenerator instanceof ILostChunkGenerator) {
ILostChunkGenerator gen = (ILostChunkGenerator) ws.getChunkProvider().chunkGenerator;
BlockPos pos = query.getPos(event);
ILostChunkInfo chunkInfo = gen.getChunkInfo(pos.getX() >> 4, pos.getZ() >> 4);
return chunkInfo.isCity() && chunkInfo.getBuildingType() == null;
}
return false;
}
示例3: isBuilding
import net.minecraft.world.WorldServer; //导入方法依赖的package包/类
public static <T> boolean isBuilding(IEventQuery<T> query, T event) {
World world = query.getWorld(event);
WorldServer ws = (WorldServer) world;
if (ws.getChunkProvider().chunkGenerator instanceof ILostChunkGenerator) {
ILostChunkGenerator gen = (ILostChunkGenerator) ws.getChunkProvider().chunkGenerator;
BlockPos pos = query.getPos(event);
ILostChunkInfo chunkInfo = gen.getChunkInfo(pos.getX() >> 4, pos.getZ() >> 4);
return chunkInfo.isCity() && chunkInfo.getBuildingType() != null;
}
return false;
}