Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 06/09/20 in all areas

  1. Hey man, hope you're doing well, I'm currently not at my machine, and I don't really have any code to work off as I haven't done it before. However, if you're wondering in what order things happens, if you're overwriting vanilla methods just put print statements in it, you'll see what order they print and therefore can work it out, some of them are dependant on conditions but through analysis of the vanilla classes I'm sure it will become explanatory, if there's any particular method you're confused with I'd be happy to take a look when I'm next around, stay safe and stay inside ❤️
    1 point
  2. You need to create your own class (preferably enum, it’ll be easier) and let it implement IItemTier as an interface. You’ll need to override all the methods of IItemTier in your new class - look at what the vanilla one does, and just replicate its functionality. Then you can just use your MyModItemTier.SOME_MATERIAL in the constructor of your new tool Items.
    1 point
  3. private static BlockState updateDistance(BlockState blockState, IWorld world, BlockPos blockPos) { int i = distance; try (BlockPos.PooledMutableBlockPos pos = PooledMutableBlockPos.retain().setPos(blockPos)) { loop: for (int k = -1; k < 2; k++) { for (int l = -1; l < 2; l++) { for (int m = -1; m < 2; m++) { if (k == 0 && l == 0 && m == 0) continue; pos.setPos(blockPos.getX() + k, blockPos.getY() + l, blockPos.getZ() + m); i = Math.min(i, getDistance(world.getBlockState(pos)) + 1); if (i <= 1) break loop; } } } } return blockState.with(DISTANCE, Integer.valueOf(i)); } distance is 7, I just did this so I can easily control it.
    1 point
×
×
  • Create New...

Important Information

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