diff options
Diffstat (limited to 'src/main/java/me/xmrvizzy/skyblocker/skyblock/dungeon')
-rw-r--r-- | src/main/java/me/xmrvizzy/skyblocker/skyblock/dungeon/DungeonMap.java | 34 | ||||
-rw-r--r-- | src/main/java/me/xmrvizzy/skyblocker/skyblock/dungeon/DungeonPuzzles.java | 34 |
2 files changed, 68 insertions, 0 deletions
diff --git a/src/main/java/me/xmrvizzy/skyblocker/skyblock/dungeon/DungeonMap.java b/src/main/java/me/xmrvizzy/skyblocker/skyblock/dungeon/DungeonMap.java new file mode 100644 index 00000000..61e747d0 --- /dev/null +++ b/src/main/java/me/xmrvizzy/skyblocker/skyblock/dungeon/DungeonMap.java @@ -0,0 +1,34 @@ +package me.xmrvizzy.skyblocker.skyblock.dungeon; + +import net.minecraft.client.MinecraftClient; +import net.minecraft.client.gui.MapRenderer; +import net.minecraft.client.render.VertexConsumerProvider; +import net.minecraft.client.util.math.MatrixStack; +import net.minecraft.item.FilledMapItem; +import net.minecraft.item.ItemStack; +import net.minecraft.item.map.MapState; +import net.minecraft.nbt.CompoundTag; + +public class DungeonMap { + + public static void render(MatrixStack matrices) { + MinecraftClient client = MinecraftClient.getInstance(); + if (client.player == null && client.world == null) return; + ItemStack item = client.player.inventory.main.get(8); + CompoundTag tag = item.getTag(); + + if (tag != null && tag.contains("map")) { + VertexConsumerProvider.Immediate vertices = client.getBufferBuilders().getEffectVertexConsumers(); + MapRenderer map = client.gameRenderer.getMapRenderer(); + MapState state = FilledMapItem.getMapState(item, client.world); + + if (state == null) return; + matrices.push(); + matrices.translate(2, 2, 0); + matrices.scale(1, 1, 0); + map.draw(matrices, vertices, state, false, 15728880); + vertices.draw(); + matrices.pop(); + } + } +}
\ No newline at end of file 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 |