summaryrefslogtreecommitdiff
path: root/src/main/java/net/justlearning/arslaan3102/arslaansmagichax/modules/impl/Xray.java
blob: 71163b5bcaa65c20bff0ab9db6144a4bdd7e765b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
package net.justlearning.arslaan3102.arslaansmagichax.modules.impl;

import net.justlearning.arslaan3102.arslaansmagichax.modules.Category;
import net.justlearning.arslaan3102.arslaansmagichax.modules.Module;
import net.justlearning.arslaan3102.arslaansmagichax.modules.settings.ModeSetting;
import net.minecraft.block.AbstractBlock;
import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks;
import net.minecraft.entity.effect.StatusEffectInstance;
import net.minecraft.entity.effect.StatusEffects;
import net.minecraft.registry.Registries;
import net.minecraft.text.Text;

import java.util.ArrayList;
import java.util.List;
import java.util.Objects;

public class Xray extends Module {
    private List<BlockState> interestingBlocks = new ArrayList<>();

    public Xray() {
        super("Xray", "Allows you to see through blocks.", -1, Category.RENDER);

        // Add ores, spawners, liquids, etc.
        interestingBlocks.add(Blocks.DIAMOND_ORE.getDefaultState());
        interestingBlocks.add(Blocks.DEEPSLATE_DIAMOND_ORE.getDefaultState());
        interestingBlocks.add(Blocks.GOLD_ORE.getDefaultState());
        interestingBlocks.add(Blocks.DEEPSLATE_GOLD_ORE.getDefaultState());
        interestingBlocks.add(Blocks.IRON_ORE.getDefaultState());
        interestingBlocks.add(Blocks.DEEPSLATE_IRON_ORE.getDefaultState());
        interestingBlocks.add(Blocks.REDSTONE_ORE.getDefaultState());
        interestingBlocks.add(Blocks.DEEPSLATE_REDSTONE_ORE.getDefaultState());
        interestingBlocks.add(Blocks.LAPIS_ORE.getDefaultState());
        interestingBlocks.add(Blocks.DEEPSLATE_LAPIS_ORE.getDefaultState());
        interestingBlocks.add(Blocks.EMERALD_ORE.getDefaultState());
        interestingBlocks.add(Blocks.DEEPSLATE_EMERALD_ORE.getDefaultState());
        interestingBlocks.add(Blocks.COAL_ORE.getDefaultState());
        interestingBlocks.add(Blocks.DEEPSLATE_COAL_ORE.getDefaultState());
        interestingBlocks.add(Blocks.COPPER_ORE.getDefaultState());
        interestingBlocks.add(Blocks.DEEPSLATE_COPPER_ORE.getDefaultState());
        interestingBlocks.add(Blocks.NETHER_QUARTZ_ORE.getDefaultState());
        interestingBlocks.add(Blocks.NETHER_GOLD_ORE.getDefaultState());
        interestingBlocks.add(Blocks.SPAWNER.getDefaultState());
        interestingBlocks.add(Blocks.CHEST.getDefaultState());
        interestingBlocks.add(Blocks.ANCIENT_DEBRIS.getDefaultState());
        interestingBlocks.add(Blocks.GLOWSTONE.getDefaultState());
        interestingBlocks.add(Blocks.WATER.getDefaultState());
        interestingBlocks.add(Blocks.LAVA.getDefaultState());
    }

    @Override
    protected void onEnable() {
        if (mc.worldRenderer != null) mc.worldRenderer.reload();

        if (mc.player != null) mc.player.sendMessage(Text.literal("[Xray] It is recommended to use this hack with Fullbright for a better experience."), false);
    }


    @Override
    protected void onDisable() {
        if (mc.worldRenderer != null) mc.worldRenderer.reload();
    }

    public boolean isInterestingBlock(BlockState state) {
        return interestingBlocks.contains(state);
    }

    // xraying is handled in BlockMixin.java
}