From 9c8d03569403ba832b072b3a223718bb53014dca Mon Sep 17 00:00:00 2001 From: grimmauld Date: Fri, 26 Mar 2021 13:35:45 +0100 Subject: [PATCH] Dya see the dye? --- src/generated/resources/.cache/cache | 30 ++-- .../assets/create/blockstates/fluid_pipe.json | 154 +++++++++--------- .../create/blockstates/radial_chassis.json | 96 +++++------ .../resources/assets/create/lang/en_us.json | 4 + .../assets/create/lang/unfinished/de_de.json | 6 +- .../assets/create/lang/unfinished/es_es.json | 6 +- .../assets/create/lang/unfinished/es_mx.json | 6 +- .../assets/create/lang/unfinished/fr_fr.json | 6 +- .../assets/create/lang/unfinished/it_it.json | 6 +- .../assets/create/lang/unfinished/ja_jp.json | 6 +- .../assets/create/lang/unfinished/ko_kr.json | 6 +- .../assets/create/lang/unfinished/nl_nl.json | 6 +- .../assets/create/lang/unfinished/pt_br.json | 6 +- .../assets/create/lang/unfinished/ru_ru.json | 6 +- .../assets/create/lang/unfinished/zh_cn.json | 6 +- .../assets/create/lang/unfinished/zh_tw.json | 6 +- .../logistics/item/filter/ItemAttribute.java | 37 ++--- .../item/filter/attribute/ColorAttribute.java | 86 ++++++++++ .../assets/create/lang/default/messages.json | 4 + 19 files changed, 312 insertions(+), 171 deletions(-) create mode 100644 src/main/java/com/simibubi/create/content/logistics/item/filter/attribute/ColorAttribute.java diff --git a/src/generated/resources/.cache/cache b/src/generated/resources/.cache/cache index c067095a9..a14f23093 100644 --- a/src/generated/resources/.cache/cache +++ b/src/generated/resources/.cache/cache @@ -140,7 +140,7 @@ de8a40b7daf1497d5aecee47a43b3e0b1d030b00 assets/create/blockstates/fancy_scoria_ fc9ac0a7e7191b93516719455a17177fa6524ecc assets/create/blockstates/fancy_weathered_limestone_bricks_slab.json b2a7c321b1795f20e7433f81a55ce4683de081b8 assets/create/blockstates/fancy_weathered_limestone_bricks_stairs.json 6372fe02ba0065acb0758121c45a15a1a8fdc5de assets/create/blockstates/fancy_weathered_limestone_bricks_wall.json -48086bf71a824faf14841b698050cc8544b09a9b assets/create/blockstates/fluid_pipe.json +3d97226b5e8d8f70ed08e45e78db1faf78d5e28b assets/create/blockstates/fluid_pipe.json f0eaab18e16c4f3f65ebf3b55b08f0dc445720fe assets/create/blockstates/fluid_tank.json 5408d92ab02af86539ac42971d4033545970bb3a assets/create/blockstates/fluid_valve.json e9da1794b6ece7f9aa8bcb43d42c23a55446133b assets/create/blockstates/flywheel.json @@ -337,7 +337,7 @@ e8b0a401c10d1ba67ed71ba31bd5f9bc28571b65 assets/create/blockstates/powered_toggl d06cd9a1101b18d306a786320aab12018b1325d6 assets/create/blockstates/purple_sail.json 92957119abd5fbcca36a113b2a80255fd70fc303 assets/create/blockstates/purple_seat.json 61035f8afe75ff7bbd291da5d8690bcbebe679eb assets/create/blockstates/purple_valve_handle.json -4439fc83a8c7370ab44b211a3fd48abde20a4728 assets/create/blockstates/radial_chassis.json +8d7e653bfd9846e684a0d3725595714a19201017 assets/create/blockstates/radial_chassis.json 45877c4d90a7185c2f304edbd67379d800920439 assets/create/blockstates/red_sail.json da1b08387af7afa0855ee8d040f620c01f20660a assets/create/blockstates/red_seat.json 722fc77bbf387af8a4016e42cbf9501d2b968881 assets/create/blockstates/red_valve_handle.json @@ -403,19 +403,19 @@ a3a11524cd3515fc01d905767b4b7ea782adaf03 assets/create/blockstates/yellow_seat.j 7f39521b211441f5c3e06d60c5978cebe16cacfb assets/create/blockstates/zinc_block.json b7181bcd8182b2f17088e5aa881f374c9c65470c assets/create/blockstates/zinc_ore.json ce0e5405da381a86625b908c569c5dbe347abdba assets/create/lang/en_ud.json -5383435fbb7d8be0c6cdc8a4ebfae072645e461f assets/create/lang/en_us.json -f67a8ceef1ec2091b53198e5509e80ac9e5b82c1 assets/create/lang/unfinished/de_de.json -174bd2c5b0fe4560030c4b5f92dd795ce7785245 assets/create/lang/unfinished/es_es.json -20783faf769c31e3d8200ebdc78256e6845e4fc6 assets/create/lang/unfinished/es_mx.json -c33171dd6390d80e39beef5c1511e72e7515c390 assets/create/lang/unfinished/fr_fr.json -38bff62b21ff5c241cab0e06cc161cd12162749e assets/create/lang/unfinished/it_it.json -c5a21a9238d491434fac9552c2372b0e2c5a8612 assets/create/lang/unfinished/ja_jp.json -fab3e5b787268d39fa3b1c31d923e9d4f4b66419 assets/create/lang/unfinished/ko_kr.json -62f4a359bf78057eaf9a3ef73766ee5e25833ce6 assets/create/lang/unfinished/nl_nl.json -4fd663de3f40c2e2c569de95cfce4167e8a42cb1 assets/create/lang/unfinished/pt_br.json -d431bca588528894340f8619cfcd82013eb04635 assets/create/lang/unfinished/ru_ru.json -752dee8e473eb96deaa7a6b1f8405a1313c99cec assets/create/lang/unfinished/zh_cn.json -efe100b3543f98a16f4230b7278a66f9bd00166c assets/create/lang/unfinished/zh_tw.json +e572959e40b9917e88e6b86b5b9ebbf091d5f1ba assets/create/lang/en_us.json +6d55a1325fc8bf894b92285f217b794e32575739 assets/create/lang/unfinished/de_de.json +77c60af805305234d28421be451a6091c9222d44 assets/create/lang/unfinished/es_es.json +d623da600d9f84f7ace4689b44e982746364cd36 assets/create/lang/unfinished/es_mx.json +41b68809a2c0267be7e6966274e00a69f370b743 assets/create/lang/unfinished/fr_fr.json +4606b3e7bcbb0b54802e52a800838343e84087ee assets/create/lang/unfinished/it_it.json +38e23ba73a515cb238d3899cc7517ff30223a3bc assets/create/lang/unfinished/ja_jp.json +0e34e4848b8e0ea0b73778477cc4790d6a637143 assets/create/lang/unfinished/ko_kr.json +3d790d06451adfab91ed133e80239df6e6221567 assets/create/lang/unfinished/nl_nl.json +d2e1804d40933c6b6e3badcc1ae197f80fb839af assets/create/lang/unfinished/pt_br.json +ae45aacb4418411dec1e6248637094efec94bd24 assets/create/lang/unfinished/ru_ru.json +ba653601c0452116fd5f8b820a136b4833dcb426 assets/create/lang/unfinished/zh_cn.json +1087875125ce70b1543df07e3957b14b5ef60e9f assets/create/lang/unfinished/zh_tw.json 846200eb548d3bfa2e77b41039de159b4b6cfb45 assets/create/models/block/acacia_window.json 1930fa3a3c98d53dd19e4ee7f55bc27fd47aa281 assets/create/models/block/acacia_window_pane_noside.json 1763ea2c9b981d187f5031ba608f3d5d3be3986a assets/create/models/block/acacia_window_pane_noside_alt.json diff --git a/src/generated/resources/assets/create/blockstates/fluid_pipe.json b/src/generated/resources/assets/create/blockstates/fluid_pipe.json index 80a25280c..a4cffcde7 100644 --- a/src/generated/resources/assets/create/blockstates/fluid_pipe.json +++ b/src/generated/resources/assets/create/blockstates/fluid_pipe.json @@ -61,9 +61,9 @@ { "when": { "down": "false", + "north": "true", "up": "true", - "south": "false", - "north": "true" + "south": "false" }, "apply": { "model": "create:block/fluid_pipe/lu_x" @@ -72,9 +72,9 @@ { "when": { "down": "false", + "north": "false", "up": "true", - "south": "true", - "north": "false" + "south": "true" }, "apply": { "model": "create:block/fluid_pipe/ru_x" @@ -83,9 +83,9 @@ { "when": { "down": "true", + "north": "true", "up": "false", - "south": "false", - "north": "true" + "south": "false" }, "apply": { "model": "create:block/fluid_pipe/ld_x" @@ -94,9 +94,9 @@ { "when": { "down": "true", + "north": "false", "up": "false", - "south": "true", - "north": "false" + "south": "true" }, "apply": { "model": "create:block/fluid_pipe/rd_x" @@ -105,9 +105,9 @@ { "when": { "down": "true", + "north": "false", "up": "true", - "south": "false", - "north": "false" + "south": "false" }, "apply": { "model": "create:block/fluid_pipe/ud_x" @@ -116,9 +116,9 @@ { "when": { "down": "false", + "north": "false", "up": "true", - "south": "false", - "north": "false" + "south": "false" }, "apply": { "model": "create:block/fluid_pipe/ud_x" @@ -127,9 +127,9 @@ { "when": { "down": "true", + "north": "false", "up": "false", - "south": "false", - "north": "false" + "south": "false" }, "apply": { "model": "create:block/fluid_pipe/ud_x" @@ -138,9 +138,9 @@ { "when": { "down": "false", + "north": "true", "up": "false", - "south": "true", - "north": "true" + "south": "true" }, "apply": { "model": "create:block/fluid_pipe/lr_x" @@ -149,9 +149,9 @@ { "when": { "down": "false", + "north": "true", "up": "false", - "south": "false", - "north": "true" + "south": "false" }, "apply": { "model": "create:block/fluid_pipe/lr_x" @@ -160,9 +160,9 @@ { "when": { "down": "false", + "north": "false", "up": "false", - "south": "true", - "north": "false" + "south": "true" }, "apply": { "model": "create:block/fluid_pipe/lr_x" @@ -171,9 +171,9 @@ { "when": { "down": "false", + "north": "false", "up": "false", - "south": "false", - "north": "false" + "south": "false" }, "apply": { "model": "create:block/fluid_pipe/none_x" @@ -181,10 +181,10 @@ }, { "when": { - "south": "true", "west": "true", + "east": "false", "north": "false", - "east": "false" + "south": "true" }, "apply": { "model": "create:block/fluid_pipe/lu_y" @@ -192,10 +192,10 @@ }, { "when": { - "south": "true", "west": "false", + "east": "true", "north": "false", - "east": "true" + "south": "true" }, "apply": { "model": "create:block/fluid_pipe/ru_y" @@ -203,10 +203,10 @@ }, { "when": { - "south": "false", "west": "true", + "east": "false", "north": "true", - "east": "false" + "south": "false" }, "apply": { "model": "create:block/fluid_pipe/ld_y" @@ -214,10 +214,10 @@ }, { "when": { - "south": "false", "west": "false", + "east": "true", "north": "true", - "east": "true" + "south": "false" }, "apply": { "model": "create:block/fluid_pipe/rd_y" @@ -225,10 +225,10 @@ }, { "when": { - "south": "true", "west": "false", + "east": "false", "north": "true", - "east": "false" + "south": "true" }, "apply": { "model": "create:block/fluid_pipe/ud_y" @@ -236,10 +236,10 @@ }, { "when": { - "south": "true", "west": "false", + "east": "false", "north": "false", - "east": "false" + "south": "true" }, "apply": { "model": "create:block/fluid_pipe/ud_y" @@ -247,10 +247,10 @@ }, { "when": { - "south": "false", "west": "false", + "east": "false", "north": "true", - "east": "false" + "south": "false" }, "apply": { "model": "create:block/fluid_pipe/ud_y" @@ -258,10 +258,10 @@ }, { "when": { - "south": "false", "west": "true", + "east": "true", "north": "false", - "east": "true" + "south": "false" }, "apply": { "model": "create:block/fluid_pipe/lr_y" @@ -269,10 +269,10 @@ }, { "when": { - "south": "false", "west": "true", + "east": "false", "north": "false", - "east": "false" + "south": "false" }, "apply": { "model": "create:block/fluid_pipe/lr_y" @@ -280,10 +280,10 @@ }, { "when": { - "south": "false", "west": "false", + "east": "true", "north": "false", - "east": "true" + "south": "false" }, "apply": { "model": "create:block/fluid_pipe/lr_y" @@ -291,10 +291,10 @@ }, { "when": { - "south": "false", "west": "false", + "east": "false", "north": "false", - "east": "false" + "south": "false" }, "apply": { "model": "create:block/fluid_pipe/none_y" @@ -302,10 +302,10 @@ }, { "when": { - "down": "false", - "up": "true", "west": "false", - "east": "true" + "down": "false", + "east": "true", + "up": "true" }, "apply": { "model": "create:block/fluid_pipe/lu_z" @@ -313,10 +313,10 @@ }, { "when": { - "down": "false", - "up": "true", "west": "true", - "east": "false" + "down": "false", + "east": "false", + "up": "true" }, "apply": { "model": "create:block/fluid_pipe/ru_z" @@ -324,10 +324,10 @@ }, { "when": { - "down": "true", - "up": "false", "west": "false", - "east": "true" + "down": "true", + "east": "true", + "up": "false" }, "apply": { "model": "create:block/fluid_pipe/ld_z" @@ -335,10 +335,10 @@ }, { "when": { - "down": "true", - "up": "false", "west": "true", - "east": "false" + "down": "true", + "east": "false", + "up": "false" }, "apply": { "model": "create:block/fluid_pipe/rd_z" @@ -346,10 +346,10 @@ }, { "when": { + "west": "false", "down": "true", - "up": "true", - "west": "false", - "east": "false" + "east": "false", + "up": "true" }, "apply": { "model": "create:block/fluid_pipe/ud_z" @@ -357,10 +357,10 @@ }, { "when": { + "west": "false", "down": "false", - "up": "true", - "west": "false", - "east": "false" + "east": "false", + "up": "true" }, "apply": { "model": "create:block/fluid_pipe/ud_z" @@ -368,10 +368,10 @@ }, { "when": { + "west": "false", "down": "true", - "up": "false", - "west": "false", - "east": "false" + "east": "false", + "up": "false" }, "apply": { "model": "create:block/fluid_pipe/ud_z" @@ -379,10 +379,10 @@ }, { "when": { - "down": "false", - "up": "false", "west": "true", - "east": "true" + "down": "false", + "east": "true", + "up": "false" }, "apply": { "model": "create:block/fluid_pipe/lr_z" @@ -390,10 +390,10 @@ }, { "when": { - "down": "false", - "up": "false", "west": "false", - "east": "true" + "down": "false", + "east": "true", + "up": "false" }, "apply": { "model": "create:block/fluid_pipe/lr_z" @@ -401,10 +401,10 @@ }, { "when": { - "down": "false", - "up": "false", "west": "true", - "east": "false" + "down": "false", + "east": "false", + "up": "false" }, "apply": { "model": "create:block/fluid_pipe/lr_z" @@ -412,10 +412,10 @@ }, { "when": { - "down": "false", - "up": "false", "west": "false", - "east": "false" + "down": "false", + "east": "false", + "up": "false" }, "apply": { "model": "create:block/fluid_pipe/none_z" diff --git a/src/generated/resources/assets/create/blockstates/radial_chassis.json b/src/generated/resources/assets/create/blockstates/radial_chassis.json index 8bd829ffc..9d00ea8b1 100644 --- a/src/generated/resources/assets/create/blockstates/radial_chassis.json +++ b/src/generated/resources/assets/create/blockstates/radial_chassis.json @@ -29,8 +29,8 @@ }, { "when": { - "axis": "x", - "sticky_south": "true" + "sticky_south": "true", + "axis": "x" }, "apply": { "model": "create:block/radial_chassis_side_x_sticky", @@ -39,8 +39,8 @@ }, { "when": { - "axis": "y", - "sticky_south": "true" + "sticky_south": "true", + "axis": "y" }, "apply": { "model": "create:block/radial_chassis_side_y_sticky" @@ -48,8 +48,8 @@ }, { "when": { - "axis": "z", - "sticky_south": "true" + "sticky_south": "true", + "axis": "z" }, "apply": { "model": "create:block/radial_chassis_side_x_sticky", @@ -59,8 +59,8 @@ }, { "when": { - "axis": "x", - "sticky_south": "false" + "sticky_south": "false", + "axis": "x" }, "apply": { "model": "create:block/radial_chassis_side_x", @@ -69,8 +69,8 @@ }, { "when": { - "axis": "y", - "sticky_south": "false" + "sticky_south": "false", + "axis": "y" }, "apply": { "model": "create:block/radial_chassis_side_y" @@ -78,8 +78,8 @@ }, { "when": { - "axis": "z", - "sticky_south": "false" + "sticky_south": "false", + "axis": "z" }, "apply": { "model": "create:block/radial_chassis_side_x", @@ -89,8 +89,8 @@ }, { "when": { - "axis": "x", - "sticky_west": "true" + "sticky_west": "true", + "axis": "x" }, "apply": { "model": "create:block/radial_chassis_side_x_sticky", @@ -99,8 +99,8 @@ }, { "when": { - "axis": "y", - "sticky_west": "true" + "sticky_west": "true", + "axis": "y" }, "apply": { "model": "create:block/radial_chassis_side_y_sticky", @@ -109,8 +109,8 @@ }, { "when": { - "axis": "z", - "sticky_west": "true" + "sticky_west": "true", + "axis": "z" }, "apply": { "model": "create:block/radial_chassis_side_z_sticky", @@ -119,8 +119,8 @@ }, { "when": { - "axis": "x", - "sticky_west": "false" + "sticky_west": "false", + "axis": "x" }, "apply": { "model": "create:block/radial_chassis_side_x", @@ -129,8 +129,8 @@ }, { "when": { - "axis": "y", - "sticky_west": "false" + "sticky_west": "false", + "axis": "y" }, "apply": { "model": "create:block/radial_chassis_side_y", @@ -139,8 +139,8 @@ }, { "when": { - "axis": "z", - "sticky_west": "false" + "sticky_west": "false", + "axis": "z" }, "apply": { "model": "create:block/radial_chassis_side_z", @@ -149,8 +149,8 @@ }, { "when": { - "axis": "x", - "sticky_north": "true" + "sticky_north": "true", + "axis": "x" }, "apply": { "model": "create:block/radial_chassis_side_x_sticky" @@ -158,8 +158,8 @@ }, { "when": { - "axis": "y", - "sticky_north": "true" + "sticky_north": "true", + "axis": "y" }, "apply": { "model": "create:block/radial_chassis_side_y_sticky", @@ -168,8 +168,8 @@ }, { "when": { - "axis": "z", - "sticky_north": "true" + "sticky_north": "true", + "axis": "z" }, "apply": { "model": "create:block/radial_chassis_side_x_sticky", @@ -178,8 +178,8 @@ }, { "when": { - "axis": "x", - "sticky_north": "false" + "sticky_north": "false", + "axis": "x" }, "apply": { "model": "create:block/radial_chassis_side_x" @@ -187,8 +187,8 @@ }, { "when": { - "axis": "y", - "sticky_north": "false" + "sticky_north": "false", + "axis": "y" }, "apply": { "model": "create:block/radial_chassis_side_y", @@ -197,8 +197,8 @@ }, { "when": { - "axis": "z", - "sticky_north": "false" + "sticky_north": "false", + "axis": "z" }, "apply": { "model": "create:block/radial_chassis_side_x", @@ -207,8 +207,8 @@ }, { "when": { - "axis": "x", - "sticky_east": "true" + "sticky_east": "true", + "axis": "x" }, "apply": { "model": "create:block/radial_chassis_side_x_sticky", @@ -217,8 +217,8 @@ }, { "when": { - "axis": "y", - "sticky_east": "true" + "sticky_east": "true", + "axis": "y" }, "apply": { "model": "create:block/radial_chassis_side_y_sticky", @@ -227,8 +227,8 @@ }, { "when": { - "axis": "z", - "sticky_east": "true" + "sticky_east": "true", + "axis": "z" }, "apply": { "model": "create:block/radial_chassis_side_z_sticky" @@ -236,8 +236,8 @@ }, { "when": { - "axis": "x", - "sticky_east": "false" + "sticky_east": "false", + "axis": "x" }, "apply": { "model": "create:block/radial_chassis_side_x", @@ -246,8 +246,8 @@ }, { "when": { - "axis": "y", - "sticky_east": "false" + "sticky_east": "false", + "axis": "y" }, "apply": { "model": "create:block/radial_chassis_side_y", @@ -256,8 +256,8 @@ }, { "when": { - "axis": "z", - "sticky_east": "false" + "sticky_east": "false", + "axis": "z" }, "apply": { "model": "create:block/radial_chassis_side_z" diff --git a/src/generated/resources/assets/create/lang/en_us.json b/src/generated/resources/assets/create/lang/en_us.json index 57cfdb221..690dd2fbe 100644 --- a/src/generated/resources/assets/create/lang/en_us.json +++ b/src/generated/resources/assets/create/lang/en_us.json @@ -1023,6 +1023,10 @@ "create.item_attributes.added_by.inverted": "was not added by %1$s", "create.item_attributes.has_enchant": "is enchanted with %1$s", "create.item_attributes.has_enchant.inverted": "is not enchanted with %1$s", + "create.item_attributes.color": "is dyed %1$s", + "create.item_attributes.color.inverted": "is not dyed %1$s", + "create.item_attributes.max_enchanted": "is enchanted at max level", + "create.item_attributes.max_enchanted.inverted": "is not enchanted at max level", "create.item_attributes.has_fluid": "contains %1$s", "create.item_attributes.has_fluid.inverted": "does not contain %1$s", "create.item_attributes.has_name": "has the custom name %1$s", diff --git a/src/generated/resources/assets/create/lang/unfinished/de_de.json b/src/generated/resources/assets/create/lang/unfinished/de_de.json index aec1cbcc7..8e489b370 100644 --- a/src/generated/resources/assets/create/lang/unfinished/de_de.json +++ b/src/generated/resources/assets/create/lang/unfinished/de_de.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 1506", + "_": "Missing Localizations: 1510", "_": "->------------------------] Game Elements [------------------------<-", @@ -1024,6 +1024,10 @@ "create.item_attributes.added_by.inverted": "UNLOCALIZED: was not added by %1$s", "create.item_attributes.has_enchant": "UNLOCALIZED: is enchanted with %1$s", "create.item_attributes.has_enchant.inverted": "UNLOCALIZED: is not enchanted with %1$s", + "create.item_attributes.color": "UNLOCALIZED: is dyed %1$s", + "create.item_attributes.color.inverted": "UNLOCALIZED: is not dyed %1$s", + "create.item_attributes.max_enchanted": "UNLOCALIZED: is enchanted at max level", + "create.item_attributes.max_enchanted.inverted": "UNLOCALIZED: is not enchanted at max level", "create.item_attributes.has_fluid": "UNLOCALIZED: contains %1$s", "create.item_attributes.has_fluid.inverted": "UNLOCALIZED: does not contain %1$s", "create.item_attributes.has_name": "UNLOCALIZED: has the custom name %1$s", diff --git a/src/generated/resources/assets/create/lang/unfinished/es_es.json b/src/generated/resources/assets/create/lang/unfinished/es_es.json index 683a53505..22baf842f 100644 --- a/src/generated/resources/assets/create/lang/unfinished/es_es.json +++ b/src/generated/resources/assets/create/lang/unfinished/es_es.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 537", + "_": "Missing Localizations: 541", "_": "->------------------------] Game Elements [------------------------<-", @@ -1024,6 +1024,10 @@ "create.item_attributes.added_by.inverted": "no fue añadida por %1$s", "create.item_attributes.has_enchant": "está encantado con %1$s", "create.item_attributes.has_enchant.inverted": "no está encantado con %1$s", + "create.item_attributes.color": "UNLOCALIZED: is dyed %1$s", + "create.item_attributes.color.inverted": "UNLOCALIZED: is not dyed %1$s", + "create.item_attributes.max_enchanted": "UNLOCALIZED: is enchanted at max level", + "create.item_attributes.max_enchanted.inverted": "UNLOCALIZED: is not enchanted at max level", "create.item_attributes.has_fluid": "contiene %1$s", "create.item_attributes.has_fluid.inverted": "no contiene %1$s", "create.item_attributes.has_name": "tiene el nombre personalizado %1$s", diff --git a/src/generated/resources/assets/create/lang/unfinished/es_mx.json b/src/generated/resources/assets/create/lang/unfinished/es_mx.json index 970066780..854c8e156 100644 --- a/src/generated/resources/assets/create/lang/unfinished/es_mx.json +++ b/src/generated/resources/assets/create/lang/unfinished/es_mx.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 1436", + "_": "Missing Localizations: 1440", "_": "->------------------------] Game Elements [------------------------<-", @@ -1024,6 +1024,10 @@ "create.item_attributes.added_by.inverted": "UNLOCALIZED: was not added by %1$s", "create.item_attributes.has_enchant": "UNLOCALIZED: is enchanted with %1$s", "create.item_attributes.has_enchant.inverted": "UNLOCALIZED: is not enchanted with %1$s", + "create.item_attributes.color": "UNLOCALIZED: is dyed %1$s", + "create.item_attributes.color.inverted": "UNLOCALIZED: is not dyed %1$s", + "create.item_attributes.max_enchanted": "UNLOCALIZED: is enchanted at max level", + "create.item_attributes.max_enchanted.inverted": "UNLOCALIZED: is not enchanted at max level", "create.item_attributes.has_fluid": "UNLOCALIZED: contains %1$s", "create.item_attributes.has_fluid.inverted": "UNLOCALIZED: does not contain %1$s", "create.item_attributes.has_name": "UNLOCALIZED: has the custom name %1$s", diff --git a/src/generated/resources/assets/create/lang/unfinished/fr_fr.json b/src/generated/resources/assets/create/lang/unfinished/fr_fr.json index 0add5245a..a41a33360 100644 --- a/src/generated/resources/assets/create/lang/unfinished/fr_fr.json +++ b/src/generated/resources/assets/create/lang/unfinished/fr_fr.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 1218", + "_": "Missing Localizations: 1222", "_": "->------------------------] Game Elements [------------------------<-", @@ -1024,6 +1024,10 @@ "create.item_attributes.added_by.inverted": "n'a pas été ajouté par %1$s", "create.item_attributes.has_enchant": "est enchanté %1$s", "create.item_attributes.has_enchant.inverted": "n'est pas enchenté %1$s", + "create.item_attributes.color": "UNLOCALIZED: is dyed %1$s", + "create.item_attributes.color.inverted": "UNLOCALIZED: is not dyed %1$s", + "create.item_attributes.max_enchanted": "UNLOCALIZED: is enchanted at max level", + "create.item_attributes.max_enchanted.inverted": "UNLOCALIZED: is not enchanted at max level", "create.item_attributes.has_fluid": "contient %1$s", "create.item_attributes.has_fluid.inverted": "ne contient pas %1$s", "create.item_attributes.has_name": "est renommé %1$s", diff --git a/src/generated/resources/assets/create/lang/unfinished/it_it.json b/src/generated/resources/assets/create/lang/unfinished/it_it.json index 321d024fc..87fc548f2 100644 --- a/src/generated/resources/assets/create/lang/unfinished/it_it.json +++ b/src/generated/resources/assets/create/lang/unfinished/it_it.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 554", + "_": "Missing Localizations: 558", "_": "->------------------------] Game Elements [------------------------<-", @@ -1024,6 +1024,10 @@ "create.item_attributes.added_by.inverted": "non è stato aggiunto da %1$s", "create.item_attributes.has_enchant": "è stato incantato con %1$s", "create.item_attributes.has_enchant.inverted": "non è stato incantato con %1$s", + "create.item_attributes.color": "UNLOCALIZED: is dyed %1$s", + "create.item_attributes.color.inverted": "UNLOCALIZED: is not dyed %1$s", + "create.item_attributes.max_enchanted": "UNLOCALIZED: is enchanted at max level", + "create.item_attributes.max_enchanted.inverted": "UNLOCALIZED: is not enchanted at max level", "create.item_attributes.has_fluid": "contiene %1$s", "create.item_attributes.has_fluid.inverted": "non contiene %1$s", "create.item_attributes.has_name": "è stato rinominato in %1$s", diff --git a/src/generated/resources/assets/create/lang/unfinished/ja_jp.json b/src/generated/resources/assets/create/lang/unfinished/ja_jp.json index 5b64d94c6..245f96ca6 100644 --- a/src/generated/resources/assets/create/lang/unfinished/ja_jp.json +++ b/src/generated/resources/assets/create/lang/unfinished/ja_jp.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 561", + "_": "Missing Localizations: 565", "_": "->------------------------] Game Elements [------------------------<-", @@ -1024,6 +1024,10 @@ "create.item_attributes.added_by.inverted": "%1$sによって追加されていないか", "create.item_attributes.has_enchant": "エンチャントされているか%1$s", "create.item_attributes.has_enchant.inverted": "エンチャントがされていないか", + "create.item_attributes.color": "UNLOCALIZED: is dyed %1$s", + "create.item_attributes.color.inverted": "UNLOCALIZED: is not dyed %1$s", + "create.item_attributes.max_enchanted": "UNLOCALIZED: is enchanted at max level", + "create.item_attributes.max_enchanted.inverted": "UNLOCALIZED: is not enchanted at max level", "create.item_attributes.has_fluid": "%1$sを含んでいるか", "create.item_attributes.has_fluid.inverted": "%1$sを含んでいないか", "create.item_attributes.has_name": "%1$sの名前が付けられているか", diff --git a/src/generated/resources/assets/create/lang/unfinished/ko_kr.json b/src/generated/resources/assets/create/lang/unfinished/ko_kr.json index b0845cb27..499ddcbc1 100644 --- a/src/generated/resources/assets/create/lang/unfinished/ko_kr.json +++ b/src/generated/resources/assets/create/lang/unfinished/ko_kr.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 607", + "_": "Missing Localizations: 611", "_": "->------------------------] Game Elements [------------------------<-", @@ -1024,6 +1024,10 @@ "create.item_attributes.added_by.inverted": "%1$s모드가 추가하지 않음", "create.item_attributes.has_enchant": "UNLOCALIZED: is enchanted with %1$s", "create.item_attributes.has_enchant.inverted": "UNLOCALIZED: is not enchanted with %1$s", + "create.item_attributes.color": "UNLOCALIZED: is dyed %1$s", + "create.item_attributes.color.inverted": "UNLOCALIZED: is not dyed %1$s", + "create.item_attributes.max_enchanted": "UNLOCALIZED: is enchanted at max level", + "create.item_attributes.max_enchanted.inverted": "UNLOCALIZED: is not enchanted at max level", "create.item_attributes.has_fluid": "UNLOCALIZED: contains %1$s", "create.item_attributes.has_fluid.inverted": "UNLOCALIZED: does not contain %1$s", "create.item_attributes.has_name": "UNLOCALIZED: has the custom name %1$s", diff --git a/src/generated/resources/assets/create/lang/unfinished/nl_nl.json b/src/generated/resources/assets/create/lang/unfinished/nl_nl.json index c10eef86d..8c7090e72 100644 --- a/src/generated/resources/assets/create/lang/unfinished/nl_nl.json +++ b/src/generated/resources/assets/create/lang/unfinished/nl_nl.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 1705", + "_": "Missing Localizations: 1709", "_": "->------------------------] Game Elements [------------------------<-", @@ -1024,6 +1024,10 @@ "create.item_attributes.added_by.inverted": "UNLOCALIZED: was not added by %1$s", "create.item_attributes.has_enchant": "UNLOCALIZED: is enchanted with %1$s", "create.item_attributes.has_enchant.inverted": "UNLOCALIZED: is not enchanted with %1$s", + "create.item_attributes.color": "UNLOCALIZED: is dyed %1$s", + "create.item_attributes.color.inverted": "UNLOCALIZED: is not dyed %1$s", + "create.item_attributes.max_enchanted": "UNLOCALIZED: is enchanted at max level", + "create.item_attributes.max_enchanted.inverted": "UNLOCALIZED: is not enchanted at max level", "create.item_attributes.has_fluid": "UNLOCALIZED: contains %1$s", "create.item_attributes.has_fluid.inverted": "UNLOCALIZED: does not contain %1$s", "create.item_attributes.has_name": "UNLOCALIZED: has the custom name %1$s", diff --git a/src/generated/resources/assets/create/lang/unfinished/pt_br.json b/src/generated/resources/assets/create/lang/unfinished/pt_br.json index e45ff7651..69c3540e9 100644 --- a/src/generated/resources/assets/create/lang/unfinished/pt_br.json +++ b/src/generated/resources/assets/create/lang/unfinished/pt_br.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 1771", + "_": "Missing Localizations: 1775", "_": "->------------------------] Game Elements [------------------------<-", @@ -1024,6 +1024,10 @@ "create.item_attributes.added_by.inverted": "UNLOCALIZED: was not added by %1$s", "create.item_attributes.has_enchant": "UNLOCALIZED: is enchanted with %1$s", "create.item_attributes.has_enchant.inverted": "UNLOCALIZED: is not enchanted with %1$s", + "create.item_attributes.color": "UNLOCALIZED: is dyed %1$s", + "create.item_attributes.color.inverted": "UNLOCALIZED: is not dyed %1$s", + "create.item_attributes.max_enchanted": "UNLOCALIZED: is enchanted at max level", + "create.item_attributes.max_enchanted.inverted": "UNLOCALIZED: is not enchanted at max level", "create.item_attributes.has_fluid": "UNLOCALIZED: contains %1$s", "create.item_attributes.has_fluid.inverted": "UNLOCALIZED: does not contain %1$s", "create.item_attributes.has_name": "UNLOCALIZED: has the custom name %1$s", diff --git a/src/generated/resources/assets/create/lang/unfinished/ru_ru.json b/src/generated/resources/assets/create/lang/unfinished/ru_ru.json index 4869223bd..cd3635698 100644 --- a/src/generated/resources/assets/create/lang/unfinished/ru_ru.json +++ b/src/generated/resources/assets/create/lang/unfinished/ru_ru.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 557", + "_": "Missing Localizations: 561", "_": "->------------------------] Game Elements [------------------------<-", @@ -1024,6 +1024,10 @@ "create.item_attributes.added_by.inverted": "не был добавлен %1$s", "create.item_attributes.has_enchant": "зачарован на %1$s", "create.item_attributes.has_enchant.inverted": "не зачарован на %1$s", + "create.item_attributes.color": "UNLOCALIZED: is dyed %1$s", + "create.item_attributes.color.inverted": "UNLOCALIZED: is not dyed %1$s", + "create.item_attributes.max_enchanted": "UNLOCALIZED: is enchanted at max level", + "create.item_attributes.max_enchanted.inverted": "UNLOCALIZED: is not enchanted at max level", "create.item_attributes.has_fluid": "содержит %1$s", "create.item_attributes.has_fluid.inverted": "не содержит %1$s", "create.item_attributes.has_name": "имеет нестандартное имя %1$s", diff --git a/src/generated/resources/assets/create/lang/unfinished/zh_cn.json b/src/generated/resources/assets/create/lang/unfinished/zh_cn.json index e1f1eeb33..add7d93b3 100644 --- a/src/generated/resources/assets/create/lang/unfinished/zh_cn.json +++ b/src/generated/resources/assets/create/lang/unfinished/zh_cn.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 555", + "_": "Missing Localizations: 559", "_": "->------------------------] Game Elements [------------------------<-", @@ -1024,6 +1024,10 @@ "create.item_attributes.added_by.inverted": "不是由%1$s添加", "create.item_attributes.has_enchant": "有附魔效果%1$s", "create.item_attributes.has_enchant.inverted": "没有附魔效果%1$s", + "create.item_attributes.color": "UNLOCALIZED: is dyed %1$s", + "create.item_attributes.color.inverted": "UNLOCALIZED: is not dyed %1$s", + "create.item_attributes.max_enchanted": "UNLOCALIZED: is enchanted at max level", + "create.item_attributes.max_enchanted.inverted": "UNLOCALIZED: is not enchanted at max level", "create.item_attributes.has_fluid": "包含%1$s", "create.item_attributes.has_fluid.inverted": "不包含%1$s", "create.item_attributes.has_name": "有自定义名称%1$s", diff --git a/src/generated/resources/assets/create/lang/unfinished/zh_tw.json b/src/generated/resources/assets/create/lang/unfinished/zh_tw.json index a0122693f..767b6f86c 100644 --- a/src/generated/resources/assets/create/lang/unfinished/zh_tw.json +++ b/src/generated/resources/assets/create/lang/unfinished/zh_tw.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 560", + "_": "Missing Localizations: 564", "_": "->------------------------] Game Elements [------------------------<-", @@ -1024,6 +1024,10 @@ "create.item_attributes.added_by.inverted": "不是由%1$s添加", "create.item_attributes.has_enchant": "有附魔效果%1$s", "create.item_attributes.has_enchant.inverted": "沒有附魔效果%1$s", + "create.item_attributes.color": "UNLOCALIZED: is dyed %1$s", + "create.item_attributes.color.inverted": "UNLOCALIZED: is not dyed %1$s", + "create.item_attributes.max_enchanted": "UNLOCALIZED: is enchanted at max level", + "create.item_attributes.max_enchanted.inverted": "UNLOCALIZED: is not enchanted at max level", "create.item_attributes.has_fluid": "包含%1$s", "create.item_attributes.has_fluid.inverted": "不包含%1$s", "create.item_attributes.has_name": "有自定義名稱%1$s", diff --git a/src/main/java/com/simibubi/create/content/logistics/item/filter/ItemAttribute.java b/src/main/java/com/simibubi/create/content/logistics/item/filter/ItemAttribute.java index ea1782646..1f6cdfa46 100644 --- a/src/main/java/com/simibubi/create/content/logistics/item/filter/ItemAttribute.java +++ b/src/main/java/com/simibubi/create/content/logistics/item/filter/ItemAttribute.java @@ -1,31 +1,15 @@ package com.simibubi.create.content.logistics.item.filter; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.List; -import java.util.Optional; -import java.util.function.BiPredicate; -import java.util.function.Predicate; -import java.util.stream.Collectors; - -import org.apache.commons.lang3.StringUtils; - -import com.google.common.base.Predicates; import com.simibubi.create.AllRecipeTypes; import com.simibubi.create.content.logistics.InWorldProcessing; -import com.simibubi.create.content.logistics.item.filter.attribute.BookAuthorAttribute; -import com.simibubi.create.content.logistics.item.filter.attribute.BookCopyAttribute; -import com.simibubi.create.content.logistics.item.filter.attribute.EnchantAttribute; -import com.simibubi.create.content.logistics.item.filter.attribute.FluidContentsAttribute; -import com.simibubi.create.content.logistics.item.filter.attribute.ItemNameAttribute; +import com.simibubi.create.content.logistics.item.filter.attribute.*; import com.simibubi.create.content.logistics.item.filter.attribute.astralsorcery.AstralSorceryAmuletAttribute; import com.simibubi.create.content.logistics.item.filter.attribute.astralsorcery.AstralSorceryAttunementAttribute; import com.simibubi.create.content.logistics.item.filter.attribute.astralsorcery.AstralSorceryCrystalAttribute; import com.simibubi.create.content.logistics.item.filter.attribute.astralsorcery.AstralSorceryPerkGemAttribute; import com.simibubi.create.foundation.utility.Lang; - import net.minecraft.client.resources.I18n; +import net.minecraft.enchantment.EnchantmentHelper; import net.minecraft.inventory.IInventory; import net.minecraft.item.BlockItem; import net.minecraft.item.Item; @@ -45,6 +29,12 @@ import net.minecraftforge.fml.ModList; import net.minecraftforge.forgespi.language.IModInfo; import net.minecraftforge.items.ItemStackHandler; import net.minecraftforge.items.wrapper.RecipeWrapper; +import org.apache.commons.lang3.StringUtils; + +import java.util.*; +import java.util.function.BiPredicate; +import java.util.function.Predicate; +import java.util.stream.Collectors; public interface ItemAttribute { @@ -54,6 +44,7 @@ public interface ItemAttribute { static ItemAttribute inTag = register(new InTag(new ResourceLocation("dummy"))); static ItemAttribute inItemGroup = register(new InItemGroup(ItemGroup.MISC)); static ItemAttribute hasEnchant = register(EnchantAttribute.EMPTY); + static ItemAttribute hasColor = register(ColorAttribute.EMPTY); static ItemAttribute hasFluid = register(FluidContentsAttribute.EMPTY); static ItemAttribute hasName = register(new ItemNameAttribute("dummy")); static ItemAttribute astralAmulet = register(new AstralSorceryAmuletAttribute("dummy", -1)); @@ -130,8 +121,9 @@ public interface ItemAttribute { RENAMED(ItemStack::hasDisplayName), DAMAGED(ItemStack::isDamaged), BADLY_DAMAGED(s -> s.isDamaged() && s.getDamage() / s.getMaxDamage() > 3 / 4f), - NOT_STACKABLE(Predicates.not(ItemStack::isStackable)), + NOT_STACKABLE(((Predicate) ItemStack::isStackable).negate()), EQUIPABLE(s -> s.getEquipmentSlot() != null), + MAX_ENCHANTED(StandardTraits::maxEnchanted), FURNACE_FUEL(AbstractFurnaceTileEntity::isFuel), WASHABLE(InWorldProcessing::isWashable), CRUSHABLE((s, w) -> testRecipe(s, w, AllRecipeTypes.CRUSHING.getType()) @@ -155,6 +147,13 @@ public interface ItemAttribute { .isPresent(); } + private static boolean maxEnchanted(ItemStack s) { + return EnchantmentHelper.getEnchantments(s.getEnchantmentTagList()) + .entrySet() + .stream() + .anyMatch(e -> e.getKey().getMaxLevel() <= e.getValue()); + } + private StandardTraits(BiPredicate test) { this.testWithWorld = test; } diff --git a/src/main/java/com/simibubi/create/content/logistics/item/filter/attribute/ColorAttribute.java b/src/main/java/com/simibubi/create/content/logistics/item/filter/attribute/ColorAttribute.java new file mode 100644 index 000000000..3d8fce2c9 --- /dev/null +++ b/src/main/java/com/simibubi/create/content/logistics/item/filter/attribute/ColorAttribute.java @@ -0,0 +1,86 @@ +package com.simibubi.create.content.logistics.item.filter.attribute; + +import com.simibubi.create.content.logistics.item.filter.ItemAttribute; +import net.minecraft.item.DyeColor; +import net.minecraft.item.FireworkRocketItem; +import net.minecraft.item.FireworkStarItem; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.CompoundNBT; +import net.minecraft.nbt.ListNBT; +import net.minecraft.util.text.TranslationTextComponent; + +import java.util.*; +import java.util.stream.Collectors; + +public class ColorAttribute implements ItemAttribute { + public static final ColorAttribute EMPTY = new ColorAttribute(DyeColor.PURPLE); + + public final DyeColor color; + + public ColorAttribute(DyeColor color) { + this.color = color; + } + + @Override + public boolean appliesTo(ItemStack itemStack) { + return findMatchingDyeColors(itemStack).stream().anyMatch(color::equals); + } + + @Override + public List listAttributesOf(ItemStack itemStack) { + return findMatchingDyeColors(itemStack).stream().map(ColorAttribute::new).collect(Collectors.toList()); + } + + private Collection findMatchingDyeColors(ItemStack stack) { + CompoundNBT nbt = stack.getTag(); + + DyeColor color = DyeColor.getColor(stack); + if (color != null) + return Collections.singletonList(color); + + Set colors = new HashSet<>(); + if (stack.getItem() instanceof FireworkRocketItem && nbt != null) { + ListNBT listnbt = nbt.getCompound("Fireworks").getList("Explosions", 10); + for (int i = 0; i < listnbt.size(); i++) { + colors.addAll(getFireworkStarColors(listnbt.getCompound(i))); + } + } + + if (stack.getItem() instanceof FireworkStarItem && nbt != null) { + colors.addAll(getFireworkStarColors(nbt.getCompound("Explosion"))); + } + + Arrays.stream(DyeColor.values()).filter(c -> stack.getItem().getRegistryName().getPath().startsWith(c.getTranslationKey() + "_")).forEach(colors::add); + + return colors; + } + + private Collection getFireworkStarColors(CompoundNBT compound) { + Set colors = new HashSet<>(); + Arrays.stream(compound.getIntArray("Colors")).mapToObj(DyeColor::byFireworkColor).forEach(colors::add); + Arrays.stream(compound.getIntArray("FadeColors")).mapToObj(DyeColor::byFireworkColor).forEach(colors::add); + return colors; + } + + @Override + public String getTranslationKey() { + return "color"; + } + + @Override + public Object[] getTranslationParameters() { + return new Object[]{new TranslationTextComponent(color.getTranslationKey()).getFormattedText()}; + } + + @Override + public void writeNBT(CompoundNBT nbt) { + nbt.putInt("id", color.getId()); + } + + @Override + public ItemAttribute readNBT(CompoundNBT nbt) { + return nbt.contains("id") ? + new ColorAttribute(DyeColor.byId(nbt.getInt("id"))) + : EMPTY; + } +} diff --git a/src/main/resources/assets/create/lang/default/messages.json b/src/main/resources/assets/create/lang/default/messages.json index 2131d38a8..a5176a70f 100644 --- a/src/main/resources/assets/create/lang/default/messages.json +++ b/src/main/resources/assets/create/lang/default/messages.json @@ -379,6 +379,10 @@ "create.item_attributes.has_enchant": "is enchanted with %1$s", "create.item_attributes.has_enchant.inverted": "is not enchanted with %1$s", + "create.item_attributes.color": "is dyed %1$s", + "create.item_attributes.color.inverted": "is not dyed %1$s", + "create.item_attributes.max_enchanted": "is enchanted at max level", + "create.item_attributes.max_enchanted.inverted": "is not enchanted at max level", "create.item_attributes.has_fluid": "contains %1$s", "create.item_attributes.has_fluid.inverted": "does not contain %1$s", "create.item_attributes.has_name": "has the custom name %1$s",