Closed PayDevD closed 4 years ago
For issue #1071
GlowDoubleChest extends GlowSuperInventory and its field, parents' GlowInventory viewers are unmodifiable.
protected void initialize(List<GlowInventory> parents, InventoryHolder owner, InventoryType type, String title) { SuperList<GlowInventorySlot> slots = new SuperList<>(); SuperSet<HumanEntity> viewers = new SuperSet<>(); for (GlowInventory parent : parents) { slots.getParents().add(parent.getSlots()); viewers.getParents().add(parent.getViewersSet()); } initialize(slots, viewers, owner, type, title); this.parents = parents; }
However, viewers should be modifiable because openInventory logic modifies its viewers. UnmodifiableSet could occur UnsupportedOperationException. We can use synchronizedSet instead of unmodifiableSet.
All committers have signed the CLA.
@mastercoms I would appreciate if you could merge this branch. Thanks for your review!
For issue #1071
GlowDoubleChest extends GlowSuperInventory and its field, parents' GlowInventory viewers are unmodifiable.
However, viewers should be modifiable because openInventory logic modifies its viewers. UnmodifiableSet could occur UnsupportedOperationException. We can use synchronizedSet instead of unmodifiableSet.