Refactor slot configs

This commit is contained in:
modmuss50 2023-05-31 20:23:46 +01:00
parent 4ee192b4cd
commit 0adc67de8a
15 changed files with 320 additions and 366 deletions

View file

@ -38,13 +38,16 @@ public class SlotConfigExclusionZones implements ExclusionZonesProvider<GuiBase<
@Override
public Collection<Rectangle> provide(GuiBase screen) {
if (!screen.hideGuiElements()) {
if (!(screen.getSelectedTab() instanceof SlotConfigGui slotConfigGui)){
return Collections.emptyList();
}
if (SlotConfigGui.selectedSlot == -1){
final ConfigSlotElement element = slotConfigGui.getSelectedSlot();
if (element == null) {
return Collections.emptyList();
}
ConfigSlotElement element = SlotConfigGui.slotElementMap.get(SlotConfigGui.selectedSlot);
int slotX = element.getX() + screen.getGuiLeft() -50;
if (element.getWidth() + slotX > screen.getScreenWidth() ) {
int slotY = element.getY() + screen.getGuiTop() + 25;