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;
}
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();
}
Aggregations