Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed item stack copy #484

Merged
merged 3 commits into from
Jun 13, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -280,20 +280,20 @@ object MiningFeatures {
@SubscribeEvent
fun onDrawSlot(event: GuiContainerEvent.DrawSlotEvent.Pre) {
if (!Utils.inSkyblock || event.container !is ContainerChest) return
if (event.slot.hasStack) {
if (!event.slot.hasStack) return
if (Skytils.config.highlightDisabledHOTMPerks && SBInfo.lastOpenContainerName == "Heart of the Mountain") {
val item = event.slot.stack
if (Skytils.config.highlightDisabledHOTMPerks && SBInfo.lastOpenContainerName == "Heart of the Mountain") {
if (ItemUtil.getItemLore(item).any { it == "§c§lDISABLED" }) {
event.slot highlight Color(255, 0, 0)
}
if (ItemUtil.getItemLore(item).any { it == "§c§lDISABLED" }) {
hannibal002 marked this conversation as resolved.
Show resolved Hide resolved
event.slot highlight Color(255, 0, 0)
}
if (Skytils.config.highlightCompletedCommissions && SBInfo.lastOpenContainerName.equals("Commissions")) {
if (item.displayName.startsWith("§6Commission #") && item.item == Items.writable_book) {
if (ItemUtil.getItemLore(item).any {
it == "§eClick to claim rewards!"
}) {
event.slot highlight Color(255, 0, 0)
}
}
if (Skytils.config.highlightCompletedCommissions && SBInfo.lastOpenContainerName.equals("Commissions")) {
val item = event.slot.stack
if (item.displayName.startsWith("§6Commission #") && item.item == Items.writable_book) {
if (ItemUtil.getItemLore(item).any {
it == "§eClick to claim rewards!"
}) {
event.slot highlight Color(255, 0, 0)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable

fun markTerminalItems(slot: Slot, cir: CallbackInfoReturnable<ItemStack?>) {
if (!Utils.inSkyblock) return
val item: ItemStack = (slot.inventory.getStackInSlot(slot.slotIndex) ?: return).copy()
if (!item.isItemEnchanted && (SelectAllColorSolver.shouldClick.contains(slot.slotNumber) || StartsWithSequenceSolver.shouldClick.contains(
slot.slotNumber
))
val original = slot.inventory.getStackInSlot(slot.slotIndex) ?: return
if (!original.isItemEnchanted && (SelectAllColorSolver.shouldClick.contains(slot.slotNumber) ||
Sychic marked this conversation as resolved.
Show resolved Hide resolved
StartsWithSequenceSolver.shouldClick.contains(slot.slotNumber))
) {
val item = original.copy()
if (item.tagCompound == null) {
item.tagCompound = NBTTagCompound()
}
Expand Down
Loading