Skip to content

Commit b79592b

Browse files
committed
use the MapTemplate library
1 parent bfb7e37 commit b79592b

3 files changed

Lines changed: 15 additions & 111 deletions

File tree

pom.xml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,12 @@
8181
<shadedPattern>me.hsgamer.bettergui.lib.craftitem</shadedPattern>
8282
</relocation>
8383

84+
<!-- MapTemplate -->
85+
<relocation>
86+
<pattern>io.github.projectunified.maptemplate</pattern>
87+
<shadedPattern>me.hsgamer.bettergui.lib.maptemplate</shadedPattern>
88+
</relocation>
89+
8490
<!-- bStats -->
8591
<relocation>
8692
<pattern>org.bstats</pattern>
@@ -351,6 +357,13 @@
351357
<version>${craftitem.version}</version>
352358
</dependency>
353359

360+
<!-- MapTemplate -->
361+
<dependency>
362+
<groupId>io.github.projectunified</groupId>
363+
<artifactId>map-template</artifactId>
364+
<version>1.0.0</version>
365+
</dependency>
366+
354367
<!-- Annotations -->
355368
<dependency>
356369
<groupId>org.jetbrains</groupId>

src/main/java/me/hsgamer/bettergui/config/TemplateConfig.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
package me.hsgamer.bettergui.config;
22

3+
import io.github.projectunified.maptemplate.MapTemplate;
34
import io.github.projectunified.minelib.plugin.base.Loadable;
45
import io.github.projectunified.minelib.plugin.postenable.PostEnable;
56
import me.hsgamer.bettergui.BetterGUI;
67
import me.hsgamer.bettergui.builder.ConfigBuilder;
7-
import me.hsgamer.bettergui.util.MapTemplate;
88
import me.hsgamer.hscore.common.MapUtils;
99

1010
import java.io.File;
@@ -87,8 +87,7 @@ public Map<String, Object> getValues(Map<String, Object> settingMap, List<String
8787
.forEach(entry -> finalMap.put(entry.getKey(), entry.getValue()));
8888
return variableMap.isEmpty()
8989
? finalMap
90-
: MapUtils.castOptionalStringObjectMap(MapTemplate.apply(finalMap, variableMap), false).orElse(Collections.emptyMap());
91-
90+
: MapUtils.castOptionalStringObjectMap(MapTemplate.builder().setVariableMap(variableMap).build().apply(finalMap), false).orElse(Collections.emptyMap());
9291
}
9392

9493
/**

src/main/java/me/hsgamer/bettergui/util/MapTemplate.java

Lines changed: 0 additions & 108 deletions
This file was deleted.

0 commit comments

Comments
 (0)