package org.cyclops.everlastingabilities.core;

import net.minecraft.nbt.NBTBase;
import net.minecraftforge.common.capabilities.Capability;
import net.minecraftforge.common.util.INBTSerializable;
import org.cyclops.cyclopscore.modcompat.capabilities.DefaultCapabilityProvider;
import org.cyclops.everlastingabilities.capability.MutableAbilityStoreConfig;

/**
 * TODO: port to CyclopsCore
 * @author rubensworks
 */
public class SerializableCapabilityProvider<T> extends DefaultCapabilityProvider<T> implements INBTSerializable {

    private final Capability<T> capabilityType; // TODO: protected super
    private final T capability; // TODO: protected super

    public SerializableCapabilityProvider(Capability<T> capabilityType, T capability) {
        super(capabilityType, capability);
        this.capabilityType = capabilityType;
        this.capability = capability;
    }

    @Override
    public NBTBase serializeNBT() {
        return MutableAbilityStoreConfig._instance.getStorage().writeNBT(capabilityType, capability, null);
    }

    @Override
    public void deserializeNBT(NBTBase nbt) {
        MutableAbilityStoreConfig._instance.getStorage().readNBT(capabilityType, capability, null, nbt);
    }
}

@@ -273,86 +273,8 @@
 der;
-%0Aimport org.cyclops.everlastingabilities.capability.MutableAbilityStoreConfig;
 %0A%0A/*
@@ -868,82 +868,32 @@
 urn 
-MutableAbilityStoreConfig._instance.getStorage().writeNBT(capabilityType, 
+capabilityType.writeNBT(
 capa
@@ -986,81 +986,31 @@
     
-MutableAbilityStoreConfig._instance.getStorage().readNBT(capabilityType, 
+capabilityType.readNBT(
 capa

Simplify serializable cap provider