本文整理匯總了Java中net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate方法的典型用法代碼示例。如果您正苦於以下問題:Java PopulateChunkEvent.Populate方法的具體用法?Java PopulateChunkEvent.Populate怎麽用?Java PopulateChunkEvent.Populate使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類net.minecraftforge.event.terraingen.PopulateChunkEvent
的用法示例。
在下文中一共展示了PopulateChunkEvent.Populate方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: populate
import net.minecraftforge.event.terraingen.PopulateChunkEvent; //導入方法依賴的package包/類
/** Alters vanilla chunk populating. */
@SubscribeEvent
public void populate(PopulateChunkEvent.Populate event) {
Random rand = event.getRand();
// Chance of generating rice lake
if (event.getType() == PopulateChunkEvent.Populate.EventType.LAKE &&
rand.nextFloat() <= 0.1) {
event.setResult(Result.DENY);
new PopulateChunkRicelake(event.getWorld(), rand)
.generateChunk(event.getChunkX(), event.getChunkZ());
return;
}
}
示例2: onBiomePopulate
import net.minecraftforge.event.terraingen.PopulateChunkEvent; //導入方法依賴的package包/類
@SubscribeEvent
public void onBiomePopulate(PopulateChunkEvent.Populate event)
{
if(ConfigValues.SPAWN_WORLD_CRATER)
{
if(event.getWorld().provider.getDimension() == 0)
{
int chunkX = event.getChunkX();
int chunkZ = event.getChunkZ();
if(Math.sqrt(((chunkX*16)*(chunkX*16)) + ((chunkZ*16)*(chunkZ*16))) < 378)
{
event.setResult(Event.Result.DENY);
}
}
}
}
示例3: onPopulate
import net.minecraftforge.event.terraingen.PopulateChunkEvent; //導入方法依賴的package包/類
@SubscribeEvent
public void onPopulate(PopulateChunkEvent.Populate event)
{
if (event.getWorld().getWorldType() != ExPMisc.worldTypeExP)
{
return;
}
if (event.getType() == EventType.LAKE || event.getType() == EventType.LAVA)
{
event.setResult(Result.DENY);
}
}
示例4: onPopulateChunk_Populate
import net.minecraftforge.event.terraingen.PopulateChunkEvent; //導入方法依賴的package包/類
@SubscribeEvent(priority = EventPriority.TOP)
public static void onPopulateChunk_Populate(PopulateChunkEvent.Populate event) {
Biome biome = event.getWorld().getBiome(new BlockPos(event.getChunkX() * 16, 1, event.getChunkZ() * 16));
if (biome instanceof AlchemyBiome) {
if (event.getType() == PopulateChunkEvent.Populate.EventType.LAKE ||
event.getType() == PopulateChunkEvent.Populate.EventType.LAVA)
AlchemyEventSystem.markEventIgnore(event, Result.DENY);
}
}
示例5: cancelPopulations
import net.minecraftforge.event.terraingen.PopulateChunkEvent; //導入方法依賴的package包/類
@SubscribeEvent
public void cancelPopulations(PopulateChunkEvent.Populate event) {
if (!genOnWorld(event.world)) return;
final EventType type = event.type;
if (type == LAKE || type == LAVA || type == ANIMALS || type == CUSTOM) {
if (cancel(event.world, event.chunkX, event.chunkZ)) {
event.setResult(Result.DENY);
}
}
}
示例6: onPopulateChunk
import net.minecraftforge.event.terraingen.PopulateChunkEvent; //導入方法依賴的package包/類
@SubscribeEvent
public void onPopulateChunk(PopulateChunkEvent.Populate event)
{
if (Configs.get(event.getWorld()).populationIsDisabled(event.getType()))
{
event.setResult(Event.Result.DENY);
}
}
示例7: onPopulate
import net.minecraftforge.event.terraingen.PopulateChunkEvent; //導入方法依賴的package包/類
@SubscribeEvent
public void onPopulate(PopulateChunkEvent.Populate event) {
if (event.type == EventType.LAKE || event.type == EventType.LAVA) {
for(Entry<String, StructureGenerator> e : StructureGenerator.generators.entrySet()) {
if (e.getValue().areStructuresInChunk(event.world, event.chunkX, event.chunkZ)) {
event.setResult(Result.DENY);
return;
}
}
}
}
示例8: onPopulateChunk
import net.minecraftforge.event.terraingen.PopulateChunkEvent; //導入方法依賴的package包/類
@SubscribeEvent(priority=EventPriority.LOWEST)
public void onPopulateChunk(PopulateChunkEvent.Populate event) {
if (!event.world.provider.isSurfaceWorld()) {
return;
} else if (event.type != EventType.LAKE && event.type != EventType.LAVA) {
return;
} else if (bossRoomGen.shouldDenyLakeAt(event.chunkX, event.chunkZ)) {
event.setResult(Result.DENY);
}
}
示例9: onPopulateChunkEvent
import net.minecraftforge.event.terraingen.PopulateChunkEvent; //導入方法依賴的package包/類
@SubscribeEvent
@SuppressWarnings("unused")
public void onPopulateChunkEvent(PopulateChunkEvent.Populate event) {
}