• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java ChunkProviderEnd类的典型用法和代码示例

java 10次浏览

本文整理汇总了Java中net.minecraft.world.gen.ChunkProviderEnd的典型用法代码示例。如果您正苦于以下问题:Java ChunkProviderEnd类的具体用法?Java ChunkProviderEnd怎么用?Java ChunkProviderEnd使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

ChunkProviderEnd类属于net.minecraft.world.gen包,在下文中一共展示了ChunkProviderEnd类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: create

点赞 3

import net.minecraft.world.gen.ChunkProviderEnd; //导入依赖的package包/类
private void create(World worldIn, ChunkProviderEnd chunkProvider, Random rnd, int chunkX, int chunkZ)
{
    Random random = new Random((long)(chunkX + chunkZ * 10387313));
    Rotation rotation = Rotation.values()[random.nextInt(Rotation.values().length)];
    int i = MapGenEndCity.func_191070_b(chunkX, chunkZ, chunkProvider);

    if (i < 60)
    {
        this.isSizeable = false;
    }
    else
    {
        BlockPos blockpos = new BlockPos(chunkX * 16 + 8, i, chunkZ * 16 + 8);
        StructureEndCityPieces.func_191087_a(worldIn.getSaveHandler().getStructureTemplateManager(), blockpos, rotation, this.components, rnd);
        this.updateBoundingBox();
        this.isSizeable = true;
    }
}
 

开发者ID:sudofox,
项目名称:Backmemed,
代码行数:19,
代码来源:MapGenEndCity.java

示例2: getGroundLevel

点赞 3

import net.minecraft.world.gen.ChunkProviderEnd; //导入依赖的package包/类
public static int getGroundLevel(World worldin, int xpos, int zpos) {
    int chunkX = xpos >> 4;
    int chunkZ = zpos >> 4;
    IChunkProvider provider = worldin.getChunkProvider();
    ChunkPrimer primer = new ChunkPrimer();
    if (chunkX == cachedChunkX && chunkZ == cachedChunkZ && cachedChunk != null) {
        primer = cachedChunk;
    } else {
        if (provider instanceof ChunkProviderOverworld) {
            ((ChunkProviderOverworld)provider).setBlocksInChunk(chunkX, chunkZ, primer);
        } else if (provider instanceof ChunkProviderEnd) {
            ((ChunkProviderEnd) provider).setBlocksInChunk(chunkX, chunkZ, primer);
        } else if (provider instanceof ChunkProviderFlat) {
            return worldin.getSeaLevel();
        } else {
            return -1; // unhandled dimension.
        }
        cachedChunk = primer;
        cachedChunkX = chunkX;
        cachedChunkZ = chunkZ;
    }
    return primer.findGroundBlockIdx(xpos & 15, zpos & 15);
}
 

开发者ID:MinimumContent,
项目名称:muon,
代码行数:24,
代码来源:MuonUtils.java

示例3: Setup_Vanilla

点赞 3

import net.minecraft.world.gen.ChunkProviderEnd; //导入依赖的package包/类
/**
 * Vanilla MC (End Asteroids)
 */
private ModContainer Setup_Vanilla()
{
    // --- Mod Vanilla (Heh, "mod")
    ModContainer modMCVanilla = new ModContainer("Vanilla");

    // If you happen to have an asteroid dim, just skip the blocklist, and setDimensionType() to DimensionType.Asteroid
    // also don't forget to add at least one asteroid type, or nothing will generate!
    ModDimensionDef dimEndAsteroids = new ModDimensionDef("EndAsteroids", ChunkProviderEnd.class, Enums.DimensionType.Asteroid);

    dimEndAsteroids.addAsteroidMaterial(new AsteroidBlockComb(GTOreTypes.Netherrack));
    dimEndAsteroids.addAsteroidMaterial(new AsteroidBlockComb(GTOreTypes.RedGranite));
    dimEndAsteroids.addAsteroidMaterial(new AsteroidBlockComb(GTOreTypes.BlackGranite));
    dimEndAsteroids.addAsteroidMaterial(new AsteroidBlockComb(GTOreTypes.EndStone));

    // These Blocks will randomly be generated
    dimEndAsteroids.addSpecialAsteroidBlock(new SpecialBlockComb(Blocks.glowstone));
    dimEndAsteroids.addSpecialAsteroidBlock(new SpecialBlockComb(Blocks.lava, Enums.AllowedBlockPosition.AsteroidCore));

    modMCVanilla.addDimensionDef(dimEndAsteroids);

    return modMCVanilla;
}
 

开发者ID:GTNewHorizons,
项目名称:NewHorizonsCoreMod,
代码行数:26,
代码来源:SpaceDimRegisterer.java

示例4: generate

点赞 3

import net.minecraft.world.gen.ChunkProviderEnd; //导入依赖的package包/类
@Override
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider)
{
	// chunkX <<= 4;
	// chunkZ <<= 4;
	BlockPos pos = new BlockPos(chunkX, 1, chunkZ);
	if (chunkGenerator instanceof ChunkProviderGenerate
			|| chunkGenerator.getClass().toString().contains("ChunkProviderRTG"))
	{
		this.generateOverworld(world, random, chunkX, chunkZ);
		if (Config.genBiomeStones == true)
		{
			this.genBiomeStone(world, chunkX, chunkZ, random);
		}
	}
	else if (chunkGenerator instanceof ChunkProviderHell)
	{
		this.generateNether(world, random, chunkX, chunkZ);
	}
	else if (chunkGenerator instanceof ChunkProviderEnd)
	{
		this.generateEnd(world, random, chunkX, chunkZ);
	}
}
 

开发者ID:MinestrapTeam,
项目名称:Minestrappolation-4,
代码行数:25,
代码来源:MGenHandler.java

示例5: generate

点赞 3

import net.minecraft.world.gen.ChunkProviderEnd; //导入依赖的package包/类
@Override
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider)
{
    if(!(chunkGenerator instanceof ChunkProviderHell) && !(chunkGenerator instanceof ChunkProviderEnd))
    {
        for(int i = 0; i < ConfigurationHandler.leadOrePerChunk; i++)
        {
            int randPosX = (chunkX*16) + random.nextInt(16);
            int randPosY = random.nextInt(60);
            int randPosZ = (chunkZ*16) + random.nextInt(16);
            new WorldGenMinable(ModBlocks.leadOre, 10, Blocks.stone).generate(world, random, randPosX, randPosY, randPosZ);
        }


    }
}
 

开发者ID:JWStrube,
项目名称:Aftermath,
代码行数:17,
代码来源:OreGenHandler.java

示例6: Setup_Vanilla

点赞 3

import net.minecraft.world.gen.ChunkProviderEnd; //导入依赖的package包/类
/**
 * Vanilla MC (End Asteroids)
 */
private ModContainer Setup_Vanilla()
{
	// --- Mod Vanilla (Heh, "mod")
	ModContainer modMCVanilla = new ModContainer("Vanilla");

	// If you happen to have an asteroid dim, just skip the blocklist, and setDimensionType() to DimensionType.Asteroid
	// also don't forget to add at least one asteroid type, or nothing will generate!
	ModDimensionDef dimEndAsteroids = new ModDimensionDef("EndAsteroids", ChunkProviderEnd.class, DimensionType.Asteroid);
	
	dimEndAsteroids.addAsteroidMaterial(new AsteroidBlockComb(GTOreTypes.Netherrack)); 
	dimEndAsteroids.addAsteroidMaterial(new AsteroidBlockComb(GTOreTypes.RedGranite)); 
	dimEndAsteroids.addAsteroidMaterial(new AsteroidBlockComb(GTOreTypes.BlackGranite));
	dimEndAsteroids.addAsteroidMaterial(new AsteroidBlockComb(GTOreTypes.EndStone));
	
	// These Blocks will randomly be generated
	dimEndAsteroids.addSpecialAsteroidBlock(new SpecialBlockComb(Blocks.glowstone));
	dimEndAsteroids.addSpecialAsteroidBlock(new SpecialBlockComb(Blocks.lava, AllowedBlockPosition.AsteroidCore));
	
	modMCVanilla.addDimensionDef(dimEndAsteroids);
	
	return modMCVanilla;
}
 

开发者ID:GTNewHorizons,
项目名称:GalacticGregGT5,
代码行数:26,
代码来源:ModRegisterer.java

示例7: isOreGeneratedInWorld

点赞 3

import net.minecraft.world.gen.ChunkProviderEnd; //导入依赖的package包/类
@Override
public boolean isOreGeneratedInWorld(World world, IChunkProvider chunkGenerator)
{
	if (!this.shouldGenerate)
	{
		return false;
	}
	if (this.ignoreSurface && chunkGenerator instanceof ChunkProviderGenerate)
	{
		return false;
	}
	if (this.ignoreNether && chunkGenerator instanceof ChunkProviderHell)
	{
		return false;
	}
	if (this.ignoreEnd && chunkGenerator instanceof ChunkProviderEnd)
	{
		return false;
	}
	return true;
}
 

