-
-
Save Kaupenjoe/4de02a8c23ed48281c00d968e0743014 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| "block.tutorialmod.firestone_block": "Firestone Block", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public static final RegistryObject<Block> FIRESTONE_BLOCK = registerBlock("firestone_block", | |
| () -> new FirestoneBlock(AbstractBlock.Properties.create(Material.IRON) | |
| .harvestLevel(2).setRequiresTool().harvestTool(ToolType.PICKAXE).hardnessAndResistance(6f))); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "parent": "block/cube_all", | |
| "textures": { | |
| "all": "tutorialmod:block/firestone_block" | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "variants": { | |
| "": { "model": "tutorialmod:block/firestone_block" } | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class FirestoneBlock extends Block { | |
| public FirestoneBlock(Properties properties) { | |
| super(properties); | |
| } | |
| @SuppressWarnings("deprecation") | |
| @Override | |
| public ActionResultType onBlockActivated(BlockState state, World worldIn, BlockPos pos, PlayerEntity player, | |
| Hand handIn, BlockRayTraceResult hit) { | |
| if(!worldIn.isRemote()) { | |
| if(handIn == Hand.MAIN_HAND) { | |
| System.out.println("I right-clicked a FirestoneBlock. Called for the Main Hand!"); | |
| } | |
| if(handIn == Hand.OFF_HAND) { | |
| System.out.println("I right-clicked a FirestoneBlock. Called for the Off Hand!"); | |
| } | |
| } | |
| return super.onBlockActivated(state, worldIn, pos, player, handIn, hit); | |
| } | |
| @SuppressWarnings("deprecation") | |
| @Override | |
| public void onBlockClicked(BlockState state, World worldIn, BlockPos pos, PlayerEntity player) { | |
| if(!worldIn.isRemote()) { | |
| System.out.println("I left-clicked a FirestoneBlock"); | |
| } | |
| } | |
| @Override | |
| public void onEntityWalk(World worldIn, BlockPos pos, Entity entityIn) { | |
| Firestone.lightEntityOnFire(entityIn, 5); | |
| super.onEntityWalk(worldIn, pos, entityIn); | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "parent": "tutorialmod:block/firestone_block" | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment