Fix previous creative tab not being restored ()

This commit is contained in:
modmuss50 2022-12-12 19:26:03 +00:00 committed by GitHub
parent 0db3bc5ba9
commit d3d735d000
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -46,6 +46,9 @@ public abstract class CreativeInventoryScreenMixin<T extends ScreenHandler> exte
@Shadow
protected abstract void setSelectedTab(ItemGroup itemGroup_1);
@Shadow
private static ItemGroup selectedTab;
// "static" matches selectedTab
private static int fabric_currentPage = 0;
@ -96,7 +99,7 @@ public abstract class CreativeInventoryScreenMixin<T extends ScreenHandler> exte
@Inject(method = "init", at = @At("RETURN"))
private void init(CallbackInfo info) {
fabric_updateSelection();
fabric_currentPage = fabric_getPage(selectedTab);
int xpos = x + 170;
int ypos = y + 4;