Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,13 @@
import gregtech.api.recipes.ingredients.GTRecipeOreInput;
import gregtech.api.unification.Element;
import gregtech.api.unification.Elements;
import gregtech.api.unification.OreDictUnifier;
import gregtech.api.unification.material.Material;
import gregtech.api.unification.material.event.MaterialEvent;
import gregtech.api.unification.material.event.PostMaterialEvent;
import gregtech.api.unification.material.registry.MaterialRegistry;
import gregtech.api.unification.ore.OrePrefix;
import gregtech.api.unification.stack.UnificationEntry;
import gregtech.api.util.GTUtility;
import gregtech.api.util.Mods;
import gregtech.common.blocks.BlockCompressed;
Expand Down Expand Up @@ -46,6 +48,7 @@
import com.cleanroommc.groovyscript.compat.mods.GroovyPropertyContainer;
import com.cleanroommc.groovyscript.event.ScriptRunEvent;
import com.cleanroommc.groovyscript.helper.EnumHelper;
import com.cleanroommc.groovyscript.mapper.TextureBinder;
import com.cleanroommc.groovyscript.sandbox.expand.ExpansionHelper;
import com.google.common.collect.ImmutableList;
import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap;
Expand Down Expand Up @@ -273,6 +276,9 @@ public void onCompatLoaded(GroovyContainer<?> container) {
container.objectMapperBuilder("oreprefix", OrePrefix.class)
.parser(IObjectParser.wrapStringGetter(OrePrefix::getPrefix))
.completerOfNamed(OrePrefix::values, v -> v.name)
.textureBinder(TextureBinder.of(i -> OreDictUnifier.getAll(new UnificationEntry(i)),
TextureBinder.ofItem(),
i -> String.format("![](${item('%s')}) %s", i.getItem().getRegistryName(), i.getDisplayName())))
Comment on lines +279 to +281
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a bad idea since there are tons of items for each prefix

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, perhaps no texture inlays for oreprefix then?

.register();

container.objectMapperBuilder("metaitem", ItemStack.class)
Expand All @@ -289,6 +295,7 @@ public void onCompatLoaded(GroovyContainer<?> container) {
}
}
})
.textureBinder(TextureBinder.ofItem())
.register();

container.objectMapperBuilder("element", Element.class)
Expand Down
Loading