Count the two cases that were written but never counted

The visor and backtank cases went in with the space gems and were left off
`CASES`, so `GetItemSocketsEvent` found nothing to add and a space helmet
holding an Apothic case reported no socket. The life support pack carried the
same omission for the same reason - it is one list, and both ids were missing
from it.

Nothing was wrong with either module. They name the right `allowed_in_slots`
key, carry the right tags and wear the gemstone model, which is exactly what
made this hard to see: a case missing from the list still fits its slot and
still renders, and grants nothing. That is now said out loud in the `CASES`
javadoc and in the README, because the next socket that names a body part will
need a case of its own and will hide the same way if its id is forgotten.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
gem-placement
Amir Alexander Abdelbaki 2026-08-26 22:42:24 +02:00
parent c711ae2831
commit 1450101edb
2 changed files with 21 additions and 7 deletions

View File

@ -224,10 +224,19 @@ nothing asks for costs nothing.
Nothing else changes. Sockets are counted per case rather than per item, so a Nothing else changes. Sockets are counted per case rather than per item, so a
sword with a case in its pommel reports one the same way a chestplate does and sword with a case in its pommel reports one the same way a chestplate does and
a guard holding two small cases reports two; Apotheosis sockets gems into a guard holding two small cases reports two; Apotheosis sockets gems into
weapons already. All three are filed under `packs/apotheosis` rather than with weapons already. They are all filed under `packs/apotheosis` rather than with
the pommels, because a case without Apotheosis is an item that grants nothing, the pommels, because a case without Apotheosis is an item that grants nothing,
while a case without Arsenal is one that simply never fits anywhere. while a case without Arsenal is one that simply never fits anywhere.
Every socket that names a body part needs a case of its own, because a slot
takes only what its `allowed` list names and each of those lists names one key:
the four limbs, the space helmet's visor and the backtank. That is the cost of
placing a gem on the limb it was cut into - the generic case answers for
`gem_armor_medium` and cannot answer for a key nothing else uses. The counting
is by module id, so a new case has to be added to `CASES` in
`ApothicSockets.java` as well as written; one that is missing from that list
still fits its slot and still wears its gemstone, and grants nothing.
One socket a case, and none of it is in the module JSON, because every route One socket a case, and none of it is in the module JSON, because every route
through data is closed. MIAPI's `components` property sets a component rather through data is closed. MIAPI's `components` property sets a component rather
than adding to it, so two cases both writing `1` leave the piece with one socket than adding to it, so two cases both writing `1` leave the piece with one socket

View File

@ -46,11 +46,14 @@ public final class ApothicSockets {
private static final String MIAPI_MODULE = "smartin.miapi.modules.ItemModule"; private static final String MIAPI_MODULE = "smartin.miapi.modules.ItemModule";
/** /**
* Module ids that are a gem case: one per gem size, one per limb socket. * Module ids that are a gem case: one per gem size, and one per socket that
* A case is not listed twice for being allowed in a pommel as well as in * names a body part - the four limbs, the space helmet's visor and the
* armour - it is one module either way, and this counts modules, so a * backtank. A case is not listed twice for being allowed in a pommel as
* guard holding two small cases is worth two sockets by the same rule * well as in armour - it is one module either way, and this counts modules,
* that makes a chestplate holding one worth one. * so a guard holding two small cases is worth two sockets by the same rule
* that makes a chestplate holding one worth one. A case missing from this
* list still fits its slot and still wears its gemstone; it simply grants
* nothing, which is the failure that brought the space cases here.
*/ */
private static final List<String> CASES = List.of( private static final List<String> CASES = List.of(
"cmmodular:gem/apothic_case", "cmmodular:gem/apothic_case",
@ -59,7 +62,9 @@ public final class ApothicSockets {
"cmmodular:gem/limb/case_arm_left", "cmmodular:gem/limb/case_arm_left",
"cmmodular:gem/limb/case_arm_right", "cmmodular:gem/limb/case_arm_right",
"cmmodular:gem/limb/case_leg_left", "cmmodular:gem/limb/case_leg_left",
"cmmodular:gem/limb/case_leg_right"); "cmmodular:gem/limb/case_leg_right",
"cmmodular:gem/space/case_helmet",
"cmmodular:gem/space/case_backtank");
/** MIAPI's module tree, reached without naming its types at compile time. */ /** MIAPI's module tree, reached without naming its types at compile time. */
private static Method getModules; private static Method getModules;