Mixin icon indicating copy to clipboard operation
Mixin copied to clipboard

Class available at compile-time is incorrectly marked as imaginary if specified by name

Open LlamaLad7 opened this issue 3 years ago • 2 comments

This code:

@Mixin(CreativeInventoryScreen.class)
public interface ExampleMixin {
	@Accessor(value = "fabric_currentPage", remap = false)
	static int getFabricCurrentPage() {
		throw new AssertionError();
	}
}

Fails during compileJava with the following:

error: Could not locate @Accessor target fabric_currentPage in target net.minecraft.client.gui.screen.ingame.CreativeInventoryScreen

However using

@Mixin(targets = "net.minecraft.client.gui.screen.ingame.CreativeInventoryScreen")

Works perfectly.

LlamaLad7 avatar Apr 17 '21 09:04 LlamaLad7

Have you tried changing the priority relative to the mixin which adds the field?

Earthcomputer avatar Apr 17 '21 09:04 Earthcomputer

Yes, it's an AP error so that doesn't help.

LlamaLad7 avatar Apr 17 '21 09:04 LlamaLad7