2014-03-31 10:36:27 +02:00
|
|
|
package baubles.common.container;
|
|
|
|
|
|
2021-11-21 23:28:57 -05:00
|
|
|
import baubles.api.IBauble;
|
|
|
|
|
import baubles.api.expanded.BaubleExpandedSlots;
|
|
|
|
|
import baubles.api.expanded.IBaubleExpanded;
|
|
|
|
|
import baubles.common.BaublesConfig;
|
|
|
|
|
import baubles.common.lib.PlayerHandler;
|
|
|
|
|
import cpw.mods.fml.relauncher.Side;
|
|
|
|
|
import cpw.mods.fml.relauncher.SideOnly;
|
2014-03-31 10:36:27 +02:00
|
|
|
import net.minecraft.entity.player.EntityPlayer;
|
|
|
|
|
import net.minecraft.entity.player.InventoryPlayer;
|
|
|
|
|
import net.minecraft.inventory.Container;
|
2025-09-14 14:35:31 -04:00
|
|
|
import net.minecraft.inventory.IInventory;
|
|
|
|
|
import net.minecraft.inventory.InventoryCraftResult;
|
|
|
|
|
import net.minecraft.inventory.InventoryCrafting;
|
2014-03-31 10:36:27 +02:00
|
|
|
import net.minecraft.inventory.Slot;
|
2025-09-14 14:35:31 -04:00
|
|
|
import net.minecraft.inventory.SlotCrafting;
|
2021-11-03 05:13:32 -04:00
|
|
|
import net.minecraft.item.Item;
|
2014-03-31 10:36:27 +02:00
|
|
|
import net.minecraft.item.ItemArmor;
|
|
|
|
|
import net.minecraft.item.ItemStack;
|
2025-09-14 14:35:31 -04:00
|
|
|
import net.minecraft.item.crafting.CraftingManager;
|
2021-11-03 19:19:12 -04:00
|
|
|
import net.minecraft.util.IIcon;
|
2014-03-31 10:36:27 +02:00
|
|
|
|
2025-09-14 14:35:31 -04:00
|
|
|
import static baubles.common.BaublesConfig.useOldGuiRendering;
|
|
|
|
|
|
2021-11-03 05:13:32 -04:00
|
|
|
public class ContainerPlayerExpanded extends Container {
|
2025-09-14 14:35:31 -04:00
|
|
|
|
|
|
|
|
public InventoryCrafting craftMatrix = new InventoryCrafting(this, 2, 2);
|
|
|
|
|
public IInventory craftResult = new InventoryCraftResult();
|
2014-03-31 10:36:27 +02:00
|
|
|
public InventoryBaubles baubles;
|
2021-11-03 05:13:32 -04:00
|
|
|
|
2014-03-31 10:36:27 +02:00
|
|
|
private final EntityPlayer thePlayer;
|
|
|
|
|
|
2025-12-06 11:31:36 -03:00
|
|
|
private int slotsAdded = 0;
|
|
|
|
|
|
|
|
|
|
private int baubleFirstSlotIndex = -1;
|
|
|
|
|
private int baubleSlotCount = 0;
|
|
|
|
|
|
2025-09-14 14:35:31 -04:00
|
|
|
public ContainerPlayerExpanded(InventoryPlayer playerInv, boolean isClient, EntityPlayer player) {
|
2014-03-31 10:36:27 +02:00
|
|
|
this.thePlayer = player;
|
2025-09-19 06:56:27 +02:00
|
|
|
baubles = PlayerHandler.getPlayerBaubles(player);
|
2014-03-31 10:36:27 +02:00
|
|
|
baubles.setEventHandler(this);
|
2021-11-03 05:13:32 -04:00
|
|
|
|
2014-03-31 10:36:27 +02:00
|
|
|
int i;
|
|
|
|
|
int j;
|
|
|
|
|
|
2025-12-06 11:31:36 -03:00
|
|
|
// Crafting slots
|
2025-09-14 14:35:31 -04:00
|
|
|
if (!useOldGuiRendering) {
|
|
|
|
|
this.addSlotToContainer(new SlotCrafting(playerInv.player, this.craftMatrix, this.craftResult, 0, 144, 36));
|
|
|
|
|
|
|
|
|
|
for (i = 0; i < 2; ++i) {
|
|
|
|
|
for (j = 0; j < 2; ++j) {
|
|
|
|
|
this.addSlotToContainer(new Slot(this.craftMatrix, j + i * 2, 88 + j * 18, 26 + i * 18));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Armor slots
|
2021-11-03 05:13:32 -04:00
|
|
|
for (i = 0; i < 4; ++i) {
|
2014-03-31 10:36:27 +02:00
|
|
|
final int k = i;
|
2021-11-03 05:13:32 -04:00
|
|
|
this.addSlotToContainer(new Slot(playerInv, playerInv.getSizeInventory() - 1 - i, 8, 8 + i * 18) {
|
2014-03-31 10:36:27 +02:00
|
|
|
@Override
|
|
|
|
|
public int getSlotStackLimit() { return 1; }
|
2021-11-03 19:19:12 -04:00
|
|
|
|
2014-03-31 10:36:27 +02:00
|
|
|
@Override
|
2021-11-03 05:13:32 -04:00
|
|
|
public boolean isItemValid(ItemStack itemStack) {
|
2025-09-14 14:35:31 -04:00
|
|
|
if (itemStack == null || itemStack.getItem() == null) return false;
|
2021-11-03 05:13:32 -04:00
|
|
|
return itemStack.getItem().isValidArmor(itemStack, k, thePlayer);
|
2014-03-31 10:36:27 +02:00
|
|
|
}
|
2023-03-06 18:35:19 -05:00
|
|
|
|
2021-11-04 23:36:02 -04:00
|
|
|
@Override
|
2021-11-03 19:19:12 -04:00
|
|
|
@SideOnly(Side.CLIENT)
|
|
|
|
|
public IIcon getBackgroundIconIndex() {
|
|
|
|
|
return ItemArmor.func_94602_b(k);
|
|
|
|
|
}
|
2014-03-31 10:36:27 +02:00
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
2021-11-03 05:13:32 -04:00
|
|
|
final int slotOffset = 18;
|
|
|
|
|
final int slotStartX = 80;
|
|
|
|
|
final int slotStartY = 8;
|
2023-03-06 18:35:19 -05:00
|
|
|
|
2025-09-14 14:35:31 -04:00
|
|
|
// Bauble slots
|
2025-12-06 11:31:36 -03:00
|
|
|
baubleFirstSlotIndex = slotsAdded;
|
2025-09-14 14:35:31 -04:00
|
|
|
for (i = 0; i < BaubleExpandedSlots.slotLimit; i++) {
|
|
|
|
|
String slotType = BaubleExpandedSlots.getSlotType(i);
|
|
|
|
|
if (BaublesConfig.showUnusedSlots || !slotType.equals(BaubleExpandedSlots.unknownType)) {
|
2025-12-06 11:31:36 -03:00
|
|
|
Slot slot = useOldGuiRendering
|
|
|
|
|
? new SlotBauble(baubles, slotType, i, slotStartX + (slotOffset * (i / 4)), slotStartY + (slotOffset * (i % 4)))
|
|
|
|
|
: new SlotBauble(baubles, slotType, i, -18, 12 + (slotOffset * i));
|
|
|
|
|
|
|
|
|
|
addSlotToContainer(slot);
|
|
|
|
|
baubleSlotCount++;
|
2025-09-14 14:35:31 -04:00
|
|
|
}
|
2021-11-03 05:13:32 -04:00
|
|
|
}
|
2014-03-31 10:36:27 +02:00
|
|
|
|
2025-09-14 14:35:31 -04:00
|
|
|
// Inventory slots
|
2021-11-03 05:13:32 -04:00
|
|
|
for (i = 0; i < 3; ++i) {
|
|
|
|
|
for (j = 0; j < 9; ++j) {
|
2025-09-14 14:35:31 -04:00
|
|
|
this.addSlotToContainer(new Slot(playerInv, j + (i + 1) * 9, slotStartY + j * slotOffset, 84 + i * 18));
|
2014-03-31 10:36:27 +02:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2025-09-14 14:35:31 -04:00
|
|
|
// Hotbar slots
|
2021-11-03 05:13:32 -04:00
|
|
|
for (i = 0; i < 9; ++i) {
|
2025-09-14 14:35:31 -04:00
|
|
|
this.addSlotToContainer(new Slot(playerInv, i, slotStartY + i * slotOffset, 142));
|
2014-03-31 10:36:27 +02:00
|
|
|
}
|
2023-03-06 18:35:19 -05:00
|
|
|
|
2025-09-14 14:35:31 -04:00
|
|
|
if (!useOldGuiRendering) {
|
|
|
|
|
this.onCraftMatrixChanged(this.craftMatrix);
|
|
|
|
|
this.scrollTo(0);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2025-12-06 11:31:36 -03:00
|
|
|
@Override
|
|
|
|
|
protected Slot addSlotToContainer(Slot slot) {
|
|
|
|
|
// Count slots as we add them so we can determine what the first Bauble slot index will be
|
|
|
|
|
slotsAdded++;
|
|
|
|
|
return super.addSlotToContainer(slot);
|
|
|
|
|
}
|
|
|
|
|
|
2025-09-14 14:35:31 -04:00
|
|
|
@Override
|
|
|
|
|
public void onCraftMatrixChanged(IInventory par1IInventory) {
|
|
|
|
|
if (!useOldGuiRendering) {
|
|
|
|
|
this.craftResult.setInventorySlotContents(0, CraftingManager.getInstance().findMatchingRecipe(this.craftMatrix, this.thePlayer.worldObj));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void onContainerClosed(EntityPlayer player) {
|
|
|
|
|
super.onContainerClosed(player);
|
|
|
|
|
if (useOldGuiRendering) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
for (int i = 0; i < 4; ++i) {
|
|
|
|
|
ItemStack itemstack = this.craftMatrix.getStackInSlotOnClosing(i);
|
|
|
|
|
|
|
|
|
|
if (itemstack != null) {
|
|
|
|
|
if (!player.inventory.addItemStackToInventory(itemstack)) {
|
|
|
|
|
player.dropPlayerItemWithRandomChoice(itemstack, false);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
this.craftResult.setInventorySlotContents(0, null);
|
|
|
|
|
if (!player.worldObj.isRemote) {
|
|
|
|
|
PlayerHandler.setPlayerBaubles(player, baubles);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2025-12-06 11:31:36 -03:00
|
|
|
public int getBaubleSlotCount() {
|
|
|
|
|
return this.baubleSlotCount;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public SlotBauble getBaubleSlot(int slotIndex) {
|
|
|
|
|
if(slotIndex < 0 || slotIndex >= baubleSlotCount) return null;
|
|
|
|
|
return (SlotBauble) inventorySlots.get(baubleFirstSlotIndex + slotIndex);
|
|
|
|
|
}
|
|
|
|
|
|
2025-09-14 14:35:31 -04:00
|
|
|
public void scrollTo(float offset) {
|
|
|
|
|
if (!canScroll()) return;
|
|
|
|
|
final int activeBaubleSlots = BaubleExpandedSlots.slotsCurrentlyUsed();
|
|
|
|
|
|
|
|
|
|
offset = Math.max(0, Math.min(1, offset));
|
|
|
|
|
|
|
|
|
|
int shownSlots = 8;
|
|
|
|
|
int slotOffset = (int) (offset * (activeBaubleSlots - shownSlots) + 0.5F);
|
|
|
|
|
|
|
|
|
|
if (slotOffset < 0) {
|
|
|
|
|
slotOffset = 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < activeBaubleSlots && i < BaubleExpandedSlots.slotLimit; i++) {
|
2025-12-06 11:31:36 -03:00
|
|
|
Slot slot = (Slot) this.inventorySlots.get(baubleFirstSlotIndex + i);
|
2025-09-14 14:35:31 -04:00
|
|
|
if (i >= 0) {
|
|
|
|
|
slot.yDisplayPosition = (12 - (slotOffset * 18) + (i) * 18);
|
|
|
|
|
if (slot.yDisplayPosition < 12 || slot.yDisplayPosition > 8 * 18) {
|
|
|
|
|
// Hide the rest of the slots!
|
|
|
|
|
slot.yDisplayPosition = -2000;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public boolean canScroll() {
|
|
|
|
|
return BaubleExpandedSlots.slotsCurrentlyUsed() > 8 && !useOldGuiRendering;
|
2014-03-31 10:36:27 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
2021-11-03 05:13:32 -04:00
|
|
|
public boolean canInteractWith(EntityPlayer player) {
|
2014-03-31 10:36:27 +02:00
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2025-09-14 14:35:31 -04:00
|
|
|
* Called when a player shift-clicks on a slot. You must override this, or you will crash when someone does that.
|
2014-03-31 10:36:27 +02:00
|
|
|
*/
|
|
|
|
|
@Override
|
2021-11-03 05:13:32 -04:00
|
|
|
public ItemStack transferStackInSlot(EntityPlayer player, int slotIndex) {
|
2023-03-06 18:35:19 -05:00
|
|
|
ItemStack returnStack = null;
|
2025-09-14 14:35:31 -04:00
|
|
|
Slot slot = (Slot) inventorySlots.get(slotIndex);
|
|
|
|
|
final int visibleBaubleSlots = BaubleExpandedSlots.slotsCurrentlyUsed();
|
|
|
|
|
int craftingActive = 5;
|
|
|
|
|
if (useOldGuiRendering) {
|
|
|
|
|
craftingActive = 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (slot == null || !slot.getHasStack()) {
|
|
|
|
|
return returnStack;
|
|
|
|
|
}
|
|
|
|
|
ItemStack originalStack = slot.getStack();
|
|
|
|
|
returnStack = originalStack.copy();
|
|
|
|
|
Item item = returnStack.getItem();
|
|
|
|
|
|
|
|
|
|
if (!useOldGuiRendering) {
|
|
|
|
|
if (slotIndex == 0) {
|
|
|
|
|
if (!mergeItemStack(originalStack, 4 + craftingActive + visibleBaubleSlots, 40 + craftingActive + visibleBaubleSlots, true)) {
|
|
|
|
|
return null;
|
2014-03-31 10:36:27 +02:00
|
|
|
}
|
2025-09-14 14:35:31 -04:00
|
|
|
slot.onSlotChange(originalStack, returnStack);
|
|
|
|
|
} else if (slotIndex < 5) {
|
|
|
|
|
if (!mergeItemStack(originalStack, 4 + craftingActive + visibleBaubleSlots, 40 + craftingActive + visibleBaubleSlots, false)) {
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
}
|
2025-10-19 21:42:04 +02:00
|
|
|
} else if (item instanceof ItemArmor armor && !((Slot) inventorySlots.get(craftingActive + armor.armorType)).getHasStack()) {
|
2025-09-14 14:35:31 -04:00
|
|
|
int armorSlot = craftingActive + armor.armorType;
|
|
|
|
|
if (!mergeItemStack(originalStack, armorSlot, armorSlot + 1, false)) {
|
|
|
|
|
returnStack = null;
|
|
|
|
|
}
|
|
|
|
|
} else if (slotIndex >= 4 + craftingActive + visibleBaubleSlots && item instanceof IBauble bauble && bauble.canEquip(returnStack, thePlayer)) {
|
|
|
|
|
for (int baubleSlot = 4 + craftingActive; baubleSlot < 4 + craftingActive + visibleBaubleSlots; baubleSlot++) {
|
|
|
|
|
if (returnStack == null) {
|
|
|
|
|
break;
|
2014-03-31 10:36:27 +02:00
|
|
|
}
|
2025-09-14 14:35:31 -04:00
|
|
|
if (((Slot) inventorySlots.get(baubleSlot)).getHasStack()) {
|
|
|
|
|
continue;
|
2014-03-31 10:36:27 +02:00
|
|
|
}
|
2025-09-14 14:35:31 -04:00
|
|
|
String[] types;
|
|
|
|
|
if (item instanceof IBaubleExpanded) {
|
|
|
|
|
types = ((IBaubleExpanded) item).getBaubleTypes(returnStack);
|
|
|
|
|
} else {
|
|
|
|
|
types = new String[] {BaubleExpandedSlots.getTypeFromBaubleType(bauble.getBaubleType(returnStack))};
|
|
|
|
|
}
|
|
|
|
|
for (String type : types) {
|
|
|
|
|
if ((type.equals(BaubleExpandedSlots.universalType)
|
|
|
|
|
|| type.equals(BaubleExpandedSlots.getSlotType(baubleSlot - 4 - craftingActive)))
|
|
|
|
|
&& !mergeItemStack(originalStack, baubleSlot, baubleSlot + 1, false)) {
|
|
|
|
|
returnStack = null;
|
|
|
|
|
}
|
2014-03-31 10:36:27 +02:00
|
|
|
}
|
|
|
|
|
}
|
2025-09-14 14:35:31 -04:00
|
|
|
} else if (slotIndex >= 4 + craftingActive + visibleBaubleSlots && slotIndex < 31 + craftingActive + visibleBaubleSlots) {
|
|
|
|
|
if (!mergeItemStack(originalStack, 31 + craftingActive + visibleBaubleSlots, 40 + craftingActive + visibleBaubleSlots, false)) {
|
|
|
|
|
returnStack = null;
|
2014-03-31 10:36:27 +02:00
|
|
|
}
|
2025-09-14 14:35:31 -04:00
|
|
|
} else if (slotIndex >= 31 + craftingActive + visibleBaubleSlots && slotIndex < 40 + craftingActive + visibleBaubleSlots) {
|
|
|
|
|
if (!mergeItemStack(originalStack, 4 + craftingActive + visibleBaubleSlots, 31 + craftingActive + visibleBaubleSlots, false)) {
|
2023-03-06 18:35:19 -05:00
|
|
|
returnStack = null;
|
2014-03-31 10:36:27 +02:00
|
|
|
}
|
2025-09-14 14:35:31 -04:00
|
|
|
} else if (!mergeItemStack(originalStack, 4 + craftingActive + visibleBaubleSlots, 40 + craftingActive + visibleBaubleSlots, false, slot)) {
|
|
|
|
|
returnStack = null;
|
|
|
|
|
}
|
2014-03-31 10:36:27 +02:00
|
|
|
|
2025-09-14 14:35:31 -04:00
|
|
|
if (originalStack.stackSize <= 0) {
|
|
|
|
|
slot.putStack(null);
|
|
|
|
|
} else {
|
|
|
|
|
slot.onSlotChanged();
|
2014-03-31 10:36:27 +02:00
|
|
|
}
|
|
|
|
|
|
2025-09-14 14:35:31 -04:00
|
|
|
if (returnStack != null && originalStack.stackSize == returnStack.stackSize) {
|
|
|
|
|
returnStack = null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
slot.onPickupFromSlot(player, originalStack);
|
|
|
|
|
|
2023-03-06 18:35:19 -05:00
|
|
|
return returnStack;
|
2014-03-31 10:36:27 +02:00
|
|
|
}
|
2023-03-06 18:35:19 -05:00
|
|
|
|
2014-04-01 19:54:04 +02:00
|
|
|
private void unequipBauble(ItemStack stack) {
|
2025-09-14 14:35:31 -04:00
|
|
|
//if (stack.getItem() instanceof IBauble) {
|
|
|
|
|
// ((IBauble)stack.getItem()).onUnequipped(stack, thePlayer);
|
|
|
|
|
//}
|
2014-04-01 19:54:04 +02:00
|
|
|
}
|
2021-11-03 05:13:32 -04:00
|
|
|
|
2014-08-07 09:30:13 +02:00
|
|
|
@Override
|
2021-11-03 19:19:12 -04:00
|
|
|
public void putStacksInSlots(ItemStack[] p_75131_1_) {
|
|
|
|
|
baubles.blockEvents=true;
|
|
|
|
|
super.putStacksInSlots(p_75131_1_);
|
|
|
|
|
}
|
2014-08-07 09:30:13 +02:00
|
|
|
|
2025-09-14 14:35:31 -04:00
|
|
|
protected boolean mergeItemStack(ItemStack sourceStack, int startIndex, int endIndex, boolean reverse, Slot sourceSlot) {
|
|
|
|
|
boolean merged = false;
|
|
|
|
|
int index = reverse ? endIndex - 1 : startIndex;
|
|
|
|
|
|
|
|
|
|
Slot targetSlot;
|
|
|
|
|
ItemStack targetStack;
|
|
|
|
|
|
|
|
|
|
// First pass: try stacking into existing stacks
|
|
|
|
|
if (sourceStack.isStackable()) {
|
|
|
|
|
while (sourceStack.stackSize > 0 && (!reverse && index < endIndex || reverse && index >= startIndex)) {
|
|
|
|
|
targetSlot = (Slot) inventorySlots.get(index);
|
|
|
|
|
targetStack = targetSlot.getStack();
|
|
|
|
|
|
|
|
|
|
if (targetStack != null && targetStack.getItem() == sourceStack.getItem() &&
|
|
|
|
|
(!sourceStack.getHasSubtypes() || sourceStack.getItemDamage() == targetStack.getItemDamage()) &&
|
|
|
|
|
ItemStack.areItemStackTagsEqual(sourceStack, targetStack)) {
|
|
|
|
|
|
|
|
|
|
int combinedSize = targetStack.stackSize + sourceStack.stackSize;
|
|
|
|
|
|
|
|
|
|
if (combinedSize <= sourceStack.getMaxStackSize()) {
|
|
|
|
|
if (sourceSlot instanceof SlotBauble) {
|
|
|
|
|
unequipBauble(sourceStack);
|
|
|
|
|
}
|
|
|
|
|
sourceStack.stackSize = 0;
|
|
|
|
|
targetStack.stackSize = combinedSize;
|
|
|
|
|
targetSlot.onSlotChanged();
|
|
|
|
|
return true;
|
|
|
|
|
} else if (targetStack.stackSize < sourceStack.getMaxStackSize()) {
|
|
|
|
|
if (sourceSlot instanceof SlotBauble) {
|
|
|
|
|
unequipBauble(sourceStack);
|
|
|
|
|
}
|
|
|
|
|
sourceStack.stackSize -= sourceStack.getMaxStackSize() - targetStack.stackSize;
|
|
|
|
|
targetStack.stackSize = sourceStack.getMaxStackSize();
|
|
|
|
|
targetSlot.onSlotChanged();
|
|
|
|
|
merged = true;
|
2014-04-01 19:54:04 +02:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2025-09-14 14:35:31 -04:00
|
|
|
index = reverse ? index - 1 : index + 1;
|
2014-04-01 19:54:04 +02:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2025-09-14 14:35:31 -04:00
|
|
|
// Second pass: put into empty slots
|
|
|
|
|
index = reverse ? endIndex - 1 : startIndex;
|
|
|
|
|
while (!reverse && index < endIndex || reverse && index >= startIndex) {
|
|
|
|
|
targetSlot = (Slot) inventorySlots.get(index);
|
|
|
|
|
targetStack = targetSlot.getStack();
|
2014-04-01 19:54:04 +02:00
|
|
|
|
2025-09-14 14:35:31 -04:00
|
|
|
if (targetStack == null) {
|
|
|
|
|
if (sourceSlot instanceof SlotBauble) {
|
|
|
|
|
unequipBauble(sourceStack);
|
2014-04-01 19:54:04 +02:00
|
|
|
}
|
2025-09-14 14:35:31 -04:00
|
|
|
targetSlot.putStack(sourceStack.copy());
|
|
|
|
|
targetSlot.onSlotChanged();
|
|
|
|
|
sourceStack.stackSize = 0;
|
|
|
|
|
return true;
|
2014-04-01 19:54:04 +02:00
|
|
|
}
|
2025-09-14 14:35:31 -04:00
|
|
|
|
|
|
|
|
index = reverse ? index - 1 : index + 1;
|
2014-04-01 19:54:04 +02:00
|
|
|
}
|
2014-03-31 10:36:27 +02:00
|
|
|
|
2025-09-14 14:35:31 -04:00
|
|
|
return merged;
|
|
|
|
|
}
|
2014-03-31 10:36:27 +02:00
|
|
|
}
|