-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Offhand support for auto loot feature. #5
base: master
Are you sure you want to change the base?
Conversation
@@ -132,6 +137,10 @@ public static boolean isBoots(ItemStack itemStack) { | |||
"CHAINMAIL_BOOTS"); | |||
} | |||
|
|||
public static boolean isOffhandItem(ItemStack itemStack) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it always this? Can't you also hold something else in the off-hand?
I'm thinking about the dualwield plugin I forked. So then you'd be able to hold an axe or sword in your offhand.
Isn't there a better way to do this? I mean: maybe it's possible to store (as underneath it's using SQLite) the order of items? And as such, also store armor/hand/offhand data?
Do you think it's possible to do it that way?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm sure that it would be much better to use SQLite to store the items properly however, I believe it would require a decent change to the way that the graves store the items.
I don't really have the time to implement those changes properly, and this was kind of just a bandaid fix to just get the idea out, mostly for personal use, in the hopes that someone else will expand upon it (in a hopefully much smarter way than I can).
(While writing this out, I realized that it probably would have been better to just make a feature request rather than make a weak attempt at implementing it)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you allow me to write to your branch, I will have a try today. Or I just fork your fork 😎.
Quality Gate passedIssues Measures |
It will check to see if there is a shield or torches in the grave and attempt to place them in the offhand slot. It will not place an item in the slot if it has any items before looting.
Fixed my mistake of not including
isOffhandItem()
in theInventoryUtil
class.