Search in sources :

Example 1 with TCMaterial

use of com.mcmoddev.lib.integration.plugins.tinkers.TCMaterial in project BaseMetals by MinecraftModDevelopmentMods.

the class TinkersConstructBase method registerMaterial.

/**
 * Creates a Tinkers Construct
 * {@link slimeknights.tconstruct.library.materials.Material}.
 *
 * @param material
 *            Material identifier
 * @param craftable
 *            If this be crafted
 * @param castable
 *            If this can be casted
 * @return a handle for potential, further manipulation of the material
 */
protected static TCMaterial registerMaterial(@Nonnull final MMDMaterial material, @Nonnull final boolean craftable, @Nonnull final boolean castable) {
    final TCMaterial tcm = registry.newMaterial(material.getName(), material.getTintColor());
    if (craftable) {
        tcm.setCraftable();
    }
    if (castable) {
        tcm.setCastable();
    }
    tcm.setSourceMaterial(material);
    tcm.genStatsFromSource();
    return tcm;
}
Also used : TCMaterial(com.mcmoddev.lib.integration.plugins.tinkers.TCMaterial)

Example 2 with TCMaterial

use of com.mcmoddev.lib.integration.plugins.tinkers.TCMaterial in project BaseMetals by MinecraftModDevelopmentMods.

the class TinkersConstruct method registerMaterial.

private void registerMaterial(final String name, final boolean castable, final boolean craftable, final String... traits) {
    if (!Materials.hasMaterial(name)) {
        return;
    }
    final MMDMaterial mmdMat = Materials.getMaterialByName(name);
    final TCMaterial mat = registry.newMaterial(name, mmdMat.getTintColor());
    if (mmdMat.isEmpty()) {
        return;
    }
    if (castable) {
        mat.setCastable();
    }
    if (craftable) {
        mat.setCraftable();
    }
    mat.setSourceMaterial(mmdMat);
    mat.genStatsFromSource();
    if (traits.length > 0) {
        addTraits(mat, traits);
    }
    mat.settle();
}
Also used : MMDMaterial(com.mcmoddev.lib.material.MMDMaterial) TCMaterial(com.mcmoddev.lib.integration.plugins.tinkers.TCMaterial)

Aggregations

TCMaterial (com.mcmoddev.lib.integration.plugins.tinkers.TCMaterial)2 MMDMaterial (com.mcmoddev.lib.material.MMDMaterial)1