Search in sources :

Example 1 with ItemMultiHelmet

use of com.cjm721.overloaded.item.functional.armor.ItemMultiHelmet in project Overloaded by CJ-MC-Mods.

the class ArmorEventHandler method getHelmetDataStorage.

@Nonnull
private static IGenericDataStorage getHelmetDataStorage(PlayerEntity player) {
    for (ItemStack stack : player.inventory.armor) {
        if (stack.getItem() instanceof ItemMultiHelmet) {
            IGenericDataStorage cap = stack.getCapability(GENERIC_DATA_STORAGE).orElse(new GenericDataStorage());
            cap.suggestUpdate();
            return cap;
        }
    }
    return new GenericDataStorage();
}
Also used : IGenericDataStorage(com.cjm721.overloaded.storage.IGenericDataStorage) IGenericDataStorage(com.cjm721.overloaded.storage.IGenericDataStorage) GenericDataStorage(com.cjm721.overloaded.storage.GenericDataStorage) ItemStack(net.minecraft.item.ItemStack) Nonnull(javax.annotation.Nonnull)

Example 2 with ItemMultiHelmet

use of com.cjm721.overloaded.item.functional.armor.ItemMultiHelmet in project Overloaded by CJ-MC-Mods.

the class ModItems method init.

public static void init() {
    linkingCard = registerItem(new ItemLinkingCard());
    multiTool = registerItem(new ItemMultiTool());
    energyCore = registerItem(new ItemEnergyCore());
    itemCore = registerItem(new ItemItemCore());
    fluidCore = registerItem(new ItemFluidCore());
    customHelmet = registerItem(new ItemMultiHelmet());
    customChestplate = registerItem(new ItemMultiChestplate());
    customLeggins = registerItem(new ItemMultiLeggings());
    customBoots = registerItem(new ItemMultiBoots());
    settingsEditor = registerItem(new ItemSettingEditor());
    rayGun = registerItem(new ItemRayGun());
    railgun = registerItem(new ItemRailGun());
    if (OverloadedConfig.INSTANCE.developmentConfig.wipStuff) {
        // amountSelector = registerItem(new ItemAmountSelector());
        for (int i = 0; i < 10; i++) {
            registerItem(new InDevItem("in_dev_item_" + i));
        }
    }
}
Also used : InDevItem(com.cjm721.overloaded.item.basic.InDevItem) ItemMultiHelmet(com.cjm721.overloaded.item.functional.armor.ItemMultiHelmet) ItemEnergyCore(com.cjm721.overloaded.item.crafting.ItemEnergyCore) ItemMultiChestplate(com.cjm721.overloaded.item.functional.armor.ItemMultiChestplate) ItemItemCore(com.cjm721.overloaded.item.crafting.ItemItemCore) ItemFluidCore(com.cjm721.overloaded.item.crafting.ItemFluidCore) ItemMultiLeggings(com.cjm721.overloaded.item.functional.armor.ItemMultiLeggings) ItemMultiBoots(com.cjm721.overloaded.item.functional.armor.ItemMultiBoots)

Aggregations

InDevItem (com.cjm721.overloaded.item.basic.InDevItem)1 ItemEnergyCore (com.cjm721.overloaded.item.crafting.ItemEnergyCore)1 ItemFluidCore (com.cjm721.overloaded.item.crafting.ItemFluidCore)1 ItemItemCore (com.cjm721.overloaded.item.crafting.ItemItemCore)1 ItemMultiBoots (com.cjm721.overloaded.item.functional.armor.ItemMultiBoots)1 ItemMultiChestplate (com.cjm721.overloaded.item.functional.armor.ItemMultiChestplate)1 ItemMultiHelmet (com.cjm721.overloaded.item.functional.armor.ItemMultiHelmet)1 ItemMultiLeggings (com.cjm721.overloaded.item.functional.armor.ItemMultiLeggings)1 GenericDataStorage (com.cjm721.overloaded.storage.GenericDataStorage)1 IGenericDataStorage (com.cjm721.overloaded.storage.IGenericDataStorage)1 Nonnull (javax.annotation.Nonnull)1 ItemStack (net.minecraft.item.ItemStack)1