You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
//mc code
public abstract class Feature<FC extends FeatureConfig>{
public abstract boolean generate(IWorld world, ChunkGenerator<? extends ChunkGeneratorConfig> generator, Random random, BlockPos pos, FC config);
}
//my code
public class SimpleSpawnerFeature extends Feature<DefaultFeatureConfig>{
@Override
public boolean generate(
IWorld world,
ChunkGenerator<? extends ChunkGeneratorConfig> generator,
Random random,
BlockPos pos,
DefaultFeatureConfig config
){...}
}
In my code this "generate" cannot be remapped.
In AbstractClassMappingImpl#getMethodMapping, the input signature is MethodSignature{name=generate, descriptor=(Lnet/minecraft/world/IWorld;Lnet/minecraft/world/gen/chunk/ChunkGenerator;Ljava/util/Random;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/world/gen/feature/DefaultFeatureConfig;)Z}
And in this.methods it has MethodSignature{name=generate, descriptor=(Lnet/minecraft/world/IWorld;Lnet/minecraft/world/gen/chunk/ChunkGenerator;Ljava/util/Random;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/world/gen/feature/FeatureConfig;)Z}
So getMethodMapping will return null in this case.
Possible solution:
In AbstractClassMappingImpl#getMethodMapping, if it cannot find the method mapping that exactly match the signature, then find the method mapping that has the same name.
The text was updated successfully, but these errors were encountered:
Perhaps we could add a computeMethodMapping to Lorenz, that in the absence of a mapping checks for other mappings of the same name that can assign to the exact signature?
If you're interested, I could compose a pull request to add it to the upstream. I haven't done so yet as my workaround is kinda hacky in that it bypasses Lorenz and Bombe and just crawls the AST.
As best as I can tell, an actual solution would require incorporating type parameter support into Lorenz, Bombe, and Mercury. I briefly considered forking and trying at it, but this hot fix is good enough for my purposes.
Example:
In my code this "generate" cannot be remapped.
In AbstractClassMappingImpl#getMethodMapping, the input signature is MethodSignature{name=generate, descriptor=(Lnet/minecraft/world/IWorld;Lnet/minecraft/world/gen/chunk/ChunkGenerator;Ljava/util/Random;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/world/gen/feature/DefaultFeatureConfig;)Z}
And in this.methods it has MethodSignature{name=generate, descriptor=(Lnet/minecraft/world/IWorld;Lnet/minecraft/world/gen/chunk/ChunkGenerator;Ljava/util/Random;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/world/gen/feature/FeatureConfig;)Z}
So getMethodMapping will return null in this case.
Possible solution:
In AbstractClassMappingImpl#getMethodMapping, if it cannot find the method mapping that exactly match the signature, then find the method mapping that has the same name.
The text was updated successfully, but these errors were encountered: