From c1ba7683a710eb7729f063f78e89be59e20153a2 Mon Sep 17 00:00:00 2001 From: PepperCode1 <44146161+PepperCode1@users.noreply.github.com> Date: Tue, 29 Mar 2022 21:49:23 -0700 Subject: [PATCH] Miscellaneous fixes and improvements - Fix ColorAttribute not showing color name - Refactor some code related to SpeedLevel - Improve goggles predicate API - Make ToolboxInventory use Item#canFitInsideContainerItems - Prevent toolbox items from being placed inside of shulker boxes - Fix shadow steel always converting below y=0 instead of the min build height --- .github/ISSUE_TEMPLATE/bug_report.yml | 10 +- .github/ISSUE_TEMPLATE/suggestion.yml | 6 +- src/generated/resources/.cache/cache | 30 ++--- .../resources/assets/create/lang/en_us.json | 3 +- .../assets/create/lang/unfinished/de_de.json | 5 +- .../assets/create/lang/unfinished/es_cl.json | 5 +- .../assets/create/lang/unfinished/es_es.json | 5 +- .../assets/create/lang/unfinished/fr_fr.json | 5 +- .../assets/create/lang/unfinished/it_it.json | 5 +- .../assets/create/lang/unfinished/ja_jp.json | 5 +- .../assets/create/lang/unfinished/ko_kr.json | 5 +- .../assets/create/lang/unfinished/nl_nl.json | 5 +- .../assets/create/lang/unfinished/pl_pl.json | 5 +- .../assets/create/lang/unfinished/pt_br.json | 5 +- .../assets/create/lang/unfinished/pt_pt.json | 5 +- .../assets/create/lang/unfinished/ru_ru.json | 5 +- .../assets/create/lang/unfinished/zh_cn.json | 5 +- .../assets/create/lang/unfinished/zh_tw.json | 5 +- .../java/com/simibubi/create/AllBlocks.java | 3 +- .../com/simibubi/create/AllEntityTypes.java | 2 +- .../content/contraptions/base/IRotate.java | 103 ++++++++++-------- .../contraptions/base/KineticTileEntity.java | 8 +- .../crafter/MechanicalCrafterBlock.java | 12 +- .../structureMovement/Contraption.java | 1 + .../NonStationaryLighter.java | 1 + .../OrientedContraptionEntityRenderer.java | 2 + .../bearing/AnchoredLighter.java | 2 +- .../bearing/BearingContraption.java | 2 +- .../bearing/ClockworkContraption.java | 2 +- .../bearing/StabilizedContraption.java | 2 +- .../gantry/GantryContraption.java | 2 +- .../mounted/MountedContraption.java | 2 +- .../piston/PistonContraption.java | 2 +- .../piston/PistonLighter.java | 2 +- .../pulley/PulleyContraption.java | 2 +- .../pulley/PulleyLighter.java | 2 +- .../ContraptionEntityRenderer.java | 5 +- .../{ => render}/ContraptionLighter.java | 3 +- .../render/EmptyLighter.java | 1 - .../render/FlwContraption.java | 1 - .../goggles/GoggleOverlayRenderer.java | 17 +-- .../contraptions/goggles/GogglesItem.java | 25 ++++- .../particle/RotationIndicatorParticle.java | 2 +- .../relays/gauge/SpeedGaugeTileEntity.java | 5 +- .../relays/gauge/StressGaugeTileEntity.java | 4 +- .../curiosities/ChromaticCompoundItem.java | 12 +- .../curiosities/toolbox/ToolboxInventory.java | 10 +- .../item/filter/attribute/ColorAttribute.java | 4 +- .../foundation/item/ItemDescription.java | 25 ++--- .../create/foundation/item/TooltipHelper.java | 9 +- .../item/UncontainableBlockItem.java | 15 +++ .../EdgeInteractionBehaviour.java | 2 +- .../EdgeInteractionHandler.java | 4 +- .../resources/assets/create/lang/de_de.json | 2 +- .../assets/create/lang/default/interface.json | 5 +- .../resources/assets/create/lang/es_cl.json | 2 +- .../resources/assets/create/lang/es_es.json | 2 +- .../resources/assets/create/lang/fr_fr.json | 2 +- .../resources/assets/create/lang/it_it.json | 2 +- .../resources/assets/create/lang/ja_jp.json | 2 +- .../resources/assets/create/lang/ko_kr.json | 2 +- .../resources/assets/create/lang/nl_nl.json | 2 +- .../resources/assets/create/lang/pl_pl.json | 2 +- .../resources/assets/create/lang/ru_ru.json | 2 +- .../resources/assets/create/lang/zh_cn.json | 2 +- .../resources/assets/create/lang/zh_tw.json | 2 +- 66 files changed, 240 insertions(+), 204 deletions(-) rename src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/{ => render}/ContraptionEntityRenderer.java (90%) rename src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/{ => render}/ContraptionLighter.java (94%) create mode 100644 src/main/java/com/simibubi/create/foundation/item/UncontainableBlockItem.java diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index e4ebb27c6..95883df8e 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -11,7 +11,7 @@ body: - type: textarea attributes: label: Reproduction Steps - description: Tell us about the steps to reproduce the bug + description: Tell us about the steps to reproduce the bug. value: | 1. 2. @@ -28,13 +28,13 @@ body: - type: textarea attributes: label: Screenshots and Videos - description: If applicable, add screenshots or videos to help explain your problem + description: If applicable, add screenshots or videos to help explain your problem. validations: required: false - type: input attributes: label: Crash Report or Log - description: If applicable, please add a **link** to the crash report or log that was created when this issue occured. You can upload the crash report to a site like Pastebin or GitHub Gist. Please **do not** paste the whole crash report in this issue + description: If applicable, please add a **link** to the crash report or log that was created when this issue occured. You can upload the crash report to a site like Pastebin or GitHub Gist. Please **do not** paste the whole crash report in this issue. validations: required: false - type: input @@ -121,7 +121,7 @@ body: - type: textarea attributes: label: Other Mods - description: Please list any other mods that were running when the crash happened + description: Please list any other mods that were running when the crash happened. validations: required: false - type: textarea @@ -132,4 +132,4 @@ body: required: false - type: markdown attributes: - value: "Thank you for taking the time to make this bug report and to help improve Create" + value: "Thank you for taking the time to make this bug report and help improve Create!" diff --git a/.github/ISSUE_TEMPLATE/suggestion.yml b/.github/ISSUE_TEMPLATE/suggestion.yml index cd38b4ed8..3a460558b 100644 --- a/.github/ISSUE_TEMPLATE/suggestion.yml +++ b/.github/ISSUE_TEMPLATE/suggestion.yml @@ -11,15 +11,15 @@ body: - type: textarea attributes: label: Screenshots and Videos - description: If applicable, add screenshots or videos to help explain your suggestion + description: If applicable, add screenshots or videos to help explain your suggestion. validations: required: false - type: textarea attributes: label: Additional Context - description: Add any extra context about the suggestion here + description: Add any extra context about the suggestion here. validations: required: false - type: markdown attributes: - value: "Thank you for taking the time to make this suggestion and to help improve Create" + value: "Thank you for taking the time to make this suggestion and help improve Create!" diff --git a/src/generated/resources/.cache/cache b/src/generated/resources/.cache/cache index 04f1d9048..32f00ab25 100644 --- a/src/generated/resources/.cache/cache +++ b/src/generated/resources/.cache/cache @@ -531,21 +531,21 @@ bf2b0310500213ff853c748c236eb5d01f61658e assets/create/blockstates/yellow_toolbo 7f39521b211441f5c3e06d60c5978cebe16cacfb assets/create/blockstates/zinc_block.json b7181bcd8182b2f17088e5aa881f374c9c65470c assets/create/blockstates/zinc_ore.json 7880ce16e8b649e26d01cecee271648027f26651 assets/create/lang/en_ud.json -aca02d2ab91e288e65e07470a117ace325299130 assets/create/lang/en_us.json -64aa458040affc16c4412297cdb5ee13ad010660 assets/create/lang/unfinished/de_de.json -7f36bcf491d6890a563c8d03c281e300576f446d assets/create/lang/unfinished/es_cl.json -0c44dc2a7f3157c463a26900ec75b0278b372cc9 assets/create/lang/unfinished/es_es.json -ee7d298b7234ba25b373eb9d9f2a3ec52aeca233 assets/create/lang/unfinished/fr_fr.json -e642827b0c2530c490f6a4961cba9f6d91d3783c assets/create/lang/unfinished/it_it.json -e92011006f03ed066b51eb5d03011a982589ff37 assets/create/lang/unfinished/ja_jp.json -6441efd98496beff0dcfbd15fd1dd20f5e26eaaf assets/create/lang/unfinished/ko_kr.json -2313eaab1f7eabd4d6d481c139e3fe84ebb4a1eb assets/create/lang/unfinished/nl_nl.json -5a35cb79c97578730d20f766a59443afe484ad03 assets/create/lang/unfinished/pl_pl.json -1112631bcb7d1503dec6e605ef1c4828a1726551 assets/create/lang/unfinished/pt_br.json -36b1368644fb946a97044610932e2a11ddf508b3 assets/create/lang/unfinished/pt_pt.json -8ffe7f27cd6fce29116f9e0920c792376545aa2c assets/create/lang/unfinished/ru_ru.json -967dd607e8784ad7d8851c18f89e32661543a394 assets/create/lang/unfinished/zh_cn.json -5cd389eba3817fc4d5cbaa0ce15ccdb7fbe6c0bf assets/create/lang/unfinished/zh_tw.json +194fbc2c94d07a5fc1712c8b579973e92fafa5d8 assets/create/lang/en_us.json +a711143e849fdc488e43e8eb284248955bbf1ceb assets/create/lang/unfinished/de_de.json +f5218855767129457b3e10ae1d7c254b5af29f27 assets/create/lang/unfinished/es_cl.json +92882d65db2ee109a3e79d4156277f925f4a387c assets/create/lang/unfinished/es_es.json +02f3a6a3a281d59489cb0c02db249aaff7aaa433 assets/create/lang/unfinished/fr_fr.json +fd2eb2cc4987ae9ddadd6452fc853091b6a93982 assets/create/lang/unfinished/it_it.json +64d40f6fb9a873b8c107b82236f0b8fddc010c72 assets/create/lang/unfinished/ja_jp.json +7b680aca19dd1b015e72c1af91f388313eabcfac assets/create/lang/unfinished/ko_kr.json +bae90b8439e02d2f97f0eb65f2261e4e0d80aea5 assets/create/lang/unfinished/nl_nl.json +d640931ab5f23128910228880a4beccd45af3cce assets/create/lang/unfinished/pl_pl.json +f2ecb8fdd15cd042198d50e25b9dcafc9409423e assets/create/lang/unfinished/pt_br.json +0baffa79e99e78a81d9933c44aeefe6282e634ea assets/create/lang/unfinished/pt_pt.json +c77ae5ebbbd4ead7a641b9a2bf8b17073e73ecb9 assets/create/lang/unfinished/ru_ru.json +9acc0e92774c0e4b6207f08d3a85a81b1a7a0734 assets/create/lang/unfinished/zh_cn.json +60b348950274d79f267ae8e6283e5a23a6c65720 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 6198ed78e..1600360ad 100644 --- a/src/generated/resources/assets/create/lang/en_us.json +++ b/src/generated/resources/assets/create/lang/en_us.json @@ -1231,8 +1231,9 @@ "create.tooltip.keyCtrl": "Ctrl", "create.tooltip.speedRequirement": "Speed Requirement: %1$s", "create.tooltip.speedRequirement.none": "None", + "create.tooltip.speedRequirement.slow": "Slow", "create.tooltip.speedRequirement.medium": "Moderate", - "create.tooltip.speedRequirement.high": "Fast", + "create.tooltip.speedRequirement.fast": "Fast", "create.tooltip.stressImpact": "Kinetic Stress Impact: %1$s", "create.tooltip.stressImpact.low": "Low", "create.tooltip.stressImpact.medium": "Moderate", 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 078550333..babfd23bf 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: 1324", + "_": "Missing Localizations: 1325", "_": "->------------------------] Game Elements [------------------------<-", @@ -1232,8 +1232,9 @@ "create.tooltip.keyCtrl": "Strg", "create.tooltip.speedRequirement": "Geschwindigkeitsanforderung: %1$s", "create.tooltip.speedRequirement.none": "Keine", + "create.tooltip.speedRequirement.slow": "UNLOCALIZED: Slow", "create.tooltip.speedRequirement.medium": "Moderat", - "create.tooltip.speedRequirement.high": "Schnell", + "create.tooltip.speedRequirement.fast": "Schnell", "create.tooltip.stressImpact": "Kinetische Belastungsauswirkung: %1$s", "create.tooltip.stressImpact.low": "Niedrig", "create.tooltip.stressImpact.medium": "Moderat", 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 0d445ef6d..f07240362 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: 335", + "_": "Missing Localizations: 336", "_": "->------------------------] Game Elements [------------------------<-", @@ -1232,8 +1232,9 @@ "create.tooltip.keyCtrl": "Ctrl", "create.tooltip.speedRequirement": "Requqrimiento de Velocidad: %1$s", "create.tooltip.speedRequirement.none": "Ninguno", + "create.tooltip.speedRequirement.slow": "UNLOCALIZED: Slow", "create.tooltip.speedRequirement.medium": "Moderado", - "create.tooltip.speedRequirement.high": "Rápidp", + "create.tooltip.speedRequirement.fast": "Rápido", "create.tooltip.stressImpact": "Impacto en el Estrés Cinético: %1$s", "create.tooltip.stressImpact.low": "Bajo", "create.tooltip.stressImpact.medium": "Moderado", 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 f69d63309..23244a9c2 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: 6", + "_": "Missing Localizations: 7", "_": "->------------------------] Game Elements [------------------------<-", @@ -1232,8 +1232,9 @@ "create.tooltip.keyCtrl": "Ctrl", "create.tooltip.speedRequirement": "Requisitos de velocidad: %1$s", "create.tooltip.speedRequirement.none": "Ninguno", + "create.tooltip.speedRequirement.slow": "UNLOCALIZED: Slow", "create.tooltip.speedRequirement.medium": "Moderado", - "create.tooltip.speedRequirement.high": "Rápido", + "create.tooltip.speedRequirement.fast": "Rápido", "create.tooltip.stressImpact": "Impacto de estrés: %1$s", "create.tooltip.stressImpact.low": "Bajo", "create.tooltip.stressImpact.medium": "Moderado", 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 a8b4ed9da..b183b25bf 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: 1586", + "_": "Missing Localizations: 1587", "_": "->------------------------] Game Elements [------------------------<-", @@ -1232,8 +1232,9 @@ "create.tooltip.keyCtrl": "Ctrl", "create.tooltip.speedRequirement": "Vitesse requise: %1$s", "create.tooltip.speedRequirement.none": "Aucune", + "create.tooltip.speedRequirement.slow": "UNLOCALIZED: Slow", "create.tooltip.speedRequirement.medium": "Modérée", - "create.tooltip.speedRequirement.high": "Rapide", + "create.tooltip.speedRequirement.fast": "Rapide", "create.tooltip.stressImpact": "Impact du stress: %1$s", "create.tooltip.stressImpact.low": "Faible", "create.tooltip.stressImpact.medium": "Modéré", 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 59111a369..08eff7c05 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: 1275", + "_": "Missing Localizations: 1276", "_": "->------------------------] Game Elements [------------------------<-", @@ -1232,8 +1232,9 @@ "create.tooltip.keyCtrl": "Ctrl", "create.tooltip.speedRequirement": "Velocità richiesta: %1$s", "create.tooltip.speedRequirement.none": "Nessuna", + "create.tooltip.speedRequirement.slow": "UNLOCALIZED: Slow", "create.tooltip.speedRequirement.medium": "Moderata", - "create.tooltip.speedRequirement.high": "Veloce", + "create.tooltip.speedRequirement.fast": "Veloce", "create.tooltip.stressImpact": "Impatto sullo stress: %1$s", "create.tooltip.stressImpact.low": "Basso", "create.tooltip.stressImpact.medium": "Moderato", 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 e43406f13..e77bf0009 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: 1", + "_": "Missing Localizations: 2", "_": "->------------------------] Game Elements [------------------------<-", @@ -1232,8 +1232,9 @@ "create.tooltip.keyCtrl": "Ctrl", "create.tooltip.speedRequirement": "必要な回転速度: %1$s", "create.tooltip.speedRequirement.none": "無し", + "create.tooltip.speedRequirement.slow": "UNLOCALIZED: Slow", "create.tooltip.speedRequirement.medium": "中速", - "create.tooltip.speedRequirement.high": "高速", + "create.tooltip.speedRequirement.fast": "高速", "create.tooltip.stressImpact": "応力への影響: %1$s", "create.tooltip.stressImpact.low": "低", "create.tooltip.stressImpact.medium": "中", 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 67151bd04..6883d6f0f 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: 1", + "_": "Missing Localizations: 2", "_": "->------------------------] Game Elements [------------------------<-", @@ -1232,8 +1232,9 @@ "create.tooltip.keyCtrl": "Ctrl", "create.tooltip.speedRequirement": "요구 회전속도: %1$s", "create.tooltip.speedRequirement.none": "없음", + "create.tooltip.speedRequirement.slow": "UNLOCALIZED: Slow", "create.tooltip.speedRequirement.medium": "보통", - "create.tooltip.speedRequirement.high": "빠름", + "create.tooltip.speedRequirement.fast": "빠름", "create.tooltip.stressImpact": "피로도 부하: %1$s", "create.tooltip.stressImpact.low": "낮음", "create.tooltip.stressImpact.medium": "보통", 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 8d6addeac..1faa90dde 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: 1939", + "_": "Missing Localizations: 1940", "_": "->------------------------] Game Elements [------------------------<-", @@ -1232,8 +1232,9 @@ "create.tooltip.keyCtrl": "Ctrl", "create.tooltip.speedRequirement": "Snelheid eis: %1$s", "create.tooltip.speedRequirement.none": "Geen", + "create.tooltip.speedRequirement.slow": "UNLOCALIZED: Slow", "create.tooltip.speedRequirement.medium": "Gemiddeld", - "create.tooltip.speedRequirement.high": "Snel", + "create.tooltip.speedRequirement.fast": "Snel", "create.tooltip.stressImpact": "Stress Impact: %1$s", "create.tooltip.stressImpact.low": "Laag", "create.tooltip.stressImpact.medium": "Gemiddeld", 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 2a7bee84e..310b5b82c 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: 374", + "_": "Missing Localizations: 375", "_": "->------------------------] Game Elements [------------------------<-", @@ -1232,8 +1232,9 @@ "create.tooltip.keyCtrl": "Ctrl", "create.tooltip.speedRequirement": "Wymagana prędkość: %1$s", "create.tooltip.speedRequirement.none": "Brak", + "create.tooltip.speedRequirement.slow": "UNLOCALIZED: Slow", "create.tooltip.speedRequirement.medium": "Umiarkowana", - "create.tooltip.speedRequirement.high": "Wysoka", + "create.tooltip.speedRequirement.fast": "Wysoka", "create.tooltip.stressImpact": "Wpływ na obciążenie: %1$s", "create.tooltip.stressImpact.low": "Niski", "create.tooltip.stressImpact.medium": "Umiarkowany", 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 edaca3809..c562404d3 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: 1186", + "_": "Missing Localizations: 1187", "_": "->------------------------] Game Elements [------------------------<-", @@ -1232,8 +1232,9 @@ "create.tooltip.keyCtrl": "UNLOCALIZED: Ctrl", "create.tooltip.speedRequirement": "UNLOCALIZED: Speed Requirement: %1$s", "create.tooltip.speedRequirement.none": "UNLOCALIZED: None", + "create.tooltip.speedRequirement.slow": "UNLOCALIZED: Slow", "create.tooltip.speedRequirement.medium": "UNLOCALIZED: Moderate", - "create.tooltip.speedRequirement.high": "UNLOCALIZED: Fast", + "create.tooltip.speedRequirement.fast": "UNLOCALIZED: Fast", "create.tooltip.stressImpact": "UNLOCALIZED: Kinetic Stress Impact: %1$s", "create.tooltip.stressImpact.low": "UNLOCALIZED: Low", "create.tooltip.stressImpact.medium": "UNLOCALIZED: Moderate", 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 1e7043d4b..561f13f94 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: 1558", + "_": "Missing Localizations: 1559", "_": "->------------------------] Game Elements [------------------------<-", @@ -1232,8 +1232,9 @@ "create.tooltip.keyCtrl": "UNLOCALIZED: Ctrl", "create.tooltip.speedRequirement": "UNLOCALIZED: Speed Requirement: %1$s", "create.tooltip.speedRequirement.none": "UNLOCALIZED: None", + "create.tooltip.speedRequirement.slow": "UNLOCALIZED: Slow", "create.tooltip.speedRequirement.medium": "UNLOCALIZED: Moderate", - "create.tooltip.speedRequirement.high": "UNLOCALIZED: Fast", + "create.tooltip.speedRequirement.fast": "UNLOCALIZED: Fast", "create.tooltip.stressImpact": "UNLOCALIZED: Kinetic Stress Impact: %1$s", "create.tooltip.stressImpact.low": "UNLOCALIZED: Low", "create.tooltip.stressImpact.medium": "UNLOCALIZED: Moderate", 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 37af0100f..1ace4144b 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: 379", + "_": "Missing Localizations: 380", "_": "->------------------------] Game Elements [------------------------<-", @@ -1232,8 +1232,9 @@ "create.tooltip.keyCtrl": "Ctrl", "create.tooltip.speedRequirement": "Требование к скорости: %1$s", "create.tooltip.speedRequirement.none": "Нет", + "create.tooltip.speedRequirement.slow": "UNLOCALIZED: Slow", "create.tooltip.speedRequirement.medium": "Умеренная", - "create.tooltip.speedRequirement.high": "Быстрая", + "create.tooltip.speedRequirement.fast": "Быстрая", "create.tooltip.stressImpact": "Создаваемая нагрузка: %1$s", "create.tooltip.stressImpact.low": "Низкая", "create.tooltip.stressImpact.medium": "Средняя", 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 4ff97c351..17caaa59a 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: 1", + "_": "Missing Localizations: 2", "_": "->------------------------] Game Elements [------------------------<-", @@ -1232,8 +1232,9 @@ "create.tooltip.keyCtrl": "Ctrl", "create.tooltip.speedRequirement": "需求转速:%1$s", "create.tooltip.speedRequirement.none": "无", + "create.tooltip.speedRequirement.slow": "UNLOCALIZED: Slow", "create.tooltip.speedRequirement.medium": "适当", - "create.tooltip.speedRequirement.high": "快", + "create.tooltip.speedRequirement.fast": "快", "create.tooltip.stressImpact": "应力影响:%1$s", "create.tooltip.stressImpact.low": "低", "create.tooltip.stressImpact.medium": "中", 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 d223fe30f..8948ba01e 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: 393", + "_": "Missing Localizations: 394", "_": "->------------------------] Game Elements [------------------------<-", @@ -1232,8 +1232,9 @@ "create.tooltip.keyCtrl": "Ctrl", "create.tooltip.speedRequirement": "需求速度:%1$s", "create.tooltip.speedRequirement.none": "無", + "create.tooltip.speedRequirement.slow": "UNLOCALIZED: Slow", "create.tooltip.speedRequirement.medium": "適當", - "create.tooltip.speedRequirement.high": "快", + "create.tooltip.speedRequirement.fast": "快", "create.tooltip.stressImpact": "動能消耗:%1$s", "create.tooltip.stressImpact.low": "低", "create.tooltip.stressImpact.medium": "中", diff --git a/src/main/java/com/simibubi/create/AllBlocks.java b/src/main/java/com/simibubi/create/AllBlocks.java index 0c3c2f7bf..330ea3715 100644 --- a/src/main/java/com/simibubi/create/AllBlocks.java +++ b/src/main/java/com/simibubi/create/AllBlocks.java @@ -175,6 +175,7 @@ import com.simibubi.create.foundation.data.CreateRegistrate; import com.simibubi.create.foundation.data.ModelGen; import com.simibubi.create.foundation.data.SharedProperties; import com.simibubi.create.foundation.item.TooltipHelper; +import com.simibubi.create.foundation.item.UncontainableBlockItem; import com.simibubi.create.foundation.utility.ColorHandlers; import com.simibubi.create.foundation.utility.Couple; import com.simibubi.create.foundation.utility.DyeHelper; @@ -1503,7 +1504,7 @@ public class AllBlocks { }) .onRegisterAfter(Item.class, v -> TooltipHelper.referTo(v, "block.create.toolbox")) .tag(AllBlockTags.TOOLBOXES.tag) - .item() + .item(UncontainableBlockItem::new) .model((c, p) -> p.withExistingParent(colourName + "_toolbox", p.modLoc("block/toolbox/item")) .texture("0", p.modLoc("block/toolbox/" + colourName))) .tag(AllItemTags.TOOLBOXES.tag) diff --git a/src/main/java/com/simibubi/create/AllEntityTypes.java b/src/main/java/com/simibubi/create/AllEntityTypes.java index 85e64ed4e..15cb673d1 100644 --- a/src/main/java/com/simibubi/create/AllEntityTypes.java +++ b/src/main/java/com/simibubi/create/AllEntityTypes.java @@ -2,7 +2,6 @@ package com.simibubi.create; import com.simibubi.create.content.contraptions.components.actors.SeatEntity; import com.simibubi.create.content.contraptions.components.structureMovement.AbstractContraptionEntity; -import com.simibubi.create.content.contraptions.components.structureMovement.ContraptionEntityRenderer; import com.simibubi.create.content.contraptions.components.structureMovement.ControlledContraptionEntity; import com.simibubi.create.content.contraptions.components.structureMovement.OrientedContraptionEntity; import com.simibubi.create.content.contraptions.components.structureMovement.OrientedContraptionEntityRenderer; @@ -10,6 +9,7 @@ import com.simibubi.create.content.contraptions.components.structureMovement.gan import com.simibubi.create.content.contraptions.components.structureMovement.glue.GlueInstance; import com.simibubi.create.content.contraptions.components.structureMovement.glue.SuperGlueEntity; import com.simibubi.create.content.contraptions.components.structureMovement.glue.SuperGlueRenderer; +import com.simibubi.create.content.contraptions.components.structureMovement.render.ContraptionEntityRenderer; import com.simibubi.create.content.curiosities.tools.BlueprintEntity; import com.simibubi.create.content.curiosities.tools.BlueprintRenderer; import com.simibubi.create.content.curiosities.weapons.PotatoProjectileEntity; diff --git a/src/main/java/com/simibubi/create/content/contraptions/base/IRotate.java b/src/main/java/com/simibubi/create/content/contraptions/base/IRotate.java index 8f405b615..9105d6b63 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/base/IRotate.java +++ b/src/main/java/com/simibubi/create/content/contraptions/base/IRotate.java @@ -19,32 +19,31 @@ import net.minecraft.world.level.block.state.BlockState; public interface IRotate extends IWrenchable { enum SpeedLevel { - NONE, - MEDIUM, - FAST; + NONE(ChatFormatting.DARK_GRAY, 0x000000, 0), + SLOW(ChatFormatting.GREEN, 0x22FF22, 10), + MEDIUM(ChatFormatting.AQUA, 0x0084FF, 20), + FAST(ChatFormatting.LIGHT_PURPLE, 0xFF55FF, 30); + + private final ChatFormatting textColor; + private final int color; + private final int particleSpeed; + + SpeedLevel(ChatFormatting textColor, int color, int particleSpeed) { + this.textColor = textColor; + this.color = color; + this.particleSpeed = particleSpeed; + } public ChatFormatting getTextColor() { - return this == NONE ? ChatFormatting.GREEN - : this == MEDIUM ? ChatFormatting.AQUA : ChatFormatting.LIGHT_PURPLE; + return textColor; } public int getColor() { - return this == NONE ? 0x22FF22 : this == MEDIUM ? 0x0084FF : 0xFF55FF; + return color; } public int getParticleSpeed() { - return this == NONE ? 10 : this == MEDIUM ? 20 : 30; - } - - public static SpeedLevel of(float speed) { - speed = Math.abs(speed); - - if (speed >= AllConfigs.SERVER.kinetics.fastSpeed.get()) { - return FAST; - } else if (speed >= AllConfigs.SERVER.kinetics.mediumSpeed.get()) { - return MEDIUM; - } - return NONE; + return particleSpeed; } public float getSpeedValue() { @@ -53,22 +52,31 @@ public interface IRotate extends IWrenchable { return AllConfigs.SERVER.kinetics.fastSpeed.get().floatValue(); case MEDIUM: return AllConfigs.SERVER.kinetics.mediumSpeed.get().floatValue(); + case SLOW: + return 1; case NONE: default: return 0; } } - public static Component getFormattedSpeedText(float speed, boolean overstressed){ + public static SpeedLevel of(float speed) { + speed = Math.abs(speed); + + if (speed >= AllConfigs.SERVER.kinetics.fastSpeed.get()) + return FAST; + if (speed >= AllConfigs.SERVER.kinetics.mediumSpeed.get()) + return MEDIUM; + if (speed >= 1) + return SLOW; + return NONE; + } + + public static Component getFormattedSpeedText(float speed, boolean overstressed) { SpeedLevel speedLevel = of(speed); MutableComponent level = new TextComponent(ItemDescription.makeProgressBar(3, speedLevel.ordinal())); - - if (speedLevel == SpeedLevel.MEDIUM) - level.append(Lang.translate("tooltip.speedRequirement.medium")); - if (speedLevel == SpeedLevel.FAST) - level.append(Lang.translate("tooltip.speedRequirement.high")); - + level.append(Lang.translate("tooltip.speedRequirement." + Lang.asId(speedLevel.name()))); level.append(" (" + IHaveGoggleInformation.format(Math.abs(speed))).append(Lang.translate("generic.unit.rpm")).append(") "); if (overstressed) @@ -82,40 +90,49 @@ public interface IRotate extends IWrenchable { } enum StressImpact { - LOW, - MEDIUM, - HIGH, - OVERSTRESSED; + LOW(ChatFormatting.YELLOW, ChatFormatting.GREEN), + MEDIUM(ChatFormatting.GOLD, ChatFormatting.YELLOW), + HIGH(ChatFormatting.RED, ChatFormatting.GOLD), + OVERSTRESSED(ChatFormatting.RED, ChatFormatting.RED); + + private final ChatFormatting absoluteColor; + private final ChatFormatting relativeColor; + + StressImpact(ChatFormatting absoluteColor, ChatFormatting relativeColor) { + this.absoluteColor = absoluteColor; + this.relativeColor = relativeColor; + } public ChatFormatting getAbsoluteColor() { - return this == LOW ? ChatFormatting.YELLOW : this == MEDIUM ? ChatFormatting.GOLD : ChatFormatting.RED; + return absoluteColor; } public ChatFormatting getRelativeColor() { - return this == LOW ? ChatFormatting.GREEN : this == MEDIUM ? ChatFormatting.YELLOW : this == HIGH ? ChatFormatting.GOLD : ChatFormatting.RED; + return relativeColor; } - public static StressImpact of(double stressPercent){ - if (stressPercent > 1) return StressImpact.OVERSTRESSED; - else if (stressPercent > .75d) return StressImpact.HIGH; - else if (stressPercent > .5d) return StressImpact.MEDIUM; - else return StressImpact.LOW; + public static StressImpact of(double stressPercent) { + if (stressPercent > 1) + return StressImpact.OVERSTRESSED; + if (stressPercent > .75d) + return StressImpact.HIGH; + if (stressPercent > .5d) + return StressImpact.MEDIUM; + return StressImpact.LOW; } - + public static boolean isEnabled() { return !AllConfigs.SERVER.kinetics.disableStress.get(); } - public static Component getFormattedStressText(double stressPercent){ + public static Component getFormattedStressText(double stressPercent) { StressImpact stressLevel = of(stressPercent); - ChatFormatting color = stressLevel.getRelativeColor(); - MutableComponent level = new TextComponent(ItemDescription.makeProgressBar(3, Math.min(stressLevel.ordinal(), 2))); + MutableComponent level = new TextComponent(ItemDescription.makeProgressBar(3, Math.min(stressLevel.ordinal() + 1, 3))); level.append(Lang.translate("tooltip.stressImpact." + Lang.asId(stressLevel.name()))); - level.append(String.format(" (%s%%) ", (int) (stressPercent * 100))); - return level.withStyle(color); + return level.withStyle(stressLevel.getRelativeColor()); } } @@ -124,7 +141,7 @@ public interface IRotate extends IWrenchable { public Axis getRotationAxis(BlockState state); public default SpeedLevel getMinimumRequiredSpeedLevel() { - return SpeedLevel.NONE; + return SpeedLevel.SLOW; } public default boolean hideStressImpact() { diff --git a/src/main/java/com/simibubi/create/content/contraptions/base/KineticTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/base/KineticTileEntity.java index 753d54586..17c2bce3f 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/base/KineticTileEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/base/KineticTileEntity.java @@ -357,13 +357,7 @@ public class KineticTileEntity extends SmartTileEntity return true; IRotate def = (IRotate) state.getBlock(); SpeedLevel minimumRequiredSpeedLevel = def.getMinimumRequiredSpeedLevel(); - if (minimumRequiredSpeedLevel == null) - return true; - if (minimumRequiredSpeedLevel == SpeedLevel.MEDIUM) - return Math.abs(getSpeed()) >= AllConfigs.SERVER.kinetics.mediumSpeed.get(); - if (minimumRequiredSpeedLevel == SpeedLevel.FAST) - return Math.abs(getSpeed()) >= AllConfigs.SERVER.kinetics.fastSpeed.get(); - return true; + return Math.abs(getSpeed()) >= minimumRequiredSpeedLevel.getSpeedValue(); } public static void switchToBlockState(Level world, BlockPos pos, BlockState state) { diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/crafter/MechanicalCrafterBlock.java b/src/main/java/com/simibubi/create/content/contraptions/components/crafter/MechanicalCrafterBlock.java index 0f9f96937..47062a61b 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/crafter/MechanicalCrafterBlock.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/crafter/MechanicalCrafterBlock.java @@ -155,18 +155,18 @@ public class MechanicalCrafterBlock extends HorizontalKineticBlock @Override public InteractionResult use(BlockState state, Level worldIn, BlockPos pos, Player player, InteractionHand handIn, BlockHitResult hit) { - ItemStack heldItem = player.getItemInHand(handIn); - boolean isHand = heldItem.isEmpty() && handIn == InteractionHand.MAIN_HAND; - BlockEntity te = worldIn.getBlockEntity(pos); - if (!(te instanceof MechanicalCrafterTileEntity)) + if (!(te instanceof MechanicalCrafterTileEntity crafter)) return InteractionResult.PASS; - MechanicalCrafterTileEntity crafter = (MechanicalCrafterTileEntity) te; - boolean wrenched = AllItems.WRENCH.isIn(heldItem); + + ItemStack heldItem = player.getItemInHand(handIn); if (AllBlocks.MECHANICAL_ARM.isIn(heldItem)) return InteractionResult.PASS; + boolean isHand = heldItem.isEmpty() && handIn == InteractionHand.MAIN_HAND; + boolean wrenched = AllItems.WRENCH.isIn(heldItem); + if (hit.getDirection() == state.getValue(HORIZONTAL_FACING)) { if (crafter.phase != Phase.IDLE && !wrenched) { diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/Contraption.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/Contraption.java index 790746d32..2299a6594 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/Contraption.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/Contraption.java @@ -49,6 +49,7 @@ import com.simibubi.create.content.contraptions.components.structureMovement.pul import com.simibubi.create.content.contraptions.components.structureMovement.pulley.PulleyBlock.MagnetBlock; import com.simibubi.create.content.contraptions.components.structureMovement.pulley.PulleyBlock.RopeBlock; import com.simibubi.create.content.contraptions.components.structureMovement.pulley.PulleyTileEntity; +import com.simibubi.create.content.contraptions.components.structureMovement.render.ContraptionLighter; import com.simibubi.create.content.contraptions.components.structureMovement.render.EmptyLighter; import com.simibubi.create.content.contraptions.fluids.tank.FluidTankTileEntity; import com.simibubi.create.content.contraptions.relays.advanced.GantryShaftBlock; diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/NonStationaryLighter.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/NonStationaryLighter.java index 1249efaa8..2027daa77 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/NonStationaryLighter.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/NonStationaryLighter.java @@ -4,6 +4,7 @@ import com.jozufozu.flywheel.light.LightProvider; import com.jozufozu.flywheel.light.MovingListener; import com.jozufozu.flywheel.util.box.GridAlignedBB; import com.jozufozu.flywheel.util.box.ImmutableBox; +import com.simibubi.create.content.contraptions.components.structureMovement.render.ContraptionLighter; import com.simibubi.create.foundation.config.AllConfigs; public class NonStationaryLighter extends ContraptionLighter implements MovingListener { diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/OrientedContraptionEntityRenderer.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/OrientedContraptionEntityRenderer.java index 548d6f3f9..0789157fa 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/OrientedContraptionEntityRenderer.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/OrientedContraptionEntityRenderer.java @@ -1,5 +1,7 @@ package com.simibubi.create.content.contraptions.components.structureMovement; +import com.simibubi.create.content.contraptions.components.structureMovement.render.ContraptionEntityRenderer; + import net.minecraft.client.renderer.culling.Frustum; import net.minecraft.client.renderer.entity.EntityRendererProvider; diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/bearing/AnchoredLighter.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/bearing/AnchoredLighter.java index 1f2a06669..e195ae9b3 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/bearing/AnchoredLighter.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/bearing/AnchoredLighter.java @@ -2,7 +2,7 @@ package com.simibubi.create.content.contraptions.components.structureMovement.be import com.jozufozu.flywheel.util.box.GridAlignedBB; import com.simibubi.create.content.contraptions.components.structureMovement.Contraption; -import com.simibubi.create.content.contraptions.components.structureMovement.ContraptionLighter; +import com.simibubi.create.content.contraptions.components.structureMovement.render.ContraptionLighter; public class AnchoredLighter extends ContraptionLighter { diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/bearing/BearingContraption.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/bearing/BearingContraption.java index 0cc239a58..788b111b7 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/bearing/BearingContraption.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/bearing/BearingContraption.java @@ -5,8 +5,8 @@ import org.apache.commons.lang3.tuple.Pair; import com.simibubi.create.AllTags.AllBlockTags; import com.simibubi.create.content.contraptions.components.structureMovement.AssemblyException; import com.simibubi.create.content.contraptions.components.structureMovement.Contraption; -import com.simibubi.create.content.contraptions.components.structureMovement.ContraptionLighter; import com.simibubi.create.content.contraptions.components.structureMovement.ContraptionType; +import com.simibubi.create.content.contraptions.components.structureMovement.render.ContraptionLighter; import com.simibubi.create.foundation.config.AllConfigs; import net.minecraft.core.BlockPos; diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/bearing/ClockworkContraption.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/bearing/ClockworkContraption.java index aa81ef4a4..5027c0bea 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/bearing/ClockworkContraption.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/bearing/ClockworkContraption.java @@ -8,8 +8,8 @@ import org.apache.commons.lang3.tuple.Pair; import com.simibubi.create.content.contraptions.components.structureMovement.AssemblyException; import com.simibubi.create.content.contraptions.components.structureMovement.Contraption; -import com.simibubi.create.content.contraptions.components.structureMovement.ContraptionLighter; import com.simibubi.create.content.contraptions.components.structureMovement.ContraptionType; +import com.simibubi.create.content.contraptions.components.structureMovement.render.ContraptionLighter; import com.simibubi.create.foundation.utility.NBTHelper; import net.minecraft.core.BlockPos; diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/bearing/StabilizedContraption.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/bearing/StabilizedContraption.java index 5bb86310e..ca4526b8d 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/bearing/StabilizedContraption.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/bearing/StabilizedContraption.java @@ -2,9 +2,9 @@ package com.simibubi.create.content.contraptions.components.structureMovement.be import com.simibubi.create.content.contraptions.components.structureMovement.AssemblyException; import com.simibubi.create.content.contraptions.components.structureMovement.Contraption; -import com.simibubi.create.content.contraptions.components.structureMovement.ContraptionLighter; import com.simibubi.create.content.contraptions.components.structureMovement.ContraptionType; import com.simibubi.create.content.contraptions.components.structureMovement.NonStationaryLighter; +import com.simibubi.create.content.contraptions.components.structureMovement.render.ContraptionLighter; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/gantry/GantryContraption.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/gantry/GantryContraption.java index e3f3be3ef..bbb995b66 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/gantry/GantryContraption.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/gantry/GantryContraption.java @@ -2,10 +2,10 @@ package com.simibubi.create.content.contraptions.components.structureMovement.ga import com.simibubi.create.AllBlocks; import com.simibubi.create.content.contraptions.components.structureMovement.AssemblyException; -import com.simibubi.create.content.contraptions.components.structureMovement.ContraptionLighter; import com.simibubi.create.content.contraptions.components.structureMovement.ContraptionType; import com.simibubi.create.content.contraptions.components.structureMovement.NonStationaryLighter; import com.simibubi.create.content.contraptions.components.structureMovement.TranslatingContraption; +import com.simibubi.create.content.contraptions.components.structureMovement.render.ContraptionLighter; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/mounted/MountedContraption.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/mounted/MountedContraption.java index 2b06c5df6..fec9129c5 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/mounted/MountedContraption.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/mounted/MountedContraption.java @@ -9,10 +9,10 @@ import org.apache.commons.lang3.tuple.Pair; import com.simibubi.create.AllBlocks; import com.simibubi.create.content.contraptions.components.structureMovement.AssemblyException; import com.simibubi.create.content.contraptions.components.structureMovement.Contraption; -import com.simibubi.create.content.contraptions.components.structureMovement.ContraptionLighter; import com.simibubi.create.content.contraptions.components.structureMovement.ContraptionType; import com.simibubi.create.content.contraptions.components.structureMovement.NonStationaryLighter; import com.simibubi.create.content.contraptions.components.structureMovement.mounted.CartAssemblerTileEntity.CartMovementMode; +import com.simibubi.create.content.contraptions.components.structureMovement.render.ContraptionLighter; import com.simibubi.create.foundation.utility.Iterate; import com.simibubi.create.foundation.utility.NBTHelper; import com.simibubi.create.foundation.utility.VecHelper; diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/piston/PistonContraption.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/piston/PistonContraption.java index 00537bd01..7413928c2 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/piston/PistonContraption.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/piston/PistonContraption.java @@ -16,10 +16,10 @@ import org.apache.commons.lang3.tuple.Pair; import com.simibubi.create.content.contraptions.components.structureMovement.AssemblyException; import com.simibubi.create.content.contraptions.components.structureMovement.BlockMovementChecks; -import com.simibubi.create.content.contraptions.components.structureMovement.ContraptionLighter; import com.simibubi.create.content.contraptions.components.structureMovement.ContraptionType; import com.simibubi.create.content.contraptions.components.structureMovement.TranslatingContraption; import com.simibubi.create.content.contraptions.components.structureMovement.piston.MechanicalPistonBlock.PistonState; +import com.simibubi.create.content.contraptions.components.structureMovement.render.ContraptionLighter; import com.simibubi.create.foundation.config.AllConfigs; import com.simibubi.create.foundation.utility.VecHelper; diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/piston/PistonLighter.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/piston/PistonLighter.java index 5d834de18..cf1b2f961 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/piston/PistonLighter.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/piston/PistonLighter.java @@ -1,7 +1,7 @@ package com.simibubi.create.content.contraptions.components.structureMovement.piston; import com.jozufozu.flywheel.util.box.GridAlignedBB; -import com.simibubi.create.content.contraptions.components.structureMovement.ContraptionLighter; +import com.simibubi.create.content.contraptions.components.structureMovement.render.ContraptionLighter; import net.minecraft.core.Vec3i; diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/pulley/PulleyContraption.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/pulley/PulleyContraption.java index 46463cff2..ee53dfc94 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/pulley/PulleyContraption.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/pulley/PulleyContraption.java @@ -1,9 +1,9 @@ package com.simibubi.create.content.contraptions.components.structureMovement.pulley; import com.simibubi.create.content.contraptions.components.structureMovement.AssemblyException; -import com.simibubi.create.content.contraptions.components.structureMovement.ContraptionLighter; import com.simibubi.create.content.contraptions.components.structureMovement.ContraptionType; import com.simibubi.create.content.contraptions.components.structureMovement.TranslatingContraption; +import com.simibubi.create.content.contraptions.components.structureMovement.render.ContraptionLighter; import net.minecraft.core.BlockPos; import net.minecraft.nbt.CompoundTag; diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/pulley/PulleyLighter.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/pulley/PulleyLighter.java index 2a1faf43c..aedfcc667 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/pulley/PulleyLighter.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/pulley/PulleyLighter.java @@ -2,7 +2,7 @@ package com.simibubi.create.content.contraptions.components.structureMovement.pu import com.jozufozu.flywheel.util.box.GridAlignedBB; import com.simibubi.create.AllBlocks; -import com.simibubi.create.content.contraptions.components.structureMovement.ContraptionLighter; +import com.simibubi.create.content.contraptions.components.structureMovement.render.ContraptionLighter; import net.minecraft.core.BlockPos; import net.minecraft.world.level.Level; diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/ContraptionEntityRenderer.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/render/ContraptionEntityRenderer.java similarity index 90% rename from src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/ContraptionEntityRenderer.java rename to src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/render/ContraptionEntityRenderer.java index 3e0378a93..7646cb39c 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/ContraptionEntityRenderer.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/render/ContraptionEntityRenderer.java @@ -1,7 +1,8 @@ -package com.simibubi.create.content.contraptions.components.structureMovement; +package com.simibubi.create.content.contraptions.components.structureMovement.render; import com.mojang.blaze3d.vertex.PoseStack; -import com.simibubi.create.content.contraptions.components.structureMovement.render.ContraptionRenderDispatcher; +import com.simibubi.create.content.contraptions.components.structureMovement.AbstractContraptionEntity; +import com.simibubi.create.content.contraptions.components.structureMovement.Contraption; import net.minecraft.client.renderer.MultiBufferSource; import net.minecraft.client.renderer.culling.Frustum; diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/ContraptionLighter.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/render/ContraptionLighter.java similarity index 94% rename from src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/ContraptionLighter.java rename to src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/render/ContraptionLighter.java index f55daf85c..39ea4a658 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/ContraptionLighter.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/render/ContraptionLighter.java @@ -1,4 +1,4 @@ -package com.simibubi.create.content.contraptions.components.structureMovement; +package com.simibubi.create.content.contraptions.components.structureMovement.render; import com.jozufozu.flywheel.light.GPULightVolume; import com.jozufozu.flywheel.light.LightListener; @@ -7,6 +7,7 @@ import com.jozufozu.flywheel.light.LightUpdater; import com.jozufozu.flywheel.light.ListenerStatus; import com.jozufozu.flywheel.util.box.GridAlignedBB; import com.jozufozu.flywheel.util.box.ImmutableBox; +import com.simibubi.create.content.contraptions.components.structureMovement.Contraption; import net.minecraft.world.level.LightLayer; diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/render/EmptyLighter.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/render/EmptyLighter.java index c922a2ccd..c223dea3b 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/render/EmptyLighter.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/render/EmptyLighter.java @@ -2,7 +2,6 @@ package com.simibubi.create.content.contraptions.components.structureMovement.re import com.jozufozu.flywheel.util.box.GridAlignedBB; import com.simibubi.create.content.contraptions.components.structureMovement.Contraption; -import com.simibubi.create.content.contraptions.components.structureMovement.ContraptionLighter; // so other contraptions don't crash before they have a lighter public class EmptyLighter extends ContraptionLighter { diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/render/FlwContraption.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/render/FlwContraption.java index 01cbb7d95..566f4aeed 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/render/FlwContraption.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/render/FlwContraption.java @@ -22,7 +22,6 @@ import com.mojang.blaze3d.vertex.PoseStack; import com.mojang.math.Matrix4f; import com.simibubi.create.content.contraptions.components.structureMovement.AbstractContraptionEntity; import com.simibubi.create.content.contraptions.components.structureMovement.Contraption; -import com.simibubi.create.content.contraptions.components.structureMovement.ContraptionLighter; import com.simibubi.create.foundation.render.CreateContexts; import com.simibubi.create.foundation.utility.AnimationTickHolder; diff --git a/src/main/java/com/simibubi/create/content/contraptions/goggles/GoggleOverlayRenderer.java b/src/main/java/com/simibubi/create/content/contraptions/goggles/GoggleOverlayRenderer.java index 118c292ec..461aeeee0 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/goggles/GoggleOverlayRenderer.java +++ b/src/main/java/com/simibubi/create/content/contraptions/goggles/GoggleOverlayRenderer.java @@ -1,10 +1,8 @@ package com.simibubi.create.content.contraptions.goggles; import java.util.ArrayList; -import java.util.LinkedList; import java.util.List; import java.util.Map; -import java.util.function.Supplier; import com.mojang.blaze3d.vertex.PoseStack; import com.simibubi.create.AllBlocks; @@ -33,7 +31,6 @@ import net.minecraft.network.chat.Component; import net.minecraft.network.chat.FormattedText; import net.minecraft.network.chat.TextComponent; import net.minecraft.util.Mth; -import net.minecraft.world.entity.EquipmentSlot; import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.block.entity.BlockEntity; import net.minecraft.world.level.block.state.BlockState; @@ -46,7 +43,6 @@ public class GoggleOverlayRenderer { public static final IIngameOverlay OVERLAY = GoggleOverlayRenderer::renderOverlay; - private static final List> customGogglePredicates = new LinkedList<>(); private static final Map outlines = CreateClient.OUTLINER.getOutlines(); public static int hoverTicks = 0; @@ -73,7 +69,6 @@ public class GoggleOverlayRenderer { Minecraft mc = Minecraft.getInstance(); ClientLevel world = mc.level; BlockPos pos = result.getBlockPos(); - ItemStack headSlot = mc.player.getItemBySlot(EquipmentSlot.HEAD); BlockEntity te = world.getBlockEntity(pos); if (lastHovered == null || lastHovered.equals(pos)) @@ -82,9 +77,7 @@ public class GoggleOverlayRenderer { hoverTicks = 0; lastHovered = pos; - boolean wearingGoggles = AllItems.GOGGLES.isIn(headSlot); - for (Supplier supplier : customGogglePredicates) - wearingGoggles |= supplier.get(); + boolean wearingGoggles = GogglesItem.isWearingGoggles(mc.player); boolean hasGoggleInformation = te instanceof IHaveGoggleInformation; boolean hasHoveringInformation = te instanceof IHaveHoveringInformation; @@ -200,12 +193,4 @@ public class GoggleOverlayRenderer { poseStack.popPose(); } - /** - * Use this method to add custom entry points to the goggles overlay, e.g. custom - * armor, handheld alternatives, etc. - */ - public static void registerCustomGoggleCondition(Supplier condition) { - customGogglePredicates.add(condition); - } - } diff --git a/src/main/java/com/simibubi/create/content/contraptions/goggles/GogglesItem.java b/src/main/java/com/simibubi/create/content/contraptions/goggles/GogglesItem.java index 20789248a..19063c4d6 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/goggles/GogglesItem.java +++ b/src/main/java/com/simibubi/create/content/contraptions/goggles/GogglesItem.java @@ -1,5 +1,9 @@ package com.simibubi.create.content.contraptions.goggles; +import java.util.ArrayList; +import java.util.List; +import java.util.function.Predicate; + import com.simibubi.create.AllItems; import net.minecraft.world.InteractionHand; @@ -16,6 +20,11 @@ import net.minecraft.world.level.block.DispenserBlock; public class GogglesItem extends Item { + private static final List> IS_WEARING_PREDICATES = new ArrayList<>(); + static { + addIsWearingPredicate(player -> AllItems.GOGGLES.isIn(player.getItemBySlot(EquipmentSlot.HEAD))); + } + public GogglesItem(Properties properties) { super(properties); DispenserBlock.registerBehavior(this, ArmorItem.DISPENSE_ITEM_BEHAVIOR); @@ -39,11 +48,21 @@ public class GogglesItem extends Item { } } - public static boolean canSeeParticles(Player player) { - for (ItemStack itemStack : player.getArmorSlots()) - if (AllItems.GOGGLES.isIn(itemStack)) + public static boolean isWearingGoggles(Player player) { + for (Predicate predicate : IS_WEARING_PREDICATES) { + if (predicate.test(player)) { return true; + } + } return false; } + /** + * Use this method to add custom entry points to the goggles overlay, e.g. custom + * armor, handheld alternatives, etc. + */ + public static void addIsWearingPredicate(Predicate predicate) { + IS_WEARING_PREDICATES.add(predicate); + } + } diff --git a/src/main/java/com/simibubi/create/content/contraptions/particle/RotationIndicatorParticle.java b/src/main/java/com/simibubi/create/content/contraptions/particle/RotationIndicatorParticle.java index d4af3be6d..593940293 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/particle/RotationIndicatorParticle.java +++ b/src/main/java/com/simibubi/create/content/contraptions/particle/RotationIndicatorParticle.java @@ -88,7 +88,7 @@ public class RotationIndicatorParticle extends SimpleAnimatedParticle { double xSpeed, double ySpeed, double zSpeed) { Minecraft mc = Minecraft.getInstance(); LocalPlayer player = mc.player; - boolean visible = worldIn != mc.level || player != null && GogglesItem.canSeeParticles(player); + boolean visible = worldIn != mc.level || player != null && GogglesItem.isWearingGoggles(player); return new RotationIndicatorParticle(worldIn, x, y, z, data.color, data.radius1, data.radius2, data.speed, data.getAxis(), data.lifeSpan, visible, this.spriteSet); } diff --git a/src/main/java/com/simibubi/create/content/contraptions/relays/gauge/SpeedGaugeTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/relays/gauge/SpeedGaugeTileEntity.java index 95dfae818..c1dae80ea 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/relays/gauge/SpeedGaugeTileEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/relays/gauge/SpeedGaugeTileEntity.java @@ -27,11 +27,10 @@ public class SpeedGaugeTileEntity extends GaugeTileEntity { super.onSpeedChanged(prevSpeed); float speed = Math.abs(getSpeed()); - color = speed == 0 ? 0x333333 - : Color.mixColors(SpeedLevel.of(speed) + color = Color.mixColors(SpeedLevel.of(speed) .getColor(), 0xffffff, .25f); if (speed == 69) - AllTriggers.triggerForNearbyPlayers(AllTriggers.SPEED_READ, level, worldPosition, 6, GogglesItem::canSeeParticles); + AllTriggers.triggerForNearbyPlayers(AllTriggers.SPEED_READ, level, worldPosition, 6, GogglesItem::isWearingGoggles); dialTarget = getDialTarget(speed); setChanged(); diff --git a/src/main/java/com/simibubi/create/content/contraptions/relays/gauge/StressGaugeTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/relays/gauge/StressGaugeTileEntity.java index 95b78174d..cfe5111cd 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/relays/gauge/StressGaugeTileEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/relays/gauge/StressGaugeTileEntity.java @@ -73,9 +73,7 @@ public class StressGaugeTileEntity extends GaugeTileEntity { tooltip.add(componentSpacing.plainCopy().append(Lang.translate("gui.stressometer.title").withStyle(ChatFormatting.GRAY))); if (getTheoreticalSpeed() == 0) - tooltip.add(new TextComponent(spacing + ItemDescription.makeProgressBar(3, -1)).append(Lang.translate("gui.stressometer.no_rotation")).withStyle(ChatFormatting.DARK_GRAY)); - // tooltip.add(new StringTextComponent(TextFormatting.DARK_GRAY + ItemDescription.makeProgressBar(3, -1) - // + Lang.translate("gui.stressometer.no_rotation"))); + tooltip.add(new TextComponent(spacing + ItemDescription.makeProgressBar(3, 0)).append(Lang.translate("gui.stressometer.no_rotation")).withStyle(ChatFormatting.DARK_GRAY)); else { tooltip.add(componentSpacing.plainCopy().append(StressImpact.getFormattedStressText(stressFraction))); diff --git a/src/main/java/com/simibubi/create/content/curiosities/ChromaticCompoundItem.java b/src/main/java/com/simibubi/create/content/curiosities/ChromaticCompoundItem.java index b8bf6bd67..6d2537478 100644 --- a/src/main/java/com/simibubi/create/content/curiosities/ChromaticCompoundItem.java +++ b/src/main/java/com/simibubi/create/content/curiosities/ChromaticCompoundItem.java @@ -73,15 +73,12 @@ public class ChromaticCompoundItem extends Item { @Override public boolean onEntityItemUpdate(ItemStack stack, ItemEntity entity) { - double y = entity.getY(); - double yMotion = entity.getDeltaMovement().y; Level world = entity.level; - CompoundTag data = entity.getPersistentData(); CompoundTag itemData = entity.getItem() .getOrCreateTag(); - Vec3 positionVec = entity.position(); CRecipes config = AllConfigs.SERVER.recipes; + if (world.isClientSide) { int light = itemData.getInt("CollectingLight"); if (world.random.nextInt(config.lightSourceCountForRefinedRadiance.get() + 20) < light) { @@ -94,8 +91,13 @@ public class ChromaticCompoundItem extends Item { return false; } + double y = entity.getY(); + double yMotion = entity.getDeltaMovement().y; + int minHeight = world.getMinBuildHeight(); + CompoundTag data = entity.getPersistentData(); + // Convert to Shadow steel if in void - if (y < 0 && y - yMotion < -10 && config.enableShadowSteelRecipe.get()) { + if (y < minHeight && y - yMotion < -10 + minHeight && config.enableShadowSteelRecipe.get()) { ItemStack newStack = AllItems.SHADOW_STEEL.asStack(); newStack.setCount(stack.getCount()); data.putBoolean("JustCreated", true); diff --git a/src/main/java/com/simibubi/create/content/curiosities/toolbox/ToolboxInventory.java b/src/main/java/com/simibubi/create/content/curiosities/toolbox/ToolboxInventory.java index 48e6d0b08..1d35771c3 100644 --- a/src/main/java/com/simibubi/create/content/curiosities/toolbox/ToolboxInventory.java +++ b/src/main/java/com/simibubi/create/content/curiosities/toolbox/ToolboxInventory.java @@ -7,14 +7,11 @@ import java.util.function.Consumer; import javax.annotation.Nonnull; import com.simibubi.create.AllItems; -import com.simibubi.create.AllTags.AllItemTags; import com.simibubi.create.foundation.utility.NBTHelper; import net.minecraft.nbt.CompoundTag; import net.minecraft.nbt.Tag; -import net.minecraft.world.item.BlockItem; import net.minecraft.world.item.ItemStack; -import net.minecraft.world.level.block.ShulkerBoxBlock; import net.minecraftforge.items.ItemHandlerHelper; import net.minecraftforge.items.ItemStackHandler; @@ -91,13 +88,8 @@ public class ToolboxInventory extends ItemStackHandler { @Override public boolean isItemValid(int slot, ItemStack stack) { - if (AllItemTags.TOOLBOXES.matches(stack)) + if (!stack.getItem().canFitInsideContainerItems()) return false; - if (stack.getItem() instanceof BlockItem) { - BlockItem blockItem = (BlockItem) stack.getItem(); - if (blockItem.getBlock() instanceof ShulkerBoxBlock) - return false; - } if (slot < 0 || slot >= getSlots()) return false; diff --git a/src/main/java/com/simibubi/create/content/logistics/item/filter/attribute/ColorAttribute.java b/src/main/java/com/simibubi/create/content/logistics/item/filter/attribute/ColorAttribute.java index e7d2cba7a..7f401883e 100644 --- a/src/main/java/com/simibubi/create/content/logistics/item/filter/attribute/ColorAttribute.java +++ b/src/main/java/com/simibubi/create/content/logistics/item/filter/attribute/ColorAttribute.java @@ -10,9 +10,9 @@ import java.util.stream.Collectors; import com.simibubi.create.content.logistics.item.filter.ItemAttribute; +import net.minecraft.client.resources.language.I18n; import net.minecraft.nbt.CompoundTag; import net.minecraft.nbt.ListTag; -import net.minecraft.network.chat.TranslatableComponent; import net.minecraft.world.item.DyeColor; import net.minecraft.world.item.FireworkRocketItem; import net.minecraft.world.item.FireworkStarItem; @@ -75,7 +75,7 @@ public class ColorAttribute implements ItemAttribute { @Override public Object[] getTranslationParameters() { - return new Object[]{new TranslatableComponent(color.getName()).getContents()}; + return new Object[] { I18n.get("color.minecraft." + color.getName()) }; } @Override diff --git a/src/main/java/com/simibubi/create/foundation/item/ItemDescription.java b/src/main/java/com/simibubi/create/foundation/item/ItemDescription.java index fdf3e2c85..47992e3c7 100644 --- a/src/main/java/com/simibubi/create/foundation/item/ItemDescription.java +++ b/src/main/java/com/simibubi/create/foundation/item/ItemDescription.java @@ -21,13 +21,13 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import com.simibubi.create.AllItems; import com.simibubi.create.content.contraptions.base.IRotate; import com.simibubi.create.content.contraptions.base.IRotate.SpeedLevel; import com.simibubi.create.content.contraptions.base.IRotate.StressImpact; import com.simibubi.create.content.contraptions.components.fan.EncasedFanBlock; import com.simibubi.create.content.contraptions.components.flywheel.engine.FurnaceEngineBlock; import com.simibubi.create.content.contraptions.components.waterwheel.WaterWheelBlock; +import com.simibubi.create.content.contraptions.goggles.GogglesItem; import com.simibubi.create.foundation.block.BlockStressValues; import com.simibubi.create.foundation.config.AllConfigs; import com.simibubi.create.foundation.config.CKinetics; @@ -39,7 +39,6 @@ import net.minecraft.client.gui.screens.Screen; import net.minecraft.network.chat.Component; import net.minecraft.network.chat.MutableComponent; import net.minecraft.network.chat.TextComponent; -import net.minecraft.world.entity.EquipmentSlot; import net.minecraft.world.level.block.Block; public class ItemDescription { @@ -90,7 +89,7 @@ public class ItemDescription { CKinetics config = AllConfigs.SERVER.kinetics; Component rpmUnit = Lang.translate("generic.unit.rpm"); - boolean hasGoggles = AllItems.GOGGLES.isIn(Minecraft.getInstance().player.getItemBySlot(EquipmentSlot.HEAD)); + boolean hasGoggles = GogglesItem.isWearingGoggles(Minecraft.getInstance().player); SpeedLevel minimumRequiredSpeedLevel; boolean showStressImpact; @@ -102,13 +101,12 @@ public class ItemDescription { showStressImpact = !((IRotate) block).hideStressImpact(); } - boolean hasSpeedRequirement = minimumRequiredSpeedLevel != SpeedLevel.NONE; + boolean hasSpeedRequirement = minimumRequiredSpeedLevel != SpeedLevel.NONE && minimumRequiredSpeedLevel != SpeedLevel.SLOW; boolean hasStressImpact = StressImpact.isEnabled() && showStressImpact && BlockStressValues.getImpact(block) > 0; boolean hasStressCapacity = StressImpact.isEnabled() && BlockStressValues.hasCapacity(block); if (hasSpeedRequirement) { - List speedLevels = Lang.translatedOptions("tooltip.speedRequirement", "none", "medium", "high"); int index = minimumRequiredSpeedLevel.ordinal(); MutableComponent level = new TextComponent(makeProgressBar(3, index)).withStyle(minimumRequiredSpeedLevel.getTextColor()); @@ -118,7 +116,7 @@ public class ItemDescription { .append(rpmUnit) .append("+"); else - level.append(speedLevels.get(index)); + level.append(Lang.translate("tooltip.speedRequirement." + Lang.asId(minimumRequiredSpeedLevel.name()))); list.add(Lang.translate("tooltip.speedRequirement") .withStyle(GRAY)); @@ -126,19 +124,18 @@ public class ItemDescription { } if (hasStressImpact) { - List stressLevels = Lang.translatedOptions("tooltip.stressImpact", "low", "medium", "high"); double impact = BlockStressValues.getImpact(block); StressImpact impactId = impact >= config.highStressImpact.get() ? StressImpact.HIGH : (impact >= config.mediumStressImpact.get() ? StressImpact.MEDIUM : StressImpact.LOW); int index = impactId.ordinal(); MutableComponent level = - new TextComponent(makeProgressBar(3, index)).withStyle(impactId.getAbsoluteColor()); + new TextComponent(makeProgressBar(3, index + 1)).withStyle(impactId.getAbsoluteColor()); if (hasGoggles) level.append(impact + "x ") .append(rpmUnit); else - level.append(stressLevels.get(index)); + level.append(Lang.translate("tooltip.stressImpact." + Lang.asId(impactId.name()))); list.add(Lang.translate("tooltip.stressImpact") .withStyle(GRAY)); @@ -146,20 +143,18 @@ public class ItemDescription { } if (hasStressCapacity) { - List stressCapacityLevels = - Lang.translatedOptions("tooltip.capacityProvided", "low", "medium", "high"); double capacity = BlockStressValues.getCapacity(block); StressImpact impactId = capacity >= config.highCapacity.get() ? StressImpact.LOW : (capacity >= config.mediumCapacity.get() ? StressImpact.MEDIUM : StressImpact.HIGH); int index = StressImpact.values().length - 2 - impactId.ordinal(); MutableComponent level = - new TextComponent(makeProgressBar(3, index)).withStyle(impactId.getAbsoluteColor()); + new TextComponent(makeProgressBar(3, index + 1)).withStyle(impactId.getAbsoluteColor()); if (hasGoggles) level.append(capacity + "x ") .append(rpmUnit); else - level.append(stressCapacityLevels.get(index)); + level.append(Lang.translate("tooltip.capacityProvided." + Lang.asId(impactId.name()))); // if (!isEngine && ((IRotate) block).showCapacityWithAnnotation()) // level += @@ -183,8 +178,8 @@ public class ItemDescription { public static String makeProgressBar(int length, int filledLength) { String bar = " "; - int emptySpaces = length - 1 - filledLength; - for (int i = 0; i <= filledLength; i++) + int emptySpaces = length - filledLength; + for (int i = 0; i < filledLength; i++) bar += "\u2588"; for (int i = 0; i < emptySpaces; i++) bar += "\u2592"; diff --git a/src/main/java/com/simibubi/create/foundation/item/TooltipHelper.java b/src/main/java/com/simibubi/create/foundation/item/TooltipHelper.java index f40029b04..42cc7ca82 100644 --- a/src/main/java/com/simibubi/create/foundation/item/TooltipHelper.java +++ b/src/main/java/com/simibubi/create/foundation/item/TooltipHelper.java @@ -10,8 +10,8 @@ import java.util.function.Supplier; import com.google.common.base.Strings; import com.mojang.bridge.game.Language; -import com.simibubi.create.AllItems; import com.simibubi.create.content.AllSections; +import com.simibubi.create.content.contraptions.goggles.GogglesItem; import com.simibubi.create.content.contraptions.goggles.IHaveGoggleInformation; import com.simibubi.create.foundation.item.ItemDescription.Palette; import com.simibubi.create.foundation.utility.Couple; @@ -25,7 +25,6 @@ import net.minecraft.client.resources.language.I18n; import net.minecraft.network.chat.Component; import net.minecraft.network.chat.MutableComponent; import net.minecraft.network.chat.TextComponent; -import net.minecraft.world.entity.EquipmentSlot; import net.minecraft.world.entity.player.Player; import net.minecraft.world.item.Item; import net.minecraft.world.item.ItemStack; @@ -235,10 +234,10 @@ public class TooltipHelper { public static boolean hasTooltip(ItemStack stack, Player player) { checkLocale(); - boolean hasGlasses = AllItems.GOGGLES.isIn(player.getItemBySlot(EquipmentSlot.HEAD)); + boolean hasGoggles = GogglesItem.isWearingGoggles(player); - if (hasGlasses != gogglesMode) { - gogglesMode = hasGlasses; + if (hasGoggles != gogglesMode) { + gogglesMode = hasGoggles; cachedTooltips.clear(); } diff --git a/src/main/java/com/simibubi/create/foundation/item/UncontainableBlockItem.java b/src/main/java/com/simibubi/create/foundation/item/UncontainableBlockItem.java new file mode 100644 index 000000000..6cae40209 --- /dev/null +++ b/src/main/java/com/simibubi/create/foundation/item/UncontainableBlockItem.java @@ -0,0 +1,15 @@ +package com.simibubi.create.foundation.item; + +import net.minecraft.world.item.BlockItem; +import net.minecraft.world.level.block.Block; + +public class UncontainableBlockItem extends BlockItem { + public UncontainableBlockItem(Block block, Properties properties) { + super(block, properties); + } + + @Override + public boolean canFitInsideContainerItems() { + return false; + } +} diff --git a/src/main/java/com/simibubi/create/foundation/tileEntity/behaviour/edgeInteraction/EdgeInteractionBehaviour.java b/src/main/java/com/simibubi/create/foundation/tileEntity/behaviour/edgeInteraction/EdgeInteractionBehaviour.java index 83e730fa6..4dd437666 100644 --- a/src/main/java/com/simibubi/create/foundation/tileEntity/behaviour/edgeInteraction/EdgeInteractionBehaviour.java +++ b/src/main/java/com/simibubi/create/foundation/tileEntity/behaviour/edgeInteraction/EdgeInteractionBehaviour.java @@ -13,7 +13,7 @@ import net.minecraft.world.level.Level; public class EdgeInteractionBehaviour extends TileEntityBehaviour { - public static BehaviourType TYPE = new BehaviourType<>(); + public static final BehaviourType TYPE = new BehaviourType<>(); ConnectionCallback connectionCallback; ConnectivityPredicate connectivityPredicate; diff --git a/src/main/java/com/simibubi/create/foundation/tileEntity/behaviour/edgeInteraction/EdgeInteractionHandler.java b/src/main/java/com/simibubi/create/foundation/tileEntity/behaviour/edgeInteraction/EdgeInteractionHandler.java index 065b2ff3d..4ec901624 100644 --- a/src/main/java/com/simibubi/create/foundation/tileEntity/behaviour/edgeInteraction/EdgeInteractionHandler.java +++ b/src/main/java/com/simibubi/create/foundation/tileEntity/behaviour/edgeInteraction/EdgeInteractionHandler.java @@ -42,11 +42,11 @@ public class EdgeInteractionHandler { EdgeInteractionBehaviour behaviour = TileEntityBehaviour.get(world, pos, EdgeInteractionBehaviour.TYPE); if (behaviour == null) return; + if (behaviour.requiredItem.isPresent() && behaviour.requiredItem.get() != heldItem.getItem()) + return; BlockHitResult ray = RaycastHelper.rayTraceRange(world, player, 10); if (ray == null) return; - if (behaviour.requiredItem.orElse(heldItem.getItem()) != heldItem.getItem()) - return; Direction activatedDirection = getActivatedDirection(world, pos, ray.getDirection(), ray.getLocation(), behaviour); if (activatedDirection == null) diff --git a/src/main/resources/assets/create/lang/de_de.json b/src/main/resources/assets/create/lang/de_de.json index c462dff01..7ca810e13 100644 --- a/src/main/resources/assets/create/lang/de_de.json +++ b/src/main/resources/assets/create/lang/de_de.json @@ -1148,7 +1148,7 @@ "create.tooltip.speedRequirement": "Geschwindigkeitsanforderung: %1$s", "create.tooltip.speedRequirement.none": "Keine", "create.tooltip.speedRequirement.medium": "Moderat", - "create.tooltip.speedRequirement.high": "Schnell", + "create.tooltip.speedRequirement.fast": "Schnell", "create.tooltip.stressImpact": "Kinetische Belastungsauswirkung: %1$s", "create.tooltip.stressImpact.low": "Niedrig", "create.tooltip.stressImpact.medium": "Moderat", diff --git a/src/main/resources/assets/create/lang/default/interface.json b/src/main/resources/assets/create/lang/default/interface.json index 4ebd988d5..6244a5153 100644 --- a/src/main/resources/assets/create/lang/default/interface.json +++ b/src/main/resources/assets/create/lang/default/interface.json @@ -34,7 +34,7 @@ "create.recipe.fan_washing.fan": "Fan behind Flowing Water", "create.recipe.fan_smoking": "Bulk Smoking", "create.recipe.fan_smoking.fan": "Fan behind Fire", - "create.recipe.fan_haunting": "Bulk Haunting", + "create.recipe.fan_haunting": "Bulk Haunting", "create.recipe.fan_haunting.fan": "Fan behind Soul Fire", "create.recipe.fan_blasting": "Bulk Blasting", "create.recipe.fan_blasting.fan": "Fan behind Lava", @@ -461,8 +461,9 @@ "create.tooltip.speedRequirement": "Speed Requirement: %1$s", "create.tooltip.speedRequirement.none": "None", + "create.tooltip.speedRequirement.slow": "Slow", "create.tooltip.speedRequirement.medium": "Moderate", - "create.tooltip.speedRequirement.high": "Fast", + "create.tooltip.speedRequirement.fast": "Fast", "create.tooltip.stressImpact": "Kinetic Stress Impact: %1$s", "create.tooltip.stressImpact.low": "Low", diff --git a/src/main/resources/assets/create/lang/es_cl.json b/src/main/resources/assets/create/lang/es_cl.json index 86514071e..60d563460 100644 --- a/src/main/resources/assets/create/lang/es_cl.json +++ b/src/main/resources/assets/create/lang/es_cl.json @@ -1146,7 +1146,7 @@ "create.tooltip.speedRequirement": "Requqrimiento de Velocidad: %1$s", "create.tooltip.speedRequirement.none": "Ninguno", "create.tooltip.speedRequirement.medium": "Moderado", - "create.tooltip.speedRequirement.high": "Rápidp", + "create.tooltip.speedRequirement.fast": "Rápido", "create.tooltip.stressImpact": "Impacto en el Estrés Cinético: %1$s", "create.tooltip.stressImpact.low": "Bajo", "create.tooltip.stressImpact.medium": "Moderado", diff --git a/src/main/resources/assets/create/lang/es_es.json b/src/main/resources/assets/create/lang/es_es.json index 0c1b8ebd9..36cc90c85 100644 --- a/src/main/resources/assets/create/lang/es_es.json +++ b/src/main/resources/assets/create/lang/es_es.json @@ -1228,7 +1228,7 @@ "create.tooltip.speedRequirement": "Requisitos de velocidad: %1$s", "create.tooltip.speedRequirement.none": "Ninguno", "create.tooltip.speedRequirement.medium": "Moderado", - "create.tooltip.speedRequirement.high": "Rápido", + "create.tooltip.speedRequirement.fast": "Rápido", "create.tooltip.stressImpact": "Impacto de estrés: %1$s", "create.tooltip.stressImpact.low": "Bajo", "create.tooltip.stressImpact.medium": "Moderado", diff --git a/src/main/resources/assets/create/lang/fr_fr.json b/src/main/resources/assets/create/lang/fr_fr.json index ddc79050d..1e5a3302b 100644 --- a/src/main/resources/assets/create/lang/fr_fr.json +++ b/src/main/resources/assets/create/lang/fr_fr.json @@ -623,7 +623,7 @@ "create.tooltip.speedRequirement": "Vitesse requise: %1$s", "create.tooltip.speedRequirement.none": "Aucune", "create.tooltip.speedRequirement.medium": "Modérée", - "create.tooltip.speedRequirement.high": "Rapide", + "create.tooltip.speedRequirement.fast": "Rapide", "create.tooltip.stressImpact": "Impact du stress: %1$s", "create.tooltip.stressImpact.low": "Faible", "create.tooltip.stressImpact.medium": "Modéré", diff --git a/src/main/resources/assets/create/lang/it_it.json b/src/main/resources/assets/create/lang/it_it.json index 7b4edec9a..684117901 100644 --- a/src/main/resources/assets/create/lang/it_it.json +++ b/src/main/resources/assets/create/lang/it_it.json @@ -1043,7 +1043,7 @@ "create.tooltip.speedRequirement": "Velocità richiesta: %1$s", "create.tooltip.speedRequirement.none": "Nessuna", "create.tooltip.speedRequirement.medium": "Moderata", - "create.tooltip.speedRequirement.high": "Veloce", + "create.tooltip.speedRequirement.fast": "Veloce", "create.tooltip.stressImpact": "Impatto sullo stress: %1$s", "create.tooltip.stressImpact.low": "Basso", "create.tooltip.stressImpact.medium": "Moderato", diff --git a/src/main/resources/assets/create/lang/ja_jp.json b/src/main/resources/assets/create/lang/ja_jp.json index 3c21c5a46..79d8d9ed9 100644 --- a/src/main/resources/assets/create/lang/ja_jp.json +++ b/src/main/resources/assets/create/lang/ja_jp.json @@ -1232,7 +1232,7 @@ "create.tooltip.speedRequirement": "必要な回転速度: %1$s", "create.tooltip.speedRequirement.none": "無し", "create.tooltip.speedRequirement.medium": "中速", - "create.tooltip.speedRequirement.high": "高速", + "create.tooltip.speedRequirement.fast": "高速", "create.tooltip.stressImpact": "応力への影響: %1$s", "create.tooltip.stressImpact.low": "低", "create.tooltip.stressImpact.medium": "中", diff --git a/src/main/resources/assets/create/lang/ko_kr.json b/src/main/resources/assets/create/lang/ko_kr.json index 8ba788049..ca76009db 100644 --- a/src/main/resources/assets/create/lang/ko_kr.json +++ b/src/main/resources/assets/create/lang/ko_kr.json @@ -1230,7 +1230,7 @@ "create.tooltip.speedRequirement": "요구 회전속도: %1$s", "create.tooltip.speedRequirement.none": "없음", "create.tooltip.speedRequirement.medium": "보통", - "create.tooltip.speedRequirement.high": "빠름", + "create.tooltip.speedRequirement.fast": "빠름", "create.tooltip.stressImpact": "피로도 부하: %1$s", "create.tooltip.stressImpact.low": "낮음", "create.tooltip.stressImpact.medium": "보통", diff --git a/src/main/resources/assets/create/lang/nl_nl.json b/src/main/resources/assets/create/lang/nl_nl.json index 8d9108149..523599f4a 100644 --- a/src/main/resources/assets/create/lang/nl_nl.json +++ b/src/main/resources/assets/create/lang/nl_nl.json @@ -405,7 +405,7 @@ "create.tooltip.speedRequirement": "Snelheid eis: %1$s", "create.tooltip.speedRequirement.none": "Geen", "create.tooltip.speedRequirement.medium": "Gemiddeld", - "create.tooltip.speedRequirement.high": "Snel", + "create.tooltip.speedRequirement.fast": "Snel", "create.tooltip.stressImpact": "Stress Impact: %1$s", "create.tooltip.stressImpact.low": "Laag", diff --git a/src/main/resources/assets/create/lang/pl_pl.json b/src/main/resources/assets/create/lang/pl_pl.json index dcf1dfa54..a07c852dc 100644 --- a/src/main/resources/assets/create/lang/pl_pl.json +++ b/src/main/resources/assets/create/lang/pl_pl.json @@ -1116,7 +1116,7 @@ "create.tooltip.speedRequirement": "Wymagana prędkość: %1$s", "create.tooltip.speedRequirement.none": "Brak", "create.tooltip.speedRequirement.medium": "Umiarkowana", - "create.tooltip.speedRequirement.high": "Wysoka", + "create.tooltip.speedRequirement.fast": "Wysoka", "create.tooltip.stressImpact": "Wpływ na obciążenie: %1$s", "create.tooltip.stressImpact.low": "Niski", "create.tooltip.stressImpact.medium": "Umiarkowany", diff --git a/src/main/resources/assets/create/lang/ru_ru.json b/src/main/resources/assets/create/lang/ru_ru.json index 3031f418d..a133da166 100644 --- a/src/main/resources/assets/create/lang/ru_ru.json +++ b/src/main/resources/assets/create/lang/ru_ru.json @@ -1118,7 +1118,7 @@ "create.tooltip.speedRequirement": "Требование к скорости: %1$s", "create.tooltip.speedRequirement.none": "Нет", "create.tooltip.speedRequirement.medium": "Умеренная", - "create.tooltip.speedRequirement.high": "Быстрая", + "create.tooltip.speedRequirement.fast": "Быстрая", "create.tooltip.stressImpact": "Создаваемая нагрузка: %1$s", "create.tooltip.stressImpact.low": "Низкая", "create.tooltip.stressImpact.medium": "Средняя", diff --git a/src/main/resources/assets/create/lang/zh_cn.json b/src/main/resources/assets/create/lang/zh_cn.json index 158b6193d..f9d9fb964 100644 --- a/src/main/resources/assets/create/lang/zh_cn.json +++ b/src/main/resources/assets/create/lang/zh_cn.json @@ -1232,7 +1232,7 @@ "create.tooltip.speedRequirement": "需求转速:%1$s", "create.tooltip.speedRequirement.none": "无", "create.tooltip.speedRequirement.medium": "适当", - "create.tooltip.speedRequirement.high": "快", + "create.tooltip.speedRequirement.fast": "快", "create.tooltip.stressImpact": "应力影响:%1$s", "create.tooltip.stressImpact.low": "低", "create.tooltip.stressImpact.medium": "中", diff --git a/src/main/resources/assets/create/lang/zh_tw.json b/src/main/resources/assets/create/lang/zh_tw.json index 70b74b490..8fbbdfc7b 100644 --- a/src/main/resources/assets/create/lang/zh_tw.json +++ b/src/main/resources/assets/create/lang/zh_tw.json @@ -1114,7 +1114,7 @@ "create.tooltip.speedRequirement": "需求速度:%1$s", "create.tooltip.speedRequirement.none": "無", "create.tooltip.speedRequirement.medium": "適當", - "create.tooltip.speedRequirement.high": "快", + "create.tooltip.speedRequirement.fast": "快", "create.tooltip.stressImpact": "動能消耗:%1$s", "create.tooltip.stressImpact.low": "低", "create.tooltip.stressImpact.medium": "中",