TESLA

TESLA

A power API

by
8.1K Downloads
forgelibrarytechnology
Rent Server with this Mod

About this Mod

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!

Nodecraft sponsor banner

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. 

Available Versions

Tesla-1.12.2-1.0.63release
MC 1.12.2forge
June 7, 2023
Tesla-1.12.2-1.0.62release
MC 1.12.2forge
June 7, 2023
Tesla-1.12-1.0.60release
MC 1.12forge
June 7, 2023
Tesla-1.11-1.3.0.52release
MC 1.11, 1.11.2forge
June 7, 2023
Tesla-1.11-1.3.0.51release
MC 1.11forge
June 7, 2023

How to Install TESLA on Your Server

1

Order Server

Order a Minecraft Java server with at least 3 GB RAM (4 GB recommended).

2

Set forge Loader

In the panel under "Egg", select the forge loader and matching Minecraft version (1.12.2).

3

Install Mod

Open the mod browser in the dashboard and search for "TESLA". Click "Install" – done! Alternatively, upload the .jar via SFTP to the /mods folder.

Compatibility

Mod Loaders

forge

Minecraft Versions

1.12.2, 1.12, 1.11.2 (+7 more)

Server-side

Required

Recommended RAM

4 GB(min. 3 GB)

Frequently Asked Questions

TESLA server crashes on startup – what to do?

Most common cause: wrong forge version or insufficient RAM. Check the server log (latest.log) for "OutOfMemoryError" or "Mixin" errors. With Mado Hosting: ensure at least 3 GB RAM is allocated and the loader matches the mod version (1.12.2). You can switch loaders with one click in the panel.

Is TESLA compatible with forge?

TESLA officially supports forge for Minecraft 1.12.2, 1.12, 1.11.2. The Mado dashboard automatically detects incompatible loader combinations.

Server lagging with TESLA – how to optimize performance?

Recommended RAM: 4 GB (per 8 players). Use /spark profiler to check if TESLA consumes the most tick time. Common fixes: reduce server view-distance to 8-10, install "performant" or "starlight" as supplementary mods on Forge. With Mado Hosting, your server runs on NVMe SSDs with dedicated CPU cores for minimal latency.

Rent Modded Server

Install TESLA with just one click on your server.

Recommended RAM
4 GBab €8/mo
Min. 3 GB | +1 GB pro 8 Spieler
Create Server Now
1-Click Mod Install
NVMe SSD Storage
DDoS Protection included

Details

License
MIT License
Server-side
Required

Supported Versions

1.12.21.121.11.21.111.10.21.10.11.101.9.41.9.31.9