Skip to content

Commit 31af189

Browse files
committed
update warp's
1 parent 438c287 commit 31af189

File tree

2 files changed

+9
-11
lines changed

2 files changed

+9
-11
lines changed

eternalcore-core/src/main/java/com/eternalcode/core/feature/warp/WarpInventory.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ public void addWarp(Warp warp) {
247247
}
248248
}
249249

250-
private int getSlot(Translation.WarpSection.WarpInventorySection warpSection) {
250+
private int getSlot(WarpMessages.WarpInventorySection warpSection) {
251251
int size = warpSection.items().size();
252252
if (!warpSection.border().enabled()) {
253253
return GUI_ITEM_SLOT_WITHOUT_BORDER + size;
@@ -279,7 +279,7 @@ public void removeWarp(String warpName) {
279279
}
280280
}
281281

282-
private void shiftWarpItems(WarpInventoryItem removed, Translation.WarpSection.WarpInventorySection warpSection) {
282+
private void shiftWarpItems(WarpInventoryItem removed, WarpMessages.WarpInventorySection warpSection) {
283283
int removedSlot = removed.warpItem.slot;
284284
List<WarpInventoryItem> itemsToShift = warpSection.items().values().stream()
285285
.filter(item -> item.warpItem.slot > removedSlot)

eternalcore-core/src/main/java/com/eternalcode/core/feature/warp/messages/WarpMessages.java

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -41,32 +41,30 @@ default void addItem(String name, WarpInventoryItem item) {
4141
this.setItems(items);
4242
}
4343

44-
default void removeItem(String name) {
44+
default WarpInventoryItem removeItem(String name) {
4545
Map<String, WarpInventoryItem> items = new HashMap<>(this.items());
46-
items.remove(name);
46+
WarpInventoryItem removed = items.remove(name);
4747

4848
this.setItems(items);
49+
return removed;
4950
}
5051

51-
WarpInventorySection.BorderSection border();
52-
WarpInventorySection.DecorationItemsSection decorationItems();
52+
BorderSection border();
53+
DecorationItemsSection decorationItems();
5354

5455
interface BorderSection {
5556
boolean enabled();
5657

5758
Material material();
5859

59-
WarpInventorySection.BorderSection.FillType fillType();
60+
FillType fillType();
6061

6162
String name();
6263

6364
List<String> lore();
6465

6566
enum FillType {
66-
TOP,
67-
BOTTOM,
68-
BORDER,
69-
ALL
67+
TOP, BOTTOM, BORDER, ALL
7068
}
7169
}
7270

0 commit comments

Comments
 (0)