本文整理汇总了Java中net.minecraftforge.event.terraingen.OreGenEvent.GenerateMinable方法的典型用法代码示例。如果您正苦于以下问题:Java OreGenEvent.GenerateMinable方法的具体用法?Java OreGenEvent.GenerateMinable怎么用?Java OreGenEvent.GenerateMinable使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraftforge.event.terraingen.OreGenEvent
的用法示例。
在下文中一共展示了OreGenEvent.GenerateMinable方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: oreGenMinable
import net.minecraftforge.event.terraingen.OreGenEvent; //导入方法依赖的package包/类
/** Alters vanilla ore generation. */
@SubscribeEvent
public void oreGenMinable(OreGenEvent.GenerateMinable event) {
OreGenEvent.GenerateMinable.EventType type = event.getType();
// Cancel vanilla ores to be overriden
if (type == OreGenEvent.GenerateMinable.EventType.COAL ||
type == OreGenEvent.GenerateMinable.EventType.DIAMOND ||
type == OreGenEvent.GenerateMinable.EventType.EMERALD ||
type == OreGenEvent.GenerateMinable.EventType.GOLD ||
type == OreGenEvent.GenerateMinable.EventType.IRON ||
type == OreGenEvent.GenerateMinable.EventType.LAPIS ||
type == OreGenEvent.GenerateMinable.EventType.REDSTONE) {
event.setResult(Event.Result.DENY);
}
}
示例2: genDisabler
import net.minecraftforge.event.terraingen.OreGenEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void genDisabler(OreGenEvent.GenerateMinable event)
{
EventType type = event.type;
if (type == EventType.COAL || type == EventType.DIAMOND || type == EventType.GOLD || type == EventType.IRON
|| type == EventType.LAPIS || type == EventType.QUARTZ || type == EventType.REDSTONE || type == EventType.EMERALD)
{
if(ConfigOptions.disableVanillaOres)
{
event.setResult(Result.DENY);
}
}
else if (type == EventType.ANDESITE || type == EventType.DIORITE || type == EventType.GRANITE || type == EventType.GRAVEL || type == EventType.DIRT)
{
if(ConfigOptions.disableVanillaOthers)
{
event.setResult(Result.DENY);
}
}
}
示例3: onOreGenMinable
import net.minecraftforge.event.terraingen.OreGenEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void onOreGenMinable(OreGenEvent.GenerateMinable event)
{
Configs configs = Configs.get(event.getWorld());
EventType type = event.getType();
// Disable custom ores, if a mod happens to fire the event
if (type == EventType.CUSTOM)
{
if (configs.minableIsDisabled(type))
{
event.setResult(Event.Result.DENY);
}
}
// Disable ALL vanilla generation, including dirt and gravel pockets.
else if (configs.minablesDisableAllVanillaGeneration())
{
event.setResult(Event.Result.DENY);
}
// Disable individual types
else if (configs.minableIsDisabled(type))
{
event.setResult(Event.Result.DENY);
}
}
示例4: onOreGeneration
import net.minecraftforge.event.terraingen.OreGenEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void onOreGeneration(OreGenEvent.GenerateMinable event)
{
if(ConfigValues.SPAWN_WORLD_CRATER)
{
if(event.getWorld().provider.getDimension() == 0)
{
int x = event.getPos().getX();
int z = event.getPos().getZ();
if(Math.sqrt((x*x) + (z*z)) < 378)
{
event.setResult(Event.Result.DENY);
}
}
}
}
示例5: onWorldGen
import net.minecraftforge.event.terraingen.OreGenEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void onWorldGen(OreGenEvent.GenerateMinable event) {
if(event.world.provider instanceof WorldProviderPlanet &&
DimensionManager.getInstance().getDimensionProperties(event.world.provider.dimensionId).getOreGenProperties(event.world) != null) {
switch(event.type) {
case COAL:
case DIAMOND:
case GOLD:
case IRON:
case LAPIS:
case QUARTZ:
case REDSTONE:
case CUSTOM:
event.setResult(Result.DENY);
break;
default:
event.setResult(Result.DEFAULT);
}
}
}
示例6: noDirt
import net.minecraftforge.event.terraingen.OreGenEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void noDirt(final OreGenEvent.GenerateMinable event) {
if (event.world.provider.dimensionId == ExtraUtils.underdarkDimID) {
switch (event.type) {
case DIRT:
case GRAVEL: {
event.setResult(Event.Result.DENY);
break;
}
}
}
}
示例7: onOreGen
import net.minecraftforge.event.terraingen.OreGenEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void onOreGen(OreGenEvent.GenerateMinable e)
{
if (e.getType().equals(OreGenEvent.GenerateMinable.EventType.IRON)
|| e.getType().equals(OreGenEvent.GenerateMinable.EventType.GOLD)
|| e.getType().equals(OreGenEvent.GenerateMinable.EventType.REDSTONE))
e.setResult(Event.Result.DENY);
}
示例8: generate
import net.minecraftforge.event.terraingen.OreGenEvent; //导入方法依赖的package包/类
@Override
public void generate(Random random, int chunkX, int chunkZ, World world,
IChunkProvider chunkGenerator, IChunkProvider chunkProvider) {
OreGenEvent event = new OreGenEvent.GenerateMinable(world, random, this, chunkX, chunkZ, EventType.CUSTOM);
MinecraftForge.ORE_GEN_BUS.post(event);
if(event.getResult() != Result.DENY) {
if(Configuration.generateCopper) {
generate(world, MaterialRegistry.getMaterialFromName("Copper"), Configuration.copperPerChunk, Configuration.copperClumpSize, chunkX, chunkZ, random);
}
if(Configuration.generateTin) {
generate(world, MaterialRegistry.getMaterialFromName("Tin"), Configuration.tinPerChunk, Configuration.tinClumpSize, chunkX, chunkZ, random);
}
if(Configuration.generateRutile) {
generate(world, MaterialRegistry.getMaterialFromName("Rutile"), Configuration.rutilePerChunk, Configuration.rutileClumpSize, chunkX, chunkZ, random);
}
if(Configuration.generateAluminum) {
generate(world, MaterialRegistry.getMaterialFromName("Aluminum"), Configuration.aluminumPerChunk, Configuration.aluminumClumpSize, chunkX, chunkZ, random);
}
if(Configuration.generateDilithium) {
int dilithiumChance = Configuration.dilithiumPerChunk;
if(world.provider instanceof WorldProviderPlanet) {
dilithiumChance = DimensionProperties.AtmosphereTypes.getAtmosphereTypeFromValue(DimensionManager.getInstance().getDimensionProperties(world.provider.dimensionId).getAtmosphereDensity()) == DimensionProperties.AtmosphereTypes.NONE ? Configuration.dilithiumPerChunkMoon : Configuration.dilithiumPerChunk;;
}
for(int i = 0; i < dilithiumChance; i++) {
int coordX = 16*chunkX + random.nextInt(16);
int coordY = random.nextInt(64);
int coordZ = 16*chunkZ + random.nextInt(16);
new WorldGenMinable(MaterialRegistry.getMaterialFromName("Dilithium").getBlock(), MaterialRegistry.getMaterialFromName("Dilithium").getMeta(), Configuration.dilithiumClumpSize, Blocks.stone).generate(world, random, coordX, coordY, coordZ);
}
}
}
}
示例9: onGenerateMinable
import net.minecraftforge.event.terraingen.OreGenEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void onGenerateMinable(OreGenEvent.GenerateMinable event)
{
World world = event.getWorld();
ServerState.checkIfServerChanged(world.getMinecraftServer(), world.getWorldInfo());
boolean vanillaOreGen = ServerState.getWorldConfig(world).vanillaOreGen;
boolean isCustom = event.getType() == OreGenEvent.GenerateMinable.EventType.CUSTOM;
boolean isOre = event.getType() != OreGenEvent.GenerateMinable.EventType.GRAVEL &&
event.getType() != OreGenEvent.GenerateMinable.EventType.DIRT &&
// TODO: remove after we add stone generation to the configs
event.getType() != OreGenEvent.GenerateMinable.EventType.ANDESITE &&
event.getType() != OreGenEvent.GenerateMinable.EventType.DIORITE &&
event.getType() != OreGenEvent.GenerateMinable.EventType.GRANITE;
event.setResult((vanillaOreGen || isCustom || !isOre) ? Result.ALLOW : Result.DENY);
}
示例10: onOrePopulate
import net.minecraftforge.event.terraingen.OreGenEvent; //导入方法依赖的package包/类
@SubscribeEvent(priority = EventPriority.HIGHEST, receiveCanceled = true)
public void onOrePopulate(OreGenEvent.GenerateMinable event)
{
ConfigOres conf = Geolosys.getInstance().configOres;
if ((conf.hematiteChance > 0 || conf.limoniteChance > 0) && event.getType() == OreGenEvent.GenerateMinable.EventType.IRON)
{
event.setResult(Event.Result.DENY);
}
if (conf.goldChance > 0 && event.getType() == OreGenEvent.GenerateMinable.EventType.GOLD)
{
event.setResult(Event.Result.DENY);
}
if (conf.kimberliteChance > 0 && event.getType() == OreGenEvent.GenerateMinable.EventType.DIAMOND)
{
event.setResult(Event.Result.DENY);
}
if (conf.coalChance > 0 && event.getType() == OreGenEvent.GenerateMinable.EventType.COAL)
{
event.setResult(Event.Result.DENY);
}
if (conf.cinnabarChance > 0 && event.getType() == OreGenEvent.GenerateMinable.EventType.REDSTONE)
{
event.setResult(Event.Result.DENY);
}
if (conf.lapisChance > 0 && event.getType() == OreGenEvent.GenerateMinable.EventType.LAPIS)
{
event.setResult(Event.Result.DENY);
}
if (conf.quartzChance > 0 && event.getType() == OreGenEvent.GenerateMinable.EventType.QUARTZ)
{
event.setResult(Event.Result.DENY);
}
if (conf.berylChance > 0 && event.getType() == OreGenEvent.GenerateMinable.EventType.EMERALD)
{
event.setResult(Event.Result.DENY);
}
if (Config.getInstance().modStones)
{
if (event.getType() == OreGenEvent.GenerateMinable.EventType.ANDESITE || event.getType() == OreGenEvent.GenerateMinable.EventType.GRANITE || event.getType() == OreGenEvent.GenerateMinable.EventType.DIORITE)
{
event.setResult(Event.Result.DENY);
}
}
}
示例11: onOreGen_GenerateMinable
import net.minecraftforge.event.terraingen.OreGenEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void onOreGen_GenerateMinable(OreGenEvent.GenerateMinable event) {
if (setting != null && event.getType() == setting.type)
generate(event.getRand(), event.getPos().getX(), event.getPos().getZ(), event.getWorld());
}