Search in sources :

Example 16 with MMDMaterial

use of com.mcmoddev.lib.material.MMDMaterial in project BaseMetals by MinecraftModDevelopmentMods.

the class MithrilProperty method hasEffect.

@Override
public boolean hasEffect(ItemStack stack, EntityPlayer player) {
    MMDMaterial mat = Materials.getMaterialByName(MaterialNames.MITHRIL);
    boolean rv = (stackIsArmorMaterial(stack, mat) && ((stack.getItem() instanceof IMMDObject) && (((IMMDObject) stack.getItem()).getMMDMaterial() == mat))) && (countArmorPieces(Materials.getMaterialByName(MaterialNames.MITHRIL), player) > 0);
    return rv;
}
Also used : IMMDObject(com.mcmoddev.lib.material.IMMDObject) MMDMaterial(com.mcmoddev.lib.material.MMDMaterial)

Example 17 with MMDMaterial

use of com.mcmoddev.lib.material.MMDMaterial in project BaseMetals by MinecraftModDevelopmentMods.

the class StarSteelProperty method hasEffect.

@Override
public boolean hasEffect(ItemStack stack, EntityPlayer player) {
    MMDMaterial mat = Materials.getMaterialByName(MaterialNames.STARSTEEL);
    boolean rv = (stackIsArmorMaterial(stack, mat) && ((stack.getItem() instanceof IMMDObject) && (((IMMDObject) stack.getItem()).getMMDMaterial() == mat))) && (countArmorPieces(Materials.getMaterialByName(MaterialNames.STARSTEEL), player) > 0);
    return rv;
}
Also used : IMMDObject(com.mcmoddev.lib.material.IMMDObject) MMDMaterial(com.mcmoddev.lib.material.MMDMaterial)

Example 18 with MMDMaterial

use of com.mcmoddev.lib.material.MMDMaterial in project BaseMetals by MinecraftModDevelopmentMods.

the class AdamantineProperty method hasEffect.

@Override
public boolean hasEffect(ItemStack stack, EntityPlayer player) {
    MMDMaterial mat = Materials.getMaterialByName(MaterialNames.ADAMANTINE);
    boolean rv = (stackIsArmorMaterial(stack, mat) && ((stack.getItem() instanceof IMMDObject) && (((IMMDObject) stack.getItem()).getMMDMaterial() == mat))) && (countArmorPieces(Materials.getMaterialByName(MaterialNames.ADAMANTINE), player) > 0);
    return rv;
}
Also used : IMMDObject(com.mcmoddev.lib.material.IMMDObject) MMDMaterial(com.mcmoddev.lib.material.MMDMaterial)

Example 19 with MMDMaterial

use of com.mcmoddev.lib.material.MMDMaterial in project BaseMetals by MinecraftModDevelopmentMods.

the class LeadProperty method hasEffect.

@Override
public boolean hasEffect(ItemStack stack, EntityPlayer player) {
    MMDMaterial mat = Materials.getMaterialByName(MaterialNames.LEAD);
    boolean rv = (stackIsArmorMaterial(stack, mat) && ((stack.getItem() instanceof IMMDObject) && (((IMMDObject) stack.getItem()).getMMDMaterial() == mat))) && (countArmorPieces(Materials.getMaterialByName(MaterialNames.LEAD), player) > 0);
    return rv;
}
Also used : IMMDObject(com.mcmoddev.lib.material.IMMDObject) MMDMaterial(com.mcmoddev.lib.material.MMDMaterial)

Example 20 with MMDMaterial

use of com.mcmoddev.lib.material.MMDMaterial in project BaseMetals by MinecraftModDevelopmentMods.

the class BMeIC2 method mainInteraction.

/**
 * @param event The Event.
 */
