From df3eb315d2bdcb398af60a38dc44a4e739fd2128 Mon Sep 17 00:00:00 2001 From: Alexey Krainev Date: Tue, 19 Jan 2021 22:23:47 +0500 Subject: v1.0.2 --- .../skyblock/dungeon/DungeonPuzzles.java | 34 ++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 src/main/java/me/xmrvizzy/skyblocker/skyblock/dungeon/DungeonPuzzles.java (limited to 'src/main/java/me/xmrvizzy/skyblocker/skyblock/dungeon/DungeonPuzzles.java') diff --git a/src/main/java/me/xmrvizzy/skyblocker/skyblock/dungeon/DungeonPuzzles.java b/src/main/java/me/xmrvizzy/skyblocker/skyblock/dungeon/DungeonPuzzles.java new file mode 100644 index 00000000..3fae82cd --- /dev/null +++ b/src/main/java/me/xmrvizzy/skyblocker/skyblock/dungeon/DungeonPuzzles.java @@ -0,0 +1,34 @@ +package me.xmrvizzy.skyblocker.skyblock.dungeon; + +import net.minecraft.client.MinecraftClient; +import net.minecraft.entity.decoration.ArmorStandEntity; +import net.minecraft.text.Text; +import net.minecraft.util.Formatting; + +public class DungeonPuzzles { + + public static void threeWeirdos(String message) { + MinecraftClient client = MinecraftClient.getInstance(); + if (client.player == null && client.world == null) return; + + String[] solutions = { + "The reward is not in my chest!", + "At least one of them is lying, and the reward is not in", + "My chest doesn't have the reward. We are all telling the truth.", + "My chest has the reward and I'm telling the truth!", + "The reward isn't in any of our chests.", + "Both of them are telling the truth. Also," + }; + + for (String s : solutions) { + if (message.contains(s)) { + String npc = message.substring(message.indexOf("]") + 4, message.indexOf(":") - 2); + client.world.getEntitiesByClass(ArmorStandEntity.class, client.player.getBoundingBox().expand(3), entity -> { + if (entity.hasCustomName() && entity.getCustomName().getString().contains(npc)) + return true; + return false; + }).forEach(entity -> entity.setCustomName(Text.of(Formatting.GREEN + npc))); + } + } + } +} \ No newline at end of file -- cgit