mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-20 23:46:57 +01:00
Release POIs when villagers are removed by plugins
By: md_5 <git@md-5.net>
This commit is contained in:
parent
ea74321d65
commit
05d379a339
2 changed files with 16 additions and 0 deletions
|
@ -58,6 +58,15 @@
|
|||
Logger logger = EntityVillager.LOGGER;
|
||||
|
||||
Objects.requireNonNull(logger);
|
||||
@@ -630,7 +645,7 @@
|
||||
super.die(damagesource);
|
||||
}
|
||||
|
||||
- private void releaseAllPois() {
|
||||
+ public void releaseAllPois() {
|
||||
this.releasePoi(MemoryModuleType.HOME);
|
||||
this.releasePoi(MemoryModuleType.JOB_SITE);
|
||||
this.releasePoi(MemoryModuleType.POTENTIAL_JOB_SITE);
|
||||
@@ -816,7 +831,12 @@
|
||||
}
|
||||
|
||||
|
|
|
@ -38,6 +38,13 @@ public class CraftVillager extends CraftAbstractVillager implements Villager {
|
|||
return EntityType.VILLAGER;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void remove() {
|
||||
getHandle().releaseAllPois();
|
||||
|
||||
super.remove();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Profession getProfession() {
|
||||
return CraftVillager.nmsToBukkitProfession(getHandle().getVillagerData().getProfession());
|
||||
|
|
Loading…
Reference in a new issue