Search in sources :

Example 1 with Pair

use of io.github.lukebemish.excavated_variants.util.Pair in project excavated_variants by lukebemish.

the class ExcavatedVariantsClient method init.

public static void init() {
    LangBuilder langBuilder = new LangBuilder();
    Collection<String> modids = Services.PLATFORM.getModIds();
    // Texture/asset extraction. Not shared with common code, so it's not visible from the oreStoneList.
    Map<String, BaseStone> stoneMap = new HashMap<>();
    Map<String, List<BaseOre>> oreMap = new HashMap<>();
    for (ModData mod : ExcavatedVariants.getConfig().mods) {
        if (modids.containsAll(mod.mod_id)) {
            for (BaseStone stone : mod.provided_stones) {
                if (!ExcavatedVariants.getConfig().blacklist_stones.contains(stone.id)) {
                    stoneMap.put(stone.id, stone);
                }
            }
            for (BaseOre ore : mod.provided_ores) {
                if (!ExcavatedVariants.getConfig().blacklist_ores.contains(ore.id)) {
                    oreMap.computeIfAbsent(ore.id, k -> new ArrayList<>());
                    oreMap.get(ore.id).add(ore);
                }
            }
        }
    }
    List<String> extractedOres = new ArrayList<>();
    Map<String, Pair<BaseOre, BaseStone>> extractorMap = new HashMap<>();
    for (ModData mod : ExcavatedVariants.getConfig().mods) {
        if (modids.containsAll(mod.mod_id)) {
            Map<String, BaseStone> internalStoneMap = new HashMap<>();
            for (BaseStone stone : mod.provided_stones) {
                if (!ExcavatedVariants.getConfig().blacklist_stones.contains(stone.id)) {
                    internalStoneMap.put(stone.id, stone);
                }
            }
            for (BaseOre ore : mod.provided_ores) {
                if (!extractedOres.contains(ore.id)) {
                    for (String stone_id : ore.stone) {
                        if (internalStoneMap.get(stone_id) != null && extractorMap.get(ore.id) == null) {
                            var extractor = new Pair<>(ore, internalStoneMap.get(stone_id));
                            extractorMap.put(ore.id, extractor);
                        } else if (stoneMap.get(stone_id) != null && extractorMap.get(ore.id) == null) {
                            var extractor = new Pair<>(ore, stoneMap.get(stone_id));
                            extractorMap.put(ore.id, extractor);
                        }
                    }
                    extractedOres.add(ore.id);
                }
            }
        }
    }
    for (List<BaseOre> oreList : oreMap.values()) {
        BaseOre ore = oreList.get(0);
        for (String stone_id : ore.stone) {
            if (stoneMap.get(stone_id) != null && extractorMap.get(ore.id) == null) {
                var extractor = new Pair<>(ore, stoneMap.get(stone_id));
                extractorMap.put(ore.id, extractor);
            }
        }
    }
    List<Pair<BaseOre, BaseStone>> to_make = new ArrayList<>();
    ExcavatedVariants.setupMap();
    for (Pair<BaseOre, HashSet<BaseStone>> p : ExcavatedVariants.oreStoneList) {
        var ore = p.first();
        for (BaseStone stone : p.last()) {
            String full_id = stone.id + "_" + ore.id;
            to_make.add(new Pair<>(ore, stone));
            DynAssetGeneratorClientAPI.planLoadingStream(new ResourceLocation(ExcavatedVariants.MOD_ID, "models/item/" + full_id + ".json"), JsonHelper.getItemModel(full_id));
            langBuilder.add(full_id, stone, ore);
        }
    }
    DynAssetGeneratorClientAPI.planLoadingStream(new ResourceLocation(ExcavatedVariants.MOD_ID, "lang/en_us.json"), langBuilder.build());
    BlockStateAssembler.setupClientAssets(extractorMap.values(), to_make);
}
Also used : ModData(io.github.lukebemish.excavated_variants.data.ModData) BaseStone(io.github.lukebemish.excavated_variants.data.BaseStone) BaseOre(io.github.lukebemish.excavated_variants.data.BaseOre) ResourceLocation(net.minecraft.resources.ResourceLocation) Pair(io.github.lukebemish.excavated_variants.util.Pair)

Example 2 with Pair

