From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Martijn Muijsers Date: Wed, 30 Aug 2023 19:01:50 +0200 Subject: [PATCH] Initialize line of sight cache with low capacity License: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html) Gale - https://galemc.org diff --git a/net/minecraft/world/entity/ai/sensing/Sensing.java b/net/minecraft/world/entity/ai/sensing/Sensing.java index b1aa7294f9479f45fcde77c5ea46db9f62370abf..e17b1a2a95975d1eae5adaa679e027b9181dddbd 100644 --- a/net/minecraft/world/entity/ai/sensing/Sensing.java +++ b/net/minecraft/world/entity/ai/sensing/Sensing.java @@ -7,8 +7,10 @@ import net.minecraft.world.entity.Mob; public class Sensing { private final Mob mob; - private final IntSet seen = new IntOpenHashSet(); - private final IntSet unseen = new IntOpenHashSet(); + // Gale start - initialize line of sight cache with low capacity + private final IntSet seen = new IntOpenHashSet(2); + private final IntSet unseen = new IntOpenHashSet(2); + // Gale end - initialize line of sight cache with low capacity public Sensing(Mob mob) { this.mob = mob;