added distribution task to client buildscript
This commit is contained in:
@@ -14,6 +14,7 @@ import org.jetbrains.annotations.Unmodifiable;
|
||||
import java.util.*;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Unmodifiable
|
||||
@EqualsAndHashCode(of = {"values", "present"})
|
||||
public final class GameData {
|
||||
@@ -59,12 +60,10 @@ public final class GameData {
|
||||
public <T> T get(@NotNull Key<T> key) {
|
||||
int index = key.index();
|
||||
if (present[index]) {
|
||||
//noinspection unchecked
|
||||
return (T) values[index];
|
||||
} else if (key.defaultValue() != null) {
|
||||
present[index] = true;
|
||||
values[index] = key.defaultValue().get();
|
||||
//noinspection unchecked
|
||||
return (T) values[index];
|
||||
} else {
|
||||
throw new NoSuchElementException();
|
||||
|
Reference in New Issue
Block a user