Skip to content

Commit

Permalink
ctrl: 将Set改回List
Browse files Browse the repository at this point in the history
  • Loading branch information
Silvigarabis committed Jan 2, 2024
1 parent a82be54 commit 284a008
Showing 1 changed file with 7 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,24 +27,22 @@
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.HashSet;

//import java.util.WeakHashMap;

public final class ESplitterController {

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

private Player player;
protected Player player;

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

private ItemStack selectedItem;
protected ItemStack selectedItem;

private Map<Enchantment, Integer> enchantments;
protected Map<Enchantment, Integer> enchantments;

private Set<EnchantmentSet> enchantSetList;
protected List<EnchantmentSet> enchantSetList;

private ESplitterGui gui;

Expand Down Expand Up @@ -90,7 +88,7 @@ public void selectItem(ItemStack item){
// 感觉写的不是很好,先就这样吧,以后看看怎么弄

private void divideEnchantmentSet(){
this.enchantSetList = new HashSet<>();
this.enchantSetList = new ArrayList<>();

for (var ench : this.enchantments.keySet()){
this.enchantSetList.add(new EnchantmentSet(ench));
Expand Down Expand Up @@ -122,7 +120,7 @@ public boolean removeEnchantment(EnchantmentSet enchantSet){
enchantments.remove(ench);
}

enchantSetList.remove(enchantSet);
enchantSetList.removeIf((e) -> e == enchantSet);

playerInv.setItem(slot, selectedItem);

Expand Down

0 comments on commit 284a008

Please sign in to comment.