Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

bonjourpancake

Members
  • Joined

  • Last visited

Everything posted by bonjourpancake

  1. Hi all, Working on a custom dimension based on the flat dimension generator from Minecraft and I can't seem to figure out how to make it look like the default flat land. Example: I'm looking through the source and I've only modified the generation of villages and messed around with the rendering of clouds but other than that I don't know where I went wrong. I've tried setting Sky and Cloud renderers to null as well as setting the cloud heights to -1.0F. Could anyone have a look and see where I went wrong / what source code to look at to make it look like normal flat? CODE: PowerhouseDimensions.java (registered in preInit of CommonProxy) public class PowerhouseDimensions { public static DimensionType powerhouseDimensionType; public static void init() { registerDimensionTypes(); registerDimensions(); } private static void registerDimensionTypes() { powerhouseDimensionType = DimensionType.register( Powercraft.MOD_ID, "_test", Powercraft.DIMENSION_ID, FlatWorldProvider.class, false); } private static void registerDimensions() { DimensionManager.registerDimension(Powercraft.DIMENSION_ID, powerhouseDimensionType); } } FlatWorldProvider.java public class FlatWorldProvider extends WorldProvider { @Override public DimensionType getDimensionType() { return PowerhouseDimensions.powerhouseDimensionType; } @Override public String getSaveFolder() { return "flat"; } @Override public IChunkGenerator createChunkGenerator() { return new FlatDimensionGenerator(world); } } FlatDimensionGenerator.java public class FlatDimensionGenerator implements IChunkGenerator { private final World world; private final IBlockState[] cachedBlockIDs = new IBlockState[256]; private final FlatGeneratorInfo flatWorldGenInfo; public FlatDimensionGenerator(World worldIn) { this.world = worldIn; this.flatWorldGenInfo = FlatGeneratorInfo.getDefaultFlatGenerator(); int j = 0; int k = 0; for (FlatLayerInfo flatlayerinfo : this.flatWorldGenInfo.getFlatLayers()) { for (int i = flatlayerinfo.getMinY(); i < flatlayerinfo.getMinY() + flatlayerinfo.getLayerCount(); ++i) { IBlockState iblockstate = flatlayerinfo.getLayerMaterial(); if (iblockstate.getBlock() != Blocks.AIR) { this.cachedBlockIDs[i] = iblockstate; } } if (flatlayerinfo.getLayerMaterial().getBlock() == Blocks.AIR) { k += flatlayerinfo.getLayerCount(); } else { j += flatlayerinfo.getLayerCount() + k; k = 0; } } worldIn.setSeaLevel(j); } /** * Generates the chunk at the specified position, from scratch */ @Override public Chunk generateChunk(int x, int z) { ChunkPrimer chunkprimer = new ChunkPrimer(); for (int i = 0; i < this.cachedBlockIDs.length; ++i) { IBlockState iblockstate = this.cachedBlockIDs[i]; if (iblockstate != null) { for (int j = 0; j < 16; ++j) { for (int k = 0; k < 16; ++k) { chunkprimer.setBlockState(j, i, k, iblockstate); } } } } Chunk chunk = new Chunk(this.world, chunkprimer, x, z); //chunk.generateSkylightMap(); return chunk; } @Override public void populate(int x, int z) { } @Override public boolean generateStructures(Chunk chunkIn, int x, int z) { return false; } public List<Biome.SpawnListEntry> getPossibleCreatures(EnumCreatureType creatureType, BlockPos pos) { return Collections.emptyList(); } @Nullable @Override public BlockPos getNearestStructurePos(World worldIn, String structureName, BlockPos position, boolean findUnexplored) { return null; } @Override public boolean isInsideStructure(World worldIn, String structureName, BlockPos pos) { return false; } @Override public void recreateStructures(Chunk chunkIn, int x, int z) { } }

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.