use of com.mcmoddev.lib.material.MMDMaterial in project BaseMetals by MinecraftModDevelopmentMods.
the class VillagerTrades method registerModSpecificTrades.
protected static void registerModSpecificTrades() {
if (Materials.hasMaterial(MaterialNames.CHARCOAL)) {
final MMDMaterial charcoal = Materials.getMaterialByName(MaterialNames.CHARCOAL);
if (charcoal.hasItem(Names.POWDER)) {
final Item charcoalPowder = charcoal.getItem(Names.POWDER);
final ITradeList[] charcoalTrades = makePurchasePalette(1, 10, charcoalPowder);
VillagerTradeHelper.insertTrades(SMITH_RL, ARMOR_SMITH_ID, 1, charcoalTrades);
VillagerTradeHelper.insertTrades(SMITH_RL, WEAPON_SMITH_ID, 1, charcoalTrades);
VillagerTradeHelper.insertTrades(SMITH_RL, TOOL_SMITH_ID, 1, charcoalTrades);
}
}
if (Materials.hasMaterial(MaterialNames.COAL)) {
final MMDMaterial coal = Materials.getMaterialByName(MaterialNames.COAL);
if (coal.hasItem(Names.POWDER)) {
final Item coalPowder = coal.getItem(Names.POWDER);
final ITradeList[] coalTrades = makePurchasePalette(1, 10, coalPowder);
VillagerTradeHelper.insertTrades(SMITH_RL, ARMOR_SMITH_ID, 1, coalTrades);
VillagerTradeHelper.insertTrades(SMITH_RL, WEAPON_SMITH_ID, 1, coalTrades);
VillagerTradeHelper.insertTrades(SMITH_RL, TOOL_SMITH_ID, 1, coalTrades);
}
}
}
use of com.mcmoddev.lib.material.MMDMaterial in project BaseMetals by MinecraftModDevelopmentMods.
the class BMeThaumcraft method makeSpecialMaterial.
private static void makeSpecialMaterial(String name) {
TCMaterial thisMat = tcMaterials.getOrDefault(name, Thaumcraft.createWithAspects(Materials.getMaterialByName(name)));
switch(name) {
case "mithril":
case "aquarium":
thisMat.addMaterialAspect(Aspect.MAGIC, 5);
break;
case "copper":
thisMat.addMaterialAspect(Aspect.EXCHANGE, 5);
break;
case "tin":
thisMat.addMaterialAspect(Aspect.CRYSTAL, 5);
break;
case "steel":
thisMat.addMaterialAspect(Aspect.ORDER, 5);
break;
case "brass":
case "bronze":
thisMat.addMaterialAspect(Aspect.TOOL, 5);
break;
case "silver":
case "diamond":
case "emerald":
MMDMaterial mat = thisMat.getMMDMaterial();
thisMat.addMaterialAspect(Aspect.DESIRE, (m) -> mat.isRare() ? (int) (mat.getStat(MaterialStats.MAGICAFFINITY) * 2 / 45 * m) : 5);
break;
}
tcMaterials.put(name, thisMat);
}
use of com.mcmoddev.lib.material.MMDMaterial in project BaseMetals by MinecraftModDevelopmentMods.
the class Items method registerItems.
/**
*/
@SubscribeEvent
public static void registerItems(MMDLibRegisterItems ev) {
final List<String> materials = Arrays.asList(MaterialNames.ADAMANTINE, MaterialNames.ANTIMONY, MaterialNames.AQUARIUM, MaterialNames.BISMUTH, MaterialNames.BRASS, MaterialNames.BRONZE, MaterialNames.COLDIRON, MaterialNames.COPPER, MaterialNames.CUPRONICKEL, MaterialNames.ELECTRUM, MaterialNames.INVAR, MaterialNames.LEAD, MaterialNames.MITHRIL, MaterialNames.NICKEL, MaterialNames.PEWTER, MaterialNames.PLATINUM, MaterialNames.SILVER, MaterialNames.STARSTEEL, MaterialNames.STEEL, MaterialNames.TIN, MaterialNames.ZINC);
// create and register modded stuffs
final List<String> materialsModSupport = Arrays.asList(MaterialNames.ADAMANTINE, MaterialNames.ANTIMONY, MaterialNames.BISMUTH, MaterialNames.COLDIRON, MaterialNames.PLATINUM, MaterialNames.NICKEL, MaterialNames.STARSTEEL, MaterialNames.ZINC);
materials.stream().filter(Materials::hasMaterial).filter(materialName -> !Materials.getMaterialByName(materialName).isEmpty()).forEach(materialName -> {
final MMDMaterial material = Materials.getMaterialByName(materialName);
create(Names.BLEND, material);
create(Names.INGOT, material);
create(Names.NUGGET, material);
create(Names.POWDER, material);
create(Names.SMALLBLEND, material);
create(Names.SMALLPOWDER, material);
create(Names.ARROW, material);
create(Names.AXE, material);
create(Names.BOLT, material);
create(Names.BOOTS, material);
create(Names.BOW, material);
create(Names.CHESTPLATE, material);
create(Names.CRACKHAMMER, material);
create(Names.CROSSBOW, material);
create(Names.DOOR, material);
create(Names.FISHING_ROD, material);
create(Names.HELMET, material);
create(Names.HOE, material);
create(Names.HORSE_ARMOR, material);
create(Names.LEGGINGS, material);
create(Names.PICKAXE, material);
create(Names.SHEARS, material);
create(Names.SHIELD, material);
create(Names.SHOVEL, material);
create(Names.SCYTHE, material);
create(Names.SLAB, material);
create(Names.SWORD, material);
create(Names.ROD, material);
create(Names.GEAR, material);
});
materials.stream().filter(Materials::hasMaterial).map(Materials::getMaterialByName).forEach(com.mcmoddev.basemetals.init.Items::setBurnTimes);
materialsModSupport.stream().filter(Materials::hasMaterial).filter(materialName -> !Materials.getMaterialByName(materialName).isEmpty()).forEach(materialName -> {
final MMDMaterial material = Materials.getMaterialByName(materialName);
create(Names.CASING, material);
create(Names.DENSE_PLATE, material);
if (material.hasOre()) {
create(Names.CRUSHED, material);
create(Names.CRUSHED_PURIFIED, material);
createMekCrystal(material, ItemGroups.getTab(SharedStrings.TAB_ITEMS));
create(Names.SHARD, material);
create(Names.CLUMP, material);
create(Names.POWDER_DIRTY, material);
create(Names.CRYSTAL, material);
}
});
if (Materials.hasMaterial(MaterialNames.MERCURY)) {
final MMDMaterial mercury = Materials.getMaterialByName(MaterialNames.MERCURY);
create(Names.INGOT, mercury);
create(Names.NUGGET, mercury);
create(Names.POWDER, mercury);
create(Names.SMALLPOWDER, mercury);
}
Arrays.asList(MaterialNames.STONE, MaterialNames.STEEL, MaterialNames.ADAMANTINE).stream().filter(Materials::hasMaterial).forEach(materialName -> create(Names.ANVIL, Materials.getMaterialByName(materialName)));
addToMetList();
MinecraftForge.EVENT_BUS.register(Items.class);
}
use of com.mcmoddev.lib.material.MMDMaterial in project BaseMetals by MinecraftModDevelopmentMods.
the class VanillaBlocks method registerVanilla.
@SubscribeEvent
public static void registerVanilla(MMDLibRegisterBlocks ev) {
// Vanilla Materials get their Ore and Block always
final MMDMaterial charcoal = Materials.getMaterialByName(MaterialNames.CHARCOAL);
final MMDMaterial gold = Materials.getMaterialByName(MaterialNames.GOLD);
final MMDMaterial iron = Materials.getMaterialByName(MaterialNames.IRON);
final MMDMaterial quartz = Materials.getMaterialByName(MaterialNames.QUARTZ);
if (Materials.hasMaterial(MaterialNames.CHARCOAL)) {
create(Names.BLOCK, charcoal);
}
Arrays.stream(new String[] { MaterialNames.DIAMOND, MaterialNames.EMERALD, MaterialNames.GOLD, MaterialNames.OBSIDIAN }).filter(n -> Options.isMaterialEnabled(n.toString())).filter(Materials::hasMaterial).map(Materials::getMaterialByName).forEach(mat -> {
Arrays.stream(new Names[] { Names.BARS, Names.DOOR, Names.TRAPDOOR, Names.BUTTON, Names.SLAB, Names.DOUBLE_SLAB, Names.LEVER, Names.PRESSURE_PLATE, Names.STAIRS, Names.WALL }).forEach(n -> create(n, mat));
});
if (Materials.hasMaterial(MaterialNames.GOLD) && Options.isMaterialEnabled(MaterialNames.GOLD)) {
create(Names.PLATE, gold);
}
if (Materials.hasMaterial(MaterialNames.IRON) && Options.isMaterialEnabled(MaterialNames.IRON)) {
create(Names.PLATE, iron);
create(Names.BUTTON, iron);
create(Names.SLAB, iron);
create(Names.DOUBLE_SLAB, iron);
create(Names.LEVER, iron);
create(Names.PRESSURE_PLATE, iron);
create(Names.STAIRS, iron);
create(Names.WALL, iron);
}
if (Materials.hasMaterial(MaterialNames.QUARTZ) && Options.isMaterialEnabled(MaterialNames.QUARTZ)) {
create(Names.BARS, quartz);
create(Names.DOOR, quartz);
create(Names.TRAPDOOR, quartz);
create(Names.BUTTON, quartz);
create(Names.LEVER, quartz);
create(Names.PRESSURE_PLATE, quartz);
create(Names.WALL, quartz);
}
}
use of com.mcmoddev.lib.material.MMDMaterial in project BaseMetals by MinecraftModDevelopmentMods.
the class VanillaItems method addStoneBits.
private static void addStoneBits() {
final MMDMaterial stone = Materials.getMaterialByName(MaterialNames.STONE);
if (Materials.hasMaterial(MaterialNames.STONE)) {
create(Names.CRACKHAMMER, stone);
create(Names.ROD, stone);
create(Names.GEAR, stone);
create(Names.SCYTHE, stone);
}
}
Aggregations