From cd0c748e0be1c6b7d2458a3c0938dd38ac55df19 Mon Sep 17 00:00:00 2001 From: simibubi <31564874+simibubi@users.noreply.github.com> Date: Wed, 19 Oct 2022 13:15:47 +0200 Subject: [PATCH] Too much elevation - Elevator contacts no longer power adjacent elevator contacts - Fixed elevator contraptions travelling to unreachable floors - Switch to redstone palette for controls indicator - Added localised elevator assembly hints - Multiple elevators can no longer be assembled into the same column --- src/generated/resources/.cache/cache | 34 +++---- .../resources/assets/create/lang/en_us.json | 4 + .../assets/create/lang/unfinished/de_de.json | 6 +- .../assets/create/lang/unfinished/es_cl.json | 6 +- .../assets/create/lang/unfinished/es_es.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/pl_pl.json | 6 +- .../assets/create/lang/unfinished/pt_br.json | 6 +- .../assets/create/lang/unfinished/pt_pt.json | 6 +- .../assets/create/lang/unfinished/ro_ro.json | 6 +- .../assets/create/lang/unfinished/ru_ru.json | 6 +- .../assets/create/lang/unfinished/uk_ua.json | 6 +- .../assets/create/lang/unfinished/zh_cn.json | 6 +- .../assets/create/lang/unfinished/zh_tw.json | 6 +- .../controls/ContraptionControlsMovement.java | 90 ++--------------- .../controls/ContraptionControlsRenderer.java | 93 +++++++++++++++++- .../AbstractContraptionEntity.java | 3 +- .../elevator/ElevatorContactBlock.java | 7 +- .../elevator/ElevatorContraption.java | 25 ++++- .../elevator/ElevatorPulleyTileEntity.java | 3 + .../elevator/ElevatorTargetFloorPacket.java | 2 + .../piston/LinearActuatorTileEntity.java | 1 - .../assets/create/lang/default/interface.json | 4 + .../block/contraption_controls_frame.png | Bin 3408 -> 3409 bytes .../block/contraption_controls_indicator.png | Bin 2945 -> 2941 bytes 29 files changed, 237 insertions(+), 125 deletions(-) diff --git a/src/generated/resources/.cache/cache b/src/generated/resources/.cache/cache index 529a795b7..53998221a 100644 --- a/src/generated/resources/.cache/cache +++ b/src/generated/resources/.cache/cache @@ -563,23 +563,23 @@ bf2b0310500213ff853c748c236eb5d01f61658e assets/create/blockstates/yellow_toolbo 7f39521b211441f5c3e06d60c5978cebe16cacfb assets/create/blockstates/zinc_block.json b7181bcd8182b2f17088e5aa881f374c9c65470c assets/create/blockstates/zinc_ore.json 29da6f08028cfed0f311c8073d7615d6821aaee6 assets/create/lang/en_ud.json -f16b180625bb72138bcb57e27b91b1b4b9c71db7 assets/create/lang/en_us.json -cab6bdb4325f41b3309bc9f7381dacbe50bc284a assets/create/lang/unfinished/de_de.json -52206a7b8357a3ba74b265a87ef01f4f5ccff521 assets/create/lang/unfinished/es_cl.json -9dbfe72c9585e0eaec5b185ede7a7f58c2896c31 assets/create/lang/unfinished/es_es.json -8cbbfeb3f1697d013517754bcd2a6b08831d4f84 assets/create/lang/unfinished/fr_fr.json -218ea3097c9979909d897d978cbad61facfb1b8c assets/create/lang/unfinished/it_it.json -ae2dfc2bd8196fce9f30dc1469e94f050a1a49f5 assets/create/lang/unfinished/ja_jp.json -271fc874fe49205e3fbcfe1d27148ab4f4cf3d96 assets/create/lang/unfinished/ko_kr.json -032e905563d9257b9423c88706ab8a4cfb1b5bb3 assets/create/lang/unfinished/nl_nl.json -3012ab3a76e359db944d1d6330772dd15e6e8c5c assets/create/lang/unfinished/pl_pl.json -df65548cb9c722b93bee0a570b75aac37442a517 assets/create/lang/unfinished/pt_br.json -5cb5a8ab92c155131dfcfc1e593d5a0e04cbd219 assets/create/lang/unfinished/pt_pt.json -3afabc1553ae8c007c31c79686d0d36502f54687 assets/create/lang/unfinished/ro_ro.json -ccb8e554f34afdd21f9d6920c9a503f275ec676c assets/create/lang/unfinished/ru_ru.json -b6ecf4c99b64ecf194253a8595ced0732a53beb3 assets/create/lang/unfinished/uk_ua.json -fe13c0665e0359ec356d0656f1b5715b1e6a6213 assets/create/lang/unfinished/zh_cn.json -9f80d15820f6d308e31c3a31b2e98251bdc93b01 assets/create/lang/unfinished/zh_tw.json +0070b8f388464c998ebdec0dd9ed00f95910922b assets/create/lang/en_us.json +819a773dac8b804a497bc798aa5b60011de1f736 assets/create/lang/unfinished/de_de.json +ed149274800dbc226bdc3dc0ba5f37fd5aff7e9a assets/create/lang/unfinished/es_cl.json +59ba35103b2ec6b30b00c38e6410994eb1050a06 assets/create/lang/unfinished/es_es.json +27463977eae36ec876a0a298885f606297c971c1 assets/create/lang/unfinished/fr_fr.json +b8f760ee53958b6193350c82a0ad6ec4df0116d9 assets/create/lang/unfinished/it_it.json +766d570603a8cb1475002045db8976d7bfae72f1 assets/create/lang/unfinished/ja_jp.json +5d585d77810a3bc6b4247eff5a08f0a85fcc0e7c assets/create/lang/unfinished/ko_kr.json +1275ee80cc65b49a77c26dbbd3bfba9eac762ead assets/create/lang/unfinished/nl_nl.json +9c2210faa1a598567c9b8c6e0529183227afd8de assets/create/lang/unfinished/pl_pl.json +4e07b14961b64aa05a60193335663a4ea2cbe4ef assets/create/lang/unfinished/pt_br.json +4f27ff82d89d4b25b3cc237118611c385b6bedd9 assets/create/lang/unfinished/pt_pt.json +3b76d014cacd40e53e1f8f10545a133e2289ebc7 assets/create/lang/unfinished/ro_ro.json +b315407f620e95f376e4b0aab5cc6755c6410227 assets/create/lang/unfinished/ru_ru.json +5ec15854ee92e6e463341b226da3682f213ad7a5 assets/create/lang/unfinished/uk_ua.json +1be5b9da89c4f22421bda20eae909f69dd8f7554 assets/create/lang/unfinished/zh_cn.json +df88975ac97350e6f77355c053f853f14d867ecb 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 diff --git a/src/generated/resources/assets/create/lang/en_us.json b/src/generated/resources/assets/create/lang/en_us.json index b1f5c9e4e..6d6d2dfda 100644 --- a/src/generated/resources/assets/create/lang/en_us.json +++ b/src/generated/resources/assets/create/lang/en_us.json @@ -1081,6 +1081,9 @@ "create.gui.assembly.exception.tooManyPistonPoles": "There are too many extension Poles attached to this Piston.\nThe configured maximum is: %1$s", "create.gui.assembly.exception.noPistonPoles": "The Piston is missing some extension Poles", "create.gui.assembly.exception.not_enough_sails": "Attached structure does not include enough sail-like blocks: %1$s\nA minimum of %2$s are required", + "create.gui.assembly.exception.no_contacts": "Elevators require a horizontal _Redstone_ _Contact_ attached to the structure", + "create.gui.assembly.exception.too_many_contacts": "Cannot attach more than one _Redstone_ _Contact_ to Elevators", + "create.gui.assembly.exception.column_conflict": "Another Elevator is already targeting this column of contacts", "create.gui.gauge.info_header": "Gauge Information:", "create.gui.speedometer.title": "Rotation Speed", "create.gui.stressometer.title": "Network Stress", @@ -1644,6 +1647,7 @@ "create.contraption.controls.all_actor_toggle": "All Actors: %1$s", "create.contraption.controls.actor_toggle.on": "On", "create.contraption.controls.actor_toggle.off": "Off", + "create.contraption.controls.floor_unreachable": "Unreachable", "create.display_link.set": "Targeted position selected", "create.display_link.success": "Successfully bound to targeted position", 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 044a0069c..c3935a7ea 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: 866", + "_": "Missing Localizations: 870", "_": "->------------------------] Game Elements [------------------------<-", @@ -1082,6 +1082,9 @@ "create.gui.assembly.exception.tooManyPistonPoles": "Es sind zu viele Pleuelverlängerungen an diesen Kolben angebracht.\nDas konfigurierte Maximum ist: %1$s", "create.gui.assembly.exception.noPistonPoles": "Dem Kolben fehlen ein paar Pleuelverlängerungen", "create.gui.assembly.exception.not_enough_sails": "Angebrachte Struktur enthält nicht genug segelähnliche Blöcke: %1$s\nEin Minimum von %2$s ist erforderlich", + "create.gui.assembly.exception.no_contacts": "UNLOCALIZED: Elevators require a horizontal _Redstone_ _Contact_ attached to the structure", + "create.gui.assembly.exception.too_many_contacts": "UNLOCALIZED: Cannot attach more than one _Redstone_ _Contact_ to Elevators", + "create.gui.assembly.exception.column_conflict": "UNLOCALIZED: Another Elevator is already targeting this column of contacts", "create.gui.gauge.info_header": "Messgerät Information:", "create.gui.speedometer.title": "Rotationsgeschwindigkeit", "create.gui.stressometer.title": "Netzwerkbelastung", @@ -1645,6 +1648,7 @@ "create.contraption.controls.all_actor_toggle": "UNLOCALIZED: All Actors: %1$s", "create.contraption.controls.actor_toggle.on": "UNLOCALIZED: On", "create.contraption.controls.actor_toggle.off": "UNLOCALIZED: Off", + "create.contraption.controls.floor_unreachable": "UNLOCALIZED: Unreachable", "create.display_link.set": "Anvisierte Position ausgewählt", "create.display_link.success": "Erfolgreich mit ausgewählter Position gebunden", diff --git a/src/generated/resources/assets/create/lang/unfinished/es_cl.json b/src/generated/resources/assets/create/lang/unfinished/es_cl.json index 54776c155..d09f16d7b 100644 --- a/src/generated/resources/assets/create/lang/unfinished/es_cl.json +++ b/src/generated/resources/assets/create/lang/unfinished/es_cl.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 1012", + "_": "Missing Localizations: 1016", "_": "->------------------------] Game Elements [------------------------<-", @@ -1082,6 +1082,9 @@ "create.gui.assembly.exception.tooManyPistonPoles": "Hay muchos postes de extensión en este pistón.\nEl máximo configurado es: %1$s", "create.gui.assembly.exception.noPistonPoles": "Al pistón le faltan algunos postes de extensión", "create.gui.assembly.exception.not_enough_sails": "La estructura adjunta no incluye suficientes bloques de vela: %1$s\nUn mínimo de %2$s son requeridos", + "create.gui.assembly.exception.no_contacts": "UNLOCALIZED: Elevators require a horizontal _Redstone_ _Contact_ attached to the structure", + "create.gui.assembly.exception.too_many_contacts": "UNLOCALIZED: Cannot attach more than one _Redstone_ _Contact_ to Elevators", + "create.gui.assembly.exception.column_conflict": "UNLOCALIZED: Another Elevator is already targeting this column of contacts", "create.gui.gauge.info_header": "Información del medidor:", "create.gui.speedometer.title": "Velocidad de Rotación", "create.gui.stressometer.title": "Estrés de la Red", @@ -1645,6 +1648,7 @@ "create.contraption.controls.all_actor_toggle": "UNLOCALIZED: All Actors: %1$s", "create.contraption.controls.actor_toggle.on": "UNLOCALIZED: On", "create.contraption.controls.actor_toggle.off": "UNLOCALIZED: Off", + "create.contraption.controls.floor_unreachable": "UNLOCALIZED: Unreachable", "create.display_link.set": "UNLOCALIZED: Targeted position selected", "create.display_link.success": "UNLOCALIZED: Successfully bound to targeted position", 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 4fdc694f1..53974bfaa 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: 32", + "_": "Missing Localizations: 36", "_": "->------------------------] Game Elements [------------------------<-", @@ -1082,6 +1082,9 @@ "create.gui.assembly.exception.tooManyPistonPoles": "Hay demasiadas Pértigas de extensión conectadas a este Pistón.\nEl máximo configurado es: %1$s", "create.gui.assembly.exception.noPistonPoles": "Faltan pértigas de extensión para el pistón", "create.gui.assembly.exception.not_enough_sails": "La estructura adjunta no incluye suficientes bloques tipo vela: %1$s\nSe requiere un mínimo de %2$s", + "create.gui.assembly.exception.no_contacts": "UNLOCALIZED: Elevators require a horizontal _Redstone_ _Contact_ attached to the structure", + "create.gui.assembly.exception.too_many_contacts": "UNLOCALIZED: Cannot attach more than one _Redstone_ _Contact_ to Elevators", + "create.gui.assembly.exception.column_conflict": "UNLOCALIZED: Another Elevator is already targeting this column of contacts", "create.gui.gauge.info_header": "Información sobre el medidor:", "create.gui.speedometer.title": "Velocidad de rotación", "create.gui.stressometer.title": "Estrés de la red", @@ -1645,6 +1648,7 @@ "create.contraption.controls.all_actor_toggle": "UNLOCALIZED: All Actors: %1$s", "create.contraption.controls.actor_toggle.on": "UNLOCALIZED: On", "create.contraption.controls.actor_toggle.off": "UNLOCALIZED: Off", + "create.contraption.controls.floor_unreachable": "UNLOCALIZED: Unreachable", "create.display_link.set": "Posición objetivo seleccionada", "create.display_link.success": "Posición objetivo vinculada con éxito", 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 3f590a96c..3e927a7cc 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: 2150", + "_": "Missing Localizations: 2165", "_": "->------------------------] Game Elements [------------------------<-", @@ -1082,6 +1082,9 @@ "create.gui.assembly.exception.tooManyPistonPoles": "UNLOCALIZED: There are too many extension Poles attached to this Piston.\nThe configured maximum is: %1$s", "create.gui.assembly.exception.noPistonPoles": "UNLOCALIZED: The Piston is missing some extension Poles", "create.gui.assembly.exception.not_enough_sails": "UNLOCALIZED: Attached structure does not include enough sail-like blocks: %1$s\nA minimum of %2$s are required", + "create.gui.assembly.exception.no_contacts": "UNLOCALIZED: Elevators require a horizontal _Redstone_ _Contact_ attached to the structure", + "create.gui.assembly.exception.too_many_contacts": "UNLOCALIZED: Cannot attach more than one _Redstone_ _Contact_ to Elevators", + "create.gui.assembly.exception.column_conflict": "UNLOCALIZED: Another Elevator is already targeting this column of contacts", "create.gui.gauge.info_header": "Informations sur la jauge:", "create.gui.speedometer.title": "Vitesse de rotation", "create.gui.stressometer.title": "Stress du réseau", @@ -1645,6 +1648,7 @@ "create.contraption.controls.all_actor_toggle": "UNLOCALIZED: All Actors: %1$s", "create.contraption.controls.actor_toggle.on": "UNLOCALIZED: On", "create.contraption.controls.actor_toggle.off": "UNLOCALIZED: Off", + "create.contraption.controls.floor_unreachable": "UNLOCALIZED: Unreachable", "create.display_link.set": "UNLOCALIZED: Targeted position selected", "create.display_link.success": "UNLOCALIZED: Successfully bound to targeted position", 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 1044a7dea..73cc6388d 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: 26", + "_": "Missing Localizations: 30", "_": "->------------------------] Game Elements [------------------------<-", @@ -1082,6 +1082,9 @@ "create.gui.assembly.exception.tooManyPistonPoles": "Ci sono troppi Pali di pistone attaccati a questo Pistone.\nIl massimo èimpostato a: %1$s", "create.gui.assembly.exception.noPistonPoles": "Questo Pistone non ha Pali per pistone attaccati", "create.gui.assembly.exception.not_enough_sails": "La struttura attaccata non include abbastanza blocchi simili a vele: %1$s\nNe servono un minimo di %2$s", + "create.gui.assembly.exception.no_contacts": "UNLOCALIZED: Elevators require a horizontal _Redstone_ _Contact_ attached to the structure", + "create.gui.assembly.exception.too_many_contacts": "UNLOCALIZED: Cannot attach more than one _Redstone_ _Contact_ to Elevators", + "create.gui.assembly.exception.column_conflict": "UNLOCALIZED: Another Elevator is already targeting this column of contacts", "create.gui.gauge.info_header": "Informazioni sul sistema:", "create.gui.speedometer.title": "Velocità di rotazione", "create.gui.stressometer.title": "Stress della rete", @@ -1645,6 +1648,7 @@ "create.contraption.controls.all_actor_toggle": "UNLOCALIZED: All Actors: %1$s", "create.contraption.controls.actor_toggle.on": "UNLOCALIZED: On", "create.contraption.controls.actor_toggle.off": "UNLOCALIZED: Off", + "create.contraption.controls.floor_unreachable": "UNLOCALIZED: Unreachable", "create.display_link.set": "Bersaglio selezionato", "create.display_link.success": "Connesso con successo alla posizione selezionata", 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 355cf6504..c76c046cf 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: 28", + "_": "Missing Localizations: 32", "_": "->------------------------] Game Elements [------------------------<-", @@ -1082,6 +1082,9 @@ "create.gui.assembly.exception.tooManyPistonPoles": "このピストンに取り付けられているピストン延長ポールが多すぎます。\n最大値: %1$s", "create.gui.assembly.exception.noPistonPoles": "ピストンにピストン延長ポールがありません。", "create.gui.assembly.exception.not_enough_sails": "このからくりは帆ブロックが足りていません。: %1$s\nが最低でも%2$s個必要です。", + "create.gui.assembly.exception.no_contacts": "UNLOCALIZED: Elevators require a horizontal _Redstone_ _Contact_ attached to the structure", + "create.gui.assembly.exception.too_many_contacts": "UNLOCALIZED: Cannot attach more than one _Redstone_ _Contact_ to Elevators", + "create.gui.assembly.exception.column_conflict": "UNLOCALIZED: Another Elevator is already targeting this column of contacts", "create.gui.gauge.info_header": "メーターの情報:", "create.gui.speedometer.title": "回転速度", "create.gui.stressometer.title": "ネットワークの応力", @@ -1645,6 +1648,7 @@ "create.contraption.controls.all_actor_toggle": "UNLOCALIZED: All Actors: %1$s", "create.contraption.controls.actor_toggle.on": "UNLOCALIZED: On", "create.contraption.controls.actor_toggle.off": "UNLOCALIZED: Off", + "create.contraption.controls.floor_unreachable": "UNLOCALIZED: Unreachable", "create.display_link.set": "対象の位置を選択しました", "create.display_link.success": "対象の位置と結び付けられました", 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 719a7b46c..bdcebf9c2 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: 32", + "_": "Missing Localizations: 36", "_": "->------------------------] Game Elements [------------------------<-", @@ -1082,6 +1082,9 @@ "create.gui.assembly.exception.tooManyPistonPoles": "이 피스톤에 너무 많은 연장 축이 부착되어 있습니다.\n설정된 최댓값: %1$s개", "create.gui.assembly.exception.noPistonPoles": "이 피스톤은 연장 축이 없습니다.", "create.gui.assembly.exception.not_enough_sails": "부착된 구조물에 날개 블록이 부족합니다. 현재: %1$s개 \n최소 %2$s개가 필요합니다.", + "create.gui.assembly.exception.no_contacts": "UNLOCALIZED: Elevators require a horizontal _Redstone_ _Contact_ attached to the structure", + "create.gui.assembly.exception.too_many_contacts": "UNLOCALIZED: Cannot attach more than one _Redstone_ _Contact_ to Elevators", + "create.gui.assembly.exception.column_conflict": "UNLOCALIZED: Another Elevator is already targeting this column of contacts", "create.gui.gauge.info_header": "계측기 정보:", "create.gui.speedometer.title": "회전 속도", "create.gui.stressometer.title": "네트워크 부하", @@ -1645,6 +1648,7 @@ "create.contraption.controls.all_actor_toggle": "UNLOCALIZED: All Actors: %1$s", "create.contraption.controls.actor_toggle.on": "UNLOCALIZED: On", "create.contraption.controls.actor_toggle.off": "UNLOCALIZED: Off", + "create.contraption.controls.floor_unreachable": "UNLOCALIZED: Unreachable", "create.display_link.set": "표시할 대상을 선택했습니다", "create.display_link.success": "성공적으로 대상과 연결되었습니다", 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 056daaa70..dc0e06221 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: 2498", + "_": "Missing Localizations: 2513", "_": "->------------------------] Game Elements [------------------------<-", @@ -1082,6 +1082,9 @@ "create.gui.assembly.exception.tooManyPistonPoles": "UNLOCALIZED: There are too many extension Poles attached to this Piston.\nThe configured maximum is: %1$s", "create.gui.assembly.exception.noPistonPoles": "UNLOCALIZED: The Piston is missing some extension Poles", "create.gui.assembly.exception.not_enough_sails": "UNLOCALIZED: Attached structure does not include enough sail-like blocks: %1$s\nA minimum of %2$s are required", + "create.gui.assembly.exception.no_contacts": "UNLOCALIZED: Elevators require a horizontal _Redstone_ _Contact_ attached to the structure", + "create.gui.assembly.exception.too_many_contacts": "UNLOCALIZED: Cannot attach more than one _Redstone_ _Contact_ to Elevators", + "create.gui.assembly.exception.column_conflict": "UNLOCALIZED: Another Elevator is already targeting this column of contacts", "create.gui.gauge.info_header": "UNLOCALIZED: Gauge Information:", "create.gui.speedometer.title": "UNLOCALIZED: Rotation Speed", "create.gui.stressometer.title": "UNLOCALIZED: Network Stress", @@ -1645,6 +1648,7 @@ "create.contraption.controls.all_actor_toggle": "UNLOCALIZED: All Actors: %1$s", "create.contraption.controls.actor_toggle.on": "UNLOCALIZED: On", "create.contraption.controls.actor_toggle.off": "UNLOCALIZED: Off", + "create.contraption.controls.floor_unreachable": "UNLOCALIZED: Unreachable", "create.display_link.set": "UNLOCALIZED: Targeted position selected", "create.display_link.success": "UNLOCALIZED: Successfully bound to targeted position", diff --git a/src/generated/resources/assets/create/lang/unfinished/pl_pl.json b/src/generated/resources/assets/create/lang/unfinished/pl_pl.json index 4b9101779..9c2204258 100644 --- a/src/generated/resources/assets/create/lang/unfinished/pl_pl.json +++ b/src/generated/resources/assets/create/lang/unfinished/pl_pl.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 36", + "_": "Missing Localizations: 40", "_": "->------------------------] Game Elements [------------------------<-", @@ -1082,6 +1082,9 @@ "create.gui.assembly.exception.tooManyPistonPoles": "Zbyt dużo przedłużeń tłoka. Ustawione maksimum to: %1$s", "create.gui.assembly.exception.noPistonPoles": "Brakuje kilku przedłużeń tłoka", "create.gui.assembly.exception.not_enough_sails": "Przyczepiona struktura nie zawiera wystarczająco żaglo-podobnych bloków: %1$s Wymagane minimum to %2$s", + "create.gui.assembly.exception.no_contacts": "UNLOCALIZED: Elevators require a horizontal _Redstone_ _Contact_ attached to the structure", + "create.gui.assembly.exception.too_many_contacts": "UNLOCALIZED: Cannot attach more than one _Redstone_ _Contact_ to Elevators", + "create.gui.assembly.exception.column_conflict": "UNLOCALIZED: Another Elevator is already targeting this column of contacts", "create.gui.gauge.info_header": "Informacje miernika:", "create.gui.speedometer.title": "Prędkość obrotu", "create.gui.stressometer.title": "Obciążenie systemu", @@ -1645,6 +1648,7 @@ "create.contraption.controls.all_actor_toggle": "UNLOCALIZED: All Actors: %1$s", "create.contraption.controls.actor_toggle.on": "UNLOCALIZED: On", "create.contraption.controls.actor_toggle.off": "UNLOCALIZED: Off", + "create.contraption.controls.floor_unreachable": "UNLOCALIZED: Unreachable", "create.display_link.set": "Pozycja docelowa zaznaczona", "create.display_link.success": "Pomyślnie przypisano do pozycji docelowej", 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 a47a0b41c..a8f817d21 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: 1355", + "_": "Missing Localizations: 1359", "_": "->------------------------] Game Elements [------------------------<-", @@ -1082,6 +1082,9 @@ "create.gui.assembly.exception.tooManyPistonPoles": "Tem muitas varetas de extensão colocadas nesse pistão. O limite configurado é: %1$s", "create.gui.assembly.exception.noPistonPoles": "O pistão esta faltando algumas varetas de extensão", "create.gui.assembly.exception.not_enough_sails": "A estrutura conectada não possui o número suficiente de blocos tipo vela: %1$s\nUm mínimo de %2$s são requeridos", + "create.gui.assembly.exception.no_contacts": "UNLOCALIZED: Elevators require a horizontal _Redstone_ _Contact_ attached to the structure", + "create.gui.assembly.exception.too_many_contacts": "UNLOCALIZED: Cannot attach more than one _Redstone_ _Contact_ to Elevators", + "create.gui.assembly.exception.column_conflict": "UNLOCALIZED: Another Elevator is already targeting this column of contacts", "create.gui.gauge.info_header": "Informação do medidor:", "create.gui.speedometer.title": "Velocidade de rotação", "create.gui.stressometer.title": "Estresse do sistema", @@ -1645,6 +1648,7 @@ "create.contraption.controls.all_actor_toggle": "UNLOCALIZED: All Actors: %1$s", "create.contraption.controls.actor_toggle.on": "UNLOCALIZED: On", "create.contraption.controls.actor_toggle.off": "UNLOCALIZED: Off", + "create.contraption.controls.floor_unreachable": "UNLOCALIZED: Unreachable", "create.display_link.set": "UNLOCALIZED: Targeted position selected", "create.display_link.success": "UNLOCALIZED: Successfully bound to targeted position", diff --git a/src/generated/resources/assets/create/lang/unfinished/pt_pt.json b/src/generated/resources/assets/create/lang/unfinished/pt_pt.json index a4a5fc425..5f6365e95 100644 --- a/src/generated/resources/assets/create/lang/unfinished/pt_pt.json +++ b/src/generated/resources/assets/create/lang/unfinished/pt_pt.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 2220", + "_": "Missing Localizations: 2224", "_": "->------------------------] Game Elements [------------------------<-", @@ -1082,6 +1082,9 @@ "create.gui.assembly.exception.tooManyPistonPoles": "UNLOCALIZED: There are too many extension Poles attached to this Piston.\nThe configured maximum is: %1$s", "create.gui.assembly.exception.noPistonPoles": "UNLOCALIZED: The Piston is missing some extension Poles", "create.gui.assembly.exception.not_enough_sails": "UNLOCALIZED: Attached structure does not include enough sail-like blocks: %1$s\nA minimum of %2$s are required", + "create.gui.assembly.exception.no_contacts": "UNLOCALIZED: Elevators require a horizontal _Redstone_ _Contact_ attached to the structure", + "create.gui.assembly.exception.too_many_contacts": "UNLOCALIZED: Cannot attach more than one _Redstone_ _Contact_ to Elevators", + "create.gui.assembly.exception.column_conflict": "UNLOCALIZED: Another Elevator is already targeting this column of contacts", "create.gui.gauge.info_header": "UNLOCALIZED: Gauge Information:", "create.gui.speedometer.title": "UNLOCALIZED: Rotation Speed", "create.gui.stressometer.title": "UNLOCALIZED: Network Stress", @@ -1645,6 +1648,7 @@ "create.contraption.controls.all_actor_toggle": "UNLOCALIZED: All Actors: %1$s", "create.contraption.controls.actor_toggle.on": "UNLOCALIZED: On", "create.contraption.controls.actor_toggle.off": "UNLOCALIZED: Off", + "create.contraption.controls.floor_unreachable": "UNLOCALIZED: Unreachable", "create.display_link.set": "UNLOCALIZED: Targeted position selected", "create.display_link.success": "UNLOCALIZED: Successfully bound to targeted position", diff --git a/src/generated/resources/assets/create/lang/unfinished/ro_ro.json b/src/generated/resources/assets/create/lang/unfinished/ro_ro.json index e6e5d8cf9..dfd9983f0 100644 --- a/src/generated/resources/assets/create/lang/unfinished/ro_ro.json +++ b/src/generated/resources/assets/create/lang/unfinished/ro_ro.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 679", + "_": "Missing Localizations: 683", "_": "->------------------------] Game Elements [------------------------<-", @@ -1082,6 +1082,9 @@ "create.gui.assembly.exception.tooManyPistonPoles": "Sunt prea multe Brațe de extensie atașat la acest Piston.\nMaximul configurat este: %1$s", "create.gui.assembly.exception.noPistonPoles": "Pistonului îi lipsesc niște Brațe de extensie", "create.gui.assembly.exception.not_enough_sails": "Structura atașată nu include destule blocuri de pânze: %1$s\nUn minim de %2$s e necesar", + "create.gui.assembly.exception.no_contacts": "UNLOCALIZED: Elevators require a horizontal _Redstone_ _Contact_ attached to the structure", + "create.gui.assembly.exception.too_many_contacts": "UNLOCALIZED: Cannot attach more than one _Redstone_ _Contact_ to Elevators", + "create.gui.assembly.exception.column_conflict": "UNLOCALIZED: Another Elevator is already targeting this column of contacts", "create.gui.gauge.info_header": "Informație Gabarit:", "create.gui.speedometer.title": "Viteză de Rotație", "create.gui.stressometer.title": "Rețea de Stres", @@ -1645,6 +1648,7 @@ "create.contraption.controls.all_actor_toggle": "UNLOCALIZED: All Actors: %1$s", "create.contraption.controls.actor_toggle.on": "UNLOCALIZED: On", "create.contraption.controls.actor_toggle.off": "UNLOCALIZED: Off", + "create.contraption.controls.floor_unreachable": "UNLOCALIZED: Unreachable", "create.display_link.set": "UNLOCALIZED: Targeted position selected", "create.display_link.success": "UNLOCALIZED: Successfully bound to targeted position", 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 718150b8a..d7f9acbc7 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: 24", + "_": "Missing Localizations: 28", "_": "->------------------------] Game Elements [------------------------<-", @@ -1082,6 +1082,9 @@ "create.gui.assembly.exception.tooManyPistonPoles": "Слишком много удлинителей прикреплено к этому поршню.\nТекущий максимум: %1$s", "create.gui.assembly.exception.noPistonPoles": "Поршню не хватает удлинителей", "create.gui.assembly.exception.not_enough_sails": "Присоединённая структура содержит недостаточно парусоподобных блоков; %1$s из минимум %2$s необходимых", + "create.gui.assembly.exception.no_contacts": "UNLOCALIZED: Elevators require a horizontal _Redstone_ _Contact_ attached to the structure", + "create.gui.assembly.exception.too_many_contacts": "UNLOCALIZED: Cannot attach more than one _Redstone_ _Contact_ to Elevators", + "create.gui.assembly.exception.column_conflict": "UNLOCALIZED: Another Elevator is already targeting this column of contacts", "create.gui.gauge.info_header": "Калибровочная информация:", "create.gui.speedometer.title": "Скорость вращения", "create.gui.stressometer.title": "Нагрузка на сеть", @@ -1645,6 +1648,7 @@ "create.contraption.controls.all_actor_toggle": "UNLOCALIZED: All Actors: %1$s", "create.contraption.controls.actor_toggle.on": "UNLOCALIZED: On", "create.contraption.controls.actor_toggle.off": "UNLOCALIZED: Off", + "create.contraption.controls.floor_unreachable": "UNLOCALIZED: Unreachable", "create.display_link.set": "Выбрана целевая позиция", "create.display_link.success": "Успешно привязан к целевой позиции", diff --git a/src/generated/resources/assets/create/lang/unfinished/uk_ua.json b/src/generated/resources/assets/create/lang/unfinished/uk_ua.json index 07a44b6a0..f4005ba15 100644 --- a/src/generated/resources/assets/create/lang/unfinished/uk_ua.json +++ b/src/generated/resources/assets/create/lang/unfinished/uk_ua.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 1010", + "_": "Missing Localizations: 1014", "_": "->------------------------] Game Elements [------------------------<-", @@ -1082,6 +1082,9 @@ "create.gui.assembly.exception.tooManyPistonPoles": "Надто багато Подовжувачів прикріплено до цього поршня.\nПоточний максимум: %1$s", "create.gui.assembly.exception.noPistonPoles": "Поршню не вистачає Подовжувачів", "create.gui.assembly.exception.not_enough_sails": "Приєднана структура не містить достатньо парусоподібних блоків: %1$s\nМінімум з %2$s необхідних", + "create.gui.assembly.exception.no_contacts": "UNLOCALIZED: Elevators require a horizontal _Redstone_ _Contact_ attached to the structure", + "create.gui.assembly.exception.too_many_contacts": "UNLOCALIZED: Cannot attach more than one _Redstone_ _Contact_ to Elevators", + "create.gui.assembly.exception.column_conflict": "UNLOCALIZED: Another Elevator is already targeting this column of contacts", "create.gui.gauge.info_header": "Калібрувальна інформація:", "create.gui.speedometer.title": "Швидкість обертання", "create.gui.stressometer.title": "Нагрузка на мережу", @@ -1645,6 +1648,7 @@ "create.contraption.controls.all_actor_toggle": "UNLOCALIZED: All Actors: %1$s", "create.contraption.controls.actor_toggle.on": "UNLOCALIZED: On", "create.contraption.controls.actor_toggle.off": "UNLOCALIZED: Off", + "create.contraption.controls.floor_unreachable": "UNLOCALIZED: Unreachable", "create.display_link.set": "UNLOCALIZED: Targeted position selected", "create.display_link.success": "UNLOCALIZED: Successfully bound to targeted position", 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 0bf7da01c..67a3007d2 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: 24", + "_": "Missing Localizations: 28", "_": "->------------------------] Game Elements [------------------------<-", @@ -1082,6 +1082,9 @@ "create.gui.assembly.exception.tooManyPistonPoles": "活塞加装的活塞杆数量过多\n配置的最大值为:%1$s", "create.gui.assembly.exception.noPistonPoles": "活塞缺失部分活塞杆", "create.gui.assembly.exception.not_enough_sails": "相接的结构所包含的类风帆方块的数量不足:%1$s\n至少需要 %2$s", + "create.gui.assembly.exception.no_contacts": "UNLOCALIZED: Elevators require a horizontal _Redstone_ _Contact_ attached to the structure", + "create.gui.assembly.exception.too_many_contacts": "UNLOCALIZED: Cannot attach more than one _Redstone_ _Contact_ to Elevators", + "create.gui.assembly.exception.column_conflict": "UNLOCALIZED: Another Elevator is already targeting this column of contacts", "create.gui.gauge.info_header": "仪表信息:", "create.gui.speedometer.title": "旋转速度", "create.gui.stressometer.title": "网络应力", @@ -1645,6 +1648,7 @@ "create.contraption.controls.all_actor_toggle": "UNLOCALIZED: All Actors: %1$s", "create.contraption.controls.actor_toggle.on": "UNLOCALIZED: On", "create.contraption.controls.actor_toggle.off": "UNLOCALIZED: Off", + "create.contraption.controls.floor_unreachable": "UNLOCALIZED: Unreachable", "create.display_link.set": "已选择目标位置", "create.display_link.success": "成功绑定到目标位置", 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 7ab5bcc94..dd4891d51 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: 32", + "_": "Missing Localizations: 36", "_": "->------------------------] Game Elements [------------------------<-", @@ -1082,6 +1082,9 @@ "create.gui.assembly.exception.tooManyPistonPoles": "活塞的活塞桿數量過多\n可放置的數量最大為:%1$s", "create.gui.assembly.exception.noPistonPoles": "這個活塞遺失了一些活塞桿", "create.gui.assembly.exception.not_enough_sails": "結構中所需的風帆類方塊數量不足:%1$s\n最少需要的數量為:%2$s", + "create.gui.assembly.exception.no_contacts": "UNLOCALIZED: Elevators require a horizontal _Redstone_ _Contact_ attached to the structure", + "create.gui.assembly.exception.too_many_contacts": "UNLOCALIZED: Cannot attach more than one _Redstone_ _Contact_ to Elevators", + "create.gui.assembly.exception.column_conflict": "UNLOCALIZED: Another Elevator is already targeting this column of contacts", "create.gui.gauge.info_header": "儀表訊息:", "create.gui.speedometer.title": "旋轉速度", "create.gui.stressometer.title": "網路負荷", @@ -1645,6 +1648,7 @@ "create.contraption.controls.all_actor_toggle": "UNLOCALIZED: All Actors: %1$s", "create.contraption.controls.actor_toggle.on": "UNLOCALIZED: On", "create.contraption.controls.actor_toggle.off": "UNLOCALIZED: Off", + "create.contraption.controls.floor_unreachable": "UNLOCALIZED: Unreachable", "create.display_link.set": "已選定目標位置", "create.display_link.success": "成功綁定到目標位置", diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/actors/controls/ContraptionControlsMovement.java b/src/main/java/com/simibubi/create/content/contraptions/components/actors/controls/ContraptionControlsMovement.java index 7aa0dec3a..ecac443ee 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/actors/controls/ContraptionControlsMovement.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/actors/controls/ContraptionControlsMovement.java @@ -1,34 +1,20 @@ package com.simibubi.create.content.contraptions.components.actors.controls; -import java.util.Random; - import com.jozufozu.flywheel.core.virtual.VirtualRenderWorld; -import com.jozufozu.flywheel.util.transform.TransformStack; -import com.mojang.blaze3d.vertex.PoseStack; -import com.simibubi.create.AllBlocks; import com.simibubi.create.content.contraptions.components.structureMovement.Contraption; import com.simibubi.create.content.contraptions.components.structureMovement.MovementBehaviour; import com.simibubi.create.content.contraptions.components.structureMovement.MovementContext; import com.simibubi.create.content.contraptions.components.structureMovement.elevator.ElevatorContraption; import com.simibubi.create.content.contraptions.components.structureMovement.render.ContraptionMatrices; -import com.simibubi.create.content.logistics.block.redstone.NixieTubeRenderer; -import com.simibubi.create.foundation.utility.AngleHelper; -import com.simibubi.create.foundation.utility.AnimationTickHolder; -import com.simibubi.create.foundation.utility.Color; import com.simibubi.create.foundation.utility.Couple; -import com.simibubi.create.foundation.utility.DyeHelper; import com.simibubi.create.foundation.utility.IntAttached; +import com.simibubi.create.foundation.utility.Lang; import com.simibubi.create.foundation.utility.animation.LerpedFloat; import com.simibubi.create.foundation.utility.animation.LerpedFloat.Chaser; -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.Font; import net.minecraft.client.renderer.MultiBufferSource; -import net.minecraft.core.Direction; import net.minecraft.nbt.CompoundTag; import net.minecraft.util.Mth; -import net.minecraft.world.entity.Entity; -import net.minecraft.world.item.DyeColor; import net.minecraft.world.item.ItemStack; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; @@ -61,8 +47,6 @@ public class ContraptionControlsMovement implements MovementBehaviour { return ItemHandlerHelper.canItemStacksStack(stack1, stack2); } - private static Random r = new Random(); - public static ItemStack getFilter(MovementContext ctx) { CompoundTag tileData = ctx.tileData; if (tileData == null) @@ -148,6 +132,10 @@ public class ContraptionControlsMovement implements MovementBehaviour { efs.currentLongName = entry.getSecond() .getSecond(); efs.targetYEqualsSelection = efs.currentTargetY == ec.clientYTarget; + + if (ec.isTargetUnreachable(efs.currentTargetY)) + efs.currentLongName = Lang.translate("contraption.controls.floor_unreachable") + .string(); } @Override @@ -159,73 +147,7 @@ public class ContraptionControlsMovement implements MovementBehaviour { @OnlyIn(Dist.CLIENT) public void renderInContraption(MovementContext ctx, VirtualRenderWorld renderWorld, ContraptionMatrices matrices, MultiBufferSource buffer) { - - if (!(ctx.temporaryData instanceof ElevatorFloorSelection efs)) - return; - if (!AllBlocks.CONTRAPTION_CONTROLS.has(ctx.state)) - return; - - Entity cameraEntity = Minecraft.getInstance() - .getCameraEntity(); - float playerDistance = (float) (ctx.position == null || cameraEntity == null ? 0 - : ctx.position.distanceToSqr(cameraEntity.getEyePosition())); - - float flicker = r.nextFloat(); - Couple couple = DyeHelper.DYE_TABLE.get(efs.targetYEqualsSelection ? DyeColor.WHITE : DyeColor.ORANGE); - int brightColor = couple.getFirst(); - int darkColor = couple.getSecond(); - int flickeringBrightColor = Color.mixColors(brightColor, darkColor, flicker / 4); - Font fontRenderer = Minecraft.getInstance().font; - float shadowOffset = .5f; - - String text = efs.currentShortName; - String description = efs.currentLongName; - PoseStack ms = matrices.getViewProjection(); - TransformStack msr = TransformStack.cast(ms); - - ms.pushPose(); - msr.translate(ctx.localPos); - msr.rotateCentered(Direction.UP, - AngleHelper.rad(AngleHelper.horizontalAngle(ctx.state.getValue(ContraptionControlsBlock.FACING)))); - ms.translate(0.275f + 0.125f, 1, 0.5f); - msr.rotate(Direction.WEST, AngleHelper.rad(67.5f)); - - float buttondepth = -.25f; - if (ctx.contraption.presentTileEntities.get(ctx.localPos)instanceof ContraptionControlsTileEntity cte) - buttondepth += -1 / 24f * cte.button.getValue(AnimationTickHolder.getPartialTicks(renderWorld)); - - if (!text.isBlank() && playerDistance < 100) { - int actualWidth = fontRenderer.width(text); - int width = Math.max(actualWidth, 12); - float scale = 1 / (5f * (width - .5f)); - float heightCentering = (width - 8f) / 2; - - ms.pushPose(); - ms.translate(0, .15f, buttondepth); - ms.scale(scale, -scale, scale); - ms.translate(Math.max(0, width - actualWidth) / 2, heightCentering, 0); - NixieTubeRenderer.drawInWorldString(ms, buffer, text, flickeringBrightColor); - ms.translate(shadowOffset, shadowOffset, -1 / 16f); - NixieTubeRenderer.drawInWorldString(ms, buffer, text, Color.mixColors(darkColor, 0, .35f)); - ms.popPose(); - } - - if (!description.isBlank() && playerDistance < 20) { - int actualWidth = fontRenderer.width(description); - int width = Math.max(actualWidth, 55); - float scale = 1 / (3f * (width - .5f)); - float heightCentering = (width - 8f) / 2; - - ms.pushPose(); - ms.translate(-.0635f, 0.06f, buttondepth); - ms.scale(scale, -scale, scale); - ms.translate(Math.max(0, width - actualWidth) / 2, heightCentering, 0); - NixieTubeRenderer.drawInWorldString(ms, buffer, description, flickeringBrightColor); - ms.popPose(); - } - - ms.popPose(); - + ContraptionControlsRenderer.renderInContraption(ctx, renderWorld, matrices, buffer); } public static class ElevatorFloorSelection { diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/actors/controls/ContraptionControlsRenderer.java b/src/main/java/com/simibubi/create/content/contraptions/components/actors/controls/ContraptionControlsRenderer.java index 31d8838d6..a48f914fa 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/actors/controls/ContraptionControlsRenderer.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/actors/controls/ContraptionControlsRenderer.java @@ -1,23 +1,42 @@ package com.simibubi.create.content.contraptions.components.actors.controls; +import java.util.Random; + +import com.jozufozu.flywheel.core.virtual.VirtualRenderWorld; +import com.jozufozu.flywheel.util.transform.TransformStack; import com.mojang.blaze3d.vertex.PoseStack; import com.mojang.blaze3d.vertex.VertexConsumer; import com.simibubi.create.AllBlockPartials; +import com.simibubi.create.AllBlocks; +import com.simibubi.create.content.contraptions.components.actors.controls.ContraptionControlsMovement.ElevatorFloorSelection; +import com.simibubi.create.content.contraptions.components.structureMovement.MovementContext; +import com.simibubi.create.content.contraptions.components.structureMovement.render.ContraptionMatrices; +import com.simibubi.create.content.logistics.block.redstone.NixieTubeRenderer; import com.simibubi.create.foundation.render.CachedBufferer; import com.simibubi.create.foundation.tileEntity.renderer.SmartTileEntityRenderer; import com.simibubi.create.foundation.utility.AngleHelper; +import com.simibubi.create.foundation.utility.AnimationTickHolder; +import com.simibubi.create.foundation.utility.Color; +import com.simibubi.create.foundation.utility.Couple; +import com.simibubi.create.foundation.utility.DyeHelper; import com.simibubi.create.foundation.utility.VecHelper; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.Font; import net.minecraft.client.renderer.MultiBufferSource; import net.minecraft.client.renderer.RenderType; import net.minecraft.client.renderer.blockentity.BlockEntityRendererProvider.Context; import net.minecraft.core.Direction; import net.minecraft.core.Direction.Axis; +import net.minecraft.world.entity.Entity; +import net.minecraft.world.item.DyeColor; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.phys.Vec3; public class ContraptionControlsRenderer extends SmartTileEntityRenderer { + private static Random r = new Random(); + public ContraptionControlsRenderer(Context context) { super(context); } @@ -34,18 +53,88 @@ public class ContraptionControlsRenderer extends SmartTileEntityRenderer couple = DyeHelper.DYE_TABLE.get(efs.targetYEqualsSelection ? DyeColor.WHITE : DyeColor.ORANGE); + int brightColor = couple.getFirst(); + int darkColor = couple.getSecond(); + int flickeringBrightColor = Color.mixColors(brightColor, darkColor, flicker / 4); + Font fontRenderer = Minecraft.getInstance().font; + float shadowOffset = .5f; + + String text = efs.currentShortName; + String description = efs.currentLongName; + PoseStack ms = matrices.getViewProjection(); + TransformStack msr = TransformStack.cast(ms); + + ms.pushPose(); + msr.translate(ctx.localPos); + msr.rotateCentered(Direction.UP, + AngleHelper.rad(AngleHelper.horizontalAngle(ctx.state.getValue(ContraptionControlsBlock.FACING)))); + ms.translate(0.275f + 0.125f, 1, 0.5f); + msr.rotate(Direction.WEST, AngleHelper.rad(67.5f)); + + float buttondepth = -.25f; + if (ctx.contraption.presentTileEntities.get(ctx.localPos)instanceof ContraptionControlsTileEntity cte) + buttondepth += -1 / 24f * cte.button.getValue(AnimationTickHolder.getPartialTicks(renderWorld)); + + if (!text.isBlank() && playerDistance < 100) { + int actualWidth = fontRenderer.width(text); + int width = Math.max(actualWidth, 12); + float scale = 1 / (5f * (width - .5f)); + float heightCentering = (width - 8f) / 2; + + ms.pushPose(); + ms.translate(0, .15f, buttondepth); + ms.scale(scale, -scale, scale); + ms.translate(Math.max(0, width - actualWidth) / 2, heightCentering, 0); + NixieTubeRenderer.drawInWorldString(ms, buffer, text, flickeringBrightColor); + ms.translate(shadowOffset, shadowOffset, -1 / 16f); + NixieTubeRenderer.drawInWorldString(ms, buffer, text, Color.mixColors(darkColor, 0, .35f)); + ms.popPose(); + } + + if (!description.isBlank() && playerDistance < 20) { + int actualWidth = fontRenderer.width(description); + int width = Math.max(actualWidth, 55); + float scale = 1 / (3f * (width - .5f)); + float heightCentering = (width - 8f) / 2; + + ms.pushPose(); + ms.translate(-.0635f, 0.06f, buttondepth); + ms.scale(scale, -scale, scale); + ms.translate(Math.max(0, width - actualWidth) / 2, heightCentering, 0); + NixieTubeRenderer.drawInWorldString(ms, buffer, description, flickeringBrightColor); + ms.popPose(); + } + + ms.popPose(); } diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/AbstractContraptionEntity.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/AbstractContraptionEntity.java index 0fb21b5f3..02b952a59 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/AbstractContraptionEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/AbstractContraptionEntity.java @@ -24,6 +24,7 @@ import com.simibubi.create.Create; import com.simibubi.create.content.contraptions.components.actors.PortableStorageInterfaceMovement; import com.simibubi.create.content.contraptions.components.actors.SeatBlock; import com.simibubi.create.content.contraptions.components.actors.SeatEntity; +import com.simibubi.create.content.contraptions.components.structureMovement.elevator.ElevatorContraption; import com.simibubi.create.content.contraptions.components.structureMovement.glue.SuperGlueEntity; import com.simibubi.create.content.contraptions.components.structureMovement.interaction.controls.ControlsStopControllingPacket; import com.simibubi.create.content.contraptions.components.structureMovement.mounted.MountedContraption; @@ -129,7 +130,7 @@ public abstract class AbstractContraptionEntity extends Entity implements IEntit } public boolean supportsTerrainCollision() { - return contraption instanceof TranslatingContraption; + return contraption instanceof TranslatingContraption && !(contraption instanceof ElevatorContraption); } protected void contraptionInitialize() { diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/elevator/ElevatorContactBlock.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/elevator/ElevatorContactBlock.java index f0e3c7df0..c0e48e3e8 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/elevator/ElevatorContactBlock.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/elevator/ElevatorContactBlock.java @@ -173,6 +173,11 @@ public class ElevatorContactBlock extends WrenchableDirectionalBlock @Override public int getSignal(BlockState state, BlockGetter blockAccess, BlockPos pos, Direction side) { + if (side == null) + return 0; + BlockState toState = blockAccess.getBlockState(pos.relative(side.getOpposite())); + if (toState.is(this)) + return 0; return state.getValue(POWERING) ? 15 : 0; } @@ -209,7 +214,7 @@ public class ElevatorContactBlock extends WrenchableDirectionalBlock if (player instanceof LocalPlayer) ScreenOpener.open(new ElevatorContactScreen(te.getBlockPos(), te.shortName, te.longName)); } - + public static int getLight(BlockState state) { return state.getValue(POWERING) ? 10 : state.getValue(CALLING) ? 5 : 0; } diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/elevator/ElevatorContraption.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/elevator/ElevatorContraption.java index c33b8e7f0..46e9c4486 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/elevator/ElevatorContraption.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/elevator/ElevatorContraption.java @@ -39,6 +39,9 @@ public class ElevatorContraption extends PulleyContraption { private int namesListVersion = -1; public List>> namesList = ImmutableList.of(); public int clientYTarget; + + public int maxContactY; + public int minContactY; // during assembly only private int contacts; @@ -84,7 +87,14 @@ public class ElevatorContraption extends PulleyContraption { ElevatorColumn column = ElevatorColumn.get(level, coords); if (column == null) return null; - return column.targetedYLevel; + int targetedYLevel = column.targetedYLevel; + if (isTargetUnreachable(targetedYLevel)) + return null; + return targetedYLevel; + } + + public boolean isTargetUnreachable(int contactY) { + return contactY < minContactY || contactY > maxContactY; } @Override @@ -94,9 +104,14 @@ public class ElevatorContraption extends PulleyContraption { if (blocks.size() <= 0) return false; if (contacts == 0) - throw new AssemblyException(Lang.translateDirect("elevator_assembly.no_contacts")); + throw new AssemblyException(Lang.translateDirect("gui.assembly.exception.no_contacts")); if (contacts > 1) - throw new AssemblyException(Lang.translateDirect("train_assembly.too_many_contacts")); + throw new AssemblyException(Lang.translateDirect("gui.assembly.exception.too_many_contacts")); + + ElevatorColumn column = ElevatorColumn.get(world, getGlobalColumn()); + if (column != null && column.isActive()) + throw new AssemblyException(Lang.translateDirect("gui.assembly.exception.column_conflict")); + startMoving(world); return true; } @@ -138,6 +153,8 @@ public class ElevatorContraption extends PulleyContraption { tag.putBoolean("Arrived", arrived); tag.put("Column", column.write()); tag.putInt("ContactY", contactYOffset); + tag.putInt("MaxContactY", maxContactY); + tag.putInt("MinContactY", minContactY); return tag; } @@ -146,6 +163,8 @@ public class ElevatorContraption extends PulleyContraption { arrived = nbt.getBoolean("Arrived"); column = ColumnCoords.read(nbt.getCompound("Column")); contactYOffset = nbt.getInt("ContactY"); + maxContactY = nbt.getInt("MaxContactY"); + minContactY = nbt.getInt("MinContactY"); super.readNBT(world, nbt, spawnData); } diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/elevator/ElevatorPulleyTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/elevator/ElevatorPulleyTileEntity.java index a9175c9f7..1d15767c1 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/elevator/ElevatorPulleyTileEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/elevator/ElevatorPulleyTileEntity.java @@ -74,6 +74,7 @@ public class ElevatorPulleyTileEntity extends PulleyTileEntity { if (level.isClientSide()) ec.setClientYTarget(worldPosition.getY() - clientOffsetTarget + ec.contactYOffset - 1); + waitingForSpeedChange = false; ec.arrived = wasArrived; if (!arrived) @@ -269,6 +270,8 @@ public class ElevatorPulleyTileEntity extends PulleyTileEntity { contraption.removeBlocksFromWorld(level, BlockPos.ZERO); movedContraption = ControlledContraptionEntity.create(level, this, contraption); movedContraption.setPos(anchor.getX(), anchor.getY(), anchor.getZ()); + contraption.maxContactY = worldPosition.getY() + contraption.contactYOffset - 1; + contraption.minContactY = contraption.maxContactY - maxLength; level.addFreshEntity(movedContraption); forceMove = true; needsContraption = true; diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/elevator/ElevatorTargetFloorPacket.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/elevator/ElevatorTargetFloorPacket.java index 5a9e15b45..09d63dd87 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/elevator/ElevatorTargetFloorPacket.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/elevator/ElevatorTargetFloorPacket.java @@ -53,6 +53,8 @@ public class ElevatorTargetFloorPacket extends SimplePacketBase { ElevatorColumn elevatorColumn = ElevatorColumn.get(level, ec.getGlobalColumn()); if (!elevatorColumn.contacts.contains(targetY)) return; + if (ec.isTargetUnreachable(targetY)) + return; for (BlockPos otherPos : elevatorColumn.getContacts()) { BlockState otherState = level.getBlockState(otherPos); diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/piston/LinearActuatorTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/piston/LinearActuatorTileEntity.java index 5379103c2..fe89f8bda 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/piston/LinearActuatorTileEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/piston/LinearActuatorTileEntity.java @@ -71,7 +71,6 @@ public abstract class LinearActuatorTileEntity extends KineticTileEntity if (level.isClientSide) clientOffsetDiff *= .75f; - waitingForSpeedChange = false;//TODO if (waitingForSpeedChange) { if (movedContraption != null) { if (level.isClientSide) { diff --git a/src/main/resources/assets/create/lang/default/interface.json b/src/main/resources/assets/create/lang/default/interface.json index 8c7a2aab4..791f99267 100644 --- a/src/main/resources/assets/create/lang/default/interface.json +++ b/src/main/resources/assets/create/lang/default/interface.json @@ -220,6 +220,9 @@ "create.gui.assembly.exception.tooManyPistonPoles": "There are too many extension Poles attached to this Piston.\nThe configured maximum is: %1$s", "create.gui.assembly.exception.noPistonPoles": "The Piston is missing some extension Poles", "create.gui.assembly.exception.not_enough_sails": "Attached structure does not include enough sail-like blocks: %1$s\nA minimum of %2$s are required", + "create.gui.assembly.exception.no_contacts": "Elevators require a horizontal _Redstone_ _Contact_ attached to the structure", + "create.gui.assembly.exception.too_many_contacts": "Cannot attach more than one _Redstone_ _Contact_ to Elevators", + "create.gui.assembly.exception.column_conflict": "Another Elevator is already targeting this column of contacts", "create.gui.gauge.info_header": "Gauge Information:", "create.gui.speedometer.title": "Rotation Speed", @@ -807,6 +810,7 @@ "create.contraption.controls.all_actor_toggle": "All Actors: %1$s", "create.contraption.controls.actor_toggle.on": "On", "create.contraption.controls.actor_toggle.off": "Off", + "create.contraption.controls.floor_unreachable": "Unreachable", "create.display_link.set": "Targeted position selected", "create.display_link.success": "Successfully bound to targeted position", diff --git a/src/main/resources/assets/create/textures/block/contraption_controls_frame.png b/src/main/resources/assets/create/textures/block/contraption_controls_frame.png index 80d302af23355a35021018c76c585fa6da353e7f..e42877d8204b80ceb60e6022066c6662f89423c3 100644 GIT binary patch delta 526 zcmV+p0`dLO8qpfCVgf2a0Rd!WWLH;LSOEb^0|hJw0A*!mM@C0PLqz}p0E%KwRR910 zLv&J3QRA@ z<|b^^fihT%0l`AurYTIpB=3ylCw#%dVf>d`n>Q=$Pw!vh5C;pASc=|oTUgn-cSK$6Vn^BEnk z&XWX0S~QZx18Mr;hAR(LQikqCW9EU{E?8|BYNW{Yuis>Hbf=gM4G%<}=+9%TP37si z-R%4Y4F5e)Gl^$Ra(QC1JbkS50K7qX?FIn<-hWG>kI7L4lqo6_#bp3cqLe6v01(Dl zYpko*U|53i;w}Q1vDt!@=UH|H$|=DCxHQ>fwO+6C%q%6VfKo_fvo(t~X=OHBcATLQ zm*io)vjvdb-KN@w2S5VDoy~H$#NOJSr~|;reV*t0{XWZVZ3YA;-)!>);LhaXa7gKQ zm_NOwFYlSe*NGA*04>3#`{F{1UOlK%1R&+7N>t4QEg_32`9xJO%L5$$1IiDR4xHls QmH+?%07*qoM6N<$f(hI4DgXcg delta 525 zcmV+o0`mRQ8qgZBVgf338bM@aWLH;Lk0MNh9!F#oHf3dHM@C0PLqz}p03>c7xBvhE zLv&J3Q4wIaaK@Id$Ss&{>J+wJ|jx$1Qc@9_FpSlhXu#0$0KvLH`mNP?q{n(hKxlX%NhZ_jgbr7y zNdh7*8cE`TG<|Txl?N&*LwBMv@jz`CthNg^P-Ob?iA)ae6_cUifv6KbzqHy^UjMY4 zoj1Vn-vc$1_>D;}4@{P)|Lc1Iz977I1Au?;rGL=JWG@2B6cvf$G5{!1N)$o>2xF`@ z)>UgTEJ1j27Xi%JY(~oSEZYO+l;8lIn{2jNE*E)b=8{!FDWtJlo7s}IFsn7&&rpa< z^04060?6%rRqet9Ac5h=X1QBpYwbqV0bt}l&-3ken`O2(0|Jv@ws`<>XL7gOrS#iP z-aga!f0@M3i4q3@Ey1Px;zEi(J*ZLyAmyh@RLuh|A&V&aL{%@#104SX#DkLwO>#ce P00000NkvXXu0mjf$-VD9 diff --git a/src/main/resources/assets/create/textures/block/contraption_controls_indicator.png b/src/main/resources/assets/create/textures/block/contraption_controls_indicator.png index 33f1fdd9dd263d21950efdf7d9a0b1c82bbed727..4f14eaae39c333753eb643696382024c5b2c76b6 100644 GIT binary patch delta 253 zcmVMKmh@u003A40Z9V|(EtFv001lo0C)fZKo=PR007)W%`TJW z0VN8-000ib0l1NC?XwgDtq6aoNklkdB&2a5s7Kq8Mr{wv=9xm+y#Ei!Q=Frn#sZbQ(eXYkZF)OoARq|D~4yg@t4jHpnt$Ko=hb@-yGSuc+h+T)*_Ic? zOeIW#`Xv|uH2c{Y!D-YafQ5bmwk1csCMSRo+6R1SDLVeJ1;tH(kZ`|1>s#7#k+PN? z1xURoVrnUuUY9HYqP}2^9LlKqDQ$lpcYyzT5a8fpo}0aln!PYE&%Hr<(e~GI2l$1D zK6g+L+85NrJomaE3>-X6`@z5~JdC-|J