diff --git a/src/generated/resources/assets/whispergrove/lang/en_us.json b/src/generated/resources/assets/whispergrove/lang/en_us.json index 9fe51c3..d2ad782 100644 --- a/src/generated/resources/assets/whispergrove/lang/en_us.json +++ b/src/generated/resources/assets/whispergrove/lang/en_us.json @@ -17,41 +17,41 @@ "cmd.whispergrove.reset.success": "Reset Value success", "cmd.whispergrove.set.failed": "Set Value failed: %s", "cmd.whispergrove.set.success": "Set Value success: %f", - "desc.whispergrove.heart_deteriorated.level.1": "Heart Deteriorated Mild", - "desc.whispergrove.heart_deteriorated.level.2": "Heart Deteriorated Moderate", - "desc.whispergrove.heart_deteriorated.level.3": "Heart Deteriorated Critical", - "desc.whispergrove.heart_hyperactivity.level.1": "Heart Hyperactivity Mild", - "desc.whispergrove.heart_hyperactivity.level.2": "Heart Hyperactivity Moderate", - "desc.whispergrove.heart_hyperactivity.level.3": "Heart Hyperactivity Critical", - "desc.whispergrove.heart_normal": "Heart Normal", - "desc.whispergrove.kidney_deteriorated.level.1": "Kidney Deteriorated Mild", - "desc.whispergrove.kidney_deteriorated.level.2": "Kidney Deteriorated Moderate", - "desc.whispergrove.kidney_deteriorated.level.3": "Kidney Deteriorated Critical", - "desc.whispergrove.kidney_hyperactivity.level.1": "Kidney Hyperactivity Mild", - "desc.whispergrove.kidney_hyperactivity.level.2": "Kidney Hyperactivity Moderate", - "desc.whispergrove.kidney_hyperactivity.level.3": "Kidney Hyperactivity Critical", - "desc.whispergrove.kidney_normal": "Kidney Normal", - "desc.whispergrove.liver_deteriorated.level.1": "Liver Deteriorated Mild", - "desc.whispergrove.liver_deteriorated.level.2": "Liver Deteriorated Moderate", - "desc.whispergrove.liver_deteriorated.level.3": "Liver Deteriorated Critical", - "desc.whispergrove.liver_hyperactivity.level.1": "Liver Hyperactivity Mild", - "desc.whispergrove.liver_hyperactivity.level.2": "Liver Hyperactivity Moderate", - "desc.whispergrove.liver_hyperactivity.level.3": "Liver Hyperactivity Critical", - "desc.whispergrove.liver_normal": "Liver Normal", - "desc.whispergrove.lung_deteriorated.level.1": "Lung Deteriorated Mild", - "desc.whispergrove.lung_deteriorated.level.2": "Lung Deteriorated Moderate", - "desc.whispergrove.lung_deteriorated.level.3": "Lung Deteriorated Critical", - "desc.whispergrove.lung_hyperactivity.level.1": "Lung Hyperactivity Mild", - "desc.whispergrove.lung_hyperactivity.level.2": "Lung Hyperactivity Moderate", - "desc.whispergrove.lung_hyperactivity.level.3": "Lung Hyperactivity Critical", - "desc.whispergrove.lung_normal": "Lung Normal", - "desc.whispergrove.spleen_deteriorated.level.1": "Spleen Deteriorated Mild", - "desc.whispergrove.spleen_deteriorated.level.2": "Spleen Deteriorated Moderate", - "desc.whispergrove.spleen_deteriorated.level.3": "Spleen Deteriorated Critical", - "desc.whispergrove.spleen_hyperactivity.level.1": "Spleen Hyperactivity Mild", - "desc.whispergrove.spleen_hyperactivity.level.2": "Spleen Hyperactivity Moderate", - "desc.whispergrove.spleen_hyperactivity.level.3": "Spleen Hyperactivity Critical", - "desc.whispergrove.spleen_normal": "Spleen Normal", + "desc.whispergrove.heart.deteriorated.level.1": "Heart Deteriorated Mild", + "desc.whispergrove.heart.deteriorated.level.2": "Heart Deteriorated Moderate", + "desc.whispergrove.heart.deteriorated.level.3": "Heart Deteriorated Critical", + "desc.whispergrove.heart.hyperactivity.level.1": "Heart Hyperactivity Mild", + "desc.whispergrove.heart.hyperactivity.level.2": "Heart Hyperactivity Moderate", + "desc.whispergrove.heart.hyperactivity.level.3": "Heart Hyperactivity Critical", + "desc.whispergrove.heart.normal": "Heart Normal", + "desc.whispergrove.kidney.deteriorated.level.1": "Kidney Deteriorated Mild", + "desc.whispergrove.kidney.deteriorated.level.2": "Kidney Deteriorated Moderate", + "desc.whispergrove.kidney.deteriorated.level.3": "Kidney Deteriorated Critical", + "desc.whispergrove.kidney.hyperactivity.level.1": "Kidney Hyperactivity Mild", + "desc.whispergrove.kidney.hyperactivity.level.2": "Kidney Hyperactivity Moderate", + "desc.whispergrove.kidney.hyperactivity.level.3": "Kidney Hyperactivity Critical", + "desc.whispergrove.kidney.normal": "Kidney Normal", + "desc.whispergrove.liver.deteriorated.level.1": "Liver Deteriorated Mild", + "desc.whispergrove.liver.deteriorated.level.2": "Liver Deteriorated Moderate", + "desc.whispergrove.liver.deteriorated.level.3": "Liver Deteriorated Critical", + "desc.whispergrove.liver.hyperactivity.level.1": "Liver Hyperactivity Mild", + "desc.whispergrove.liver.hyperactivity.level.2": "Liver Hyperactivity Moderate", + "desc.whispergrove.liver.hyperactivity.level.3": "Liver Hyperactivity Critical", + "desc.whispergrove.liver.normal": "Liver Normal", + "desc.whispergrove.lung.deteriorated.level.1": "Lung Deteriorated Mild", + "desc.whispergrove.lung.deteriorated.level.2": "Lung Deteriorated Moderate", + "desc.whispergrove.lung.deteriorated.level.3": "Lung Deteriorated Critical", + "desc.whispergrove.lung.hyperactivity.level.1": "Lung Hyperactivity Mild", + "desc.whispergrove.lung.hyperactivity.level.2": "Lung Hyperactivity Moderate", + "desc.whispergrove.lung.hyperactivity.level.3": "Lung Hyperactivity Critical", + "desc.whispergrove.lung.normal": "Lung Normal", + "desc.whispergrove.spleen.deteriorated.level.1": "Spleen Deteriorated Mild", + "desc.whispergrove.spleen.deteriorated.level.2": "Spleen Deteriorated Moderate", + "desc.whispergrove.spleen.deteriorated.level.3": "Spleen Deteriorated Critical", + "desc.whispergrove.spleen.hyperactivity.level.1": "Spleen Hyperactivity Mild", + "desc.whispergrove.spleen.hyperactivity.level.2": "Spleen Hyperactivity Moderate", + "desc.whispergrove.spleen.hyperactivity.level.3": "Spleen Hyperactivity Critical", + "desc.whispergrove.spleen.normal": "Spleen Normal", "effect.whispergrove.heart_deteriorated": "Heart Deteriorated", "effect.whispergrove.heart_hyperactivity": "Heart Hyperactivity", "effect.whispergrove.kidney_deteriorated": "Kidney Deteriorated", @@ -97,6 +97,7 @@ "item.whispergrove.soup": "Unnamed Medicinal soup", "item.whispergrove.tortoise_plastron_glue": "Tortoise Plastron Glue", "itemGroup.whispergrove": "Whisper Grove", + "menu.whispergrove.viscera_tab": "Viscera", "network.whispergrove.failed": "Failed to handle network data: %s", "tooltip.whispergrove.actinolite": "", "tooltip.whispergrove.albizia_bark": "", @@ -122,10 +123,15 @@ "tooltip.whispergrove.gentian": "", "tooltip.whispergrove.ginseng": "", "tooltip.whispergrove.gypsum_rubrum": "", + "tooltip.whispergrove.heart": "Heart ", + "tooltip.whispergrove.kidney": "Kidney ", "tooltip.whispergrove.licorice": "", + "tooltip.whispergrove.liver": "Liver ", + "tooltip.whispergrove.lung": "Lung ", "tooltip.whispergrove.malt": "", "tooltip.whispergrove.milkvetch": "", "tooltip.whispergrove.monkshood": "", + "tooltip.whispergrove.ping": "Balance %d", "tooltip.whispergrove.poria_cocos": "", "tooltip.whispergrove.pot": "", "tooltip.whispergrove.prepared_licorice": "", @@ -141,8 +147,18 @@ "tooltip.whispergrove.sliced_ginseng": "", "tooltip.whispergrove.sliced_milkvetch": "", "tooltip.whispergrove.soup": "", + "tooltip.whispergrove.spleen": "Spleen ", "tooltip.whispergrove.springing": "", "tooltip.whispergrove.tortoise_plastron_glue": "", + "tooltip.whispergrove.yang": "Warm %d", + "tooltip.whispergrove.yin": "Cold %d", + "viscera.whispergrove.heart": "Heart", + "viscera.whispergrove.hover.yang": "Yang: %d Points", + "viscera.whispergrove.hover.yin": "Yin: %d Points", + "viscera.whispergrove.kidney": "Kidney", + "viscera.whispergrove.liver": "Liver", + "viscera.whispergrove.lung": "Lung", + "viscera.whispergrove.spleen": "Spleen", "whispergrove.configuration.debug": "Debug", "whispergrove.configuration.debug.tooltip": "Set to true to enable debug info", "whispergrove.configuration.disease_critical": "Critical disease", diff --git a/src/generated/resources/assets/whispergrove/lang/zh_cn.json b/src/generated/resources/assets/whispergrove/lang/zh_cn.json index d95233d..46bc754 100644 --- a/src/generated/resources/assets/whispergrove/lang/zh_cn.json +++ b/src/generated/resources/assets/whispergrove/lang/zh_cn.json @@ -17,41 +17,41 @@ "cmd.whispergrove.reset.success": "重设值成功", "cmd.whispergrove.set.failed": "设置值失败:%s", "cmd.whispergrove.set.success": "设置值成功:%f", - "desc.whispergrove.heart_deteriorated.level.1": "心衰 轻度", - "desc.whispergrove.heart_deteriorated.level.2": "心衰 中度", - "desc.whispergrove.heart_deteriorated.level.3": "心衰 重度", - "desc.whispergrove.heart_hyperactivity.level.1": "心亢 轻度", - "desc.whispergrove.heart_hyperactivity.level.2": "心亢 中度", - "desc.whispergrove.heart_hyperactivity.level.3": "心亢 重度", - "desc.whispergrove.heart_normal": "心 正常", - "desc.whispergrove.kidney_deteriorated.level.1": "肾衰 轻度", - "desc.whispergrove.kidney_deteriorated.level.2": "肾衰 中度", - "desc.whispergrove.kidney_deteriorated.level.3": "肾衰 重度", - "desc.whispergrove.kidney_hyperactivity.level.1": "肾亢 轻度", - "desc.whispergrove.kidney_hyperactivity.level.2": "肾亢 中度", - "desc.whispergrove.kidney_hyperactivity.level.3": "肾亢 重度", - "desc.whispergrove.kidney_normal": "肾 正常", - "desc.whispergrove.liver_deteriorated.level.1": "肝衰 轻度", - "desc.whispergrove.liver_deteriorated.level.2": "肝衰 中度", - "desc.whispergrove.liver_deteriorated.level.3": "肝衰 重度", - "desc.whispergrove.liver_hyperactivity.level.1": "肝亢 轻度", - "desc.whispergrove.liver_hyperactivity.level.2": "肝亢 中度", - "desc.whispergrove.liver_hyperactivity.level.3": "肝亢 重度", - "desc.whispergrove.liver_normal": "肝 正常", - "desc.whispergrove.lung_deteriorated.level.1": "肺衰 轻度", - "desc.whispergrove.lung_deteriorated.level.2": "肺衰 中度", - "desc.whispergrove.lung_deteriorated.level.3": "肺衰 重度", - "desc.whispergrove.lung_hyperactivity.level.1": "肺亢 轻度", - "desc.whispergrove.lung_hyperactivity.level.2": "肺亢 中度", - "desc.whispergrove.lung_hyperactivity.level.3": "肺亢 重度", - "desc.whispergrove.lung_normal": "肺 正常", - "desc.whispergrove.spleen_deteriorated.level.1": "脾衰 轻度", - "desc.whispergrove.spleen_deteriorated.level.2": "脾衰 中度", - "desc.whispergrove.spleen_deteriorated.level.3": "脾衰 重度", - "desc.whispergrove.spleen_hyperactivity.level.1": "脾亢 轻度", - "desc.whispergrove.spleen_hyperactivity.level.2": "脾亢 中度", - "desc.whispergrove.spleen_hyperactivity.level.3": "脾亢 重度", - "desc.whispergrove.spleen_normal": "脾 正常", + "desc.whispergrove.heart.deteriorated.level.1": "心衰 轻度", + "desc.whispergrove.heart.deteriorated.level.2": "心衰 中度", + "desc.whispergrove.heart.deteriorated.level.3": "心衰 重度", + "desc.whispergrove.heart.hyperactivity.level.1": "心亢 轻度", + "desc.whispergrove.heart.hyperactivity.level.2": "心亢 中度", + "desc.whispergrove.heart.hyperactivity.level.3": "心亢 重度", + "desc.whispergrove.heart.normal": "心 正常", + "desc.whispergrove.kidney.deteriorated.level.1": "肾衰 轻度", + "desc.whispergrove.kidney.deteriorated.level.2": "肾衰 中度", + "desc.whispergrove.kidney.deteriorated.level.3": "肾衰 重度", + "desc.whispergrove.kidney.hyperactivity.level.1": "肾亢 轻度", + "desc.whispergrove.kidney.hyperactivity.level.2": "肾亢 中度", + "desc.whispergrove.kidney.hyperactivity.level.3": "肾亢 重度", + "desc.whispergrove.kidney.normal": "肾 正常", + "desc.whispergrove.liver.deteriorated.level.1": "肝衰 轻度", + "desc.whispergrove.liver.deteriorated.level.2": "肝衰 中度", + "desc.whispergrove.liver.deteriorated.level.3": "肝衰 重度", + "desc.whispergrove.liver.hyperactivity.level.1": "肝亢 轻度", + "desc.whispergrove.liver.hyperactivity.level.2": "肝亢 中度", + "desc.whispergrove.liver.hyperactivity.level.3": "肝亢 重度", + "desc.whispergrove.liver.normal": "肝 正常", + "desc.whispergrove.lung.deteriorated.level.1": "肺衰 轻度", + "desc.whispergrove.lung.deteriorated.level.2": "肺衰 中度", + "desc.whispergrove.lung.deteriorated.level.3": "肺衰 重度", + "desc.whispergrove.lung.hyperactivity.level.1": "肺亢 轻度", + "desc.whispergrove.lung.hyperactivity.level.2": "肺亢 中度", + "desc.whispergrove.lung.hyperactivity.level.3": "肺亢 重度", + "desc.whispergrove.lung.normal": "肺 正常", + "desc.whispergrove.spleen.deteriorated.level.1": "脾衰 轻度", + "desc.whispergrove.spleen.deteriorated.level.2": "脾衰 中度", + "desc.whispergrove.spleen.deteriorated.level.3": "脾衰 重度", + "desc.whispergrove.spleen.hyperactivity.level.1": "脾亢 轻度", + "desc.whispergrove.spleen.hyperactivity.level.2": "脾亢 中度", + "desc.whispergrove.spleen.hyperactivity.level.3": "脾亢 重度", + "desc.whispergrove.spleen.normal": "脾 正常", "effect.whispergrove.heart_deteriorated": "心衰", "effect.whispergrove.heart_hyperactivity": "心亢", "effect.whispergrove.kidney_deteriorated": "肾衰", @@ -97,6 +97,7 @@ "item.whispergrove.soup": "未命名药汤", "item.whispergrove.tortoise_plastron_glue": "龟板胶", "itemGroup.whispergrove": "浅草轻语", + "menu.whispergrove.viscera_tab": "脏腑", "neoforge.configuration.uitext.reset": "重置", "neoforge.configuration.uitext.undo": "撤销", "network.whispergrove.failed": "无法处理网络数据: %s", @@ -153,6 +154,13 @@ "tooltip.whispergrove.tortoise_plastron_glue": "", "tooltip.whispergrove.yang": "温%d", "tooltip.whispergrove.yin": "寒%d", + "viscera.whispergrove.heart": "心", + "viscera.whispergrove.hover.yang": "阳:%d点数", + "viscera.whispergrove.hover.yin": "阴:%d点数", + "viscera.whispergrove.kidney": "肾", + "viscera.whispergrove.liver": "肝", + "viscera.whispergrove.lung": "肺", + "viscera.whispergrove.spleen": "脾", "whispergrove.configuration.debug": "调试", "whispergrove.configuration.debug.tooltip": "设置为true以启用调试信息", "whispergrove.configuration.disease_critical": "重度疾病", diff --git a/src/generated/resources/assets/whispergrove/models/item/gentian_seed.json b/src/generated/resources/assets/whispergrove/models/item/gentian_seed.json deleted file mode 100644 index af3bef9..0000000 --- a/src/generated/resources/assets/whispergrove/models/item/gentian_seed.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "minecraft:item/generated", - "textures": { - "layer0": "whispergrove:item/gentian_seed" - } -} \ No newline at end of file diff --git a/src/generated/resources/assets/whispergrove/models/item/ginseng_seed.json b/src/generated/resources/assets/whispergrove/models/item/ginseng_seed.json deleted file mode 100644 index 6775dd1..0000000 --- a/src/generated/resources/assets/whispergrove/models/item/ginseng_seed.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "minecraft:item/generated", - "textures": { - "layer0": "whispergrove:item/ginseng_seed" - } -} \ No newline at end of file diff --git a/src/generated/resources/assets/whispergrove/models/item/licorice_seed.json b/src/generated/resources/assets/whispergrove/models/item/licorice_seed.json deleted file mode 100644 index 303cf98..0000000 --- a/src/generated/resources/assets/whispergrove/models/item/licorice_seed.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "minecraft:item/generated", - "textures": { - "layer0": "whispergrove:item/licorice_seed" - } -} \ No newline at end of file diff --git a/src/generated/resources/assets/whispergrove/models/item/milkvetch_seed.json b/src/generated/resources/assets/whispergrove/models/item/milkvetch_seed.json deleted file mode 100644 index 632573d..0000000 --- a/src/generated/resources/assets/whispergrove/models/item/milkvetch_seed.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "minecraft:item/generated", - "textures": { - "layer0": "whispergrove:item/milkvetch_seed" - } -} \ No newline at end of file diff --git a/src/generated/resources/assets/whispergrove/models/item/rehmannia_seed.json b/src/generated/resources/assets/whispergrove/models/item/rehmannia_seed.json deleted file mode 100644 index 8ea31ce..0000000 --- a/src/generated/resources/assets/whispergrove/models/item/rehmannia_seed.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "minecraft:item/generated", - "textures": { - "layer0": "whispergrove:item/rehmannia_seed" - } -} \ No newline at end of file diff --git a/src/generated/resources/data/minecraft/advancement/recipes/diamond.json b/src/generated/resources/data/minecraft/advancement/recipes/diamond.json deleted file mode 100644 index c1e8fb2..0000000 --- a/src/generated/resources/data/minecraft/advancement/recipes/diamond.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "parent": "minecraft:recipes/root", - "criteria": { - "has_iron_ingot": { - "conditions": { - "items": [ - { - "items": "minecraft:iron_ingot" - } - ] - }, - "trigger": "minecraft:inventory_changed" - }, - "has_the_recipe": { - "conditions": { - "recipe": "minecraft:diamond" - }, - "trigger": "minecraft:recipe_unlocked" - } - }, - "requirements": [ - [ - "has_the_recipe", - "has_iron_ingot" - ] - ], - "rewards": { - "recipes": [ - "minecraft:diamond" - ] - } -} \ No newline at end of file diff --git a/src/generated/resources/data/minecraft/recipe/diamond.json b/src/generated/resources/data/minecraft/recipe/diamond.json deleted file mode 100644 index 23cccd8..0000000 --- a/src/generated/resources/data/minecraft/recipe/diamond.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "type": "whispergrove:general_prescript_process", - "ingredient": [ - { - "item": "minecraft:iron_ingot" - }, - { - "item": "minecraft:apple" - } - ], - "ordered": false, - "processtime": 100, - "result": { - "count": 1, - "id": "minecraft:diamond" - }, - "state": { - "Name": "minecraft:dirt" - } -} \ No newline at end of file diff --git a/src/generated/resources/data/whispergrove/worldgen/configured_feature/wg_med.json b/src/generated/resources/data/whispergrove/worldgen/configured_feature/wg_med.json index 7a15e19..4fa41a2 100644 --- a/src/generated/resources/data/whispergrove/worldgen/configured_feature/wg_med.json +++ b/src/generated/resources/data/whispergrove/worldgen/configured_feature/wg_med.json @@ -11,7 +11,38 @@ "Name": "minecraft:dandelion" }, "high_chance": 0.33333334, - "high_states": [], + "high_states": [ + { + "Name": "whispergrove:rehmannia", + "Properties": { + "age": "0" + } + }, + { + "Name": "whispergrove:licorice", + "Properties": { + "age": "0" + } + }, + { + "Name": "whispergrove:milkvetch", + "Properties": { + "age": "0" + } + }, + { + "Name": "whispergrove:gentian", + "Properties": { + "age": "0" + } + }, + { + "Name": "whispergrove:ginseng", + "Properties": { + "age": "0" + } + } + ], "low_states": [ { "Name": "whispergrove:rehmannia", @@ -51,7 +82,7 @@ "firstOctave": 0 }, "scale": 0.005, - "seed": 2345, + "seed": 496156461, "threshold": -0.8 } } diff --git a/src/generated/resources/data/whispergrove/worldgen/placed_feature/wg_med.json b/src/generated/resources/data/whispergrove/worldgen/placed_feature/wg_med.json index bd8610c..6b594dd 100644 --- a/src/generated/resources/data/whispergrove/worldgen/placed_feature/wg_med.json +++ b/src/generated/resources/data/whispergrove/worldgen/placed_feature/wg_med.json @@ -12,7 +12,38 @@ "Name": "minecraft:dandelion" }, "high_chance": 0.33333334, - "high_states": [], + "high_states": [ + { + "Name": "whispergrove:rehmannia", + "Properties": { + "age": "0" + } + }, + { + "Name": "whispergrove:licorice", + "Properties": { + "age": "0" + } + }, + { + "Name": "whispergrove:milkvetch", + "Properties": { + "age": "0" + } + }, + { + "Name": "whispergrove:gentian", + "Properties": { + "age": "0" + } + }, + { + "Name": "whispergrove:ginseng", + "Properties": { + "age": "0" + } + } + ], "low_states": [ { "Name": "whispergrove:rehmannia", @@ -52,7 +83,7 @@ "firstOctave": 0 }, "scale": 0.005, - "seed": 2345, + "seed": 496156461, "threshold": -0.8 } } @@ -75,17 +106,37 @@ "placement": [ { "type": "minecraft:heightmap", - "heightmap": "MOTION_BLOCKING" + "heightmap": "WORLD_SURFACE" }, { "type": "minecraft:in_square" }, + { + "type": "minecraft:count", + "count": 1 + }, { "type": "minecraft:biome" }, + { + "type": "minecraft:surface_water_depth_filter", + "max_water_depth": 0 + }, + { + "type": "minecraft:block_predicate_filter", + "predicate": { + "type": "minecraft:would_survive", + "state": { + "Name": "minecraft:birch_sapling", + "Properties": { + "stage": "0" + } + } + } + }, { "type": "minecraft:rarity_filter", - "chance": 20 + "chance": 10 } ] } \ No newline at end of file diff --git a/src/main/java/org/hiedacamellia/whispergrove/api/viscera/VisceraHolder.java b/src/main/java/org/hiedacamellia/whispergrove/api/viscera/VisceraHolder.java index adb3378..5955199 100644 --- a/src/main/java/org/hiedacamellia/whispergrove/api/viscera/VisceraHolder.java +++ b/src/main/java/org/hiedacamellia/whispergrove/api/viscera/VisceraHolder.java @@ -61,7 +61,7 @@ public VisceraHolder updateSpleen(ItemStack itemStack){ return update(VisceraHolder.getSpleen(itemStack)); } - public VisceraHolder getHeart(Player player){ + public static VisceraHolder getHeart(Player player){ if(player.hasData(WGAttachment.HEART)){ return fromHeart(player.getData(WGAttachment.HEART)); } @@ -72,7 +72,7 @@ public static VisceraHolder getHeart(ItemStack itemStack){ return fromHeart(itemStack.getOrDefault(WGDataComponent.HEART.get(), new Heart(0.0, 0.0,0.0))); } - public VisceraHolder getKidney(Player player){ + public static VisceraHolder getKidney(Player player){ if(player.hasData(WGAttachment.KIDNEY)){ return fromKidney(player.getData(WGAttachment.KIDNEY)); } @@ -83,7 +83,7 @@ public static VisceraHolder getKidney(ItemStack itemStack){ return fromKidney(itemStack.getOrDefault(WGDataComponent.KIDNEY.get(), new Kidney(0.0, 0.0,0.0))); } - public VisceraHolder getLiver(Player player){ + public static VisceraHolder getLiver(Player player){ if(player.hasData(WGAttachment.LIVER)){ return fromLiver(player.getData(WGAttachment.LIVER)); } @@ -94,7 +94,7 @@ public static VisceraHolder getLiver(ItemStack itemStack){ return fromLiver(itemStack.getOrDefault(WGDataComponent.LIVER.get(), new Liver(0.0, 0.0,0.0))); } - public VisceraHolder getLung(Player player){ + public static VisceraHolder getLung(Player player){ if(player.hasData(WGAttachment.LUNG)){ return fromLung(player.getData(WGAttachment.LUNG)); } @@ -105,7 +105,7 @@ public static VisceraHolder getLung(ItemStack itemStack){ return fromLung(itemStack.getOrDefault(WGDataComponent.LUNG.get(), new Lung(0.0, 0.0,0.0))); } - public VisceraHolder getSpleen(Player player){ + public static VisceraHolder getSpleen(Player player){ if(player.hasData(WGAttachment.SPLEEN)){ return fromSpleen(player.getData(WGAttachment.SPLEEN)); } diff --git a/src/main/java/org/hiedacamellia/whispergrove/content/viscera/HeartEvent.java b/src/main/java/org/hiedacamellia/whispergrove/content/viscera/HeartEvent.java index ac97a92..979c4f2 100644 --- a/src/main/java/org/hiedacamellia/whispergrove/content/viscera/HeartEvent.java +++ b/src/main/java/org/hiedacamellia/whispergrove/content/viscera/HeartEvent.java @@ -16,6 +16,8 @@ import org.hiedacamellia.whispergrove.registers.WGAttachment; import org.hiedacamellia.whispergrove.registers.WGEffect; +import java.util.ArrayList; +import java.util.List; import java.util.Objects; public class HeartEvent { @@ -60,29 +62,43 @@ public static void Check(Player player) { } } - public String getdesc(Player player) { + public static Component getdesc(Player player) { if (!player.hasData(WGAttachment.HEART)) { - return ""; + return Component.empty(); } Heart heart = player.getData(WGAttachment.HEART); - double diff = heart.yang() - heart.yin(); - if (diff >= 60.0) { + double diff = heart.yang() / heart.yin(); + if (diff >= CommonConfig.DISEASE_MODERATE.get()) { - return Component.translatable("desc.whispergrove.heart.hyperactivity.level.2").getString(); + return Component.translatable("desc.whispergrove.heart.hyperactivity.level.2"); } - if (diff >= 30.0) { + if (diff >= CommonConfig.DISEASE_MILD.get()) { - return Component.translatable("desc.whispergrove.heart.hyperactivity.level.1").getString(); + return Component.translatable("desc.whispergrove.heart.hyperactivity.level.1"); } - if (diff <= -60.0) { + if (diff <= 1/ CommonConfig.DISEASE_MODERATE.get()) { - return Component.translatable("desc.whispergrove.heart.deteriorated.level.2").getString(); + return Component.translatable("desc.whispergrove.heart.deteriorated.level.2"); } - if (diff <= -30.0) { + if (diff <= 1/ CommonConfig.DISEASE_MILD.get()) { - return Component.translatable("desc.whispergrove.heart.deteriorated.level.1").getString(); + return Component.translatable("desc.whispergrove.heart.deteriorated.level.1"); } - return Component.translatable("desc.whispergrove.heart.normal").getString(); + return Component.translatable("desc.whispergrove.heart.normal"); + } + + public static List getHover(Player player) { + if (!player.hasData(WGAttachment.HEART)) { + return List.of(); + } + Heart heart = player.getData(WGAttachment.HEART); + + List raw = new ArrayList<>(); + + raw.add(Component.translatable("viscera.whispergrove.hover.yin", heart.yin())); + raw.add(Component.translatable("viscera.whispergrove.hover.yang", heart.yang())); + + return raw; } } diff --git a/src/main/java/org/hiedacamellia/whispergrove/content/viscera/KidneyEvent.java b/src/main/java/org/hiedacamellia/whispergrove/content/viscera/KidneyEvent.java index 703842e..c9c809e 100644 --- a/src/main/java/org/hiedacamellia/whispergrove/content/viscera/KidneyEvent.java +++ b/src/main/java/org/hiedacamellia/whispergrove/content/viscera/KidneyEvent.java @@ -12,6 +12,8 @@ import org.hiedacamellia.whispergrove.registers.WGAttachment; import org.hiedacamellia.whispergrove.registers.WGEffect; +import java.util.ArrayList; +import java.util.List; import java.util.Objects; public class KidneyEvent { @@ -58,29 +60,42 @@ public static void Check(Player player) { } } - public String getdesc(Player player) { + public static Component getdesc(Player player) { if (!player.hasData(WGAttachment.KIDNEY)) { - return ""; + return Component.empty(); } Kidney kidney = player.getData(WGAttachment.KIDNEY); - double diff = kidney.yang() - kidney.yin(); - if (diff >= 60.0) { + double diff = kidney.yang() / kidney.yin(); + if (diff >= CommonConfig.DISEASE_MODERATE.get()) { + + return Component.translatable("desc.whispergrove.kidney.hyperactivity.level.2"); + } + if (diff >= CommonConfig.DISEASE_MILD.get()) { - return Component.translatable("desc.whispergrove.kidney.hyperactivity.level.2").getString(); + return Component.translatable("desc.whispergrove.kidney.hyperactivity.level.1"); } - if (diff >= 30.0) { + if (diff <= 1/ CommonConfig.DISEASE_MODERATE.get()) { - return Component.translatable("desc.whispergrove.kidney.hyperactivity.level.1").getString(); + return Component.translatable("desc.whispergrove.kidney.deteriorated.level.2"); } - if (diff <= -60.0) { + if (diff <= 1/ CommonConfig.DISEASE_MILD.get()) { - return Component.translatable("desc.whispergrove.kidney.deteriorated.level.2").getString(); + return Component.translatable("desc.whispergrove.kidney.deteriorated.level.1"); } - if (diff <= -30.0) { - return Component.translatable("desc.whispergrove.kidney.deteriorated.level.1").getString(); + return Component.translatable("desc.whispergrove.kidney.normal"); + } + public static List getHover(Player player) { + if (!player.hasData(WGAttachment.KIDNEY)) { + return List.of(); } + Kidney kidney = player.getData(WGAttachment.KIDNEY); + + List raw = new ArrayList<>(); + + raw.add(Component.translatable("viscera.whispergrove.hover.yin", kidney.yin())); + raw.add(Component.translatable("viscera.whispergrove.hover.yang", kidney.yang())); - return Component.translatable("desc.whispergrove.kidney.normal").getString(); + return raw; } } diff --git a/src/main/java/org/hiedacamellia/whispergrove/content/viscera/LiverEvent.java b/src/main/java/org/hiedacamellia/whispergrove/content/viscera/LiverEvent.java index ee8e221..c9c35f7 100644 --- a/src/main/java/org/hiedacamellia/whispergrove/content/viscera/LiverEvent.java +++ b/src/main/java/org/hiedacamellia/whispergrove/content/viscera/LiverEvent.java @@ -22,6 +22,8 @@ import org.hiedacamellia.whispergrove.registers.WGAttachment; import org.hiedacamellia.whispergrove.registers.WGEffect; +import java.util.ArrayList; +import java.util.List; import java.util.Objects; @EventBusSubscriber(modid = WhisperGrove.MODID) @@ -85,29 +87,42 @@ public static void onPlayerDamage(LivingDamageEvent.Pre event) { } } - public String getdesc(Player player) { + public static Component getdesc(Player player) { if (!player.hasData(WGAttachment.LIVER)) { - return ""; + return Component.empty(); } Liver liver = player.getData(WGAttachment.LIVER); - double diff = liver.yang() - liver.yin(); - if (diff >= 60.0) { + double diff = liver.yang() / liver.yin(); + if (diff >= CommonConfig.DISEASE_MODERATE.get()) { + + return Component.translatable("desc.whispergrove.liver.hyperactivity.level.2"); + } + if (diff >= CommonConfig.DISEASE_MILD.get()) { - return Component.translatable("desc.whispergrove.liver.hyperactivity.level.2").getString(); + return Component.translatable("desc.whispergrove.liver.hyperactivity.level.1"); } - if (diff >= 30.0) { + if (diff <= 1/ CommonConfig.DISEASE_MODERATE.get()) { - return Component.translatable("desc.whispergrove.liver.hyperactivity.level.1").getString(); + return Component.translatable("desc.whispergrove.liver.deteriorated.level.2"); } - if (diff <= -60.0) { + if (diff <= 1/ CommonConfig.DISEASE_MILD.get()) { - return Component.translatable("desc.whispergrove.liver.deteriorated.level.2").getString(); + return Component.translatable("desc.whispergrove.liver.deteriorated.level.1"); } - if (diff <= -30.0) { - return Component.translatable("desc.whispergrove.liver.deteriorated.level.1").getString(); + return Component.translatable("desc.whispergrove.liver.normal"); + } + public static List getHover(Player player) { + if (!player.hasData(WGAttachment.LIVER)) { + return List.of(); } + Liver liver = player.getData(WGAttachment.LIVER); + + List raw = new ArrayList<>(); + + raw.add(Component.translatable("viscera.whispergrove.hover.yin", liver.yin())); + raw.add(Component.translatable("viscera.whispergrove.hover.yang", liver.yang())); - return Component.translatable("desc.whispergrove.liver.normal").getString(); + return raw; } } diff --git a/src/main/java/org/hiedacamellia/whispergrove/content/viscera/LungEvent.java b/src/main/java/org/hiedacamellia/whispergrove/content/viscera/LungEvent.java index 311d17d..5acce8f 100644 --- a/src/main/java/org/hiedacamellia/whispergrove/content/viscera/LungEvent.java +++ b/src/main/java/org/hiedacamellia/whispergrove/content/viscera/LungEvent.java @@ -11,11 +11,14 @@ import net.neoforged.fml.common.EventBusSubscriber; import net.neoforged.neoforge.event.entity.living.LivingHealEvent; import org.hiedacamellia.whispergrove.WhisperGrove; +import org.hiedacamellia.whispergrove.core.codec.record.Heart; import org.hiedacamellia.whispergrove.core.config.CommonConfig; import org.hiedacamellia.whispergrove.core.codec.record.Lung; import org.hiedacamellia.whispergrove.registers.WGAttachment; import org.hiedacamellia.whispergrove.registers.WGEffect; +import java.util.ArrayList; +import java.util.List; import java.util.Objects; @EventBusSubscriber(modid = WhisperGrove.MODID) @@ -72,29 +75,42 @@ public static void onPlayerHeal(LivingHealEvent event) { } } - public String getdesc(Player player) { + public static Component getdesc(Player player) { if (!player.hasData(WGAttachment.LUNG)) { - return ""; + return Component.empty(); } Lung lung = player.getData(WGAttachment.LUNG); - double diff = lung.yang() - lung.yin(); - if (diff >= 60.0) { + double diff = lung.yang() / lung.yin(); + if (diff >= CommonConfig.DISEASE_MODERATE.get()) { + + return Component.translatable("desc.whispergrove.lung.hyperactivity.level.2"); + } + if (diff >= CommonConfig.DISEASE_MILD.get()) { - return Component.translatable("desc.whispergrove.lung.hyperactivity.level.2").getString(); + return Component.translatable("desc.whispergrove.lung.hyperactivity.level.1"); } - if (diff >= 30.0) { + if (diff <= 1/ CommonConfig.DISEASE_MODERATE.get()) { - return Component.translatable("desc.whispergrove.lung.hyperactivity.level.1").getString(); + return Component.translatable("desc.whispergrove.lung.deteriorated.level.2"); } - if (diff <= -60.0) { + if (diff <= 1/ CommonConfig.DISEASE_MILD.get()) { - return Component.translatable("desc.whispergrove.lung.deteriorated.level.2").getString(); + return Component.translatable("desc.whispergrove.lung.deteriorated.level.1"); } - if (diff <= -30.0) { - return Component.translatable("desc.whispergrove.lung.deteriorated.level.1").getString(); + return Component.translatable("desc.whispergrove.lung.normal"); + } + public static List getHover(Player player) { + if (!player.hasData(WGAttachment.LUNG)) { + return List.of(); } + Lung lung = player.getData(WGAttachment.LUNG); + + List raw = new ArrayList<>(); + + raw.add(Component.translatable("viscera.whispergrove.hover.yin", lung.yin())); + raw.add(Component.translatable("viscera.whispergrove.hover.yang", lung.yang())); - return Component.translatable("desc.whispergrove.lung.normal").getString(); + return raw; } } diff --git a/src/main/java/org/hiedacamellia/whispergrove/content/viscera/SpleenEvent.java b/src/main/java/org/hiedacamellia/whispergrove/content/viscera/SpleenEvent.java index 4575ef2..45564fe 100644 --- a/src/main/java/org/hiedacamellia/whispergrove/content/viscera/SpleenEvent.java +++ b/src/main/java/org/hiedacamellia/whispergrove/content/viscera/SpleenEvent.java @@ -17,6 +17,8 @@ import org.hiedacamellia.whispergrove.registers.WGAttachment; import org.hiedacamellia.whispergrove.registers.WGEffect; +import java.util.ArrayList; +import java.util.List; import java.util.Objects; public class SpleenEvent { @@ -62,29 +64,41 @@ public static void Check(Player player) { } } - public String getdesc(Player player) { + public static Component getdesc(Player player) { if (!player.hasData(WGAttachment.SPLEEN)) { - return ""; + return Component.empty(); } Spleen spleen = player.getData(WGAttachment.SPLEEN); - double diff = spleen.yang() - spleen.yin(); - if (diff >= 60.0) { + double diff = spleen.yang() / spleen.yin(); + if (diff >= CommonConfig.DISEASE_MODERATE.get()) { - return Component.translatable("desc.whispergrove.spleen.hyperactivity.level.2").getString(); + return Component.translatable("desc.whispergrove.spleen.hyperactivity.level.2"); } - if (diff >= 30.0) { + if (diff >= CommonConfig.DISEASE_MILD.get()) { - return Component.translatable("desc.whispergrove.spleen.hyperactivity.level.1").getString(); + return Component.translatable("desc.whispergrove.spleen.hyperactivity.level.1"); } - if (diff <= -60.0) { + if (diff <= 1/ CommonConfig.DISEASE_MODERATE.get()) { - return Component.translatable("desc.whispergrove.spleen.deteriorated.level.2").getString(); + return Component.translatable("desc.whispergrove.spleen.deteriorated.level.2"); } - if (diff <= -30.0) { + if (diff <= 1/ CommonConfig.DISEASE_MILD.get()) { - return Component.translatable("desc.whispergrove.spleen.deteriorated.level.1").getString(); + return Component.translatable("desc.whispergrove.spleen.deteriorated.level.1"); } - return Component.translatable("desc.whispergrove.spleen.normal").getString(); + return Component.translatable("desc.whispergrove.spleen.normal"); + } + public static List getHover(Player player) { + if (!player.hasData(WGAttachment.SPLEEN)) { + return List.of(); + } + Spleen spleen = player.getData(WGAttachment.SPLEEN); + List raw = new ArrayList<>(); + + raw.add(Component.translatable("viscera.whispergrove.hover.yin", spleen.yin())); + raw.add(Component.translatable("viscera.whispergrove.hover.yang", spleen.yang())); + + return raw; } } diff --git a/src/main/java/org/hiedacamellia/whispergrove/core/codec/record/Heart.java b/src/main/java/org/hiedacamellia/whispergrove/core/codec/record/Heart.java index cf666a7..5a63a0d 100644 --- a/src/main/java/org/hiedacamellia/whispergrove/core/codec/record/Heart.java +++ b/src/main/java/org/hiedacamellia/whispergrove/core/codec/record/Heart.java @@ -22,6 +22,12 @@ public void sync(Player player){ PacketDistributor.sendToPlayer(serverPlayer, new Heart(this.yin, this.yang, this.ping)); } + public static final StreamCodec STREAM_CODEC = StreamCodec.composite( + ByteBufCodecs.DOUBLE, Heart::yin, + ByteBufCodecs.DOUBLE, Heart::yang, + ByteBufCodecs.DOUBLE, Heart::ping, + Heart::new); + public static final CustomPacketPayload.Type TYPE = new CustomPacketPayload.Type<>(ResourceLocation.fromNamespaceAndPath(WhisperGrove.MODID, "heart")); @Override diff --git a/src/main/java/org/hiedacamellia/whispergrove/core/codec/record/Kidney.java b/src/main/java/org/hiedacamellia/whispergrove/core/codec/record/Kidney.java index 5fc4c1d..06d7f0c 100644 --- a/src/main/java/org/hiedacamellia/whispergrove/core/codec/record/Kidney.java +++ b/src/main/java/org/hiedacamellia/whispergrove/core/codec/record/Kidney.java @@ -20,6 +20,11 @@ public void sync(Player player){ if (player instanceof ServerPlayer serverPlayer) PacketDistributor.sendToPlayer(serverPlayer, new Kidney(this.yin, this.yang, this.ping)); } + public static final StreamCodec STREAM_CODEC = StreamCodec.composite( + ByteBufCodecs.DOUBLE, Kidney::yin, + ByteBufCodecs.DOUBLE, Kidney::yang, + ByteBufCodecs.DOUBLE, Kidney::ping, + Kidney::new); public static final CustomPacketPayload.Type TYPE = new CustomPacketPayload.Type<>(ResourceLocation.fromNamespaceAndPath(WhisperGrove.MODID, "kidney")); diff --git a/src/main/java/org/hiedacamellia/whispergrove/core/codec/record/Liver.java b/src/main/java/org/hiedacamellia/whispergrove/core/codec/record/Liver.java index 94576ce..04b23f4 100644 --- a/src/main/java/org/hiedacamellia/whispergrove/core/codec/record/Liver.java +++ b/src/main/java/org/hiedacamellia/whispergrove/core/codec/record/Liver.java @@ -20,6 +20,11 @@ public void sync(Player player){ if (player instanceof ServerPlayer serverPlayer) PacketDistributor.sendToPlayer(serverPlayer, new Liver(this.yin, this.yang, this.ping)); } + public static final StreamCodec STREAM_CODEC = StreamCodec.composite( + ByteBufCodecs.DOUBLE, Liver::yin, + ByteBufCodecs.DOUBLE, Liver::yang, + ByteBufCodecs.DOUBLE, Liver::ping, + Liver::new); public static final CustomPacketPayload.Type TYPE = new CustomPacketPayload.Type<>(ResourceLocation.fromNamespaceAndPath(WhisperGrove.MODID, "liver")); diff --git a/src/main/java/org/hiedacamellia/whispergrove/core/codec/record/Lung.java b/src/main/java/org/hiedacamellia/whispergrove/core/codec/record/Lung.java index 43ab4c8..78653b8 100644 --- a/src/main/java/org/hiedacamellia/whispergrove/core/codec/record/Lung.java +++ b/src/main/java/org/hiedacamellia/whispergrove/core/codec/record/Lung.java @@ -20,6 +20,11 @@ public void sync(Player player){ if (player instanceof ServerPlayer serverPlayer) PacketDistributor.sendToPlayer(serverPlayer, new Lung(this.yin, this.yang, this.ping)); } + public static final StreamCodec STREAM_CODEC = StreamCodec.composite( + ByteBufCodecs.DOUBLE, Lung::yin, + ByteBufCodecs.DOUBLE, Lung::yang, + ByteBufCodecs.DOUBLE, Lung::ping, + Lung::new); public static final CustomPacketPayload.Type TYPE = new CustomPacketPayload.Type<>(ResourceLocation.fromNamespaceAndPath(WhisperGrove.MODID, "lung")); diff --git a/src/main/java/org/hiedacamellia/whispergrove/core/codec/record/Spleen.java b/src/main/java/org/hiedacamellia/whispergrove/core/codec/record/Spleen.java index c7b6742..2969034 100644 --- a/src/main/java/org/hiedacamellia/whispergrove/core/codec/record/Spleen.java +++ b/src/main/java/org/hiedacamellia/whispergrove/core/codec/record/Spleen.java @@ -20,6 +20,11 @@ public void sync(Player player){ if (player instanceof ServerPlayer serverPlayer) PacketDistributor.sendToPlayer(serverPlayer, new Spleen(this.yin, this.yang, this.ping)); } + public static final StreamCodec STREAM_CODEC = StreamCodec.composite( + ByteBufCodecs.DOUBLE, Spleen::yin, + ByteBufCodecs.DOUBLE, Spleen::yang, + ByteBufCodecs.DOUBLE, Spleen::ping, + Spleen::new); public static final CustomPacketPayload.Type TYPE = new CustomPacketPayload.Type<>(ResourceLocation.fromNamespaceAndPath(WhisperGrove.MODID, "spleen")); diff --git a/src/main/java/org/hiedacamellia/whispergrove/core/data/lang/ChineseLanguageProvider.java b/src/main/java/org/hiedacamellia/whispergrove/core/data/lang/ChineseLanguageProvider.java index bbaceaf..c75b2ec 100644 --- a/src/main/java/org/hiedacamellia/whispergrove/core/data/lang/ChineseLanguageProvider.java +++ b/src/main/java/org/hiedacamellia/whispergrove/core/data/lang/ChineseLanguageProvider.java @@ -19,6 +19,7 @@ public ChineseLanguageProvider(PackOutput output) { protected void addTranslations() { add("tooltip.whispergrove.press_shift","按住Shift键以显示更多信息"); add("itemGroup.whispergrove", "浅草轻语"); + add("menu.whispergrove.viscera_tab","脏腑"); add("network.whispergrove.failed","无法处理网络数据: %s"); add("cmd.whispergrove.modify.success","修改值成功:%f"); add("cmd.whispergrove.modify.failed","修改值失败:%s"); @@ -163,5 +164,7 @@ protected void addTranslations() { add("tooltip.whispergrove.yin","寒%d"); add("tooltip.whispergrove.yang","温%d"); add("tooltip.whispergrove.ping","平%d"); + add("viscera.whispergrove.hover.yin","阴:%d点数"); + add("viscera.whispergrove.hover.yang","阳:%d点数"); } } diff --git a/src/main/java/org/hiedacamellia/whispergrove/core/data/lang/EnglishLanguageProvider.java b/src/main/java/org/hiedacamellia/whispergrove/core/data/lang/EnglishLanguageProvider.java index 0f73864..fd2a834 100644 --- a/src/main/java/org/hiedacamellia/whispergrove/core/data/lang/EnglishLanguageProvider.java +++ b/src/main/java/org/hiedacamellia/whispergrove/core/data/lang/EnglishLanguageProvider.java @@ -19,6 +19,7 @@ public EnglishLanguageProvider(PackOutput output) { protected void addTranslations() { add("tooltip.whispergrove.press_shift","Press Shift to display more information"); add("itemGroup.whispergrove", "Whisper Grove"); + add("menu.whispergrove.viscera_tab","Viscera"); add("network.whispergrove.failed","Failed to handle network data: %s"); add("cmd.whispergrove.modify.success","Modify Value success: %f"); add("cmd.whispergrove.modify.failed","Modify Value failed: %s"); @@ -149,5 +150,16 @@ protected void addTranslations() { add("whispergrove.configuration.ecliptic_compact.tooltip", "Set to true to enable the compact of the Ecliptic"); add("whispergrove.configuration.section.whispergrove.common.toml", "Common Config"); add("whispergrove.configuration.section.whispergrove.common.toml.title", "Whisper Grove Common Config"); + + add("tooltip.whispergrove.heart","Heart "); + add("tooltip.whispergrove.liver","Liver "); + add("tooltip.whispergrove.lung","Lung "); + add("tooltip.whispergrove.kidney","Kidney "); + add("tooltip.whispergrove.spleen","Spleen "); + add("tooltip.whispergrove.yin","Cold %d"); + add("tooltip.whispergrove.yang","Warm %d"); + add("tooltip.whispergrove.ping","Balance %d"); + add("viscera.whispergrove.hover.yin","Yin: %d Points"); + add("viscera.whispergrove.hover.yang","Yang: %d Points"); } } diff --git a/src/main/java/org/hiedacamellia/whispergrove/core/data/lang/gen/DescGen.java b/src/main/java/org/hiedacamellia/whispergrove/core/data/lang/gen/DescGen.java index cd9e799..0c90d33 100644 --- a/src/main/java/org/hiedacamellia/whispergrove/core/data/lang/gen/DescGen.java +++ b/src/main/java/org/hiedacamellia/whispergrove/core/data/lang/gen/DescGen.java @@ -33,6 +33,7 @@ public Map gendesc_en() { } } values.add(vis + " " + normal_desc_en); + values.add(vis); } for (int i = 0; i < keys.size(); i++) { desc.put(keys.get(i), values.get(i)); @@ -52,6 +53,7 @@ public Map gendesc_zh() { } } values.add(vis + " " + normal_desc_zh); + values.add(vis); } for (int i = 0; i < keys.size(); i++) { desc.put(keys.get(i), values.get(i)); @@ -65,10 +67,11 @@ private List genkeys(){ for (String vis : viscera) { for (String dis : diseases) { for (int level : levels) { - keys.add("desc.whispergrove." + vis + "_" + dis + ".level." + level); + keys.add("desc.whispergrove." + vis + "." + dis + ".level." + level); } } - keys.add("desc.whispergrove." + vis + "_normal"); + keys.add("desc.whispergrove." + vis + ".normal"); + keys.add("viscera.whispergrove." + vis); } return keys; } diff --git a/src/main/java/org/hiedacamellia/whispergrove/core/event/WGModBusEvent.java b/src/main/java/org/hiedacamellia/whispergrove/core/event/WGModBusEvent.java index bcba9c8..01cd48a 100644 --- a/src/main/java/org/hiedacamellia/whispergrove/core/event/WGModBusEvent.java +++ b/src/main/java/org/hiedacamellia/whispergrove/core/event/WGModBusEvent.java @@ -6,6 +6,7 @@ import net.neoforged.neoforge.network.handling.DirectionalPayloadHandler; import net.neoforged.neoforge.network.registration.PayloadRegistrar; import org.hiedacamellia.whispergrove.WhisperGrove; +import org.hiedacamellia.whispergrove.core.codec.record.*; import org.hiedacamellia.whispergrove.core.network.PlayerMenuC2SPacket; import org.hiedacamellia.whispergrove.core.network.PlayerMenuS2SPacket; import org.hiedacamellia.whispergrove.core.network.PlayerVisceraS2CPacket; @@ -27,6 +28,26 @@ public static void register(final RegisterPayloadHandlersEvent event) { PlayerMenuS2SPacket.STREAM_CODEC, PlayerMenuS2SPacket::handleData ); + registrar.playToClient(Heart.TYPE, + Heart.STREAM_CODEC, + Heart::handleData + ); + registrar.playToClient(Kidney.TYPE, + Kidney.STREAM_CODEC, + Kidney::handleData + ); + registrar.playToClient(Lung.TYPE, + Lung.STREAM_CODEC, + Lung::handleData + ); + registrar.playToClient(Liver.TYPE, + Liver.STREAM_CODEC, + Liver::handleData + ); + registrar.playToClient(Spleen.TYPE, + Spleen.STREAM_CODEC, + Spleen::handleData + ); } } \ No newline at end of file diff --git a/src/main/java/org/hiedacamellia/whispergrove/core/event/WGPlayerEvent.java b/src/main/java/org/hiedacamellia/whispergrove/core/event/WGPlayerEvent.java index 63851dc..21d948f 100644 --- a/src/main/java/org/hiedacamellia/whispergrove/core/event/WGPlayerEvent.java +++ b/src/main/java/org/hiedacamellia/whispergrove/core/event/WGPlayerEvent.java @@ -1,5 +1,6 @@ package org.hiedacamellia.whispergrove.core.event; +import net.minecraft.server.level.ServerPlayer; import net.minecraft.world.entity.LivingEntity; import net.minecraft.world.entity.player.Player; import net.neoforged.bus.api.SubscribeEvent; @@ -9,6 +10,7 @@ import net.neoforged.neoforge.event.entity.living.LivingHealEvent; import net.neoforged.neoforge.event.entity.player.PlayerEvent; import net.neoforged.neoforge.event.tick.PlayerTickEvent; +import net.neoforged.neoforge.network.PacketDistributor; import org.hiedacamellia.whispergrove.WhisperGrove; import org.hiedacamellia.whispergrove.content.viscera.*; import org.hiedacamellia.whispergrove.core.codec.record.*; @@ -77,6 +79,20 @@ public static void onPlayerLoggedIn(PlayerEvent.PlayerLoggedInEvent event) { if (!event.getEntity().hasData(WGAttachment.REFRESH)) { event.getEntity().setData(WGAttachment.REFRESH, new Refresh(0)); } + + if(event.getEntity() instanceof ServerPlayer player){ + Heart heart = player.getData(WGAttachment.HEART); + Kidney kidney = player.getData(WGAttachment.KIDNEY); + Lung lung = player.getData(WGAttachment.LUNG); + Liver liver = player.getData(WGAttachment.LIVER); + Spleen spleen = player.getData(WGAttachment.SPLEEN); + heart.sync(player); + kidney.sync(player); + lung.sync(player); + liver.sync(player); + spleen.sync(player); + } + } @SubscribeEvent