forked from lishid/OpenInv
-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Yield correct item for click event slot * Improve raw slot conversion
- Loading branch information
Showing
2 changed files
with
73 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
...src/main/java/com/lishid/openinv/internal/v1_21_R1/container/OpenPlayerInventorySelf.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package com.lishid.openinv.internal.v1_21_R1.container; | ||
|
||
import org.bukkit.inventory.ItemStack; | ||
import org.jetbrains.annotations.NotNull; | ||
|
||
public class OpenPlayerInventorySelf extends OpenPlayerInventory { | ||
|
||
private final int offset; | ||
|
||
public OpenPlayerInventorySelf(@NotNull OpenInventory inventory, int offset) { | ||
super(inventory); | ||
this.offset = offset; | ||
} | ||
|
||
@Override | ||
public ItemStack getItem(int index) { | ||
return super.getItem(offset + index); | ||
} | ||
|
||
@Override | ||
public void setItem(int index, ItemStack item) { | ||
super.setItem(offset + index, item); | ||
} | ||
|
||
} |