开发者ID:tterrag1098,
项目名称:SimpleTransmutations,
代码行数:22,
代码来源:OreGenReplace.java

示例8: func_191070_b

点赞 2

import net.minecraft.world.gen.ChunkProviderEnd; //导入依赖的package包/类
private static int func_191070_b(int p_191070_0_, int p_191070_1_, ChunkProviderEnd p_191070_2_)
{
    Random random = new Random((long)(p_191070_0_ + p_191070_1_ * 10387313));
    Rotation rotation = Rotation.values()[random.nextInt(Rotation.values().length)];
    ChunkPrimer chunkprimer = new ChunkPrimer();
    p_191070_2_.setBlocksInChunk(p_191070_0_, p_191070_1_, chunkprimer);
    int i = 5;
    int j = 5;

    if (rotation == Rotation.CLOCKWISE_90)
    {
        i = -5;
    }
    else if (rotation == Rotation.CLOCKWISE_180)
    {
        i = -5;
        j = -5;
    }
    else if (rotation == Rotation.COUNTERCLOCKWISE_90)
    {
        j = -5;
    }

    int k = chunkprimer.findGroundBlockIdx(7, 7);
    int l = chunkprimer.findGroundBlockIdx(7, 7 + j);
    int i1 = chunkprimer.findGroundBlockIdx(7 + i, 7);
    int j1 = chunkprimer.findGroundBlockIdx(7 + i, 7 + j);
    int k1 = Math.min(Math.min(k, l), Math.min(i1, j1));
    return k1;
}
 

开发者ID:sudofox,
项目名称:Backmemed,
代码行数:31,
代码来源:MapGenEndCity.java

示例9: create

点赞 2

import net.minecraft.world.gen.ChunkProviderEnd; //导入依赖的package包/类
private void create(World worldIn, ChunkProviderEnd chunkProvider, Random rnd, int chunkX, int chunkZ)
{
    Rotation rotation = Rotation.values()[rnd.nextInt(Rotation.values().length)];
    ChunkPrimer chunkprimer = new ChunkPrimer();
    chunkProvider.setBlocksInChunk(chunkX, chunkZ, chunkprimer);
    int i = 5;
    int j = 5;

    if (rotation == Rotation.CLOCKWISE_90)
    {
        i = -5;
    }
    else if (rotation == Rotation.CLOCKWISE_180)
    {
        i = -5;
        j = -5;
    }
    else if (rotation == Rotation.COUNTERCLOCKWISE_90)
    {
        j = -5;
    }

    int k = chunkprimer.findGroundBlockIdx(7, 7);
    int l = chunkprimer.findGroundBlockIdx(7, 7 + j);
    int i1 = chunkprimer.findGroundBlockIdx(7 + i, 7);
    int j1 = chunkprimer.findGroundBlockIdx(7 + i, 7 + j);
    int k1 = Math.min(Math.min(k, l), Math.min(i1, j1));

    if (k1 < 60)
    {
        this.isSizeable = false;
    }
    else
    {
        BlockPos blockpos = new BlockPos(chunkX * 16 + 8, k1, chunkZ * 16 + 8);
        StructureEndCityPieces.beginHouseTower(blockpos, rotation, this.components, rnd);
        this.updateBoundingBox();
        this.isSizeable = true;
    }
}
 

开发者ID:F1r3w477,
项目名称:CustomWorldGen,
代码行数:41,
代码来源:MapGenEndCity.java

示例10: generate

点赞 2

import net.minecraft.world.gen.ChunkProviderEnd; //导入依赖的package包/类
@Override
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) {
    if (!(chunkGenerator instanceof ChunkProviderHell) && !(chunkGenerator instanceof ChunkProviderEnd)) {
        generateSurface(world, random, chunkX * 16, chunkZ * 16);
    } else if (chunkGenerator instanceof ChunkProviderHell) {
        generateNether(world, random, chunkX * 16, chunkZ * 16);
    } else {
        generateEnd(world, random, chunkX * 16, chunkZ * 16);
    }
}
 

开发者ID:MagiciansArtificeTeam,
项目名称:Magicians-Artifice,
代码行数:11,
代码来源:GenerationHandler.java

示例11: createChunkGenerator

点赞 2

import net.minecraft.world.gen.ChunkProviderEnd; //导入依赖的package包/类
/**
 * Returns a new chunk provider which generates chunks for this world
 */
public IChunkProvider createChunkGenerator()
{
    return new ChunkProviderEnd(this.worldObj, this.worldObj.getSeed());
}
 

开发者ID:Notoh,
项目名称:DecompiledMinecraft,
代码行数:8,
代码来源:WorldProviderEnd.java

示例12: createChunkGenerator

点赞 2

import net.minecraft.world.gen.ChunkProviderEnd; //导入依赖的package包/类
public IChunkGenerator createChunkGenerator()
{
    return new ChunkProviderEnd(this.worldObj, this.worldObj.getWorldInfo().isMapFeaturesEnabled(), this.worldObj.getSeed(), this.getSpawnCoordinate());
}
 

开发者ID:sudofox,
项目名称:Backmemed,
代码行数:5,
代码来源:WorldProviderEnd.java

示例13: MapGenEndCity

点赞 2

import net.minecraft.world.gen.ChunkProviderEnd; //导入依赖的package包/类
public MapGenEndCity(ChunkProviderEnd p_i46665_1_)
{
    this.endProvider = p_i46665_1_;
}
 

开发者ID:sudofox,
项目名称:Backmemed,
代码行数:5,
代码来源:MapGenEndCity.java

示例14: Start

点赞 2

import net.minecraft.world.gen.ChunkProviderEnd; //导入依赖的package包/类
public Start(World worldIn, ChunkProviderEnd chunkProvider, Random random, int chunkX, int chunkZ)
{
    super(chunkX, chunkZ);
    this.create(worldIn, chunkProvider, random, chunkX, chunkZ);
}
 

开发者ID:sudofox,
项目名称:Backmemed,
代码行数:6,
代码来源:MapGenEndCity.java

示例15: createChunkGenerator

点赞 2

import net.minecraft.world.gen.ChunkProviderEnd; //导入依赖的package包/类
public IChunkGenerator createChunkGenerator()
{
    return new ChunkProviderEnd(this.worldObj, this.worldObj.getWorldInfo().isMapFeaturesEnabled(), this.worldObj.getSeed());
}
 

开发者ID:F1r3w477,
项目名称:CustomWorldGen,
代码行数:5,
代码来源:WorldProviderEnd.java

示例16: defaultHeights

点赞 2

import net.minecraft.world.gen.ChunkProviderEnd; //导入依赖的package包/类
public static MuonHeightMap defaultHeights(World worldIn, StructureBoundingBox bb) {
    MuonHeightMap hm = new MuonHeightMap(worldIn, bb);
    // try to load default map heights from terrain generator
    IChunkProvider provider = worldIn.getChunkProvider();
    IChunkGenerator gen = null;
    try {
        gen = ((ChunkProviderServer) provider).chunkGenerator;
    } catch (Exception e) { e.printStackTrace(); }
    hm.seaLevel =  worldIn.getSeaLevel() - 1; // set sea level.
    int defaultlevel = -1;
    if (gen instanceof ChunkProviderFlat) {
        defaultlevel = worldIn.getSeaLevel() - 1;
    }
    for (int chunkX = (hm.mapbb.minX>>4); chunkX <= (hm.mapbb.maxX>>4); ++chunkX) {
        for (int chunkZ = (hm.mapbb.minZ>>4); chunkZ <= (hm.mapbb.maxZ>>4); ++chunkZ) {
            ChunkPrimer primer = new ChunkPrimer();
            if (gen instanceof ChunkProviderOverworld) {
                ((ChunkProviderOverworld) gen).setBlocksInChunk(chunkX, chunkZ, primer);
            } else if (gen instanceof ChunkProviderEnd) {
                ((ChunkProviderEnd) gen).setBlocksInChunk(chunkX, chunkZ, primer);
            } else {
                primer = null;
            }
            for (int i = 0; i < 16; ++i) {
                for (int j = 0; j < 16; ++j) {
                    int groundlevel = defaultlevel;
                    if (primer != null) {
                        //BUGGY if we do it with groundlevel = primer.findGroundBlockIdx(i, j);
                        for (int k = 255; k >= 0; --k) {
                            IBlockState state = primer.getBlockState(i,k,j);
                            if (state != Blocks.AIR.getDefaultState()) {
                                groundlevel = k;
                                break;
                            }
                        }
                    }
                    hm.setHeight((chunkX<<4)+i, (chunkZ<<4)+j, groundlevel);
                }
            }
        }
    }
    return hm;
}
 

开发者ID:MinimumContent,
项目名称:muon,
代码行数:44,
代码来源:MuonHeightMap.java

示例17: createChunkGenerator

点赞 2

import net.minecraft.world.gen.ChunkProviderEnd; //导入依赖的package包/类
public IChunkProvider createChunkGenerator()
{
    return new ChunkProviderEnd(this.worldObj, this.worldObj.getSeed());
}
 

开发者ID:xtrafrancyz,
项目名称:Cauldron,
代码行数:5,
代码来源:WorldProviderEnd.java

示例18: func_76555_c

点赞 2

import net.minecraft.world.gen.ChunkProviderEnd; //导入依赖的package包/类
public IChunkProvider func_76555_c() {
   return new ChunkProviderEnd(this.field_76579_a, this.field_76579_a.func_72905_C());
}
 

开发者ID:HATB0T,
项目名称:RuneCraftery,
代码行数:4,
代码来源:WorldProviderEnd.java

示例19: populateWorldProperties

点赞 2

import net.minecraft.world.gen.ChunkProviderEnd; //导入依赖的package包/类
private static void populateWorldProperties(Map<String,Object> properties, World world, WorldInfo worldInfo)
{
    properties.put("world", worldInfo == null ? "" : worldInfo.getWorldName());
    properties.put("world.seed", worldInfo == null ? 0L : worldInfo.getSeed());
    properties.put("world.version", worldInfo == null ? 0 : worldInfo.getSaveVersion());
    properties.put("world.isHardcore", worldInfo == null ? false : worldInfo.isHardcoreModeEnabled());
    properties.put("world.hasFeatures", worldInfo == null ? false : worldInfo.isMapFeaturesEnabled());
    properties.put("world.hasCheats", worldInfo == null ? false : worldInfo.areCommandsAllowed());
    properties.put("world.gameMode", worldInfo == null ? "" : worldInfo.getGameType().getName());
    properties.put("world.gameMode.id", worldInfo == null ? 0 : worldInfo.getGameType().getID());
    properties.put("world.type", worldInfo == null ? "" : worldInfo.getTerrainType().getName());
    properties.put("world.type.version", worldInfo == null ? 0 : worldInfo.getTerrainType().getGeneratorVersion());
    String genName = "RandomLevelSource";
    String genClass = "ChunkProviderOverworld";

    if (world != null)
    {
        IChunkGenerator chunkGenerator = world.provider.createChunkGenerator();
        genName = chunkGenerator.toString();
        genClass = chunkGenerator.getClass().getSimpleName();

        if (chunkGenerator instanceof ChunkProviderOverworld)
        {
            genClass = "ChunkProviderOverworld";
        }
        else if (chunkGenerator instanceof ChunkProviderFlat)
        {
            genClass = "ChunkProviderFlat";
        }
        else if (chunkGenerator instanceof ChunkProviderHell)
        {
            genClass = "ChunkProviderHell";
        }
        else if (chunkGenerator instanceof ChunkProviderEnd)
        {
            genName = "EndRandomLevelSource";
            genClass = "ChunkProviderEnd";
        }
    }

    properties.put("dimension.generator", genName);
    properties.put("dimension.generator.class", genClass);
    properties.put("dimension", world == null ? "" : world.provider.getDimensionType().getName());
    properties.put("dimension.id", world == null ? 0 : world.provider.getDimension());
    properties.put("dimension.isSurface", world == null ? false : world.provider.isSurfaceWorld());
    properties.put("dimension.hasNoSky", world == null ? false : world.provider.hasNoSky());
    properties.put("dimension.groundLevel", world == null ? 0 : world.provider.getAverageGroundLevel());
    properties.put("dimension.actualHeight", world == null ? 0 : world.getActualHeight());
    properties.put("dimension.height", world == null ? 0 : world.getHeight());
    properties.put("age", false);
}
 

开发者ID:lawremi,
项目名称:CustomOreGen,
代码行数:52,
代码来源:WorldConfig.java

示例20: getChunkProvider

点赞 2

import net.minecraft.world.gen.ChunkProviderEnd; //导入依赖的package包/类
public IChunkProvider getChunkProvider()
{
    return new ChunkProviderEnd(this.worldObj, this.worldObj.getSeed());
}
 

开发者ID:Cortex-Modders,
项目名称:CodeLyokoMod,
代码行数:5,
代码来源:LyokoForestSector.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)