use of io.github.lukebemish.excavated_variants.util.Pair in project excavated_variants by lukebemish.

the class BlockStateAssembler method getInfoFromBlockstate.

private static Pair<BlockModelDefinition, List<ResourceLocation>> getInfoFromBlockstate(ResourceLocation oreRl, BlockModelDefinition.Context ctx) throws IOException {
    ResourceLocation oreBS = new ResourceLocation(oreRl.getNamespace(), "blockstates/" + oreRl.getPath() + ".json");
    InputStream oreBSIS;
    try {
        oreBSIS = ClientPrePackRepository.getResource(oreBS);
    } catch (IOException e) {
        oreBSIS = BackupFetcher.provideBlockstateFile(oreRl);
    }
    BlockModelDefinition oreBMD = BlockModelDefinition.fromStream(ctx, new BufferedReader(new InputStreamReader(oreBSIS, StandardCharsets.UTF_8)));
    if (!oreBMD.isMultiPart()) {
        Set<ResourceLocation> oreModels = new HashSet<>();
        for (Map.Entry<String, MultiVariant> e : oreBMD.getVariants().entrySet()) {
            oreModels.addAll(e.getValue().getDependencies());
        }
        List<ResourceLocation> oreTextures = new ArrayList<>();
        for (ResourceLocation mRl : oreModels) {
            ResourceLocation actual = new ResourceLocation(mRl.getNamespace(), "models/" + mRl.getPath() + ".json");
            InputStream is;
            try {
                is = ClientPrePackRepository.getResource(actual);
            } catch (IOException e) {
                is = BackupFetcher.provideBlockModelFile(mRl);
            }
            BlockModelParser map = GSON.fromJson(new BufferedReader(new InputStreamReader(is, StandardCharsets.UTF_8)), BlockModelParser.class);
            if (map.textures != null) {
                for (String i : map.textures.values()) {
                    ResourceLocation o = ResourceLocation.of(i, ':');
                    oreTextures.add(new ResourceLocation(o.getNamespace(), "textures/" + o.getPath() + ".png"));
                }
            }
        }
        return new Pair<>(oreBMD, oreTextures);
    }
    return null;
}
Also used : BlockModelDefinition(net.minecraft.client.renderer.block.model.BlockModelDefinition) MultiVariant(net.minecraft.client.renderer.block.model.MultiVariant) ResourceLocation(net.minecraft.resources.ResourceLocation) Pair(io.github.lukebemish.excavated_variants.util.Pair)

Example 3 with Pair

use of io.github.lukebemish.excavated_variants.util.Pair in project excavated_variants by lukebemish.

the class BlockStateAssembler method getMap.

