Advertisement
jayhillx

strippedlogs class

Aug 6th, 2020 (edited)
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.27 KB | None | 0 0
  1. public class StrippedLogs extends LogBlock {
  2.  
  3. public StrippedLogs(MaterialColor verticalColorIn, Properties properties) {
  4. super(verticalColorIn, properties);
  5. }
  6.  
  7. protected static final Map<Block, Block> STRIPPED_LOGS = (new ImmutableMap.Builder<Block, Block>()).put(ModBlock.DANDELION_LOG.get(), ModBlock.STRIPPED_DANDELION_LOG.get()).put(ModBlock.LEMON_LIME_LOG.get(), ModBlock.STRIPPED_LEMON_LIME_LOG.get()).put(ModBlock.SEAFOAM_LOG.get(), ModBlock.STRIPPED_SEAFOAM_LOG.get()).put(ModBlock.TROPICAL_LOG.get(), ModBlock.STRIPPED_TROPICAL_LOG.get()).put(ModBlock.STRAWBERRRY_LOG.get(), ModBlock.STRIPPED_STRAWBERRY_LOG.get()).put(ModBlock.SWEET_STRAWBERRY_LOG.get(), ModBlock.STRIPPED_SWEET_STRAWBERRY_LOG.get()).put(ModBlock.LAVENDER_LOG.get(), ModBlock.STRIPPED_LAVENDER_LOG.get()).put(ModBlock.MYSTIC_LOG.get(), ModBlock.STRIPPED_MYSTIC_LOG.get()).build();
  8.  
  9. @Override
  10. public ActionResultType onBlockActivated(BlockState state, World worldIn, BlockPos pos, PlayerEntity player, Hand handIn, BlockRayTraceResult hit) {
  11. if(player.getHeldItemMainhand().getItem() instanceof AxeItem) {
  12. worldIn.setBlockState(pos, (BlockState) STRIPPED_LOGS.get(state.getBlock().getDefaultState()));
  13. }
  14. return ActionResultType.SUCCESS;
  15. }
  16. }
  17.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement