diff --git a/Common/src/generated/resources/.cache/e5c5eb35b4ba40351ecb7d9f04c3527f2f5779b0 b/Common/src/generated/resources/.cache/e5c5eb35b4ba40351ecb7d9f04c3527f2f5779b0 index 010e48c1..b46c34f8 100644 --- a/Common/src/generated/resources/.cache/e5c5eb35b4ba40351ecb7d9f04c3527f2f5779b0 +++ b/Common/src/generated/resources/.cache/e5c5eb35b4ba40351ecb7d9f04c3527f2f5779b0 @@ -1,7 +1,7 @@ -// 1.19.2 2022-11-09T19:44:43.405259 Advancements +// 1.19.2 2022-11-29T13:33:14.877218824 Advancements b21f0b7f0cda29a7e84693df8139f2fecfeea960 data/hexcasting/advancements/aaa_wasteful_cast.json 9d8b41dd8ddfccdf2cd19433d8d7d3cf934e64db data/hexcasting/advancements/aab_big_cast.json -ef61c93d776c6f212820af20909a4c1d92822baf data/hexcasting/advancements/enlightenment.json +425b42f6da5fd6498053f565dce1f171997dbb8b data/hexcasting/advancements/enlightenment.json 8f97205fa79270eab688aa3019d6fe7dd8c8b0d3 data/hexcasting/advancements/lore.json 2f5ad49936d58c7097ac7f8fbbf3f66f9f90fd2c data/hexcasting/advancements/lore/experiment1.json 9a4eba1c9d7868906e8ea1b4ec287f54a2c379b5 data/hexcasting/advancements/lore/experiment2.json @@ -11,6 +11,6 @@ ef06ae5bd79e2c52291fbfb3c69bc2f74a604477 data/hexcasting/advancements/lore/terab 74fbb1ce0e3acf982325b9e9205f774a67956c3c data/hexcasting/advancements/lore/terabithia3.json 861374b7c144ccdbbd031a3f5042af6718ba42bf data/hexcasting/advancements/lore/terabithia4.json e26db8dfa825b7ac572d59a548b610db7c7bf736 data/hexcasting/advancements/lore/terabithia5.json -2acbfb4efe2a72a1986c8dbe62ad8d93e9613e99 data/hexcasting/advancements/opened_eyes.json +bf319d71d9e706f9131c9484be1bc83ca2b8b6a3 data/hexcasting/advancements/opened_eyes.json d19039a73324eb7532d035d08442f3b68bb13bcb data/hexcasting/advancements/root.json b1b82068d65d6872c258d905d4f78499e8227ccf data/hexcasting/advancements/y_u_no_cast_angy.json diff --git a/Common/src/generated/resources/data/hexcasting/advancements/enlightenment.json b/Common/src/generated/resources/data/hexcasting/advancements/enlightenment.json index a4c76966..4488f207 100644 --- a/Common/src/generated/resources/data/hexcasting/advancements/enlightenment.json +++ b/Common/src/generated/resources/data/hexcasting/advancements/enlightenment.json @@ -7,8 +7,8 @@ "min": 0.8 }, "mojang_i_am_begging_and_crying_please_add_an_entity_health_criterion": { - "max": 2.05, - "min": 0.1 + "max": 1.0, + "min": 2.2250738585072014E-308 } }, "trigger": "hexcasting:overcast" diff --git a/Common/src/generated/resources/data/hexcasting/advancements/opened_eyes.json b/Common/src/generated/resources/data/hexcasting/advancements/opened_eyes.json index 908477ac..fde10466 100644 --- a/Common/src/generated/resources/data/hexcasting/advancements/opened_eyes.json +++ b/Common/src/generated/resources/data/hexcasting/advancements/opened_eyes.json @@ -4,7 +4,7 @@ "health_used": { "conditions": { "mojang_i_am_begging_and_crying_please_add_an_entity_health_criterion": { - "min": 0.1 + "min": 0.0 } }, "trigger": "hexcasting:overcast" diff --git a/Common/src/main/java/at/petrak/hexcasting/api/advancements/OvercastTrigger.java b/Common/src/main/java/at/petrak/hexcasting/api/advancements/OvercastTrigger.java index 7b5b8d74..ae972d1c 100644 --- a/Common/src/main/java/at/petrak/hexcasting/api/advancements/OvercastTrigger.java +++ b/Common/src/main/java/at/petrak/hexcasting/api/advancements/OvercastTrigger.java @@ -15,7 +15,8 @@ public class OvercastTrigger extends SimpleCriterionTrigger 0) { // Cast from HP! val mediaToHealth = HexConfig.common().mediaToHealthRate() - val healthToRemove = costLeft.toDouble() / mediaToHealth + val healthToRemove = max(costLeft.toDouble() / mediaToHealth, 0.5) val mediaAbleToCastFromHP = this.ctx.caster.health * mediaToHealth val mediaToActuallyPayFor = min(mediaAbleToCastFromHP.toInt(), costLeft) diff --git a/Common/src/main/java/at/petrak/hexcasting/datagen/HexAdvancements.java b/Common/src/main/java/at/petrak/hexcasting/datagen/HexAdvancements.java index 2b1651d3..9f220aa5 100644 --- a/Common/src/main/java/at/petrak/hexcasting/datagen/HexAdvancements.java +++ b/Common/src/main/java/at/petrak/hexcasting/datagen/HexAdvancements.java @@ -5,19 +5,15 @@ import at.petrak.hexcasting.api.advancements.FailToCastGreatSpellTrigger; import at.petrak.hexcasting.api.advancements.OvercastTrigger; import at.petrak.hexcasting.api.advancements.SpendMediaTrigger; import at.petrak.hexcasting.api.misc.MediaConstants; +import at.petrak.hexcasting.api.mod.HexItemTags; import at.petrak.hexcasting.common.items.ItemLoreFragment; import at.petrak.hexcasting.common.lib.HexBlocks; -import at.petrak.hexcasting.api.mod.HexItemTags; import at.petrak.hexcasting.common.lib.HexItems; import at.petrak.paucal.api.datagen.PaucalAdvancementProvider; import net.minecraft.advancements.Advancement; import net.minecraft.advancements.DisplayInfo; import net.minecraft.advancements.FrameType; import net.minecraft.advancements.critereon.*; -import net.minecraft.advancements.critereon.EntityPredicate; -import net.minecraft.advancements.critereon.InventoryChangeTrigger; -import net.minecraft.advancements.critereon.ItemPredicate; -import net.minecraft.advancements.critereon.MinMaxBounds; import net.minecraft.data.DataGenerator; import net.minecraft.network.chat.Component; import net.minecraft.resources.ResourceLocation; @@ -77,7 +73,7 @@ public class HexAdvancements extends PaucalAdvancementProvider { MinMaxBounds.Ints.ANY, MinMaxBounds.Doubles.ANY, // you can't just kill yourself - MinMaxBounds.Doubles.atLeast(0.1))) + MinMaxBounds.Doubles.atLeast(0.0))) .save(consumer, prefix("opened_eyes")); Advancement.Builder.advancement() @@ -90,9 +86,12 @@ public class HexAdvancements extends PaucalAdvancementProvider { .addCriterion("health_used", new OvercastTrigger.Instance(EntityPredicate.Composite.ANY, MinMaxBounds.Ints.ANY, - // add a little bit of slop here + // add a little bit of slop here. use 80% or more health ... MinMaxBounds.Doubles.atLeast(0.8), - MinMaxBounds.Doubles.between(0.1, 2.05))) + // and be left with under 1 healthpoint (half a heart) + // TODO this means if 80% of your health is less than half a heart, so if you have 2.5 hearts or + // less, you can't become enlightened. + MinMaxBounds.Doubles.between(Double.MIN_NORMAL, 1.0))) .save(consumer, prefix("enlightenment")); var loreRoot = Advancement.Builder.advancement()