private static Map<ResourceLocation, Supplier<InputStream>> getMap(Collection<Pair<BaseOre, BaseStone>> original_pairs, List<Pair<BaseOre, BaseStone>> to_make) {
    BlockModelDefinition.Context ctx = new BlockModelDefinition.Context();
    Map<ResourceLocation, Supplier<InputStream>> resources = new HashMap<>();
    Map<String, Pair<BlockModelDefinition, List<ResourceLocation>>> oreInfoMap = new HashMap<>();
    Map<String, Pair<BlockModelDefinition, List<ResourceLocation>>> stoneInfoMap = new HashMap<>();
    Map<String, ArrayList<Triple<PaletteExtractor, ResourceLocation, Boolean>>> extractorMap = new HashMap<>();
    for (Pair<BaseOre, BaseStone> p : to_make) {
        var ore = p.first();
        var stone = p.last();
        try {
            if (!oreInfoMap.containsKey(ore.id)) {
                ResourceLocation oreRl = ore.block_id.get(0);
                oreInfoMap.put(ore.id, getInfoFromBlockstate(oreRl, ctx));
            }
            if (!stoneInfoMap.containsKey(stone.id)) {
                ResourceLocation stoneRl = stone.block_id;
                stoneInfoMap.put(stone.id, getInfoFromBlockstate(stoneRl, ctx));
            }
        } catch (IOException e) {
            // TODO: add stuff here
            // Potentially ignore this; it could be we're running too early.
            ExcavatedVariants.LOGGER.info(e);
        // throw new RuntimeException(e);
        }
    }
    for (Pair<BaseOre, BaseStone> p : original_pairs) {
        var ore = p.first();
        var base = p.last();
        try {
            if (!oreInfoMap.containsKey(ore.id)) {
                ResourceLocation oreRl = ore.block_id.get(0);
                oreInfoMap.put(ore.id, getInfoFromBlockstate(oreRl, ctx));
            }
            if (!stoneInfoMap.containsKey(base.id)) {
                ResourceLocation stoneRl = base.block_id;
                stoneInfoMap.put(base.id, getInfoFromBlockstate(stoneRl, ctx));
            }
            var stoneInfo = stoneInfoMap.get(base.id);
            var oreInfo = oreInfoMap.get(ore.id);
            if (stoneInfo != null && oreInfo != null && stoneInfo.last().size() >= 1 && oreInfo.last().size() >= 1) {
                ArrayList<Triple<PaletteExtractor, ResourceLocation, Boolean>> extractors = new ArrayList<>();
                extractorMap.put(ore.id, extractors);
                for (ResourceLocation rl : oreInfo.last()) {
                    var is = ClientPrePackRepository.getResource(rl);
                    var img = NativeImage.read(is);
                    boolean isTransparent = false;
                    outer: for (int x = 0; x < img.getWidth(); x++) {
                        for (int y = 0; y < img.getHeight(); y++) {
                            int c = img.getPixelRGBA(x, y);
                            float alpha = (c >> 24 & 255) / 255.0F;
                            if (alpha < 0.5f) {
                                isTransparent = true;
                                break outer;
                            }
                        }
                    }
                    PaletteExtractor extractor = isTransparent ? null : new PaletteExtractor(stoneInfo.last().get(0), rl, 6, true, true, 0.2).fillHoles(true);
                    extractors.add(new Triple<>(extractor, rl, !isTransparent));
                }
            } else {
                ExcavatedVariants.LOGGER.warn("Bad info while extracting from blocks {} and {}:{}", ore.block_id.get(0).toString(), base.block_id.toString(), (stoneInfo == null ? "\nMissing stone block model info" : "") + (oreInfo == null ? "\nMissing ore block model info" : "") + (stoneInfo != null && (stoneInfo.last().size() < 1) ? "\nNo stone textures found" : "") + (oreInfo != null && (oreInfo.last().size() < 1) ? "\nNo ore textures found" : ""));
            }
        } catch (IOException e) {
            // TODO: add stuff here
            // Potentially ignore this; it could be we're running too early.
            ExcavatedVariants.LOGGER.info(e);
        // throw new RuntimeException(e);
        } catch (JsonSyntaxException e) {
            // TODO: add other stuff here
            ExcavatedVariants.LOGGER.error(e);
        // throw new RuntimeException(e);
        }
    }
    for (Pair<BaseOre, BaseStone> p : to_make) {
        var oreInfo = oreInfoMap.get(p.first().id);
        var stoneInfo = stoneInfoMap.get(p.last().id);
        var extractorPair = extractorMap.get(p.first().id);
        var stone = p.last();
        var ore = p.first();
        var full_id = stone.id + "_" + ore.id;
        var outBlock = ExcavatedVariants.getBlocks().get(full_id);
        if (oreInfo != null && stoneInfo != null && extractorPair != null && outBlock != null) {
            // stone, ore -> new
            Map<Pair<ResourceLocation, ResourceLocation>, ResourceLocation> texMap = new HashMap<>();
            // First, create new textures:
            int index = 0;
            for (ResourceLocation stoneBG : stoneInfo.last()) {
                for (Triple<PaletteExtractor, ResourceLocation, Boolean> exp : extractorPair) {
                    if (exp.last()) {
                        IPalettePlan plan = new ForegroundTransferType(exp.first(), stoneBG, true, false);
                        ResourceLocation outRL = new ResourceLocation(ExcavatedVariants.MOD_ID, "textures/block/" + full_id + index + ".png");
                        index++;
                        resources.put(outRL, plan.getStream(outRL));
                        texMap.put(new Pair<>(stoneBG, exp.second()), outRL);
                    } else {
                        texMap.put(new Pair<>(stoneBG, exp.second()), exp.second());
                    }
                }
            }
            HashMap<Pair<ResourceLocation, ResourceLocation>, ResourceLocation> newTexMap = new HashMap<>();
            for (Pair<ResourceLocation, ResourceLocation> pair : texMap.keySet()) {
                var p1 = pair.first().getPath().substring(9);
                p1 = p1.substring(0, p1.length() - 4);
                var rl1 = new ResourceLocation(pair.first().getNamespace(), p1);
                p1 = pair.last().getPath().substring(9);
                p1 = p1.substring(0, p1.length() - 4);
                var rl2 = new ResourceLocation(pair.last().getNamespace(), p1);
                p1 = texMap.get(pair).getPath().substring(9);
                p1 = p1.substring(0, p1.length() - 4);
                var rl3 = new ResourceLocation(texMap.get(pair).getNamespace(), p1);
                newTexMap.put(new Pair<>(rl1, rl2), rl3);
            }
            // Next, process the models:
            var defaultModels = oreInfo.first().getMultiVariants().stream().findFirst().get().getVariants().stream().map(Variant::getModelLocation).toList();
            var stoneModel = stoneInfo.first().getMultiVariants().stream().findFirst().get().getVariants().stream().map(Variant::getModelLocation).findFirst().get();
            var outModelRLs = new ArrayList<ResourceLocation>();
            try {
                InputStream read;
                try {
                    read = ClientPrePackRepository.getResource(new ResourceLocation(stoneModel.getNamespace(), "models/" + stoneModel.getPath() + ".json"));
                } catch (IOException e) {
                    read = BackupFetcher.provideBlockModelFile(stoneModel);
                }
                BlockModelParser parentModel = GSON.fromJson(new BufferedReader(new InputStreamReader(read, StandardCharsets.UTF_8)), BlockModelParser.class);
                List<ResourceLocation> stoneLocs = parentModel.textures.values().stream().map(x -> ResourceLocation.of(x, ':')).toList();
                int i2 = 0;
                for (ResourceLocation m : defaultModels) {
                    InputStream stoneRead;
                    try {
                        stoneRead = ClientPrePackRepository.getResource(new ResourceLocation(stoneModel.getNamespace(), "models/" + stoneModel.getPath() + ".json"));
                    } catch (IOException e) {
                        stoneRead = BackupFetcher.provideBlockModelFile(stoneModel);
                    }
                    BlockModelParser outputModel = GSON.fromJson(new BufferedReader(new InputStreamReader(stoneRead, StandardCharsets.UTF_8)), BlockModelParser.class);
                    try {
                        stoneRead = ClientPrePackRepository.getResource(new ResourceLocation(stoneModel.getNamespace(), "models/" + stoneModel.getPath() + ".json"));
                    } catch (IOException e) {
                        stoneRead = BackupFetcher.provideBlockModelFile(stoneModel);
                    }
                    JsonObject outputMap = GSON.fromJson(new BufferedReader(new InputStreamReader(stoneRead, StandardCharsets.UTF_8)), JsonObject.class);
                    InputStream oreRead;
                    try {
                        oreRead = ClientPrePackRepository.getResource(new ResourceLocation(m.getNamespace(), "models/" + m.getPath() + ".json"));
                    } catch (IOException e) {
                        oreRead = BackupFetcher.provideBlockModelFile(m);
                    }
                    StringBuilder oreTextBuilder = new StringBuilder();
                    Reader oreReader = new BufferedReader(new InputStreamReader(oreRead, Charset.forName(StandardCharsets.UTF_8.name())));
                    int oreC = 0;
                    while ((oreC = oreReader.read()) != -1) {
                        oreTextBuilder.append((char) oreC);
                    }
                    BlockModelParser oreModel = GSON.fromJson(oreTextBuilder.toString(), BlockModelParser.class);
                    String maybeTex = oreModel.textures.values().stream().filter(x -> !stoneLocs.contains(ResourceLocation.of(x, ':')) && newTexMap.keySet().stream().anyMatch(y -> {
                        var rl = ResourceLocation.of(x, ':');
                        return y.last().equals(rl);
                    })).findFirst().orElse(null);
                    ResourceLocation mainOreTex = maybeTex == null ? null : ResourceLocation.of(maybeTex, ':');
                    var overlayTextures = oreModel.textures.values().stream().filter(x -> newTexMap.entrySet().stream().anyMatch(e -> {
                        var y = e.getKey();
                        var rl = ResourceLocation.of(x, ':');
                        return y.last().equals(rl) && y.last().equals(e.getValue());
                    })).toList();
                    for (String s : outputModel.textures.keySet()) {
                        String val = outputModel.textures.get(s);
                        ResourceLocation old = ResourceLocation.of(val, ':');
                        ResourceLocation lookup = newTexMap.get(new Pair<>(old, mainOreTex));
                        if (lookup != null)
                            outputModel.replaceTexture(old, lookup);
                    }
                    int i = 0;
                    for (String s : overlayTextures) {
                        var rl = ResourceLocation.of(s, ':');
                        outputModel.addOverlay(i, rl);
                        i++;
                    }
                    outputMap.add("textures", GSON.toJsonTree(outputModel.textures));
                    if (outputModel.elements != null && outputModel.elements.size() != 0)
                        outputMap.add("elements", outputModel.elements);
                    var outModelRL = new ResourceLocation(ExcavatedVariants.MOD_ID, "block/" + full_id + i2);
                    outModelRLs.add(outModelRL);
                    String finalJson = GSON.toJson(outputMap);
                    resources.put(new ResourceLocation(ExcavatedVariants.MOD_ID, "models/" + outModelRL.getPath() + ".json"), () -> new ByteArrayInputStream(finalJson.getBytes()));
                    i2++;
                }
                // Create output BS
                var assembler = BlockstateModelParser.create(outBlock, outModelRLs);
                String bs = GSON.toJson(assembler);
                resources.put(new ResourceLocation(ExcavatedVariants.MOD_ID, "blockstates/" + full_id + ".json"), () -> new ByteArrayInputStream(bs.getBytes()));
            } catch (IOException e) {
                // TODO: add stuff here
                ExcavatedVariants.LOGGER.error(e);
            // throw new RuntimeException(e);
            }
        } else {
            ExcavatedVariants.LOGGER.warn("Missing {}for ore {}", "" + (oreInfo == null ? "ore model info, " : "") + (stoneInfo == null ? "stone model info, " : "") + (extractorPair == null ? "texture extractor info, " : "") + (outBlock == null ? "registered block, " : ""), full_id);
        }
    }
    return resources;
}
Also used : ResourceLocation(net.minecraft.resources.ResourceLocation) JsonObject(com.google.gson.JsonObject) MultiVariant(net.minecraft.client.renderer.block.model.MultiVariant) java.util(java.util) BaseStone(io.github.lukebemish.excavated_variants.data.BaseStone) PaletteExtractor(io.github.lukebemish.dynamic_asset_generator.client.api.PaletteExtractor) JsonSyntaxException(com.google.gson.JsonSyntaxException) Pair(io.github.lukebemish.excavated_variants.util.Pair) ExcavatedVariants(io.github.lukebemish.excavated_variants.ExcavatedVariants) Supplier(java.util.function.Supplier) GsonBuilder(com.google.gson.GsonBuilder) StandardCharsets(java.nio.charset.StandardCharsets) ForegroundTransferType(io.github.lukebemish.dynamic_asset_generator.client.api.ForegroundTransferType) IPalettePlan(io.github.lukebemish.dynamic_asset_generator.client.util.IPalettePlan) BlockModelDefinition(net.minecraft.client.renderer.block.model.BlockModelDefinition) Variant(net.minecraft.client.renderer.block.model.Variant) java.io(java.io) Charset(java.nio.charset.Charset) Gson(com.google.gson.Gson) Triple(io.github.lukebemish.excavated_variants.util.Triple) DynAssetGeneratorClientAPI(io.github.lukebemish.dynamic_asset_generator.client.api.DynAssetGeneratorClientAPI) NativeImage(com.mojang.blaze3d.platform.NativeImage) ClientPrePackRepository(io.github.lukebemish.dynamic_asset_generator.client.api.ClientPrePackRepository) BaseOre(io.github.lukebemish.excavated_variants.data.BaseOre) ForegroundTransferType(io.github.lukebemish.dynamic_asset_generator.client.api.ForegroundTransferType) JsonObject(com.google.gson.JsonObject) BaseOre(io.github.lukebemish.excavated_variants.data.BaseOre) ResourceLocation(net.minecraft.resources.ResourceLocation) IPalettePlan(io.github.lukebemish.dynamic_asset_generator.client.util.IPalettePlan) Supplier(java.util.function.Supplier) Pair(io.github.lukebemish.excavated_variants.util.Pair) BlockModelDefinition(net.minecraft.client.renderer.block.model.BlockModelDefinition) BaseStone(io.github.lukebemish.excavated_variants.data.BaseStone) Triple(io.github.lukebemish.excavated_variants.util.Triple) MultiVariant(net.minecraft.client.renderer.block.model.MultiVariant) Variant(net.minecraft.client.renderer.block.model.Variant) JsonSyntaxException(com.google.gson.JsonSyntaxException) PaletteExtractor(io.github.lukebemish.dynamic_asset_generator.client.api.PaletteExtractor)

