-
Notifications
You must be signed in to change notification settings - Fork 421
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
Basic villager trades #1819
base: master
Are you sure you want to change the base?
Basic villager trades #1819
Conversation
|
||
public class EntityVillager extends EntityCreature implements EntityNPC, EntityAgeable { | ||
public class EntityVillager extends EntityCreature implements InventoryHolder, EntityNPC, EntityAgeable { |
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.
Not sure about implementing InventoryHolder here, since it has no physical inventory
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.
or does 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.
Villager trading is inventory and since villager contains trade recipes, i find them as inventory holders.
Fix nbt Handle trade inventory transaction
} | ||
|
||
@Override | ||
public boolean onInteract(Player player, Item item) { |
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.
(Google Translate)
I think we also need to rewrite the onInteract(Player player, Item item, Vector3 clickedPos) method
like this:
@Override
public boolean onInteract(Player player, Item item, Vector3 clickedPos) {
if (super.onInteract(player, item, clickedPos)) {
return true;
}
return this.onInteract(player, item);
}
This pull request should add basic villager trade inventory with custom api.