Advertisement
Guest User

Untitled

a guest
Dec 20th, 2017
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. private void calcSapling(final World world)
  2. {
  3. for(final BlockPos pos : leaves)
  4. {
  5. final Block block = world.getBlockState(pos).getBlock();
  6.  
  7. if(block instanceof BlockLeaves)
  8. {
  9. final NonNullList<ItemStack> list = NonNullList.create();
  10. block.getDrops(list, world, pos, world.getBlockState(pos), 100);
  11. for(final ItemStack stack: list)
  12. {
  13. final int[] oreIds = OreDictionary.getOreIDs(stack);
  14. for(final int oreId: oreIds)
  15. {
  16. if(OreDictionary.getOreName(oreId).equals(SAPLINGS))
  17. {
  18. saplingToUse = stack;
  19. return;
  20. }
  21. }
  22. }
  23. }
  24. }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement