Skip to content
This repository has been archived by the owner on Aug 20, 2022. It is now read-only.

Sumo Fences unsupported map #136

Open
Lightcaster5 opened this issue Jun 7, 2022 · 1 comment
Open

Sumo Fences unsupported map #136

Lightcaster5 opened this issue Jun 7, 2022 · 1 comment

Comments

@Lightcaster5
Copy link

Lightcaster5 commented Jun 7, 2022

There is a new map to be added for the module Sumo Fences to work. The map name is "Fort Royale".

private final List<String> m = Arrays.asList("Sumo", "Space Mine", "White Crystal");

UPDATE:
Got things fixed myself, the new map is actually higher up than the others (by 7 blocks)
Just made the following method:

private int higher() {
    if (Utils.Client.isHyp()) {
        for (String l: Utils.Client.getPlayersFromScoreboard()) {
            String s = Utils.Java.str(l);
            if (s.startsWith("Map:")) {
                String mapName = s.substring(5);
                if (mapName.equalsIgnoreCase("Fort Royale")) {
                    return 7; // because the map is 7 blocks higher
                }
            }
        }
    }
    return 0; // other maps should be at the default height value
}

Here is the updated t method for the SumoFences for functionality:

public TimerTask t() {
    return new TimerTask() {
        public void run() {
            if (SumoFences.this.is()) {
                int a = higher(); // determines additional height of the map
                for (BlockPos p: SumoFences.f_p) {
                    for (int i = 0;
                        (double) i < SumoFences.b.getInput(); ++i) {
                        BlockPos p2 = new BlockPos(p.getX(), p.getY() + i + a, p.getZ()); // updated to use variable 'a'
                        if (Module.mc.theWorld.getBlockState(p2).getBlock() == Blocks.air) {
                            Module.mc.theWorld.setBlockState(p2, SumoFences.this.f);
                        }
                    }
                }
            }
        }
    }
}
@tyLunar
Copy link

tyLunar commented Jun 15, 2022

yes add this

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants