Skip to content
This repository was archived by the owner on Sep 23, 2026. It is now read-only.
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
27 changes: 27 additions & 0 deletions .github/scripts/install-local-dependencies.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/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/ItemsAdder_3.5.0-r2.jar" -DgroupId="local" -DartifactId="LoneLibs" \
-Dversion="3.5.0-tfmc-0116d714822b" -Dpackaging=jar -DgeneratePom=true "$@"
mvn -B --no-transfer-progress org.apache.maven.plugins:maven-install-plugin:3.1.4:install-file \
-Dfile="libs/json-simple-1.1.jar" -DgroupId="local" -DartifactId="json-simple" \
-Dversion="1.1-tfmc-2d9484f4c649" -Dpackaging=jar -DgeneratePom=true "$@"
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.6.1-tfmc-660ff2a6ec86" -Dpackaging=jar -DgeneratePom=true "$@"
mvn -B --no-transfer-progress org.apache.maven.plugins:maven-install-plugin:3.1.4:install-file \
-Dfile="libs/MythicMobs-5.8.0-SNAPSHOT.jar" -DgroupId="local" -DartifactId="MythicMobs" \
-Dversion="5.8.0-tfmc-575aa30aee8e" -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 @@ -10,4 +10,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/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"
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/575aa30aee8e/MythicMobs-5.8.0-SNAPSHOT.jar?ref=$ref" > "libs/MythicMobs-5.8.0-SNAPSHOT.jar"
sha256sum --check .github/dependencies.sha256
bash .github/scripts/install-local-dependencies.sh "$@"
35 changes: 14 additions & 21 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,44 +17,38 @@
<dependency>
<groupId>local</groupId>
<artifactId>LoneLibs</artifactId>
<version>3.5.0</version>
<scope>system</scope>
<systemPath>${project.basedir}/libs/ItemsAdder_3.5.0-r2.jar</systemPath>
<version>3.5.0-tfmc-0116d714822b</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>local</groupId>
<artifactId>json-simple</artifactId>
<version>1.1</version>
<scope>system</scope>
<systemPath>${project.basedir}/libs/json-simple-1.1.jar</systemPath>
<version>1.1-tfmc-2d9484f4c649</version>
<scope>provided</scope>
</dependency>
<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.6.1</version>
<scope>system</scope>
<systemPath>${project.basedir}/libs/MythicLib-1.7.jar</systemPath>
<version>1.6.1-tfmc-660ff2a6ec86</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.spigotmc</groupId>
Expand All @@ -65,9 +59,8 @@
<dependency>
<groupId>local</groupId>
<artifactId>MythicMobs</artifactId>
<version>5.8.0</version>
<scope>system</scope>
<systemPath>${project.basedir}/libs/MythicMobs-5.8.0-SNAPSHOT.jar</systemPath>
<version>5.8.0-tfmc-575aa30aee8e</version>
<scope>provided</scope>
</dependency>
</dependencies>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package net.tfminecraft.advancedresearch;

import net.tfminecraft.advancedresearch.util.LegacyModelData;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
Expand Down Expand Up @@ -28,7 +30,7 @@ public void MenuInventory(Player player, RStation rs) {
if(re.getId().equalsIgnoreCase(e.split("\\.")[0])) {
ItemStack eItem = new ItemStack(re.getMaterial(), 1);
ItemMeta m = eItem.getItemMeta();
m.setCustomModelData(re.getModelData());
LegacyModelData.set(m, re.getModelData());
m.setDisplayName(re.getName());
List<String> lore = new ArrayList<String>();
for(String ce : rs.getCurrentElements()) {
Expand Down Expand Up @@ -148,7 +150,7 @@ public void UpdateInventory(Inventory i, Player p, RStation rs) {
if(re.getId().equalsIgnoreCase(e.split("\\.")[0])) {
ItemStack eItem = new ItemStack(re.getMaterial(), 1);
ItemMeta m = eItem.getItemMeta();
m.setCustomModelData(re.getModelData());
LegacyModelData.set(m, re.getModelData());
m.setDisplayName(re.getName());
List<String> lore = new ArrayList<String>();
for(String ce : rs.getCurrentElements()) {
Expand Down Expand Up @@ -201,8 +203,7 @@ public ItemStack getItemsAdderItem(String path) {
}
@SuppressWarnings("deprecation")
public ItemStack getMMOItem(String path) {
ItemManager itemManager = MMOItems.plugin.getItems();
ItemStack item = itemManager.getMMOItem(MMOItems.plugin.getTypes().get(path.split("\\.")[1].toUpperCase()), path.split("\\.")[2].toUpperCase()).newBuilder().build(); //m.material.salt
ItemStack item = MMOItems.plugin.getMMOItem(MMOItems.plugin.getTypes().get(path.split("\\.")[1].toUpperCase()), path.split("\\.")[2].toUpperCase()).newBuilder().build(); //m.material.salt
return item;
}

Expand Down Expand Up @@ -230,7 +231,7 @@ public void completeResearch(Inventory i, Player p, RStation rs, Boolean open) {
if(re.getId().equalsIgnoreCase(e.split("\\.")[0])) {
ItemStack eItem = new ItemStack(re.getMaterial(), 1);
ItemMeta m = eItem.getItemMeta();
m.setCustomModelData(re.getModelData());
LegacyModelData.set(m, re.getModelData());
m.setDisplayName(re.getName());
List<String> lore = new ArrayList<String>();
for(String ce : rs.getCurrentElements()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,7 @@ private void giveResult(Player p, RStation rs) {
}
String type = rs.getResult().split("\\.")[0]; //v.emerald
if(type.equalsIgnoreCase("m")) {
ItemManager itemManager = MMOItems.plugin.getItems();
ItemStack item = itemManager.getMMOItem(MMOItems.plugin.getTypes().get(rs.getResult().split("\\.")[1].toUpperCase()), rs.getResult().split("\\.")[2].toUpperCase()).newBuilder().build(); //m.material.salt
ItemStack item = MMOItems.plugin.getMMOItem(MMOItems.plugin.getTypes().get(rs.getResult().split("\\.")[1].toUpperCase()), rs.getResult().split("\\.")[2].toUpperCase()).newBuilder().build(); //m.material.salt
p.getInventory().addItem(item);
} else {
CustomStack stack = CustomStack.getInstance(rs.getResult().split("\\.")[1]);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
package net.tfminecraft.advancedresearch.util;

import java.util.List;
import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.inventory.meta.components.CustomModelDataComponent;

/** Preserves the integer model IDs used by existing configuration and resource packs. */
public final class LegacyModelData {
private LegacyModelData() {}

public static boolean has(ItemMeta meta) {
return !meta.getCustomModelDataComponent().getFloats().isEmpty();
}

public static int get(ItemMeta meta) {
List<Float> floats = meta.getCustomModelDataComponent().getFloats();
if (floats.isEmpty()) {
throw new IllegalStateException("We don't have CustomModelData! Check hasCustomModelData first!");
}
return floats.get(0).intValue();
}

public static void set(ItemMeta meta, Integer value) {
if (value == null) {
meta.setCustomModelDataComponent(null);
return;
}
CustomModelDataComponent component = meta.getCustomModelDataComponent();
// The former integer setter replaced the entire component, not just its first float.
component.setFloats(List.of(value.floatValue()));
component.setFlags(List.of());
component.setStrings(List.of());
component.setColors(List.of());
meta.setCustomModelDataComponent(component);
}
}