Skip to content

Commit

Permalink
update warp's
Browse files Browse the repository at this point in the history
  • Loading branch information
vLuckyyy committed Feb 7, 2025
1 parent 438c287 commit 31af189
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ public void addWarp(Warp warp) {
}
}

private int getSlot(Translation.WarpSection.WarpInventorySection warpSection) {
private int getSlot(WarpMessages.WarpInventorySection warpSection) {
int size = warpSection.items().size();
if (!warpSection.border().enabled()) {
return GUI_ITEM_SLOT_WITHOUT_BORDER + size;
Expand Down Expand Up @@ -279,7 +279,7 @@ public void removeWarp(String warpName) {
}
}

private void shiftWarpItems(WarpInventoryItem removed, Translation.WarpSection.WarpInventorySection warpSection) {
private void shiftWarpItems(WarpInventoryItem removed, WarpMessages.WarpInventorySection warpSection) {
int removedSlot = removed.warpItem.slot;
List<WarpInventoryItem> itemsToShift = warpSection.items().values().stream()
.filter(item -> item.warpItem.slot > removedSlot)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,32 +41,30 @@ default void addItem(String name, WarpInventoryItem item) {
this.setItems(items);
}

default void removeItem(String name) {
default WarpInventoryItem removeItem(String name) {
Map<String, WarpInventoryItem> items = new HashMap<>(this.items());
items.remove(name);
WarpInventoryItem removed = items.remove(name);

this.setItems(items);
return removed;
}

WarpInventorySection.BorderSection border();
WarpInventorySection.DecorationItemsSection decorationItems();
BorderSection border();
DecorationItemsSection decorationItems();

interface BorderSection {
boolean enabled();

Material material();

WarpInventorySection.BorderSection.FillType fillType();
FillType fillType();

String name();

List<String> lore();

enum FillType {
TOP,
BOTTOM,
BORDER,
ALL
TOP, BOTTOM, BORDER, ALL
}
}

Expand Down

0 comments on commit 31af189

Please sign in to comment.