當前位置: 首頁>>代碼示例>>Java>>正文


Java PopulateChunkEvent.Populate方法代碼示例

本文整理匯總了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;
    }
}
 
開發者ID:JayAvery,項目名稱:geomastery,代碼行數:17,代碼來源:WorldGenerator.java

示例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);
            }
        }
    }
}
 
開發者ID:Lumaceon,項目名稱:ClockworkPhase2,代碼行數:17,代碼來源:WorldGenHandler.java

示例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);
	}
}
 
開發者ID:V0idWa1k3r,項目名稱:ExPetrum,代碼行數:14,代碼來源:ExPHandlerWorldGen.java

示例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);
	}
}
 
開發者ID:NekoCaffeine,項目名稱:Alchemy,代碼行數:10,代碼來源:AlchemyBiome.java

示例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);
        }
    }
}
 
開發者ID:purpleposeidon,項目名稱:Factorization,代碼行數:12,代碼來源:WorldGenColossus.java

示例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);
    }
}
 
開發者ID:maruohon,項目名稱:orecontrol,代碼行數:9,代碼來源:OreControlEventHandler.java

示例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;
			}
		}
	}
}
 
開發者ID:TTFTCUTS,項目名稱:ShadowsOfPhysis,代碼行數:12,代碼來源:StructureHandler.java

示例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);
	}
}
 
開發者ID:coolAlias,項目名稱:ZeldaSwordSkills,代碼行數:11,代碼來源:ZSSBossDungeonGen.java

示例9: onPopulateChunkEvent

import net.minecraftforge.event.terraingen.PopulateChunkEvent; //導入方法依賴的package包/類
@SubscribeEvent
@SuppressWarnings("unused")
public void onPopulateChunkEvent(PopulateChunkEvent.Populate event) {
	
}
 
開發者ID:Team-Antimatter-Mod,項目名稱:AntiMatterMod,代碼行數:6,代碼來源:AMMStructureEventHandler.java


注:本文中的net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。