Example 4 with Pair

use of io.github.lukebemish.excavated_variants.util.Pair in project excavated_variants by lukebemish.

the class ExcavatedVariants method internalSetupMap.

private static synchronized void internalSetupMap(Collection<String> modids) {
    // Yeah, yeah, I don't like static synchronized either. This way, though, it should only ever fire once, since
    // this is an internal method and only ever locks if the list is null or empty. And I don't really want to
    // build the list more than once, since that causes issues, so...
    oreStoneList = new ArrayList<>();
    Map<String, BaseStone> stoneMap = new HashMap<>();
    Map<String, List<BaseOre>> oreMap = new HashMap<>();
    for (ModData mod : ExcavatedVariants.getConfig().mods) {
        if (modids.containsAll(mod.mod_id)) {
            for (BaseStone stone : mod.provided_stones) {
                if (!ExcavatedVariants.getConfig().blacklist_stones.contains(stone.id)) {
                    stoneMap.put(stone.id, stone);
                }
            }
            for (BaseOre ore : mod.provided_ores) {
                if (!ExcavatedVariants.getConfig().blacklist_ores.contains(ore.id)) {
                    oreMap.computeIfAbsent(ore.id, k -> new ArrayList<>());
                    oreMap.get(ore.id).add(ore);
                }
            }
        }
    }
    for (String id : oreMap.keySet()) {
        List<BaseOre> oreList = oreMap.get(id);
        List<String> stones = new ArrayList<>();
        for (BaseOre ore : oreList) {
            stones.addAll(ore.stone);
        }
        Pair<BaseOre, HashSet<BaseStone>> pair = new Pair<>(oreList.get(0).clone(), new HashSet<>());
        if (oreList.size() > 1) {
            pair.first().block_id = new ArrayList<>();
            pair.first().orename = new ArrayList<>();
            pair.first().stone = new ArrayList<>();
            pair.first().types = new ArrayList<>();
            for (BaseOre baseOre : oreList) {
                pair.first().block_id.addAll(baseOre.block_id);
                pair.first().orename.addAll(baseOre.orename);
                pair.first().stone.addAll(baseOre.stone);
                pair.first().types.addAll(baseOre.types);
            }
            List<String> types = new HashSet<>(pair.first().types).stream().toList();
            pair.first().types.clear();
            pair.first().types.addAll(types);
            List<String> orenames = new HashSet<>(pair.first().orename).stream().toList();
            pair.first().orename.clear();
            pair.first().orename.addAll(orenames);
        }
        oreStoneList.add(pair);
        for (BaseStone stone : stoneMap.values()) {
            if (!stones.contains(stone.id) && oreList.stream().anyMatch(x -> x.types.stream().anyMatch(stone.types::contains))) {
                String full_id = stone.id + "_" + id;
                if (!ExcavatedVariants.getConfig().blacklist_ids.contains(full_id)) {
                    pair.last().add(stone);
                }
            }
        }
    }
    var listListeners = Services.COMPAT.getOreListModifiers();
    for (IOreListModifier listListener : listListeners) {
        oreStoneList = listListener.modify(oreStoneList, stoneMap.values());
    }
    HashSet<String> done_ids = new HashSet<>();
    ArrayList<Pair<BaseOre, HashSet<BaseStone>>> out = new ArrayList<>();
    for (Pair<BaseOre, HashSet<BaseStone>> p : oreStoneList) {
        BaseOre ore = p.first();
        if (!done_ids.contains(ore.id)) {
            done_ids.add(ore.id);
            Pair<BaseOre, HashSet<BaseStone>> o = new Pair<>(ore, new HashSet<>());
            out.add(o);
            for (BaseStone stone : p.last()) {
                String full_id = stone.id + "_" + ore.id;
                if (!ExcavatedVariants.getConfig().blacklist_ids.contains(full_id)) {
                    o.last().add(stone);
                }
            }
        }
    }
    oreStoneList = out;
}
Also used : OreConversionRecipe(io.github.lukebemish.excavated_variants.recipe.OreConversionRecipe) ResourceLocation(net.minecraft.resources.ResourceLocation) NoneFeatureConfiguration(net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration) java.util(java.util) BaseStone(io.github.lukebemish.excavated_variants.data.BaseStone) Item(net.minecraft.world.item.Item) BiFunction(java.util.function.BiFunction) Pair(io.github.lukebemish.excavated_variants.util.Pair) Supplier(java.util.function.Supplier) DynAssetGeneratorServerAPI(io.github.lukebemish.dynamic_asset_generator.api.DynAssetGeneratorServerAPI) Services(io.github.lukebemish.excavated_variants.platform.Services) BiConsumer(java.util.function.BiConsumer) BaseOre(io.github.lukebemish.excavated_variants.data.BaseOre) BlockItem(net.minecraft.world.item.BlockItem) RecipeSerializer(net.minecraft.world.item.crafting.RecipeSerializer) IOreListModifier(io.github.lukebemish.excavated_variants.api.IOreListModifier) SimpleRecipeSerializer(net.minecraft.world.item.crafting.SimpleRecipeSerializer) ClientServices(io.github.lukebemish.excavated_variants.client.ClientServices) ConfiguredFeature(net.minecraft.world.level.levelgen.feature.ConfiguredFeature) Logger(org.apache.logging.log4j.Logger) PlacedFeature(net.minecraft.world.level.levelgen.placement.PlacedFeature) ModConfig(io.github.lukebemish.excavated_variants.data.ModConfig) Block(net.minecraft.world.level.block.Block) LogManager(org.apache.logging.log4j.LogManager) ModData(io.github.lukebemish.excavated_variants.data.ModData) ModData(io.github.lukebemish.excavated_variants.data.ModData) BaseStone(io.github.lukebemish.excavated_variants.data.BaseStone) BaseOre(io.github.lukebemish.excavated_variants.data.BaseOre) IOreListModifier(io.github.lukebemish.excavated_variants.api.IOreListModifier) Pair(io.github.lukebemish.excavated_variants.util.Pair)

