13
0
geforkt von Mirrors/Paper

SPIGOT-6820: VillagerCareerChangeEvent's ChangeReason is sometimes incorrect

By: Doc <nachito94@msn.com>
Dieser Commit ist enthalten in:
CraftBukkit/Spigot 2021-12-01 08:26:14 +11:00
Ursprung 2492a39911
Commit cc70f18bef

Datei anzeigen

@ -19,7 +19,7 @@
protected void start(WorldServer worldserver, EntityVillager entityvillager, long i) {
- entityvillager.setVillagerData(entityvillager.getVillagerData().setProfession(VillagerProfession.NONE));
+ // 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()) {
+ return;
+ }