aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHimbeer <himbeer@disroot.org>2025-03-26 12:38:41 +0100
committerHimbeer <himbeer@disroot.org>2025-03-26 12:39:57 +0100
commitba1b754dbfa12ef1a78cb508a22babeab09ae454 (patch)
tree3c6ed441ed83cb1984822bd634a326179f2d70f6
parent8d3572a53e9080024a21f5493e7ca180cddbebd9 (diff)
Make textureName regexp match meshes (#158)
Since this regexp is used with formspecs, meshes need media pool prepending too. This commit fixes issues with meshes in formspecs not being displayed.
-rw-r--r--formspec.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/formspec.go b/formspec.go
index bfe2e98..db0688d 100644
--- a/formspec.go
+++ b/formspec.go
@@ -6,7 +6,7 @@ import (
var itemName = regexp.MustCompile("(item_image\\[[0-9.-]+,[0-9.-]+;[0-9.-]+,[0-9.-]+;)([a-zA-Z0-9-_.: ]+)(\\])")
var itemButtonName = regexp.MustCompile("(item_image_button\\[[0-9.-]+,[0-9.-]+;[0-9.-]+,[0-9.-]+;)([a-zA-Z0-9-_.: ]+)(;[a-zA-Z0-9-_.: ]+;[^\\[\\]]*\\])")
-var textureName = regexp.MustCompile("([a-zA-Z0-9-_.]+\\.(?i:png|jpg|bmp|tga))")
+var textureName = regexp.MustCompile("([a-zA-Z0-9-_.]+\\.(?i:png|jpg|jpeg|bmp|tga|obj|b3d|x|gltf|glb))")
func (sc *ServerConn) prependFormspec(fs *string) {
*fs = ReplaceAllStringSubmatchFunc(textureName, *fs, func(groups []string) string {