mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-10 02:07:37 +01:00
SPIGOT-6820: VillagerCareerChangeEvent's ChangeReason is sometimes incorrect
By: Doc <nachito94@msn.com>
This commit is contained in:
parent
2492a39911
commit
cc70f18bef
@ -19,7 +19,7 @@
|
|||||||
protected void start(WorldServer worldserver, EntityVillager entityvillager, long i) {
|
protected void start(WorldServer worldserver, EntityVillager entityvillager, long i) {
|
||||||
- entityvillager.setVillagerData(entityvillager.getVillagerData().setProfession(VillagerProfession.NONE));
|
- entityvillager.setVillagerData(entityvillager.getVillagerData().setProfession(VillagerProfession.NONE));
|
||||||
+ // CraftBukkit start
|
+ // CraftBukkit start
|
||||||
+ VillagerCareerChangeEvent event = CraftEventFactory.callVillagerCareerChangeEvent(entityvillager, CraftVillager.nmsToBukkitProfession(VillagerProfession.NONE), VillagerCareerChangeEvent.ChangeReason.EMPLOYED);
|
+ VillagerCareerChangeEvent event = CraftEventFactory.callVillagerCareerChangeEvent(entityvillager, CraftVillager.nmsToBukkitProfession(VillagerProfession.NONE), VillagerCareerChangeEvent.ChangeReason.LOSING_JOB);
|
||||||
+ if (event.isCancelled()) {
|
+ if (event.isCancelled()) {
|
||||||
+ return;
|
+ return;
|
||||||
+ }
|
+ }
|
||||||
|
Loading…
Reference in New Issue
Block a user