Trains detected

- Added the Train Observer
This commit is contained in:
simibubi 2022-06-05 17:02:33 +02:00
parent 648f43e870
commit e203801aad
50 changed files with 838 additions and 62 deletions

View file

@ -492,6 +492,7 @@ e815bfd854c2653f10828bb11950f7fb991d7efc assets/create/blockstates/stressometer.
8b0c2c7ac72529565b3339aa8df7565858100afa assets/create/blockstates/tiled_glass.json
a2454400b1cf9889f70aebdc89c52a1be25f543c assets/create/blockstates/tiled_glass_pane.json
96c45abe7a5d9273feaf5f747d14cee8e04b58da assets/create/blockstates/track.json
98b936d72da49ee02eacd0b3244fe133e5575bb1 assets/create/blockstates/track_observer.json
408ae1009ee8bb2f2b83753d5909c53744f7865f assets/create/blockstates/track_signal.json
60609cfbcc9be6f7e41fb493ef3147beb9750b60 assets/create/blockstates/track_station.json
b000a6cde143f8a12fc8996d1ac8b5164f75253b assets/create/blockstates/train_door.json
@ -550,23 +551,23 @@ bf2b0310500213ff853c748c236eb5d01f61658e assets/create/blockstates/yellow_toolbo
6801fa1f466f172700e573e5b8ee8ee5f9ca4583 assets/create/blockstates/yellow_valve_handle.json
7f39521b211441f5c3e06d60c5978cebe16cacfb assets/create/blockstates/zinc_block.json
b7181bcd8182b2f17088e5aa881f374c9c65470c assets/create/blockstates/zinc_ore.json
c7b048548ba737df7efee5731a064c8ee960bdaa assets/create/lang/en_ud.json
0870bf282b75f8126166ed6f9a5ece80dd71b64b assets/create/lang/en_us.json
cc9ca507f0679d21193d3e9ea38ea2da63690538 assets/create/lang/unfinished/de_de.json
ac841d318a6df832c6de0daf4f9309c11aa46a3e assets/create/lang/unfinished/es_cl.json
2874f436add4c9ff52f6cce5180cb8c30c2dd203 assets/create/lang/unfinished/es_es.json
b1a3ae3a464bd5f2321a53666fe124e6cdee7bba assets/create/lang/unfinished/fr_fr.json
adcc4aab4338cc21e89fd92208d0d50cd00be109 assets/create/lang/unfinished/it_it.json
7cab2dd7377cc08087ecefd94f20d169f11ad7ed assets/create/lang/unfinished/ja_jp.json
cc00931dba01292bf0d407ba958bafa0add11128 assets/create/lang/unfinished/ko_kr.json
143a9297fc06a5e5d6ef5b458b8d4d7f888ebf42 assets/create/lang/unfinished/nl_nl.json
46495cff5c50b4f81b8075a90d85da06f55153bb assets/create/lang/unfinished/pl_pl.json
33de68ff95c6c281a530101160086e9367fac086 assets/create/lang/unfinished/pt_br.json
a1b28b1203acca0ea3d4a84c2945e25aed073eba assets/create/lang/unfinished/pt_pt.json
89a8daa6b5665bd1f63855fc07c3dbe238bf2995 assets/create/lang/unfinished/ro_ro.json
6744c0236c63458700c7a70607c00ca57e0a8473 assets/create/lang/unfinished/ru_ru.json
faad944cb89c9dce81cfabaaaa3fb53e354c64e2 assets/create/lang/unfinished/zh_cn.json
6176afefd864926e69f5e6a7935527674f535a77 assets/create/lang/unfinished/zh_tw.json
ecf25701623f13a101e5e9ce673022ba3be59958 assets/create/lang/en_ud.json
96f38bd8b9ee491b39ee060230ba16cbfadafd63 assets/create/lang/en_us.json
2508bb467d14a3eccc2c9bc06e7c6ce9b86ced5e assets/create/lang/unfinished/de_de.json
d9ed3f02a3ecb05c066a8bc6be726e878e5603e7 assets/create/lang/unfinished/es_cl.json
4994369b0f203e9be357d0f09d9c0dd69b25966d assets/create/lang/unfinished/es_es.json
2a45ff494d9b59deff77d80ea4ab88aa7031ea65 assets/create/lang/unfinished/fr_fr.json
7b7d097d466936203775cf1ae598445c99e316e3 assets/create/lang/unfinished/it_it.json
d01d2d62e93ea46d842517f8d23613ef0b83f263 assets/create/lang/unfinished/ja_jp.json
a6553b41cf67ec58ae8fe4ad4fe1d7fae31a8ec4 assets/create/lang/unfinished/ko_kr.json
1d3976dd8af0980104f477b7b3d8903991b37ec3 assets/create/lang/unfinished/nl_nl.json
e4ceb3f1dd76cbfa584f97f4df13eb40278c232b assets/create/lang/unfinished/pl_pl.json
19520e67836fc085224ca44a83fbe69e6621f581 assets/create/lang/unfinished/pt_br.json
a8ddeed7d64567cadf006caef7869fe5456b84ce assets/create/lang/unfinished/pt_pt.json
157fcd051324b3fa59fb6a3dbd5f104f9b38a48a assets/create/lang/unfinished/ro_ro.json
067cdf63461c178e31be57e8b2ce5e1dd9eea467 assets/create/lang/unfinished/ru_ru.json
d7cc4cdb02e41b7e6363ec9600be5f7600366051 assets/create/lang/unfinished/zh_cn.json
5ab965a636cd6ee50c815892fadc418c9c37c3a2 assets/create/lang/unfinished/zh_tw.json
487a511a01b2a4531fb672f917922312db78f958 assets/create/models/block/acacia_window.json
b48060cba1a382f373a05bf0039054053eccf076 assets/create/models/block/acacia_window_pane_noside.json
3066db1bf03cffa1a9c7fbacf47ae586632f4eb3 assets/create/models/block/acacia_window_pane_noside_alt.json
@ -2125,6 +2126,7 @@ bab8f78c319b2a79ed55c5d2a94b521ddaa44996 assets/create/models/item/stressometer.
b1d3d00ff05908feacad06a86800da96cc9bc65d assets/create/models/item/tiled_glass.json
a7d0b746637897209bd86b1a6501ecbfb46d8270 assets/create/models/item/tiled_glass_pane.json
6b5569f25fa2d905729a3f18deb56b6c67c5dfa4 assets/create/models/item/track.json
c7beb7db3e00ff2475e53ef163376b94bb4022be assets/create/models/item/track_observer.json
c317adb86ee47765dd7716539c65f31f329deb85 assets/create/models/item/track_signal.json
447b472ee2e4796dde9e96a2be3c12e015756845 assets/create/models/item/track_station.json
c802b2ba62dca48eaad28dafbe67961f44697696 assets/create/models/item/train_door.json
@ -2480,6 +2482,8 @@ e8bea7022c2d36276922a59eca0e9364efe9ee03 data/create/advancements/recipes/create
f14d533b42261bd4c5366cd6afaf44bf184a9f03 data/create/advancements/recipes/create.base/crafting/kinetics/sticky_mechanical_piston.json
f640ded44cb4cf4c31e49deb0fc14e3495cd2edf data/create/advancements/recipes/create.base/crafting/kinetics/stressometerfrom_conversion.json
f3fc3d4fee0712906f833aa17185f0bacb21922f data/create/advancements/recipes/create.base/crafting/kinetics/super_glue.json
78a36489e5295d5bd53619e7f1e42edb6ba7116a data/create/advancements/recipes/create.base/crafting/kinetics/track_observer.json
e7df922cf9c6b39ee866d224d1812288073c7907 data/create/advancements/recipes/create.base/crafting/kinetics/track_observer_from_other_plates.json
23c1ecff946d41c74d4fb78e2bbc5e348c4487f5 data/create/advancements/recipes/create.base/crafting/kinetics/track_signal.json
da30636ca7e77f2947d0d28542c0b99747c9939e data/create/advancements/recipes/create.base/crafting/kinetics/track_station.json
050b8c527083e624a01f38ea8b34771a19ed2bc5 data/create/advancements/recipes/create.base/crafting/kinetics/train_door.json
@ -3842,6 +3846,7 @@ da3ceb80799d349b91781b0dd43a02e548045c66 data/create/loot_tables/blocks/stressom
811674fd816503cd78fc4df267dc23f760940e8f data/create/loot_tables/blocks/tiled_glass.json
313344ef4ee67ffd0f7fd44adcb3ad08de571c92 data/create/loot_tables/blocks/tiled_glass_pane.json
e2846b8823918bce402eb361f703ecdc14251ccc data/create/loot_tables/blocks/track.json
749a2f82cc5315d10447d644b13c1c1e9a7673a6 data/create/loot_tables/blocks/track_observer.json
f589afc404f98c42d2d9b0b03bcac87f7f6444cc data/create/loot_tables/blocks/track_signal.json
4617a11e220dcd0094c29d204fe90c01495c4e9b data/create/loot_tables/blocks/track_station.json
7f337ebb7f9a6ec83af12f3cf99517762689ac25 data/create/loot_tables/blocks/train_door.json
@ -4126,6 +4131,8 @@ e532a5c405e48b415e3fcd4f7c6183ea335cb915 data/create/recipes/crafting/kinetics/s
3be40664acfd150d0617bc138dc2dd9d54a21b3a data/create/recipes/crafting/kinetics/sticky_mechanical_piston.json
af5854ee2fa3be195ad9abcdeebe6ed7306b651c data/create/recipes/crafting/kinetics/stressometerfrom_conversion.json
21f885a674603367b67e1e993c175638cbda9ea3 data/create/recipes/crafting/kinetics/super_glue.json
ea173b87f9a8c86abcf7f662a7b1d510b8a13f83 data/create/recipes/crafting/kinetics/track_observer.json
a6d074a4a400e82223211badfd923bb28c3c0bd0 data/create/recipes/crafting/kinetics/track_observer_from_other_plates.json
456d59d0fff2b042e1e886ebbe46b84fbd212c40 data/create/recipes/crafting/kinetics/track_signal.json
3c8fd3b5fe4d264cfe405c8d222b451769c816d5 data/create/recipes/crafting/kinetics/track_station.json
c38984c432bd410261aaf6a6f30744c58481b325 data/create/recipes/crafting/kinetics/train_door.json
@ -5397,7 +5404,7 @@ dea0b54b33b1ae3b4fa8091dfcc4ad5687978ab1 data/minecraft/tags/blocks/climbable.js
69f596fcb065e26b02ce246760432b5174191b76 data/minecraft/tags/blocks/impermeable.json
2db7759fe036160c14c6ed19a68604ca16f4de60 data/minecraft/tags/blocks/lush_ground_replaceable.json
1472ec62e43355273f0699743ccdb65324c02475 data/minecraft/tags/blocks/mineable/axe.json
b4942c1fc4d3f55eb5f603ebd5c6f4bad62a3cb4 data/minecraft/tags/blocks/mineable/pickaxe.json
09044f5b96f6f17747f1e3849425006090ed8c09 data/minecraft/tags/blocks/mineable/pickaxe.json
2db7759fe036160c14c6ed19a68604ca16f4de60 data/minecraft/tags/blocks/moss_replaceable.json
e157c1d3af30e409e34bbefbe15a037e6e1c8daa data/minecraft/tags/blocks/needs_iron_tool.json
a08f67865337f62601c5e333b4011382d10020e4 data/minecraft/tags/blocks/needs_stone_tool.json

