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
4 changes: 4 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ jobs:
grep -Fxq 'data/middle-earth/loot_table/blocks/skeletal_pile_layer.json' "$RUNNER_TEMP/middle-earth-player-jar-entries.txt"
grep -Fxq 'data/middle-earth/loot_table/blocks/waste_pile_layer.json' "$RUNNER_TEMP/middle-earth-player-jar-entries.txt"
grep -Fxq 'assets/middle-earth/models/item/gondorian_sword.json' "$RUNNER_TEMP/middle-earth-player-jar-entries.txt"
for armor in gondorian_horse_armor rohirric_horse_armor dalish_horse_armor lorien_horse_armor; do
grep -Fxq "assets/middle-earth/textures/entity/horse/armor/horse_armor_${armor}.png" "$RUNNER_TEMP/middle-earth-player-jar-entries.txt"
! grep -Fxq "assets/middle-earth/textures/entity/equipment/horse_body/${armor}.png" "$RUNNER_TEMP/middle-earth-player-jar-entries.txt"
done
wild_things_entry=$(grep -E '^META-INF/jarjar/.+Of-Beasts-and-Wild-Things.+\.jar$' "$RUNNER_TEMP/middle-earth-player-jar-entries.txt")
unzip -p "${player_jars[0]}" "$wild_things_entry" > "$RUNNER_TEMP/wild-things.jar"
jar tf "$RUNNER_TEMP/wild-things.jar" > "$RUNNER_TEMP/wild-things-entries.txt"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,38 @@ void itemTintsMatchTheUpstreamDefinitions() throws IOException {
assertTrue(colors.contains("ResourceItemsME.COLORED_BUNDLES"));
}

@Test
void horseArmorTexturesUseTheMinecraft1211PathContract() throws IOException {
String equipment = source("net/sevenstars/middleearth/item/EquipmentItemsME.java");
String materials = source(
"net/sevenstars/middleearth/item/utils/armor/ArmorMaterialsME.java"
);

for (String armor : new String[]{
"gondorian_horse_armor",
"rohirric_horse_armor",
"dalish_horse_armor",
"lorien_horse_armor"
}) {
assertTrue(materials.contains("registerArmor(\"" + armor + "\""), armor);
assertTrue(equipment.contains("registerGeneratedItem(\"" + armor + "\""), armor);
assertTrue(
Files.isRegularFile(MAIN_RESOURCE_TEXTURES.resolve(
"entity/horse/armor/horse_armor_" + armor + ".png"
)),
"Missing Minecraft 1.21.1 horse armor texture for " + armor
);
assertFalse(
Files.exists(MAIN_RESOURCE_TEXTURES.resolve(
"entity/equipment/horse_body/" + armor + ".png"
)),
"Minecraft 1.21.8 horse armor path leaked into the 1.21.1 port for " + armor
);
}

assertTrue(equipment.contains("AnimalArmorItem.BodyType.EQUESTRIAN"));
}

@Test
void forgedComponentsKeepEveryMaterialModelAndHotState() throws IOException {
String provider = source(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
import java.util.zip.ZipFile;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertNull;
import static org.junit.jupiter.api.Assertions.assertTrue;

class PackagedDataDeterminismContractTest {
Expand Down Expand Up @@ -57,6 +59,25 @@ void factionNpcRanksUseCanonicalSerializationOrder() throws IOException {
assertTrue(checkedFactions > 0, "Expected packaged faction NPC pools");
}

@Test
void packagedHorseArmorTexturesUseTheMinecraft1211Paths() throws IOException {
try (ZipFile playerJar = new ZipFile(playerJar().toFile())) {
for (String armor : List.of(
"gondorian_horse_armor",
"rohirric_horse_armor",
"dalish_horse_armor",
"lorien_horse_armor"
)) {
String expected = "assets/middle-earth/textures/entity/horse/armor/horse_armor_"
+ armor + ".png";
String incompatible = "assets/middle-earth/textures/entity/equipment/horse_body/"
+ armor + ".png";
assertNotNull(playerJar.getEntry(expected), "Missing " + expected);
assertNull(playerJar.getEntry(incompatible), "Found incompatible " + incompatible);
}
}
}

private static JsonObject readJson(ZipFile playerJar, ZipEntry entry) throws IOException {
try (InputStreamReader reader = new InputStreamReader(
playerJar.getInputStream(entry), StandardCharsets.UTF_8
Expand Down