mirror of
https://github.com/PlayPro/CoreProtect.git
synced 2025-02-11 16:30:03 +08:00
add API methods to log player inventory items
note: 'player' is only ever used for the player's name within the entire code base, consider using plain strings instead.
This commit is contained in:
parent
af1d4402eb
commit
d9bf5a8333
@ -302,6 +302,30 @@ public class CoreProtectAPI extends Queue {
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean logDropItem(String user, Location location, ItemStack itemStack) {
|
||||
if (Config.getGlobal().API_ENABLED) {
|
||||
if (user != null && location != null && itemStack != null) {
|
||||
if (user.length() > 0) {
|
||||
PlayerDropItemListener.playerDropItem(location, user, itemStack);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean logPickupItem(String user, Location location, ItemStack itemStack) {
|
||||
if (Config.getGlobal().API_ENABLED) {
|
||||
if (user != null && location != null && itemStack != null) {
|
||||
if (user.length() > 0) {
|
||||
EntityPickupItemListener.onItemPickup(Bukkit.getPlayer(user), location, itemStack);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public boolean logPlacement(String user, Location location, Material type, byte data) {
|
||||
if (Config.getGlobal().API_ENABLED) {
|
||||
|
Loading…
Reference in New Issue
Block a user