Aggregations

Pair (io.github.lukebemish.excavated_variants.util.Pair)4 ResourceLocation (net.minecraft.resources.ResourceLocation)4 BaseOre (io.github.lukebemish.excavated_variants.data.BaseOre)3 BaseStone (io.github.lukebemish.excavated_variants.data.BaseStone)3 ModData (io.github.lukebemish.excavated_variants.data.ModData)2 java.util (java.util)2 Supplier (java.util.function.Supplier)2 BlockModelDefinition (net.minecraft.client.renderer.block.model.BlockModelDefinition)2 MultiVariant (net.minecraft.client.renderer.block.model.MultiVariant)2 Gson (com.google.gson.Gson)1 GsonBuilder (com.google.gson.GsonBuilder)1 JsonObject (com.google.gson.JsonObject)1 JsonSyntaxException (com.google.gson.JsonSyntaxException)1 NativeImage (com.mojang.blaze3d.platform.NativeImage)1 DynAssetGeneratorServerAPI (io.github.lukebemish.dynamic_asset_generator.api.DynAssetGeneratorServerAPI)1 ClientPrePackRepository (io.github.lukebemish.dynamic_asset_generator.client.api.ClientPrePackRepository)1 DynAssetGeneratorClientAPI (io.github.lukebemish.dynamic_asset_generator.client.api.DynAssetGeneratorClientAPI)1 ForegroundTransferType (io.github.lukebemish.dynamic_asset_generator.client.api.ForegroundTransferType)1 PaletteExtractor (io.github.lukebemish.dynamic_asset_generator.client.api.PaletteExtractor)1 IPalettePlan (io.github.lukebemish.dynamic_asset_generator.client.util.IPalettePlan)1