diff --git a/common/src/generated/resources/.cache/34eff76d8db6df414572b0996d464f3a4bc943ee b/common/src/generated/resources/.cache/34eff76d8db6df414572b0996d464f3a4bc943ee deleted file mode 100644 index 5b155283..00000000 --- a/common/src/generated/resources/.cache/34eff76d8db6df414572b0996d464f3a4bc943ee +++ /dev/null @@ -1,22 +0,0 @@ -// 1.21.3 2024-10-29T11:57:32.3272904 Item Models: sereneseasons -8131cb872e089e4f0ac2bccf3d4d7a25d7d92ec7 assets/sereneseasons/models/item/calendar.json -cb387a39c39a0f4665c565e7218cd4426875246a assets/sereneseasons/models/item/calendar_00.json -c154671ec34c7931bc05c47db4f69f21a5e413c7 assets/sereneseasons/models/item/calendar_01.json -01c1acf59f2e7d7b8319592777b1f2218c208f78 assets/sereneseasons/models/item/calendar_02.json -d44c9ac4201a4a952696ecccd594fc9689de3576 assets/sereneseasons/models/item/calendar_03.json -cc3782ec8e516147656f4045139440b5ccadf0b6 assets/sereneseasons/models/item/calendar_04.json -55827705e48251633ddf7345549e9e3cfc9a7fc9 assets/sereneseasons/models/item/calendar_05.json -93c14f266f904cc70eede0f028efaf976f348c41 assets/sereneseasons/models/item/calendar_06.json -ef42e0689c450893ae9666734d540a12d22974cc assets/sereneseasons/models/item/calendar_07.json -01b281a50b438eb9899a38bb22fbe4a07d524a77 assets/sereneseasons/models/item/calendar_08.json -b48f883f9a867921ce1cf1d738c929dbf4fa811a assets/sereneseasons/models/item/calendar_09.json -cfce93d8a9e0dccea5e123e0a0fd61830ef92024 assets/sereneseasons/models/item/calendar_10.json -f752ad7cd8c2af7907da019e39596dada37fcd0d assets/sereneseasons/models/item/calendar_11.json -4f091f7f06f8789e698f1298b02436a9063cee2f assets/sereneseasons/models/item/calendar_null.json -c4e806108e523f09f34968a76f3cdd9c6f985a22 assets/sereneseasons/models/item/ss_icon.json -ddfc3c7333675fd86b4c43d98957dba35286d21c assets/sereneseasons/models/item/tropical_calendar_00.json -2ab5c214a2af0899a6d7d6a8c8796ee70e5bb51e assets/sereneseasons/models/item/tropical_calendar_01.json -5a3146b60ec2bcf9721ed8c6335a1452003e5e6f assets/sereneseasons/models/item/tropical_calendar_02.json -26179b4c671d541f6c132207f0d4f05ba4e0ebea assets/sereneseasons/models/item/tropical_calendar_03.json -af77ba9b80f14188dc6369b08d3b1e748ac18969 assets/sereneseasons/models/item/tropical_calendar_04.json -02753018faf93099950323611f38635a77077719 assets/sereneseasons/models/item/tropical_calendar_05.json diff --git a/common/src/generated/resources/.cache/51dc2b66606c1345aa908ef96784ba8686abe32c b/common/src/generated/resources/.cache/51dc2b66606c1345aa908ef96784ba8686abe32c deleted file mode 100644 index 745c7dc8..00000000 --- a/common/src/generated/resources/.cache/51dc2b66606c1345aa908ef96784ba8686abe32c +++ /dev/null @@ -1,7 +0,0 @@ -// 1.21.3 2024-10-29T11:57:32.3262892 Block States: sereneseasons -edf060403d4f871caf88b27e91d713ee2be4ebc1 assets/sereneseasons/blockstates/season_sensor.json -2797b7f59442c019e778d4e72e49c819153d75b3 assets/sereneseasons/models/block/season_sensor_autumn.json -607600cb666bf37bc704c834d7d0ffc585b405d0 assets/sereneseasons/models/block/season_sensor_spring.json -7ed498c84b8810c377d83886277d13204d936b5a assets/sereneseasons/models/block/season_sensor_summer.json -7013d7e0506d4d1f4bde717ae5fbb71bd269ee86 assets/sereneseasons/models/block/season_sensor_winter.json -bf0c1df529d4858c45155785e5197da636dbaf3a assets/sereneseasons/models/item/season_sensor.json diff --git a/common/src/generated/resources/.cache/77038cb024c5999ce280bcb6800e72cf1c655fe7 b/common/src/generated/resources/.cache/77038cb024c5999ce280bcb6800e72cf1c655fe7 new file mode 100644 index 00000000..a9c994af --- /dev/null +++ b/common/src/generated/resources/.cache/77038cb024c5999ce280bcb6800e72cf1c655fe7 @@ -0,0 +1,29 @@ +// 1.21.4 2024-12-13T16:44:54.3891147 Model Definitions +2ea45e64e9e34075391dc30304fed3123150b8ef assets/sereneseasons/blockstates/season_sensor.json +5fd5aa241920a07c37d4df886850192229270ada assets/sereneseasons/items/calendar.json +099047045d7653877027bfca4a3175d4a0adb968 assets/sereneseasons/items/season_sensor.json +eea0ea9e0c24e02a67f6f5192a3b06e118c40585 assets/sereneseasons/items/ss_icon.json +607600cb666bf37bc704c834d7d0ffc585b405d0 assets/sereneseasons/models/block/season_sensor.json +2797b7f59442c019e778d4e72e49c819153d75b3 assets/sereneseasons/models/block/season_sensor_autumn.json +7ed498c84b8810c377d83886277d13204d936b5a assets/sereneseasons/models/block/season_sensor_summer.json +7013d7e0506d4d1f4bde717ae5fbb71bd269ee86 assets/sereneseasons/models/block/season_sensor_winter.json +cb387a39c39a0f4665c565e7218cd4426875246a assets/sereneseasons/models/item/calendar_00.json +c154671ec34c7931bc05c47db4f69f21a5e413c7 assets/sereneseasons/models/item/calendar_01.json +01c1acf59f2e7d7b8319592777b1f2218c208f78 assets/sereneseasons/models/item/calendar_02.json +d44c9ac4201a4a952696ecccd594fc9689de3576 assets/sereneseasons/models/item/calendar_03.json +cc3782ec8e516147656f4045139440b5ccadf0b6 assets/sereneseasons/models/item/calendar_04.json +55827705e48251633ddf7345549e9e3cfc9a7fc9 assets/sereneseasons/models/item/calendar_05.json +93c14f266f904cc70eede0f028efaf976f348c41 assets/sereneseasons/models/item/calendar_06.json +ef42e0689c450893ae9666734d540a12d22974cc assets/sereneseasons/models/item/calendar_07.json +01b281a50b438eb9899a38bb22fbe4a07d524a77 assets/sereneseasons/models/item/calendar_08.json +b48f883f9a867921ce1cf1d738c929dbf4fa811a assets/sereneseasons/models/item/calendar_09.json +cfce93d8a9e0dccea5e123e0a0fd61830ef92024 assets/sereneseasons/models/item/calendar_10.json +f752ad7cd8c2af7907da019e39596dada37fcd0d assets/sereneseasons/models/item/calendar_11.json +4f091f7f06f8789e698f1298b02436a9063cee2f assets/sereneseasons/models/item/calendar_null.json +a2497c6b45c5f4c1d63d25bbc39d97b586062c53 assets/sereneseasons/models/item/calendar_tropical_00.json +6eb80c9a6831badc1ba847e866c1092df7e7aaf9 assets/sereneseasons/models/item/calendar_tropical_01.json +8b518f9123cc741a690af3a729d1e4348278529d assets/sereneseasons/models/item/calendar_tropical_02.json +b36f2b2372a0985419e0659656089466b8e963a3 assets/sereneseasons/models/item/calendar_tropical_03.json +af26ace87fdb72c0f5a952073ad284ddf288c4d0 assets/sereneseasons/models/item/calendar_tropical_04.json +7116416dd672caa9749618f5d43bb16bae99ed5b assets/sereneseasons/models/item/calendar_tropical_05.json +c4e806108e523f09f34968a76f3cdd9c6f985a22 assets/sereneseasons/models/item/ss_icon.json diff --git a/common/src/generated/resources/.cache/7dda471881370ae09913a072085433a4eb774f0b b/common/src/generated/resources/.cache/7dda471881370ae09913a072085433a4eb774f0b index c96c677a..22367273 100644 --- a/common/src/generated/resources/.cache/7dda471881370ae09913a072085433a4eb774f0b +++ b/common/src/generated/resources/.cache/7dda471881370ae09913a072085433a4eb774f0b @@ -1,4 +1,4 @@ -// 1.21.3 2024-10-29T11:57:32.3267901 SS Recipes +// 1.21.4 2024-12-08T13:56:50.8841059 SS Recipes e072858e57ee517a9ad673759ea337523f1faf58 data/sereneseasons/advancement/recipes/redstone/season_sensor.json a6e2e9061195651e5a5ebe536429b983725e47a8 data/sereneseasons/advancement/recipes/tools/calendar.json 8baddb9771f6e76a935fa1bf988623c65578b91f data/sereneseasons/recipe/calendar.json diff --git a/common/src/generated/resources/assets/sereneseasons/blockstates/season_sensor.json b/common/src/generated/resources/assets/sereneseasons/blockstates/season_sensor.json index 362e857f..f801609a 100644 --- a/common/src/generated/resources/assets/sereneseasons/blockstates/season_sensor.json +++ b/common/src/generated/resources/assets/sereneseasons/blockstates/season_sensor.json @@ -1,195 +1,15 @@ { "variants": { - "power=0,season=0": { - "model": "sereneseasons:block/season_sensor_spring" + "season=0": { + "model": "sereneseasons:block/season_sensor" }, - "power=0,season=1": { + "season=1": { "model": "sereneseasons:block/season_sensor_summer" }, - "power=0,season=2": { + "season=2": { "model": "sereneseasons:block/season_sensor_autumn" }, - "power=0,season=3": { - "model": "sereneseasons:block/season_sensor_winter" - }, - "power=1,season=0": { - "model": "sereneseasons:block/season_sensor_spring" - }, - "power=1,season=1": { - "model": "sereneseasons:block/season_sensor_summer" - }, - "power=1,season=2": { - "model": "sereneseasons:block/season_sensor_autumn" - }, - "power=1,season=3": { - "model": "sereneseasons:block/season_sensor_winter" - }, - "power=10,season=0": { - "model": "sereneseasons:block/season_sensor_spring" - }, - "power=10,season=1": { - "model": "sereneseasons:block/season_sensor_summer" - }, - "power=10,season=2": { - "model": "sereneseasons:block/season_sensor_autumn" - }, - "power=10,season=3": { - "model": "sereneseasons:block/season_sensor_winter" - }, - "power=11,season=0": { - "model": "sereneseasons:block/season_sensor_spring" - }, - "power=11,season=1": { - "model": "sereneseasons:block/season_sensor_summer" - }, - "power=11,season=2": { - "model": "sereneseasons:block/season_sensor_autumn" - }, - "power=11,season=3": { - "model": "sereneseasons:block/season_sensor_winter" - }, - "power=12,season=0": { - "model": "sereneseasons:block/season_sensor_spring" - }, - "power=12,season=1": { - "model": "sereneseasons:block/season_sensor_summer" - }, - "power=12,season=2": { - "model": "sereneseasons:block/season_sensor_autumn" - }, - "power=12,season=3": { - "model": "sereneseasons:block/season_sensor_winter" - }, - "power=13,season=0": { - "model": "sereneseasons:block/season_sensor_spring" - }, - "power=13,season=1": { - "model": "sereneseasons:block/season_sensor_summer" - }, - "power=13,season=2": { - "model": "sereneseasons:block/season_sensor_autumn" - }, - "power=13,season=3": { - "model": "sereneseasons:block/season_sensor_winter" - }, - "power=14,season=0": { - "model": "sereneseasons:block/season_sensor_spring" - }, - "power=14,season=1": { - "model": "sereneseasons:block/season_sensor_summer" - }, - "power=14,season=2": { - "model": "sereneseasons:block/season_sensor_autumn" - }, - "power=14,season=3": { - "model": "sereneseasons:block/season_sensor_winter" - }, - "power=15,season=0": { - "model": "sereneseasons:block/season_sensor_spring" - }, - "power=15,season=1": { - "model": "sereneseasons:block/season_sensor_summer" - }, - "power=15,season=2": { - "model": "sereneseasons:block/season_sensor_autumn" - }, - "power=15,season=3": { - "model": "sereneseasons:block/season_sensor_winter" - }, - "power=2,season=0": { - "model": "sereneseasons:block/season_sensor_spring" - }, - "power=2,season=1": { - "model": "sereneseasons:block/season_sensor_summer" - }, - "power=2,season=2": { - "model": "sereneseasons:block/season_sensor_autumn" - }, - "power=2,season=3": { - "model": "sereneseasons:block/season_sensor_winter" - }, - "power=3,season=0": { - "model": "sereneseasons:block/season_sensor_spring" - }, - "power=3,season=1": { - "model": "sereneseasons:block/season_sensor_summer" - }, - "power=3,season=2": { - "model": "sereneseasons:block/season_sensor_autumn" - }, - "power=3,season=3": { - "model": "sereneseasons:block/season_sensor_winter" - }, - "power=4,season=0": { - "model": "sereneseasons:block/season_sensor_spring" - }, - "power=4,season=1": { - "model": "sereneseasons:block/season_sensor_summer" - }, - "power=4,season=2": { - "model": "sereneseasons:block/season_sensor_autumn" - }, - "power=4,season=3": { - "model": "sereneseasons:block/season_sensor_winter" - }, - "power=5,season=0": { - "model": "sereneseasons:block/season_sensor_spring" - }, - "power=5,season=1": { - "model": "sereneseasons:block/season_sensor_summer" - }, - "power=5,season=2": { - "model": "sereneseasons:block/season_sensor_autumn" - }, - "power=5,season=3": { - "model": "sereneseasons:block/season_sensor_winter" - }, - "power=6,season=0": { - "model": "sereneseasons:block/season_sensor_spring" - }, - "power=6,season=1": { - "model": "sereneseasons:block/season_sensor_summer" - }, - "power=6,season=2": { - "model": "sereneseasons:block/season_sensor_autumn" - }, - "power=6,season=3": { - "model": "sereneseasons:block/season_sensor_winter" - }, - "power=7,season=0": { - "model": "sereneseasons:block/season_sensor_spring" - }, - "power=7,season=1": { - "model": "sereneseasons:block/season_sensor_summer" - }, - "power=7,season=2": { - "model": "sereneseasons:block/season_sensor_autumn" - }, - "power=7,season=3": { - "model": "sereneseasons:block/season_sensor_winter" - }, - "power=8,season=0": { - "model": "sereneseasons:block/season_sensor_spring" - }, - "power=8,season=1": { - "model": "sereneseasons:block/season_sensor_summer" - }, - "power=8,season=2": { - "model": "sereneseasons:block/season_sensor_autumn" - }, - "power=8,season=3": { - "model": "sereneseasons:block/season_sensor_winter" - }, - "power=9,season=0": { - "model": "sereneseasons:block/season_sensor_spring" - }, - "power=9,season=1": { - "model": "sereneseasons:block/season_sensor_summer" - }, - "power=9,season=2": { - "model": "sereneseasons:block/season_sensor_autumn" - }, - "power=9,season=3": { + "season=3": { "model": "sereneseasons:block/season_sensor_winter" } } diff --git a/common/src/generated/resources/assets/sereneseasons/items/calendar.json b/common/src/generated/resources/assets/sereneseasons/items/calendar.json new file mode 100644 index 00000000..79b302bc --- /dev/null +++ b/common/src/generated/resources/assets/sereneseasons/items/calendar.json @@ -0,0 +1,201 @@ +{ + "model": { + "type": "minecraft:select", + "cases": [ + { + "model": { + "type": "minecraft:range_dispatch", + "entries": [ + { + "model": { + "type": "minecraft:model", + "model": "sereneseasons:item/calendar_00" + }, + "threshold": 0.0 + }, + { + "model": { + "type": "minecraft:model", + "model": "sereneseasons:item/calendar_01" + }, + "threshold": 0.083333336 + }, + { + "model": { + "type": "minecraft:model", + "model": "sereneseasons:item/calendar_02" + }, + "threshold": 0.16666667 + }, + { + "model": { + "type": "minecraft:model", + "model": "sereneseasons:item/calendar_03" + }, + "threshold": 0.25 + }, + { + "model": { + "type": "minecraft:model", + "model": "sereneseasons:item/calendar_04" + }, + "threshold": 0.33333334 + }, + { + "model": { + "type": "minecraft:model", + "model": "sereneseasons:item/calendar_05" + }, + "threshold": 0.41666666 + }, + { + "model": { + "type": "minecraft:model", + "model": "sereneseasons:item/calendar_06" + }, + "threshold": 0.5 + }, + { + "model": { + "type": "minecraft:model", + "model": "sereneseasons:item/calendar_07" + }, + "threshold": 0.5833333 + }, + { + "model": { + "type": "minecraft:model", + "model": "sereneseasons:item/calendar_08" + }, + "threshold": 0.6666667 + }, + { + "model": { + "type": "minecraft:model", + "model": "sereneseasons:item/calendar_09" + }, + "threshold": 0.75 + }, + { + "model": { + "type": "minecraft:model", + "model": "sereneseasons:item/calendar_10" + }, + "threshold": 0.8333333 + }, + { + "model": { + "type": "minecraft:model", + "model": "sereneseasons:item/calendar_11" + }, + "threshold": 0.9166667 + } + ], + "property": "minecraft:season_time" + }, + "when": "standard" + }, + { + "model": { + "type": "minecraft:range_dispatch", + "entries": [ + { + "model": { + "type": "minecraft:model", + "model": "sereneseasons:item/calendar_tropical_01" + }, + "threshold": 0.0 + }, + { + "model": { + "type": "minecraft:model", + "model": "sereneseasons:item/calendar_tropical_02" + }, + "threshold": 0.083333336 + }, + { + "model": { + "type": "minecraft:model", + "model": "sereneseasons:item/calendar_tropical_02" + }, + "threshold": 0.16666667 + }, + { + "model": { + "type": "minecraft:model", + "model": "sereneseasons:item/calendar_tropical_03" + }, + "threshold": 0.25 + }, + { + "model": { + "type": "minecraft:model", + "model": "sereneseasons:item/calendar_tropical_03" + }, + "threshold": 0.33333334 + }, + { + "model": { + "type": "minecraft:model", + "model": "sereneseasons:item/calendar_tropical_04" + }, + "threshold": 0.41666666 + }, + { + "model": { + "type": "minecraft:model", + "model": "sereneseasons:item/calendar_tropical_04" + }, + "threshold": 0.5 + }, + { + "model": { + "type": "minecraft:model", + "model": "sereneseasons:item/calendar_tropical_05" + }, + "threshold": 0.5833333 + }, + { + "model": { + "type": "minecraft:model", + "model": "sereneseasons:item/calendar_tropical_05" + }, + "threshold": 0.6666667 + }, + { + "model": { + "type": "minecraft:model", + "model": "sereneseasons:item/calendar_tropical_00" + }, + "threshold": 0.75 + }, + { + "model": { + "type": "minecraft:model", + "model": "sereneseasons:item/calendar_tropical_00" + }, + "threshold": 0.8333333 + }, + { + "model": { + "type": "minecraft:model", + "model": "sereneseasons:item/calendar_tropical_01" + }, + "threshold": 0.9166667 + } + ], + "property": "minecraft:season_time" + }, + "when": "tropical" + }, + { + "model": { + "type": "minecraft:model", + "model": "sereneseasons:item/calendar_null" + }, + "when": "none" + } + ], + "property": "minecraft:context_calendar_type" + } +} \ No newline at end of file diff --git a/common/src/generated/resources/assets/sereneseasons/items/season_sensor.json b/common/src/generated/resources/assets/sereneseasons/items/season_sensor.json new file mode 100644 index 00000000..f87955c0 --- /dev/null +++ b/common/src/generated/resources/assets/sereneseasons/items/season_sensor.json @@ -0,0 +1,6 @@ +{ + "model": { + "type": "minecraft:model", + "model": "sereneseasons:block/season_sensor" + } +} \ No newline at end of file diff --git a/common/src/generated/resources/assets/sereneseasons/items/ss_icon.json b/common/src/generated/resources/assets/sereneseasons/items/ss_icon.json new file mode 100644 index 00000000..4eda4e7c --- /dev/null +++ b/common/src/generated/resources/assets/sereneseasons/items/ss_icon.json @@ -0,0 +1,6 @@ +{ + "model": { + "type": "minecraft:model", + "model": "sereneseasons:item/ss_icon" + } +} \ No newline at end of file diff --git a/common/src/generated/resources/assets/sereneseasons/models/block/season_sensor_spring.json b/common/src/generated/resources/assets/sereneseasons/models/block/season_sensor.json similarity index 100% rename from common/src/generated/resources/assets/sereneseasons/models/block/season_sensor_spring.json rename to common/src/generated/resources/assets/sereneseasons/models/block/season_sensor.json diff --git a/common/src/generated/resources/assets/sereneseasons/models/item/calendar.json b/common/src/generated/resources/assets/sereneseasons/models/item/calendar.json deleted file mode 100644 index ed87967e..00000000 --- a/common/src/generated/resources/assets/sereneseasons/models/item/calendar.json +++ /dev/null @@ -1,180 +0,0 @@ -{ - "parent": "minecraft:item/generated", - "overrides": [ - { - "model": "sereneseasons:item/calendar_00", - "predicate": { - "sereneseasons:seasontype": 0.0, - "sereneseasons:time": 0.0 - } - }, - { - "model": "sereneseasons:item/calendar_01", - "predicate": { - "sereneseasons:seasontype": 0.0, - "sereneseasons:time": 0.083333336 - } - }, - { - "model": "sereneseasons:item/calendar_02", - "predicate": { - "sereneseasons:seasontype": 0.0, - "sereneseasons:time": 0.16666667 - } - }, - { - "model": "sereneseasons:item/calendar_03", - "predicate": { - "sereneseasons:seasontype": 0.0, - "sereneseasons:time": 0.25 - } - }, - { - "model": "sereneseasons:item/calendar_04", - "predicate": { - "sereneseasons:seasontype": 0.0, - "sereneseasons:time": 0.33333334 - } - }, - { - "model": "sereneseasons:item/calendar_05", - "predicate": { - "sereneseasons:seasontype": 0.0, - "sereneseasons:time": 0.41666666 - } - }, - { - "model": "sereneseasons:item/calendar_06", - "predicate": { - "sereneseasons:seasontype": 0.0, - "sereneseasons:time": 0.5 - } - }, - { - "model": "sereneseasons:item/calendar_07", - "predicate": { - "sereneseasons:seasontype": 0.0, - "sereneseasons:time": 0.5833333 - } - }, - { - "model": "sereneseasons:item/calendar_08", - "predicate": { - "sereneseasons:seasontype": 0.0, - "sereneseasons:time": 0.6666667 - } - }, - { - "model": "sereneseasons:item/calendar_09", - "predicate": { - "sereneseasons:seasontype": 0.0, - "sereneseasons:time": 0.75 - } - }, - { - "model": "sereneseasons:item/calendar_10", - "predicate": { - "sereneseasons:seasontype": 0.0, - "sereneseasons:time": 0.8333333 - } - }, - { - "model": "sereneseasons:item/calendar_11", - "predicate": { - "sereneseasons:seasontype": 0.0, - "sereneseasons:time": 0.9166667 - } - }, - { - "model": "sereneseasons:item/tropical_calendar_01", - "predicate": { - "sereneseasons:seasontype": 1.0, - "sereneseasons:time": 0.0 - } - }, - { - "model": "sereneseasons:item/tropical_calendar_02", - "predicate": { - "sereneseasons:seasontype": 1.0, - "sereneseasons:time": 0.083333336 - } - }, - { - "model": "sereneseasons:item/tropical_calendar_02", - "predicate": { - "sereneseasons:seasontype": 1.0, - "sereneseasons:time": 0.16666667 - } - }, - { - "model": "sereneseasons:item/tropical_calendar_03", - "predicate": { - "sereneseasons:seasontype": 1.0, - "sereneseasons:time": 0.25 - } - }, - { - "model": "sereneseasons:item/tropical_calendar_03", - "predicate": { - "sereneseasons:seasontype": 1.0, - "sereneseasons:time": 0.33333334 - } - }, - { - "model": "sereneseasons:item/tropical_calendar_04", - "predicate": { - "sereneseasons:seasontype": 1.0, - "sereneseasons:time": 0.41666666 - } - }, - { - "model": "sereneseasons:item/tropical_calendar_04", - "predicate": { - "sereneseasons:seasontype": 1.0, - "sereneseasons:time": 0.5 - } - }, - { - "model": "sereneseasons:item/tropical_calendar_05", - "predicate": { - "sereneseasons:seasontype": 1.0, - "sereneseasons:time": 0.5833333 - } - }, - { - "model": "sereneseasons:item/tropical_calendar_05", - "predicate": { - "sereneseasons:seasontype": 1.0, - "sereneseasons:time": 0.6666667 - } - }, - { - "model": "sereneseasons:item/tropical_calendar_00", - "predicate": { - "sereneseasons:seasontype": 1.0, - "sereneseasons:time": 0.75 - } - }, - { - "model": "sereneseasons:item/tropical_calendar_00", - "predicate": { - "sereneseasons:seasontype": 1.0, - "sereneseasons:time": 0.8333333 - } - }, - { - "model": "sereneseasons:item/tropical_calendar_01", - "predicate": { - "sereneseasons:seasontype": 1.0, - "sereneseasons:time": 0.9166667 - } - }, - { - "model": "sereneseasons:item/calendar_null", - "predicate": { - "sereneseasons:seasontype": 2.0, - "sereneseasons:time": 0.0 - } - } - ] -} \ No newline at end of file diff --git a/common/src/generated/resources/assets/sereneseasons/models/item/tropical_calendar_00.json b/common/src/generated/resources/assets/sereneseasons/models/item/calendar_tropical_00.json similarity index 52% rename from common/src/generated/resources/assets/sereneseasons/models/item/tropical_calendar_00.json rename to common/src/generated/resources/assets/sereneseasons/models/item/calendar_tropical_00.json index a974bcb8..1f3b23a6 100644 --- a/common/src/generated/resources/assets/sereneseasons/models/item/tropical_calendar_00.json +++ b/common/src/generated/resources/assets/sereneseasons/models/item/calendar_tropical_00.json @@ -1,6 +1,6 @@ { "parent": "minecraft:item/generated", "textures": { - "layer0": "sereneseasons:item/tropical_calendar_00" + "layer0": "sereneseasons:item/calendar_tropical_00" } } \ No newline at end of file diff --git a/common/src/generated/resources/assets/sereneseasons/models/item/tropical_calendar_01.json b/common/src/generated/resources/assets/sereneseasons/models/item/calendar_tropical_01.json similarity index 52% rename from common/src/generated/resources/assets/sereneseasons/models/item/tropical_calendar_01.json rename to common/src/generated/resources/assets/sereneseasons/models/item/calendar_tropical_01.json index d43c707a..df688fe7 100644 --- a/common/src/generated/resources/assets/sereneseasons/models/item/tropical_calendar_01.json +++ b/common/src/generated/resources/assets/sereneseasons/models/item/calendar_tropical_01.json @@ -1,6 +1,6 @@ { "parent": "minecraft:item/generated", "textures": { - "layer0": "sereneseasons:item/tropical_calendar_01" + "layer0": "sereneseasons:item/calendar_tropical_01" } } \ No newline at end of file diff --git a/common/src/generated/resources/assets/sereneseasons/models/item/tropical_calendar_02.json b/common/src/generated/resources/assets/sereneseasons/models/item/calendar_tropical_02.json similarity index 52% rename from common/src/generated/resources/assets/sereneseasons/models/item/tropical_calendar_02.json rename to common/src/generated/resources/assets/sereneseasons/models/item/calendar_tropical_02.json index 90c7f408..5dad5740 100644 --- a/common/src/generated/resources/assets/sereneseasons/models/item/tropical_calendar_02.json +++ b/common/src/generated/resources/assets/sereneseasons/models/item/calendar_tropical_02.json @@ -1,6 +1,6 @@ { "parent": "minecraft:item/generated", "textures": { - "layer0": "sereneseasons:item/tropical_calendar_02" + "layer0": "sereneseasons:item/calendar_tropical_02" } } \ No newline at end of file diff --git a/common/src/generated/resources/assets/sereneseasons/models/item/tropical_calendar_03.json b/common/src/generated/resources/assets/sereneseasons/models/item/calendar_tropical_03.json similarity index 52% rename from common/src/generated/resources/assets/sereneseasons/models/item/tropical_calendar_03.json rename to common/src/generated/resources/assets/sereneseasons/models/item/calendar_tropical_03.json index bb9aa6bf..69f317bb 100644 --- a/common/src/generated/resources/assets/sereneseasons/models/item/tropical_calendar_03.json +++ b/common/src/generated/resources/assets/sereneseasons/models/item/calendar_tropical_03.json @@ -1,6 +1,6 @@ { "parent": "minecraft:item/generated", "textures": { - "layer0": "sereneseasons:item/tropical_calendar_03" + "layer0": "sereneseasons:item/calendar_tropical_03" } } \ No newline at end of file diff --git a/common/src/generated/resources/assets/sereneseasons/models/item/calendar_tropical_04.json b/common/src/generated/resources/assets/sereneseasons/models/item/calendar_tropical_04.json new file mode 100644 index 00000000..24d51ce0 --- /dev/null +++ b/common/src/generated/resources/assets/sereneseasons/models/item/calendar_tropical_04.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "sereneseasons:item/calendar_tropical_04" + } +} \ No newline at end of file diff --git a/common/src/generated/resources/assets/sereneseasons/models/item/calendar_tropical_05.json b/common/src/generated/resources/assets/sereneseasons/models/item/calendar_tropical_05.json new file mode 100644 index 00000000..39f75c89 --- /dev/null +++ b/common/src/generated/resources/assets/sereneseasons/models/item/calendar_tropical_05.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "sereneseasons:item/calendar_tropical_05" + } +} \ No newline at end of file diff --git a/common/src/generated/resources/assets/sereneseasons/models/item/season_sensor.json b/common/src/generated/resources/assets/sereneseasons/models/item/season_sensor.json deleted file mode 100644 index b006f09c..00000000 --- a/common/src/generated/resources/assets/sereneseasons/models/item/season_sensor.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "parent": "sereneseasons:block/season_sensor_spring" -} \ No newline at end of file diff --git a/common/src/generated/resources/assets/sereneseasons/models/item/tropical_calendar_04.json b/common/src/generated/resources/assets/sereneseasons/models/item/tropical_calendar_04.json deleted file mode 100644 index e88f53e3..00000000 --- a/common/src/generated/resources/assets/sereneseasons/models/item/tropical_calendar_04.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "minecraft:item/generated", - "textures": { - "layer0": "sereneseasons:item/tropical_calendar_04" - } -} \ No newline at end of file diff --git a/common/src/generated/resources/assets/sereneseasons/models/item/tropical_calendar_05.json b/common/src/generated/resources/assets/sereneseasons/models/item/tropical_calendar_05.json deleted file mode 100644 index fb4278da..00000000 --- a/common/src/generated/resources/assets/sereneseasons/models/item/tropical_calendar_05.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "minecraft:item/generated", - "textures": { - "layer0": "sereneseasons:item/tropical_calendar_05" - } -} \ No newline at end of file diff --git a/common/src/main/java/sereneseasons/client/item/ContextCalendarType.java b/common/src/main/java/sereneseasons/client/item/ContextCalendarType.java new file mode 100644 index 00000000..e6094d9a --- /dev/null +++ b/common/src/main/java/sereneseasons/client/item/ContextCalendarType.java @@ -0,0 +1,57 @@ +/******************************************************************************* + * Copyright 2024, the Glitchfiend Team. + * All rights reserved. + ******************************************************************************/ +package sereneseasons.client.item; + +import com.mojang.serialization.MapCodec; +import net.minecraft.client.multiplayer.ClientLevel; +import net.minecraft.client.renderer.item.properties.select.SelectItemModelProperty; +import net.minecraft.core.Holder; +import net.minecraft.world.entity.Entity; +import net.minecraft.world.entity.LivingEntity; +import net.minecraft.world.item.ItemDisplayContext; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.level.Level; +import net.minecraft.world.level.biome.Biome; +import org.jetbrains.annotations.Nullable; +import sereneseasons.init.ModConfig; +import sereneseasons.init.ModTags; +import sereneseasons.item.CalendarType; + +public class ContextCalendarType implements SelectItemModelProperty +{ + public static final SelectItemModelProperty.Type TYPE = SelectItemModelProperty.Type.create( + MapCodec.unit(new ContextCalendarType()), CalendarType.CODEC + ); + + @Nullable + @Override + public CalendarType get(ItemStack stack, @Nullable ClientLevel clientLevel, @Nullable LivingEntity livingEntity, int i, ItemDisplayContext itemDisplayContext) + { + Level level = clientLevel; + Entity holder = (Entity)(livingEntity != null ? livingEntity : stack.getFrame()); + + if (level == null && holder != null) + { + level = holder.level(); + } + + if (level == null || !ModConfig.seasons.isDimensionWhitelisted(level.dimension())) return CalendarType.NONE; + + if (holder != null) + { + Holder biome = level.getBiome(holder.blockPosition()); + if (biome.is(ModTags.Biomes.TROPICAL_BIOMES)) return CalendarType.TROPICAL; + } + + return CalendarType.STANDARD; + } + + + @Override + public Type, CalendarType> type() + { + return TYPE; + } +} diff --git a/common/src/main/java/sereneseasons/client/item/SeasonTimeProperty.java b/common/src/main/java/sereneseasons/client/item/SeasonTimeProperty.java new file mode 100644 index 00000000..07b83b4e --- /dev/null +++ b/common/src/main/java/sereneseasons/client/item/SeasonTimeProperty.java @@ -0,0 +1,42 @@ +/******************************************************************************* + * Copyright 2024, the Glitchfiend Team. + * All rights reserved. + ******************************************************************************/ +package sereneseasons.client.item; + +import com.mojang.serialization.MapCodec; +import net.minecraft.client.multiplayer.ClientLevel; +import net.minecraft.client.renderer.item.properties.numeric.RangeSelectItemModelProperty; +import net.minecraft.util.Mth; +import net.minecraft.world.entity.Entity; +import net.minecraft.world.entity.LivingEntity; +import net.minecraft.world.item.ItemStack; +import org.jetbrains.annotations.Nullable; +import sereneseasons.api.season.SeasonHelper; +import sereneseasons.season.SeasonTime; + +public class SeasonTimeProperty implements RangeSelectItemModelProperty +{ + public static final MapCodec TYPE = MapCodec.unit(new SeasonTimeProperty()); + + @Override + public float get(ItemStack itemStack, @Nullable ClientLevel level, @Nullable LivingEntity livingEntity, int i) + { + Entity holder = (Entity)(livingEntity != null ? livingEntity : itemStack.getFrame()); + + if (level == null && holder != null) level = (ClientLevel)holder.level(); + if (level == null) return 0.0F; + + double d0; + + int seasonCycleTicks = SeasonHelper.getSeasonState(level).getSeasonCycleTicks(); + d0 = (float)seasonCycleTicks / (float) SeasonTime.ZERO.getCycleDuration(); + return Mth.positiveModulo((float)d0, 1.0F); + } + + @Override + public MapCodec type() + { + return TYPE; + } +} diff --git a/common/src/main/java/sereneseasons/init/ModClient.java b/common/src/main/java/sereneseasons/init/ModClient.java index 313e693b..f4b49a48 100644 --- a/common/src/main/java/sereneseasons/init/ModClient.java +++ b/common/src/main/java/sereneseasons/init/ModClient.java @@ -10,11 +10,8 @@ import net.minecraft.ChatFormatting; import net.minecraft.client.Minecraft; import net.minecraft.client.multiplayer.ClientLevel; -import net.minecraft.client.renderer.item.ClampedItemPropertyFunction; -import net.minecraft.client.renderer.item.ItemProperties; import net.minecraft.core.BlockPos; import net.minecraft.core.Holder; -import net.minecraft.core.component.DataComponents; import net.minecraft.network.chat.Component; import net.minecraft.resources.ResourceKey; import net.minecraft.resources.ResourceLocation; @@ -22,17 +19,13 @@ import net.minecraft.world.entity.Entity; import net.minecraft.world.entity.LivingEntity; import net.minecraft.world.entity.player.Player; -import net.minecraft.world.item.Item; import net.minecraft.world.item.ItemStack; -import net.minecraft.world.item.TooltipFlag; import net.minecraft.world.level.BlockAndTintGetter; import net.minecraft.world.level.FoliageColor; import net.minecraft.world.level.Level; import net.minecraft.world.level.biome.Biome; import net.minecraft.world.level.block.Blocks; import net.minecraft.world.level.block.state.BlockState; -import net.minecraft.world.level.saveddata.maps.MapId; -import net.minecraft.world.level.saveddata.maps.MapItemSavedData; import sereneseasons.api.SSItems; import sereneseasons.api.season.ISeasonColorProvider; import sereneseasons.api.season.ISeasonState; @@ -87,92 +80,92 @@ public static void onItemTooltip(ItemTooltipEvent event) public static void registerItemProperties() { - ItemProperties.register(SSItems.CALENDAR, ResourceLocation.fromNamespaceAndPath(SereneSeasons.MOD_ID, "time"), new ClampedItemPropertyFunction() - { - @Override - public float unclampedCall(ItemStack stack, ClientLevel clientWorld, LivingEntity entity, int seed) - { - Level world = clientWorld; - Entity holder = (Entity)(entity != null ? entity : stack.getFrame()); - - if (world == null && holder != null) - { - world = holder.level(); - } - - if (world == null) - { - return 0.0F; - } - else - { - double d0; - - int seasonCycleTicks = SeasonHelper.getSeasonState(world).getSeasonCycleTicks(); - d0 = (double)((float)seasonCycleTicks / (float) SeasonTime.ZERO.getCycleDuration()); - - return Mth.positiveModulo((float)d0, 1.0F); - } - } - }); - - ItemProperties.register(SSItems.CALENDAR, ResourceLocation.fromNamespaceAndPath(SereneSeasons.MOD_ID, "seasontype"), new ClampedItemPropertyFunction() - { - @Override - public float unclampedCall(ItemStack stack, ClientLevel clientWorld, LivingEntity entity, int seed) - { - Level level = clientWorld; - Entity holder = (Entity)(entity != null ? entity : stack.getFrame()); - - if (level == null && holder != null) - { - level = holder.level(); - } - - if (level == null) - { - return 2.0F; - } - else - { - float type; - - if (ModConfig.seasons.isDimensionWhitelisted(level.dimension())) - { - if (holder != null) - { - Holder biome = level.getBiome(holder.blockPosition()); - - if (biome.is(ModTags.Biomes.TROPICAL_BIOMES)) - { - type = 1.0F; - } - else - { - type = 0.0F; - } - } - else - { - type = 0.0F; - } - } - else - { - type = 2.0F; - } - - return type; - } - } - }); +// ItemProperties.register(SSItems.CALENDAR, ResourceLocation.fromNamespaceAndPath(SereneSeasons.MOD_ID, "time"), new ClampedItemPropertyFunction() +// { +// @Override +// public float unclampedCall(ItemStack stack, ClientLevel clientWorld, LivingEntity entity, int seed) +// { +// Level world = clientWorld; +// Entity holder = (Entity)(entity != null ? entity : stack.getFrame()); +// +// if (world == null && holder != null) +// { +// world = holder.level(); +// } +// +// if (world == null) +// { +// return 0.0F; +// } +// else +// { +// double d0; +// +// int seasonCycleTicks = SeasonHelper.getSeasonState(world).getSeasonCycleTicks(); +// d0 = (double)((float)seasonCycleTicks / (float) SeasonTime.ZERO.getCycleDuration()); +// +// return Mth.positiveModulo((float)d0, 1.0F); +// } +// } +// }); +// +// ItemProperties.register(SSItems.CALENDAR, ResourceLocation.fromNamespaceAndPath(SereneSeasons.MOD_ID, "seasontype"), new ClampedItemPropertyFunction() +// { +// @Override +// public float unclampedCall(ItemStack stack, ClientLevel clientWorld, LivingEntity entity, int seed) +// { +// Level level = clientWorld; +// Entity holder = (Entity)(entity != null ? entity : stack.getFrame()); +// +// if (level == null && holder != null) +// { +// level = holder.level(); +// } +// +// if (level == null) +// { +// return 2.0F; +// } +// else +// { +// float type; +// +// if (ModConfig.seasons.isDimensionWhitelisted(level.dimension())) +// { +// if (holder != null) +// { +// Holder biome = level.getBiome(holder.blockPosition()); +// +// if (biome.is(ModTags.Biomes.TROPICAL_BIOMES)) +// { +// type = 1.0F; +// } +// else +// { +// type = 0.0F; +// } +// } +// else +// { +// type = 0.0F; +// } +// } +// else +// { +// type = 2.0F; +// } +// +// return type; +// } +// } +// }); } private static void registerBlockColors(RegisterColorsEvent.Block event) { event.register((BlockState state, @Nullable BlockAndTintGetter dimensionReader, @Nullable BlockPos pos, int tintIndex) -> { - int birchColor = FoliageColor.getBirchColor(); + int birchColor = FoliageColor.FOLIAGE_BIRCH; Level level = Minecraft.getInstance().player.level(); ResourceKey dimension = Minecraft.getInstance().player.level().dimension(); @@ -188,7 +181,7 @@ private static void registerBlockColors(RegisterColorsEvent.Block event) if (biome.is(ModTags.Biomes.LESSER_COLOR_CHANGE_BIOMES)) { - birchColor = SeasonColorUtil.mixColours(colorProvider.getBirchColor(), FoliageColor.getBirchColor(), 0.75F); + birchColor = SeasonColorUtil.mixColours(colorProvider.getBirchColor(), FoliageColor.FOLIAGE_BIRCH, 0.75F); } } } diff --git a/common/src/main/java/sereneseasons/item/CalendarType.java b/common/src/main/java/sereneseasons/item/CalendarType.java index 25fba367..05cb0412 100644 --- a/common/src/main/java/sereneseasons/item/CalendarType.java +++ b/common/src/main/java/sereneseasons/item/CalendarType.java @@ -4,9 +4,24 @@ ******************************************************************************/ package sereneseasons.item; -public enum CalendarType -{ - STANDARD, - TROPICAL, - NONE -} +import com.mojang.serialization.Codec; +import net.minecraft.util.StringRepresentable; +import net.minecraft.world.item.CrossbowItem; + +public enum CalendarType implements StringRepresentable { + STANDARD("standard"), + TROPICAL("tropical"), + NONE("none"); + + public static final Codec CODEC = StringRepresentable.fromEnum(CalendarType::values); + private final String name; + + private CalendarType(String p_386626_) { + this.name = p_386626_; + } + + @Override + public String getSerializedName() { + return this.name; + } +} \ No newline at end of file diff --git a/common/src/main/java/sereneseasons/mixin/client/MixinRangeSelectItemModelProperties.java b/common/src/main/java/sereneseasons/mixin/client/MixinRangeSelectItemModelProperties.java new file mode 100644 index 00000000..2e6534c5 --- /dev/null +++ b/common/src/main/java/sereneseasons/mixin/client/MixinRangeSelectItemModelProperties.java @@ -0,0 +1,35 @@ +/******************************************************************************* + * Copyright 2024, the Glitchfiend Team. + * All rights reserved. + ******************************************************************************/ +package sereneseasons.mixin.client; + +import com.mojang.serialization.MapCodec; +import net.minecraft.client.renderer.item.properties.numeric.RangeSelectItemModelProperties; +import net.minecraft.client.renderer.item.properties.numeric.RangeSelectItemModelProperty; +import net.minecraft.client.renderer.item.properties.select.SelectItemModelProperties; +import net.minecraft.client.renderer.item.properties.select.SelectItemModelProperty; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.util.ExtraCodecs; +import org.spongepowered.asm.mixin.Final; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; +import sereneseasons.client.item.ContextCalendarType; +import sereneseasons.client.item.SeasonTimeProperty; + +@Mixin(RangeSelectItemModelProperties.class) +public class MixinRangeSelectItemModelProperties +{ + @Shadow + @Final + private static ExtraCodecs.LateBoundIdMapper> ID_MAPPER; + + @Inject(method = "bootstrap", at=@At("TAIL")) + private static void onBootstrap(CallbackInfo ci) + { + ID_MAPPER.put(ResourceLocation.withDefaultNamespace("season_time"), SeasonTimeProperty.TYPE); + } +} diff --git a/common/src/main/java/sereneseasons/mixin/client/MixinSelectItemModelProperties.java b/common/src/main/java/sereneseasons/mixin/client/MixinSelectItemModelProperties.java new file mode 100644 index 00000000..ca4d5b37 --- /dev/null +++ b/common/src/main/java/sereneseasons/mixin/client/MixinSelectItemModelProperties.java @@ -0,0 +1,32 @@ +/******************************************************************************* + * Copyright 2024, the Glitchfiend Team. + * All rights reserved. + ******************************************************************************/ +package sereneseasons.mixin.client; + +import net.minecraft.client.renderer.item.properties.select.ContextDimension; +import net.minecraft.client.renderer.item.properties.select.SelectItemModelProperties; +import net.minecraft.client.renderer.item.properties.select.SelectItemModelProperty; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.util.ExtraCodecs; +import org.spongepowered.asm.mixin.Final; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; +import sereneseasons.client.item.ContextCalendarType; + +@Mixin(SelectItemModelProperties.class) +public class MixinSelectItemModelProperties +{ + @Shadow + @Final + private static ExtraCodecs.LateBoundIdMapper> ID_MAPPER; + + @Inject(method = "bootstrap", at=@At("TAIL")) + private static void onBootstrap(CallbackInfo ci) + { + ID_MAPPER.put(ResourceLocation.withDefaultNamespace("context_calendar_type"), ContextCalendarType.TYPE); + } +} diff --git a/common/src/main/resources/assets/sereneseasons/textures/item/tropical_calendar_00.png b/common/src/main/resources/assets/sereneseasons/textures/item/calendar_tropical_00.png similarity index 100% rename from common/src/main/resources/assets/sereneseasons/textures/item/tropical_calendar_00.png rename to common/src/main/resources/assets/sereneseasons/textures/item/calendar_tropical_00.png diff --git a/common/src/main/resources/assets/sereneseasons/textures/item/tropical_calendar_01.png b/common/src/main/resources/assets/sereneseasons/textures/item/calendar_tropical_01.png similarity index 100% rename from common/src/main/resources/assets/sereneseasons/textures/item/tropical_calendar_01.png rename to common/src/main/resources/assets/sereneseasons/textures/item/calendar_tropical_01.png diff --git a/common/src/main/resources/assets/sereneseasons/textures/item/tropical_calendar_02.png b/common/src/main/resources/assets/sereneseasons/textures/item/calendar_tropical_02.png similarity index 100% rename from common/src/main/resources/assets/sereneseasons/textures/item/tropical_calendar_02.png rename to common/src/main/resources/assets/sereneseasons/textures/item/calendar_tropical_02.png diff --git a/common/src/main/resources/assets/sereneseasons/textures/item/tropical_calendar_03.png b/common/src/main/resources/assets/sereneseasons/textures/item/calendar_tropical_03.png similarity index 100% rename from common/src/main/resources/assets/sereneseasons/textures/item/tropical_calendar_03.png rename to common/src/main/resources/assets/sereneseasons/textures/item/calendar_tropical_03.png diff --git a/common/src/main/resources/assets/sereneseasons/textures/item/tropical_calendar_04.png b/common/src/main/resources/assets/sereneseasons/textures/item/calendar_tropical_04.png similarity index 100% rename from common/src/main/resources/assets/sereneseasons/textures/item/tropical_calendar_04.png rename to common/src/main/resources/assets/sereneseasons/textures/item/calendar_tropical_04.png diff --git a/common/src/main/resources/assets/sereneseasons/textures/item/tropical_calendar_05.png b/common/src/main/resources/assets/sereneseasons/textures/item/calendar_tropical_05.png similarity index 100% rename from common/src/main/resources/assets/sereneseasons/textures/item/tropical_calendar_05.png rename to common/src/main/resources/assets/sereneseasons/textures/item/calendar_tropical_05.png diff --git a/common/src/main/resources/sereneseasons.accesswidener b/common/src/main/resources/sereneseasons.accesswidener index 8587fddd..c85d305f 100644 --- a/common/src/main/resources/sereneseasons.accesswidener +++ b/common/src/main/resources/sereneseasons.accesswidener @@ -1,4 +1,4 @@ -accessWidener v1 named +accessWidener v2 named # Block entity registration accessible class net/minecraft/world/level/block/entity/BlockEntityType$BlockEntitySupplier @@ -26,4 +26,5 @@ accessible method net/minecraft/world/level/block/IceBlock melt (Lnet/minecraft/ # Commands accessible field net/minecraft/commands/synchronization/ArgumentTypeInfos BY_CLASS Ljava/util/Map; -accessible method net/minecraft/world/level/block/entity/BlockEntityType (Lnet/minecraft/world/level/block/entity/BlockEntityType$BlockEntitySupplier;Ljava/util/Set;)V \ No newline at end of file +accessible method net/minecraft/world/level/block/entity/BlockEntityType (Lnet/minecraft/world/level/block/entity/BlockEntityType$BlockEntitySupplier;Ljava/util/Set;)V + diff --git a/common/src/main/resources/sereneseasons.mixins.json b/common/src/main/resources/sereneseasons.mixins.json index 6ee0105e..dcf8ed7f 100644 --- a/common/src/main/resources/sereneseasons.mixins.json +++ b/common/src/main/resources/sereneseasons.mixins.json @@ -10,8 +10,10 @@ "MixinServerLevel" ], "client": [ - "client.MixinWeatherEffectRenderer", - "client.MixinBiomeClient" + "client.MixinBiomeClient", + "client.MixinSelectItemModelProperties", + "client.MixinRangeSelectItemModelProperties", + "client.MixinWeatherEffectRenderer" ], "injectors": { "defaultRequire": 1 diff --git a/forge/src/main/resources/META-INF/accesstransformer.cfg b/forge/src/main/resources/META-INF/accesstransformer.cfg index 290a5f0f..6962ef42 100644 --- a/forge/src/main/resources/META-INF/accesstransformer.cfg +++ b/forge/src/main/resources/META-INF/accesstransformer.cfg @@ -14,4 +14,6 @@ public net.minecraft.world.level.biome.Biome m_47505_(Lnet/minecraft/core/BlockP # Commands public net.minecraft.commands.synchronization.ArgumentTypeInfos f_235379_ #BY_CLASS -public net.minecraft.world.level.block.entity.BlockEntityType (Lnet/minecraft/world/level/block/entity/BlockEntityType$BlockEntitySupplier;Ljava/util/Set;)V \ No newline at end of file +public net.minecraft.world.level.block.entity.BlockEntityType (Lnet/minecraft/world/level/block/entity/BlockEntityType$BlockEntitySupplier;Ljava/util/Set;)V + +public net.minecraft.client.data.models.ItemModelGenerators *() \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index 3331efd0..e2b1f8da 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,21 +3,21 @@ group=com.github.glitchfiend release_channel=beta # Common -minecraft_version=1.21.3 - +minecraft_version=1.21.4 # Forge -forge_version=53.0.2 -forge_version_range=[53.0.2,) -forge_loader_version_range=[53,) + +forge_version=54.0.6 +forge_version_range=[54.0.6,) +forge_loader_version_range=[54,) # NeoForge -neoforge_version=21.3.3-beta -neoforge_version_range=[21.3,) +neoforge_version=21.4.9-beta +neoforge_version_range=[21.4,) neoforge_loader_version_range=[1,) # Fabric -fabric_version=0.107.0+1.21.3 -fabric_loader_version=0.16.8 +fabric_version=0.111.0+1.21.4 +fabric_loader_version=0.16.9 # Mod options mod_id=sereneseasons @@ -40,4 +40,4 @@ org.gradle.daemon=false # Dependencies nightconfig_version=3.6.7 -glitchcore_version=2.2.0.2 +glitchcore_version=2.3.0.1 diff --git a/neoforge/build.gradle b/neoforge/build.gradle index 933fa354..5f5e395e 100644 --- a/neoforge/build.gradle +++ b/neoforge/build.gradle @@ -30,7 +30,7 @@ runs { programArgument '--nogui' } - data { + clientData { programArguments.addAll '--mod', project.mod_id, '--all', '--output', project(':Common').file('src/generated/resources/').getAbsolutePath(), '--existing', project(':Common').file('src/main/resources/').getAbsolutePath() } } diff --git a/neoforge/src/main/java/sereneseasons/datagen/DataGenerationHandler.java b/neoforge/src/main/java/sereneseasons/datagen/DataGenerationHandler.java index c9fea46c..e321dcd7 100644 --- a/neoforge/src/main/java/sereneseasons/datagen/DataGenerationHandler.java +++ b/neoforge/src/main/java/sereneseasons/datagen/DataGenerationHandler.java @@ -10,23 +10,23 @@ import net.neoforged.fml.common.EventBusSubscriber; import net.neoforged.neoforge.common.data.ExistingFileHelper; import net.neoforged.neoforge.data.event.GatherDataEvent; +import sereneseasons.datagen.models.SSModelProvider; import sereneseasons.datagen.provider.SSRecipeProvider; @EventBusSubscriber(bus = EventBusSubscriber.Bus.MOD) public class DataGenerationHandler { @SubscribeEvent - public static void onGatherData(GatherDataEvent event) + public static void onGatherData(GatherDataEvent.Client event) { DataGenerator generator = event.getGenerator(); PackOutput output = generator.getPackOutput(); ExistingFileHelper existingFileHelper = event.getExistingFileHelper(); // Client - generator.addProvider(event.includeClient(), new SSBlockStateProvider(output, existingFileHelper)); - generator.addProvider(event.includeClient(), new SSItemModelProvider(output, existingFileHelper)); + generator.addProvider(true, new SSModelProvider(output)); // Recipes - generator.addProvider(event.includeServer(), new SSRecipeProvider.Runner(output, event.getLookupProvider())); + generator.addProvider(true, new SSRecipeProvider.Runner(output, event.getLookupProvider())); } } diff --git a/neoforge/src/main/java/sereneseasons/datagen/SSBlockStateProvider.java b/neoforge/src/main/java/sereneseasons/datagen/SSBlockStateProvider.java deleted file mode 100644 index 71d21f73..00000000 --- a/neoforge/src/main/java/sereneseasons/datagen/SSBlockStateProvider.java +++ /dev/null @@ -1,61 +0,0 @@ -/******************************************************************************* - * Copyright 2022, the Glitchfiend Team. - * All rights reserved. - ******************************************************************************/ -package sereneseasons.datagen; - -import net.minecraft.data.PackOutput; -import net.minecraft.resources.ResourceLocation; -import net.neoforged.neoforge.client.model.generators.*; -import net.neoforged.neoforge.common.data.ExistingFileHelper; -import sereneseasons.api.SSBlocks; -import sereneseasons.api.season.Season; -import sereneseasons.block.SeasonSensorBlock; -import sereneseasons.core.SereneSeasons; - -import java.util.Arrays; -import java.util.Map; -import java.util.stream.Collectors; - -public class SSBlockStateProvider extends BlockStateProvider -{ - public SSBlockStateProvider(PackOutput output, ExistingFileHelper exFileHelper) - { - super(output, SereneSeasons.MOD_ID, exFileHelper); - } - - @Override - protected void registerStatesAndModels() - { - this.registerSeasonSensor(); - } - - public void registerSeasonSensor() - { - Map models = Arrays.stream(Season.values()).collect(Collectors.toMap(key -> key, this::seasonSensor)); - getVariantBuilder(SSBlocks.SEASON_SENSOR) - .forAllStates(state -> { - Season season = Season.values()[state.getValue(SeasonSensorBlock.SEASON)]; - return ConfiguredModel.builder() - .modelFile(models.get(season)) - .build(); - }); - - this.simpleBlockItem(SSBlocks.SEASON_SENSOR, models.get(Season.SPRING)); - } - - public BlockModelBuilder seasonSensor(Season season) - { - String name = "season_sensor_" + season.name().toLowerCase(); - ResourceLocation topTexture = ResourceLocation.fromNamespaceAndPath(SereneSeasons.MOD_ID, ModelProvider.BLOCK_FOLDER + "/" + name + "_top"); - ResourceLocation sideTexture = ResourceLocation.fromNamespaceAndPath(SereneSeasons.MOD_ID, ModelProvider.BLOCK_FOLDER + "/season_sensor_side"); - return this.daylightDetector(name, topTexture, sideTexture); - } - - public BlockModelBuilder daylightDetector(String name, ResourceLocation top, ResourceLocation side) - { - return this.models().withExistingParent(name, ModelProvider.BLOCK_FOLDER + "/template_daylight_detector") - .texture("top", top) - .texture("side", side); - } -} diff --git a/neoforge/src/main/java/sereneseasons/datagen/SSItemModelProvider.java b/neoforge/src/main/java/sereneseasons/datagen/SSItemModelProvider.java deleted file mode 100644 index 9fc3b7f9..00000000 --- a/neoforge/src/main/java/sereneseasons/datagen/SSItemModelProvider.java +++ /dev/null @@ -1,73 +0,0 @@ -/******************************************************************************* - * Copyright 2022, the Glitchfiend Team. - * All rights reserved. - ******************************************************************************/ -package sereneseasons.datagen; - -import net.minecraft.data.PackOutput; -import net.minecraft.resources.ResourceLocation; -import net.neoforged.neoforge.client.model.generators.ItemModelProvider; -import net.neoforged.neoforge.client.model.generators.ModelFile; -import net.neoforged.neoforge.common.data.ExistingFileHelper; -import sereneseasons.api.SSItems; -import sereneseasons.core.SereneSeasons; -import sereneseasons.item.CalendarType; - -public class SSItemModelProvider extends ItemModelProvider -{ - public SSItemModelProvider(PackOutput output, ExistingFileHelper existingFileHelper) - { - super(output, SereneSeasons.MOD_ID, existingFileHelper); - } - - @Override - protected void registerModels() - { - this.basicItem(SSItems.SS_ICON); - this.registerCalendarModels(); - } - private void registerCalendarModels() - { - var calendar = getBuilder(location("calendar").toString()).parent(new ModelFile.UncheckedModelFile("item/generated")); - var calendarNull = this.basicItem(location("calendar_null")); - ModelFile[] calendarStandard = new ModelFile[12]; - ModelFile[] calendarTropical = new ModelFile[6]; - - // Populate standard and tropical arrays - for (int i = 0; i < 12; i++) - { - String pathIndex = String.format("%02d", i); - calendarStandard[i] = this.basicItem(location("calendar_" + pathIndex)); - if (i < 6) calendarTropical[i] = this.basicItem(location("tropical_calendar_" + pathIndex)); - } - - // Standard calendar - for (int i = 0; i < 12; i++) - { - calendar.override() - .predicate(location("seasontype"), CalendarType.STANDARD.ordinal()) - .predicate(location("time"), (float)i / 12.0F) - .model(calendarStandard[i]); - } - - // Tropical calendar - for (int i = 0; i < 12; i++) - { - calendar.override() - .predicate(location("seasontype"), CalendarType.TROPICAL.ordinal()) - .predicate(location("time"), (float)i / 12.0F) - .model(calendarTropical[((i + 3) / 2) % 6]); - } - - // Null calendar - calendar.override() - .predicate(location("seasontype"), CalendarType.NONE.ordinal()) - .predicate(location("time"), 0.0f) - .model(calendarNull); - } - - private static ResourceLocation location(String name) - { - return ResourceLocation.fromNamespaceAndPath(SereneSeasons.MOD_ID, name); - } -} diff --git a/neoforge/src/main/java/sereneseasons/datagen/models/SSBlockModelGenerators.java b/neoforge/src/main/java/sereneseasons/datagen/models/SSBlockModelGenerators.java new file mode 100644 index 00000000..efc85472 --- /dev/null +++ b/neoforge/src/main/java/sereneseasons/datagen/models/SSBlockModelGenerators.java @@ -0,0 +1,77 @@ +/******************************************************************************* + * Copyright 2024, the Glitchfiend Team. + * All rights reserved. + ******************************************************************************/ +package sereneseasons.datagen.models; + +import net.minecraft.client.data.models.BlockModelGenerators; +import net.minecraft.client.data.models.ItemModelOutput; +import net.minecraft.client.data.models.blockstates.*; +import net.minecraft.client.data.models.model.*; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.level.block.Blocks; +import net.minecraft.world.level.block.state.properties.BlockStateProperties; +import sereneseasons.api.SSBlocks; +import sereneseasons.api.season.Season; +import sereneseasons.block.SeasonSensorBlock; + +import java.util.function.BiConsumer; +import java.util.function.Consumer; + +public class SSBlockModelGenerators extends BlockModelGenerators +{ + final Consumer blockStateOutput; + final BiConsumer modelOutput; + + public SSBlockModelGenerators(Consumer blockStateOutput, ItemModelOutput itemModelOutput, BiConsumer modelOutput) + { + super(blockStateOutput, itemModelOutput, modelOutput); + this.blockStateOutput = blockStateOutput; + this.modelOutput = modelOutput; + } + + private void createSeasonSensor() + { + ResourceLocation sideTexture = TextureMapping.getBlockTexture(SSBlocks.SEASON_SENSOR, "_side"); + TextureMapping textures = new TextureMapping() + .put(TextureSlot.TOP, TextureMapping.getBlockTexture(SSBlocks.SEASON_SENSOR, "_summer_top")) + .put(TextureSlot.SIDE, sideTexture); + TextureMapping autumnTextures = new TextureMapping() + .put(TextureSlot.TOP, TextureMapping.getBlockTexture(SSBlocks.SEASON_SENSOR, "_autumn_top")) + .put(TextureSlot.SIDE, sideTexture); + TextureMapping winterTextures = new TextureMapping() + .put(TextureSlot.TOP, TextureMapping.getBlockTexture(SSBlocks.SEASON_SENSOR, "_winter_top")) + .put(TextureSlot.SIDE, sideTexture); + TextureMapping springTextures = new TextureMapping() + .put(TextureSlot.TOP, TextureMapping.getBlockTexture(SSBlocks.SEASON_SENSOR, "_spring_top")) + .put(TextureSlot.SIDE, sideTexture); + + this.blockStateOutput.accept( + MultiVariantGenerator.multiVariant(SSBlocks.SEASON_SENSOR).with( + PropertyDispatch.property(SeasonSensorBlock.SEASON) + .select( + Season.SUMMER.ordinal(), + Variant.variant().with(VariantProperties.MODEL, ModelTemplates.DAYLIGHT_DETECTOR.createWithSuffix(SSBlocks.SEASON_SENSOR, "_summer", textures, this.modelOutput)) + ) + .select( + Season.AUTUMN.ordinal(), + Variant.variant().with(VariantProperties.MODEL, ModelTemplates.DAYLIGHT_DETECTOR.createWithSuffix(SSBlocks.SEASON_SENSOR, "_autumn", autumnTextures, this.modelOutput)) + ) + .select( + Season.WINTER.ordinal(), + Variant.variant().with(VariantProperties.MODEL, ModelTemplates.DAYLIGHT_DETECTOR.createWithSuffix(SSBlocks.SEASON_SENSOR, "_winter", winterTextures, this.modelOutput)) + ) + .select( + Season.SPRING.ordinal(), + Variant.variant().with(VariantProperties.MODEL, ModelTemplates.DAYLIGHT_DETECTOR.create(SSBlocks.SEASON_SENSOR, springTextures, this.modelOutput)) + ) + ) + ); + } + + @Override + public void run() + { + this.createSeasonSensor(); + } +} diff --git a/neoforge/src/main/java/sereneseasons/datagen/models/SSItemModelGenerators.java b/neoforge/src/main/java/sereneseasons/datagen/models/SSItemModelGenerators.java new file mode 100644 index 00000000..782121ed --- /dev/null +++ b/neoforge/src/main/java/sereneseasons/datagen/models/SSItemModelGenerators.java @@ -0,0 +1,80 @@ +/******************************************************************************* + * Copyright 2024, the Glitchfiend Team. + * All rights reserved. + ******************************************************************************/ +package sereneseasons.datagen.models; + +import net.minecraft.client.data.models.ItemModelGenerators; +import net.minecraft.client.data.models.ItemModelOutput; +import net.minecraft.client.data.models.model.ItemModelUtils; +import net.minecraft.client.data.models.model.ModelInstance; +import net.minecraft.client.data.models.model.ModelTemplates; +import net.minecraft.client.renderer.item.ItemModel; +import net.minecraft.client.renderer.item.RangeSelectItemModel; +import net.minecraft.client.renderer.item.properties.numeric.Time; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.item.Item; +import net.neoforged.neoforge.client.model.generators.ModelFile; +import sereneseasons.api.SSItems; +import sereneseasons.client.item.ContextCalendarType; +import sereneseasons.client.item.SeasonTimeProperty; +import sereneseasons.item.CalendarType; + +import java.util.ArrayList; +import java.util.List; +import java.util.Locale; +import java.util.function.BiConsumer; + +public class SSItemModelGenerators extends ItemModelGenerators +{ + private final ItemModelOutput itemModelOutput; + private final BiConsumer modelOutput; + + public SSItemModelGenerators(ItemModelOutput itemModelOutput, BiConsumer modelOutput) { + super(itemModelOutput, modelOutput); + this.itemModelOutput = itemModelOutput; + this.modelOutput = modelOutput; + } + + public void generateCalendarItem(Item item) { + // Null calendar + ItemModel.Unbaked nullCalendar = ItemModelUtils.plainModel(this.createFlatItemModel(item, "_null", ModelTemplates.FLAT_ITEM)); + + List standardEntries = new ArrayList<>(); + List tropicalEntries = new ArrayList<>(); + + ItemModel.Unbaked[] standardModels = new ItemModel.Unbaked[12]; + ItemModel.Unbaked[] tropicalModels = new ItemModel.Unbaked[6]; + + + // Create standard entries and tropical models + for (int i = 0; i < 12; i++) + { + standardModels[i] = ItemModelUtils.plainModel(this.createFlatItemModel(item, String.format("_%02d", i), ModelTemplates.FLAT_ITEM)); + standardEntries.add(ItemModelUtils.override(standardModels[i], i / 12.0F)); + if (i < 6) tropicalModels[i] = ItemModelUtils.plainModel(this.createFlatItemModel(item, String.format("_tropical_%02d", i), ModelTemplates.FLAT_ITEM)); + } + + // Create tropical overrides + for (int i = 0; i < 12; i++) + { + tropicalEntries.add(ItemModelUtils.override(tropicalModels[((i + 3) / 2) % 6], i / 12.0F)); + } + + this.itemModelOutput + .accept( + item, + ItemModelUtils.select(new ContextCalendarType(), + ItemModelUtils.when(CalendarType.STANDARD, ItemModelUtils.rangeSelect(new SeasonTimeProperty(), 1.0F, standardEntries)), + ItemModelUtils.when(CalendarType.TROPICAL, ItemModelUtils.rangeSelect(new SeasonTimeProperty(), 1.0F, tropicalEntries)), + ItemModelUtils.when(CalendarType.NONE, nullCalendar)) + ); + } + + @Override + public void run() + { + this.generateFlatItem(SSItems.SS_ICON, ModelTemplates.FLAT_ITEM); + this.generateCalendarItem(SSItems.CALENDAR); + } +} diff --git a/neoforge/src/main/java/sereneseasons/datagen/models/SSModelProvider.java b/neoforge/src/main/java/sereneseasons/datagen/models/SSModelProvider.java new file mode 100644 index 00000000..0b61283d --- /dev/null +++ b/neoforge/src/main/java/sereneseasons/datagen/models/SSModelProvider.java @@ -0,0 +1,38 @@ +/******************************************************************************* + * Copyright 2024, the Glitchfiend Team. + * All rights reserved. + ******************************************************************************/ +package sereneseasons.datagen.models; + +import glitchcore.data.ModelProviderBase; +import net.minecraft.client.data.models.BlockModelGenerators; +import net.minecraft.client.data.models.ItemModelGenerators; +import net.minecraft.client.data.models.ItemModelOutput; +import net.minecraft.client.data.models.blockstates.BlockStateGenerator; +import net.minecraft.client.data.models.model.ModelInstance; +import net.minecraft.data.PackOutput; +import net.minecraft.resources.ResourceLocation; +import sereneseasons.core.SereneSeasons; + +import java.util.function.BiConsumer; +import java.util.function.Consumer; + +public class SSModelProvider extends ModelProviderBase +{ + public SSModelProvider(PackOutput output) + { + super(output, SereneSeasons.MOD_ID); + } + + @Override + protected BlockModelGenerators createBlockModelGenerators(Consumer blockStateOutput, ItemModelOutput itemModelOutput, BiConsumer modelOutput) + { + return new SSBlockModelGenerators(blockStateOutput, itemModelOutput, modelOutput); + } + + @Override + protected ItemModelGenerators createItemModelGenerators(ItemModelOutput itemModelOutput, BiConsumer modelOutput) + { + return new SSItemModelGenerators(itemModelOutput, modelOutput); + } +} diff --git a/neoforge/src/main/resources/META-INF/accesstransformer.cfg b/neoforge/src/main/resources/META-INF/accesstransformer.cfg index 736b2da6..ad8bb949 100644 --- a/neoforge/src/main/resources/META-INF/accesstransformer.cfg +++ b/neoforge/src/main/resources/META-INF/accesstransformer.cfg @@ -14,4 +14,6 @@ public net.minecraft.world.level.biome.Biome getTemperature(Lnet/minecraft/core/ # Commands public net.minecraft.commands.synchronization.ArgumentTypeInfos BY_CLASS -public net.minecraft.world.level.block.entity.BlockEntityType (Lnet/minecraft/world/level/block/entity/BlockEntityType$BlockEntitySupplier;Ljava/util/Set;)V \ No newline at end of file +public net.minecraft.world.level.block.entity.BlockEntityType (Lnet/minecraft/world/level/block/entity/BlockEntityType$BlockEntitySupplier;Ljava/util/Set;)V + +public net.minecraft.client.data.models.ItemModelGenerators *() \ No newline at end of file