|
24 | 24 | import com.clubobsidian.dynamicgui.api.inventory.ItemStackWrapper;
|
25 | 25 | import com.clubobsidian.dynamicgui.api.manager.ModelManager;
|
26 | 26 | import com.clubobsidian.dynamicgui.api.manager.inventory.ItemStackManager;
|
| 27 | +import com.clubobsidian.dynamicgui.api.manager.material.MaterialManager; |
27 | 28 | import com.clubobsidian.dynamicgui.api.manager.replacer.AnimationReplacerManager;
|
28 | 29 | import com.clubobsidian.dynamicgui.api.manager.replacer.ReplacerManager;
|
29 | 30 | import com.clubobsidian.dynamicgui.api.model.ModelProvider;
|
@@ -184,23 +185,26 @@ public FunctionTree getFunctions() {
|
184 | 185 | public ItemStackWrapper<?> buildItemStack(@NotNull PlayerWrapper<?> playerWrapper) {
|
185 | 186 | Objects.requireNonNull(playerWrapper);
|
186 | 187 | ItemStackWrapper<?> builderItem = this.itemStack;
|
| 188 | + String updatedIcon = MaterialManager |
| 189 | + .get() |
| 190 | + .normalizeMaterial(ReplacerManager.get().replace(this.icon, playerWrapper)); |
187 | 191 | if (builderItem == null) {
|
188 |
| - builderItem = ItemStackManager.get().createItemStackWrapper(this.icon, this.amount); |
| 192 | + builderItem = ItemStackManager.get().createItemStackWrapper(updatedIcon, this.amount); |
189 | 193 | } else {
|
190 |
| - builderItem.setType(this.icon); |
| 194 | + builderItem.setType(updatedIcon); |
191 | 195 | builderItem.setAmount(this.amount);
|
192 | 196 | }
|
193 | 197 | if (builderItem == null) {
|
194 | 198 | DynamicGui.get().getLogger().error(
|
195 | 199 | "Invalid material type '%s' for slot '%d' in gui '%s'",
|
196 |
| - this.icon, |
| 200 | + updatedIcon, |
197 | 201 | this.index,
|
198 | 202 | this.getOwner().getName()
|
199 | 203 | );
|
200 | 204 | return null;
|
201 | 205 | }
|
202 | 206 |
|
203 |
| - if (!this.icon.equalsIgnoreCase(IGNORE_MATERIAL)) { |
| 207 | + if (!updatedIcon.equalsIgnoreCase(IGNORE_MATERIAL)) { |
204 | 208 | if (this.data != 0) {
|
205 | 209 | builderItem.setDurability(this.data);
|
206 | 210 | }
|
|
0 commit comments