use of me.jellysquid.mods.lithium.common.entity.EntityNavigationExtended in project roadrunner by MaxNeedsSnacks.
the class ServerWorldMixin method stopListeningOnEntityUnload.
@Redirect(// forge replaces this with their own method
method = "removeEntityComplete", remap = false, at = @At(value = "INVOKE", target = "Ljava/util/Set;remove(Ljava/lang/Object;)Z"))
private boolean stopListeningOnEntityUnload(Set<EntityNavigation> set, Object navigation) {
EntityNavigation entityNavigation = (EntityNavigation) navigation;
((EntityNavigationExtended) entityNavigation).setRegisteredToWorld(false);
this.activeEntityNavigations.remove(entityNavigation);
return set.remove(entityNavigation);
}
use of me.jellysquid.mods.lithium.common.entity.EntityNavigationExtended in project roadrunner by MaxNeedsSnacks.
the class ServerWorldMixin method startListeningOnEntityLoad.
@Redirect(method = "loadEntityUnchecked", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/mob/MobEntity;getNavigation()Lnet/minecraft/entity/ai/pathing/EntityNavigation;"))
private EntityNavigation startListeningOnEntityLoad(MobEntity mobEntity) {
EntityNavigation navigation = mobEntity.getNavigation();
((EntityNavigationExtended) navigation).setRegisteredToWorld(true);
if (navigation.getCurrentPath() != null) {
this.activeEntityNavigations.add(navigation);
}
return navigation;
}
Aggregations