mirror of
https://github.com/architectury/architectury-loom.git
synced 2026-04-02 05:27:43 -05:00
FabricModJson: Make hashCode final again
Fixes ModAccessWidenerEntryTest.
This commit is contained in:
@@ -67,7 +67,7 @@ public abstract sealed class FabricModJson permits FabricModJsonV0, FabricModJso
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
public final int hashCode() {
|
||||
return Objects.hash(getId(), getVersion());
|
||||
}
|
||||
|
||||
|
||||
@@ -42,6 +42,7 @@ import org.jetbrains.annotations.Nullable;
|
||||
import net.fabricmc.loom.util.gradle.SourceSetHelper;
|
||||
|
||||
public final class ModMetadataFabricModJson extends FabricModJson {
|
||||
private static final int FABRIC_SCHEMA_VERSION = -1;
|
||||
private final ModMetadataFile modMetadata;
|
||||
private final FabricModJsonSource source;
|
||||
|
||||
@@ -99,7 +100,9 @@ public final class ModMetadataFabricModJson extends FabricModJson {
|
||||
|
||||
@Override
|
||||
public int getVersion() {
|
||||
throw new UnsupportedOperationException();
|
||||
// Technically not correct since we're not a real fabric.mod.json,
|
||||
// but this is needed for computing the hash code.
|
||||
return FABRIC_SCHEMA_VERSION;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -122,9 +125,4 @@ public final class ModMetadataFabricModJson extends FabricModJson {
|
||||
.stream()
|
||||
.collect(Collectors.toMap(Function.identity(), path -> ModEnvironment.UNIVERSAL));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return modMetadata.hashCode();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user