KyoriPowered / adventure

A user-interface library, formerly known as text, for Minecraft: Java Edition
https://docs.advntr.dev/
MIT License
679 stars 105 forks source link

Make use of Java 9+ immutable collections #459

Open kashike opened 2 years ago

CoreyShupe commented 2 years ago

Could we possibly have more of a description on what this is achieving and what adventure is trying to change with the use of immutable collections.

electronicboy commented 2 years ago

components are immutable, hence things like Lists, stored on components, are immutable; Right now the project is using Guavas immutable lists, aim here I'd imagine is to get away from Guava's given that java now offers their own standard implementations of these

kashike commented 2 years ago

We don't use Guava, but we do a lot of stuff like Collections.unmodifiableList(new ArrayList<>(someList)) which can just be List.copyOf(someList) with Java 9+.