Skip to content

Commit

Permalink
disable villagers breeding when limit is reached
Browse files Browse the repository at this point in the history
  • Loading branch information
piotrskibapl committed Sep 27, 2022
1 parent a1c75e1 commit 989ebcb
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import org.bukkit.World;
import org.bukkit.block.Block;
import org.bukkit.block.BlockFace;
import org.bukkit.entity.Animals;
import org.bukkit.entity.Breedable;
import org.bukkit.entity.Villager;
import org.bukkit.entity.Entity;
import org.bukkit.entity.EntityType;
Expand Down Expand Up @@ -94,9 +94,9 @@ public void onBreed(final EntityBreedEvent e) {
&& (e.getBreeder() instanceof Player p)
&& !(p.isOp() || p.hasPermission(addon.getPlugin().getIWM().getPermissionPrefix(e.getEntity().getWorld()) + MOD_BYPASS))
&& !checkLimit(e, e.getEntity(), SpawnReason.BREEDING, false)
&& e.getFather() instanceof Animals f && e.getMother() instanceof Animals m) {
f.setLoveModeTicks(0);
m.setLoveModeTicks(0);
&& e.getFather() instanceof Breedable f && e.getMother() instanceof Breedable m) {
f.setBreed(false);
m.setBreed(false);
}
}

Expand Down

0 comments on commit 989ebcb

Please sign in to comment.