package tamaized.tammodized.common.helper;

import net.minecraft.entity.Entity;
import net.minecraft.util.EnumFacing;
import net.minecraftforge.common.capabilities.Capability;

public class CapabilityHelper {

	private CapabilityHelper() {

	}

	public static <T> T getCap(Entity entity, Capability<T> cap, EnumFacing face) {
		return entity != null && entity.hasCapability(cap, face) ? entity.getCapability(cap, face) : null;
	}

}

@@ -41,44 +41,8 @@
 r;%0A%0A
-import net.minecraft.entity.Entity;%0A
 impo
@@ -75,16 +75,16 @@
 Facing;%0A
+
 import n
@@ -132,16 +132,83 @@
 ability;
+%0Aimport net.minecraftforge.common.capabilities.ICapabilityProvider;
 %0A%0Apublic
@@ -301,21 +301,36 @@
 Cap(
-Entity entity
+ICapabilityProvider provider
 , Ca
@@ -374,22 +374,24 @@
 %09return 
-entity
+provider
  != null
@@ -394,22 +394,24 @@
 null && 
-entity
+provider
 .hasCapa
@@ -434,14 +434,16 @@
 ) ? 
-entity
+provider
 .get

use ICapabilityProvider