Skip to content

Instantly share code, notes, and snippets.

@loordgek
Created November 11, 2017 21:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save loordgek/d5dc0cbec73ea9623a45e6d77f1de047 to your computer and use it in GitHub Desktop.
Save loordgek/d5dc0cbec73ea9623a45e6d77f1de047 to your computer and use it in GitHub Desktop.
@SubscribeEvent
public static void onAttachCapabilitiesTileEntity(AttachCapabilitiesEvent<TileEntity> event) {
ResourceLocation location = new ResourceLocation(Ref.modinfo.modid, "test");
if (event.getCapabilities().containsKey(location)) return;
if (event.getObject() instanceof TileEntityChest) {
event.addCapability(location, new CapProvider((IInventory) event.getObject()));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment