Skip to content

Commit

Permalink
Fix compatibility issues with the new SlimeFun plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
iXanadu13 committed Jun 1, 2024
1 parent 74d67bc commit 201974b
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
10 changes: 5 additions & 5 deletions src/main/java/pers/xanadu/slimefunrecipe/gui/GUI.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public String getTitle(){
return input;
}
public void setPage(final Player p, int to){
if(to<1||to>getSize()) return;
if(to<1||to>getRowSize()) return;
index=to;
fillPagedItems(to);
updateButton(p,to);
Expand All @@ -65,7 +65,7 @@ public void prev(final Player p){
updateButton(p,index);
}
public void next(final Player p){
if(index==getSize()) return;
if(index==getRowSize()) return;
++index;
fillPagedItems(index);
updateButton(p,index);
Expand All @@ -83,10 +83,10 @@ protected void fillPagedItems(int page){

}
protected void updateButton(final Player p, int page){
this.replaceExistingItem(getPrevPageButtonIndex(), ChestMenuUtils.getPreviousButton(p,page,getSize()));
this.replaceExistingItem(getNextPageButtonIndex(), ChestMenuUtils.getNextButton(p,page,getSize()));
this.replaceExistingItem(getPrevPageButtonIndex(), ChestMenuUtils.getPreviousButton(p,page,getRowSize()));
this.replaceExistingItem(getNextPageButtonIndex(), ChestMenuUtils.getNextButton(p,page,getRowSize()));
}
public abstract int getSize();
public abstract int getRowSize();
public abstract int getCancelButtonIndex();
public abstract int getVerifyButtonIndex();
public abstract int getMachineIndex();
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/pers/xanadu/slimefunrecipe/gui/GUI1x4.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ protected void fillPagedItems(int page){
this.replaceExistingItem(i+45,j==chosen? GuiUtils.getItem_chosen() : GuiUtils.getItem_not_chosen());
}
}
public int getSize(){
public int getRowSize(){
return (items.size()-1)/9+1;
}
public int getCancelButtonIndex(){
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/pers/xanadu/slimefunrecipe/gui/GUI3x3.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ protected void fillPagedItems(int page){
this.replaceExistingItem(i+45,j==chosen? GuiUtils.getItem_chosen() : GuiUtils.getItem_not_chosen());
}
}
public int getSize(){
public int getRowSize(){
return (items.size()-1)/9+1;
}
public int getCancelButtonIndex(){
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/pers/xanadu/slimefunrecipe/gui/GUI6x6.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ protected void fillPagedItems(int page){
this.replaceExistingItem(i*9+6,j==chosen? GuiUtils.getItem_chosen() : GuiUtils.getItem_not_chosen());
}
}
public int getSize(){
public int getRowSize(){
return (items.size()-1)/6+1;
}
public int getCancelButtonIndex(){
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/plugin.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: SlimeFunRecipe
version: 1.2.0
version: 1.2.1
main: pers.xanadu.slimefunrecipe.Main
api-version: 1.13
depend:
Expand Down

0 comments on commit 201974b

Please sign in to comment.