From 43dff8f29d61a69e3260601c8c3783dad28e26e9 Mon Sep 17 00:00:00 2001 From: Alan19 Date: Sat, 30 Nov 2019 21:35:10 -0500 Subject: [PATCH] Add nutrition values for foods --- build.gradle | 4 +- .../alan199921/astral/items/Feverweed.java | 2 +- .../astral/items/IntrospectionMedicine.java | 2 + .../alan199921/astral/items/Snowberry.java | 2 +- .../astral/items/TravellingMedicine.java | 2 + src/main/resources/META-INF/mods.toml | 8 +- .../loot_tables/blocks/snowberry_bush.json | 74 +++++++++++++++++++ 7 files changed, 86 insertions(+), 8 deletions(-) diff --git a/build.gradle b/build.gradle index 490611c1..0b5edefe 100644 --- a/build.gradle +++ b/build.gradle @@ -13,7 +13,7 @@ apply plugin: 'net.minecraftforge.gradle' apply plugin: 'eclipse' apply plugin: 'maven-publish' -version = '0.4.4' +version = '0.4.6' group = 'com.alan199921.astral' // http://maven.apache.org/guides/mini/guide-naming-conventions.html archivesBaseName = 'astral' @@ -70,7 +70,7 @@ minecraft { } dependencies { - minecraft 'net.minecraftforge:forge:1.14.4-28.1.87' + minecraft 'net.minecraftforge:forge:1.14.4-28.1.96' } jar { diff --git a/src/main/java/com/alan199921/astral/items/Feverweed.java b/src/main/java/com/alan199921/astral/items/Feverweed.java index 8f53ab74..5bb053fe 100644 --- a/src/main/java/com/alan199921/astral/items/Feverweed.java +++ b/src/main/java/com/alan199921/astral/items/Feverweed.java @@ -20,7 +20,7 @@ public Feverweed() { .group(Astral.setup.astralItems) .food(new Food.Builder() .setAlwaysEdible() - .saturation(1) + .saturation(-1F) .hunger(1) .fastToEat() .effect(new EffectInstance(Effects.LUCK, AstralConfig.getHerbEffectDurations().getFeverweedLuckDuration(), 1), 1) diff --git a/src/main/java/com/alan199921/astral/items/IntrospectionMedicine.java b/src/main/java/com/alan199921/astral/items/IntrospectionMedicine.java index 88bb5b82..c0bbd066 100644 --- a/src/main/java/com/alan199921/astral/items/IntrospectionMedicine.java +++ b/src/main/java/com/alan199921/astral/items/IntrospectionMedicine.java @@ -16,6 +16,8 @@ public IntrospectionMedicine() { super(new Properties() .food(new Food.Builder() .setAlwaysEdible() + .hunger(1) + .saturation(-2F) .build()) .group(Astral.setup.astralItems) ); diff --git a/src/main/java/com/alan199921/astral/items/Snowberry.java b/src/main/java/com/alan199921/astral/items/Snowberry.java index 5cf764de..0875e359 100644 --- a/src/main/java/com/alan199921/astral/items/Snowberry.java +++ b/src/main/java/com/alan199921/astral/items/Snowberry.java @@ -19,7 +19,7 @@ public Snowberry() { .group(Astral.setup.astralItems) .food(new Food.Builder() .setAlwaysEdible() - .saturation(1) + .saturation(-1F) .hunger(1) .fastToEat() .effect(new EffectInstance(Effects.NAUSEA, AstralConfig.getHerbEffectDurations().getSnowberryNauseaDuration(), 1), 1) diff --git a/src/main/java/com/alan199921/astral/items/TravellingMedicine.java b/src/main/java/com/alan199921/astral/items/TravellingMedicine.java index e04da453..e1d019e0 100644 --- a/src/main/java/com/alan199921/astral/items/TravellingMedicine.java +++ b/src/main/java/com/alan199921/astral/items/TravellingMedicine.java @@ -18,6 +18,8 @@ public TravellingMedicine() { .food(new Food.Builder() .fastToEat() .setAlwaysEdible() + .saturation(-2F) + .hunger(1) .effect(new EffectInstance(AstralEffects.astralTravelEffect, AstralConfig.getHerbEffectDurations().getTravellingMedicineDuration(), 1), 1) .build())); } diff --git a/src/main/resources/META-INF/mods.toml b/src/main/resources/META-INF/mods.toml index 411b2bf6..09676336 100644 --- a/src/main/resources/META-INF/mods.toml +++ b/src/main/resources/META-INF/mods.toml @@ -5,9 +5,9 @@ issueTrackerURL="https://github.com/Alan19/Astral/issues" modId="astral" version="${file.jarVersion}" displayName="Astral" -updateJSONURL="http://myurl.me/" #optional -displayURL="https://github.com/Alan19/Astral" #optional -logoFile="examplemod.png" #optional -credits="Thanks to Divineaspect for designing and planning the mod and Lance5057 for some of the textures!" #optional +updateJSONURL="http://myurl.me/" +displayURL="https://github.com/Alan19/Astral" +logoFile="examplemod.png" +credits="Thanks to Divineaspect for designing and planning the mod and Lance5057 and Snurly for some of the textures!" authors="Alan199921" description='''A practice of the arts of psychic projection and inversion, the exploration of the psychic world hidden around us, and the development of the inner worlds of the mind of the practitioner.''' \ No newline at end of file diff --git a/src/main/resources/data/astral/loot_tables/blocks/snowberry_bush.json b/src/main/resources/data/astral/loot_tables/blocks/snowberry_bush.json index d8196bfa..e42ecf48 100644 --- a/src/main/resources/data/astral/loot_tables/blocks/snowberry_bush.json +++ b/src/main/resources/data/astral/loot_tables/blocks/snowberry_bush.json @@ -74,6 +74,80 @@ } } ] + }, + { + "name": "not_grown", + "rolls": 1.0, + "entries": [ + { + "type": "minecraft:item", + "name": "astral:snowberry" + } + ], + "conditions": [ + { + "condition": "minecraft:block_state_property", + "block": "astral:snowberry_bush", + "properties": { + "age": "1" + } + } + ], + "functions": [ + { + "function": "minecraft:set_count", + "count": { + "min": 1.0, + "max": 1.0, + "type": "minecraft:uniform" + } + }, + { + "function": "minecraft:apply_bonus", + "enchantment": "minecraft:fortune", + "formula": "minecraft:uniform_bonus_count", + "parameters": { + "bonusMultiplier": 1 + } + } + ] + }, + { + "name": "planted", + "rolls": 1.0, + "entries": [ + { + "type": "minecraft:item", + "name": "astral:snowberry" + } + ], + "conditions": [ + { + "condition": "minecraft:block_state_property", + "block": "astral:snowberry_bush", + "properties": { + "age": "0" + } + } + ], + "functions": [ + { + "function": "minecraft:set_count", + "count": { + "min": 1.0, + "max": 1.0, + "type": "minecraft:uniform" + } + }, + { + "function": "minecraft:apply_bonus", + "enchantment": "minecraft:fortune", + "formula": "minecraft:uniform_bonus_count", + "parameters": { + "bonusMultiplier": 1 + } + } + ] } ], "functions": [