GregTech CE Unofficial

GregTech CE Unofficial

412k Downloads

[Suggestion] Making @ZenGetter("components") return a Array instead of ImmutableList

tekcay opened this issue ยท 1 comments

commented

In Material.java :

    @ZenGetter("components")
    public ImmutableList<MaterialStack> getMaterialComponents() {
        return materialInfo.componentList;
    }

Applying this getter returns a ImmutableList which is hard (impossible ?) to work with in CT.

Describe the solution you'd like

I don't know if simply doing

    @ZenGetter("components")
    public ArrayList<MaterialStack> getMaterialComponents() {
        return materialInfo.componentList;
    }

would work, but basically having an Array would be more convenient to work with.

Context

For example, this code does not work :

import mods.gregtech.material.Material;
import mods.gregtech.material.MaterialStack;

val bla as MaterialStack[] = <material:bronze>.components;

for i in bla {
print(i.material.camelCaseName);
print(i.amount);
}

As I would expect it to print :

tin
1
copper
3
commented

fixed in 2.3.0