mirror of
https://github.com/FabricMC/fabric.git
synced 2025-04-08 21:14:41 -04:00
Fix last few transitive access wideners missing the transitive-
prefix (#3064)
Also add validation to make sure that the generated `.accesswidener` has only transitive access modifiers.
This commit is contained in:
parent
7e532d225e
commit
b4a333d661
3 changed files with 26 additions and 10 deletions
fabric-transitive-access-wideners-v1
|
@ -48,6 +48,8 @@ task generateAccessWidener {
|
|||
}
|
||||
|
||||
file('src/main/resources/fabric-transitive-access-wideners-v1.accesswidener').text = String.join('\n', lines) + '\n'
|
||||
|
||||
validateAccessWidener(lines)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -124,4 +126,18 @@ ClassNode loadClass(Path path) {
|
|||
return node
|
||||
}
|
||||
|
||||
def validateAccessWidener(List<String> lines) {
|
||||
List<String> exceptions = new ArrayList<>()
|
||||
|
||||
for (int i = 0; i < lines.size(); i++) {
|
||||
String line = lines.get(i)
|
||||
if (line.isBlank() || line.startsWith("#") || line.startsWith("transitive-") || line.startsWith("accessWidener")) continue
|
||||
exceptions.add(String.valueOf(i + 1))
|
||||
}
|
||||
|
||||
if (exceptions.size() > 0) {
|
||||
throw new InvalidUserDataException("\"fabric-transitive-access-wideners-v1.accesswidener\" contains non-transitive access modifiers at lines: [" + String.join(", ", exceptions) + "]")
|
||||
}
|
||||
}
|
||||
|
||||
generateResources.dependsOn generateAccessWidener
|
||||
|
|
|
@ -118,13 +118,13 @@ transitive-accessible method net/minecraft/world/gen/stateprovider/BlockStatePro
|
|||
transitive-accessible method net/minecraft/world/biome/OverworldBiomeCreator getSkyColor (F)I
|
||||
|
||||
# Creating custom template pools
|
||||
accessible field net/minecraft/structure/processor/StructureProcessorLists EMPTY Lnet/minecraft/registry/RegistryKey;
|
||||
transitive-accessible field net/minecraft/structure/processor/StructureProcessorLists EMPTY Lnet/minecraft/registry/RegistryKey;
|
||||
|
||||
# Creating custom trees
|
||||
accessible method net/minecraft/world/gen/foliage/FoliagePlacerType <init> (Lcom/mojang/serialization/Codec;)V
|
||||
accessible method net/minecraft/world/gen/treedecorator/TreeDecoratorType <init> (Lcom/mojang/serialization/Codec;)V
|
||||
accessible method net/minecraft/world/gen/trunk/TrunkPlacerType <init> (Lcom/mojang/serialization/Codec;)V
|
||||
accessible method net/minecraft/world/gen/root/RootPlacerType <init> (Lcom/mojang/serialization/Codec;)V
|
||||
transitive-accessible method net/minecraft/world/gen/foliage/FoliagePlacerType <init> (Lcom/mojang/serialization/Codec;)V
|
||||
transitive-accessible method net/minecraft/world/gen/treedecorator/TreeDecoratorType <init> (Lcom/mojang/serialization/Codec;)V
|
||||
transitive-accessible method net/minecraft/world/gen/trunk/TrunkPlacerType <init> (Lcom/mojang/serialization/Codec;)V
|
||||
transitive-accessible method net/minecraft/world/gen/root/RootPlacerType <init> (Lcom/mojang/serialization/Codec;)V
|
||||
|
||||
# Working with custom damage sources
|
||||
transitive-accessible field net/minecraft/entity/damage/DamageSources registry Lnet/minecraft/registry/Registry;
|
||||
|
|
|
@ -113,13 +113,13 @@ transitive-accessible method net/minecraft/world/gen/stateprovider/BlockStatePro
|
|||
transitive-accessible method net/minecraft/world/biome/OverworldBiomeCreator getSkyColor (F)I
|
||||
|
||||
# Creating custom template pools
|
||||
accessible field net/minecraft/structure/processor/StructureProcessorLists EMPTY Lnet/minecraft/registry/RegistryKey;
|
||||
transitive-accessible field net/minecraft/structure/processor/StructureProcessorLists EMPTY Lnet/minecraft/registry/RegistryKey;
|
||||
|
||||
# Creating custom trees
|
||||
accessible method net/minecraft/world/gen/foliage/FoliagePlacerType <init> (Lcom/mojang/serialization/Codec;)V
|
||||
accessible method net/minecraft/world/gen/treedecorator/TreeDecoratorType <init> (Lcom/mojang/serialization/Codec;)V
|
||||
accessible method net/minecraft/world/gen/trunk/TrunkPlacerType <init> (Lcom/mojang/serialization/Codec;)V
|
||||
accessible method net/minecraft/world/gen/root/RootPlacerType <init> (Lcom/mojang/serialization/Codec;)V
|
||||
transitive-accessible method net/minecraft/world/gen/foliage/FoliagePlacerType <init> (Lcom/mojang/serialization/Codec;)V
|
||||
transitive-accessible method net/minecraft/world/gen/treedecorator/TreeDecoratorType <init> (Lcom/mojang/serialization/Codec;)V
|
||||
transitive-accessible method net/minecraft/world/gen/trunk/TrunkPlacerType <init> (Lcom/mojang/serialization/Codec;)V
|
||||
transitive-accessible method net/minecraft/world/gen/root/RootPlacerType <init> (Lcom/mojang/serialization/Codec;)V
|
||||
|
||||
# Working with custom damage sources
|
||||
transitive-accessible field net/minecraft/entity/damage/DamageSources registry Lnet/minecraft/registry/Registry;
|
||||
|
|
Loading…
Add table
Reference in a new issue