Skip to content

Commit cb88f99

Browse files
Allow the MenuType to be applied
1 parent cda86a0 commit cb88f99

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/main/java/me/flame/menus/menu/BaseBuilder.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,13 @@
1010
import java.util.EnumSet;
1111
import java.util.function.Consumer;
1212

13+
//changed
14+
1315
@SuppressWarnings("unused")
1416
public abstract class BaseBuilder<G, B extends BaseBuilder<G, B>> {
1517
protected String title;
1618
protected int rows;
19+
protected MenuType type = MenuType.CHEST;
1720
protected final EnumSet<Modifier> modifiers;
1821
protected Consumer<G> menuConsumer;
1922

@@ -34,6 +37,11 @@ public B rows(int rows) {
3437
return (B) this;
3538
}
3639

40+
public B type(MenuType type) {
41+
this.type = type;
42+
return (B) this;
43+
}
44+
3745
public B addModifier(@NonNull Modifier modifier) {
3846
modifiers.add(modifier);
3947
return (B) this;
@@ -57,6 +65,8 @@ public void setMenuConsumer(@NonNull Consumer<G> menuConsumer) {
5765
this.menuConsumer = menuConsumer;
5866
}
5967

68+
public abstract G create();
69+
6070
protected void checkRows(int rows) {
6171
if (rows <= 0) throw new IllegalArgumentException("Rows must be greater than 0");
6272
if (rows > 6) throw new IllegalArgumentException("Rows must be equal to 6 or less");

0 commit comments

Comments
 (0)