Update v9.md

unclear if the addition of 2 methods deserves its own API version bump
This commit is contained in:
rand0m0User 2024-02-03 22:26:55 -08:00 committed by GitHub
parent d9bf5a8333
commit 7280ab6cfa
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -256,6 +256,26 @@ This will log a block as being removed/broken, and will log the block's inventor
---
#### `logDropItem(String user, Location location, ItemStack itemStack)`
This will log a item being dropped.
* **user:** Specify the username to log as having dropped the item.
* **location:** Specify the location of the dropped item you're logging.
* **itemStack:** Specify the ItemStack of the item you're logging.
---
#### `logPickupItem(String user, Location location, ItemStack itemStack)`
This will log a item being picked up.
* **user:** Specify the username to log as having picked up the item.
* **location:** Specify the location of the picked up item you're logging.
* **itemStack:** Specify the ItemStack of the item you're logging.
---
#### `logContainerTransaction(String user, Location location)`
This will log any transactions made to a block's inventory immediately after calling the method.
@ -468,6 +488,28 @@ if (CoreProtect != null){ // Ensure we have access to the API
---
- Log 24 dirt dropped at a location by the user "Notch".
```java
CoreProtectAPI CoreProtect = getCoreProtect();
if (CoreProtect != null){ // Ensure we have access to the API
Player player = Bukkit.getPlayer("Notch")
api.logDropItem(player.getName() player.getLocation(), new ItemStack(Material.DIRT, 24));
}
```
---
- Log 56 seeds picked up at a location by the user "Notch".
```java
CoreProtectAPI CoreProtect = getCoreProtect();
if (CoreProtect != null){ // Ensure we have access to the API
Player player = Bukkit.getPlayer("Notch")
api.logPickupItem(player.getName() player.getLocation(), new ItemStack(Material.WHEAT_SEEDS, 56));
}
```
---
- Log adding/remove items in a chest (or some other block inventory).
```java
CoreProtectAPI CoreProtect = getCoreProtect();
@ -501,4 +543,4 @@ Thread thread = new Thread(runnable);
thread.start();
```
---
---