Allow markers to use content/displays as textures (#11142)

* Allow markers to use content/displays as textures

* Don't process empty commands

* Allow canvases to be used as marker textures

* Proper Json serialization

---------

Co-authored-by: Anuken <arnukren@gmail.com>
This commit is contained in:
Redstonneur1256
2025-12-28 03:37:03 +01:00
committed by GitHub
parent 7d3e3155f7
commit 59c3b18a6f
5 changed files with 118 additions and 41 deletions

View File

@@ -290,6 +290,11 @@ public class MapObjectivesDialog extends BaseDialog{
}, () -> {});
});
setInterpreter(TextureHolder.class, (cont, name, type, field, remover, indexer, get, set) -> {
name(cont, name, remover, indexer);
cont.field(String.valueOf(get.get().value), s -> get.get().value = s).growX();
});
// Types that use the default interpreter. It would be nice if all types could use it, but I don't know how to reliably prevent classes like [? extends Content] from using it.
for(var obj : MapObjectives.allObjectiveTypes) setInterpreter(obj.get().getClass(), defaultInterpreter());
for(var mark : MapObjectives.allMarkerTypes) setInterpreter(mark.get().getClass(), defaultInterpreter());