All Mods Resource Packs Data Packs Shaders Modpacks Plugins
TESLA

TESLA

by Darkhax • Downloads: 0 • Followers: 0
Description
Gallery
Changelog
Versions

Tesla

Tesla is a power API designed for cross mod communication. It allows for Items, Blocks and Entities from various mods to interact with each other over the Tesla power network. 

 

WARNING: Alpha and beta releases are intended for mod authors and testers. Mods that support Tesla should only target full releases! Using an alpha build may crash mods that require it!

This project is sponsored by Nodecraft. Use code DARKHAX for 30% off your first month of service!

Getting Started

The best way to use the Tesla API is through Forge's Capability system.  The idea is very simple, capabilities are implementations of an interface that handle a certain type of Tesla related logic. These capabilities can then be attached to supported things (Tile Entity, ItemStack and Entity). When a capability is attached, that thing will have access to the provided tesla logic, and it will be visible to other tesla enabled things. You can see a basic capability implementation here and a tile entity example here. There is also an item example here.

 

Frequently Asked Questions

 

Where can people go to discuss the Tesla API?

There is a public discord server which can be found here.

 

What makes Tesla different from other power API?

The Tesla API functions very similarly to other power API, however there are several design choices made the API much more flexible. One of these choices was the decision to use Forge's capability system, which allows for Tesla support to be added to nearly anything. It would be possible for a mod to add Tesla support to a vanilla furnace with this system, without using any dirty hacks. Another decision was using longs over integers. This change allows for mods to easily work with larger power numbers. 

 

Why did you make this API?

The API was originally made as a fun side project, but received a lot of unexpected attention from other developers. It was not created as a crusade to kill other power API or anything like that. 

 

Are there any standards for Tesla?

The API does not enforce any standard, however there are a few things which mod authors are encouraged to follow. One Tesla should equal 1 RF, tile entities should not directly implement capability interfaces, and sided logic should be handled through the capability methods.

 

Should the Tesa API be bundled with other mods?

While bundling API is frequently done, and supported by Forge, it is a very bad practice. While there is nothing stopping other mods from bundling the API it is highly discouraged and will not be officially supported. 

 

How does soft dependency work if I can't bundle the API?

Forge provides several tools which make soft dependency really simple. The first is the Optional annotation. This annotation can be added to any class that implements an interface, and if a certain mod ID is not detected, the interface can be stripped from the class. This allows for existing container objects to implement Tesla's interfaces without a hard dependency. The CapabilityInject annotation is also extremely useful for soft dependency. You can use this annotation on a field to have it initialized with a specific capability when said capability is initialized. You can also put this annotation on methods to have then called when the capability is initialized. One thing you might notice is that the annotation takes a reference to the capability class from Tesla, which will be missing under soft dependency. Due to the way annotations and the JVM work, it is safe to make this reference in the annotation. It will not give you a Class Definition exception.

 

Modpack Policy

Yes, you can use this in a mod pack. Please don't send me messages asking for permission to use this in your mod pack. I will not be responding to such messages. 

How to Install TESLA (Mod)

TESLA by Darkhax is verified for Forge across Minecraft versions 1.10, 1.10.1, 1.10.2, 1.11, 1.11.2, 1.12, 1.12.2, 1.9 (latest release: 1.0.63, file size: 30 KB). Follow the steps below to install it safely from ModCraft.tv:

  1. Click the Download button above and select your Minecraft version (1.10, 1.10.1, 1.10.2, 1.11, 1.11.2, 1.12, 1.12.2, 1.9) and platform (Forge).
  2. Make sure you have the compatible loader or environment installed for Forge.
  3. Move the downloaded TESLA file into your Minecraft .minecraft/mods folder and launch the game.

All Versions

+ Add Version
Name Game version Platforms Published Downloads Actions
1.12.2
Forge
last yr. 1
1.12.2
Forge
last yr. 1
1.12
Forge
last yr. 1
1.12
Forge
last yr. 1
1.12
Forge
last yr. 1
1.11.x
Forge
last yr. 1
1.11
Forge
last yr. 1
1.10.2
Forge
last yr. 1
1.10.2 1.9.4
Forge
last yr. 1
1.10.2 1.9.4
Forge
last yr. 1
1.10.2
Forge
last yr. 1
1.10.2
Forge
last yr. 1
1.10.2
Forge
last yr. 1
1.10.2
Forge
last yr. 1
1.10.2
Forge
last yr. 1
1.10.x 1.9.x
Forge
last yr. 1
1.10.2
Forge
last yr. 1
1.10.2
Forge
last yr. 1
1.10.2
Forge
last yr. 1
1.10.x 1.9.4
Forge
last yr. 1
1.10.2
Forge
last yr. 1
1.10
Forge
last yr. 1
1.10
Forge
last yr. 1
1.10
Forge
last yr. 1
1.10 1.9.4
Forge
last yr. 1
1.9
Forge
last yr. 1
1.9
Forge
last yr. 1
1.9
Forge
last yr. 1
1.9
Forge
last yr. 1
1.9
Forge
last yr. 1
1.9
Forge
last yr. 1
1.9
Forge
last yr. 1
1.9
Forge
last yr. 1
1.9
Forge
last yr. 1
1.9
Forge
last yr. 1
1.9
Forge
last yr. 1
1.9
Forge
last yr. 1
1.9
Forge
last yr. 1
1.9
Forge
last yr. 1
1.9
Forge
last yr. 1
1.9
Forge
last yr. 1
1.9
Forge
last yr. 1
1.9
Forge
last yr. 1
1.9
Forge
last yr. 1
1.9
Forge
last yr. 1
1.9
Forge
last yr. 1
1.9
Forge
last yr. 1
<ul>
<li>Added Polish translations, thanks to Kaperios. - Tyler Hancock</li>
</ul>

[1.0.61] Tesla-1.12-1.0.61 by Darkhax on Jun 07, 2023
Download
<ul>
<li>Updated to latest forge.</li>
</ul>

[1.0.60] Tesla-1.12-1.0.60 by Darkhax on Jun 07, 2023
Download
<ul>
<li>Updated MCP, Forge and CurseGradle.</li>
</ul>

[2.0.55] Tesla-1.12-2.0.55 by Darkhax on Jun 07, 2023
Download
<ul>
<li>Fixed wrong curseforge project id.</li>
</ul>

<p>Ported to 1.11</p>
<ul>
<li>Fixed a bug that affected some mods which use the packaged utility suit</li>
</ul>
<p>This update does not require mods which depend on Tesla to update.&nbsp;</p>
<ul>
<li>Fixed translation issues</li>
</ul>
<ul>
<li>Add new tooltip helper code</li>
<li>Add new capability checking code.</li>
</ul>
<p>This is a major new release. It may break earlier versions of mods that support Tesla. Please be patient as the other tesla mod devs update to this version.&nbsp;</p>

<p>- The mod ID has switched from Tesla to tesla. This is to comply with the new mod ID standars being enforced in 1.11<br>- There is now built in code to help render power bars to the screen.<br>- A duplicate tesla consumer capability field was removed. It was called TESLA_CONSUMER rather than CAPABILITY_CONSUMER<br>- Deprecated implementations of BaseTeslaContainer, InfiniteTeslaConsumer and InfiniteTeslaProducer were removed.<br>- Eleven new helper methods were added to the TeslaUtils. These can help make your code cleaner and ensure good practices are being followed.<br>- The BaseTeslaContainer implementation now uses getInputRate, getOutputRate and getCapacity to work in a dynamic way.<br>- It may be a good idea to add the latest version of Tesla to your dependency list, to prevent error reports with older versions.</p>
TESLA Icon
Download TESLA
Select game version
Select platform