Skip to content

Commit 6acb93a

Browse files
committed
4.1.6
1 parent e31df54 commit 6acb93a

4 files changed

Lines changed: 18 additions & 5 deletions

File tree

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# SimpAPI v4.1.5
1+
# SimpAPI v4.1.6
22
****
33
SimpAPI, finally a good API that can make coding MC Plugins much easier and less painful.
44
This API includes all of my primary utilities like *Menu Manager*, *Command Manager*, *ColorTranslator*, and more.
@@ -25,7 +25,7 @@ JavaDocs: https://kodysimpson.github.io/SimpAPI/index.html
2525
<dependency>
2626
<groupId>com.github.KodySimpson</groupId>
2727
<artifactId>SimpAPI</artifactId>
28-
<version>4.1.5</version>
28+
<version>4.1.6</version>
2929
</dependency>
3030
```
3131

@@ -51,14 +51,14 @@ repositories {
5151
Groovy:
5252
```groovy
5353
dependencies {
54-
implementation 'com.github.KodySimpson:SimpAPI:4.1.5'
54+
implementation 'com.github.KodySimpson:SimpAPI:4.1.6'
5555
}
5656
```
5757

5858
Kotlin:
5959
```kotlin
6060
dependencies {
61-
implementation("com.github.KodySimpson:SimpAPI:4.1.5")
61+
implementation("com.github.KodySimpson:SimpAPI:4.1.6")
6262
}
6363
```
6464

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<groupId>me.kodysimpson</groupId>
88
<artifactId>SimpAPI</artifactId>
9-
<version>4.1.5</version>
9+
<version>4.1.6</version>
1010
<packaging>jar</packaging>
1111

1212
<name>SimpAPI</name>

src/main/java/me/kodysimpson/simpapi/menu/Menu.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@ public void open() {
5858
playerMenuUtility.getOwner().openInventory(inventory);
5959
}
6060

61+
public void back() throws MenuManagerException, MenuManagerNotSetupException {
62+
MenuManager.openMenu(playerMenuUtility.lastMenu().getClass(), playerMenuUtility.getOwner());
63+
}
64+
6165
//Overridden method from the InventoryHolder interface
6266
@Override
6367
public @NotNull Inventory getInventory() {

src/main/java/me/kodysimpson/simpapi/menu/PlayerMenuUtility.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,13 @@
1010
import org.bukkit.entity.Player;
1111

1212
import java.util.HashMap;
13+
import java.util.Stack;
1314

1415
public class PlayerMenuUtility {
1516

1617
private final Player owner;
1718
private final HashMap<String, Object> dataMap = new HashMap<>();
19+
private final Stack<Menu> history = new Stack<>();
1820

1921
public PlayerMenuUtility(Player p) {
2022
this.owner = p;
@@ -70,5 +72,12 @@ public <T> T getData(Enum identifier, Class<T> classRef){
7072
}
7173
}
7274

75+
/**
76+
* @return Get the previous menu that was opened for the player
77+
*/
78+
public Menu lastMenu(){
79+
return this.history.pop();
80+
}
81+
7382
}
7483

0 commit comments

Comments
 (0)