Dyed toolbox fixes

- Add in-world toolbox dyeing
- Fix toolbox dyeing recipe not keeping stack NBT
- Fix toolbox handle rendering on solid layer
- Fix shadows for items on belts
- Clean up other in-world dyeing and dyed block code
This commit is contained in:
PepperBell 2021-10-30 12:43:34 -07:00
parent 2db2892033
commit fd1990f732
82 changed files with 365 additions and 1816 deletions

View file

@ -1879,41 +1879,10 @@ f2dc28c600011e6e8e515cb4d56118b1bd45b743 data/create/advancements/recipes/create
dd487f98c411f1ff22cb7fc208b8cc24b27deb2f data/create/advancements/recipes/create.base/crafting/appliances/dough.json
911159091a9674c36e8cd49f56f63e5442988e84 data/create/advancements/recipes/create.base/crafting/appliances/linked_controller.json
51cdcf168087f47e4458eed7543d227da1ee5ca0 data/create/advancements/recipes/create.base/crafting/appliances/tree_fertilizer.json
d06d9445256ae19d0a8a37e97983b168fd4d774e data/create/advancements/recipes/create.base/crafting/curiosities/black_toolbox_from_main_toolbox.json
343846c20104684b3a948e5c3a9948dd30839808 data/create/advancements/recipes/create.base/crafting/curiosities/black_toolbox_from_other_toolbox.json
acdf76187497b3101e9ec6101e2164e11277a68a data/create/advancements/recipes/create.base/crafting/curiosities/blue_toolbox_from_main_toolbox.json
3a8b083c1f4c67feade27a877e774f435b8e58da data/create/advancements/recipes/create.base/crafting/curiosities/blue_toolbox_from_other_toolbox.json
bb138bedd2aec741fa54b6b52be384fdbd741249 data/create/advancements/recipes/create.base/crafting/curiosities/brown_toolbox.json
502e8ea5b0f9cc0ca90a1018d907ffe6f3b051a3 data/create/advancements/recipes/create.base/crafting/curiosities/brown_toolbox_from_other_toolbox.json
f2afe58a26566aac8abce76f0ab6d0924c5badb6 data/create/advancements/recipes/create.base/crafting/curiosities/cyan_toolbox_from_main_toolbox.json
dea244d3f78e4aaf13132d48dcf071e5046bf154 data/create/advancements/recipes/create.base/crafting/curiosities/cyan_toolbox_from_other_toolbox.json
e28c741eed426658edda99c52eeacb4ccdcac0c2 data/create/advancements/recipes/create.base/crafting/curiosities/gray_toolbox_from_main_toolbox.json
b8df907dc00d4c28e74ba59faf9d66765ea43a6f data/create/advancements/recipes/create.base/crafting/curiosities/gray_toolbox_from_other_toolbox.json
ecd1f21c20804cbe65e7ace983d9a78c5003e8c0 data/create/advancements/recipes/create.base/crafting/curiosities/green_toolbox_from_main_toolbox.json
7969a391535586641e8da6ae6cd6d0eff2090369 data/create/advancements/recipes/create.base/crafting/curiosities/green_toolbox_from_other_toolbox.json
f174c871c7a4e8403bbf17c0e13572dc6cb31f90 data/create/advancements/recipes/create.base/crafting/curiosities/light_blue_toolbox_from_main_toolbox.json
b65a5e3f181c7ae5b63f89a51a40ad4d5d01827b data/create/advancements/recipes/create.base/crafting/curiosities/light_blue_toolbox_from_other_toolbox.json
d89ac200d23375a24cd62847e2be3108738ec948 data/create/advancements/recipes/create.base/crafting/curiosities/light_gray_toolbox_from_main_toolbox.json
2809c5b8f3d51b3319ae514006ec8baf38c7a8c2 data/create/advancements/recipes/create.base/crafting/curiosities/light_gray_toolbox_from_other_toolbox.json
152eacfd9d34c377d7380663542c22cea88b92ca data/create/advancements/recipes/create.base/crafting/curiosities/lime_toolbox_from_main_toolbox.json
acc82b0304550c4a0f8247c12b9fe92465ceee8b data/create/advancements/recipes/create.base/crafting/curiosities/lime_toolbox_from_other_toolbox.json
e89c8d11f098150a87e4724943269f421b3d63f0 data/create/advancements/recipes/create.base/crafting/curiosities/magenta_toolbox_from_main_toolbox.json
357899f0b14102faf4fff8bf290f854c2af38ba4 data/create/advancements/recipes/create.base/crafting/curiosities/magenta_toolbox_from_other_toolbox.json
d531f87f425d199aee4777a588c1cd6cab6f5173 data/create/advancements/recipes/create.base/crafting/curiosities/minecart_coupling.json
7736bf31def6c117a92cfdc7ff007e51f10a7fa7 data/create/advancements/recipes/create.base/crafting/curiosities/orange_toolbox_from_main_toolbox.json
6eb8ae16950fb299f0762b20badac6beb88b9482 data/create/advancements/recipes/create.base/crafting/curiosities/orange_toolbox_from_other_toolbox.json
a8c72e7e02fd0843d33fa4c5d43de81f29bc3aa4 data/create/advancements/recipes/create.base/crafting/curiosities/peculiar_bell.json
8d9894f687a21da528a3065ee1041ff1cccb3428 data/create/advancements/recipes/create.base/crafting/curiosities/pink_toolbox_from_main_toolbox.json
988ece3fc6f3257826f16107b995c5649b2e4e85 data/create/advancements/recipes/create.base/crafting/curiosities/pink_toolbox_from_other_toolbox.json
c645dd051a8d06fdb2d09083ba632c44b7794e9e data/create/advancements/recipes/create.base/crafting/curiosities/purple_toolbox_from_main_toolbox.json
2a4d5fa85d0c306791c67f283c4298200f2a6cd8 data/create/advancements/recipes/create.base/crafting/curiosities/purple_toolbox_from_other_toolbox.json
0567ca2d349306df05adaebe3e056fc4f75e287f data/create/advancements/recipes/create.base/crafting/curiosities/red_toolbox_from_main_toolbox.json
c71be67bfa6fac32be60424049cb221e10840016 data/create/advancements/recipes/create.base/crafting/curiosities/red_toolbox_from_other_toolbox.json
2eef3201017af03f6a2f0f015645e3ff5e25d9c1 data/create/advancements/recipes/create.base/crafting/curiosities/wand_of_symmetry.json
bb1650d8a9a5877bf64964a2d92f8a93364637f4 data/create/advancements/recipes/create.base/crafting/curiosities/white_toolbox_from_main_toolbox.json
514974b3b902a910358453b10619cbc1ac13476d data/create/advancements/recipes/create.base/crafting/curiosities/white_toolbox_from_other_toolbox.json
13180b17064fedda97cfaa18e4158e2bfcd6b332 data/create/advancements/recipes/create.base/crafting/curiosities/yellow_toolbox_from_main_toolbox.json
8ab0365e0aa21ecd1a671d7c0b8717626951e2cb data/create/advancements/recipes/create.base/crafting/curiosities/yellow_toolbox_from_other_toolbox.json
80155fa8e28e7de87adad3dc2cd79564496d7ef7 data/create/advancements/recipes/create.base/crafting/kinetics/adjustable_chain_gearshift.json
92416ced6ede6965fd728e1c7336bb05a3e41ea2 data/create/advancements/recipes/create.base/crafting/kinetics/analog_lever.json
3e9753006da898d4569bbeabf95997e8c90847c8 data/create/advancements/recipes/create.base/crafting/kinetics/attribute_filter.json
@ -3029,41 +2998,11 @@ c077375d16b4505e52548613fbc9356993556e6b data/create/recipes/crafting/appliances
75cdbd88973a8ca943ebe890153b01a344b96b01 data/create/recipes/crafting/appliances/linked_controller.json
7b5f863dda3d05a79cb85943a178eba0bd8a7dc7 data/create/recipes/crafting/appliances/slime_ball.json
b159ba84428eee6ef6e23df1766f2a18f2c8a63e data/create/recipes/crafting/appliances/tree_fertilizer.json
0de0507bc9bb44271b21a64cceb7cd94f7dbe61d data/create/recipes/crafting/curiosities/black_toolbox_from_main_toolbox.json
e89b2dd52cfe2d4d723f49aeec8f4f8c37a82dca data/create/recipes/crafting/curiosities/black_toolbox_from_other_toolbox.json
5588aa83b6fbb2ee3dc01e95b3261ccc38e40ad1 data/create/recipes/crafting/curiosities/blue_toolbox_from_main_toolbox.json
19c9fe34e311e7a11114acc10cc3777fc95ed3ab data/create/recipes/crafting/curiosities/blue_toolbox_from_other_toolbox.json
4754ca20a7efdf382f32be150f38bdf4e8183fc4 data/create/recipes/crafting/curiosities/brown_toolbox.json
14a85c9011a6ca667ac83e95dd7e8eabfac4a4c5 data/create/recipes/crafting/curiosities/brown_toolbox_from_other_toolbox.json
39e6d65af1c8ca0dec19e5b15a2f0e28e69542eb data/create/recipes/crafting/curiosities/cyan_toolbox_from_main_toolbox.json
39e055d841536e691c798acc09145f821eeb32ae data/create/recipes/crafting/curiosities/cyan_toolbox_from_other_toolbox.json
567a09f08bbbd5fd8eb34555bb9e62e7066c8c93 data/create/recipes/crafting/curiosities/gray_toolbox_from_main_toolbox.json
f6ee1a69e32851487a753a27290c7fee163de87f data/create/recipes/crafting/curiosities/gray_toolbox_from_other_toolbox.json
5e0e201caff1f11092c8dc5a524bab00dec52848 data/create/recipes/crafting/curiosities/green_toolbox_from_main_toolbox.json
9c9d9e1c9a0b76561b2fd97fe5a9adc7660935af data/create/recipes/crafting/curiosities/green_toolbox_from_other_toolbox.json
3750f44691883b644ce80b869f69785a151c63ce data/create/recipes/crafting/curiosities/light_blue_toolbox_from_main_toolbox.json
3511ddf935de95789db27cd546b51835051b0612 data/create/recipes/crafting/curiosities/light_blue_toolbox_from_other_toolbox.json
6f6e22a1d7d27098dfa15cdd7a9dc841116dd085 data/create/recipes/crafting/curiosities/light_gray_toolbox_from_main_toolbox.json
b2d9ddb013d550f335c28a64360aad5a2c9ef109 data/create/recipes/crafting/curiosities/light_gray_toolbox_from_other_toolbox.json
0b55ab5174983f503355c52e6bff1cfb199d833b data/create/recipes/crafting/curiosities/lime_toolbox_from_main_toolbox.json
8e50132d045351427ad33aec3463437f93024970 data/create/recipes/crafting/curiosities/lime_toolbox_from_other_toolbox.json
8912a48550b1e763a75eb8db0412d39992350cde data/create/recipes/crafting/curiosities/magenta_toolbox_from_main_toolbox.json
53fa044e156eae089c3bdd037b168169f3dedde8 data/create/recipes/crafting/curiosities/magenta_toolbox_from_other_toolbox.json
660e92da2b1b6698b1c0df74bd74a56a25fb3eca data/create/recipes/crafting/curiosities/minecart_coupling.json
0639c9c090321f4f95576df3b79f73138dd47b37 data/create/recipes/crafting/curiosities/orange_toolbox_from_main_toolbox.json
8ff510405b3890f3de0f1f11b733f081a2abafaf data/create/recipes/crafting/curiosities/orange_toolbox_from_other_toolbox.json
1f8f96ab57363166b7e132a1dd082001a5a0d5f0 data/create/recipes/crafting/curiosities/peculiar_bell.json
a47f561abcf3521f1407101c37e13e5a888403be data/create/recipes/crafting/curiosities/pink_toolbox_from_main_toolbox.json
84a4f2a38a73aa704a6eadfa6e30942ceace60c6 data/create/recipes/crafting/curiosities/pink_toolbox_from_other_toolbox.json
4f158ed3edf7451d1c2aa7d50efbbc58a4d5b7d0 data/create/recipes/crafting/curiosities/purple_toolbox_from_main_toolbox.json
46d792a2e1252b42b4c7975a8c76c9b818cdfafe data/create/recipes/crafting/curiosities/purple_toolbox_from_other_toolbox.json
9f0adcbf9abe39cb8ae9dfc4ea02953f8103acc9 data/create/recipes/crafting/curiosities/red_toolbox_from_main_toolbox.json
574f0198e7f0c683ae96221ec69d3a88c39f10e6 data/create/recipes/crafting/curiosities/red_toolbox_from_other_toolbox.json
07b3ca3a3e44ee1f76c69132ffa6556e027e5b0e data/create/recipes/crafting/curiosities/toolbox_dyeing.json
fcbc04d0a7eaf820a74bc7e4736a4a581e0a9dff data/create/recipes/crafting/curiosities/wand_of_symmetry.json
ef8e81e889747a35669ccd5851e43d0349225115 data/create/recipes/crafting/curiosities/white_toolbox_from_main_toolbox.json
3222feaa77a392b45da97a410e268641998864c6 data/create/recipes/crafting/curiosities/white_toolbox_from_other_toolbox.json
71272236f542469e82b92f5208122b18f72f365d data/create/recipes/crafting/curiosities/yellow_toolbox_from_main_toolbox.json
56e3950037a751edd931942ccc52563228680cb2 data/create/recipes/crafting/curiosities/yellow_toolbox_from_other_toolbox.json
cc56d21a25286a9024e506dde9fa161230eaf46d data/create/recipes/crafting/kinetics/adjustable_chain_gearshift.json
88de51b451469698665b7319e5b9cfb9a87ae3e0 data/create/recipes/crafting/kinetics/analog_lever.json
cf1f3a6306d47025cebe153cf05949ef69ccbe5a data/create/recipes/crafting/kinetics/attribute_filter.json

