Jump to content

kb9mfd

Members
  • Posts

    2
  • Joined

  • Last visited

kb9mfd's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. Ok, finally found it. I assume the order is acceptable. - for (X = start.x; X <= end.x; X++) { for (Z = start.z; Z <= end.z; Z++) { for (Y = surface; Y > 1; Y--) { BlockPos pos = new BlockPos(X, Y, Z); if (world.isAirBlock(pos)) continue; stateAt = world.getBlockState(pos); blockAt = stateAt.getBlock(); if (isMiningOre(blockAt, (mode.id().equals("vanilla")))) { BlockPos top = new BlockPos(X, surface, Z); blockAt.harvestBlock(world, entityplayer, top, stateAt, null, ItemStack.EMPTY); blockAt.dropXpOnBlockBreak(world, top,blockAt.getExpDrop(stateAt, world, pos, fortune)); world.setBlockState(pos, Blocks.STONE.getDefaultState()); blockAt.onBlockDestroyedByPlayer(world, pos, stateAt); cnt++; } } } }
  2. I have a mod that I am converting from 1.7.10 to 1.12.2. For the most part I have it working, but two things I am noticing that I cannot seem to figure out. One part of the mod will mine ores from the surface, and here is the code that does that. It does mine the ores, but in 1.7.10 it also would give xp orbs for the mined ores. This does not. Also I am having trouble the dropped items are disappearing after spawning. I am thinking they may be sinking into a cave?? They show up for a second and then disappear, and they are not in the payers inventory. First how do I get the xp orb's to spawn again and how do I get the drops to spawn at the players Y or even better yet get them to just be added to inventory, or even attached inventory like a backpack. Thanks! for (X = start.x; X <= end.x; X++) { for (Z = start.z; Z <= end.z; Z++) { for (Y = surface; Y > 1; Y--) { BlockPos pos = new BlockPos(X, Y, Z); if (world.isAirBlock(pos)) continue; stateAt = world.getBlockState(pos); blockAt = stateAt.getBlock(); if (isMiningOre(blockAt, (mode.id().equals("vanilla")))) { BlockPos top = new BlockPos(X, surface, Z); blockAt.harvestBlock(world, entityplayer, top, stateAt, null, ItemStack.EMPTY); world.setBlockState(pos, Blocks.STONE.getDefaultState()); blockAt.onBlockDestroyedByPlayer(world, top, stateAt); cnt++; } } } }
×
×
  • Create New...

Important Information

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