From 0793febb70b38e77d0d34b850b323b96b7fd7a6b Mon Sep 17 00:00:00 2001 From: blu <87286496+Bluelightning26@users.noreply.github.com> Date: Fri, 29 Nov 2024 22:35:49 -0500 Subject: [PATCH] Work of Night of Nov 29 --- .../net/pengi/potatoperks/PotatoPerks.java | 4 ++ .../pengi/potatoperks/block/ModBlocks.java | 68 ++++++++++++++++++ .../net/pengi/potatoperks/item/ModItems.java | 29 ++++++++ .../blockstates/blue_potato_block.json | 7 ++ .../blockstates/orange_potato_block.json | 7 ++ .../blockstates/pink_potato_block.json | 7 ++ .../assets/potatoperks/lang/en_us.json | 8 +++ .../models/block/blue_potato_block.json | 6 ++ .../models/block/orange_potato_block.json | 6 ++ .../models/block/pink_potato_block.json | 6 ++ .../models/item/blue_potato_block.json | 3 + .../models/item/orange_potato_block.json | 3 + .../potatoperks/models/item/pink_potato.json | 6 ++ .../models/item/pink_potato_block.json | 3 + .../textures/block/blue_potato_block.png | Bin 0 -> 967 bytes .../textures/block/orange_potato_block.png | Bin 0 -> 932 bytes .../textures/block/pink_potato_block.png | Bin 0 -> 934 bytes .../potatoperks/textures/item/pink_potato.png | Bin 0 -> 422 bytes .../data/potatoperks/recipe/pink_potato.json | 13 ++++ .../potatoperks/recipe/pink_potato_block.json | 18 +++++ 20 files changed, 194 insertions(+) create mode 100644 src/main/java/net/pengi/potatoperks/block/ModBlocks.java create mode 100644 src/main/java/net/pengi/potatoperks/item/ModItems.java create mode 100644 src/main/resources/assets/potatoperks/blockstates/blue_potato_block.json create mode 100644 src/main/resources/assets/potatoperks/blockstates/orange_potato_block.json create mode 100644 src/main/resources/assets/potatoperks/blockstates/pink_potato_block.json create mode 100644 src/main/resources/assets/potatoperks/lang/en_us.json create mode 100644 src/main/resources/assets/potatoperks/models/block/blue_potato_block.json create mode 100644 src/main/resources/assets/potatoperks/models/block/orange_potato_block.json create mode 100644 src/main/resources/assets/potatoperks/models/block/pink_potato_block.json create mode 100644 src/main/resources/assets/potatoperks/models/item/blue_potato_block.json create mode 100644 src/main/resources/assets/potatoperks/models/item/orange_potato_block.json create mode 100644 src/main/resources/assets/potatoperks/models/item/pink_potato.json create mode 100644 src/main/resources/assets/potatoperks/models/item/pink_potato_block.json create mode 100644 src/main/resources/assets/potatoperks/textures/block/blue_potato_block.png create mode 100644 src/main/resources/assets/potatoperks/textures/block/orange_potato_block.png create mode 100644 src/main/resources/assets/potatoperks/textures/block/pink_potato_block.png create mode 100644 src/main/resources/assets/potatoperks/textures/item/pink_potato.png create mode 100644 src/main/resources/data/potatoperks/recipe/pink_potato.json create mode 100644 src/main/resources/data/potatoperks/recipe/pink_potato_block.json diff --git a/src/main/java/net/pengi/potatoperks/PotatoPerks.java b/src/main/java/net/pengi/potatoperks/PotatoPerks.java index 3f51914..37239ad 100644 --- a/src/main/java/net/pengi/potatoperks/PotatoPerks.java +++ b/src/main/java/net/pengi/potatoperks/PotatoPerks.java @@ -2,6 +2,8 @@ import net.fabricmc.api.ModInitializer; +import net.pengi.potatoperks.block.ModBlocks; +import net.pengi.potatoperks.item.ModItems; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -11,6 +13,8 @@ public class PotatoPerks implements ModInitializer { @Override public void onInitialize() { + ModItems.registerModItems(); + ModBlocks.registerModBlocks(); } } \ No newline at end of file diff --git a/src/main/java/net/pengi/potatoperks/block/ModBlocks.java b/src/main/java/net/pengi/potatoperks/block/ModBlocks.java new file mode 100644 index 0000000..f4759ac --- /dev/null +++ b/src/main/java/net/pengi/potatoperks/block/ModBlocks.java @@ -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); + }); + } + } diff --git a/src/main/java/net/pengi/potatoperks/item/ModItems.java b/src/main/java/net/pengi/potatoperks/item/ModItems.java new file mode 100644 index 0000000..4d736f4 --- /dev/null +++ b/src/main/java/net/pengi/potatoperks/item/ModItems.java @@ -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); + } ); + } +} diff --git a/src/main/resources/assets/potatoperks/blockstates/blue_potato_block.json b/src/main/resources/assets/potatoperks/blockstates/blue_potato_block.json new file mode 100644 index 0000000..6307390 --- /dev/null +++ b/src/main/resources/assets/potatoperks/blockstates/blue_potato_block.json @@ -0,0 +1,7 @@ +{ + "variants": { + "": { + "model": "potatoperks:block/blue_potato_block" + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/potatoperks/blockstates/orange_potato_block.json b/src/main/resources/assets/potatoperks/blockstates/orange_potato_block.json new file mode 100644 index 0000000..336d685 --- /dev/null +++ b/src/main/resources/assets/potatoperks/blockstates/orange_potato_block.json @@ -0,0 +1,7 @@ +{ + "variants": { + "": { + "model": "potatoperks:block/orange_potato_block" + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/potatoperks/blockstates/pink_potato_block.json b/src/main/resources/assets/potatoperks/blockstates/pink_potato_block.json new file mode 100644 index 0000000..fbe4ec0 --- /dev/null +++ b/src/main/resources/assets/potatoperks/blockstates/pink_potato_block.json @@ -0,0 +1,7 @@ +{ + "variants": { + "": { + "model": "potatoperks:block/pink_potato_block" + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/potatoperks/lang/en_us.json b/src/main/resources/assets/potatoperks/lang/en_us.json new file mode 100644 index 0000000..6a2e9b4 --- /dev/null +++ b/src/main/resources/assets/potatoperks/lang/en_us.json @@ -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" + +} \ No newline at end of file diff --git a/src/main/resources/assets/potatoperks/models/block/blue_potato_block.json b/src/main/resources/assets/potatoperks/models/block/blue_potato_block.json new file mode 100644 index 0000000..7089300 --- /dev/null +++ b/src/main/resources/assets/potatoperks/models/block/blue_potato_block.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cube_all", + "textures": { + "all": "potatoperks:block/blue_potato_block" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/potatoperks/models/block/orange_potato_block.json b/src/main/resources/assets/potatoperks/models/block/orange_potato_block.json new file mode 100644 index 0000000..e06c1e8 --- /dev/null +++ b/src/main/resources/assets/potatoperks/models/block/orange_potato_block.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cube_all", + "textures": { + "all": "potatoperks:block/orange_potato_block" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/potatoperks/models/block/pink_potato_block.json b/src/main/resources/assets/potatoperks/models/block/pink_potato_block.json new file mode 100644 index 0000000..7f1a769 --- /dev/null +++ b/src/main/resources/assets/potatoperks/models/block/pink_potato_block.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cube_all", + "textures": { + "all": "potatoperks:block/pink_potato_block" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/potatoperks/models/item/blue_potato_block.json b/src/main/resources/assets/potatoperks/models/item/blue_potato_block.json new file mode 100644 index 0000000..29f32d4 --- /dev/null +++ b/src/main/resources/assets/potatoperks/models/item/blue_potato_block.json @@ -0,0 +1,3 @@ +{ + "parent": "potatoperks:block/blue_potato_block" +} \ No newline at end of file diff --git a/src/main/resources/assets/potatoperks/models/item/orange_potato_block.json b/src/main/resources/assets/potatoperks/models/item/orange_potato_block.json new file mode 100644 index 0000000..03f288e --- /dev/null +++ b/src/main/resources/assets/potatoperks/models/item/orange_potato_block.json @@ -0,0 +1,3 @@ +{ + "parent": "potatoperks:block/orange_potato_block" +} \ No newline at end of file diff --git a/src/main/resources/assets/potatoperks/models/item/pink_potato.json b/src/main/resources/assets/potatoperks/models/item/pink_potato.json new file mode 100644 index 0000000..612b842 --- /dev/null +++ b/src/main/resources/assets/potatoperks/models/item/pink_potato.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "potatoperks:item/pink_potato" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/potatoperks/models/item/pink_potato_block.json b/src/main/resources/assets/potatoperks/models/item/pink_potato_block.json new file mode 100644 index 0000000..9606abe --- /dev/null +++ b/src/main/resources/assets/potatoperks/models/item/pink_potato_block.json @@ -0,0 +1,3 @@ +{ + "parent": "potatoperks:block/pink_potato_block" +} \ No newline at end of file diff --git a/src/main/resources/assets/potatoperks/textures/block/blue_potato_block.png b/src/main/resources/assets/potatoperks/textures/block/blue_potato_block.png new file mode 100644 index 0000000000000000000000000000000000000000..f80a025d41f803875057b2b29037c506af849be9 GIT binary patch literal 967 zcmV;&133JNP)Px#L}ge>W=%~1DgXcg2mk?xX#fNO00031000^Q000001E2u_0{{R30RRC20H6W@ z1ONa40RR915TFA91ONa40RR915C8xG05nx`@&Et>F-b&0R5%e8le=!?Mihqsx$rXL zP^3snwAS`|jYYB>AZ|8TY=AsSUM5w#w5gIJb;`U#fYd2m1O_&?8Ju&z|3BorpZ=>a-h2GFpKlR_7T$h1?&49e{q@H`_{;M|mvu)*iLB2qjth&k zZBrB?O5Ceoe)#>%)6b9QY&`n*`|0f`GI=G*-QA1`yQPO+%cV3Z*_=|e~j)G&}G#>Wz%1Rwv}n$Yn>nCNzPv$OB7pA4)KPTsnRP8l5T!Erc( z*uiKLn$b&$-ZSJ5L{VY7==R_$HfUVQxdbYg7AB2iVCy49NcMP*)@ivK6qa`WO8aF4inOKt@eD| zL?eggAU9k(RX0)W^K>~Q`?YO20R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9z{3%7DOvmW#O!>)xIcc( zo~Di6u?Fk!^R$9_9Nmv1}myW^SK~8Ypi!q7`4K_Y2YG`Vc#JS znUhk4^n~O>!p<2I#^J-fZ+nRGWMom7Bv+Xu<5(Pu#HE0@25iCM!lG6-lqZAL6NZNl zN*L%!p<2!$vN9!i6XRxi750r6Sw!A>a7tji0mf^c)v4G#Jy3j#K@o6xy9Li;3_)C^ z%RqIOkaNzbc|rQzBMA6r`T${5KaD5R{nvgh*lujlho1DiDOgunu4Z1?F-P8W#H%^1 z={=9;&a^Gdbpac`a(}RXI*&vP>t}gIS>WfjjGr#l4?=fB^#D1*&2 zCV3C{^z^2U4zr#%i5{4BQ?x?DK|*@Ri7IASi97}mk!L|@+<{(md;8p$P(Pwm^y!zrHqFp=GyL4|Wu<8=3? zhmW5=Pq^NY^EAC7gDsPVG3Bg+-5nKy^v1f+^(PB5*;vb11*SjzJXt(J+A*i3SHV!g o!H_|P!HC7>FoRyN!OzC!j1wEuzbeE!cZ0&n)78&qol`;+0KbilsQ>@~ literal 0 HcmV?d00001 diff --git a/src/main/resources/data/potatoperks/recipe/pink_potato.json b/src/main/resources/data/potatoperks/recipe/pink_potato.json new file mode 100644 index 0000000..49bf703 --- /dev/null +++ b/src/main/resources/data/potatoperks/recipe/pink_potato.json @@ -0,0 +1,13 @@ +{ + "type": "minecraft:crafting_shapeless", + "category": "building", + "ingredients": [ + { + "item": "potatoperks:pink_potato_block" + } + ], + "result": { + "count": 9, + "id": "potatoperks:pink_potato" + } +} \ No newline at end of file diff --git a/src/main/resources/data/potatoperks/recipe/pink_potato_block.json b/src/main/resources/data/potatoperks/recipe/pink_potato_block.json new file mode 100644 index 0000000..616c6e0 --- /dev/null +++ b/src/main/resources/data/potatoperks/recipe/pink_potato_block.json @@ -0,0 +1,18 @@ +{ + "type": "minecraft:crafting_shaped", + "category": "misc", + "key": { + "#": { + "item": "potatoperks:pink_potato" + } + }, + "pattern": [ + "###", + "###", + "###" + ], + "result": { + "count": 1, + "id": "potatoperks:pink_potato_block" + } +} \ No newline at end of file