View file

@ -1,32 +0,0 @@
{
"parent": "minecraft:recipes/root",
"rewards": {
"recipes": [
"create:crafting/curiosities/black_toolbox_from_main_toolbox"
]
},
"criteria": {
"has_toolbox": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"items": [
{
"tag": "create:toolboxes"
}
]
}
},
"has_the_recipe": {
"trigger": "minecraft:recipe_unlocked",
"conditions": {
"recipe": "create:crafting/curiosities/black_toolbox_from_main_toolbox"
}
}
},
"requirements": [
[
"has_toolbox",
"has_the_recipe"
]
]
}

View file

@ -1,32 +0,0 @@
{
"parent": "minecraft:recipes/root",
"rewards": {
"recipes": [
"create:crafting/curiosities/black_toolbox_from_other_toolbox"
]
},
"criteria": {
"has_toolbox": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"items": [
{
"tag": "create:toolboxes"
}
]
}
},
"has_the_recipe": {
"trigger": "minecraft:recipe_unlocked",
"conditions": {
"recipe": "create:crafting/curiosities/black_toolbox_from_other_toolbox"
}
}
},
"requirements": [
[
"has_toolbox",
"has_the_recipe"
]
]
}

View file

@ -1,32 +0,0 @@
{
"parent": "minecraft:recipes/root",
"rewards": {
"recipes": [
"create:crafting/curiosities/blue_toolbox_from_main_toolbox"
]
},
"criteria": {
"has_toolbox": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"items": [
{
"tag": "create:toolboxes"
}
]
}
},
"has_the_recipe": {
"trigger": "minecraft:recipe_unlocked",
"conditions": {
"recipe": "create:crafting/curiosities/blue_toolbox_from_main_toolbox"
}
}
},
"requirements": [
[
"has_toolbox",
"has_the_recipe"
]
]
}

View file

@ -1,32 +0,0 @@
{
"parent": "minecraft:recipes/root",
"rewards": {
"recipes": [
"create:crafting/curiosities/blue_toolbox_from_other_toolbox"
]
},
"criteria": {
"has_toolbox": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"items": [
{
"tag": "create:toolboxes"
}
]
}
},
"has_the_recipe": {
"trigger": "minecraft:recipe_unlocked",
"conditions": {
"recipe": "create:crafting/curiosities/blue_toolbox_from_other_toolbox"
}
}
},
"requirements": [
[
"has_toolbox",
"has_the_recipe"
]
]
}

View file

@ -1,32 +0,0 @@
{
"parent": "minecraft:recipes/root",
"rewards": {
"recipes": [
"create:crafting/curiosities/brown_toolbox_from_other_toolbox"
]
},
"criteria": {
"has_toolbox": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"items": [
{
"tag": "create:toolboxes"
}
]
}
},
"has_the_recipe": {
"trigger": "minecraft:recipe_unlocked",
"conditions": {
"recipe": "create:crafting/curiosities/brown_toolbox_from_other_toolbox"
}
}
},
"requirements": [
[
"has_toolbox",
"has_the_recipe"
]
]
}

View file

@ -1,32 +0,0 @@
{
"parent": "minecraft:recipes/root",
"rewards": {
"recipes": [
"create:crafting/curiosities/cyan_toolbox_from_main_toolbox"
]
},
"criteria": {
"has_toolbox": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"items": [
{
"tag": "create:toolboxes"
}
]
}
},
"has_the_recipe": {
"trigger": "minecraft:recipe_unlocked",
"conditions": {
"recipe": "create:crafting/curiosities/cyan_toolbox_from_main_toolbox"
}
}
},
"requirements": [
[
"has_toolbox",
"has_the_recipe"
]
]
}

View file

@ -1,32 +0,0 @@
{
"parent": "minecraft:recipes/root",
"rewards": {
"recipes": [
"create:crafting/curiosities/cyan_toolbox_from_other_toolbox"
]
},
"criteria": {
"has_toolbox": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"items": [
{
"tag": "create:toolboxes"
}
]
}
},
"has_the_recipe": {
"trigger": "minecraft:recipe_unlocked",
"conditions": {
"recipe": "create:crafting/curiosities/cyan_toolbox_from_other_toolbox"
}
}
},
"requirements": [
[
"has_toolbox",
"has_the_recipe"
]
]
}

View file

@ -1,32 +0,0 @@
{
"parent": "minecraft:recipes/root",
"rewards": {
"recipes": [
"create:crafting/curiosities/gray_toolbox_from_main_toolbox"
]
},
"criteria": {
"has_toolbox": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"items": [
{
"tag": "create:toolboxes"
}
]
}
},
"has_the_recipe": {
"trigger": "minecraft:recipe_unlocked",
"conditions": {
"recipe": "create:crafting/curiosities/gray_toolbox_from_main_toolbox"
}
}
},
"requirements": [
[
"has_toolbox",
"has_the_recipe"
]
]
}

View file

@ -1,32 +0,0 @@
{
"parent": "minecraft:recipes/root",
"rewards": {
"recipes": [
"create:crafting/curiosities/gray_toolbox_from_other_toolbox"
]
},
"criteria": {
"has_toolbox": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"items": [
{
"tag": "create:toolboxes"
}
]
}
},
"has_the_recipe": {
"trigger": "minecraft:recipe_unlocked",
"conditions": {
"recipe": "create:crafting/curiosities/gray_toolbox_from_other_toolbox"
}
}
},
"requirements": [
[
"has_toolbox",
"has_the_recipe"
]
]
}

View file

@ -1,32 +0,0 @@
{
"parent": "minecraft:recipes/root",
"rewards": {
"recipes": [
"create:crafting/curiosities/green_toolbox_from_main_toolbox"
]
},
"criteria": {
"has_toolbox": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"items": [
{
"tag": "create:toolboxes"
}
]
}
},
"has_the_recipe": {
"trigger": "minecraft:recipe_unlocked",
"conditions": {
"recipe": "create:crafting/curiosities/green_toolbox_from_main_toolbox"
}
}
},
"requirements": [
[
"has_toolbox",
"has_the_recipe"
]
]
}

View file

@ -1,32 +0,0 @@
{
"parent": "minecraft:recipes/root",
"rewards": {
"recipes": [
"create:crafting/curiosities/green_toolbox_from_other_toolbox"
]
},
"criteria": {
"has_toolbox": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"items": [
{
"tag": "create:toolboxes"
}
]
}
},
"has_the_recipe": {
"trigger": "minecraft:recipe_unlocked",
"conditions": {
"recipe": "create:crafting/curiosities/green_toolbox_from_other_toolbox"
}
}
},
"requirements": [
[
"has_toolbox",
"has_the_recipe"
]
]
}

View file

@ -1,32 +0,0 @@
{
"parent": "minecraft:recipes/root",
"rewards": {
"recipes": [
"create:crafting/curiosities/light_blue_toolbox_from_main_toolbox"
]
},
"criteria": {
"has_toolbox": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"items": [
{
"tag": "create:toolboxes"
}
]
}
},
"has_the_recipe": {
"trigger": "minecraft:recipe_unlocked",
"conditions": {
"recipe": "create:crafting/curiosities/light_blue_toolbox_from_main_toolbox"
}
}
},
"requirements": [
[
"has_toolbox",
"has_the_recipe"
]
]
}

View file

@ -1,32 +0,0 @@
{
"parent": "minecraft:recipes/root",
"rewards": {
"recipes": [
"create:crafting/curiosities/light_blue_toolbox_from_other_toolbox"
]
},
"criteria": {
"has_toolbox": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"items": [
{
"tag": "create:toolboxes"
}
]
}
},
"has_the_recipe": {
"trigger": "minecraft:recipe_unlocked",
"conditions": {
"recipe": "create:crafting/curiosities/light_blue_toolbox_from_other_toolbox"
}
}
},
"requirements": [
[
"has_toolbox",
"has_the_recipe"
]
]
}

View file

@ -1,32 +0,0 @@
{
"parent": "minecraft:recipes/root",
"rewards": {
"recipes": [
"create:crafting/curiosities/light_gray_toolbox_from_main_toolbox"
]
},
"criteria": {
"has_toolbox": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"items": [
{
"tag": "create:toolboxes"
}
]
}
},
"has_the_recipe": {
"trigger": "minecraft:recipe_unlocked",
"conditions": {
"recipe": "create:crafting/curiosities/light_gray_toolbox_from_main_toolbox"
}
}
},
"requirements": [
[
"has_toolbox",
"has_the_recipe"
]
]
}

View file

@ -1,32 +0,0 @@
{
"parent": "minecraft:recipes/root",
"rewards": {
"recipes": [
"create:crafting/curiosities/light_gray_toolbox_from_other_toolbox"
]
},
"criteria": {
"has_toolbox": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"items": [
{
"tag": "create:toolboxes"
}
]
}
},
"has_the_recipe": {
"trigger": "minecraft:recipe_unlocked",
"conditions": {
"recipe": "create:crafting/curiosities/light_gray_toolbox_from_other_toolbox"
}
}
},
"requirements": [
[
"has_toolbox",
"has_the_recipe"
]
]
}

View file

@ -1,32 +0,0 @@
{
"parent": "minecraft:recipes/root",
"rewards": {
"recipes": [
"create:crafting/curiosities/lime_toolbox_from_main_toolbox"
]
},
"criteria": {
"has_toolbox": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"items": [
{
"tag": "create:toolboxes"
}
]
}
},
"has_the_recipe": {
"trigger": "minecraft:recipe_unlocked",
"conditions": {
"recipe": "create:crafting/curiosities/lime_toolbox_from_main_toolbox"
}
}
},
"requirements": [
[
"has_toolbox",
"has_the_recipe"
]
]
}

View file

@ -1,32 +0,0 @@
{
"parent": "minecraft:recipes/root",
"rewards": {
"recipes": [
"create:crafting/curiosities/lime_toolbox_from_other_toolbox"
]
},
"criteria": {
"has_toolbox": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"items": [
{
"tag": "create:toolboxes"
}
]
}
},
"has_the_recipe": {
"trigger": "minecraft:recipe_unlocked",
"conditions": {
"recipe": "create:crafting/curiosities/lime_toolbox_from_other_toolbox"
}
}
},
"requirements": [
[
"has_toolbox",
"has_the_recipe"
]
]
}

View file

@ -1,32 +0,0 @@
{
"parent": "minecraft:recipes/root",
"rewards": {
"recipes": [
"create:crafting/curiosities/magenta_toolbox_from_main_toolbox"
]
},
"criteria": {
"has_toolbox": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"items": [
{
"tag": "create:toolboxes"
}
]
}
},
"has_the_recipe": {
"trigger": "minecraft:recipe_unlocked",
"conditions": {
"recipe": "create:crafting/curiosities/magenta_toolbox_from_main_toolbox"
}
}
},
"requirements": [
[
"has_toolbox",
"has_the_recipe"
]
]
}

View file

@ -1,32 +0,0 @@
{
"parent": "minecraft:recipes/root",
"rewards": {
"recipes": [
"create:crafting/curiosities/magenta_toolbox_from_other_toolbox"
]
},
"criteria": {
"has_toolbox": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"items": [
{
"tag": "create:toolboxes"
}
]
}
},
"has_the_recipe": {
"trigger": "minecraft:recipe_unlocked",
"conditions": {
"recipe": "create:crafting/curiosities/magenta_toolbox_from_other_toolbox"
}
}
},
"requirements": [
[
"has_toolbox",
"has_the_recipe"
]
]
}

View file

@ -1,32 +0,0 @@
{
"parent": "minecraft:recipes/root",
"rewards": {
"recipes": [
"create:crafting/curiosities/orange_toolbox_from_main_toolbox"
]
},
"criteria": {
"has_toolbox": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"items": [
{
"tag": "create:toolboxes"
}
]
}
},
"has_the_recipe": {
"trigger": "minecraft:recipe_unlocked",
"conditions": {
"recipe": "create:crafting/curiosities/orange_toolbox_from_main_toolbox"
}
}
},
"requirements": [
[
"has_toolbox",
"has_the_recipe"
]
]
}

View file

@ -1,32 +0,0 @@
{
"parent": "minecraft:recipes/root",
"rewards": {
"recipes": [
"create:crafting/curiosities/orange_toolbox_from_other_toolbox"
]
},
"criteria": {
"has_toolbox": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"items": [
{
"tag": "create:toolboxes"
}
]
}
},
"has_the_recipe": {
"trigger": "minecraft:recipe_unlocked",
"conditions": {
"recipe": "create:crafting/curiosities/orange_toolbox_from_other_toolbox"
}
}
},
"requirements": [
[
"has_toolbox",
"has_the_recipe"
]
]
}

View file

@ -1,32 +0,0 @@
{
"parent": "minecraft:recipes/root",
"rewards": {
"recipes": [
"create:crafting/curiosities/pink_toolbox_from_main_toolbox"
]
},
"criteria": {
"has_toolbox": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"items": [
{
"tag": "create:toolboxes"
}
]
}
},
"has_the_recipe": {
"trigger": "minecraft:recipe_unlocked",
"conditions": {
"recipe": "create:crafting/curiosities/pink_toolbox_from_main_toolbox"
}
}
},
"requirements": [
[
"has_toolbox",
"has_the_recipe"
]
]
}

View file

@ -1,32 +0,0 @@
{
"parent": "minecraft:recipes/root",
"rewards": {
"recipes": [
"create:crafting/curiosities/pink_toolbox_from_other_toolbox"
]
},
"criteria": {
"has_toolbox": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"items": [
{
"tag": "create:toolboxes"
}
]
}
},
"has_the_recipe": {
"trigger": "minecraft:recipe_unlocked",
"conditions": {
"recipe": "create:crafting/curiosities/pink_toolbox_from_other_toolbox"
}
}
},
"requirements": [
[
"has_toolbox",
"has_the_recipe"
]
]
}

View file

@ -1,32 +0,0 @@
{
"parent": "minecraft:recipes/root",
"rewards": {
"recipes": [
"create:crafting/curiosities/purple_toolbox_from_main_toolbox"
]
},
"criteria": {
"has_toolbox": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"items": [
{
"tag": "create:toolboxes"
}
]
}
},
"has_the_recipe": {
"trigger": "minecraft:recipe_unlocked",
"conditions": {
"recipe": "create:crafting/curiosities/purple_toolbox_from_main_toolbox"
}
}
},
"requirements": [
[
"has_toolbox",
"has_the_recipe"
]
]
}

View file

@ -1,32 +0,0 @@
{
"parent": "minecraft:recipes/root",
"rewards": {
"recipes": [
"create:crafting/curiosities/purple_toolbox_from_other_toolbox"
]
},
"criteria": {
"has_toolbox": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"items": [
{
"tag": "create:toolboxes"
}
]
}
},
"has_the_recipe": {
"trigger": "minecraft:recipe_unlocked",
"conditions": {
"recipe": "create:crafting/curiosities/purple_toolbox_from_other_toolbox"
}
}
},
"requirements": [
[
"has_toolbox",
"has_the_recipe"
]
]
}

View file

@ -1,32 +0,0 @@
{
"parent": "minecraft:recipes/root",
"rewards": {
"recipes": [
"create:crafting/curiosities/red_toolbox_from_main_toolbox"
]
},
"criteria": {
"has_toolbox": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"items": [
{
"tag": "create:toolboxes"
}
]
}
},
"has_the_recipe": {
"trigger": "minecraft:recipe_unlocked",
"conditions": {
"recipe": "create:crafting/curiosities/red_toolbox_from_main_toolbox"
}
}
},
"requirements": [
[
"has_toolbox",
"has_the_recipe"
]
]
}

View file

@ -1,32 +0,0 @@
{
"parent": "minecraft:recipes/root",
"rewards": {
"recipes": [
"create:crafting/curiosities/red_toolbox_from_other_toolbox"
]
},
"criteria": {
"has_toolbox": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"items": [
{
"tag": "create:toolboxes"
}
]
}
},
"has_the_recipe": {
"trigger": "minecraft:recipe_unlocked",
"conditions": {
"recipe": "create:crafting/curiosities/red_toolbox_from_other_toolbox"
}
}
},
"requirements": [
[
"has_toolbox",
"has_the_recipe"
]
]
}

View file

@ -1,32 +0,0 @@
{
"parent": "minecraft:recipes/root",
"rewards": {
"recipes": [
"create:crafting/curiosities/white_toolbox_from_main_toolbox"
]
},
"criteria": {
"has_toolbox": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"items": [
{
"tag": "create:toolboxes"
}
]
}
},
"has_the_recipe": {
"trigger": "minecraft:recipe_unlocked",
"conditions": {
"recipe": "create:crafting/curiosities/white_toolbox_from_main_toolbox"
}
}
},
"requirements": [
[
"has_toolbox",
"has_the_recipe"
]
]
}

View file

@ -1,32 +0,0 @@
{
"parent": "minecraft:recipes/root",
"rewards": {
"recipes": [
"create:crafting/curiosities/white_toolbox_from_other_toolbox"
]
},
"criteria": {
"has_toolbox": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"items": [
{
"tag": "create:toolboxes"
}
]
}
},
"has_the_recipe": {
"trigger": "minecraft:recipe_unlocked",
"conditions": {
"recipe": "create:crafting/curiosities/white_toolbox_from_other_toolbox"
}
}
},
"requirements": [
[
"has_toolbox",
"has_the_recipe"
]
]
}

View file

@ -1,32 +0,0 @@
{
"parent": "minecraft:recipes/root",
"rewards": {
"recipes": [
"create:crafting/curiosities/yellow_toolbox_from_main_toolbox"
]
},
"criteria": {
"has_toolbox": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"items": [
{
"tag": "create:toolboxes"
}
]
}
},
"has_the_recipe": {
"trigger": "minecraft:recipe_unlocked",
"conditions": {
"recipe": "create:crafting/curiosities/yellow_toolbox_from_main_toolbox"
}
}
},
"requirements": [
[
"has_toolbox",
"has_the_recipe"
]
]
}

View file

@ -1,32 +0,0 @@
{
"parent": "minecraft:recipes/root",
"rewards": {
"recipes": [
"create:crafting/curiosities/yellow_toolbox_from_other_toolbox"
]
},
"criteria": {
"has_toolbox": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"items": [
{
"tag": "create:toolboxes"
}
]
}
},
"has_the_recipe": {
"trigger": "minecraft:recipe_unlocked",
"conditions": {
"recipe": "create:crafting/curiosities/yellow_toolbox_from_other_toolbox"
}
}
},
"requirements": [
[
"has_toolbox",
"has_the_recipe"
]
]
}

View file

@ -1,18 +0,0 @@
{
"type": "minecraft:crafting_shaped",
"pattern": [
"#",
"-"
],
"key": {
"#": {
"tag": "forge:dyes/black"
},
"-": {
"item": "create:brown_toolbox"
}
},
"result": {
"item": "create:black_toolbox"
}
}

View file

@ -1,18 +0,0 @@
{
"type": "minecraft:crafting_shaped",
"pattern": [
"#",
"-"
],
"key": {
"#": {
"tag": "forge:dyes/black"
},
"-": {
"tag": "create:toolboxes"
}
},
"result": {
"item": "create:black_toolbox"
}
}

View file

@ -1,18 +0,0 @@
{
"type": "minecraft:crafting_shaped",
"pattern": [
"#",
"-"
],
"key": {
"#": {
"tag": "forge:dyes/blue"
},
"-": {
"item": "create:brown_toolbox"
}
},
"result": {
"item": "create:blue_toolbox"
}
}

