• Recently Browsing

    No registered users viewing this page.

  • Posts

    • I think the problem is that you can not use getEntitiesWithinAABB() while the world is created. If you remove the second getWorld() and use the IWorld instead it will not hang, but you will not find the nearby entities at world gen (but it will work fine after that).
    • i am working on a custom worldgenore. ATM i am having an issue. What i am trying to do is get the block to skip generation of the ore randomly. I put  (rand.nextInt(10) > 3) before the  worldIn.setBlockState(.... This did nothing because all blocks in the vain would be the ore. no stone found with in the vain. So i did System.out.println(state); System.out.println(blockpos); so it turns out that it would spawn the vain sometimes all the blocks would be set to stone and some times all to ore. Bellow is my full code that I have used so far. public class WorldGenOreVain extends WorldGenerator { private final Block[] oreBlocks; /** * The number of blocks to generate. */ private final int numberOfBlocks; private Random rand = new Random(); //private final Predicate<IBlockState> predicate; public WorldGenOreVain(int blockCount, Block... blocksIn) { this.oreBlocks = blocksIn; this.numberOfBlocks = blockCount; } public boolean generate(World worldIn, Random rand, BlockPos position) { { float f = rand.nextFloat() * (float) Math.PI; double X0 = (double) ((float) (position.getX() + 8) + MathHelper.sin(f) * (float) this.numberOfBlocks / 8.0F); double X1 = (double) ((float) (position.getX() + 8) - MathHelper.sin(f) * (float) this.numberOfBlocks / 8.0F); double Z2 = (double) ((float) (position.getZ() + 8) + MathHelper.cos(f) * (float) this.numberOfBlocks / 8.0F); double Z3 = (double) ((float) (position.getZ() + 8) - MathHelper.cos(f) * (float) this.numberOfBlocks / 8.0F); double Y4 = (double) (position.getY() + rand.nextInt(3) - 2); double Y5 = (double) (position.getY() + rand.nextInt(3) - 2); for (int i = 0; i < this.numberOfBlocks; ++i) { float f1 = (float) i / (float) this.numberOfBlocks; double X6 = X0 + (X1 - X0) * (double) f1; double Y7 = Y4 + (Y5 - Y4) * (double) f1; double Z8 = Z2 + (Z3 - Z2) * (double) f1; double d9 = rand.nextDouble() * (double) this.numberOfBlocks / 16.0D; double d10 = (double) (MathHelper.sin((float) Math.PI * f1) + 1.0F) * d9 + 1.0D; double d11 = (double) (MathHelper.sin((float) Math.PI * f1) + 1.0F) * d9 + 1.0D; int j = MathHelper.floor(X6 - d10 / 2.0D); int k = MathHelper.floor(Y7 - d11 / 2.0D); int l = MathHelper.floor(Z8 - d10 / 2.0D); int i1 = MathHelper.floor(X6 + d10 / 2.0D); int j1 = MathHelper.floor(Y7 + d11 / 2.0D); int k1 = MathHelper.floor(Z8 + d10 / 2.0D); for (int x = j; x <= i1; ++x) { double d12 = ((double) x + 0.5D - X6) / (d10 / 2.0D); if (d12 * d12 < 1.0D) { for (int y = k; y <= j1; ++y) { double d13 = ((double) y + 0.5D - Y7) / (d11 / 2.0D); if (d12 * d12 + d13 * d13 < 1.0D) { for (int z = l; z <= k1; ++z) { double d14 = ((double) z + 0.5D - Z8) / (d10 / 2.0D); if (d12 * d12 + d13 * d13 + d14 * d14 < 1.0D) { BlockPos blockpos = new BlockPos(x, y, z); IBlockState state = worldIn.getBlockState(blockpos); if (StoneVariant.stoneVariant.contains(state.getBlock())) { if (oreBlocks[rand.nextInt(oreBlocks.length)] instanceof BlockOre) { Block oreIn = oreBlocks[rand.nextInt(oreBlocks.length)]; if (state.getBlock() == Blocks.STONE) { if (rand.nextInt(10) > 3) { IBlockState metaOreIn = oreIn.getStateFromMeta(0); worldIn.setBlockState(blockpos, metaOreIn, 2); System.out.println("spawm" + blockpos); } else { worldIn.setBlockState(blockpos, state, 2); System.out.println(state); System.out.println(blockpos); } } } else { worldIn.setBlockState(blockpos, oreBlocks[rand.nextInt(oreBlocks.length)].getDefaultState(), 2); System.out.println(blockpos.getX() + blockpos.getY() + blockpos.getZ()); } } } } } } } } } return true; } } } oreBlocks[rand.nextInt(oreBlocks.length)] just picks a random block in block[] to be able to make multiple blocks to spawn in the vain. How would i get this to fully work
    • To explain, we can't support old versions forever as doing so requires people who know the version and as new versions come out, people not using the old version forget how to work with it.
    • Crawl Custom Survival Server [1.15.2][JAVA] server IP: play.crawl-survival.com This server uses a semi-vanilla survival gamemode where players can play as the monsters. Although there are additions to the game and alters the spectator gamemode, the play style keeps a vanilla setting. How to Play On this server you must choose a team, you can play as a "Hero" or "Ghost" Ghosts in spectator mode can control mobs, monsters, and bosses. Each with their own special abilities The goal of a Ghost is to kill a Hero and take his place, the slain Hero will become a Ghost. The Heroes must slay the ender dragon to win, the Hero to slay the Ender Dragon will be allowed to control it as a Ghost! Heroes can craft custom spells and purchase items using experience levels! Over 50+ Custom Items coded into the gamemode as well as spells and custom enchantments! JOIN NOW! Discord Available when you join!
    • Not sure what to tell you. If you did exactly as you said and Multicraft isn't doing something funky the server should have worked.
  • Topics

  • Who's Online (See full list)