Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master-1.19-lts' into master-1.2…
Browse files Browse the repository at this point in the history
…0-lts
  • Loading branch information
rubensworks committed Oct 3, 2024
2 parents c3aa750 + b2fc48c commit 33f9513
Showing 1 changed file with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import net.minecraftforge.fluids.capability.IFluidHandler;
import net.minecraftforge.fluids.capability.IFluidHandlerItem;
import org.apache.commons.compress.utils.Lists;
import org.apache.commons.lang3.tuple.Pair;
import org.cyclops.cyclopscore.helper.GuiHelpers;
import org.cyclops.integrateddynamics.api.logicprogrammer.ILogicProgrammerElement;
import org.cyclops.integrateddynamics.client.gui.container.ContainerScreenLogicProgrammerBase;
Expand Down Expand Up @@ -49,9 +48,9 @@ public <I> List<Target<I>> getTargetsTyped(T screen, ITypedIngredient<I> ingredi

if (itemStack != null) {
// Determine slots in which the stack could be placed
Pair<Integer, Integer>[] slotPositions = element.getRenderPattern().getSlotPositions();
for (int slot = 0; slot < slotPositions.length; slot++) {
int slotId = container.slots.size() - 36 - slotPositions.length + slot;
int slotPositionsCount = container.slots.size() - 36 - 4; /* subtract player inv, and 4 fixed slots in LP */
for (int slot = 0; slot < slotPositionsCount; slot++) {
int slotId = container.slots.size() - 36 - slotPositionsCount + slot;
Slot slotContainer = container.getSlot(slotId);

Rect2i bounds = new Rect2i(
Expand Down Expand Up @@ -94,8 +93,8 @@ public boolean shouldHighlightTargets() {

protected void setStackInSlot(T screen, int slot, ItemStack itemStack) {
ContainerLogicProgrammerBase container = screen.getMenu();
Pair<Integer, Integer>[] slotPositions = container.getActiveElement().getRenderPattern().getSlotPositions();
int slotId = container.slots.size() - 36 - slotPositions.length + slot;
int slotPositionsCount = container.slots.size() - 36 - 4; /* subtract player inv, and 4 fixed slots in LP */
int slotId = container.slots.size() - 36 - slotPositionsCount + slot;
container.setItem(slotId, 0, itemStack.copy());
IntegratedDynamicsCompat._instance.getPacketHandler().sendToServer(
new CPacketSetSlot(container.containerId, slotId, itemStack));
Expand Down

0 comments on commit 33f9513

Please sign in to comment.