View file

@ -1,18 +0,0 @@
{
"type": "minecraft:crafting_shaped",
"pattern": [
"#",
"-"
],
"key": {
"#": {
"tag": "forge:dyes/blue"
},
"-": {
"tag": "create:toolboxes"
}
},
"result": {
"item": "create:blue_toolbox"
}
}

View file

@ -1,18 +0,0 @@
{
"type": "minecraft:crafting_shaped",
"pattern": [
"#",
"-"
],
"key": {
"#": {
"tag": "forge:dyes/brown"
},
"-": {
"tag": "create:toolboxes"
}
},
"result": {
"item": "create:brown_toolbox"
}
}

View file

@ -1,18 +0,0 @@
{
"type": "minecraft:crafting_shaped",
"pattern": [
"#",
"-"
],
"key": {
"#": {
"tag": "forge:dyes/cyan"
},
"-": {
"item": "create:brown_toolbox"
}
},
"result": {
"item": "create:cyan_toolbox"
}
}

View file

@ -1,18 +0,0 @@
{
"type": "minecraft:crafting_shaped",
"pattern": [
"#",
"-"
],
"key": {
"#": {
"tag": "forge:dyes/cyan"
},
"-": {
"tag": "create:toolboxes"
}
},
"result": {
"item": "create:cyan_toolbox"
}
}

View file

@ -1,18 +0,0 @@
{
"type": "minecraft:crafting_shaped",
"pattern": [
"#",
"-"
],
"key": {
"#": {
"tag": "forge:dyes/gray"
},
"-": {
"item": "create:brown_toolbox"
}
},
"result": {
"item": "create:gray_toolbox"
}
}

View file

@ -1,18 +0,0 @@
{
"type": "minecraft:crafting_shaped",
"pattern": [
"#",
"-"
],
"key": {
"#": {
"tag": "forge:dyes/gray"
},
"-": {
"tag": "create:toolboxes"
}
},
"result": {
"item": "create:gray_toolbox"
}
}

View file

@ -1,18 +0,0 @@
{
"type": "minecraft:crafting_shaped",
"pattern": [
"#",
"-"
],
"key": {
"#": {
"tag": "forge:dyes/green"
},
"-": {
"item": "create:brown_toolbox"
}
},
"result": {
"item": "create:green_toolbox"
}
}

View file

@ -1,18 +0,0 @@
{
"type": "minecraft:crafting_shaped",
"pattern": [
"#",
"-"
],
"key": {
"#": {
"tag": "forge:dyes/green"
},
"-": {
"tag": "create:toolboxes"
}
},
"result": {
"item": "create:green_toolbox"
}
}

View file

@ -1,18 +0,0 @@
{
"type": "minecraft:crafting_shaped",
"pattern": [
"#",
"-"
],
"key": {
"#": {
"tag": "forge:dyes/light_blue"
},
"-": {
"item": "create:brown_toolbox"
}
},
"result": {
"item": "create:light_blue_toolbox"
}
}

View file

@ -1,18 +0,0 @@
{
"type": "minecraft:crafting_shaped",
"pattern": [
"#",
"-"
],
"key": {
"#": {
"tag": "forge:dyes/light_blue"
},
"-": {
"tag": "create:toolboxes"
}
},
"result": {
"item": "create:light_blue_toolbox"
}
}

View file

@ -1,18 +0,0 @@
{
"type": "minecraft:crafting_shaped",
"pattern": [
"#",
"-"
],
"key": {
"#": {
"tag": "forge:dyes/light_gray"
},
"-": {
"item": "create:brown_toolbox"
}
},
"result": {
"item": "create:light_gray_toolbox"
}
}

View file

@ -1,18 +0,0 @@
{
"type": "minecraft:crafting_shaped",
"pattern": [
"#",
"-"
],
"key": {
"#": {
"tag": "forge:dyes/light_gray"
},
"-": {
"tag": "create:toolboxes"
}
},
"result": {
"item": "create:light_gray_toolbox"
}
}

View file

@ -1,18 +0,0 @@
{
"type": "minecraft:crafting_shaped",
"pattern": [
"#",
"-"
],
"key": {
"#": {
"tag": "forge:dyes/lime"
},
"-": {
"item": "create:brown_toolbox"
}
},
"result": {
"item": "create:lime_toolbox"
}
}

View file

@ -1,18 +0,0 @@
{
"type": "minecraft:crafting_shaped",
"pattern": [
"#",
"-"
],
"key": {
"#": {
"tag": "forge:dyes/lime"
},
"-": {
"tag": "create:toolboxes"
}
},
"result": {
"item": "create:lime_toolbox"
}
}

View file

@ -1,18 +0,0 @@
{
"type": "minecraft:crafting_shaped",
"pattern": [
"#",
"-"
],
"key": {
"#": {
"tag": "forge:dyes/magenta"
},
"-": {
"item": "create:brown_toolbox"
}
},
"result": {
"item": "create:magenta_toolbox"
}
}

View file

@ -1,18 +0,0 @@
{
"type": "minecraft:crafting_shaped",
"pattern": [
"#",
"-"
],
"key": {
"#": {
"tag": "forge:dyes/magenta"
},
"-": {
"tag": "create:toolboxes"
}
},
"result": {
"item": "create:magenta_toolbox"
}
}

View file

@ -1,18 +0,0 @@
{
"type": "minecraft:crafting_shaped",
"pattern": [
"#",
"-"
],
"key": {
"#": {
"tag": "forge:dyes/orange"
},
"-": {
"item": "create:brown_toolbox"
}
},
"result": {
"item": "create:orange_toolbox"
}
}

View file

@ -1,18 +0,0 @@
{
"type": "minecraft:crafting_shaped",
"pattern": [
"#",
"-"
],
"key": {
"#": {
"tag": "forge:dyes/orange"
},
"-": {
"tag": "create:toolboxes"
}
},
"result": {
"item": "create:orange_toolbox"
}
}

View file

@ -1,18 +0,0 @@
{
"type": "minecraft:crafting_shaped",
"pattern": [
"#",
"-"
],
"key": {
"#": {
"tag": "forge:dyes/pink"
},
"-": {
"item": "create:brown_toolbox"
}
},
"result": {
"item": "create:pink_toolbox"
}
}

View file

@ -1,18 +0,0 @@
{
"type": "minecraft:crafting_shaped",
"pattern": [
"#",
"-"
],
"key": {
"#": {
"tag": "forge:dyes/pink"
},
"-": {
"tag": "create:toolboxes"
}
},
"result": {
"item": "create:pink_toolbox"
}
}

View file

@ -1,18 +0,0 @@
{
"type": "minecraft:crafting_shaped",
"pattern": [
"#",
"-"
],
"key": {
"#": {
"tag": "forge:dyes/purple"
},
"-": {
"item": "create:brown_toolbox"
}
},
"result": {
"item": "create:purple_toolbox"
}
}

View file

@ -1,18 +0,0 @@
{
"type": "minecraft:crafting_shaped",
"pattern": [
"#",
"-"
],
"key": {
"#": {
"tag": "forge:dyes/purple"
},
"-": {
"tag": "create:toolboxes"
}
},
"result": {
"item": "create:purple_toolbox"
}
}

View file

@ -1,18 +0,0 @@
{
"type": "minecraft:crafting_shaped",
"pattern": [
"#",
"-"
],
"key": {
"#": {
"tag": "forge:dyes/red"
},
"-": {
"item": "create:brown_toolbox"
}
},
"result": {
"item": "create:red_toolbox"
}
}

View file

@ -1,18 +0,0 @@
{
"type": "minecraft:crafting_shaped",
"pattern": [
"#",
"-"
],
"key": {
"#": {
"tag": "forge:dyes/red"
},
"-": {
"tag": "create:toolboxes"
}
},
"result": {
"item": "create:red_toolbox"
}
}

View file

@ -0,0 +1,3 @@
{
"type": "create:toolbox_dyeing"
}

View file

@ -1,18 +0,0 @@
{
"type": "minecraft:crafting_shaped",
"pattern": [
"#",
"-"
],
"key": {
"#": {
"tag": "forge:dyes/white"
},
"-": {
"item": "create:brown_toolbox"
}
},
"result": {
"item": "create:white_toolbox"
}
}

View file

@ -1,18 +0,0 @@
{
"type": "minecraft:crafting_shaped",
"pattern": [
"#",
"-"
],
"key": {
"#": {
"tag": "forge:dyes/white"
},
"-": {
"tag": "create:toolboxes"
}
},
"result": {
"item": "create:white_toolbox"
}
}

View file

@ -1,18 +0,0 @@
{
"type": "minecraft:crafting_shaped",
"pattern": [
"#",
"-"
],
"key": {
"#": {
"tag": "forge:dyes/yellow"
},
"-": {
"item": "create:brown_toolbox"
}
},
"result": {
"item": "create:yellow_toolbox"
}
}

View file

@ -1,18 +0,0 @@
{
"type": "minecraft:crafting_shaped",
"pattern": [
"#",
"-"
],
"key": {
"#": {
"tag": "forge:dyes/yellow"
},
"-": {
"tag": "create:toolboxes"
}
},
"result": {
"item": "create:yellow_toolbox"
}
}

View file

