|
1 | | -# FakeInventories [](https://jitpack.io/#IWareQ/FakeInventories) |
| 1 | +# FakeInventories |
2 | 2 |
|
3 | | -FakeInventories is a simple library plugin for PowerNukkit/Nukkit Minecraft Bedrock core, that will help you to create |
| 3 | +FakeInventories is a simple library plugin for Lumi and Nukkit-MOT Minecraft Bedrock server software, that will help you to create |
4 | 4 | your custom virtual inventories with ease. |
5 | 5 |
|
6 | | -##### [Download](https://github.com/IWareQ/FakeInventories/releases) |
| 6 | +### [Download the plugin](https://github.com/LuminiaDev/FakeInventories/releases) |
7 | 7 |
|
8 | | -## Usage |
| 8 | +## How to use |
9 | 9 |
|
10 | 10 | ```java |
11 | | -FakeInventory inventory = new FakeInventory(InventoryType.CHEST, "custom title"); |
| 11 | +FakeInventory inventory = new FakeInventory(InventoryType.CHEST, "Custom inventory"); |
12 | 12 |
|
13 | 13 | inventory.setDefaultItemHandler((item, event) -> { |
14 | 14 | event.setCancelled(true); |
15 | 15 |
|
16 | 16 | Player target = event.getTransaction().getSource(); |
17 | | - |
18 | 17 | target.sendMessage("is default item handler"); |
19 | 18 | }); |
20 | 19 |
|
21 | | -inventory.addItems((item, event) -> { |
22 | | - event.setCancelled(true); |
23 | | - |
24 | | - Player target = event.getTransaction().getSource(); |
25 | | - |
26 | | - target.sendMessage("is custom item handler in addItem method"); |
27 | | - |
28 | | - target.removeWindow(inventory); |
29 | | -}, Item.get(Item.IRON_BLOCK), Item.get(Item.IRON_BAR)) |
30 | | - |
31 | 20 | inventory.setItem(5, Item.get(Item.DIAMOND), (item, event) -> { |
32 | 21 | event.setCancelled(true); |
33 | 22 |
|
34 | 23 | Player target = event.getTransaction().getSource(); |
35 | | - |
36 | 24 | target.sendMessage("is custom item handler"); |
37 | | - |
38 | 25 | target.removeWindow(inventory); |
39 | 26 | }); |
40 | 27 |
|
41 | 28 | player.addWindow(inventory); |
42 | 29 | ``` |
43 | 30 |
|
44 | | -## Maven |
45 | | - |
46 | | -#### Repository |
| 31 | +> [!WARNING] |
| 32 | +> To open fake inventory from the chat window or form, you need to add a delay of 10-20 ticks so that the window has time to close, otherwise the inventory will not open. |
47 | 33 |
|
| 34 | +## Maven |
| 35 | +Adding repo: |
48 | 36 | ```xml |
49 | | -<repositories> |
50 | | - <repository> |
51 | | - <id>jitpack.io</id> |
52 | | - <url>https://jitpack.io</url> |
53 | | - </repository> |
54 | | -</repositories> |
| 37 | +<repository> |
| 38 | + <id>luminiadev-repository-releases</id> |
| 39 | + <url>https://repo.luminiadev.com/releases</url> |
| 40 | +</repository> |
55 | 41 | ``` |
56 | 42 |
|
57 | | -#### Dependency |
| 43 | +Adding dependency: |
58 | 44 | ```xml |
59 | 45 | <dependency> |
60 | | - <groupId>com.github.IWareQ</groupId> |
61 | | - <artifactId>FakeInventories</artifactId> |
62 | | - <version>Version</version> |
| 46 | + <groupId>com.luminiadev.fakeinventories</groupId> |
| 47 | + <artifactId>fakeinventories</artifactId> |
| 48 | + <version>1.2.0</version> |
63 | 49 | </dependency> |
| 50 | +``` |
| 51 | + |
| 52 | +## Gradle |
| 53 | +Adding repo: |
| 54 | +```kts |
| 55 | +maven { |
| 56 | + name = "luminiadevRepositoryReleases" |
| 57 | + url = uri("https://repo.luminiadev.com/releases") |
| 58 | +} |
| 59 | +``` |
| 60 | + |
| 61 | +Adding dependency: |
| 62 | +```kts |
| 63 | +compileOnly("com.luminiadev.fakeinventories:fakeinventories:1.2.0") |
64 | 64 | ``` |
0 commit comments