Skip to content

Commit

Permalink
data changes
Browse files Browse the repository at this point in the history
  • Loading branch information
PssbleTrngle committed Aug 31, 2023
1 parent 1667e16 commit 17f3f1b
Show file tree
Hide file tree
Showing 19 changed files with 418 additions and 43 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"block.blissful.weed_crate": "ǝʇɐɹƆ pǝǝM",
"effect.blissful.peace": "ǝɔɐǝԀ",
"effect.blissful.peace.description": "uıɐɹq ɹnoʎ sboɟǝq ɐɹnɐ ןnɟssıןq Ɐ",
"item.blissful.bong": "buoᗺ",
"item.blissful.hemp": "dɯǝH",
"item.blissful.hemp_seeds": "spǝǝS dɯǝH",
"item.blissful.joint": "ʇuıoſ",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"block.blissful.weed_crate": "Weed Crate",
"effect.blissful.peace": "Peace",
"effect.blissful.peace.description": "A blissful aura befogs your brain",
"item.blissful.bong": "Bong",
"item.blissful.hemp": "Hemp",
"item.blissful.hemp_seeds": "Hemp Seeds",
"item.blissful.joint": "Joint",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "blissful:item/bong"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"parent": "minecraft:recipes/root",
"criteria": {
"has_hemp_seed": {
"conditions": {
"items": [
{
"items": [
"blissful:hemp_seeds"
]
}
]
},
"trigger": "minecraft:inventory_changed"
},
"has_the_recipe": {
"conditions": {
"recipe": "blissful:weed_brownies"
},
"trigger": "minecraft:recipe_unlocked"
}
},
"requirements": [
[
"has_hemp_seed",
"has_the_recipe"
]
],
"rewards": {
"recipes": [
"blissful:weed_brownies"
]
},
"sends_telemetry_event": false
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"parent": "minecraft:recipes/root",
"criteria": {
"has_hemp": {
"conditions": {
"items": [
{
"items": [
"blissful:hemp"
]
}
]
},
"trigger": "minecraft:inventory_changed"
},
"has_the_recipe": {
"conditions": {
"recipe": "blissful:weed_from_hemp_campfire"
},
"trigger": "minecraft:recipe_unlocked"
}
},
"requirements": [
[
"has_hemp",
"has_the_recipe"
]
],
"rewards": {
"recipes": [
"blissful:weed_from_hemp_campfire"
]
},
"sends_telemetry_event": false
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"parent": "minecraft:recipes/root",
"criteria": {
"has_hemp": {
"conditions": {
"items": [
{
"items": [
"blissful:hemp"
]
}
]
},
"trigger": "minecraft:inventory_changed"
},
"has_the_recipe": {
"conditions": {
"recipe": "blissful:weed_from_hemp_smoking"
},
"trigger": "minecraft:recipe_unlocked"
}
},
"requirements": [
[
"has_hemp",
"has_the_recipe"
]
],
"rewards": {
"recipes": [
"blissful:weed_from_hemp_smoking"
]
},
"sends_telemetry_event": false
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,43 +23,101 @@
}
}
],
"name": "blissful:hemp_seeds"
"functions": [
{
"enchantment": "minecraft:fortune",
"formula": "minecraft:binomial_with_bonus_count",
"function": "minecraft:apply_bonus",
"parameters": {
"extra": 2,
"probability": 0.57
}
}
],
"name": "blissful:hemp"
},
{
"type": "minecraft:item",
"conditions": [
{
"block": "blissful:hemp",
"condition": "minecraft:block_state_property",
"properties": {
"age": "6"
}
}
],
"functions": [
{
"enchantment": "minecraft:fortune",
"formula": "minecraft:binomial_with_bonus_count",
"function": "minecraft:apply_bonus",
"parameters": {
"extra": 1,
"probability": 0.62
}
}
],
"name": "blissful:hemp"
},
{
"type": "minecraft:item",
"name": "blissful:hemp_seeds"
}
]
}
],
"rolls": 1.0
},
{
"bonus_rolls": 0.0,
"conditions": [
{
"block": "blissful:hemp",
"condition": "minecraft:block_state_property",
"properties": {
"age": "5"
}
}
],
"entries": [
},
{
"type": "minecraft:item",
"functions": [
"type": "minecraft:alternatives",
"children": [
{
"enchantment": "minecraft:fortune",
"formula": "minecraft:binomial_with_bonus_count",
"function": "minecraft:apply_bonus",
"parameters": {
"extra": 3,
"probability": 0.5714286
}
"type": "minecraft:item",
"conditions": [
{
"block": "blissful:hemp",
"condition": "minecraft:block_state_property",
"properties": {
"age": "5"
}
}
],
"functions": [
{
"enchantment": "minecraft:fortune",
"formula": "minecraft:binomial_with_bonus_count",
"function": "minecraft:apply_bonus",
"parameters": {
"extra": 2,
"probability": 0.57
}
}
],
"name": "blissful:hemp_seeds"
},
{
"type": "minecraft:item",
"conditions": [
{
"block": "blissful:hemp",
"condition": "minecraft:block_state_property",
"properties": {
"age": "6"
}
}
],
"functions": [
{
"enchantment": "minecraft:fortune",
"formula": "minecraft:binomial_with_bonus_count",
"function": "minecraft:apply_bonus",
"parameters": {
"extra": 1,
"probability": 0.57
}
}
],
"name": "blissful:hemp_seeds"
}
],
"name": "blissful:hemp"
]
}
],
"rolls": 1.0
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"type": "minecraft:crafting_shapeless",
"category": "misc",
"ingredients": [
{
"item": "blissful:hemp_seeds"
}
],
"result": {
"item": "blissful:weed_brownies"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"type": "minecraft:campfire_cooking",
"category": "food",
"cookingtime": 600,
"experience": 0.25,
"ingredient": {
"item": "blissful:hemp"
},
"result": "blissful:weed"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"type": "minecraft:smoking",
"category": "food",
"cookingtime": 100,
"experience": 0.25,
"ingredient": {
"item": "blissful:hemp"
},
"result": "blissful:weed"
}
35 changes: 27 additions & 8 deletions common/src/main/java/galena/blissful/index/BlissfuItems.java
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
package galena.blissful.index;

import com.tterrag.registrate.AbstractRegistrate;
import com.tterrag.registrate.providers.RegistrateRecipeProvider;
import com.tterrag.registrate.util.DataIngredient;
import com.tterrag.registrate.util.entry.ItemEntry;
import com.tterrag.registrate.util.nullness.NonNullSupplier;
import galena.blissful.platform.Services;
import galena.blissful.world.item.BongItem;
import galena.blissful.world.item.JointItem;
import galena.blissful.world.item.LazyFoodItem;
import net.minecraft.data.recipes.RecipeCategory;
import net.minecraft.data.recipes.ShapelessRecipeBuilder;
import net.minecraft.world.effect.MobEffectInstance;
import net.minecraft.world.food.FoodProperties;
import net.minecraft.world.item.CreativeModeTabs;
Expand All @@ -22,9 +26,19 @@ public class BlissfuItems {
.tab(CreativeModeTabs.INGREDIENTS)
.register();

public static final ItemEntry<ItemNameBlockItem> HEMP_SEEDS = REGISTRATE
.item("hemp_seeds", p -> new ItemNameBlockItem(BlissfulBlocks.HEMP.get(), p))
.tab(CreativeModeTabs.NATURAL_BLOCKS)
.recipe((c, p) -> p.singleItem(DataIngredient.items(HEMP.get()), RecipeCategory.MISC, c, 1, 2))
.register();

public static final ItemEntry<Item> WEED = REGISTRATE
.item("weed", Item::new)
.tab(CreativeModeTabs.FOOD_AND_DRINKS)
.recipe((c, p) -> {
p.smoking(DataIngredient.items(HEMP.get()), RecipeCategory.MISC, c, 0.25F);
p.campfire(DataIngredient.items(HEMP.get()), RecipeCategory.MISC, c, 0.25F);
})
.register();

private static final NonNullSupplier<FoodProperties> BROWNIES_FOOD = NonNullSupplier.lazy(() -> new FoodProperties.Builder()
Expand All @@ -37,6 +51,17 @@ public class BlissfuItems {
public static final ItemEntry<LazyFoodItem> WEED_BROWNIES = REGISTRATE
.item("weed_brownies", p -> new LazyFoodItem(p, BROWNIES_FOOD))
.tab(CreativeModeTabs.FOOD_AND_DRINKS)
.recipe((c, p) -> ShapelessRecipeBuilder
.shapeless(RecipeCategory.FOOD, c.get())
.requires(HEMP_SEEDS)
.unlockedBy("has_hemp_seed", RegistrateRecipeProvider.has(HEMP_SEEDS))
.save(p)
)
.register();

public static final ItemEntry<BongItem> BONG = REGISTRATE
.item("bong", BongItem::new)
.tab(CreativeModeTabs.FOOD_AND_DRINKS)
.register();

private static final NonNullSupplier<FoodProperties> JOINT_FOOD = NonNullSupplier.lazy(() -> new FoodProperties.Builder()
Expand All @@ -45,17 +70,11 @@ public class BlissfuItems {
.build()
);

public static final ItemEntry<LazyFoodItem> JOINT = REGISTRATE
.item("joint", p -> new LazyFoodItem(p, JOINT_FOOD))
public static final ItemEntry<JointItem> JOINT = REGISTRATE
.item("joint", JointItem::new)
.tab(CreativeModeTabs.FOOD_AND_DRINKS)
.register();

public static final ItemEntry<ItemNameBlockItem> HEMP_SEEDS = REGISTRATE
.item("hemp_seeds", p -> new ItemNameBlockItem(BlissfulBlocks.HEMP.get(), p))
.tab(CreativeModeTabs.NATURAL_BLOCKS)
.recipe((c, p) -> p.singleItem(DataIngredient.items(HEMP.get()), RecipeCategory.MISC, c, 1, 2))
.register();

public static void register() {
// loads this class
}
Expand Down
Loading

0 comments on commit 17f3f1b

Please sign in to comment.