|
1 | 1 | package cn.handyplus.menu.inventory;
|
2 | 2 |
|
3 | 3 | import cn.handyplus.lib.constants.BaseConstants;
|
| 4 | +import cn.handyplus.lib.core.CollUtil; |
4 | 5 | import cn.handyplus.lib.core.NumberUtil;
|
5 | 6 | import cn.handyplus.lib.core.StrUtil;
|
6 | 7 | import cn.handyplus.lib.inventory.HandyInventory;
|
|
25 | 26 | import org.bukkit.inventory.meta.ItemMeta;
|
26 | 27 | import org.bukkit.inventory.meta.SkullMeta;
|
27 | 28 |
|
| 29 | +import java.util.HashMap; |
28 | 30 | import java.util.List;
|
29 | 31 | import java.util.Map;
|
30 | 32 | import java.util.Optional;
|
@@ -181,8 +183,11 @@ public static MenuButtonParam getMenuButtonParam(MemorySection memorySection, Of
|
181 | 183 | int customModelDataId = memorySection.getInt("custom-model-data");
|
182 | 184 | int priority = memorySection.getInt("priority");
|
183 | 185 | List<String> commands = memorySection.getStringList("commands");
|
| 186 | + List<String> leftActions = memorySection.getStringList("actions.left"); |
| 187 | + List<String> rightActions = memorySection.getStringList("actions.right"); |
184 | 188 | List<String> conditions = memorySection.getStringList("conditions");
|
185 | 189 | String sound = memorySection.getString("sound");
|
| 190 | + String clickType = memorySection.getString("clickType"); |
186 | 191 | String failSound = memorySection.getString("failSound");
|
187 | 192 | boolean isEnchant = memorySection.getBoolean("isEnchant", false);
|
188 | 193 | boolean hideFlag = memorySection.getBoolean("hideFlag", true);
|
@@ -235,6 +240,15 @@ public static MenuButtonParam getMenuButtonParam(MemorySection memorySection, Of
|
235 | 240 | menuButtonParam.setDynamicAmount(dynamicAmount);
|
236 | 241 | menuButtonParam.setNotPermission(notPermission);
|
237 | 242 | menuButtonParam.setPriority(priority);
|
| 243 | + Map<String, List<String>> actions = new HashMap<>(); |
| 244 | + if (CollUtil.isNotEmpty(leftActions)) { |
| 245 | + actions.put("left", leftActions); |
| 246 | + } |
| 247 | + if (CollUtil.isNotEmpty(rightActions)) { |
| 248 | + actions.put("right", rightActions); |
| 249 | + } |
| 250 | + menuButtonParam.setActions(actions); |
| 251 | + menuButtonParam.setClickType(clickType); |
238 | 252 | // 扩展商店属性
|
239 | 253 | menuButtonParam.setShopType(shopType);
|
240 | 254 | menuButtonParam.setShopMaterial(shopMaterial);
|
|
0 commit comments