Fix incompatibility between WorldEdit and FAWE for LocalSession#getTool (#1399)

This commit is contained in:
Lilly Tempest 2021-11-04 21:29:40 +01:00 committed by GitHub
parent 21b6f582e1
commit 971ae04020
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1120,6 +1120,24 @@ public class LocalSession implements TextureHolder {
//FAWE end
}
/**
* Get the tool assigned to the item.
*
* @param item the item type
* @return the tool, which may be {@code null}
* @deprecated This method is deprecated and only for compatibility with WorldEdit. Use {@link #getTool(BaseItem, Player)}
* instead.
*/
@Nullable
@Deprecated
public Tool getTool(ItemType item) {
//FAWE start
synchronized (this.tools) {
return tools.get(item.getInternalId());
}
//FAWE end
}
//FAWE start
@Nullable
public Tool getTool(Player player) {