Jump to content

StudioMaker

Members
  • Posts

    35
  • Joined

  • Last visited

Everything posted by StudioMaker

  1. Hey, i want to have my snow block to generate 100 % on stone over the y cords 110. Is it possible to do that? This is my class rn package com.studiomaker.poweredelements2.world.gen; import java.util.Random; import com.studiomaker.poweredelements2.init.ModBlocks; import net.minecraft.block.state.pattern.BlockMatcher; import net.minecraft.init.Blocks; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import net.minecraft.world.chunk.IChunkProvider; import net.minecraft.world.gen.IChunkGenerator; import net.minecraft.world.gen.feature.WorldGenMinable; import net.minecraft.world.gen.feature.WorldGenerator; import net.minecraftforge.fml.common.IWorldGenerator; import net.minecraftforge.fml.common.Mod.EventHandler; public class WorldGenCustomOres implements IWorldGenerator { private WorldGenerator snow_mountain; // private WorldGenerator energetic_ore_block; // private WorldGenerator red_crystal; public WorldGenCustomOres() { snow_mountain = new WorldGenMinable(ModBlocks.SNOW_MOUNTAIN.getDefaultState(), 3, BlockMatcher.forBlock(Blocks.STONE)); // energetic_ore_block = new WorldGenMinable(ModBlocks.ENERGETIC_ORE_BLOCK.getDefaultState(), 3, BlockMatcher.forBlock(Blocks.STONE)); } @Override public void generate(Random random, int chunkX, int chunkZ, World world, IChunkGenerator chunkGenerator, IChunkProvider chunkProvider) { switch(world.provider.getDimension()) { case 0: runGenerator(snow_mountain, world, random, chunkX, chunkZ, 255, 110, 100); // runGenerator(energetic_ore_block, world, random, chunkX, chunkZ, 50, 0, 100); } } private void runGenerator(WorldGenerator gen, World world, Random rand, int chunkX, int chunkZ, int chance, int minHeight, int maxHeight) { if(minHeight > maxHeight || minHeight < 0 || maxHeight > 256) throw new IllegalArgumentException("Ore generated out of bounds"); int heightDiff = maxHeight - minHeight + 1; for(int i = 0; i < chance; i++) { int x = chunkX * 32 + rand.nextInt(32); int y = minHeight + rand.nextInt(heightDiff); int z = chunkZ * 32 + rand.nextInt(32); gen.generate(world, rand, new BlockPos(x,y,z)); } } }
  2. Yeah i know that but then the texture has to be in diffrent timezones or something depending on where they are placed because all animation textures are synced but idk
  3. Hey, how do i make a multitexture that isnt limited on 1 block? I have tried some diffrent methods but i just haven't figured it out. Here is how it is https://gyazo.com/4c755034151dded847383d4f81ed4f5b And i want it to be like this https://gyazo.com/e925553a02116011cdf0c21ac1f2d48b instead of this https://gyazo.com/3c22cb5d185fc5ecd527096e709833d9, is it even possible to code that? Here is my block class, have not anything special there atm package com.studiomaker.poweredelements2.blocks; import java.util.EnumSet; import java.util.List; import java.util.Random; import java.util.Set; import javax.annotation.Nullable; import com.google.common.collect.Lists; import com.google.common.collect.Sets; import com.studiomaker.poweredelements2.init.ModBlocks; import com.studiomaker.poweredelements2.util.IHasModel; import net.minecraft.block.Block; import net.minecraft.block.BlockObserver; import net.minecraft.block.BlockRedstoneDiode; import net.minecraft.block.BlockRedstoneRepeater; import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; import net.minecraft.block.properties.IProperty; import net.minecraft.block.properties.PropertyEnum; import net.minecraft.block.properties.PropertyInteger; import net.minecraft.block.state.BlockFaceShape; import net.minecraft.block.state.BlockStateContainer; import net.minecraft.block.state.IBlockState; import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.BlockRenderLayer; import net.minecraft.util.EnumFacing; import net.minecraft.util.EnumParticleTypes; import net.minecraft.util.IStringSerializable; import net.minecraft.util.Mirror; import net.minecraft.util.Rotation; import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.MathHelper; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; public class Screen extends BlockBase implements IHasModel { private final boolean isOn; public Screen(String name, Material material, boolean isOn) { super(name, material); setSoundType(SoundType.GLASS); setHardness(0.5F); setResistance(0.5F); setTickRandomly(true); this.isOn = isOn; if (isOn) { this.setLightLevel(1.0F); } } }
  4. I noticed btw that i can click u on items etc in both tabs, but i cant click r on a item in the default survival tab?
  5. Galacticraft has like 1 survival mode tab in your inventory, and i cant look at recipes etc with nei when im in the default tab, i can only do that in the galacticraft tab, any ideas / help?
  6. And yes i have tried with diffrent methods but idk
  7. Hello, I want my block (Frozen dirt) after a while to transform into my dirt. i just didnt figure it out how to do that, here is my FrozenDirt class package com.studiomaker.poweredelements2.blocks; import java.util.Random; import com.studiomaker.poweredelements2.init.ModBlocks; import com.studiomaker.poweredelements2.util.IHasModel; import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; import net.minecraft.world.World; public class FrozenDirt extends BlockBase implements IHasModel { public FrozenDirt(String name, Material material) { super(name, material); setSoundType(SoundType.GLASS); setHardness(1.0F); setResistance(1F); setTickRandomly(true); } } And here is my MarsDirt class package com.studiomaker.poweredelements2.blocks; import java.util.Random; import com.studiomaker.poweredelements2.init.ModBlocks; import com.studiomaker.poweredelements2.init.ModItems; import com.studiomaker.poweredelements2.util.IHasModel; import net.minecraft.block.BlockSapling; import net.minecraft.block.IGrowable; import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; import net.minecraft.block.state.IBlockState; import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.Item; import net.minecraft.item.ItemBlock; import net.minecraft.util.EnumFacing; import net.minecraft.util.math.BlockPos; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; public class MarsDirt extends BlockBase implements IHasModel { public MarsDirt(String name, Material material) { super(name, material); setSoundType(SoundType.GROUND); setHardness(1.0F); setResistance(1F); } @Override public boolean canSustainPlant(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing direction, net.minecraftforge.common.IPlantable plantable) { IBlockState plant = plantable.getPlant(world, pos.offset(direction)); net.minecraftforge.common.EnumPlantType plantType = plantable.getPlantType(world, pos.offset(direction)); if (plant.getBlock() instanceof BlockSapling) { return true; } return false; } @Override public void onPlantGrow(IBlockState state, World world, BlockPos pos, BlockPos source) { } @Override public void updateTick(World worldIn, BlockPos pos, IBlockState state, Random rand) { if(rand.nextInt(99)+1 <= 60) { IBlockState iblockstate = worldIn.getBlockState(pos.up()); if (iblockstate.getBlock() instanceof IGrowable && iblockstate.getBlock() != Blocks.GRASS) { IGrowable igrowable = (IGrowable)iblockstate.getBlock(); if (igrowable.canGrow(worldIn, pos.up(), iblockstate, worldIn.isRemote)) { if (!worldIn.isRemote) { if (igrowable.canUseBonemeal(worldIn, worldIn.rand, pos.up(), iblockstate)) { igrowable.grow(worldIn, worldIn.rand, pos.up(), iblockstate); worldIn.playEvent(300, pos, 0); } } } } } } }
  8. I dont want them to spawn multiple but they do..
  9. I tried using some weird methods to try out new stuff package com.studiomaker.poweredelements2.world.gen; import java.util.ArrayList; import java.util.List; import java.util.Random; import com.studiomaker.poweredelements2.init.ModBlocks; import com.studiomaker.poweredelements2.util.handlers.EnumHandler; import net.minecraft.block.Block; import net.minecraft.block.state.IBlockState; import net.minecraft.block.state.pattern.BlockMatcher; import net.minecraft.init.Blocks; import net.minecraft.util.EnumFacing; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Vec3d; import net.minecraft.world.World; import net.minecraft.world.chunk.IChunkProvider; import net.minecraft.world.gen.IChunkGenerator; import net.minecraft.world.gen.feature.WorldGenMinable; import net.minecraft.world.gen.feature.WorldGenerator; import net.minecraftforge.fml.common.IWorldGenerator; import net.minecraftforge.fml.common.Mod.EventHandler; public class WorldGenCrystal implements IWorldGenerator { private WorldGenerator crystal; public WorldGenCrystal() { crystal = new WorldGenMinable(ModBlocks.CRYSTAL.getDefaultState(), 1, BlockMatcher.forBlock(Blocks.STONE)); } public void generate(Random random, int chunkX, int chunkZ, World world, IChunkGenerator chunkGenerator, IChunkProvider chunkProvider) { int x = chunkX * 50 + random.nextInt(50); int z = chunkZ * 50 + random.nextInt(50); for(int i = 15; i < 50; i++) { BlockPos pos = new BlockPos(x, i, z); BlockPos belowPos = pos.down(); IBlockState state = world.getBlockState(pos); IBlockState stateBelow = world.getBlockState(belowPos); if(state.getBlock().isAir(state, world, pos) && stateBelow.getBlock() == Blocks.STONE) { makeCrystalCaveAt(world, pos, random); return; } } } public void makeCrystalCaveAt(World world, BlockPos source, Random rand) { double expandX = (rand.nextDouble() - 0.5) * 2; double expandY = (rand.nextDouble() - 0.5) * 0.1F; double expandZ = (rand.nextDouble() - 0.5) * 2; double curveAngle = rand.nextDouble() * Math.PI * 2; double curveRatio = rand.nextDouble() * 0.25 + 0.1; double curveX = Math.cos(curveAngle) * curveRatio; double curveY = (rand.nextFloat() - 0.5F) * 0.05F; double curveZ = Math.sin(curveAngle) * curveRatio; BlockPos hollowingCenter = source; Vec3d expansion = new Vec3d(expandX, expandY, expandZ).normalize(); Vec3d curvature = new Vec3d(curveX, curveY, curveZ); int color1 = rand.nextInt(12); int color2; do { color2 = rand.nextInt(12); } while(color2 == color1); IBlockState crystal1 = ModBlocks.CRYSTAL.getStateFromMeta(color1); IBlockState crystal2 = ModBlocks.CRYSTAL.getStateFromMeta(color2); int length = 12 + rand.nextInt(10); int size = 4 + rand.nextInt(11); for(int i = 0; i < length; i++) { hollowOut(world, hollowingCenter, rand, size, crystal1, crystal2); BlockPos currentCenter = hollowingCenter; if(hollowingCenter.getY() < 10) { expansion = new Vec3d(expansion.x, -expansion.y, expansion.z); curvature = new Vec3d(curvature.x, -curvature.y, curvature.z); } expansion = expansion.add(curvature).normalize(); } } private void hollowOut(World world, BlockPos source, Random rand, int width, IBlockState crystal1, IBlockState crystal2) { List<BlockPos> crystals = new ArrayList(); int max = width * width; for(int i = -width; i <= width; i++) for(int j = -width; j <= width; j++) for(int k = -width; k <= width; k++) { BlockPos pos = source.add(i, j, k); int dist = i * i + j * j + k * k; if(dist < max) { IBlockState state = world.getBlockState(pos); Block block = state.getBlock(); if(block.getBlockHardness(state, world, pos) != -1) world.setBlockToAir(pos); } else if(dist - 1 < max) crystals.add(pos); } for(BlockPos pos : crystals) { if(rand.nextInt(3) == 0) makeCrystal(world, pos, rand, rand.nextBoolean() ? crystal1 : crystal2); else if(rand.nextInt(2) == 0) { IBlockState stateAt = world.getBlockState(pos); Block blockAt = stateAt.getBlock(); if(blockAt.isAir(stateAt, world, pos) || blockAt == ModBlocks.CRYSTAL || blockAt.getBlockHardness(stateAt, world, pos) == -1) continue; IBlockState oreState = Blocks.GOLD_ORE.getDefaultState(); if(rand.nextInt(3) == 0) { if(rand.nextInt(3) == 0) oreState = Blocks.DIAMOND_ORE.getDefaultState(); else oreState = Blocks.EMERALD_ORE.getDefaultState(); } world.setBlockState(pos, oreState); } } } private void makeCrystal(World world, BlockPos source, Random rand, IBlockState crystal) { boolean up = rand.nextBoolean(); EnumFacing shift = up ? EnumFacing.UP : EnumFacing.DOWN; BlockPos startPos = source; IBlockState state = world.getBlockState(startPos); if(state.getBlock() == ModBlocks.CRYSTAL) return; int tests = 0; while(state.getBlock().isAir(state, world, startPos)) { startPos = startPos.offset(shift.getOpposite()); state = world.getBlockState(startPos); tests++; if(tests >= 10) return; } int size = 3 + rand.nextInt(4); BlockPos pos = startPos; for(int i = 0; i < size; i++) { IBlockState stateAt = world.getBlockState(pos); Block block = stateAt.getBlock(); if(block.getBlockHardness(stateAt, world, pos) == -1) break; world.setBlockState(pos, crystal); pos = pos.offset(shift); } } }
  10. Uhm .. https://gyazo.com/b50fdc6cd17aa39caf6ef72f2a60d75e
  11. hmm could u explain a bit more lol, thats why i asked
  12. Nope didnt work, something is wrong or that isnt the solve. Here is my code package com.studiomaker.poweredelements2.world.gen; import java.util.Random; import com.studiomaker.poweredelements2.init.ModBlocks; import com.studiomaker.poweredelements2.util.handlers.EnumHandler; import net.minecraft.block.state.pattern.BlockMatcher; import net.minecraft.init.Blocks; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import net.minecraft.world.chunk.IChunkProvider; import net.minecraft.world.gen.IChunkGenerator; import net.minecraft.world.gen.feature.WorldGenMinable; import net.minecraft.world.gen.feature.WorldGenerator; import net.minecraftforge.fml.common.IWorldGenerator; import net.minecraftforge.fml.common.Mod.EventHandler; public class WorldGenCrystal implements IWorldGenerator { private WorldGenerator crystal; public WorldGenCrystal() { crystal = new WorldGenMinable(ModBlocks.CRYSTAL.getDefaultState(), 5, BlockMatcher.forBlock(Blocks.STONE)); } @Override public void generate(Random random, int chunkX, int chunkZ, World world, IChunkGenerator chunkGenerator, IChunkProvider chunkProvider) { switch(world.provider.getDimension()) { case 0: runGenerator(crystal, world, random, chunkX, chunkZ, 50, 0, 35); } } private void runGenerator(WorldGenerator gen, World world, Random rand, int chunkX, int chunkZ, int chance, int minHeight, int maxHeight) { if(minHeight > maxHeight || minHeight < 0 || maxHeight > 256) throw new IllegalArgumentException("Ore generated out of bounds"); int heightDiff = maxHeight - minHeight + 1; for (int i = 0; i < 128; ++i) { int x = chunkX * 16 + rand.nextInt(16); int y = minHeight + rand.nextInt(heightDiff); int z = chunkZ * 16 + rand.nextInt(16); pos = pos.up(); gen.generate(world, rand, new BlockPos(x,y,z)); } } }
  13. I badly need help rn. I have struggled with this for days now, like i just need to get them to generate ontop of blocks, not inside.
  14. Yea but what i wanted to know is how i can generate my crystals ontop of stone
  15. Well i added this { public static final PropertyDirection FACING = PropertyDirection.create("facing", new Predicate<EnumFacing>() { public boolean apply(@Nullable EnumFacing p_apply_1_) { return p_apply_1_ != EnumFacing.DOWN; } }); protected static final AxisAlignedBB STANDING_AABB = new AxisAlignedBB(0.4000000059604645D, 0.0D, 0.4000000059604645D, 0.6000000238418579D, 0.6000000238418579D, 0.6000000238418579D); protected static final AxisAlignedBB CRYSTAL_NORTH_AABB = new AxisAlignedBB(0.3499999940395355D, 0.20000000298023224D, 0.699999988079071D, 0.6499999761581421D, 0.800000011920929D, 1.0D); protected static final AxisAlignedBB CRYSTAL_SOUTH_AABB = new AxisAlignedBB(0.3499999940395355D, 0.20000000298023224D, 0.0D, 0.6499999761581421D, 0.800000011920929D, 0.30000001192092896D); protected static final AxisAlignedBB CRYSTAL_WEST_AABB = new AxisAlignedBB(0.699999988079071D, 0.20000000298023224D, 0.3499999940395355D, 1.0D, 0.800000011920929D, 0.6499999761581421D); protected static final AxisAlignedBB CRYSTAL_EAST_AABB = new AxisAlignedBB(0.0D, 0.20000000298023224D, 0.3499999940395355D, 0.30000001192092896D, 0.800000011920929D, 0.6499999761581421D); AxisAlignedBB getStateForPlacement() { IBlockState state = null; switch ((EnumFacing)state.getValue(FACING)) { case EAST: return CRYSTAL_EAST_AABB; case WEST: return CRYSTAL_WEST_AABB; case SOUTH: return CRYSTAL_SOUTH_AABB; case NORTH: return CRYSTAL_NORTH_AABB; default: return STANDING_AABB; } } And it didn't do anything. This is what i mean i have tried like everything and im doing something wrong
  16. Im pretty sure its something from this code (vanilla torch) that i need to add. But i have tried multiple times and it just crashes or wont work. public class BlockTorch extends Block { public static final PropertyDirection FACING = PropertyDirection.create("facing", new Predicate<EnumFacing>() { public boolean apply(@Nullable EnumFacing p_apply_1_) { return p_apply_1_ != EnumFacing.DOWN; } }); protected static final AxisAlignedBB STANDING_AABB = new AxisAlignedBB(0.4000000059604645D, 0.0D, 0.4000000059604645D, 0.6000000238418579D, 0.6000000238418579D, 0.6000000238418579D); protected static final AxisAlignedBB TORCH_NORTH_AABB = new AxisAlignedBB(0.3499999940395355D, 0.20000000298023224D, 0.699999988079071D, 0.6499999761581421D, 0.800000011920929D, 1.0D); protected static final AxisAlignedBB TORCH_SOUTH_AABB = new AxisAlignedBB(0.3499999940395355D, 0.20000000298023224D, 0.0D, 0.6499999761581421D, 0.800000011920929D, 0.30000001192092896D); protected static final AxisAlignedBB TORCH_WEST_AABB = new AxisAlignedBB(0.699999988079071D, 0.20000000298023224D, 0.3499999940395355D, 1.0D, 0.800000011920929D, 0.6499999761581421D); protected static final AxisAlignedBB TORCH_EAST_AABB = new AxisAlignedBB(0.0D, 0.20000000298023224D, 0.3499999940395355D, 0.30000001192092896D, 0.800000011920929D, 0.6499999761581421D); protected BlockTorch() { super(Material.CIRCUITS); this.setDefaultState(this.blockState.getBaseState().withProperty(FACING, EnumFacing.UP)); this.setTickRandomly(true); this.setCreativeTab(CreativeTabs.DECORATIONS); } public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos) { switch ((EnumFacing)state.getValue(FACING)) { case EAST: return TORCH_EAST_AABB; case WEST: return TORCH_WEST_AABB; case SOUTH: return TORCH_SOUTH_AABB; case NORTH: return TORCH_NORTH_AABB; default: return STANDING_AABB; } }
  17. Yeah i have tried many things, and im doing something wrong. Because i have tried adding the vanilla things, and it crashes or just dont work
  18. Well im pretty sure the problem is that i have to add enum facing thing, because it rn it should only face down (or its not facing down, but its facing the normal state) https://gyazo.com/9958fdf582b064966884d8a794f6b7b4, And for example if i place it on the side of a bloock its still facing down (normal state) https://gyazo.com/5ab57f4814932a60bd84d5ae7a00c202, And as i said im pretty sure i have to add some enum facing thing, and i have tried soooo much, and as i said it crashes or its not doing anyhting when i have tested.
  19. Btw i fixed that they only spawn in caves by just letting them only spawn in air, and under 35 lel. And no i have still not figured out how to make them spawn on the ground and not free in the air
  20. k sure, idk i have just tried to fix diffrent things soo yes in this code there will be weird stuff but k, I have tried for so long to be able to make the crystal to be able to face all directions, i have tried adding some code from vanilla mc blocks that can face all directions on blocks for example button, followed every single thing on the internet, and it crashes or just dont work when i have tried. This is the crystal class rn and yeah there is things that i have just left etc but well well package com.studiomaker.poweredelements2.blocks; import java.util.Random; import javax.annotation.Nullable; import com.studiomaker.poweredelements2.init.ModItems; import com.studiomaker.poweredelements2.init.InitMapGenEvent.EventType; import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; import net.minecraft.block.properties.IProperty; import net.minecraft.block.state.IBlockState; import net.minecraft.entity.EntityLivingBase; import net.minecraft.item.Item; import net.minecraft.util.BlockRenderLayer; import net.minecraft.util.EnumFacing; import net.minecraft.util.EnumHand; import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.math.BlockPos; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import net.minecraft.world.gen.MapGenBase; public class Crystal extends BlockBase { public Crystal(String name, Material material) { super(name, material); setSoundType(SoundType.GLASS); setHardness(1.0F); setResistance(10F); setHarvestLevel("pickaxe", 3); } public Item getItemDropped(IBlockState state, Random rand, int fortune) { return ModItems.CROSSED_CRYSTAL; } public int quantityDropped(Random random) { return 2 + random.nextInt(6); } @Nullable public AxisAlignedBB getCollisionBoundingBox(IBlockState blockState, IBlockAccess worldIn, BlockPos pos) { return NULL_AABB; } @Override public BlockRenderLayer getBlockLayer() { return BlockRenderLayer.TRANSLUCENT; } @Override public boolean isOpaqueCube(IBlockState state) { return false; } @Override public boolean isFullCube(IBlockState state) { return false; } @Override public IBlockState onBlockPlaced(World worldIn, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer) { return super.onBlockPlaced(worldIn, pos, facing, hitX, hitY, hitZ, meta, placer).withProperty(FACING, facing); } public static enum EventType {CAVE} } And here is the gen class package com.studiomaker.poweredelements2.world.gen; import java.util.Random; import com.studiomaker.poweredelements2.init.ModBlocks; import com.studiomaker.poweredelements2.util.handlers.EnumHandler; import net.minecraft.block.state.pattern.BlockMatcher; import net.minecraft.init.Blocks; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import net.minecraft.world.chunk.IChunkProvider; import net.minecraft.world.gen.IChunkGenerator; import net.minecraft.world.gen.feature.WorldGenMinable; import net.minecraft.world.gen.feature.WorldGenerator; import net.minecraftforge.fml.common.IWorldGenerator; import net.minecraftforge.fml.common.Mod.EventHandler; public class WorldGenCustomOres implements IWorldGenerator { private WorldGenerator crystal; private WorldGenerator fade_ore_block; private WorldGenerator energetic_ore_block; public WorldGenCustomOres() { crystal= new WorldGenMinable(ModBlocks.CRYSTAL.getDefaultState(), 3, BlockMatcher.forBlock(Blocks.AIR)); fade_ore_block = new WorldGenMinable(ModBlocks.FADE_ORE_BLOCK.getDefaultState(), 5, BlockMatcher.forBlock(Blocks.STONE)); energetic_ore_block = new WorldGenMinable(ModBlocks.ENERGETIC_ORE_BLOCK.getDefaultState(), 5, BlockMatcher.forBlock(Blocks.STONE)); } @Override public void generate(Random random, int chunkX, int chunkZ, World world, IChunkGenerator chunkGenerator, IChunkProvider chunkProvider) { switch(world.provider.getDimension()) { case 0: runGenerator(crystal, world, random, chunkX, chunkZ, 50, 0, 35); runGenerator(fade_ore_block, world, random, chunkX, chunkZ, 50, 0, 100); runGenerator(energetic_ore_block, world, random, chunkX, chunkZ, 50, 0, 100); } } private void runGenerator(WorldGenerator gen, World world, Random rand, int chunkX, int chunkZ, int chance, int minHeight, int maxHeight) { if(minHeight > maxHeight || minHeight < 0 || maxHeight > 256) throw new IllegalArgumentException("Ore generated out of bounds"); int heightDiff = maxHeight - minHeight + 1; for(int i = 0; i < chance; i++) { int x = chunkX * 16 + rand.nextInt(16); int y = minHeight + rand.nextInt(heightDiff); int z = chunkZ * 16 + rand.nextInt(16); gen.generate(world, rand, new BlockPos(x,y,z)); } } } ps, dont make fun of it im new
  21. And what i ment with example was that i just wanted a more simple version , because im not a modding expert like u guys and yeah its hard if someone just tells me what i need to do, because yeah im trying to learn and if i already knew how and what to do i wouldn't have asked this before
×
×
  • Create New...

Important Information

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