Skip to content

Commit

Permalink
Fixed issue where deprecated methods would still require components
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt committed Jun 16, 2021
1 parent c7f6c76 commit 055159d
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 12 deletions.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ subprojects {
}

group = "dev.triumphteam"
version = "3.0.1"
version = "3.0.2"

repositories {
mavenCentral()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ public final class VersionHelper {

// Unbreakable change
private static final int V1_11 = 1110;
// Material change and customModelData
// Material change
private static final int V1_13 = 1130;
// PDC
// PDC and customModelData
private static final int V1_14 = 1140;
// Paper adventure changes
private static final int V1_16_5 = 1165;
Expand Down
17 changes: 10 additions & 7 deletions core/src/main/java/dev/triumphteam/gui/guis/PaginatedGui.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,12 @@ public class PaginatedGui extends BaseGui {
/**
* Main constructor to provide a way to create PaginatedGui, uses {@link Component}
*
* @param rows The amount of rows the GUI should have
* @param pageSize The page size.
* @param title The GUI's title using {@link Component}
* @param rows The amount of rows the GUI should have
* @param pageSize The page size.
* @param title The GUI's title using {@link Component}
* @param interactionModifiers A set containing what {@link InteractionModifier} this GUI should have
* @since 3.0.0
* @author SecretX
* @since 3.0.0
*/
public PaginatedGui(final int rows, final int pageSize, @NotNull final Component title, @NotNull final Set<InteractionModifier> interactionModifiers) {
super(rows, title, interactionModifiers);
Expand All @@ -78,7 +78,7 @@ public PaginatedGui(final int rows, final int pageSize, @NotNull final Component
/**
* Alternative constructor for the {@link PaginatedGui} without page size
*
* @param rows Number of rows.
* @param rows Number of rows.
* @param title The title using {@link Component}
* @since 3.0.0
*/
Expand Down Expand Up @@ -106,7 +106,8 @@ public PaginatedGui(@NotNull final Component title) {
*/
@Deprecated
public PaginatedGui(final int rows, final int pageSize, @NotNull final String title) {
this(rows, pageSize, Component.text(title));
super(rows, title);
this.pageSize = pageSize;
}

/**
Expand All @@ -118,7 +119,7 @@ public PaginatedGui(final int rows, final int pageSize, @NotNull final String ti
*/
@Deprecated
public PaginatedGui(final int rows, @NotNull final String title) {
this(rows, Component.text(title));
this(rows, 0, title);
}

/**
Expand Down Expand Up @@ -352,6 +353,7 @@ public int getPrevPageNum() {

/**
* Goes to the next page
*
* @return False if there is no next page.
*/
public boolean next() {
Expand All @@ -364,6 +366,7 @@ public boolean next() {

/**
* Goes to the previous page if possible
*
* @return False if there is no previous page.
*/
public boolean previous() {
Expand Down
5 changes: 3 additions & 2 deletions core/src/main/java/dev/triumphteam/gui/guis/ScrollingGui.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
@SuppressWarnings("unused")
public class ScrollingGui extends PaginatedGui {

private final ScrollType scrollType;
private ScrollType scrollType;
private int scrollSize = 0;

/**
Expand Down Expand Up @@ -140,7 +140,8 @@ public ScrollingGui(@NotNull final Component title) {
*/
@Deprecated
public ScrollingGui(final int rows, final int pageSize, @NotNull final String title, @NotNull final ScrollType scrollType) {
this(rows, pageSize, Component.text(title));
super(rows, pageSize, title);
this.scrollType = scrollType;
}

/**
Expand Down

0 comments on commit 055159d

Please sign in to comment.