You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Supports custom inventories (size, title and type)
12
13
* Easy to use
13
14
* Option to prevent a player from closing the inventory
@@ -16,13 +17,14 @@ Lightweight and easy-to-use inventory API for Bukkit plugins.
16
17
## Installation
17
18
18
19
### Maven
20
+
19
21
```xml
20
22
<build>
21
23
<plugins>
22
24
<plugin>
23
25
<groupId>org.apache.maven.plugins</groupId>
24
26
<artifactId>maven-shade-plugin</artifactId>
25
-
<version>3.3.0<</version>
27
+
<version>3.3.0</version>
26
28
<executions>
27
29
<execution>
28
30
<phase>package</phase>
@@ -55,23 +57,24 @@ Lightweight and easy-to-use inventory API for Bukkit plugins.
55
57
<dependency>
56
58
<groupId>fr.mrmicky</groupId>
57
59
<artifactId>FastInv</artifactId>
58
-
<version>3.0.4</version>
60
+
<version>3.1.0</version>
59
61
</dependency>
60
62
</dependencies>
61
63
```
62
64
63
65
### Gradle
66
+
64
67
```groovy
65
68
plugins {
66
-
id 'com.github.johnrengelman.shadow' version '7.1.2'
69
+
id 'com.gradleup.shadow' version '8.3.0'
67
70
}
68
71
69
72
repositories {
70
73
maven { url 'https://jitpack.io' }
71
74
}
72
75
73
76
dependencies {
74
-
implementation 'fr.mrmicky:FastInv:3.0.4'
77
+
implementation 'fr.mrmicky:FastInv:3.1.0'
75
78
}
76
79
77
80
shadowJar {
@@ -88,6 +91,7 @@ You can also add `ItemBuilder.java` if you need.
88
91
## Usage
89
92
90
93
### Register FastInv
94
+
91
95
Before creating inventories, you just need to register your plugin by adding `FastInvManager.register(this);` in the `onEnable()` method of your plugin:
92
96
```java
93
97
@Override
@@ -98,10 +102,10 @@ public void onEnable() {
98
102
99
103
### Creating an inventory class
100
104
101
-
Now you can create an inventory by make a class that extends `FastInv`, and add items in the constructor.
105
+
Now you can create an inventory by creating a class that extends `FastInv`, and adding items in the constructor.
102
106
You can also override `onClick`, `onClose` and `onOpen` if you need.
103
107
104
-
Small example inventory:
108
+
Basic example inventory:
105
109
106
110
```java
107
111
packagefr.mrmicky.fastinv.test;
@@ -154,13 +158,70 @@ public class ExampleInventory extends FastInv {
154
158
}
155
159
```
156
160
157
-
Now you can open the inventory:
161
+
The inventory can be opened with the `open(player)` method:
158
162
```java
159
163
newExampleInventory().open(player);
160
164
```
161
165
166
+
### Paginated inventory
167
+
168
+
FastInv also supports paginated inventories, which can be created by using `PaginatedFastInv` instead of `FastInv`.
169
+
170
+
Content can be added to the inventory using `addContent` or `setContent`, and pagination items can be added with `previousPageItem` and `nextPageItem`.
171
+
172
+
You can also use `onPageChange` to execute code when the page changes, and the `#currentPage()`, `#lastPage()`, `#isFirstPage()` and `#isLastPage()` methods to get information about the current page.
0 commit comments