diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 69ecc3559b..706a738f10 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -99,6 +99,9 @@ Fabric API makes strong backwards compatibility guarantees, by which contributor - If vanilla exposes optionals in return types, then returning an optional is fine. - Avoid requiring the user to cast to a subtype if possible. - Adding methods to vanilla types can be done via interface injection. +- Avoid exposing java `record`s as public API. + - Records expose more than is necessary for most APIs, which makes them difficult to evolve. + - Prefer to expose an interface that is implemented by an impl record. ### API design patterns to consider diff --git a/checkstyle.xml b/checkstyle.xml index daf09c3b61..e265b13f31 100644 --- a/checkstyle.xml +++ b/checkstyle.xml @@ -208,5 +208,10 @@ + + + + + diff --git a/fabric-transfer-api-v1/src/main/java/net/fabricmc/fabric/api/transfer/v1/storage/base/ResourceAmount.java b/fabric-transfer-api-v1/src/main/java/net/fabricmc/fabric/api/transfer/v1/storage/base/ResourceAmount.java index 6a6f49009a..e0b132fc34 100644 --- a/fabric-transfer-api-v1/src/main/java/net/fabricmc/fabric/api/transfer/v1/storage/base/ResourceAmount.java +++ b/fabric-transfer-api-v1/src/main/java/net/fabricmc/fabric/api/transfer/v1/storage/base/ResourceAmount.java @@ -16,6 +16,8 @@ package net.fabricmc.fabric.api.transfer.v1.storage.base; +//CHECKSTYLE.OFF: MatchXpath + /** * An immutable object storing both a resource and an amount, provided for convenience. * @param The type of the stored resource.