mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-25 22:44:32 +00:00
Added Capability.cast, to allow avoiding unchecked casts in ICapabilityProvider.getCapability
This commit is contained in:
1 parent
a4d5760539
commit
08663587d4
13 files changed
+33
-20
No files matched your search
@@ -47,12 +47,11 @@ public class CapabilityAnimation
|
||||
return capability == ANIMATION_CAPABILITY;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public <T> T getCapability(Capability<T> capability, EnumFacing facing)
|
||||
{
|
||||
if(capability == ANIMATION_CAPABILITY)
|
||||
{
|
||||
return (T)asm;
|
||||
return ANIMATION_CAPABILITY.cast(asm);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user