diff --git a/build.gradle b/build.gradle index e9303586e8..a84f23d70d 100644 --- a/build.gradle +++ b/build.gradle @@ -142,6 +142,18 @@ immaculate { return sb.toString() } + // Disallow explicit not null in patches, it's always implied. + custom 'noNotNull', { String fileContents -> + fileContents.eachLine { + if (!it.startsWith("+")) return + if (it.contains('@NotNull') || it.contains('@Nonnull') + || it.contains('@org.jetbrains.annotations.NotNull') + || it.contains('@javax.annotation.Nonnull')) { + throw new GradleException('@NotNull and @Nonnull are disallowed.') + } + } + } + //Replace any FQN versions of javax.annotation.Nullable with the jetbrains variant custom 'jetbrainsNullablePatches', { String fileContents -> fileContents.replace('@javax.annotation.Nullable', '@org.jetbrains.annotations.Nullable') diff --git a/patches/net/minecraft/client/resources/model/MultiPartBakedModel.java.patch b/patches/net/minecraft/client/resources/model/MultiPartBakedModel.java.patch index 9c90867067..d0b78f39ed 100644 --- a/patches/net/minecraft/client/resources/model/MultiPartBakedModel.java.patch +++ b/patches/net/minecraft/client/resources/model/MultiPartBakedModel.java.patch @@ -55,7 +55,7 @@ + } + + @Override // FORGE: Get render types based on the selectors matched by the given block state -+ public net.neoforged.neoforge.client.ChunkRenderTypeSet getRenderTypes(@org.jetbrains.annotations.NotNull BlockState state, @org.jetbrains.annotations.NotNull RandomSource rand, @org.jetbrains.annotations.NotNull net.neoforged.neoforge.client.model.data.ModelData data) { ++ public net.neoforged.neoforge.client.ChunkRenderTypeSet getRenderTypes(BlockState state, RandomSource rand, net.neoforged.neoforge.client.model.data.ModelData data) { + var renderTypeSets = new java.util.LinkedList(); + var selectors = getSelectors(state); + for (int i = 0; i < selectors.length(); i++)