本文整理匯總了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;
}