added distribution task to client buildscript

This commit is contained in:
2021-11-17 12:31:35 +01:00
parent 8d7ab3e6e9
commit 7a0f30f8b7
15 changed files with 36 additions and 28 deletions

View File

@@ -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();