Skip to content

Commit

Permalink
gui: 延迟更新功能按钮;修复物品生成函数没有正确设置物品名的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
Silvigarabis committed Jan 4, 2024
1 parent f6a187a commit 6dcaf1f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,17 @@ public final class ESplitterController {

//private WeakHashMap<Player, ESplitterController> controllers = new WeakMap();

protected Player player;
protected Player player = null;

protected List<String> notifications = new ArrayList();

protected ItemStack selectedItem;
protected ItemStack selectedItem = null;

protected Map<Enchantment, Integer> enchantments;
protected Map<Enchantment, Integer> enchantments = null;

protected List<EnchantmentSet> enchantSetList;
protected List<EnchantmentSet> enchantSetList = null;

private ESplitterGui gui;
private ESplitterGui gui = null;

public ESplitterController(Player player){
if (!ESplitterPlugin.isConfigured()){
Expand Down
10 changes: 5 additions & 5 deletions src/main/java/io/github/silvigarabis/esplitter/ESplitterGui.java
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,6 @@ public ESplitterGui(ESplitterController ctrl){

buildBorder();
buildLine();

buildMiscButton();
}

public void buildBorder(){
Expand Down Expand Up @@ -347,6 +345,7 @@ public void closeGui(){

public void setSelectedItem(ItemStack item){
this.itemStacks.put(selectedItemIndex, item != null ? item.clone() : null);
buildMiscButton();
this.update();
}

Expand Down Expand Up @@ -585,11 +584,12 @@ public static ItemStack createTextItem(ItemStack item, String... texts){
return createTextItem(item, textList);
}
public static ItemStack createTextItem(ItemStack item, List<String> textList){
String titleText = "";
String titleText = null;
if (textList.size() > 0){
titleText = textList.get(0);
} else {
titleText = null;
}
if (titleText != null){
titleText = "§r§f" + titleText;
}
List<String> contentList = null;
if (textList.size() > 1){
Expand Down

0 comments on commit 6dcaf1f

Please sign in to comment.