From 8e1e4e8bd3beb310e4e114e7d36134caf1c7eb79 Mon Sep 17 00:00:00 2001 From: caelwarner Date: Mon, 13 Mar 2023 18:31:56 -0700 Subject: [PATCH] Added computer to display source ponder tag - Added advanced computer to display source ponder tag - Added missing lang entry for computer display source --- src/generated/resources/assets/create/lang/en_us.json | 1 + .../create/foundation/ponder/content/PonderIndex.java | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/src/generated/resources/assets/create/lang/en_us.json b/src/generated/resources/assets/create/lang/en_us.json index f76d0b162..e390e9fe9 100644 --- a/src/generated/resources/assets/create/lang/en_us.json +++ b/src/generated/resources/assets/create/lang/en_us.json @@ -1706,6 +1706,7 @@ "create.display_source.redstone_power.progress_bar": "Progress Bar", "create.display_source.boiler.not_enough_space": "Not enough space ", "create.display_source.boiler.for_boiler_status": "for Boiler Status", + "create.display_source.computer_display_source": "From Computer", "create.display_target.line": "Line %1$s", "create.display_target.page": "Page %1$s", diff --git a/src/main/java/com/simibubi/create/foundation/ponder/content/PonderIndex.java b/src/main/java/com/simibubi/create/foundation/ponder/content/PonderIndex.java index ed44673e8..5abcce458 100644 --- a/src/main/java/com/simibubi/create/foundation/ponder/content/PonderIndex.java +++ b/src/main/java/com/simibubi/create/foundation/ponder/content/PonderIndex.java @@ -3,6 +3,7 @@ package com.simibubi.create.foundation.ponder.content; import com.simibubi.create.AllBlocks; import com.simibubi.create.AllItems; import com.simibubi.create.Create; +import com.simibubi.create.compat.Mods; import com.simibubi.create.foundation.config.AllConfigs; import com.simibubi.create.foundation.ponder.PonderRegistrationHelper; import com.simibubi.create.foundation.ponder.PonderRegistry; @@ -20,8 +21,11 @@ import com.simibubi.create.foundation.ponder.content.trains.TrainScenes; import com.simibubi.create.foundation.ponder.content.trains.TrainSignalScenes; import com.simibubi.create.foundation.ponder.content.trains.TrainStationScenes; +import net.minecraft.resources.ResourceLocation; import net.minecraft.world.item.DyeColor; +import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.Blocks; +import net.minecraftforge.registries.ForgeRegistries; public class PonderIndex { @@ -548,6 +552,12 @@ public class PonderIndex { .add(Blocks.COMMAND_BLOCK) .add(Blocks.TARGET); + Mods.COMPUTERCRAFT.executeIfInstalled(() -> () -> { + Block computer = ForgeRegistries.BLOCKS.getValue(new ResourceLocation(Mods.COMPUTERCRAFT.asId(), "computer_advanced")); + if (computer != null) + PonderRegistry.TAGS.forTag(PonderTag.DISPLAY_SOURCES).add(computer); + }); + PonderRegistry.TAGS.forTag(PonderTag.DISPLAY_TARGETS) .add(AllBlocks.ORANGE_NIXIE_TUBE) .add(AllBlocks.DISPLAY_BOARD)