Fixed exclusion zones for many screens.
This commit is contained in:
@@ -28,6 +28,7 @@ import java.util.stream.Collectors;
|
||||
|
||||
import com.google.common.base.Preconditions;
|
||||
import com.google.common.base.Stopwatch;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.mojang.blaze3d.systems.RenderSystem;
|
||||
|
||||
import org.lwjgl.glfw.GLFW;
|
||||
@@ -58,6 +59,7 @@ import net.minecraft.util.Identifier;
|
||||
import alexiil.mc.lib.attributes.fluid.render.FluidRenderFace;
|
||||
import alexiil.mc.lib.attributes.fluid.render.FluidVolumeRenderer;
|
||||
import alexiil.mc.lib.attributes.fluid.volume.FluidVolume;
|
||||
import me.shedaniel.math.Rectangle;
|
||||
|
||||
import appeng.api.storage.data.IAEFluidStack;
|
||||
import appeng.api.storage.data.IAEItemStack;
|
||||
@@ -803,4 +805,7 @@ public abstract class AEBaseScreen<T extends AEBaseContainer> extends HandledScr
|
||||
}
|
||||
}
|
||||
|
||||
public List<Rectangle> getExclusionZones() {
|
||||
return Lists.newArrayList(new Rectangle(x, y, backgroundWidth, backgroundHeight));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,6 +28,8 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.screen.slot.Slot;
|
||||
import net.minecraft.text.Text;
|
||||
|
||||
import me.shedaniel.math.Rectangle;
|
||||
|
||||
import appeng.api.config.SearchBoxMode;
|
||||
import appeng.api.config.Settings;
|
||||
import appeng.api.config.SortDir;
|
||||
@@ -519,4 +521,14 @@ public class MEMonitorableScreen<T extends MEMonitorableContainer> extends AEBas
|
||||
this.init();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Rectangle> getExclusionZones() {
|
||||
List<Rectangle> zones = super.getExclusionZones();
|
||||
// Button toolbar on the left
|
||||
zones.add(new Rectangle(x - 18, y + 8, 18, 160));
|
||||
// View-cells on the right
|
||||
zones.add(new Rectangle(x + 197, y, 46, 128));
|
||||
return zones;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -18,10 +18,14 @@
|
||||
|
||||
package appeng.client.gui.implementations;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.text.Text;
|
||||
|
||||
import me.shedaniel.math.Rectangle;
|
||||
|
||||
import appeng.api.config.FuzzyMode;
|
||||
import appeng.api.config.RedstoneMode;
|
||||
import appeng.api.config.SchedulingMode;
|
||||
@@ -146,4 +150,11 @@ public class UpgradeableScreen<T extends UpgradeableContainer> extends AEBaseScr
|
||||
return this.bc instanceof ImportBusPart ? GuiText.ImportBus : GuiText.ExportBus;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Rectangle> getExclusionZones() {
|
||||
List<Rectangle> zones = super.getExclusionZones();
|
||||
zones.add(new Rectangle(x - 18, y + 8, 18, 60));
|
||||
return zones;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -146,7 +146,8 @@ public class QuartzKnifeContainer extends AEBaseContainer {
|
||||
if (!inSlot.getSlot(0).extract(1).isEmpty()) {
|
||||
final ItemStack item = QuartzKnifeContainer.this.toolInv.getItemStack();
|
||||
final ItemStack before = item.copy();
|
||||
// FIXME FABRIC: Quartz Knife currently is not damageable due to recipe remainder concerns
|
||||
// FIXME FABRIC: Quartz Knife currently is not damageable due to recipe
|
||||
// remainder concerns
|
||||
item.damage(1, QuartzKnifeContainer.this.getPlayerInv().player, p -> {
|
||||
QuartzKnifeContainer.this.getPlayerInv()
|
||||
.setStack(QuartzKnifeContainer.this.getPlayerInv().selectedSlot, ItemStack.EMPTY);
|
||||
|
||||
@@ -33,6 +33,8 @@ import net.minecraft.screen.slot.SlotActionType;
|
||||
import net.minecraft.text.LiteralText;
|
||||
import net.minecraft.text.Text;
|
||||
|
||||
import me.shedaniel.math.Rectangle;
|
||||
|
||||
import appeng.api.config.Settings;
|
||||
import appeng.api.config.SortDir;
|
||||
import appeng.api.config.SortOrder;
|
||||
@@ -331,4 +333,11 @@ public class FluidTerminalScreen extends AEBaseMEScreen<FluidTerminalContainer>
|
||||
return "guis/terminal.png";
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Rectangle> getExclusionZones() {
|
||||
List<Rectangle> zones = super.getExclusionZones();
|
||||
zones.add(new Rectangle(x - 18, y, 18, 40));
|
||||
return zones;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -20,6 +20,7 @@ package appeng.integration.modules.jei;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.function.Predicate;
|
||||
import java.util.stream.Collectors;
|
||||
@@ -158,7 +159,7 @@ public class ReiPlugin implements REIPluginV0 {
|
||||
|
||||
baseBoundsHandler.registerExclusionZones(AEBaseScreen.class, () -> {
|
||||
AEBaseScreen<?> screen = (AEBaseScreen<?>) MinecraftClient.getInstance().currentScreen;
|
||||
return ImmutableList.of(new Rectangle(screen.getX(), screen.getY(), screen.width, screen.height));
|
||||
return screen != null ? screen.getExclusionZones() : Collections.emptyList();
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user