Back to mods
ExplosiveAPI project artwork

CurseForge · Minecraft mod

ExplosiveAPI

API for count gunpowder power in items

Choose a version Pick your version below, then grab the matching file.

Quick answer

Which ExplosiveAPI release matches 1.21.1 NeoForge?

Updated 2 days ago
Best match for your filters ExplosiveAPI 1.0 (NeoForge 1.21.1)
Game version 1.21.1
Loader NeoForge

ExplosiveAPI 1.0 (NeoForge 1.21.1) targets 1.21.1 with NeoForge. The project page does not say whether this file belongs on the client, dedicated server, or both. No extra mods listed for this file.

Where it goes

Is ExplosiveAPI required on the client, server, or both?

The project page does not say whether this file belongs on the client, dedicated server, or both.

Client Source doesn’t say
Dedicated server Source doesn’t say
Loader for this release NeoForge
Required install it here Optional supported, not mandatory Not supported do not install here Source doesn’t say do not assume

The source does not explicitly classify this release as client-only or server-only.

What else does ExplosiveAPI 1.0 (NeoForge 1.21.1) need?

ExplosiveAPI 1.0 (NeoForge 1.21.1) on 1.21.1 NeoForge. Every mod below is checked against that same setup.

No extra mods listed for this file

This file does not list any required mods. Do not add a library just because a different file uses it.

This file does not list any required or optional mods.

Before you install it

Add ExplosiveAPI without breaking your instance.

Built for ExplosiveAPI 1.0 (NeoForge 1.21.1) on 1.21.1 NeoForge. Pick another file and the loader, install side or required mods may change.

  1. 01

    Stick to this file

    Use ExplosiveAPI 1.0 (NeoForge 1.21.1). It targets 1.21.1 with NeoForge; another release may have different loader, side or dependency requirements.

  2. 02

    Bring the mods it needs

    This file does not list any required mods. Do not add a library just because a different file uses it.

  3. 03

    Put it on the correct side

    The project page does not say whether this file belongs on the client, dedicated server, or both.

  4. 04

    Pick the file you checked

    Use the “Get this file” button beside ExplosiveAPI 1.0 (NeoForge 1.21.1). It opens that exact file at the source.

About this project

What does ExplosiveAPI add?

English

The phrase G power here stands for gunpowder power.

About the mod

The mod is a counter of explosive substances. Take vanilla gunpowder, for example.
By default, its explosiveness is measured in 1 G power:
image
If you have a stack of gunpowder in your hand, inventory, or chest, the slot will have a total of 64 G of power:
image

How the counter works

First, during the server-side launch, a graph is built from all the recipes. The explosion hazard starts being calculated from bottom to top. Items that are not in the configs and do not have a recipe receive 0G; then items with a recipe are considered: the mod calculates the amount of G power, adds it up, and divides it by the output quantity and the number of recipes. For example, dynamite. It is crafted from 5 sand and 5 gunpowder -> sand = 0G -> gunpowder = 1G -> dynamite = 5G.

What functions can be used for your add-on

You will only need the GunpowderCounter class.
Checking for the completion of recipe analysis: GunpowderCounter.isCacheLoaded();
Obtaining G power from an item: GunpowderCounter.getExplosivePowerFromItem(ItemStack stack);
Obtaining a copy of the entire map of explosive items (ResourceLocation, Integer): GunpowderCounter.getPowerCache();
Recalculating G power: GunpowderCounter.recomputeCache(Level level);

Русский

Словосочетание G сила здесь расшифровывается, как gunpowder сила (ну типа пороховая сила).

О моде

Мод из себя представляет счетчик взрывоопасных веществ. Возьмем, например, ванильный порох.
По умолчанию его взрывоопасность измеряется в 1 G силу:
image
Если у вас в руке, инвентаре или сундуке будет стак пороха, то суммарно у слота будет 64 G силы:
image

Как работает счетчик

Сначала во время запуска серверной части строится граф из всех рецептов. Взрывоопасность начинает считаться снизу вверх. Предметы, которых нет в конфигах, и у которых нет рецепта, получают 0G, потом рассматриваются предметы с рецептом: мод считает количество G силы, складывает ее и делит на количество на выходе и количество рецептов. Например, динамит. Он крафтится из 5 песка и 5 пороха -> песок = 0G -> порох = 1G -> динамит = 5G.

Какие функции могут использоваться для вашего аддона

Вам понадобится только класс GunpowderCounter.
Проверка на завершения анализа рецептов: GunpowderCounter.isCacheLoaded();
Получение G силы из предмета: GunpowderCounter.getExplosivePowerFromItem(ItemStack stack);
Получение копии вообще всей карты взрывоопасных вещей(ResourceLocation, Integer): GunpowderCounter.getPowerCache();
Пересчит G силы: GunpowderCounter.recomputeCache(Level level);

Project description from CurseForge.

Pick your setup

ExplosiveAPI by Minecraft version and loader

Choose the version and loader you play, then open the matching release.

1 available setups

Check the dependencies, then try the file in a copied instance before changing a world you care about.

Recent files

ExplosiveAPI versions and loaders

1 of 1 releases match

Looking for an older file? The official CurseForge project page is in Resources.