Skip to content

Commit

Permalink
feat: 重命名PlayerSlot
Browse files Browse the repository at this point in the history
  • Loading branch information
huanmeng-qwq committed Dec 28, 2024
1 parent e5329c5 commit 8924ed3
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public boolean tryPlace(@NonNull Button button, @NonNull Player player) {
}

@Override
public PlayerSlot toPlayerSlot() {
public PlayerSlot asPlayer() {
return this;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ public PlayerSlots(@NotNull Slots slots) {

@Override
public @NotNull <G extends AbstractGui<@NonNull G>> @NonNull Slot[] slots(@NonNull G gui) {
return Arrays.stream(slots.slots(gui)).map(Slot::toPlayerSlot).toArray(PlayerSlot[]::new);
return Arrays.stream(slots.slots(gui)).map(Slot::asPlayer).toArray(PlayerSlot[]::new);
}

@Override
public PlayerSlots toPlayerSlots() {
public PlayerSlots asPlayer() {
return this;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,11 @@ default ItemStack getShowingItem(@NonNull AbstractGui<?> gui, @NonNull Player pl
*
* @param index 背包槽位
*/
static PlayerSlot playerSlot(int index) {
static PlayerSlot player(int index) {
return new PlayerSlot(of(index));
}

default PlayerSlot toPlayerSlot() {
default PlayerSlot asPlayer() {
return new PlayerSlot(this);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ static Slots full() {
return FULL;
}

default PlayerSlots toPlayerSlots(){
default PlayerSlots asPlayer(){
return new PlayerSlots(this);
}
}

0 comments on commit 8924ed3

Please sign in to comment.