Search in sources :

Example 1 with CustomCompoundMaterial

use of net.silentchaos512.gear.gear.material.CustomCompoundMaterial in project Silent-Gear by SilentChaos512.

the class CustomMaterialItem method fillItemCategory.

@Override
public void fillItemCategory(CreativeModeTab group, NonNullList<ItemStack> items) {
    if (allowdedIn(group)) {
        items.add(create(LazyMaterialInstance.of(Const.Materials.EXAMPLE)));
        for (IMaterial material : MaterialManager.getValues()) {
            if (material instanceof CustomCompoundMaterial) {
                IMaterialInstance mat = MaterialInstance.of(material);
                ItemStack stack = create(mat);
                if (mat.getIngredient().test(stack)) {
                    items.add(stack);
                }
            }
        }
    }
}
Also used : IMaterial(net.silentchaos512.gear.api.material.IMaterial) IMaterialInstance(net.silentchaos512.gear.api.material.IMaterialInstance) CustomCompoundMaterial(net.silentchaos512.gear.gear.material.CustomCompoundMaterial) ItemStack(net.minecraft.world.item.ItemStack)

Aggregations

ItemStack (net.minecraft.world.item.ItemStack)1 IMaterial (net.silentchaos512.gear.api.material.IMaterial)1 IMaterialInstance (net.silentchaos512.gear.api.material.IMaterialInstance)1 CustomCompoundMaterial (net.silentchaos512.gear.gear.material.CustomCompoundMaterial)1