Revert "visuallise structure regions"

This reverts commit 0a87a2b81bae3c3efb72d4fb87663684eaa9169d.
This commit is contained in:
misterx
2022-01-30 01:03:15 +01:00
committed by Cloudburst
parent 60c6d20cc5
commit 40c13104c3
3 changed files with 1 additions and 76 deletions

View File

@@ -69,7 +69,6 @@ public class MeteorRejectsAddon extends MeteorAddon {
modules.add(new Rendering());
modules.add(new SkeletonESP());
modules.add(new SoundLocator());
modules.add(new StructureRegions());
// Module modifications
NoRenderModifier.init();

View File

@@ -1,74 +0,0 @@
package anticope.rejects.modules;
import anticope.rejects.MeteorRejectsAddon;
import anticope.rejects.utils.WorldGenUtils;
import kaptainwutax.featureutils.structure.*;
import kaptainwutax.mcutils.version.MCVersion;
import meteordevelopment.meteorclient.events.render.Render3DEvent;
import meteordevelopment.meteorclient.renderer.ShapeMode;
import meteordevelopment.meteorclient.settings.EnumSetting;
import meteordevelopment.meteorclient.settings.Setting;
import meteordevelopment.meteorclient.settings.SettingGroup;
import meteordevelopment.meteorclient.systems.modules.Module;
import meteordevelopment.meteorclient.utils.render.color.Color;
import meteordevelopment.orbit.EventHandler;
public class StructureRegions extends Module {
private final SettingGroup sgGeneral = settings.getDefaultGroup();
private int spacing = 20;
private int separation = 11;
private int size = 9;
private final Setting<WorldGenUtils.Feature> regionEnum = sgGeneral.add(new EnumSetting.Builder<WorldGenUtils.Feature>()
.name("Structure")
.description("Select the structure region")
.defaultValue(WorldGenUtils.Feature.end_city)
.onChanged(this::onChanged)
.build()
);
public StructureRegions() {
super(MeteorRejectsAddon.CATEGORY, "Structure regions", "show spawnable regions for specific structures");
}
private void onChanged(WorldGenUtils.Feature struc) {
Structure<?, ?> structure = WorldGenUtils.getStructure(struc, MCVersion.latest());
if (structure instanceof RegionStructure<?, ?> regionStructure) {
spacing = regionStructure.getSpacing();
separation = regionStructure.getSeparation();
size = (regionStructure.getSpacing() - regionStructure.getSeparation()) * 16;
}
}
@EventHandler
public void onRender(Render3DEvent event) {
int viewDistance = mc.options.viewDistance + 1;
viewDistance *= 16;
int negX = getRegion(event.offsetX - viewDistance);
int negZ = getRegion(event.offsetZ - viewDistance);
int posX = getRegion(event.offsetX + viewDistance);
int posZ = getRegion(event.offsetZ + viewDistance);
for (int x = negX; x <= posX; x++) {
for (int z = negZ; z <= posZ; z++) {
int blockX = x * spacing * 16;
int blockZ = z * spacing * 16;
event.renderer.box(blockX, 64, blockZ, blockX + size, 64, blockZ + size, new Color(0, 0, 0, 0), new Color(255, 0, 0), ShapeMode.Lines, 0);
}
}
}
private int getRegion(double coord) {
int region = ((int) coord / 16 + separation / 2) / spacing;
if (coord < 0) {
region--;
}
return region;
}
}

View File

@@ -296,7 +296,7 @@ public class WorldGenUtils {
}
}
public static Structure<?, ?> getStructure(Feature feature, MCVersion version) {
private static Structure<?, ?> getStructure(Feature feature, MCVersion version) {
switch (feature) {
case buried_treasure -> { return new BuriedTreasure(version); }
case mansion -> { return new Mansion(version); }