diff options
| author | Alexey Krainev <xmrvizzy@ya.ru> | 2021-01-19 22:23:47 +0500 |
|---|---|---|
| committer | Alexey Krainev <xmrvizzy@ya.ru> | 2021-01-19 22:23:47 +0500 |
| commit | df3eb315d2bdcb398af60a38dc44a4e739fd2128 (patch) | |
| tree | 60c2c3a0b83a3a7624539914c42667e92f0465a5 /src/main/java/me/xmrvizzy/skyblocker/skyblock | |
| parent | 83918b58ef710f5e425ff6b5577f43382921300f (diff) | |
| download | Skyblocker-df3eb315d2bdcb398af60a38dc44a4e739fd2128.tar.gz Skyblocker-df3eb315d2bdcb398af60a38dc44a4e739fd2128.tar.bz2 Skyblocker-df3eb315d2bdcb398af60a38dc44a4e739fd2128.zip | |
v1.0.2
Diffstat (limited to 'src/main/java/me/xmrvizzy/skyblocker/skyblock')
4 files changed, 123 insertions, 0 deletions
diff --git a/src/main/java/me/xmrvizzy/skyblocker/skyblock/Attribute.java b/src/main/java/me/xmrvizzy/skyblocker/skyblock/Attribute.java new file mode 100644 index 00000000..45532642 --- /dev/null +++ b/src/main/java/me/xmrvizzy/skyblocker/skyblock/Attribute.java @@ -0,0 +1,21 @@ +package me.xmrvizzy.skyblocker.skyblock; + +public enum Attribute { + HEALTH(100), + MAX_HEALTH(100), + MANA(100), + MAX_MANA(100), + DEFENCE(0); + + private int value; + Attribute(int value) { + this.value = value; + } + + public int get() { + return value; + } + public void set(int value) { + this.value = value; + } +}
\ No newline at end of file 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 diff --git a/src/main/java/me/xmrvizzy/skyblocker/skyblock/dwarven/Puzzler.java b/src/main/java/me/xmrvizzy/skyblocker/skyblock/dwarven/Puzzler.java new file mode 100644 index 00000000..07ae26a3 --- /dev/null +++ b/src/main/java/me/xmrvizzy/skyblocker/skyblock/dwarven/Puzzler.java @@ -0,0 +1,34 @@ +package me.xmrvizzy.skyblocker.skyblock.dwarven; + +import net.minecraft.block.Blocks; +import net.minecraft.client.MinecraftClient; +import net.minecraft.util.Formatting; +import net.minecraft.util.math.BlockPos; + +public class Puzzler { + public static void puzzler(String message) { + MinecraftClient client = MinecraftClient.getInstance(); + if (client.player == null && client.world == null) return; + + int x = 181; + int y = 195; + int z = 135; + + String path = Formatting.strip(message); + path = path.substring(path.indexOf(":") + 1); + String check = path + .replaceAll("▲", "").replaceAll("▶", "") + .replaceAll("▼", "").replaceAll("◀", ""); + + if (check.isEmpty()) { + for (char c : path.toCharArray()) { + if (c == '▲') z += 1; + if (c == '▶') x -= 1; + if (c == '▼') z -= 1; + if (c == '◀') x += 1; + } + + client.world.setBlockState(new BlockPos(x, y, z), Blocks.EMERALD_BLOCK.getDefaultState()); + } + } +}
\ No newline at end of file |