@SubscribeEvent
public void mainInteraction(final RegistryEvent.Register<IRecipe> event) {
    materials.stream().filter(Materials::hasMaterial).filter(materialName -> !Materials.getMaterialByName(materialName).isEmpty()).forEach(materialName -> {
        this.registerVanillaRecipes(materialName);
        this.addMaceratorRecipes(materialName);
        this.addOreWashingPlantRecipes(materialName);
        this.addThermalCentrifugeRecipes(materialName);
        this.addMetalFormerRecipes(materialName);
        this.addCompressorRecipes(materialName);
    });
    if (Materials.hasMaterial(MaterialNames.DIAMOND)) {
        final MMDMaterial diamond = Materials.getMaterialByName(MaterialNames.DIAMOND);
        final String oreDictName = diamond.getCapitalizedName();
        if (diamond.hasItem(Names.POWDER)) {
            this.addMaceratorRecipe(Oredicts.ORE + oreDictName, diamond.getItemStack(Names.POWDER, 2));
        }
    }
    if (Materials.hasMaterial(MaterialNames.EMERALD)) {
        final MMDMaterial emerald = Materials.getMaterialByName(MaterialNames.EMERALD);
        final String oreDictName = emerald.getCapitalizedName();
        if (emerald.hasItem(Names.POWDER)) {
            this.addMaceratorRecipe(Oredicts.ORE + oreDictName, emerald.getItemStack(Names.POWDER, 2));
        }
    }
    MinecraftForge.EVENT_BUS.register(this);
}
Also used : Arrays(java.util.Arrays) IRecipe(net.minecraft.item.crafting.IRecipe) Options(com.mcmoddev.lib.util.Config.Options) Materials(com.mcmoddev.lib.init.Materials) Oredicts(com.mcmoddev.lib.util.Oredicts) MMDMaterial(com.mcmoddev.lib.material.MMDMaterial) MaterialNames(com.mcmoddev.basemetals.data.MaterialNames) Names(com.mcmoddev.lib.data.Names) IIntegration(com.mcmoddev.lib.integration.IIntegration) List(java.util.List) MMDPlugin(com.mcmoddev.lib.integration.MMDPlugin) MinecraftForge(net.minecraftforge.common.MinecraftForge) BaseMetals(com.mcmoddev.basemetals.BaseMetals) SubscribeEvent(net.minecraftforge.fml.common.eventhandler.SubscribeEvent) RegistryEvent(net.minecraftforge.event.RegistryEvent) IntegrationInitEvent(com.mcmoddev.lib.integration.IntegrationInitEvent) IC2(com.mcmoddev.lib.integration.plugins.IC2) Materials(com.mcmoddev.lib.init.Materials) MMDMaterial(com.mcmoddev.lib.material.MMDMaterial) SubscribeEvent(net.minecraftforge.fml.common.eventhandler.SubscribeEvent)

Aggregations

MMDMaterial (com.mcmoddev.lib.material.MMDMaterial)45 List (java.util.List)9 SubscribeEvent (net.minecraftforge.fml.common.eventhandler.SubscribeEvent)9 BaseMetals (com.mcmoddev.basemetals.BaseMetals)8 Arrays (java.util.Arrays)8 MaterialNames (com.mcmoddev.basemetals.data.MaterialNames)7 Names (com.mcmoddev.lib.data.Names)7 Materials (com.mcmoddev.lib.init.Materials)7 ItemStack (net.minecraft.item.ItemStack)6 RegistryEvent (net.minecraftforge.event.RegistryEvent)6 IIntegration (com.mcmoddev.lib.integration.IIntegration)5 MMDPlugin (com.mcmoddev.lib.integration.MMDPlugin)5 IMMDObject (com.mcmoddev.lib.material.IMMDObject)5 Oredicts (com.mcmoddev.lib.util.Oredicts)5 MinecraftForge (net.minecraftforge.common.MinecraftForge)5 ImmutableList (com.google.common.collect.ImmutableList)4 Options (com.mcmoddev.lib.util.Config.Options)4 Item (net.minecraft.item.Item)4 IRecipe (net.minecraft.item.crafting.IRecipe)4 ThermalExpansionHelper (cofh.api.util.ThermalExpansionHelper)2