Search in sources :

Example 1 with MaterialIntegration

use of slimeknights.tconstruct.library.MaterialIntegration in project EnderIO by SleepyTrousers.

the class Metal method createFluid.

public static void createFluid(@Nonnull final Alloy alloy) {
    TicMaterials.setFluid(alloy, new Fluid(alloy.getFluidName(), TEX_FLOWING, TEX_STILL) {

        @Override
        public int getColor() {
            return 0xFF000000 | alloy.getColor();
        }
    }.setDensity(9000).setLuminosity(6).setTemperature(alloy.getMeltingPoint() + 273).setViscosity(3000));
    FluidRegistry.registerFluid(TicMaterials.getFluid(alloy));
    FluidRegistry.addBucketForFluid(TicMaterials.getFluid(alloy));
    TicMaterials.setMaterial(alloy, new Material(alloy.getBaseName(), alloy.getColor()));
    TicMaterials.getMaterial(alloy).addCommonItems(alloy.getOreName());
    TinkerRegistry.integrate(new MaterialIntegration(TicMaterials.getMaterial(alloy), TicMaterials.getFluid(alloy), alloy.getOreName()) {

        @Override
        public void registerFluidBlock(IForgeRegistry<Block> registry) {
        }
    }.toolforge()).preInit();
    TicMaterials.getData(alloy).stats(TicMaterials.getMaterial(alloy));
}
Also used : Fluid(net.minecraftforge.fluids.Fluid) MaterialIntegration(slimeknights.tconstruct.library.MaterialIntegration) Block(net.minecraft.block.Block) Material(slimeknights.tconstruct.library.materials.Material)

Example 2 with MaterialIntegration

use of slimeknights.tconstruct.library.MaterialIntegration in project SilentGems by SilentChaos512.

the class TConstructGemsCompat method preIntegrate.

// Copied from PlusTiC
private static void preIntegrate(Map<String, Material> materials, Map<String, MaterialIntegration> materialIntegrations, Map<String, CompletionStage<?>> materialIntegrationStages) {
    materials.forEach((k, v) -> {
        if (!materialIntegrations.containsKey(k)) {
            materialIntegrationStages.getOrDefault(k, CompletableFuture.completedFuture(null)).thenRun(() -> {
                MaterialIntegration mi;
                if (v.getRepresentativeItem().getItem() == Items.EMERALD) {
                    mi = new MaterialIntegration(v, v.getFluid());
                } else if (v.getFluid() != null) {
                    mi = new MaterialIntegration(v, v.getFluid(), k).toolforge();
                } else {
                    mi = new MaterialIntegration(v);
                }
                TinkerRegistry.integrate(mi).preInit();
                materialIntegrations.put(k, mi);
            });
        }
    });
}
Also used : MaterialIntegration(slimeknights.tconstruct.library.MaterialIntegration)

Example 3 with MaterialIntegration

use of slimeknights.tconstruct.library.MaterialIntegration in project BaseMetals by MinecraftModDevelopmentMods.

the class TinkersConstructRegistry method setupIntegrations.

/**
 */
public void setupIntegrations() {
    final String curMod = Loader.instance().activeModContainer().getModId();
    BaseMetals.logger.debug("setupIntegrations() for mod %s (%d integrations)", curMod, registry.get(curMod).size());
    for (final Entry<String, TCMaterial> entry : registry.get(curMod).entrySet()) {
        BaseMetals.logger.debug("processing material %s from mod %s", entry.getKey(), curMod);
        final TCMaterial material = entry.getValue();
        material.settle();
        material.setFluid(material.getMMDMaterial().getFluid());
        if (material.getCraftable()) {
            material.getMaterial().setCraftable(true);
        } else {
            material.getMaterial().setCastable(true);
        }
        MaterialIntegration integration = new MaterialIntegration(material.getMaterial(), material.getFluid(), material.getMMDMaterial().getCapitalizedName());
        if (material.getRepresentativeItemName() != null) {
            integration.setRepresentativeItem(material.getRepresentativeItemName());
        }
        if (material.toolForge()) {
            integration.toolforge();
        }
        final List<MaterialIntegration> cmi = integrations.getOrDefault(curMod, new ArrayList<>());
        cmi.add(integration);
        integrations.put(curMod, cmi);
        TinkerRegistry.integrate(integration);
        integration.preInit();
    }
}
Also used : MaterialIntegration(slimeknights.tconstruct.library.MaterialIntegration)

Example 4 with MaterialIntegration

use of slimeknights.tconstruct.library.MaterialIntegration in project EnderIO by SleepyTrousers.

the class Metal method createMaterial.

public static void createMaterial(@Nonnull final Alloy alloy) {
    TicMaterials.setMaterial(alloy, new Material(alloy.getBaseName(), alloy.getColor()));
    TicMaterials.getMaterial(alloy).addCommonItems(alloy.getOreName());
    TinkerRegistry.integrate(new MaterialIntegration(TicMaterials.getMaterial(alloy), null, alloy.getOreName()) {

        @Override
        public void registerFluidBlock(IForgeRegistry<Block> registry) {
        }
    }).preInit();
    TicMaterials.getData(alloy).stats(TicMaterials.getMaterial(alloy));
}
Also used : MaterialIntegration(slimeknights.tconstruct.library.MaterialIntegration) IForgeRegistry(net.minecraftforge.registries.IForgeRegistry) Material(slimeknights.tconstruct.library.materials.Material)

Aggregations

MaterialIntegration (slimeknights.tconstruct.library.MaterialIntegration)4 Material (slimeknights.tconstruct.library.materials.Material)2 Block (net.minecraft.block.Block)1 Fluid (net.minecraftforge.fluids.Fluid)1 IForgeRegistry (net.minecraftforge.registries.IForgeRegistry)1