-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Should allow adding custom buttons to VariableSelector and BlobEditor
- Loading branch information
1 parent
b6efe17
commit edb0ac7
Showing
8 changed files
with
115 additions
and
56 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
27 changes: 23 additions & 4 deletions
27
src/main/java/us/mytheria/bloblib/entities/inventory/BlobInventory.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 |
---|---|---|
@@ -1,25 +1,44 @@ | ||
package us.mytheria.bloblib.entities.inventory; | ||
|
||
import org.jetbrains.annotations.NotNull; | ||
import org.jetbrains.annotations.Nullable; | ||
|
||
import java.util.Objects; | ||
|
||
public class BlobInventory extends SharableInventory<InventoryButton> { | ||
|
||
public static BlobInventory fromInventoryBuilderCarrier(InventoryBuilderCarrier<InventoryButton> carrier) { | ||
String title = Objects.requireNonNull(carrier.title(), "title cannot be null"); | ||
return new BlobInventory(title, carrier.size(), | ||
carrier.buttonManager().copy()); | ||
return new BlobInventory( | ||
title, | ||
carrier.size(), | ||
carrier.buttonManager().copy(), | ||
carrier.reference(), | ||
carrier.locale()); | ||
} | ||
|
||
public BlobInventory(@NotNull String title, int size, | ||
public BlobInventory(@NotNull String title, | ||
int size, | ||
@NotNull ButtonManager<InventoryButton> buttonManager, | ||
@Nullable String reference, | ||
@Nullable String locale) { | ||
super(title, size, buttonManager, reference, locale); | ||
} | ||
|
||
public BlobInventory(@NotNull String title, | ||
int size, | ||
@NotNull ButtonManager<InventoryButton> buttonManager) { | ||
super(title, size, buttonManager); | ||
} | ||
|
||
@Override | ||
@NotNull | ||
public BlobInventory copy() { | ||
return new BlobInventory(getTitle(), getSize(), getButtonManager().copy()); | ||
return new BlobInventory( | ||
getTitle(), | ||
getSize(), | ||
getButtonManager().copy(), | ||
getReference(), | ||
getLocale()); | ||
} | ||
} |
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
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
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
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
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
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