deprecation of material(...), fix map_colour(...)

This commit is contained in:
gnembon committed 2023-04-05 20:09:52 +02:00
1 parent fdb0936df7
commit 9a5c2d5fc3
2 files changed
+8 -13

No files matched your search

@@ -1160,14 +1160,15 @@ public class WorldAccess
stateStringQuery(c, "block_sound", lv, (s, p) ->
Colors.soundName.get(s.getSoundType())));
expression.addContextFunction("material", -1, (c, t, lv) ->
stateStringQuery(c, "material", lv, (s, p) ->
Colors.materialName.get(s.getMaterial())));
expression.addContextFunction("material", -1, (c, t, lv) -> {
c.host.issueDeprecation("material(...)"); // deprecated for block_state()
return stateStringQuery(c, "material", lv, (s, p) ->
Colors.materialName.getOrDefault(s.getMaterial(), "unknown"));
});
expression.addContextFunction("map_colour", -1, (c, t, lv) ->
stateStringQuery(c, "map_colour", lv, (s, p) ->
Colors.materialName.get(s.getMapColor(((CarpetContext) c).level(), p))));
Colors.mapColourName.get(s.getMapColor(((CarpetContext) c).level(), p))));
// Deprecated for block_state()
expression.addContextFunction("property", -1, (c, t, lv) ->