-
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.
- Loading branch information
1 parent
4792671
commit 0793feb
Showing
20 changed files
with
194 additions
and
0 deletions.
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,68 @@ | ||
package net.pengi.potatoperks.block; | ||
|
||
import net.fabricmc.fabric.api.itemgroup.v1.ItemGroupEvents; | ||
import net.minecraft.block.AbstractBlock; | ||
import net.minecraft.block.Block; | ||
import net.minecraft.block.ExperienceDroppingBlock; | ||
import net.minecraft.block.MapColor; | ||
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; | ||
import net.minecraft.util.math.intprovider.UniformIntProvider; | ||
import net.pengi.potatoperks.PotatoPerks; | ||
|
||
public class ModBlocks { | ||
public static final Block PINK_POTATO_BLOCK = registerBlock("pink_potato_block", | ||
new Block(AbstractBlock.Settings.create() | ||
.strength(1f) | ||
.requiresTool() | ||
.sounds(BlockSoundGroup.FLOWERING_AZALEA) | ||
.velocityMultiplier(1.25f) | ||
|
||
)); | ||
|
||
public static final Block BLUE_POTATO_BLOCK = registerBlock("blue_potato_block", | ||
new Block(AbstractBlock.Settings.create() | ||
.strength(1f) | ||
.requiresTool() | ||
.sounds(BlockSoundGroup.FLOWERING_AZALEA) | ||
.jumpVelocityMultiplier(2f) | ||
|
||
)); | ||
|
||
public static final Block ORANGE_POTATO_BLOCK = registerBlock("orange_potato_block", | ||
new ExperienceDroppingBlock(UniformIntProvider.create(5,10), AbstractBlock.Settings.create() | ||
.strength(1f) | ||
.requiresTool() | ||
.sounds(BlockSoundGroup.FLOWERING_AZALEA) | ||
)); | ||
|
||
|
||
|
||
|
||
|
||
private static Block registerBlock(String name, Block block) { | ||
registerBlockItem(name, block); | ||
return Registry.register(Registries.BLOCK, Identifier.of(PotatoPerks.MOD_ID, name), block); | ||
} | ||
|
||
private static void registerBlockItem(String name, Block block) { | ||
Registry.register(Registries.ITEM, Identifier.of(PotatoPerks.MOD_ID, name), | ||
new BlockItem(block, new Item.Settings())); | ||
} | ||
|
||
|
||
public static void registerModBlocks() { | ||
PotatoPerks.LOGGER.info("Registering Mod Blocks for " + PotatoPerks.MOD_ID); | ||
|
||
ItemGroupEvents.modifyEntriesEvent(ItemGroups.BUILDING_BLOCKS).register(entries -> { | ||
entries.add(ModBlocks.PINK_POTATO_BLOCK); | ||
entries.add(ModBlocks.BLUE_POTATO_BLOCK); | ||
entries.add(ModBlocks.ORANGE_POTATO_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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package net.pengi.potatoperks.item; | ||
|
||
import net.fabricmc.fabric.api.itemgroup.v1.ItemGroupEvents; | ||
import net.minecraft.item.Item; | ||
import net.minecraft.item.ItemGroups; | ||
import net.minecraft.registry.Registries; | ||
import net.minecraft.registry.Registry; | ||
import net.minecraft.util.Identifier; | ||
import net.pengi.potatoperks.PotatoPerks; | ||
|
||
public class ModItems { | ||
|
||
public static final Item PINK_POTATO = registerItem("pink_potato", new Item(new Item.Settings())); | ||
|
||
|
||
|
||
|
||
private static Item registerItem(String name, Item item) { | ||
return Registry.register(Registries.ITEM, Identifier.of(PotatoPerks.MOD_ID, name), item); | ||
} | ||
|
||
public static void registerModItems(){ | ||
PotatoPerks.LOGGER.info("Registering Mod Items for " + PotatoPerks.MOD_ID); | ||
|
||
ItemGroupEvents.modifyEntriesEvent(ItemGroups.INGREDIENTS).register(entries -> { | ||
entries.add(PINK_POTATO); | ||
} ); | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
src/main/resources/assets/potatoperks/blockstates/blue_potato_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": "potatoperks:block/blue_potato_block" | ||
} | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
src/main/resources/assets/potatoperks/blockstates/orange_potato_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": "potatoperks:block/orange_potato_block" | ||
} | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
src/main/resources/assets/potatoperks/blockstates/pink_potato_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": "potatoperks:block/pink_potato_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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"item.potatoperks.pink_potato": "Pink Potato", | ||
|
||
"block.potatoperks.pink_potato_block": "Block of Pink Potato", | ||
"block.potatoperks.blue_potato_block": "Block of Blue Potato", | ||
"block.potatoperks.orange_potato_block": "Block of Orange Potato" | ||
|
||
} |
6 changes: 6 additions & 0 deletions
6
src/main/resources/assets/potatoperks/models/block/blue_potato_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": "potatoperks:block/blue_potato_block" | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
src/main/resources/assets/potatoperks/models/block/orange_potato_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": "potatoperks:block/orange_potato_block" | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
src/main/resources/assets/potatoperks/models/block/pink_potato_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": "potatoperks:block/pink_potato_block" | ||
} | ||
} |
3 changes: 3 additions & 0 deletions
3
src/main/resources/assets/potatoperks/models/item/blue_potato_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": "potatoperks:block/blue_potato_block" | ||
} |
3 changes: 3 additions & 0 deletions
3
src/main/resources/assets/potatoperks/models/item/orange_potato_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": "potatoperks:block/orange_potato_block" | ||
} |
6 changes: 6 additions & 0 deletions
6
src/main/resources/assets/potatoperks/models/item/pink_potato.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:item/generated", | ||
"textures": { | ||
"layer0": "potatoperks:item/pink_potato" | ||
} | ||
} |
3 changes: 3 additions & 0 deletions
3
src/main/resources/assets/potatoperks/models/item/pink_potato_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": "potatoperks:block/pink_potato_block" | ||
} |
Binary file added
BIN
+967 Bytes
src/main/resources/assets/potatoperks/textures/block/blue_potato_block.png
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
+932 Bytes
src/main/resources/assets/potatoperks/textures/block/orange_potato_block.png
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
+934 Bytes
src/main/resources/assets/potatoperks/textures/block/pink_potato_block.png
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
+422 Bytes
src/main/resources/assets/potatoperks/textures/item/pink_potato.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 13 additions & 0 deletions
13
src/main/resources/data/potatoperks/recipe/pink_potato.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,13 @@ | ||
{ | ||
"type": "minecraft:crafting_shapeless", | ||
"category": "building", | ||
"ingredients": [ | ||
{ | ||
"item": "potatoperks:pink_potato_block" | ||
} | ||
], | ||
"result": { | ||
"count": 9, | ||
"id": "potatoperks:pink_potato" | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
src/main/resources/data/potatoperks/recipe/pink_potato_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,18 @@ | ||
{ | ||
"type": "minecraft:crafting_shaped", | ||
"category": "misc", | ||
"key": { | ||
"#": { | ||
"item": "potatoperks:pink_potato" | ||
} | ||
}, | ||
"pattern": [ | ||
"###", | ||
"###", | ||
"###" | ||
], | ||
"result": { | ||
"count": 1, | ||
"id": "potatoperks:pink_potato_block" | ||
} | ||
} |