@ -643,12 +643,12 @@ public class AllBlocks {
public static final DyedBlockList<ValveHandleBlock> DYED_VALVE_HANDLES = new DyedBlockList<>(colour -> {
String colourName = colour.getSerializedName();
return REGISTRATE.block(colourName + "_valve_handle", ValveHandleBlock::dyed)
return REGISTRATE.block(colourName + "_valve_handle", p -> ValveHandleBlock.dyed(p, colour))
.transform(BuilderTransformers.valveHandle(colour))
.recipe((c, p) -> ShapedRecipeBuilder.shaped(c.get())
.pattern("#")
.pattern("-")
.define('#', DyeHelper.getTagOfDye(colour))
.define('#', colour.getTag())
.define('-', AllItemTags.VALVE_HANDLES.tag)
.unlockedBy("has_valve", RegistrateRecipeProvider.hasItem(AllItemTags.VALVE_HANDLES.tag))
.save(p, Create.asResource("crafting/kinetics/" + c.getName() + "_from_other_valve_handle")))
@ -975,7 +975,7 @@ public class AllBlocks {
public static final DyedBlockList<SeatBlock> SEATS = new DyedBlockList<>(colour -> {
String colourName = colour.getSerializedName();
SeatMovementBehaviour movementBehaviour = new SeatMovementBehaviour();
return REGISTRATE.block(colourName + "_seat", p -> new SeatBlock(p, colour == DyeColor.RED))
return REGISTRATE.block(colourName + "_seat", p -> new SeatBlock(p, colour, colour == DyeColor.RED))
.initialProperties(SharedProperties::wooden)
.onRegister(addMovementBehaviour(movementBehaviour))
.blockstate((c, p) -> {
@ -995,7 +995,7 @@ public class AllBlocks {
ShapedRecipeBuilder.shaped(c.get())
.pattern("#")
.pattern("-")
.define('#', DyeHelper.getTagOfDye(colour))
.define('#', colour.getTag())
.define('-', AllItemTags.SEATS.tag)
.unlockedBy("has_seat", RegistrateRecipeProvider.hasItem(AllItemTags.SEATS.tag))
.save(p, Create.asResource("crafting/kinetics/" + c.getName() + "_from_other_seat"));
@ -1017,7 +1017,7 @@ public class AllBlocks {
.simpleItem()
.register();
public static final BlockEntry<SailBlock> SAIL = REGISTRATE.block("white_sail", p -> SailBlock.withCanvas(p))
public static final BlockEntry<SailBlock> SAIL = REGISTRATE.block("white_sail", p -> SailBlock.withCanvas(p, DyeColor.WHITE))
.initialProperties(SharedProperties::wooden)
.properties(AbstractBlock.Properties::noOcclusion)
.blockstate(BlockStateGen.directionalBlockProvider(false))
@ -1030,7 +1030,7 @@ public class AllBlocks {
return SAIL;
}
String colourName = colour.getSerializedName();
return REGISTRATE.block(colourName + "_sail", p -> SailBlock.withCanvas(p))
return REGISTRATE.block(colourName + "_sail", p -> SailBlock.withCanvas(p, colour))
.properties(AbstractBlock.Properties::noOcclusion)
.initialProperties(SharedProperties::wooden)
.blockstate((c, p) -> p.directionalBlock(c.get(), p.models()
@ -1372,23 +1372,6 @@ public class AllBlocks {
.withExistingParent(colourName + "_toolbox", p.modLoc("block/toolbox/block"))
.texture("0", p.modLoc("block/toolbox/" + colourName)));
})
.recipe((c, p) -> {
ShapedRecipeBuilder.shaped(c.get())
.pattern("#")
.pattern("-")
.define('#', DyeHelper.getTagOfDye(colour))
.define('-', AllItemTags.TOOLBOXES.tag)
.unlockedBy("has_toolbox", RegistrateRecipeProvider.hasItem(AllItemTags.TOOLBOXES.tag))
.save(p, Create.asResource("crafting/curiosities/" + c.getName() + "_from_other_toolbox"));
if (colour != DyeColor.BROWN)
ShapedRecipeBuilder.shaped(c.get())
.pattern("#")
.pattern("-")
.define('#', DyeHelper.getTagOfDye(colour))
.define('-', ToolboxBlock.getMainBox())
.unlockedBy("has_toolbox", RegistrateRecipeProvider.hasItem(AllItemTags.TOOLBOXES.tag))
.save(p, Create.asResource("crafting/curiosities/" + c.getName() + "_from_main_toolbox"));
})
.onRegisterAfter(Item.class, v -> TooltipHelper.referTo(v, "block.create.toolbox"))
.tag(AllBlockTags.TOOLBOXES.tag)
.item()

View file

@ -19,6 +19,7 @@ import com.simibubi.create.content.contraptions.processing.BasinRecipe;
import com.simibubi.create.content.contraptions.processing.EmptyingRecipe;
import com.simibubi.create.content.contraptions.processing.ProcessingRecipeBuilder.ProcessingRecipeFactory;
import com.simibubi.create.content.contraptions.processing.ProcessingRecipeSerializer;
import com.simibubi.create.content.curiosities.toolbox.ToolboxDyeingRecipe;
import com.simibubi.create.content.curiosities.tools.SandPaperPolishingRecipe;
import com.simibubi.create.foundation.utility.Lang;
import com.simibubi.create.foundation.utility.recipe.IRecipeTypeInfo;
@ -28,6 +29,7 @@ import net.minecraft.item.crafting.IRecipe;
import net.minecraft.item.crafting.IRecipeSerializer;
import net.minecraft.item.crafting.IRecipeType;
import net.minecraft.item.crafting.ShapedRecipe;
import net.minecraft.item.crafting.SpecialRecipeSerializer;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.registry.Registry;
import net.minecraft.world.World;
@ -35,7 +37,6 @@ import net.minecraftforge.event.RegistryEvent;
public enum AllRecipeTypes implements IRecipeTypeInfo {
MECHANICAL_CRAFTING(MechanicalCraftingRecipe.Serializer::new),
CONVERSION(ConversionRecipe::new),
CRUSHING(CrushingRecipe::new),
CUTTING(CuttingRecipe::new),
@ -49,8 +50,12 @@ public enum AllRecipeTypes implements IRecipeTypeInfo {
DEPLOYING(DeployerApplicationRecipe::new),
FILLING(FillingRecipe::new),
EMPTYING(EmptyingRecipe::new),
MECHANICAL_CRAFTING(MechanicalCraftingRecipe.Serializer::new),
SEQUENCED_ASSEMBLY(SequencedAssemblyRecipeSerializer::new),
TOOLBOX_DYEING(() -> new SpecialRecipeSerializer<>(ToolboxDyeingRecipe::new), IRecipeType.CRAFTING);
;
private ResourceLocation id;

View file

@ -7,12 +7,11 @@ import javax.annotation.ParametersAreNonnullByDefault;
import com.simibubi.create.AllBlocks;
import com.simibubi.create.AllShapes;
import com.simibubi.create.foundation.utility.DyeHelper;
import com.simibubi.create.foundation.utility.BlockHelper;
import mcp.MethodsReturnNonnullByDefault;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks;
import net.minecraft.entity.Entity;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.MobEntity;
@ -37,10 +36,12 @@ import net.minecraft.world.World;
@MethodsReturnNonnullByDefault
public class SeatBlock extends Block {
private final boolean inCreativeTab;
protected final DyeColor color;
protected final boolean inCreativeTab;
public SeatBlock(Properties p_i48440_1_, boolean inCreativeTab) {
super(p_i48440_1_);
public SeatBlock(Properties properties, DyeColor color, boolean inCreativeTab) {
super(properties);
this.color = color;
this.inCreativeTab = inCreativeTab;
}
@ -60,7 +61,7 @@ public class SeatBlock extends Block {
public void updateEntityAfterFallOn(IBlockReader reader, Entity entity) {
BlockPos pos = entity.blockPosition();
if (entity instanceof PlayerEntity || !(entity instanceof LivingEntity) || !canBePickedUp(entity) || isSeatOccupied(entity.level, pos)) {
Blocks.PINK_BED.updateEntityAfterFallOn(reader, entity);
super.updateEntityAfterFallOn(reader, entity);
return;
}
if (reader.getBlockState(pos)
@ -94,17 +95,13 @@ public class SeatBlock extends Block {
return ActionResultType.PASS;
ItemStack heldItem = player.getItemInHand(hand);
for (DyeColor color : DyeColor.values()) {
if (!heldItem.getItem()
.is(DyeHelper.getTagOfDye(color)))
continue;
DyeColor color = DyeColor.getColor(heldItem);
if (color != null && color != this.color) {
if (world.isClientSide)
return ActionResultType.SUCCESS;
BlockState newState = AllBlocks.SEATS.get(color).getDefaultState();
if (newState != state)
world.setBlockAndUpdate(pos, newState);
return ActionResultType.SUCCESS;
BlockState newState = BlockHelper.copyProperties(state, AllBlocks.SEATS.get(color).getDefaultState());
world.setBlockAndUpdate(pos, newState);
return ActionResultType.sidedSuccess(world.isClientSide);
}
List<SeatEntity> seats = world.getEntitiesOfClass(SeatEntity.class, new AxisAlignedBB(pos));
@ -144,6 +141,10 @@ public class SeatBlock extends Block {
entity.startRiding(seat, true);
}
public DyeColor getColor() {
return color;
}
@Override
public boolean isPathfindable(BlockState state, IBlockReader reader, BlockPos pos, PathType type) {
return false;

View file

@ -4,7 +4,7 @@ import javax.annotation.ParametersAreNonnullByDefault;
import com.jozufozu.flywheel.core.PartialModel;
import com.simibubi.create.AllBlocks;
import com.simibubi.create.foundation.utility.DyeHelper;
import com.simibubi.create.foundation.utility.BlockHelper;
import net.minecraft.block.BlockState;
import net.minecraft.entity.player.PlayerEntity;
@ -22,41 +22,38 @@ import net.minecraftforge.api.distmarker.OnlyIn;
@ParametersAreNonnullByDefault
public class ValveHandleBlock extends HandCrankBlock {
private final DyeColor color;
private final boolean inCreativeTab;
public static ValveHandleBlock copper(Properties properties) {
return new ValveHandleBlock(properties, true);
return new ValveHandleBlock(properties, null, true);
}
public static ValveHandleBlock dyed(Properties properties) {
return new ValveHandleBlock(properties, false);
public static ValveHandleBlock dyed(Properties properties, DyeColor color) {
return new ValveHandleBlock(properties, color, false);
}
private ValveHandleBlock(Properties properties, boolean inCreativeTab) {
private ValveHandleBlock(Properties properties, DyeColor color, boolean inCreativeTab) {
super(properties);
this.color = color;
this.inCreativeTab = inCreativeTab;
}
@Override
public ActionResultType use(BlockState state, World worldIn, BlockPos pos, PlayerEntity player, Hand handIn,
public ActionResultType use(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand,
BlockRayTraceResult hit) {
ItemStack heldItem = player.getItemInHand(handIn);
for (DyeColor color : DyeColor.values()) {
if (!heldItem.getItem()
.is(DyeHelper.getTagOfDye(color)))
continue;
if (worldIn.isClientSide)
ItemStack heldItem = player.getItemInHand(hand);
DyeColor color = DyeColor.getColor(heldItem);
if (color != null && color != this.color) {
if (world.isClientSide)
return ActionResultType.SUCCESS;
BlockState newState = AllBlocks.DYED_VALVE_HANDLES.get(color)
.getDefaultState()
.setValue(FACING, state.getValue(FACING));
if (newState != state)
worldIn.setBlockAndUpdate(pos, newState);
BlockState newState = BlockHelper.copyProperties(state, AllBlocks.DYED_VALVE_HANDLES.get(color).getDefaultState());
world.setBlockAndUpdate(pos, newState);
return ActionResultType.SUCCESS;
}
return super.use(state, worldIn, pos, player, handIn, hit);
return super.use(state, world, pos, player, hand, hit);
}
@Override

View file

@ -11,7 +11,7 @@ import javax.annotation.Nullable;
import com.simibubi.create.AllBlocks;
import com.simibubi.create.AllShapes;
import com.simibubi.create.foundation.block.WrenchableDirectionalBlock;
import com.simibubi.create.foundation.utility.DyeHelper;
import com.simibubi.create.foundation.utility.BlockHelper;
import com.simibubi.create.foundation.utility.Iterate;
import com.simibubi.create.foundation.utility.placement.IPlacementHelper;
import com.simibubi.create.foundation.utility.placement.PlacementHelpers;
@ -44,20 +44,22 @@ import net.minecraft.world.World;
public class SailBlock extends WrenchableDirectionalBlock {
public static SailBlock frame(Properties properties) {
return new SailBlock(properties, true);
return new SailBlock(properties, true, null);
}
public static SailBlock withCanvas(Properties properties) {
return new SailBlock(properties, false);
public static SailBlock withCanvas(Properties properties, DyeColor color) {
return new SailBlock(properties, false, color);
}
private static final int placementHelperId = PlacementHelpers.register(new PlacementHelper());
private final boolean frame;
protected final boolean frame;
protected final DyeColor color;
protected SailBlock(Properties p_i48415_1_, boolean frame) {
super(p_i48415_1_);
protected SailBlock(Properties properties, boolean frame, DyeColor color) {
super(properties);
this.frame = frame;
this.color = color;
}
@Override
@ -83,10 +85,8 @@ public class SailBlock extends WrenchableDirectionalBlock {
if (frame)
return ActionResultType.PASS;
for (DyeColor color : DyeColor.values()) {
if (!heldItem.getItem()
.is(DyeHelper.getTagOfDye(color)))
continue;
DyeColor color = DyeColor.getColor(heldItem);
if (color != null && color != this.color) {
if (!world.isClientSide)
applyDye(state, world, pos, color);
return ActionResultType.SUCCESS;
@ -97,8 +97,8 @@ public class SailBlock extends WrenchableDirectionalBlock {
protected void applyDye(BlockState state, World world, BlockPos pos, @Nullable DyeColor color) {
BlockState newState =
(color == null ? AllBlocks.SAIL_FRAME : AllBlocks.DYED_SAILS.get(color)).getDefaultState()
.setValue(FACING, state.getValue(FACING));
(color == null ? AllBlocks.SAIL_FRAME : AllBlocks.DYED_SAILS.get(color)).getDefaultState();
newState = BlockHelper.copyProperties(state, newState);
// Dye the block itself
if (state != newState) {
@ -202,6 +202,14 @@ public class SailBlock extends WrenchableDirectionalBlock {
return false;
}
public boolean isFrame() {
return frame;
}
public DyeColor getColor() {
return color;
}
@MethodsReturnNonnullByDefault
private static class PlacementHelper implements IPlacementHelper {
@Override

View file

@ -28,10 +28,10 @@ import net.minecraft.block.BlockState;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.IRenderTypeBuffer;
import net.minecraft.client.renderer.ItemRenderer;
import net.minecraft.client.renderer.LightTexture;
import net.minecraft.client.renderer.RenderType;
import net.minecraft.client.renderer.model.ItemCameraTransforms.TransformType;
import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher;
import net.minecraft.client.settings.GraphicsFanciness;
import net.minecraft.entity.Entity;
import net.minecraft.item.DyeColor;
import net.minecraft.util.Direction;
@ -189,7 +189,7 @@ public class BeltRenderer extends SafeTileEntityRenderer<BeltTileEntity> {
Vector3i directionVec = beltFacing
.getNormal();
Vector3d beltStartOffset = Vector3d.atLowerCornerOf(directionVec).scale(-.5)
.add(.5, 13 / 16f + .125f, .5);
.add(.5, 15 / 16f, .5);
ms.translate(beltStartOffset.x, beltStartOffset.y, beltStartOffset.z);
BeltSlope slope = te.getBlockState()
.getValue(BeltBlock.SLOPE);
@ -204,22 +204,26 @@ public class BeltRenderer extends SafeTileEntityRenderer<BeltTileEntity> {
ms.pushPose();
MatrixTransformStack.of(ms)
.nudge(transported.angle);
float offset = MathHelper.lerp(partialTicks, transported.prevBeltPosition, transported.beltPosition);
float sideOffset = MathHelper.lerp(partialTicks, transported.prevSideOffset, transported.sideOffset);
float verticalMovement = verticality;
float offset;
float sideOffset;
float verticalMovement;
if (te.getSpeed() == 0) {
offset = transported.beltPosition;
sideOffset = transported.sideOffset;
} else {
offset = MathHelper.lerp(partialTicks, transported.prevBeltPosition, transported.beltPosition);
sideOffset = MathHelper.lerp(partialTicks, transported.prevSideOffset, transported.sideOffset);
}
int stackLight = onContraption ? light : getPackedLight(te, offset);
if (offset < .5)
verticalMovement = 0;
verticalMovement = verticalMovement * (Math.min(offset, te.beltLength - .5f) - .5f);
Vector3d offsetVec = Vector3d.atLowerCornerOf(directionVec).scale(offset)
.add(0, verticalMovement, 0);
else
verticalMovement = verticality * (Math.min(offset, te.beltLength - .5f) - .5f);
Vector3d offsetVec = Vector3d.atLowerCornerOf(directionVec).scale(offset);
if (verticalMovement != 0)
offsetVec = offsetVec.add(0, verticalMovement, 0);
boolean onSlope =
slope != BeltSlope.HORIZONTAL && MathHelper.clamp(offset, .5f, te.beltLength - .5f) == offset;
boolean tiltForward = (slope == BeltSlope.DOWNWARD ^ beltFacing
@ -236,6 +240,7 @@ public class BeltRenderer extends SafeTileEntityRenderer<BeltTileEntity> {
sideOffset *= -1;
ms.translate(alongX ? sideOffset : 0, 0, alongX ? 0 : sideOffset);
int stackLight = onContraption ? light : getPackedLight(te, offset);
ItemRenderer itemRenderer = Minecraft.getInstance()
.getItemRenderer();
boolean renderUpright = BeltHelper.isItemUpright(transported.stack);
@ -244,11 +249,21 @@ public class BeltRenderer extends SafeTileEntityRenderer<BeltTileEntity> {
int count = (int) (MathHelper.log2((int) (transported.stack.getCount()))) / 2;
Random r = new Random(transported.angle);
if (Minecraft.getInstance().options.graphicsMode == GraphicsFanciness.FANCY) {
Vector3d shadowPos = Vector3d.atLowerCornerOf(te.getBlockPos()).add(beltStartOffset.scale(1)
.add(offsetVec)
.add(alongX ? sideOffset : 0, .39, alongX ? 0 : sideOffset));
ShadowRenderHelper.renderShadow(ms, buffer, shadowPos, .75f, blockItem ? .2f : .2f);
boolean slopeShadowOnly = renderUpright && onSlope;
float slopeOffset = 1 / 8f;
if (slopeShadowOnly)
ms.pushPose();
if (!renderUpright || slopeShadowOnly)
ms.mulPose(new Vector3f(slopeAlongX ? 0 : 1, 0, slopeAlongX ? 1 : 0).rotationDegrees(slopeAngle));
if (onSlope)
ms.translate(0, slopeOffset, 0);
ms.pushPose();
ms.translate(0, -1 / 8f + 0.005f, 0);
ShadowRenderHelper.renderShadow(ms, buffer, .75f, .2f);
ms.popPose();
if (slopeShadowOnly) {
ms.popPose();
ms.translate(0, slopeOffset, 0);
}
if (renderUpright) {
@ -257,16 +272,11 @@ public class BeltRenderer extends SafeTileEntityRenderer<BeltTileEntity> {
Vector3d positionVec = renderViewEntity.position();
Vector3d vectorForOffset = BeltHelper.getVectorForOffset(te, offset);
Vector3d diff = vectorForOffset.subtract(positionVec);
float yRot = (float) MathHelper.atan2(diff.z, -diff.x);
ms.mulPose(Vector3f.YP.rotation((float) (yRot + Math.PI / 2)));
float yRot = (float) (MathHelper.atan2(diff.x, diff.z) + Math.PI);
ms.mulPose(Vector3f.YP.rotation(yRot));
}
ms.translate(0, 3 / 32d, 1 / 16f);
}
if (!renderUpright)
ms.mulPose(new Vector3f(slopeAlongX ? 0 : 1, 0, slopeAlongX ? 1 : 0).rotationDegrees(slopeAngle));
if (onSlope)
ms.translate(0, 1 / 8f, 0);
for (int i = 0; i <= count; i++) {
ms.pushPose();
@ -282,7 +292,7 @@ public class BeltRenderer extends SafeTileEntityRenderer<BeltTileEntity> {
}
ms.scale(.5f, .5f, .5f);
itemRenderer.renderStatic(transported.stack, TransformType.FIXED, stackLight, overlay, ms, buffer);
itemRenderer.renderStatic(null, transported.stack, TransformType.FIXED, false, ms, buffer, te.getLevel(), stackLight, overlay);
ms.popPose();
if (!renderUpright) {
@ -304,6 +314,7 @@ public class BeltRenderer extends SafeTileEntityRenderer<BeltTileEntity> {
if (controller.light == null || segment >= controller.light.length || segment < 0)
return 0;
return (controller.light[segment + 1] << 20) | (controller.light[segment] << 4);
return LightTexture.pack(controller.light[segment], controller.light[segment + 1]);
}
}

View file

@ -8,6 +8,7 @@ import com.simibubi.create.AllBlocks;
import com.simibubi.create.AllShapes;
import com.simibubi.create.AllTileEntities;
import com.simibubi.create.foundation.block.ITE;
import com.simibubi.create.foundation.utility.BlockHelper;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
@ -44,12 +45,12 @@ import net.minecraftforge.fml.network.NetworkHooks;
public class ToolboxBlock extends HorizontalBlock implements IWaterLoggable, ITE<ToolboxTileEntity> {
private final DyeColor color;
protected final DyeColor color;
public ToolboxBlock(Properties p_i48440_1_, DyeColor color) {
super(p_i48440_1_);
public ToolboxBlock(Properties properties, DyeColor color) {
super(properties);
this.color = color;
registerDefaultState(super.defaultBlockState().setValue(WATERLOGGED, false));
registerDefaultState(defaultBlockState().setValue(WATERLOGGED, false));
}
@Override
@ -87,7 +88,7 @@ public class ToolboxBlock extends HorizontalBlock implements IWaterLoggable, ITE
@Override
public void onRemove(BlockState state, World world, BlockPos pos, BlockState newState, boolean moving) {
if (state.hasTileEntity() && (!state.is(newState.getBlock()) || !newState.hasTileEntity()))
if (state.hasTileEntity() && (!newState.hasTileEntity() || !(newState.getBlock() instanceof ToolboxBlock)))
world.removeBlockEntity(pos);
}
@ -133,8 +134,8 @@ public class ToolboxBlock extends HorizontalBlock implements IWaterLoggable, ITE
}
@Override
public VoxelShape getShape(BlockState state, IBlockReader p_220053_2_, BlockPos p_220053_3_,
ISelectionContext p_220053_4_) {
public VoxelShape getShape(BlockState state, IBlockReader world, BlockPos pos,
ISelectionContext context) {
return AllShapes.TOOLBOX.get(state.getValue(FACING));
}
@ -149,6 +150,17 @@ public class ToolboxBlock extends HorizontalBlock implements IWaterLoggable, ITE
if (player == null || player.isCrouching())
return ActionResultType.PASS;
ItemStack stack = player.getItemInHand(hand);
DyeColor color = DyeColor.getColor(stack);
if (color != null && color != this.color) {
if (world.isClientSide)
return ActionResultType.SUCCESS;
BlockState newState = BlockHelper.copyProperties(state, AllBlocks.TOOLBOXES.get(color).getDefaultState());
world.setBlockAndUpdate(pos, newState);
return ActionResultType.SUCCESS;
}
if (player instanceof FakePlayer)
return ActionResultType.PASS;
if (world.isClientSide)

View file

@ -0,0 +1,86 @@
package com.simibubi.create.content.curiosities.toolbox;
import com.simibubi.create.AllBlocks;
import com.simibubi.create.AllRecipeTypes;
import net.minecraft.block.Block;
import net.minecraft.inventory.CraftingInventory;
import net.minecraft.item.DyeColor;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.IRecipeSerializer;
import net.minecraft.item.crafting.SpecialRecipe;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World;
import net.minecraftforge.common.Tags;
public class ToolboxDyeingRecipe extends SpecialRecipe {
public ToolboxDyeingRecipe(ResourceLocation rl) {
super(rl);
}
@Override
public boolean matches(CraftingInventory inventory, World world) {
int toolboxes = 0;
int dyes = 0;
for (int i = 0; i < inventory.getContainerSize(); ++i) {
ItemStack stack = inventory.getItem(i);
if (!stack.isEmpty()) {
if (Block.byItem(stack.getItem()) instanceof ToolboxBlock) {
++toolboxes;
} else {
if (!stack.getItem().is(Tags.Items.DYES)) {
return false;
}
++dyes;
}
if (dyes > 1 || toolboxes > 1) {
return false;
}
}
}
return toolboxes == 1 && dyes == 1;
}
@Override
public ItemStack assemble(CraftingInventory inventory) {
ItemStack toolbox = ItemStack.EMPTY;
DyeColor color = DyeColor.BROWN;
for (int i = 0; i < inventory.getContainerSize(); ++i) {
ItemStack stack = inventory.getItem(i);
if (!stack.isEmpty()) {
if (Block.byItem(stack.getItem()) instanceof ToolboxBlock) {
toolbox = stack;
} else {
DyeColor color1 = DyeColor.getColor(stack);
if (color1 != null) {
color = color1;
}
}
}
}
ItemStack dyedToolbox = AllBlocks.TOOLBOXES.get(color).asStack();
if (toolbox.hasTag()) {
dyedToolbox.setTag(toolbox.getTag().copy());
}
return dyedToolbox;
}
@Override
public boolean canCraftInDimensions(int width, int height) {
return width * height >= 2;
}
@Override
public IRecipeSerializer<?> getSerializer() {
return AllRecipeTypes.TOOLBOX_DYEING.getSerializer();
}
}

View file

@ -34,7 +34,7 @@ public class ToolboxRenderer extends SmartTileEntityRenderer<ToolboxTileEntity>
float lidAngle = tileEntityIn.lid.getValue(partialTicks);
float drawerOffset = tileEntityIn.drawers.getValue(partialTicks);
IVertexBuilder layer = buffer.getBuffer(RenderType.solid());
IVertexBuilder builder = buffer.getBuffer(RenderType.cutoutMipped());
lid.matrixStacker()
.centre()
.rotateY(-facing.toYRot())
@ -43,7 +43,7 @@ public class ToolboxRenderer extends SmartTileEntityRenderer<ToolboxTileEntity>
.rotateX(135 * lidAngle)
.translate(0, -6 / 16f, -12 / 16f);
lid.light(light)
.renderInto(ms, layer);
.renderInto(ms, builder);
for (int offset : Iterate.zeroAndOne) {
drawer.matrixStacker()
@ -52,7 +52,7 @@ public class ToolboxRenderer extends SmartTileEntityRenderer<ToolboxTileEntity>
.unCentre();
drawer.translate(0, offset * 1 / 8f, -drawerOffset * .175f * (2 - offset))
.light(light)
.renderInto(ms, layer);
.renderInto(ms, builder);
}
}

View file

@ -12,6 +12,7 @@ import java.util.WeakHashMap;
import com.simibubi.create.AllBlocks;
import com.simibubi.create.foundation.tileEntity.SmartTileEntity;
import com.simibubi.create.foundation.tileEntity.TileEntityBehaviour;
import com.simibubi.create.foundation.utility.ResetableLazy;
import com.simibubi.create.foundation.utility.VecHelper;
import com.simibubi.create.foundation.utility.animation.LerpedFloat;
import com.simibubi.create.foundation.utility.animation.LerpedFloat.Chaser;
@ -49,7 +50,7 @@ public class ToolboxTileEntity extends SmartTileEntity implements INamedContaine
ToolboxInventory inventory;
LazyOptional<IItemHandler> inventoryProvider;
LazyOptional<DyeColor> colorProvider;
ResetableLazy<DyeColor> colorProvider;
protected int openCount;
Map<Integer, WeakHashMap<PlayerEntity, Integer>> connectedPlayers;
@ -61,7 +62,7 @@ public class ToolboxTileEntity extends SmartTileEntity implements INamedContaine
connectedPlayers = new HashMap<>();
inventory = new ToolboxInventory(this);
inventoryProvider = LazyOptional.of(() -> inventory);
colorProvider = LazyOptional.of(() -> {
colorProvider = ResetableLazy.of(() -> {
BlockState blockState = getBlockState();
if (blockState != null && blockState.getBlock() instanceof ToolboxBlock)
return ((ToolboxBlock) blockState.getBlock()).getColor();
@ -71,7 +72,7 @@ public class ToolboxTileEntity extends SmartTileEntity implements INamedContaine
}
public DyeColor getColor() {
return colorProvider.orElse(DyeColor.BROWN);
return colorProvider.get();
}
@Override
@ -387,4 +388,16 @@ public class ToolboxTileEntity extends SmartTileEntity implements INamedContaine
return customName;
}
@Override
public void clearCache() {
super.clearCache();
colorProvider.reset();
}
@Override
public void setChanged() {
super.setChanged();
colorProvider.reset();
}
}

View file

@ -10,7 +10,6 @@ import com.simibubi.create.content.schematics.ISpecialBlockItemRequirement;
import com.simibubi.create.content.schematics.ItemRequirement;
import com.simibubi.create.content.schematics.ItemRequirement.ItemUseType;
import com.simibubi.create.foundation.block.ITE;
import com.simibubi.create.foundation.utility.DyeHelper;
import com.simibubi.create.foundation.utility.Iterate;
import net.minecraft.block.Block;
@ -42,7 +41,8 @@ public class NixieTubeBlock extends HorizontalBlock
implements ITE<NixieTubeTileEntity>, IWrenchable, ISpecialBlockItemRequirement {
public static final BooleanProperty CEILING = BooleanProperty.create("ceiling");
private DyeColor color;
protected final DyeColor color;
public NixieTubeBlock(Properties properties, DyeColor color) {
super(properties);
@ -54,13 +54,14 @@ public class NixieTubeBlock extends HorizontalBlock
public ActionResultType use(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand,
BlockRayTraceResult ray) {
if (player.isShiftKeyDown())
return ActionResultType.PASS;
ItemStack heldItem = player.getItemInHand(hand);
NixieTubeTileEntity nixie = getTileEntity(world, pos);
if (nixie == null)
return ActionResultType.PASS;
if (player.isShiftKeyDown())
return ActionResultType.PASS;
if (heldItem.isEmpty()) {
if (nixie.reactsToRedstone())
return ActionResultType.PASS;
@ -70,11 +71,7 @@ public class NixieTubeBlock extends HorizontalBlock
}
boolean display = heldItem.getItem() == Items.NAME_TAG && heldItem.hasCustomHoverName();
DyeColor dye = null;
for (DyeColor color : DyeColor.values())
if (heldItem.getItem()
.is(DyeHelper.getTagOfDye(color)))
dye = color;
DyeColor dye = DyeColor.getColor(heldItem);
if (!display && dye == null)
return ActionResultType.PASS;
@ -238,6 +235,10 @@ public class NixieTubeBlock extends HorizontalBlock
return NixieTubeTileEntity.class;
}
public DyeColor getColor() {
return color;
}
public static boolean areNixieBlocksEqual(BlockState blockState, BlockState otherState) {
if (!(blockState.getBlock() instanceof NixieTubeBlock))
return false;

View file

@ -25,6 +25,15 @@ public class DyedBlockList<T extends Block> {
return (BlockEntry<T>) values[color.ordinal()];
}
public boolean contains(Block block) {
for (BlockEntry<?> entry : values) {
if (entry.is(block)) {
return true;
}
}
return false;
}
@SuppressWarnings("unchecked")
public BlockEntry<T>[] toArray() {
return (BlockEntry<T>[]) Arrays.copyOf(values, values.length);

View file

@ -18,6 +18,7 @@ import com.google.gson.JsonArray;
import com.google.gson.JsonObject;
import com.simibubi.create.AllBlocks;
import com.simibubi.create.AllItems;
import com.simibubi.create.AllRecipeTypes;
import com.simibubi.create.AllTags;
import com.simibubi.create.AllTags.AllItemTags;
import com.simibubi.create.Create;
@ -32,6 +33,7 @@ import net.minecraft.advancements.criterion.ItemPredicate;
import net.minecraft.block.Block;
import net.minecraft.block.Blocks;
import net.minecraft.data.CookingRecipeBuilder;
import net.minecraft.data.CustomRecipeBuilder;
import net.minecraft.data.DataGenerator;
import net.minecraft.data.IFinishedRecipe;
import net.minecraft.data.ShapedRecipeBuilder;
@ -42,6 +44,7 @@ import net.minecraft.item.Items;
import net.minecraft.item.crafting.CookingRecipeSerializer;
import net.minecraft.item.crafting.IRecipeSerializer;
import net.minecraft.item.crafting.Ingredient;
import net.minecraft.item.crafting.SpecialRecipeSerializer;
import net.minecraft.tags.ITag;
import net.minecraft.tags.ItemTags;
import net.minecraft.util.IItemProvider;
@ -177,6 +180,8 @@ public class StandardRecipeGen extends CreateRecipeProvider {
.pattern("SWS")
.pattern(" L ")),
TOOLBOX_DYEING = createSpecial(AllRecipeTypes.TOOLBOX_DYEING::getSerializer, "crafting", "toolbox_dyeing"),
MINECART_COUPLING = create(AllItems.MINECART_COUPLING).unlockedBy(I::andesite)
.viaShaped(b -> b.define('E', I.andesite())
.define('O', I.ironSheet())
@ -1085,6 +1090,14 @@ public class StandardRecipeGen extends CreateRecipeProvider {
return create(result::get);
}
GeneratedRecipe createSpecial(Supplier<? extends SpecialRecipeSerializer<?>> serializer, String recipeType, String path) {
ResourceLocation location = Create.asResource(recipeType + "/" + currentFolder + "/" + path);
return register(consumer -> {
CustomRecipeBuilder b = CustomRecipeBuilder.special(serializer.get());
b.save(consumer, location.toString());
});
}
GeneratedRecipe blastCrushedMetal(Supplier<? extends IItemProvider> result,
Supplier<? extends IItemProvider> ingredient) {
return create(result::get).withSuffix("_from_crushed")

View file

@ -5,7 +5,6 @@ import com.mojang.blaze3d.vertex.IVertexBuilder;
import net.minecraft.block.BlockRenderType;
import net.minecraft.block.BlockState;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.IRenderTypeBuffer;
import net.minecraft.client.renderer.RenderType;
import net.minecraft.client.renderer.texture.OverlayTexture;
@ -18,16 +17,27 @@ import net.minecraft.util.math.vector.Vector3d;
import net.minecraft.world.IWorldReader;
/**
* Stolen from EntityRendererManager
* Taken from EntityRendererManager
*/
public class ShadowRenderHelper {
private static final RenderType SHADOW_LAYER =
RenderType.entityNoOutline(new ResourceLocation("textures/misc/shadow.png"));
public static void renderShadow(MatrixStack p_229096_0_, IRenderTypeBuffer p_229096_1_, Vector3d pos,
float p_229096_3_, float p_229096_6_) {
float f = p_229096_6_;
public static void renderShadow(MatrixStack matrixStack, IRenderTypeBuffer buffer, float opacity, float radius) {
MatrixStack.Entry entry = matrixStack.last();
IVertexBuilder builder = buffer.getBuffer(SHADOW_LAYER);
opacity /= 2;
shadowVertex(entry, builder, opacity, -1 * radius, 0, -1 * radius, 0, 0);
shadowVertex(entry, builder, opacity, -1 * radius, 0, 1 * radius, 0, 1);
shadowVertex(entry, builder, opacity, 1 * radius, 0, 1 * radius, 1, 1);
shadowVertex(entry, builder, opacity, 1 * radius, 0, -1 * radius, 1, 0);
}
public static void renderShadow(MatrixStack matrixStack, IRenderTypeBuffer buffer, IWorldReader world,
Vector3d pos, float opacity, float radius) {
float f = radius;
double d2 = pos.x();
double d0 = pos.y();
@ -38,67 +48,66 @@ public class ShadowRenderHelper {
int l = MathHelper.floor(d0);
int i1 = MathHelper.floor(d1 - (double) f);
int j1 = MathHelper.floor(d1 + (double) f);
MatrixStack.Entry matrixstack$entry = p_229096_0_.last();
IVertexBuilder ivertexbuilder = p_229096_1_.getBuffer(SHADOW_LAYER);
MatrixStack.Entry entry = matrixStack.last();
IVertexBuilder builder = buffer.getBuffer(SHADOW_LAYER);
for (BlockPos blockpos : BlockPos.betweenClosed(new BlockPos(i, k, i1), new BlockPos(j, l, j1))) {
renderShadowPart(matrixstack$entry, ivertexbuilder, Minecraft.getInstance().level, blockpos, d2, d0, d1, f,
p_229096_3_);
renderBlockShadow(entry, builder, world, blockpos, d2, d0, d1, f,
opacity);
}
}
private static void renderShadowPart(MatrixStack.Entry p_229092_0_, IVertexBuilder p_229092_1_,
IWorldReader p_229092_2_, BlockPos p_229092_3_, double p_229092_4_, double p_229092_6_, double p_229092_8_,
float p_229092_10_, float p_229092_11_) {
BlockPos blockpos = p_229092_3_.below();
BlockState blockstate = p_229092_2_.getBlockState(blockpos);
if (blockstate.getRenderShape() != BlockRenderType.INVISIBLE && p_229092_2_.getMaxLocalRawBrightness(p_229092_3_) > 3) {
if (blockstate.isCollisionShapeFullBlock(p_229092_2_, blockpos)) {
VoxelShape voxelshape = blockstate.getShape(p_229092_2_, p_229092_3_.below());
private static void renderBlockShadow(MatrixStack.Entry entry, IVertexBuilder builder,
IWorldReader world, BlockPos pos, double x, double y, double z,
float radius, float opacity) {
BlockPos blockpos = pos.below();
BlockState blockstate = world.getBlockState(blockpos);
if (blockstate.getRenderShape() != BlockRenderType.INVISIBLE && world.getMaxLocalRawBrightness(pos) > 3) {
if (blockstate.isCollisionShapeFullBlock(world, blockpos)) {
VoxelShape voxelshape = blockstate.getShape(world, pos.below());
if (!voxelshape.isEmpty()) {
@SuppressWarnings("deprecation")
float f = (float) (((double) p_229092_11_ - (p_229092_6_ - (double) p_229092_3_.getY()) / 2.0D)
* 0.5D * (double) p_229092_2_.getBrightness(p_229092_3_));
float f = (float) (((double) opacity - (y - (double) pos.getY()) / 2.0D)
* 0.5D * (double) world.getBrightness(pos));
if (f >= 0.0F) {
if (f > 1.0F) {
f = 1.0F;
}
AxisAlignedBB axisalignedbb = voxelshape.bounds();
double d0 = (double) p_229092_3_.getX() + axisalignedbb.minX;
double d1 = (double) p_229092_3_.getX() + axisalignedbb.maxX;
double d2 = (double) p_229092_3_.getY() + axisalignedbb.minY;
double d3 = (double) p_229092_3_.getZ() + axisalignedbb.minZ;
double d4 = (double) p_229092_3_.getZ() + axisalignedbb.maxZ;
float f1 = (float) (d0 - p_229092_4_);
float f2 = (float) (d1 - p_229092_4_);
float f3 = (float) (d2 - p_229092_6_ + 0.015625D);
float f4 = (float) (d3 - p_229092_8_);
float f5 = (float) (d4 - p_229092_8_);
float f6 = -f1 / 2.0F / p_229092_10_ + 0.5F;
float f7 = -f2 / 2.0F / p_229092_10_ + 0.5F;
float f8 = -f4 / 2.0F / p_229092_10_ + 0.5F;
float f9 = -f5 / 2.0F / p_229092_10_ + 0.5F;
shadowVertex(p_229092_0_, p_229092_1_, f, f1, f3, f4, f6, f8);
shadowVertex(p_229092_0_, p_229092_1_, f, f1, f3, f5, f6, f9);
shadowVertex(p_229092_0_, p_229092_1_, f, f2, f3, f5, f7, f9);
shadowVertex(p_229092_0_, p_229092_1_, f, f2, f3, f4, f7, f8);
double d0 = (double) pos.getX() + axisalignedbb.minX;
double d1 = (double) pos.getX() + axisalignedbb.maxX;
double d2 = (double) pos.getY() + axisalignedbb.minY;
double d3 = (double) pos.getZ() + axisalignedbb.minZ;
double d4 = (double) pos.getZ() + axisalignedbb.maxZ;
float f1 = (float) (d0 - x);
float f2 = (float) (d1 - x);
float f3 = (float) (d2 - y + 0.015625D);
float f4 = (float) (d3 - z);
float f5 = (float) (d4 - z);
float f6 = -f1 / 2.0F / radius + 0.5F;
float f7 = -f2 / 2.0F / radius + 0.5F;
float f8 = -f4 / 2.0F / radius + 0.5F;
float f9 = -f5 / 2.0F / radius + 0.5F;
shadowVertex(entry, builder, f, f1, f3, f4, f6, f8);
shadowVertex(entry, builder, f, f1, f3, f5, f6, f9);
shadowVertex(entry, builder, f, f2, f3, f5, f7, f9);
shadowVertex(entry, builder, f, f2, f3, f4, f7, f8);
}
}
}
}
}
private static void shadowVertex(MatrixStack.Entry p_229091_0_, IVertexBuilder p_229091_1_, float p_229091_2_,
float p_229091_3_, float p_229091_4_, float p_229091_5_, float p_229091_6_, float p_229091_7_) {
p_229091_1_.vertex(p_229091_0_.pose(), p_229091_3_, p_229091_4_, p_229091_5_)
.color(1.0F, 1.0F, 1.0F, p_229091_2_)
.uv(p_229091_6_, p_229091_7_)
private static void shadowVertex(MatrixStack.Entry entry, IVertexBuilder builder, float alpha,
float x, float y, float z, float u, float v) {
builder.vertex(entry.pose(), x, y, z)
.color(1.0F, 1.0F, 1.0F, alpha)
.uv(u, v)
.overlayCoords(OverlayTexture.NO_OVERLAY)
.uv2(15728880)
.normal(p_229091_0_.normal(), 0.0F, 1.0F, 0.0F)
.uv2(0xF000F0)
.normal(entry.normal(), 0.0F, 1.0F, 0.0F)
.endVertex();
}
}

View file

@ -48,7 +48,7 @@ public abstract class SyncedTileEntity extends TileEntity {
@Override
public SUpdateTileEntityPacket getUpdatePacket() {
return new SUpdateTileEntityPacket(getBlockPos(), 1, writeToClient(new CompoundNBT()));
return new SUpdateTileEntityPacket(getBlockPos(), 0, writeToClient(new CompoundNBT()));
}
@Override

View file

@ -26,6 +26,7 @@ import net.minecraft.item.ItemStack;
import net.minecraft.item.Items;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.particles.ParticleTypes;
import net.minecraft.state.Property;
import net.minecraft.state.properties.BlockStateProperties;
import net.minecraft.state.properties.SlabType;
import net.minecraft.stats.Stats;
@ -341,4 +342,19 @@ public class BlockHelper {
return false;
}
}
public static BlockState copyProperties(BlockState fromState, BlockState toState) {
for (Property<?> property : fromState.getProperties()) {
toState = copyProperty(property, fromState, toState);
}
return toState;
}
public static <T extends Comparable<T>> BlockState copyProperty(Property<T> property, BlockState fromState, BlockState toState) {
if (fromState.hasProperty(property) && toState.hasProperty(property)) {
return toState.setValue(property, fromState.getValue(property));
}
return toState;
}
}

View file

@ -2,9 +2,7 @@ package com.simibubi.create.foundation.utility;
import net.minecraft.block.Blocks;
import net.minecraft.item.DyeColor;
import net.minecraft.item.Item;
import net.minecraft.util.IItemProvider;
import net.minecraftforge.common.Tags;
public class DyeHelper {
@ -46,41 +44,4 @@ public class DyeHelper {
}
}
public static Tags.IOptionalNamedTag<Item> getTagOfDye(DyeColor color) {
switch (color) {
case BLACK:
return Tags.Items.DYES_BLACK;
case BLUE:
return Tags.Items.DYES_BLUE;
case BROWN:
return Tags.Items.DYES_BROWN;
case CYAN:
return Tags.Items.DYES_CYAN;
case GRAY:
return Tags.Items.DYES_GRAY;
case GREEN:
return Tags.Items.DYES_GREEN;
case LIGHT_BLUE:
return Tags.Items.DYES_LIGHT_BLUE;
case LIGHT_GRAY:
return Tags.Items.DYES_LIGHT_GRAY;
case LIME:
return Tags.Items.DYES_LIME;
case MAGENTA:
return Tags.Items.DYES_MAGENTA;
case ORANGE:
return Tags.Items.DYES_ORANGE;
case PINK:
return Tags.Items.DYES_PINK;
case PURPLE:
return Tags.Items.DYES_PURPLE;
case RED:
return Tags.Items.DYES_RED;
case YELLOW:
return Tags.Items.DYES_YELLOW;
case WHITE:
default:
return Tags.Items.DYES_WHITE;
}
}
}

View file

@ -0,0 +1,32 @@
package com.simibubi.create.foundation.utility;
import java.util.function.Supplier;
import net.minecraftforge.common.util.NonNullSupplier;
public class ResetableLazy<T> implements Supplier<T> {
private final NonNullSupplier<T> supplier;
private T value;
public ResetableLazy(NonNullSupplier<T> supplier) {
this.supplier = supplier;
}
@Override
public T get() {
if (value == null) {
value = supplier.get();
}
return value;
}
public void reset() {
value = null;
}
public static <T> ResetableLazy<T> of(NonNullSupplier<T> supplier) {
return new ResetableLazy<>(supplier);
}
}