@@ -0,0 +1,2054 @@
+package org.cyclops.cyclopscore.modcompat.capabilities;%0A%0Aimport net.minecraft.util.EnumFacing;%0Aimport net.minecraftforge.common.capabilities.Capability;%0Aimport net.minecraftforge.common.capabilities.ICapabilityProvider;%0Aimport org.apache.commons.lang3.tuple.Pair;%0Aimport org.cyclops.cyclopscore.datastructure.EnumFacingMap;%0A%0Aimport java.util.Objects;%0A%0A/**%0A * A default sided implementation of the capability provider.%0A * @author rubensworks%0A */%0Apublic class DefaultSidedCapabilityProvider%3CT%3E implements ICapabilityProvider %7B%0A%0A    private final EnumFacingMap%3CPair%3CCapability%3CT%3E, T%3E%3E capabilities;%0A%0A    public DefaultSidedCapabilityProvider(EnumFacingMap%3CPair%3CCapability%3CT%3E, T%3E%3E capabilities) %7B%0A        this.capabilities = Objects.requireNonNull(capabilities);%0A    %7D%0A%0A    @Override%0A    public boolean hasCapability(Capability%3C?%3E capability, EnumFacing facing) %7B%0A        return capabilities.containsKey(facing) && capabilities.get(facing).getKey() == capability;%0A    %7D%0A%0A    @Override%0A    public %3CT%3E T getCapability(Capability%3CT%3E capability, EnumFacing facing) %7B%0A        if(hasCapability(capability, facing)) %7B%0A            return (T) capabilities.get(facing).getValue();%0A        %7D%0A        return null;%0A    %7D%0A%0A    public static %3CT, H extends ISidedCapabilityConstructor%3CT%3E%3E EnumFacingMap%3CPair%3CCapability%3CT%3E, T%3E%3E forAllSides(Capability%3CT%3E capabilityType, H constructor) %7B%0A        return EnumFacingMap.forAllValues(%0A                Pair.of(capabilityType, constructor.createForSide(EnumFacing.DOWN)),%0A                Pair.of(capabilityType, constructor.createForSide(EnumFacing.UP)),%0A                Pair.of(capabilityType, constructor.createForSide(EnumFacing.NORTH)),%0A                Pair.of(capabilityType, constructor.createForSide(EnumFacing.SOUTH)),%0A                Pair.of(capabilityType, constructor.createForSide(EnumFacing.WEST)),%0A                Pair.of(capabilityType, constructor.createForSide(EnumFacing.EAST))%0A        );%0A    %7D%0A%0A    public static interface ISidedCapabilityConstructor%3CT%3E %7B%0A        public T createForSide(EnumFacing side);%0A    %7D%0A%7D%0A

Add DefaultSidedCapabilityProvider