Skip to content

Commit

Permalink
work morning of nov 30
Browse files Browse the repository at this point in the history
  • Loading branch information
Bluelightning26 committed Nov 30, 2024
1 parent 534b445 commit 772c3e6
Show file tree
Hide file tree
Showing 14 changed files with 102 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/main/java/net/pengi/potatoperks/PotatoPerks.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import net.fabricmc.api.ModInitializer;

import net.fabricmc.fabric.api.registry.FuelRegistry;
import net.pengi.potatoperks.block.ModBlocks;
import net.pengi.potatoperks.item.ModItems;
import org.slf4j.Logger;
Expand All @@ -16,5 +17,6 @@ public void onInitialize() {
ModItems.registerModItems();
ModBlocks.registerModBlocks();

FuelRegistry.INSTANCE.add(ModBlocks.ORANGE_POTATO_BLOCK, 15000);
}
}
26 changes: 26 additions & 0 deletions src/main/java/net/pengi/potatoperks/item/ModFoodComponents.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package net.pengi.potatoperks.item;

import net.minecraft.component.type.FoodComponent;
import net.minecraft.entity.effect.StatusEffectInstance;
import net.minecraft.entity.effect.StatusEffects;

public class ModFoodComponents {
public static final FoodComponent COOKED_PINK_POTATO = new FoodComponent.Builder()
.nutrition(5)
.saturationModifier(0.5f)
.statusEffect(new StatusEffectInstance(StatusEffects.SPEED, 200), 95f)
.build();

public static final FoodComponent COOKED_BLUE_POTATO = new FoodComponent.Builder()
.nutrition(5)
.saturationModifier(0.5f)
.statusEffect(new StatusEffectInstance(StatusEffects.JUMP_BOOST, 200), 95f)
.build();

public static final FoodComponent COOKED_ORANGE_POTATO = new FoodComponent.Builder()
.nutrition(5)
.saturationModifier(0.5f)
.statusEffect(new StatusEffectInstance(StatusEffects.HASTE, 200), 95f)
.build();

}
11 changes: 11 additions & 0 deletions src/main/java/net/pengi/potatoperks/item/ModItems.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,14 @@ public class ModItems {

public static final Item PURPLE_POTATO = registerItem("purple_potato", new Item(new Item.Settings()));

public static final Item COOKED_PINK_POTATO = registerItem("cooked_pink_potato",
new Item(new Item.Settings().food(ModFoodComponents.COOKED_PINK_POTATO)));

public static final Item COOKED_BLUE_POTATO = registerItem("cooked_blue_potato",
new Item(new Item.Settings().food(ModFoodComponents.COOKED_BLUE_POTATO)));

public static final Item COOKED_ORANGE_POTATO = registerItem("cooked_orange_potato", new Item
(new Item.Settings().food(ModFoodComponents.COOKED_ORANGE_POTATO)));

private static Item registerItem(String name, Item item) {
return Registry.register(Registries.ITEM, Identifier.of(PotatoPerks.MOD_ID, name), item);
Expand All @@ -34,6 +41,10 @@ public static void registerModItems(){
entries.add(ORANGE_POTATO);
entries.add(PURPLE_POTATO);

entries.add(COOKED_PINK_POTATO);
entries.add(COOKED_BLUE_POTATO);
entries.add(COOKED_ORANGE_POTATO);

} );
}
}
5 changes: 5 additions & 0 deletions src/main/resources/assets/potatoperks/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@
"item.potatoperks.orange_potato": "Orange Potato",
"item.potatoperks.purple_potato": "Purple Potato",

"item.potatoperks.cooked_pink_potato": "Seared Pink Potato",
"item.potatoperks.cooked_blue_potato": "Charred Blue Potato",
"item.potatoperks.cooked_orange_potato": "Scorched Orange Potato",
"item.potatoperks.cooked_purple_potato": "To Add!",

"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",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "potatoperks:item/cooked_blue_potato"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "potatoperks:item/cooked_orange_potato"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "potatoperks:item/cooked_pink_potato"
}
}
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.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"type": "minecraft:smelting",
"category": "misc",
"cookingtime": 200,
"experience": 0.3,
"group": "blue_potato",
"ingredient": {
"item": "potatoperks:blue_potato"
},
"result": {
"id": "potatoperks:cooked_blue_potato"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"type": "minecraft:smelting",
"category": "misc",
"cookingtime": 200,
"experience": 0.3,
"group": "orange_potato",
"ingredient": {
"item": "potatoperks:orange_potato"
},
"result": {
"id": "potatoperks:cooked_orange_potato"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"type": "minecraft:smelting",
"category": "misc",
"cookingtime": 200,
"experience": 0.3,
"group": "pink_potato",
"ingredient": {
"item": "potatoperks:pink_potato"
},
"result": {
"id": "potatoperks:cooked_pink_potato"
}
}
2 changes: 1 addition & 1 deletion src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
],
"contact": {
"homepage": "https://fabricmc.net/",
"sources": "https://github.com/FabricMC/fabric-example-mod"
"sources": "https://github.com/Bluelightning26/potato-perks-1.21.1"
},
"license": "MIT",
"icon": "assets/potatoperks/icon.png",
Expand Down

0 comments on commit 772c3e6

Please sign in to comment.