Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .github/scripts/install-local-dependencies.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/usr/bin/env bash
set -euo pipefail
# Run from the repository root after downloading the pinned JARs.
# Hash-qualified versions prevent different private JARs sharing a Maven cache key.
sha256sum --check .github/dependencies.sha256

mvn -B --no-transfer-progress org.apache.maven.plugins:maven-install-plugin:3.1.4:install-file \
-Dfile="libs/gson-2.10.1.jar" -DgroupId="local" -DartifactId="gson" \
-Dversion="2.10.1-tfmc-4241c14a7727" -Dpackaging=jar -DgeneratePom=true "$@"
mvn -B --no-transfer-progress org.apache.maven.plugins:maven-install-plugin:3.1.4:install-file \
-Dfile="libs/MMOCore-1.11.3.jar" -DgroupId="local" -DartifactId="MMOCore" \
-Dversion="1.11.3-tfmc-d52cc0c734a9" -Dpackaging=jar -DgeneratePom=true "$@"
mvn -B --no-transfer-progress org.apache.maven.plugins:maven-install-plugin:3.1.4:install-file \
-Dfile="libs/MMOItems-6.10.jar" -DgroupId="local" -DartifactId="MMOItems" \
-Dversion="6.10-tfmc-c84700df5942" -Dpackaging=jar -DgeneratePom=true "$@"
mvn -B --no-transfer-progress org.apache.maven.plugins:maven-install-plugin:3.1.4:install-file \
-Dfile="libs/MythicLib-1.7.jar" -DgroupId="local" -DartifactId="MythicLib" \
-Dversion="1.7-tfmc-660ff2a6ec86" -Dpackaging=jar -DgeneratePom=true "$@"
2 changes: 1 addition & 1 deletion .github/scripts/prepare-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ curl --fail --location --silent --show-error --retry 3 -H "Authorization: Bearer
curl --fail --location --silent --show-error --retry 3 -H "Authorization: Bearer $GH_TOKEN" -H "Accept: application/vnd.github.raw+json" "https://api.github.com/repos/TF-Minecraft/ServerAssets/contents/jars/d52cc0c734a9/MMOCore-1.11.3.jar?ref=$ref" > "libs/MMOCore-1.11.3.jar"
curl --fail --location --silent --show-error --retry 3 -H "Authorization: Bearer $GH_TOKEN" -H "Accept: application/vnd.github.raw+json" "https://api.github.com/repos/TF-Minecraft/ServerAssets/contents/jars/c84700df5942/MMOItems-6.10.jar?ref=$ref" > "libs/MMOItems-6.10.jar"
curl --fail --location --silent --show-error --retry 3 -H "Authorization: Bearer $GH_TOKEN" -H "Accept: application/vnd.github.raw+json" "https://api.github.com/repos/TF-Minecraft/ServerAssets/contents/jars/660ff2a6ec86/MythicLib-1.7.jar?ref=$ref" > "libs/MythicLib-1.7.jar"
sha256sum --check .github/dependencies.sha256
bash .github/scripts/install-local-dependencies.sh "$@"
20 changes: 8 additions & 12 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,30 +18,26 @@
<dependency>
<groupId>local</groupId>
<artifactId>gson</artifactId>
<version>2.10.1</version>
<scope>system</scope>
<systemPath>${project.basedir}/libs/gson-2.10.1.jar</systemPath>
<version>2.10.1-tfmc-4241c14a7727</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>local</groupId>
<artifactId>MMOCore</artifactId>
<version>1.11.3</version>
<scope>system</scope>
<systemPath>${project.basedir}/libs/MMOCore-1.11.3.jar</systemPath>
<version>1.11.3-tfmc-d52cc0c734a9</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>local</groupId>
<artifactId>MMOItems</artifactId>
<version>6.10</version>
<scope>system</scope>
<systemPath>${project.basedir}/libs/MMOItems-6.10.jar</systemPath>
<version>6.10-tfmc-c84700df5942</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>local</groupId>
<artifactId>MythicLib</artifactId>
<version>1.7</version>
<scope>system</scope>
<systemPath>${project.basedir}/libs/MythicLib-1.7.jar</systemPath>
<version>1.7-tfmc-660ff2a6ec86</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.spigotmc</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public static void applyCosmetics(MMOItem mmo, Gemstone gem, GemRarity rarity) {
itemName.setString(infusedName);
}
mmo.replaceData(ItemStats.NAME, itemName);
StatHistory hist = StatHistory.from(mmo, ItemStats.NAME);
StatHistory hist = mmo.computeStatHistory(ItemStats.NAME);
if (hist != null) {
NameData og = (NameData) hist.getOriginalData();
og.setString(infusedName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ private static boolean applyStat(MMOItem mmo, String statId, double value) {
DoubleData data = new DoubleData(value);
mmo.setData(itemStat, data);
@SuppressWarnings("deprecation")
StatHistory hist = StatHistory.from(mmo, itemStat);
StatHistory hist = mmo.computeStatHistory(itemStat);
if (hist != null) {
hist.registerExternalData(data);
mmo.setStatHistory(itemStat, hist);
Expand All @@ -156,7 +156,7 @@ private static boolean applyStat(MMOItem mmo, String statId, double value) {
}

private static void zeroOriginal(MMOItem mmo, ItemStat<?, ?> itemStat) {
StatHistory hist = StatHistory.from(mmo, itemStat);
StatHistory hist = mmo.computeStatHistory(itemStat);
if (hist != null) {
Object og = hist.getOriginalData();
if (og instanceof DoubleData doubleOg) {
Expand Down