-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Parte 3 do tutorial - Adicao de blocos
- Loading branch information
Showing
15 changed files
with
100 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
package john.mod.block; | ||
|
||
import john.mod.PrimeiroMod; | ||
import net.fabricmc.fabric.api.itemgroup.v1.ItemGroupEvents; | ||
import net.minecraft.block.AbstractBlock; | ||
import net.minecraft.block.Block; | ||
import net.minecraft.item.BlockItem; | ||
import net.minecraft.item.Item; | ||
import net.minecraft.item.ItemGroups; | ||
import net.minecraft.registry.Registries; | ||
import net.minecraft.registry.Registry; | ||
import net.minecraft.sound.BlockSoundGroup; | ||
import net.minecraft.util.Identifier; | ||
|
||
public class ModBlocks { | ||
|
||
public static final Block PINK_GARNET_BLOCK = registerBlock("pink_garnet_block", | ||
new Block(AbstractBlock.Settings.create().strength(4f).requiresTool() | ||
.sounds(BlockSoundGroup.AMETHYST_BLOCK))); | ||
|
||
public static final Block RAW_PINK_GARNET_BLOCK = registerBlock("raw_pink_garnet_block", | ||
new Block(AbstractBlock.Settings.create().strength(2f).sounds(BlockSoundGroup.CALCITE))); | ||
|
||
public static final Block QUE_SE_FODA = registerBlock("que_se_foda", | ||
new Block(AbstractBlock.Settings.create().strength(1f,4f))); | ||
|
||
private static Block registerBlock(String name, Block block){ | ||
registerBlockItem(name, block); | ||
return Registry.register(Registries.BLOCK, Identifier.of(PrimeiroMod.MOD_ID, name), block); | ||
} | ||
|
||
private static void registerBlockItem(String name, Block block) { | ||
Registry.register(Registries.ITEM, Identifier.of(PrimeiroMod.MOD_ID, name), | ||
new BlockItem(block, new Item.Settings())); | ||
} | ||
|
||
public static void registerModBlocks() { | ||
PrimeiroMod.LOGGER.info("Registering Mod Blocks for " + PrimeiroMod.MOD_ID); | ||
|
||
ItemGroupEvents.modifyEntriesEvent(ItemGroups.BUILDING_BLOCKS).register(fabricItemGroupEntries -> { | ||
fabricItemGroupEntries.add(ModBlocks.PINK_GARNET_BLOCK); | ||
fabricItemGroupEntries.add(ModBlocks.RAW_PINK_GARNET_BLOCK); | ||
fabricItemGroupEntries.add(ModBlocks.QUE_SE_FODA); | ||
}); | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
src/main/resources/assets/primeiro-mod/blockstates/pink_garnet_block.json
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"variants": { | ||
"": { | ||
"model": "primeiro-mod:block/pink_garnet_block" | ||
} | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
src/main/resources/assets/primeiro-mod/blockstates/que_se_foda.json
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"variants": { | ||
"": { | ||
"model": "primeiro-mod:block/que_se_foda" | ||
} | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
src/main/resources/assets/primeiro-mod/blockstates/raw_pink_garnet_block.json
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"variants": { | ||
"": { | ||
"model": "primeiro-mod:block/raw_pink_garnet_block" | ||
} | ||
} | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,8 @@ | ||
{ | ||
"item.primeiro-mod.pink_garnet": "Pink Garnet", | ||
"item.primeiro-mod.raw_pink_garnet": "Raw Pink Garnet", | ||
"item.primeiro-mod.yan": "Yan" | ||
|
||
"block.primeiro-mod.pink_garnet_block": "Block of Pink Garnet", | ||
"block.primeiro-mod.raw_pink_garnet_block": "Block of Raw Pink Garnet", | ||
"block.primeiro-mod.que_se_foda": "Que se Foda Block" | ||
} |
6 changes: 6 additions & 0 deletions
6
src/main/resources/assets/primeiro-mod/models/block/pink_garnet_block.json
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"parent": "minecraft:block/cube_all", | ||
"textures": { | ||
"all": "primeiro-mod:block/pink_garnet_block" | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
src/main/resources/assets/primeiro-mod/models/block/que_se_foda.json
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"parent": "minecraft:block/cube_all", | ||
"textures": { | ||
"all": "primeiro-mod:block/quesefoda" | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
src/main/resources/assets/primeiro-mod/models/block/raw_pink_garnet_block.json
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"parent": "minecraft:block/cube_all", | ||
"textures": { | ||
"all": "primeiro-mod:block/raw_pink_garnet_block" | ||
} | ||
} |
3 changes: 3 additions & 0 deletions
3
src/main/resources/assets/primeiro-mod/models/item/pink_garnet_block.json
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"parent": "primeiro-mod:block/pink_garnet_block" | ||
} |
3 changes: 3 additions & 0 deletions
3
src/main/resources/assets/primeiro-mod/models/item/que_se_foda.json
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"parent": "primeiro-mod:block/que_se_foda" | ||
} |
3 changes: 3 additions & 0 deletions
3
src/main/resources/assets/primeiro-mod/models/item/raw_pink_garnet_block.json
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"parent": "primeiro-mod:block/raw_pink_garnet_block" | ||
} |
Binary file added
BIN
+433 Bytes
src/main/resources/assets/primeiro-mod/textures/block/pink_garnet_block.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+953 Bytes
src/main/resources/assets/primeiro-mod/textures/block/raw_pink_garnet_block.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.