Skip to content

Instantly share code, notes, and snippets.

@isXander
Created March 26, 2023 18:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save isXander/c5a1dbe8e84f9fc71eb5a4e926187253 to your computer and use it in GitHub Desktop.
Save isXander/c5a1dbe8e84f9fc71eb5a4e926187253 to your computer and use it in GitHub Desktop.
@Mixin(AbstractContainerScreen.class)
public abstract class AbstractContainerScreenMixin implements ScreenProcessorProvider {
@Shadow @Nullable protected Slot hoveredSlot;
@Shadow protected abstract void slotClicked(Slot slot, int slotId, int button, ClickType actionType);
@Unique private final ScreenProcessor<?> screenProcessor = new AbstractContainerScreenProcessor<>((AbstractContainerScreen<?>) (Object) this, () -> hoveredSlot, this::slotClicked);
@Override
public ScreenProcessor<?> screenProcessor() {
return screenProcessor;
}
}
@Mixin(CreativeModeInventoryScreen.class)
public abstract class CreativeModeInventoryScreenMixin extends AbstractContainerScreenMixin {
@Unique private final CreativeModeInventoryScreenProcessor controlify$screenProcessor
= new CreativeModeInventoryScreenProcessor((CreativeModeInventoryScreen) (Object) this, () -> hoveredSlot, this::slotClicked);
@Override
public ScreenProcessor<?> screenProcessor() {
return controlify$screenProcessor;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment