This commit is contained in:
skippyall
2024-09-17 09:55:43 +02:00
parent c497884884
commit 1dd6914454
27 changed files with 307 additions and 382 deletions
@@ -16,7 +16,7 @@ import org.spongepowered.asm.mixin.injection.Redirect;
public abstract class MobEntityMixin {
@Redirect(method = "checkDespawn", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/World;getClosestPlayer(Lnet/minecraft/entity/Entity;D)Lnet/minecraft/entity/player/PlayerEntity;"))
public PlayerEntity checkMobDespawningMinion(World instance, Entity entity, double maxDistance) {
return instance.getClosestPlayer(entity.getX(), entity.getY(), entity.getZ(), maxDistance, EntityPredicates.EXCEPT_CREATIVE_OR_SPECTATOR.and(entity1 -> {
return instance.getClosestPlayer(entity.getX(), entity.getY(), entity.getZ(), maxDistance, EntityPredicates.EXCEPT_SPECTATOR.and(entity1 -> {
if(entity1 instanceof ServerPlayerEntity player) {
if(player instanceof MinionFakePlayer minion) {
return MobSpawningModule.canMinionDespawnMobs(minion);