Advertisement
jayhillx

strippedlogs code

Aug 21st, 2020
173
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.34 KB | None | 0 0
  1. public class ModStrippedLogBlock {
  2.  
  3. public static void addStripping() throws NoSuchFieldException, IllegalAccessException {
  4. Field map = ObfuscationReflectionHelper.findField(AxeItem.class, "field_203176_a");
  5.  
  6. Field modifiersField = Field.class.getDeclaredField("modifiers");
  7. modifiersField.setAccessible(true);
  8. modifiersField.setInt(map, map.getModifiers() & ~Modifier.FINAL);
  9.  
  10. map.setAccessible(true);
  11. Map<Block, Block> strip_map = (Map<Block, Block>) map.get(null);
  12. HashMap<Block, Block> new_map = new HashMap<>(strip_map);
  13. new_map.put(ModBlock.DANDELION_LOG.get(), ModBlock.STRIPPED_DANDELION_LOG.get());
  14. new_map.put(ModBlock.LEMON_LIME_LOG.get(), ModBlock.STRIPPED_LEMON_LIME_LOG.get());
  15. new_map.put(ModBlock.SEAFOAM_LOG.get(), ModBlock.STRIPPED_SEAFOAM_LOG.get());
  16. new_map.put(ModBlock.TROPICAL_LOG.get(), ModBlock.STRIPPED_TROPICAL_LOG.get());
  17. new_map.put(ModBlock.STRAWBERRRY_LOG.get(), ModBlock.STRIPPED_STRAWBERRY_LOG.get());
  18. new_map.put(ModBlock.SWEET_STRAWBERRY_LOG.get(), ModBlock.STRIPPED_SWEET_STRAWBERRY_LOG.get());
  19. new_map.put(ModBlock.LAVENDER_LOG.get(), ModBlock.STRIPPED_LAVENDER_LOG.get());
  20. new_map.put(ModBlock.MYSTIC_LOG.get(), ModBlock.STRIPPED_MYSTIC_LOG.get());
  21. map.set(null, new_map);
  22. }
  23.  
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement