Skip to content

Commit f91a246

Browse files
committed
Some clean up
1 parent dba771f commit f91a246

File tree

13 files changed

+37
-50
lines changed

13 files changed

+37
-50
lines changed

LICENSE

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,9 @@
1-
Copyright (c) 2022-2023 Linnea Gräf
1+
Copyright 2023 Linnea Gräf
22

3-
Redistribution and use in source and binary forms, with or without
4-
modification, are permitted provided that the following conditions are met:
3+
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
54

6-
1. Redistributions of source code must retain the above copyright notice, this
7-
list of conditions and the following disclaimer.
8-
9-
2. Redistributions in binary form must reproduce the above copyright notice,
10-
this list of conditions and the following disclaimer in the documentation
11-
and/or other materials provided with the distribution.
12-
13-
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
14-
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15-
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
16-
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
17-
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18-
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
19-
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
20-
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
21-
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
22-
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
5+
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
236

7+
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
248

9+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

README.md

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,5 @@ development. As such every commit could be a breaking change. Please plan accord
1313
This repository incorporates (in addition to libraries loaded by gradle) a file taken
1414
from [the google gson extra repository](https://github.com/google/gson/blob/master/extras/src/main/java/com/google/gson/typeadapters/RuntimeTypeAdapterFactory.java)
1515
with our own changes (highlighted in the code). That file is licensed under the Apache License version 2.0. The rest of
16-
the source code is licensed under the BSD-3-Clause No Military License.
16+
the source code is licensed under the BSD-2-Clause License.
1717

18-
```
19-
Copyright (c) 2022 The NEU authors. All Rights Reserved.
20-
21-
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
22-
23-
1. Redistribution of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
24-
2. Redistribution in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
25-
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
26-
27-
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28-
29-
YOU ACKNOWLEDGE THAT THIS SOFTWARE IS NOT DESIGNED, LICENSED OR INTENDED FOR USE IN THE DESIGN, CONSTRUCTION, OPERATION OR MAINTENANCE OF ANY MILITARY FACILITY.
30-
```

build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ plugins {
1010
}
1111

1212
group = "moe.nea"
13-
version = "0.0.1"
13+
version = "1.0.0"
1414

1515
repositories {
1616
mavenCentral()

src/main/java/io/github/moulberry/repo/NEUConstants.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,7 @@
33
import com.google.gson.JsonElement;
44
import com.google.gson.JsonObject;
55
import com.google.gson.reflect.TypeToken;
6-
import io.github.moulberry.repo.constants.Parents;
7-
import io.github.moulberry.repo.constants.Bonuses;
8-
import io.github.moulberry.repo.constants.Enchants;
9-
import io.github.moulberry.repo.constants.EssenceCosts;
10-
import io.github.moulberry.repo.constants.FairySouls;
6+
import io.github.moulberry.repo.constants.*;
117
import lombok.Getter;
128

139
import java.util.List;

src/main/java/io/github/moulberry/repo/NEUItems.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package io.github.moulberry.repo;
22

33
import io.github.moulberry.repo.data.NEUItem;
4+
import io.github.moulberry.repo.util.NEUId;
45
import io.github.moulberry.repo.util.StreamIt;
56
import lombok.Getter;
67
import org.checkerframework.checker.nullness.qual.Nullable;
@@ -13,7 +14,7 @@
1314
public class NEUItems implements IReloadable {
1415

1516
@Getter
16-
Map<String, NEUItem> items;
17+
Map<@NEUId String, NEUItem> items;
1718

1819
@Override
1920
public void reload(NEURepository repository) throws NEURepositoryException {
@@ -29,7 +30,7 @@ public void reload(NEURepository repository) throws NEURepositoryException {
2930
}
3031

3132
@Nullable
32-
public NEUItem getItemBySkyblockId(String itemId) {
33+
public NEUItem getItemBySkyblockId(@NEUId String itemId) {
3334
return items.get(itemId.toUpperCase(Locale.ROOT));
3435
}
3536
}

src/main/java/io/github/moulberry/repo/NEURecipeCache.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import io.github.moulberry.repo.data.NEUIngredient;
44
import io.github.moulberry.repo.data.NEUItem;
55
import io.github.moulberry.repo.data.NEURecipe;
6+
import io.github.moulberry.repo.util.NEUId;
67
import lombok.Getter;
78

89
import java.util.HashMap;
@@ -31,9 +32,9 @@ public static NEURecipeCache forRepo(NEURepository repository) {
3132

3233

3334
@Getter
34-
Map<String, Set<NEURecipe>> recipes = new HashMap<>();
35+
Map<@NEUId String, Set<NEURecipe>> recipes = new HashMap<>();
3536
@Getter
36-
Map<String, Set<NEURecipe>> usages = new HashMap<>();
37+
Map<@NEUId String, Set<NEURecipe>> usages = new HashMap<>();
3738

3839

3940
@Override

src/main/java/io/github/moulberry/repo/NEURepository.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import com.google.gson.Gson;
44
import com.google.gson.GsonBuilder;
55
import com.google.gson.reflect.TypeToken;
6-
import com.google.gson.typeadapters.RuntimeTypeAdapterFactory;
6+
import io.github.moulberry.repo.vendored.RuntimeTypeAdapterFactory;
77
import io.github.moulberry.repo.data.*;
88
import lombok.Getter;
99
import lombok.NonNull;

src/main/java/io/github/moulberry/repo/constants/EssenceCosts.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import com.google.gson.JsonElement;
55
import com.google.gson.JsonObject;
66
import io.github.moulberry.repo.NEURepositoryException;
7+
import io.github.moulberry.repo.util.NEUId;
78
import lombok.Data;
89
import lombok.Getter;
910

@@ -34,7 +35,7 @@ private EssenceCost() {
3435
}
3536

3637
@Getter
37-
Map<String, EssenceCost> costs;
38+
Map<@NEUId String, EssenceCost> costs;
3839

3940
public EssenceCosts(JsonObject json) throws NEURepositoryException {
4041
costs = new HashMap<>();

src/main/java/io/github/moulberry/repo/Leveling.java renamed to src/main/java/io/github/moulberry/repo/constants/Leveling.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package io.github.moulberry.repo;
1+
package io.github.moulberry.repo.constants;
22

33
import com.google.gson.annotations.SerializedName;
44
import lombok.Getter;

src/main/java/io/github/moulberry/repo/data/NEUIngredient.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
package io.github.moulberry.repo.data;
22

33
import com.google.gson.*;
4+
import io.github.moulberry.repo.util.NEUId;
45
import lombok.Getter;
56

67
import java.lang.reflect.Type;
78

89
@Getter
910
public class NEUIngredient {
10-
String itemId;
11+
@NEUId String itemId;
1112
int amount;
1213
public static final String NEU_SENTINEL_EMPTY = "NEU_SENTINEL_EMPTY";
1314
public static final NEUIngredient SENTINEL_EMPTY = new NEUIngredient();

0 commit comments

Comments
 (0)