Add missing require = 3 to util_threading_detector PalettedContainer constructor injection, and simplify fast_palette PalettedContainer constructor injection.

This commit is contained in:
Jason Penilla
2024-10-02 10:54:52 -07:00
parent c22538c364
commit 2acfc6a68e
2 changed files with 6 additions and 32 deletions

View File

@@ -35,40 +35,13 @@ abstract class PalettedContainerMixin<T> implements PaletteResize<T>, PalettedCo
* @author Spottedleaf * @author Spottedleaf
*/ */
@Inject( @Inject(
method = "<init>(Lnet/minecraft/core/IdMap;Ljava/lang/Object;Lnet/minecraft/world/level/chunk/PalettedContainer$Strategy;)V", method = "<init>*",
at = @At( at = @At(
value = "RETURN" value = "RETURN"
) ),
require = 3 // Require matching all 3 constructors
) )
private void constructorHook1(final CallbackInfo ci) { private void constructorHook(final CallbackInfo ci) {
this.updateData(this.data);
}
/**
* @reason Hook to update raw palette data on object construction
* @author Spottedleaf
*/
@Inject(
method = "<init>(Lnet/minecraft/core/IdMap;Lnet/minecraft/world/level/chunk/PalettedContainer$Strategy;Lnet/minecraft/world/level/chunk/PalettedContainer$Configuration;Lnet/minecraft/util/BitStorage;Ljava/util/List;)V",
at = @At(
value = "RETURN"
)
)
private void constructorHook2(final CallbackInfo ci) {
this.updateData(this.data);
}
/**
* @reason Hook to update raw palette data on object construction
* @author Spottedleaf
*/
@Inject(
method = "<init>(Lnet/minecraft/core/IdMap;Lnet/minecraft/world/level/chunk/PalettedContainer$Strategy;Lnet/minecraft/world/level/chunk/PalettedContainer$Data;)V",
at = @At(
value = "RETURN"
)
)
private void constructorHook3(final CallbackInfo ci) {
this.updateData(this.data); this.updateData(this.data);
} }

View File

@@ -21,7 +21,8 @@ abstract class PalettedContainerMixin {
at = @At( at = @At(
value = "NEW", value = "NEW",
target = "Lnet/minecraft/util/ThreadingDetector;" target = "Lnet/minecraft/util/ThreadingDetector;"
) ),
require = 3 // Require matching all 3 constructors
) )
private static ThreadingDetector threadingDetector(final String name) { private static ThreadingDetector threadingDetector(final String name) {
return THREADING_DETECTOR; return THREADING_DETECTOR;