View file

@ -0,0 +1,10 @@
{
"variants": {
"powered=false": {
"model": "create:block/track_observer/block"
},
"powered=true": {
"model": "create:block/track_observer/block_powered"
}
}
}

View file

@ -494,6 +494,7 @@
"block.create.tiled_glass": "ss\u0250\u05DF\u2141 p\u01DD\u05DF\u0131\u27D8",
"block.create.tiled_glass_pane": "\u01DDu\u0250\u0500 ss\u0250\u05DF\u2141 p\u01DD\u05DF\u0131\u27D8",
"block.create.track": "\u029E\u0254\u0250\u0279\u27D8 u\u0131\u0250\u0279\u27D8",
"block.create.track_observer": "\u0279\u01DD\u028C\u0279\u01DDsqO u\u0131\u0250\u0279\u27D8",
"block.create.track_signal": "\u05DF\u0250ub\u0131S u\u0131\u0250\u0279\u27D8",
"block.create.track_station": "uo\u0131\u0287\u0250\u0287S u\u0131\u0250\u0279\u27D8",
"block.create.train_door": "\u0279oo\u15E1 u\u0131\u0250\u0279\u27D8",

View file

@ -497,6 +497,7 @@
"block.create.tiled_glass": "Tiled Glass",
"block.create.tiled_glass_pane": "Tiled Glass Pane",
"block.create.track": "Train Track",
"block.create.track_observer": "Train Observer",
"block.create.track_signal": "Train Signal",
"block.create.track_station": "Train Station",
"block.create.train_door": "Train Door",
@ -1544,6 +1545,7 @@
"create.display_source.station_summary.now": "now",
"create.display_source.station_summary.minutes": " min",
"create.display_source.station_summary.seconds": "%1$ss",
"create.display_source.observed_train_name": "Detected Train Name",
"create.display_target.line": "Line %1$s",
"create.display_target.page": "Page %1$s",

View file

@ -1,5 +1,5 @@
{
"_": "Missing Localizations: 938",
"_": "Missing Localizations: 940",
"_": "->------------------------] Game Elements [------------------------<-",
@ -498,6 +498,7 @@
"block.create.tiled_glass": "Glasfliesen",
"block.create.tiled_glass_pane": "Glasfliesenscheibe",
"block.create.track": "UNLOCALIZED: Train Track",
"block.create.track_observer": "UNLOCALIZED: Train Observer",
"block.create.track_signal": "UNLOCALIZED: Train Signal",
"block.create.track_station": "UNLOCALIZED: Train Station",
"block.create.train_door": "UNLOCALIZED: Train Door",
@ -1545,6 +1546,7 @@
"create.display_source.station_summary.now": "UNLOCALIZED: now",
"create.display_source.station_summary.minutes": "UNLOCALIZED: min",
"create.display_source.station_summary.seconds": "UNLOCALIZED: %1$ss",
"create.display_source.observed_train_name": "UNLOCALIZED: Detected Train Name",
"create.display_target.line": "UNLOCALIZED: Line %1$s",
"create.display_target.page": "UNLOCALIZED: Page %1$s",

View file

@ -1,5 +1,5 @@
{
"_": "Missing Localizations: 588",
"_": "Missing Localizations: 590",
"_": "->------------------------] Game Elements [------------------------<-",
@ -498,6 +498,7 @@
"block.create.tiled_glass": "Vidrio Baldosa",
"block.create.tiled_glass_pane": "Panel de Vidrio Baldosa",
"block.create.track": "UNLOCALIZED: Train Track",
"block.create.track_observer": "UNLOCALIZED: Train Observer",
"block.create.track_signal": "UNLOCALIZED: Train Signal",
"block.create.track_station": "UNLOCALIZED: Train Station",
"block.create.train_door": "UNLOCALIZED: Train Door",
@ -1545,6 +1546,7 @@
"create.display_source.station_summary.now": "UNLOCALIZED: now",
"create.display_source.station_summary.minutes": "UNLOCALIZED: min",
"create.display_source.station_summary.seconds": "UNLOCALIZED: %1$ss",
"create.display_source.observed_train_name": "UNLOCALIZED: Detected Train Name",
"create.display_target.line": "UNLOCALIZED: Line %1$s",
"create.display_target.page": "UNLOCALIZED: Page %1$s",

View file

@ -1,5 +1,5 @@
{
"_": "Missing Localizations: 252",
"_": "Missing Localizations: 254",
"_": "->------------------------] Game Elements [------------------------<-",
@ -498,6 +498,7 @@
"block.create.tiled_glass": "Vidrio esmaltado",
"block.create.tiled_glass_pane": "Panel de vidrio esmaltado",
"block.create.track": "UNLOCALIZED: Train Track",
"block.create.track_observer": "UNLOCALIZED: Train Observer",
"block.create.track_signal": "UNLOCALIZED: Train Signal",
"block.create.track_station": "UNLOCALIZED: Train Station",
"block.create.train_door": "UNLOCALIZED: Train Door",
@ -1545,6 +1546,7 @@
"create.display_source.station_summary.now": "UNLOCALIZED: now",
"create.display_source.station_summary.minutes": "UNLOCALIZED: min",
"create.display_source.station_summary.seconds": "UNLOCALIZED: %1$ss",
"create.display_source.observed_train_name": "UNLOCALIZED: Detected Train Name",
"create.display_target.line": "UNLOCALIZED: Line %1$s",
"create.display_target.page": "UNLOCALIZED: Page %1$s",

View file

@ -1,5 +1,5 @@
{
"_": "Missing Localizations: 1826",
"_": "Missing Localizations: 1828",
"_": "->------------------------] Game Elements [------------------------<-",
@ -498,6 +498,7 @@
"block.create.tiled_glass": "Verre carrelé",
"block.create.tiled_glass_pane": "Vitre carrelé",
"block.create.track": "UNLOCALIZED: Train Track",
"block.create.track_observer": "UNLOCALIZED: Train Observer",
"block.create.track_signal": "UNLOCALIZED: Train Signal",
"block.create.track_station": "UNLOCALIZED: Train Station",
"block.create.train_door": "UNLOCALIZED: Train Door",
@ -1545,6 +1546,7 @@
"create.display_source.station_summary.now": "UNLOCALIZED: now",
"create.display_source.station_summary.minutes": "UNLOCALIZED: min",
"create.display_source.station_summary.seconds": "UNLOCALIZED: %1$ss",
"create.display_source.observed_train_name": "UNLOCALIZED: Detected Train Name",
"create.display_target.line": "UNLOCALIZED: Line %1$s",
"create.display_target.page": "UNLOCALIZED: Page %1$s",

View file

@ -1,5 +1,5 @@
{
"_": "Missing Localizations: 1515",
"_": "Missing Localizations: 1517",
"_": "->------------------------] Game Elements [------------------------<-",
@ -498,6 +498,7 @@
"block.create.tiled_glass": "Vetro piastrellato",
"block.create.tiled_glass_pane": "Pannello di vetro piastrellato",
"block.create.track": "UNLOCALIZED: Train Track",
"block.create.track_observer": "UNLOCALIZED: Train Observer",
"block.create.track_signal": "UNLOCALIZED: Train Signal",
"block.create.track_station": "UNLOCALIZED: Train Station",
"block.create.train_door": "UNLOCALIZED: Train Door",
@ -1545,6 +1546,7 @@
"create.display_source.station_summary.now": "UNLOCALIZED: now",
"create.display_source.station_summary.minutes": "UNLOCALIZED: min",
"create.display_source.station_summary.seconds": "UNLOCALIZED: %1$ss",
"create.display_source.observed_train_name": "UNLOCALIZED: Detected Train Name",
"create.display_target.line": "UNLOCALIZED: Line %1$s",
"create.display_target.page": "UNLOCALIZED: Page %1$s",

View file

@ -1,5 +1,5 @@
{
"_": "Missing Localizations: 254",
"_": "Missing Localizations: 256",
"_": "->------------------------] Game Elements [------------------------<-",
@ -498,6 +498,7 @@
"block.create.tiled_glass": "タイルガラス",
"block.create.tiled_glass_pane": "タイル板ガラス",
"block.create.track": "UNLOCALIZED: Train Track",
"block.create.track_observer": "UNLOCALIZED: Train Observer",
"block.create.track_signal": "UNLOCALIZED: Train Signal",
"block.create.track_station": "UNLOCALIZED: Train Station",
"block.create.train_door": "UNLOCALIZED: Train Door",
@ -1545,6 +1546,7 @@
"create.display_source.station_summary.now": "UNLOCALIZED: now",
"create.display_source.station_summary.minutes": "UNLOCALIZED: min",
"create.display_source.station_summary.seconds": "UNLOCALIZED: %1$ss",
"create.display_source.observed_train_name": "UNLOCALIZED: Detected Train Name",
"create.display_target.line": "UNLOCALIZED: Line %1$s",
"create.display_target.page": "UNLOCALIZED: Page %1$s",

View file

@ -1,5 +1,5 @@
{
"_": "Missing Localizations: 254",
"_": "Missing Localizations: 256",
"_": "->------------------------] Game Elements [------------------------<-",
@ -498,6 +498,7 @@
"block.create.tiled_glass": "타일 유리",
"block.create.tiled_glass_pane": "타일 유리판",
"block.create.track": "UNLOCALIZED: Train Track",
"block.create.track_observer": "UNLOCALIZED: Train Observer",
"block.create.track_signal": "UNLOCALIZED: Train Signal",
"block.create.track_station": "UNLOCALIZED: Train Station",
"block.create.train_door": "UNLOCALIZED: Train Door",
@ -1545,6 +1546,7 @@
"create.display_source.station_summary.now": "UNLOCALIZED: now",
"create.display_source.station_summary.minutes": "UNLOCALIZED: min",
"create.display_source.station_summary.seconds": "UNLOCALIZED: %1$ss",
"create.display_source.observed_train_name": "UNLOCALIZED: Detected Train Name",
"create.display_target.line": "UNLOCALIZED: Line %1$s",
"create.display_target.page": "UNLOCALIZED: Page %1$s",

View file

@ -1,5 +1,5 @@
{
"_": "Missing Localizations: 2178",
"_": "Missing Localizations: 2180",
"_": "->------------------------] Game Elements [------------------------<-",
@ -498,6 +498,7 @@
"block.create.tiled_glass": "Getegeld Glas",
"block.create.tiled_glass_pane": "Getegeld Glazen Paneel",
"block.create.track": "UNLOCALIZED: Train Track",
"block.create.track_observer": "UNLOCALIZED: Train Observer",
"block.create.track_signal": "UNLOCALIZED: Train Signal",
"block.create.track_station": "UNLOCALIZED: Train Station",
"block.create.train_door": "UNLOCALIZED: Train Door",
@ -1545,6 +1546,7 @@
"create.display_source.station_summary.now": "UNLOCALIZED: now",
"create.display_source.station_summary.minutes": "UNLOCALIZED: min",
"create.display_source.station_summary.seconds": "UNLOCALIZED: %1$ss",
"create.display_source.observed_train_name": "UNLOCALIZED: Detected Train Name",
"create.display_target.line": "UNLOCALIZED: Line %1$s",
"create.display_target.page": "UNLOCALIZED: Page %1$s",

View file

@ -1,5 +1,5 @@
{
"_": "Missing Localizations: 627",
"_": "Missing Localizations: 629",
"_": "->------------------------] Game Elements [------------------------<-",
@ -498,6 +498,7 @@
"block.create.tiled_glass": "Kafelkowane szkło",
"block.create.tiled_glass_pane": "Kafelkowana szyba",
"block.create.track": "UNLOCALIZED: Train Track",
"block.create.track_observer": "UNLOCALIZED: Train Observer",
"block.create.track_signal": "UNLOCALIZED: Train Signal",
"block.create.track_station": "UNLOCALIZED: Train Station",
"block.create.train_door": "UNLOCALIZED: Train Door",
@ -1545,6 +1546,7 @@
"create.display_source.station_summary.now": "UNLOCALIZED: now",
"create.display_source.station_summary.minutes": "UNLOCALIZED: min",
"create.display_source.station_summary.seconds": "UNLOCALIZED: %1$ss",
"create.display_source.observed_train_name": "UNLOCALIZED: Detected Train Name",
"create.display_target.line": "UNLOCALIZED: Line %1$s",
"create.display_target.page": "UNLOCALIZED: Page %1$s",

View file

@ -1,5 +1,5 @@
{
"_": "Missing Localizations: 1122",
"_": "Missing Localizations: 1124",
"_": "->------------------------] Game Elements [------------------------<-",
@ -498,6 +498,7 @@
"block.create.tiled_glass": "Vidro Entalhado",
"block.create.tiled_glass_pane": "Vidraça Entalhada",
"block.create.track": "UNLOCALIZED: Train Track",
"block.create.track_observer": "UNLOCALIZED: Train Observer",
"block.create.track_signal": "UNLOCALIZED: Train Signal",
"block.create.track_station": "UNLOCALIZED: Train Station",
"block.create.train_door": "UNLOCALIZED: Train Door",
@ -1545,6 +1546,7 @@
"create.display_source.station_summary.now": "UNLOCALIZED: now",
"create.display_source.station_summary.minutes": "UNLOCALIZED: min",
"create.display_source.station_summary.seconds": "UNLOCALIZED: %1$ss",
"create.display_source.observed_train_name": "UNLOCALIZED: Detected Train Name",
"create.display_target.line": "UNLOCALIZED: Line %1$s",
"create.display_target.page": "UNLOCALIZED: Page %1$s",

View file

@ -1,5 +1,5 @@
{
"_": "Missing Localizations: 1800",
"_": "Missing Localizations: 1802",
"_": "->------------------------] Game Elements [------------------------<-",
@ -498,6 +498,7 @@
"block.create.tiled_glass": "Vidro Entalhado",
"block.create.tiled_glass_pane": "Vidraça Entalhada",
"block.create.track": "UNLOCALIZED: Train Track",
"block.create.track_observer": "UNLOCALIZED: Train Observer",
"block.create.track_signal": "UNLOCALIZED: Train Signal",
"block.create.track_station": "UNLOCALIZED: Train Station",
"block.create.train_door": "UNLOCALIZED: Train Door",
@ -1545,6 +1546,7 @@
"create.display_source.station_summary.now": "UNLOCALIZED: now",
"create.display_source.station_summary.minutes": "UNLOCALIZED: min",
"create.display_source.station_summary.seconds": "UNLOCALIZED: %1$ss",
"create.display_source.observed_train_name": "UNLOCALIZED: Detected Train Name",
"create.display_target.line": "UNLOCALIZED: Line %1$s",
"create.display_target.page": "UNLOCALIZED: Page %1$s",

View file

@ -1,5 +1,5 @@
{
"_": "Missing Localizations: 255",
"_": "Missing Localizations: 257",
"_": "->------------------------] Game Elements [------------------------<-",
@ -498,6 +498,7 @@
"block.create.tiled_glass": "Sticlă De Țiglă",
"block.create.tiled_glass_pane": "Fereastră De Țiglă",
"block.create.track": "UNLOCALIZED: Train Track",
"block.create.track_observer": "UNLOCALIZED: Train Observer",
"block.create.track_signal": "UNLOCALIZED: Train Signal",
"block.create.track_station": "UNLOCALIZED: Train Station",
"block.create.train_door": "UNLOCALIZED: Train Door",
@ -1545,6 +1546,7 @@
"create.display_source.station_summary.now": "UNLOCALIZED: now",
"create.display_source.station_summary.minutes": "UNLOCALIZED: min",
"create.display_source.station_summary.seconds": "UNLOCALIZED: %1$ss",
"create.display_source.observed_train_name": "UNLOCALIZED: Detected Train Name",
"create.display_target.line": "UNLOCALIZED: Line %1$s",
"create.display_target.page": "UNLOCALIZED: Page %1$s",

View file

@ -1,5 +1,5 @@
{
"_": "Missing Localizations: 632",
"_": "Missing Localizations: 634",
"_": "->------------------------] Game Elements [------------------------<-",
@ -498,6 +498,7 @@
"block.create.tiled_glass": "Плиточное стекло",
"block.create.tiled_glass_pane": "Плиточная стеклянная панель",
"block.create.track": "UNLOCALIZED: Train Track",
"block.create.track_observer": "UNLOCALIZED: Train Observer",
"block.create.track_signal": "UNLOCALIZED: Train Signal",
"block.create.track_station": "UNLOCALIZED: Train Station",
"block.create.train_door": "UNLOCALIZED: Train Door",
@ -1545,6 +1546,7 @@
"create.display_source.station_summary.now": "UNLOCALIZED: now",
"create.display_source.station_summary.minutes": "UNLOCALIZED: min",
"create.display_source.station_summary.seconds": "UNLOCALIZED: %1$ss",
"create.display_source.observed_train_name": "UNLOCALIZED: Detected Train Name",
"create.display_target.line": "UNLOCALIZED: Line %1$s",
"create.display_target.page": "UNLOCALIZED: Page %1$s",

View file

@ -1,5 +1,5 @@
{
"_": "Missing Localizations: 252",
"_": "Missing Localizations: 254",
"_": "->------------------------] Game Elements [------------------------<-",
@ -498,6 +498,7 @@
"block.create.tiled_glass": "十字玻璃窗",
"block.create.tiled_glass_pane": "十字玻璃窗户板",
"block.create.track": "UNLOCALIZED: Train Track",
"block.create.track_observer": "UNLOCALIZED: Train Observer",
"block.create.track_signal": "UNLOCALIZED: Train Signal",
"block.create.track_station": "UNLOCALIZED: Train Station",
"block.create.train_door": "UNLOCALIZED: Train Door",
@ -1545,6 +1546,7 @@
"create.display_source.station_summary.now": "UNLOCALIZED: now",
"create.display_source.station_summary.minutes": "UNLOCALIZED: min",
"create.display_source.station_summary.seconds": "UNLOCALIZED: %1$ss",
"create.display_source.observed_train_name": "UNLOCALIZED: Detected Train Name",
"create.display_target.line": "UNLOCALIZED: Line %1$s",
"create.display_target.page": "UNLOCALIZED: Page %1$s",

View file

@ -1,5 +1,5 @@
{
"_": "Missing Localizations: 646",
"_": "Missing Localizations: 648",
"_": "->------------------------] Game Elements [------------------------<-",
@ -498,6 +498,7 @@
"block.create.tiled_glass": "十字玻璃窗",
"block.create.tiled_glass_pane": "十字玻璃窗戶片",
"block.create.track": "UNLOCALIZED: Train Track",
"block.create.track_observer": "UNLOCALIZED: Train Observer",
"block.create.track_signal": "UNLOCALIZED: Train Signal",
"block.create.track_station": "UNLOCALIZED: Train Station",
"block.create.train_door": "UNLOCALIZED: Train Door",
@ -1545,6 +1546,7 @@
"create.display_source.station_summary.now": "UNLOCALIZED: now",
"create.display_source.station_summary.minutes": "UNLOCALIZED: min",
"create.display_source.station_summary.seconds": "UNLOCALIZED: %1$ss",
"create.display_source.observed_train_name": "UNLOCALIZED: Detected Train Name",
"create.display_target.line": "UNLOCALIZED: Line %1$s",
"create.display_target.page": "UNLOCALIZED: Page %1$s",

View file

@ -0,0 +1,3 @@
{
"parent": "create:block/track_observer/block"
}

View file

@ -0,0 +1,34 @@
{
"parent": "minecraft:recipes/root",
"rewards": {
"recipes": [
"create:crafting/kinetics/track_observer"
]
},
"criteria": {
"has_item": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"items": [
{
"items": [
"create:railway_casing"
]
}
]
}
},
"has_the_recipe": {
"trigger": "minecraft:recipe_unlocked",
"conditions": {
"recipe": "create:crafting/kinetics/track_observer"
}
}
},
"requirements": [
[
"has_item",
"has_the_recipe"
]
]
}

View file

@ -0,0 +1,34 @@
{
"parent": "minecraft:recipes/root",
"rewards": {
"recipes": [
"create:crafting/kinetics/track_observer_from_other_plates"
]
},
"criteria": {
"has_item": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"items": [
{
"items": [
"create:railway_casing"
]
}
]
}
},
"has_the_recipe": {
"trigger": "minecraft:recipe_unlocked",
"conditions": {
"recipe": "create:crafting/kinetics/track_observer_from_other_plates"
}
}
},
"requirements": [
[
"has_item",
"has_the_recipe"
]
]
}

View file

@ -0,0 +1,20 @@
{
"type": "minecraft:block",
"pools": [
{
"rolls": 1.0,
"bonus_rolls": 0.0,
"entries": [
{
"type": "minecraft:item",
"name": "create:track_observer"
}
],
"conditions": [
{
"condition": "minecraft:survives_explosion"
}
]
}
]
}

View file

@ -0,0 +1,15 @@
{
"type": "minecraft:crafting_shapeless",
"ingredients": [
{
"item": "create:railway_casing"
},
{
"tag": "minecraft:wooden_pressure_plates"
}
],
"result": {
"item": "create:track_observer",
"count": 2
}
}

View file

@ -0,0 +1,26 @@
{
"type": "minecraft:crafting_shapeless",
"ingredients": [
{
"item": "create:railway_casing"
},
[
{
"item": "minecraft:stone_pressure_plate"
},
{
"item": "minecraft:polished_blackstone_pressure_plate"
},
{
"item": "minecraft:heavy_weighted_pressure_plate"
},
{
"item": "minecraft:light_weighted_pressure_plate"
}
]
],
"result": {
"item": "create:track_observer",
"count": 2
}
}

View file

@ -116,6 +116,7 @@
"create:railway_casing",
"create:track_station",
"create:track_signal",
"create:track_observer",
"create:small_bogey",
"create:large_bogey",
"create:controls",

View file

@ -110,6 +110,7 @@ public class AllBlockPartials {
TRACK_STATION_OVERLAY = block("track_overlay/station"), TRACK_SIGNAL_OVERLAY = block("track_overlay/signal"),
TRACK_ASSEMBLING_OVERLAY = block("track_overlay/assembling"),
TRACK_SIGNAL_DUAL_OVERLAY = block("track_overlay/signal_dual"),
TRACK_OBSERVER_OVERLAY = block("track_overlay/observer"),
BOGEY_FRAME = block("track/bogey/bogey_frame"), SMALL_BOGEY_WHEELS = block("track/bogey/bogey_wheel"),
BOGEY_PIN = block("track/bogey/bogey_drive_wheel_pin"), BOGEY_PISTON = block("track/bogey/bogey_drive_piston"),
@ -136,10 +137,10 @@ public class AllBlockPartials {
SIGNAL_RED = block("track_signal/red_tube"), SIGNAL_YELLOW_CUBE = block("track_signal/yellow_cube"),
SIGNAL_YELLOW_GLOW = block("track_signal/yellow_glow"), SIGNAL_YELLOW = block("track_signal/yellow_tube"),
BLAZE_GOGGLES = block("blaze_burner/goggles"),
BLAZE_IDLE = block("blaze_burner/blaze/idle"), BLAZE_ACTIVE = block("blaze_burner/blaze/active"),
BLAZE_SUPER = block("blaze_burner/blaze/super"), BLAZE_BURNER_FLAME = block("blaze_burner/flame"),
BLAZE_BURNER_RODS = block("blaze_burner/rods_small"), BLAZE_BURNER_RODS_2 = block("blaze_burner/rods_large"),
BLAZE_GOGGLES = block("blaze_burner/goggles"), BLAZE_IDLE = block("blaze_burner/blaze/idle"),
BLAZE_ACTIVE = block("blaze_burner/blaze/active"), BLAZE_SUPER = block("blaze_burner/blaze/super"),
BLAZE_BURNER_FLAME = block("blaze_burner/flame"), BLAZE_BURNER_RODS = block("blaze_burner/rods_small"),
BLAZE_BURNER_RODS_2 = block("blaze_burner/rods_large"),
BLAZE_BURNER_SUPER_RODS = block("blaze_burner/superheated_rods_small"),
BLAZE_BURNER_SUPER_RODS_2 = block("blaze_burner/superheated_rods_large"),

View file

@ -170,6 +170,7 @@ import com.simibubi.create.content.logistics.block.display.source.ItemCountDispl
import com.simibubi.create.content.logistics.block.display.source.ItemListDisplaySource;
import com.simibubi.create.content.logistics.block.display.source.ItemNameDisplaySource;
import com.simibubi.create.content.logistics.block.display.source.ItemThoughputDisplaySource;
import com.simibubi.create.content.logistics.block.display.source.ObservedTrainNameSource;
import com.simibubi.create.content.logistics.block.display.source.StationSummaryDisplaySource;
import com.simibubi.create.content.logistics.block.display.source.StopWatchDisplaySource;
import com.simibubi.create.content.logistics.block.display.source.TimeOfDayDisplaySource;
@ -198,7 +199,9 @@ import com.simibubi.create.content.logistics.block.vault.ItemVaultCTBehaviour;
import com.simibubi.create.content.logistics.block.vault.ItemVaultItem;
import com.simibubi.create.content.logistics.item.LecternControllerBlock;
import com.simibubi.create.content.logistics.trains.management.display.FlapDisplayBlock;
import com.simibubi.create.content.logistics.trains.management.edgePoint.EdgePointType;
import com.simibubi.create.content.logistics.trains.management.edgePoint.TrackTargetingBlockItem;
import com.simibubi.create.content.logistics.trains.management.edgePoint.observer.TrackObserverBlock;
import com.simibubi.create.content.logistics.trains.management.edgePoint.signal.SignalBlock;
import com.simibubi.create.content.logistics.trains.management.edgePoint.station.StationBlock;
import com.simibubi.create.content.logistics.trains.track.FakeTrackBlock;
@ -1510,7 +1513,7 @@ public class AllBlocks {
.blockstate((c, p) -> p.simpleBlock(c.get(), AssetLookup.partialBaseModel(c, p)))
.onRegister(assignDataBehaviour(new StationSummaryDisplaySource(), "station_summary"))
.lang("Train Station")
.item(TrackTargetingBlockItem::new)
.item(TrackTargetingBlockItem.ofType(EdgePointType.STATION))
.transform(customItemModel())
.register();
@ -1526,10 +1529,24 @@ public class AllBlocks {
.getSerializedName()))
.build()))
.lang("Train Signal")
.item(TrackTargetingBlockItem::new)
.item(TrackTargetingBlockItem.ofType(EdgePointType.SIGNAL))
.transform(customItemModel())
.register();
public static final BlockEntry<TrackObserverBlock> TRACK_OBSERVER =
REGISTRATE.block("track_observer", TrackObserverBlock::new)
.initialProperties(SharedProperties::softMetal)
.properties(p -> p.color(MaterialColor.PODZOL))
.properties(p -> p.noOcclusion())
.properties(p -> p.sound(SoundType.NETHERITE_BLOCK))
.blockstate((c, p) -> BlockStateGen.simpleBlock(c, p, AssetLookup.forPowered(c, p)))
.transform(pickaxeOnly())
.onRegister(assignDataBehaviour(new ObservedTrainNameSource(), "observed_train_name"))
.lang("Train Observer")
.item(TrackTargetingBlockItem.ofType(EdgePointType.OBSERVER))
.transform(customItemModel("_", "block"))
.register();
public static final BlockEntry<StandardBogeyBlock> SMALL_BOGEY =
REGISTRATE.block("small_bogey", p -> new StandardBogeyBlock(p, false))
.properties(p -> p.color(MaterialColor.PODZOL))

View file

@ -182,6 +182,8 @@ import com.simibubi.create.content.logistics.item.LecternControllerTileEntity;
import com.simibubi.create.content.logistics.trains.IBogeyTileEntityRenderer;
import com.simibubi.create.content.logistics.trains.management.display.FlapDisplayRenderer;
import com.simibubi.create.content.logistics.trains.management.display.FlapDisplayTileEntity;
import com.simibubi.create.content.logistics.trains.management.edgePoint.observer.TrackObserverRenderer;
import com.simibubi.create.content.logistics.trains.management.edgePoint.observer.TrackObserverTileEntity;
import com.simibubi.create.content.logistics.trains.management.edgePoint.signal.SignalRenderer;
import com.simibubi.create.content.logistics.trains.management.edgePoint.signal.SignalTileEntity;
import com.simibubi.create.content.logistics.trains.management.edgePoint.station.StationRenderer;
@ -814,6 +816,12 @@ public class AllTileEntities {
.renderer(() -> SignalRenderer::new)
.validBlocks(AllBlocks.TRACK_SIGNAL)
.register();
public static final BlockEntityEntry<TrackObserverTileEntity> TRACK_OBSERVER = Create.registrate()
.tileEntity("track_observer", TrackObserverTileEntity::new)
.renderer(() -> TrackObserverRenderer::new)
.validBlocks(AllBlocks.TRACK_OBSERVER)
.register();
public static void register() {}
}

View file

@ -0,0 +1,47 @@
package com.simibubi.create.content.logistics.block.display.source;
import java.util.UUID;
import com.simibubi.create.Create;
import com.simibubi.create.content.logistics.block.display.DisplayLinkContext;
import com.simibubi.create.content.logistics.block.display.target.DisplayTargetStats;
import com.simibubi.create.content.logistics.trains.entity.Train;
import com.simibubi.create.content.logistics.trains.management.edgePoint.observer.TrackObserver;
import com.simibubi.create.content.logistics.trains.management.edgePoint.observer.TrackObserverTileEntity;
import net.minecraft.network.chat.MutableComponent;
public class ObservedTrainNameSource extends SingleLineDisplaySource {
@Override
protected MutableComponent provideLine(DisplayLinkContext context, DisplayTargetStats stats) {
if (!(context.getSourceTE() instanceof TrackObserverTileEntity observerTE))
return EMPTY_LINE;
TrackObserver observer = observerTE.getObserver();
if (observer == null)
return EMPTY_LINE;
UUID currentTrain = observer.getCurrentTrain();
if (currentTrain == null)
return EMPTY_LINE;
Train train = Create.RAILWAYS.trains.get(currentTrain);
if (train == null)
return EMPTY_LINE;
return train.name.copy();
}
@Override
public int getPassiveRefreshTicks() {
return 400;
}
@Override
protected String getTranslationKey() {
return "observed_train_name";
}
@Override
protected boolean allowsLabeling(DisplayLinkContext context) {
return true;
}
}

View file

@ -355,11 +355,16 @@ public class TrackGraph {
}
public Map<TrackNode, TrackEdge> getConnectionsFrom(TrackNode node) {
if (node == null)
return null;
return connectionsByNode.getOrDefault(node, new HashMap<>());
}
public TrackEdge getConnection(Couple<TrackNode> nodes) {
return getConnectionsFrom(nodes.getFirst()).get(nodes.getSecond());
Map<TrackNode, TrackEdge> connectionsFrom = getConnectionsFrom(nodes.getFirst());
if (connectionsFrom == null)
return null;
return connectionsFrom.get(nodes.getSecond());
}
public void connectNodes(LevelAccessor reader, TrackNodeLocation location, TrackNodeLocation location2,

View file

@ -22,6 +22,7 @@ import org.apache.commons.lang3.mutable.MutableObject;
import com.simibubi.create.AllMovementBehaviours;
import com.simibubi.create.Create;
import com.simibubi.create.content.contraptions.components.structureMovement.MovementBehaviour;
import com.simibubi.create.content.logistics.item.filter.FilterItem;
import com.simibubi.create.content.logistics.trains.DimensionPalette;
import com.simibubi.create.content.logistics.trains.GraphLocation;
import com.simibubi.create.content.logistics.trains.TrackEdge;
@ -33,6 +34,7 @@ import com.simibubi.create.content.logistics.trains.entity.TravellingPoint.ITrac
import com.simibubi.create.content.logistics.trains.entity.TravellingPoint.SteerDirection;
import com.simibubi.create.content.logistics.trains.management.edgePoint.EdgeData;
import com.simibubi.create.content.logistics.trains.management.edgePoint.EdgePointType;
import com.simibubi.create.content.logistics.trains.management.edgePoint.observer.TrackObserver;
import com.simibubi.create.content.logistics.trains.management.edgePoint.signal.SignalBlock.SignalType;
import com.simibubi.create.content.logistics.trains.management.edgePoint.signal.SignalBoundary;
import com.simibubi.create.content.logistics.trains.management.edgePoint.signal.SignalEdgeGroup;
@ -63,6 +65,9 @@ import net.minecraft.world.level.Explosion.BlockInteraction;
import net.minecraft.world.level.Level;
import net.minecraft.world.phys.Vec3;
import net.minecraftforge.common.ForgeHooks;
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fluids.capability.IFluidHandler;
import net.minecraftforge.fluids.capability.IFluidHandler.FluidAction;
import net.minecraftforge.items.IItemHandlerModifiable;
import net.minecraftforge.items.ItemHandlerHelper;
import net.minecraftforge.network.PacketDistributor;
@ -102,6 +107,9 @@ public class Train {
public Map<UUID, UUID> occupiedSignalBlocks;
public Set<UUID> reservedSignalBlocks;
public Set<UUID> occupiedObservers;
public Map<UUID, Pair<Integer, Boolean>> cachedObserverFiltering;
List<TrainMigration> migratingPoints;
public int migrationCooldown;
public boolean derailed;
@ -135,6 +143,8 @@ public class Train {
manualSteer = SteerDirection.NONE;
occupiedSignalBlocks = new HashMap<>();
reservedSignalBlocks = new HashSet<>();
occupiedObservers = new HashSet<>();
cachedObserverFiltering = new HashMap<>();
tickOffset = Create.RANDOM.nextInt(100);
}
@ -154,6 +164,73 @@ public class Train {
addToSignalGroups(occupiedSignalBlocks.keySet());
addToSignalGroups(reservedSignalBlocks);
if (occupiedObservers.isEmpty())
return;
tickOccupiedObservers(level);
}
private void tickOccupiedObservers(Level level) {
int storageVersion = 0;
for (Carriage carriage : carriages)
storageVersion += carriage.storage.getVersion();
for (UUID uuid : occupiedObservers) {
TrackObserver observer = graph.getPoint(EdgePointType.OBSERVER, uuid);
if (observer == null)
continue;
ItemStack filter = observer.getFilter();
if (filter.isEmpty()) {
observer.keepAlive(this);
continue;
}
Pair<Integer, Boolean> cachedMatch = cachedObserverFiltering.computeIfAbsent(uuid, $ -> Pair.of(-1, false));
boolean shouldActivate = cachedMatch.getSecond();
if (cachedMatch.getFirst() == storageVersion) {
if (shouldActivate)
observer.keepAlive(this);
continue;
}
shouldActivate = false;
for (Carriage carriage : carriages) {
if (shouldActivate)
break;
IItemHandlerModifiable inv = carriage.storage.getItems();
if (inv != null) {
for (int slot = 0; slot < inv.getSlots(); slot++) {
if (shouldActivate)
break;
ItemStack extractItem = inv.extractItem(slot, 1, true);
if (extractItem.isEmpty())
continue;
shouldActivate |= FilterItem.test(level, extractItem, filter);
}
}
IFluidHandler tank = carriage.storage.getFluids();
if (tank != null) {
for (int slot = 0; slot < tank.getTanks(); slot++) {
if (shouldActivate)
break;
FluidStack drain = tank.drain(1, FluidAction.SIMULATE);
if (drain.isEmpty())
continue;
shouldActivate |= FilterItem.test(level, drain, filter);
}
}
}
cachedObserverFiltering.put(uuid, Pair.of(storageVersion, shouldActivate));
if (shouldActivate)
observer.keepAlive(this);
}
}
private void addToSignalGroups(Collection<UUID> groups) {
@ -338,10 +415,15 @@ public class Train {
return true;
}
if (couple.getFirst() instanceof TrackObserver observer) {
occupiedObservers.add(observer.getId());
return false;
}
if (!(couple.getFirst() instanceof SignalBoundary signal))
return false;
if (navigation.waitingForSignal != null && navigation.waitingForSignal.getFirst()
.equals(signal.id)) {
.equals(signal.getId())) {
speed = 0;
navigation.distanceToSignal = 0;
return true;
@ -383,6 +465,11 @@ public class Train {
public IEdgePointListener backSignalListener() {
return (distance, couple) -> {
if (couple.getFirst() instanceof TrackObserver observer) {
occupiedObservers.remove(observer.getId());
cachedObserverFiltering.remove(observer.getId());
return false;
}
if (!(couple.getFirst() instanceof SignalBoundary signal))
return false;
UUID groupId = signal.getGroup(couple.getSecond()
@ -821,6 +908,8 @@ public class Train {
occupiedSignalBlocks.clear();
reservedSignalBlocks.clear();
occupiedObservers.clear();
cachedObserverFiltering.clear();
TravellingPoint signalScout = new TravellingPoint(node1, node2, edge, position);
Map<UUID, SignalEdgeGroup> allGroups = Create.RAILWAYS.signalEdgeGroups;
@ -863,6 +952,10 @@ public class Train {
forEachTravellingPointBackwards((tp, d) -> {
signalScout.travel(graph, d, signalScout.follow(tp), (distance, couple) -> {
if (couple.getFirst() instanceof TrackObserver observer) {
occupiedObservers.add(observer.getId());
return false;
}
if (!(couple.getFirst() instanceof SignalBoundary signal))
return false;
couple.getSecond()
@ -991,6 +1084,11 @@ public class Train {
compoundTag.putUUID("Id", uid);
return compoundTag;
}));
tag.put("OccupiedObservers", NBTHelper.writeCompoundList(occupiedObservers, uid -> {
CompoundTag compoundTag = new CompoundTag();
compoundTag.putUUID("Id", uid);
return compoundTag;
}));
tag.put("MigratingPoints", NBTHelper.writeCompoundList(migratingPoints, tm -> tm.write(dimensions)));
tag.put("Runtime", runtime.write());
@ -1031,6 +1129,8 @@ public class Train {
.put(c.getUUID("Id"), c.contains("Boundary") ? c.getUUID("Boundary") : null));
NBTHelper.iterateCompoundList(tag.getList("ReservedSignalBlocks", Tag.TAG_COMPOUND),
c -> train.reservedSignalBlocks.add(c.getUUID("Id")));
NBTHelper.iterateCompoundList(tag.getList("OccupiedObservers", Tag.TAG_COMPOUND),
c -> train.occupiedObservers.add(c.getUUID("Id")));
NBTHelper.iterateCompoundList(tag.getList("MigratingPoints", Tag.TAG_COMPOUND),
c -> train.migratingPoints.add(TrainMigration.read(c, dimensions)));

View file

@ -6,6 +6,7 @@ import java.util.function.Supplier;
import com.simibubi.create.Create;
import com.simibubi.create.content.logistics.trains.DimensionPalette;
import com.simibubi.create.content.logistics.trains.management.edgePoint.observer.TrackObserver;
import com.simibubi.create.content.logistics.trains.management.edgePoint.signal.SignalBoundary;
import com.simibubi.create.content.logistics.trains.management.edgePoint.signal.TrackEdgePoint;
import com.simibubi.create.content.logistics.trains.management.edgePoint.station.GlobalStation;
@ -23,6 +24,8 @@ public class EdgePointType<T extends TrackEdgePoint> {
register(Create.asResource("signal"), SignalBoundary::new);
public static final EdgePointType<GlobalStation> STATION =
register(Create.asResource("station"), GlobalStation::new);
public static final EdgePointType<TrackObserver> OBSERVER =
register(Create.asResource("observer"), TrackObserver::new);
public static <T extends TrackEdgePoint> EdgePointType<T> register(ResourceLocation id, Supplier<T> factory) {
EdgePointType<T> type = new EdgePointType<>(id, factory);

View file

@ -305,7 +305,7 @@ public class TrackTargetingBehaviour<T extends TrackEdgePoint> extends TileEntit
}
public static enum RenderedTrackOverlayType {
STATION, SIGNAL, DUAL_SIGNAL;
STATION, SIGNAL, DUAL_SIGNAL, OBSERVER;
}
@OnlyIn(Dist.CLIENT)

View file

@ -5,7 +5,6 @@ import java.util.function.BiConsumer;
import org.apache.commons.lang3.mutable.MutableObject;
import com.simibubi.create.AllBlocks;
import com.simibubi.create.AllSoundEvents;
import com.simibubi.create.content.logistics.trains.GraphLocation;
import com.simibubi.create.content.logistics.trains.ITrackBlock;
@ -19,6 +18,7 @@ import com.simibubi.create.content.logistics.trains.track.TrackTileEntity;
import com.simibubi.create.foundation.networking.AllPackets;
import com.simibubi.create.foundation.utility.Couple;
import com.simibubi.create.foundation.utility.Lang;
import com.tterrag.registrate.util.nullness.NonNullBiFunction;
import net.minecraft.ChatFormatting;
import net.minecraft.client.Minecraft;
@ -30,6 +30,7 @@ import net.minecraft.nbt.NbtUtils;
import net.minecraft.world.InteractionResult;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.BlockItem;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.context.UseOnContext;
import net.minecraft.world.level.Level;
@ -41,8 +42,16 @@ import net.minecraftforge.api.distmarker.OnlyIn;
public class TrackTargetingBlockItem extends BlockItem {
public TrackTargetingBlockItem(Block pBlock, Properties pProperties) {
private EdgePointType<?> type;
public static <T extends Block> NonNullBiFunction<? super T, Item.Properties, TrackTargetingBlockItem> ofType(
EdgePointType<?> type) {
return (b, p) -> new TrackTargetingBlockItem(b, p, type);
}
public TrackTargetingBlockItem(Block pBlock, Properties pProperties, EdgePointType<?> type) {
super(pBlock, pProperties);
this.type = type;
}
@Override
@ -134,8 +143,8 @@ public class TrackTargetingBlockItem extends BlockItem {
return useOn;
}
protected EdgePointType<?> getType(ItemStack stack) {
return AllBlocks.TRACK_SIGNAL.isIn(stack) ? EdgePointType.SIGNAL : EdgePointType.STATION;
public EdgePointType<?> getType(ItemStack stack) {
return type;
}
@OnlyIn(Dist.CLIENT)
@ -200,7 +209,7 @@ public class TrackTargetingBlockItem extends BlockItem {
TrackEdge edge = location.graph.getConnection(nodes);
if (edge == null)
return;
EdgeData edgeData = edge.getEdgeData();
double edgePosition = location.position;

View file

@ -48,7 +48,7 @@ public class TrackTargetingClient {
BezierTrackPointLocation hoveredBezier = null;
ItemStack stack = player.getMainHandItem();
if (stack.getItem()instanceof TrackTargetingBlockItem ttbi)
if (stack.getItem() instanceof TrackTargetingBlockItem ttbi)
type = ttbi.getType(stack);
if (type == EdgePointType.SIGNAL)
@ -83,7 +83,7 @@ public class TrackTargetingClient {
BlockHitResult blockHitResult = (BlockHitResult) hitResult;
BlockPos pos = blockHitResult.getBlockPos();
BlockState blockState = mc.level.getBlockState(pos);
if (blockState.getBlock()instanceof ITrackBlock track) {
if (blockState.getBlock() instanceof ITrackBlock track) {
direction = track.getNearestTrackAxis(mc.level, pos, blockState, lookAngle)
.getSecond() == AxisDirection.POSITIVE;
hovered = pos;
@ -124,8 +124,9 @@ public class TrackTargetingClient {
BlockPos pos = lastHovered;
int light = LevelRenderer.getLightColor(mc.level, pos);
AxisDirection direction = lastDirection ? AxisDirection.POSITIVE : AxisDirection.NEGATIVE;
RenderedTrackOverlayType type =
lastType == EdgePointType.SIGNAL ? RenderedTrackOverlayType.SIGNAL : RenderedTrackOverlayType.STATION;
RenderedTrackOverlayType type = lastType == EdgePointType.SIGNAL ? RenderedTrackOverlayType.SIGNAL
: lastType == EdgePointType.OBSERVER ? RenderedTrackOverlayType.OBSERVER : RenderedTrackOverlayType.STATION;
TrackTargetingBehaviour.render(mc.level, pos, direction, lastHoveredBezierSegment, ms, buffer, light,
OverlayTexture.NO_OVERLAY, type, 1 + 1 / 16f);

View file

@ -0,0 +1,111 @@
package com.simibubi.create.content.logistics.trains.management.edgePoint.observer;
import java.util.UUID;
import com.simibubi.create.Create;
import com.simibubi.create.content.logistics.trains.DimensionPalette;
import com.simibubi.create.content.logistics.trains.TrackEdge;
import com.simibubi.create.content.logistics.trains.TrackGraph;
import com.simibubi.create.content.logistics.trains.entity.Train;
import com.simibubi.create.content.logistics.trains.management.edgePoint.signal.SignalPropagator;
import com.simibubi.create.content.logistics.trains.management.edgePoint.signal.SingleTileEdgePoint;
import com.simibubi.create.foundation.tileEntity.TileEntityBehaviour;
import com.simibubi.create.foundation.tileEntity.behaviour.filtering.FilteringBehaviour;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.network.FriendlyByteBuf;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.entity.BlockEntity;
public class TrackObserver extends SingleTileEdgePoint {
private int activated;
private ItemStack filter;
private UUID currentTrain;
public TrackObserver() {
activated = 0;
filter = ItemStack.EMPTY;
currentTrain = null;
}
@Override
public void tileAdded(BlockEntity tile, boolean front) {
super.tileAdded(tile, front);
FilteringBehaviour filteringBehaviour = TileEntityBehaviour.get(tile, FilteringBehaviour.TYPE);
if (filteringBehaviour != null)
setFilterAndNotify(tile.getLevel(), filteringBehaviour.getFilter());
}
@Override
public void tick(TrackGraph graph, boolean preTrains) {
super.tick(graph, preTrains);
if (isActivated())
activated--;
if (!isActivated())
currentTrain = null;
}
public void setFilterAndNotify(Level level, ItemStack filter) {
this.filter = filter;
notifyTrains(level);
}
private void notifyTrains(Level level) {
TrackGraph graph = Create.RAILWAYS.sided(level)
.getGraph(level, edgeLocation.getFirst());
if (graph == null)
return;
TrackEdge edge = graph.getConnection(edgeLocation.map(graph::locateNode));
if (edge == null)
return;
SignalPropagator.notifyTrains(graph, edge);
}
public ItemStack getFilter() {
return filter;
}
public UUID getCurrentTrain() {
return currentTrain;
}
public boolean isActivated() {
return activated > 0;
}
public void keepAlive(Train train) {
activated = 8;
currentTrain = train.id;
}
@Override
public void read(CompoundTag nbt, boolean migration, DimensionPalette dimensions) {
super.read(nbt, migration, dimensions);
activated = nbt.getInt("Activated");
filter = ItemStack.of(nbt.getCompound("Filter"));
if (nbt.contains("TrainId"))
currentTrain = nbt.getUUID("TrainId");
}
@Override
public void read(FriendlyByteBuf buffer, DimensionPalette dimensions) {
super.read(buffer, dimensions);
}
@Override
public void write(CompoundTag nbt, DimensionPalette dimensions) {
super.write(nbt, dimensions);
nbt.putInt("Activated", activated);
nbt.put("Filter", filter.serializeNBT());
if (currentTrain != null)
nbt.putUUID("TrainId", currentTrain);
}
@Override
public void write(FriendlyByteBuf buffer, DimensionPalette dimensions) {
super.write(buffer, dimensions);
}
}

View file

@ -0,0 +1,67 @@
package com.simibubi.create.content.logistics.trains.management.edgePoint.observer;
import com.simibubi.create.AllTileEntities;
import com.simibubi.create.content.contraptions.wrench.IWrenchable;
import com.simibubi.create.foundation.block.ITE;
import com.simibubi.create.foundation.tileEntity.TileEntityBehaviour;
import com.simibubi.create.foundation.tileEntity.behaviour.filtering.FilteringBehaviour;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.world.level.BlockGetter;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.entity.BlockEntityType;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.block.state.StateDefinition.Builder;
import net.minecraft.world.level.block.state.properties.BlockStateProperties;
import net.minecraft.world.level.block.state.properties.BooleanProperty;
public class TrackObserverBlock extends Block implements ITE<TrackObserverTileEntity>, IWrenchable {
public static final BooleanProperty POWERED = BlockStateProperties.POWERED;
public TrackObserverBlock(Properties p_49795_) {
super(p_49795_);
registerDefaultState(defaultBlockState().setValue(POWERED, false));
}
@Override
protected void createBlockStateDefinition(Builder<Block, BlockState> pBuilder) {
super.createBlockStateDefinition(pBuilder.add(POWERED));
}
@Override
public boolean isSignalSource(BlockState state) {
return true;
}
@Override
public int getSignal(BlockState blockState, BlockGetter blockAccess, BlockPos pos, Direction side) {
return blockState.getValue(POWERED) ? 15 : 0;
}
@Override
public boolean canConnectRedstone(BlockState state, BlockGetter world, BlockPos pos, Direction side) {
return true;
}
@Override
public Class<TrackObserverTileEntity> getTileEntityClass() {
return TrackObserverTileEntity.class;
}
@Override
public BlockEntityType<? extends TrackObserverTileEntity> getTileEntityType() {
return AllTileEntities.TRACK_OBSERVER.get();
}
@Override
public void onRemove(BlockState pState, Level pLevel, BlockPos pPos, BlockState pNewState, boolean pIsMoving) {
if (pState.hasBlockEntity() && (!pState.is(pNewState.getBlock()) || !pNewState.hasBlockEntity())) {
TileEntityBehaviour.destroy(pLevel, pPos, FilteringBehaviour.TYPE);
pLevel.removeBlockEntity(pPos);
}
}
}

View file

@ -0,0 +1,46 @@
package com.simibubi.create.content.logistics.trains.management.edgePoint.observer;
import com.mojang.blaze3d.vertex.PoseStack;
import com.simibubi.create.content.logistics.trains.ITrackBlock;
import com.simibubi.create.content.logistics.trains.management.edgePoint.TrackTargetingBehaviour;
import com.simibubi.create.content.logistics.trains.management.edgePoint.TrackTargetingBehaviour.RenderedTrackOverlayType;
import com.simibubi.create.foundation.tileEntity.renderer.SmartTileEntityRenderer;
import net.minecraft.client.renderer.MultiBufferSource;
import net.minecraft.client.renderer.blockentity.BlockEntityRendererProvider.Context;
import net.minecraft.core.BlockPos;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.state.BlockState;
public class TrackObserverRenderer extends SmartTileEntityRenderer<TrackObserverTileEntity> {
public TrackObserverRenderer(Context context) {
super(context);
}
@Override
protected void renderSafe(TrackObserverTileEntity te, float partialTicks, PoseStack ms, MultiBufferSource buffer,
int light, int overlay) {
super.renderSafe(te, partialTicks, ms, buffer, light, overlay);
BlockPos pos = te.getBlockPos();
TrackTargetingBehaviour<TrackObserver> target = te.edgePoint;
BlockPos targetPosition = target.getGlobalPosition();
Level level = te.getLevel();
BlockState trackState = level.getBlockState(targetPosition);
Block block = trackState.getBlock();
if (!(block instanceof ITrackBlock))
return;
ms.pushPose();
ms.translate(-pos.getX(), -pos.getY(), -pos.getZ());
RenderedTrackOverlayType type = RenderedTrackOverlayType.OBSERVER;
TrackTargetingBehaviour.render(level, targetPosition, target.getTargetDirection(), target.getTargetBezier(), ms,
buffer, light, overlay, type, 1);
ms.popPose();
}
}

View file

@ -0,0 +1,115 @@
package com.simibubi.create.content.logistics.trains.management.edgePoint.observer;
import java.util.List;
import javax.annotation.Nullable;
import com.jozufozu.flywheel.util.transform.TransformStack;
import com.mojang.blaze3d.vertex.PoseStack;
import com.simibubi.create.content.contraptions.components.structureMovement.ITransformableTE;
import com.simibubi.create.content.contraptions.components.structureMovement.StructureTransform;
import com.simibubi.create.content.logistics.block.display.DisplayLinkBlock;
import com.simibubi.create.content.logistics.trains.management.edgePoint.EdgePointType;
import com.simibubi.create.content.logistics.trains.management.edgePoint.TrackTargetingBehaviour;
import com.simibubi.create.foundation.tileEntity.SmartTileEntity;
import com.simibubi.create.foundation.tileEntity.TileEntityBehaviour;
import com.simibubi.create.foundation.tileEntity.behaviour.ValueBoxTransform;
import com.simibubi.create.foundation.tileEntity.behaviour.filtering.FilteringBehaviour;
import net.minecraft.core.BlockPos;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.block.entity.BlockEntityType;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.phys.AABB;
import net.minecraft.world.phys.Vec3;
public class TrackObserverTileEntity extends SmartTileEntity implements ITransformableTE {
public TrackTargetingBehaviour<TrackObserver> edgePoint;
private FilteringBehaviour filtering;
public TrackObserverTileEntity(BlockEntityType<?> type, BlockPos pos, BlockState state) {
super(type, pos, state);
}
@Override
public void addBehaviours(List<TileEntityBehaviour> behaviours) {
behaviours.add(edgePoint = new TrackTargetingBehaviour<>(this, EdgePointType.OBSERVER));
behaviours.add(filtering = createFilter().withCallback(this::onFilterChanged));
}
private void onFilterChanged(ItemStack newFilter) {
if (level.isClientSide())
return;
TrackObserver observer = getObserver();
if (observer != null)
observer.setFilterAndNotify(level, newFilter);
}
@Override
public void tick() {
super.tick();
if (level.isClientSide())
return;
boolean shouldBePowered = false;
TrackObserver observer = getObserver();
if (observer != null)
shouldBePowered = observer.isActivated();
if (isBlockPowered() == shouldBePowered)
return;
BlockState blockState = getBlockState();
if (blockState.hasProperty(TrackObserverBlock.POWERED))
level.setBlock(worldPosition, blockState.setValue(TrackObserverBlock.POWERED, shouldBePowered), 3);
DisplayLinkBlock.notifyGatherers(level, worldPosition);
}
@Nullable
public TrackObserver getObserver() {
return edgePoint.getEdgePoint();
}
public ItemStack getFilter() {
return filtering.getFilter();
}
public boolean isBlockPowered() {
return getBlockState().getOptionalValue(TrackObserverBlock.POWERED)
.orElse(false);
}
@Override
protected AABB createRenderBoundingBox() {
return new AABB(worldPosition, edgePoint.getGlobalPosition()).inflate(2);
}
@Override
public void transform(StructureTransform transform) {
edgePoint.transform(transform);
}
public FilteringBehaviour createFilter() {
return new FilteringBehaviour(this, new ValueBoxTransform() {
@Override
protected void rotate(BlockState state, PoseStack ms) {
TransformStack.cast(ms)
.rotateX(90);
}
@Override
protected Vec3 getLocalOffset(BlockState state) {
return new Vec3(0.5, 15 / 16d, 0.5);
}
protected float getScale() {
return super.getScale() * 1.5f;
};
});
}
}

View file

@ -39,11 +39,6 @@ public class SignalBlock extends Block implements ITE<SignalTileEntity>, IWrench
super(p_53182_);
registerDefaultState(defaultBlockState().setValue(TYPE, SignalType.ENTRY_SIGNAL));
}
@Override
public boolean propagatesSkylightDown(BlockState pState, BlockGetter pLevel, BlockPos pPos) {
return pState.getFluidState().isEmpty();
}
@Override
public Class<SignalTileEntity> getTileEntityClass() {

View file

@ -536,12 +536,12 @@ public class TrackBlock extends Block
return null;
return AllTileEntities.TRACK.create(p_153215_, state);
}
@Override
public Class<TrackTileEntity> getTileEntityClass() {
return TrackTileEntity.class;
}
@Override
public BlockEntityType<? extends TrackTileEntity> getTileEntityType() {
return AllTileEntities.TRACK.get();
@ -702,10 +702,12 @@ public class TrackBlock extends Block
msr.rotateCentered(Direction.UP, Mth.PI);
}
msr.scale(type == RenderedTrackOverlayType.STATION ? 1 + 1 / 512f : 1);
return type == RenderedTrackOverlayType.STATION ? AllBlockPartials.TRACK_STATION_OVERLAY
: type == RenderedTrackOverlayType.SIGNAL ? AllBlockPartials.TRACK_SIGNAL_OVERLAY
: AllBlockPartials.TRACK_SIGNAL_DUAL_OVERLAY;
return switch (type) {
case DUAL_SIGNAL -> AllBlockPartials.TRACK_SIGNAL_DUAL_OVERLAY;
case OBSERVER -> AllBlockPartials.TRACK_OBSERVER_OVERLAY;
case SIGNAL -> AllBlockPartials.TRACK_SIGNAL_OVERLAY;
case STATION -> AllBlockPartials.TRACK_STATION_OVERLAY;
};
}
@Override

View file

@ -536,6 +536,18 @@ public class StandardRecipeGen extends CreateRecipeProvider {
.viaShapeless(b -> b.requires(I.railwayCasing())
.requires(I.electronTube())),
TRAIN_OBSERVER = create(AllBlocks.TRACK_OBSERVER).unlockedBy(I::railwayCasing)
.returns(2)
.viaShapeless(b -> b.requires(I.railwayCasing())
.requires(ItemTags.WOODEN_PRESSURE_PLATES)),
TRAIN_OBSERVER_2 = create(AllBlocks.TRACK_OBSERVER).withSuffix("_from_other_plates")
.unlockedBy(I::railwayCasing)
.returns(2)
.viaShapeless(b -> b.requires(I.railwayCasing())
.requires(Ingredient.of(Items.STONE_PRESSURE_PLATE, Items.POLISHED_BLACKSTONE_PRESSURE_PLATE,
Items.HEAVY_WEIGHTED_PRESSURE_PLATE, Items.LIGHT_WEIGHTED_PRESSURE_PLATE))),
TRAIN_SCHEDULE = create(AllItems.SCHEDULE).unlockedByTag(I::reinforcedSheet)
.returns(4)
.viaShapeless(b -> b.requires(I.reinforcedSheet())

View file

@ -759,6 +759,7 @@
"create.display_source.station_summary.now": "now",
"create.display_source.station_summary.minutes": " min",
"create.display_source.station_summary.seconds": "%1$ss",
"create.display_source.observed_train_name": "Detected Train Name",
"create.display_target.line": "Line %1$s",
"create.display_target.page": "Page %1$s",

View file

@ -0,0 +1,23 @@
{
"credit": "Made with Blockbench",
"parent": "block/block",
"textures": {
"0": "create:block/signal_box_top",
"1": "create:block/observer_box",
"particle": "create:block/observer_box"
},
"elements": [
{
"from": [0, 0, 0],
"to": [16, 16, 16],
"faces": {
"north": {"uv": [0, 0, 16, 16], "texture": "#1"},
"east": {"uv": [0, 0, 16, 16], "texture": "#1"},
"south": {"uv": [0, 0, 16, 16], "texture": "#1"},
"west": {"uv": [0, 0, 16, 16], "texture": "#1"},
"up": {"uv": [0, 0, 16, 16], "texture": "#0"},
"down": {"uv": [0, 0, 16, 16], "texture": "#0"}
}
}
]
}

View file

@ -0,0 +1,23 @@
{
"credit": "Made with Blockbench",
"parent": "block/block",
"textures": {
"0": "create:block/signal_box_top",
"1": "create:block/observer_box_powered",
"particle": "create:block/observer_box_powered"
},
"elements": [
{
"from": [0, 0, 0],
"to": [16, 16, 16],
"faces": {
"north": {"uv": [0, 0, 16, 16], "texture": "#1"},
"east": {"uv": [0, 0, 16, 16], "texture": "#1"},
"south": {"uv": [0, 0, 16, 16], "texture": "#1"},
"west": {"uv": [0, 0, 16, 16], "texture": "#1"},
"up": {"uv": [0, 0, 16, 16], "texture": "#0"},
"down": {"uv": [0, 0, 16, 16], "texture": "#0"}
}
}
]
}

View file

@ -0,0 +1,7 @@
{
"credit": "Made with Blockbench",
"parent": "create:block/track_overlay/station",
"textures": {
"1": "create:block/observer_indicator"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB