[OreSim] use version prop. instead of a setting

This commit is contained in:
C10udburst
2022-02-16 10:39:40 +01:00
parent cfcb4a683a
commit 6aaf590ebb
3 changed files with 44 additions and 63 deletions

View File

@@ -1,9 +1,9 @@
package anticope.rejects.utils;
import anticope.rejects.modules.OreSim;
import meteordevelopment.meteorclient.settings.BoolSetting;
import meteordevelopment.meteorclient.settings.Setting;
import meteordevelopment.meteorclient.utils.render.color.Color;
import com.seedfinding.mccore.version.MCVersion;
import net.minecraft.util.Identifier;
import net.minecraft.util.math.intprovider.ConstantIntProvider;
import net.minecraft.util.math.intprovider.IntProvider;
@@ -203,13 +203,14 @@ public class Ore {
return ores;
}
public static List<Ore> getConfig(OreSim.Version version) {
public static List<Ore> getConfig(MCVersion version) {
return switch (version) {
case V1_18 -> V1_18();
case V1_17_1 -> V1_17_1();
case V1_17_0 -> V1_17();
case V1_16 -> V1_16();
case V1_15, V1_14 -> V1_15();
case v1_18_1, v1_18 -> V1_18();
case v1_17_1 -> V1_17_1();
case v1_17 -> V1_17();
case v1_16_5, v1_16_4, v1_16_3, v1_16_2, v1_16_1, v1_16 -> V1_16();
case v1_15_2, v1_15_1, v1_15, v1_14_4, v1_14_3, v1_14_2, v1_14_1, v1_14 -> V1_15();
default -> null;
};
}

View File

@@ -280,36 +280,36 @@ public class WorldGenUtils {
}
private static Dimension getDimension(Feature feature) {
switch (feature) {
case buried_treasure -> { return Dimension.OVERWORLD; }
case mansion -> { return Dimension.OVERWORLD; }
case stronghold -> { return Dimension.OVERWORLD; }
case nether_fortress -> { return Dimension.NETHER; }
case ocean_monument -> { return Dimension.OVERWORLD; }
case bastion_remnant -> { return Dimension.NETHER; }
case slime_chunk -> { return Dimension.OVERWORLD; }
case village -> { return Dimension.OVERWORLD; }
case mineshaft -> { return Dimension.OVERWORLD; }
case end_city -> { return Dimension.END; }
case desert_pyramid -> { return Dimension.OVERWORLD; }
default -> { return Dimension.OVERWORLD; }
}
return switch (feature) {
case buried_treasure -> Dimension.OVERWORLD;
case mansion -> Dimension.OVERWORLD;
case stronghold -> Dimension.OVERWORLD;
case nether_fortress -> Dimension.NETHER;
case ocean_monument -> Dimension.OVERWORLD;
case bastion_remnant -> Dimension.NETHER;
case slime_chunk -> Dimension.OVERWORLD;
case village -> Dimension.OVERWORLD;
case mineshaft -> Dimension.OVERWORLD;
case end_city -> Dimension.END;
case desert_pyramid -> Dimension.OVERWORLD;
default -> Dimension.OVERWORLD;
};
}
private static Structure<?, ?> getStructure(Feature feature, MCVersion version) {
switch (feature) {
case buried_treasure -> { return new BuriedTreasure(version); }
case mansion -> { return new Mansion(version); }
case stronghold -> { return new Stronghold(version); }
case nether_fortress -> { return new Fortress(version); }
case ocean_monument -> { return new Monument(version); }
case bastion_remnant -> { return new BastionRemnant(version); }
case end_city -> { return new EndCity(version); }
case village -> { return new Village(version); }
case mineshaft -> { return new Mineshaft(version); }
case desert_pyramid -> { return new DesertPyramid(version); }
default -> { return null;}
}
return switch (feature) {
case buried_treasure -> new BuriedTreasure(version);
case mansion -> new Mansion(version);
case stronghold -> new Stronghold(version);
case nether_fortress -> new Fortress(version);
case ocean_monument -> new Monument(version);
case bastion_remnant -> new BastionRemnant(version);
case end_city -> new EndCity(version);
case village -> new Village(version);
case mineshaft -> new Mineshaft(version);
case desert_pyramid -> new DesertPyramid(version);
default -> null;
};
}
private static BlockPos toBlockPos(BPos pos) {