Skip to content

Commit

Permalink
refactor: minor optimizations
Browse files Browse the repository at this point in the history
  • Loading branch information
My-Name-Is-Jeff committed Feb 21, 2025
1 parent be739c9 commit d5a551a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,8 @@
@Mixin(Slot.class)
public abstract class MixinSlot {

private final Slot $this = (Slot) (Object) this;

@Inject(method = "getStack", at = @At("HEAD"), cancellable = true)
private void markTerminalItems(CallbackInfoReturnable<ItemStack> cir) {
SlotHookKt.markTerminalItems($this, cir);
SlotHookKt.markTerminalItems((Slot) (Object) this, cir);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,6 @@ public abstract class MixinItemBow extends Item {
return intended.getItem() == itemIn && instance.getStackInSlot(8) == fake;
}

return hasItem;
return false;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,11 @@ import gg.skytils.skytilsmod.utils.Utils
import net.minecraft.inventory.Slot
import net.minecraft.item.ItemStack
import net.minecraft.nbt.NBTTagCompound
import net.minecraft.world.ILockableContainer
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable

fun markTerminalItems(slot: Slot, cir: CallbackInfoReturnable<ItemStack?>) {
if (!Utils.inSkyblock) return
if (!Utils.inSkyblock || slot.inventory !is ILockableContainer) return
val original = slot.inventory.getStackInSlot(slot.slotIndex) ?: return
if (!original.isItemEnchanted && (SelectAllColorSolver.shouldClick.contains(slot.slotNumber) ||
StartsWithSequenceSolver.shouldClick.contains(slot.slotNumber))
Expand Down

0 comments on commit d5a551a

Please sign in to comment.