Fix incorrect Collections#unmodifiableSet usage

This commit is contained in:
dordsor21 2021-02-01 15:07:54 +00:00
parent 09ba78d1e9
commit f88432a709
No known key found for this signature in database
GPG Key ID: 1E53E88969FFCF0B
4 changed files with 8 additions and 8 deletions

View File

@ -196,11 +196,11 @@ public class FAWEWorldNativeAccess_1_15_2 implements WorldNativeAccess<Chunk, IB
}
private synchronized void flushAsync(final boolean sendChunks) {
final Set<CachedChange> changes = Collections.unmodifiableSet(cachedChanges);
final Set<CachedChange> changes = Collections.unmodifiableSet(new HashSet<>(cachedChanges));
cachedChanges.clear();
final Set<IntPair> toSend;
if (sendChunks) {
toSend = Collections.unmodifiableSet(cachedChunksToSend);
toSend = Collections.unmodifiableSet(new HashSet<>(cachedChunksToSend));
cachedChunksToSend.clear();
} else {
toSend = Collections.emptySet();

View File

@ -197,11 +197,11 @@ public class FAWEWorldNativeAccess_1_16_R1 implements WorldNativeAccess<Chunk, I
}
private synchronized void flushAsync(final boolean sendChunks) {
final Set<CachedChange> changes = Collections.unmodifiableSet(cachedChanges);
final Set<CachedChange> changes = Collections.unmodifiableSet(new HashSet<>(cachedChanges));
cachedChanges.clear();
final Set<IntPair> toSend;
if (sendChunks) {
toSend = Collections.unmodifiableSet(cachedChunksToSend);
toSend = Collections.unmodifiableSet(new HashSet<>(cachedChunksToSend));
cachedChunksToSend.clear();
} else {
toSend = Collections.emptySet();

View File

@ -197,11 +197,11 @@ public class FAWEWorldNativeAccess_1_16_R2 implements WorldNativeAccess<Chunk, I
}
private synchronized void flushAsync(final boolean sendChunks) {
final Set<CachedChange> changes = Collections.unmodifiableSet(cachedChanges);
final Set<CachedChange> changes = Collections.unmodifiableSet(new HashSet<>(cachedChanges));
cachedChanges.clear();
final Set<IntPair> toSend;
if (sendChunks) {
toSend = Collections.unmodifiableSet(cachedChunksToSend);
toSend = Collections.unmodifiableSet(new HashSet<>(cachedChunksToSend));
cachedChunksToSend.clear();
} else {
toSend = Collections.emptySet();

View File

@ -196,11 +196,11 @@ public class FAWEWorldNativeAccess_1_16_R3 implements WorldNativeAccess<Chunk, I
}
private synchronized void flushAsync(final boolean sendChunks) {
final Set<CachedChange> changes = Collections.unmodifiableSet(cachedChanges);
final Set<CachedChange> changes = Collections.unmodifiableSet(new HashSet<>(cachedChanges));
cachedChanges.clear();
final Set<IntPair> toSend;
if (sendChunks) {
toSend = Collections.unmodifiableSet(cachedChunksToSend);
toSend = Collections.unmodifiableSet(new HashSet<>(cachedChunksToSend));
cachedChunksToSend.clear();
} else {
toSend = Collections.emptySet();