Merge branch '1.20.4' into 1.21

This commit is contained in:
Sollace 2024-10-02 23:33:46 +01:00
commit 6a7f26119a
No known key found for this signature in database
GPG key ID: E52FACE7B5C773DB

View file

@ -6,7 +6,6 @@ import net.minecraft.client.MinecraftClient;
import net.minecraft.entity.LivingEntity; import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.effect.StatusEffectInstance; import net.minecraft.entity.effect.StatusEffectInstance;
import net.minecraft.entity.effect.StatusEffects; import net.minecraft.entity.effect.StatusEffects;
import net.minecraft.entity.player.PlayerEntity;
public class BatEyesApplicator { public class BatEyesApplicator {
@ -23,13 +22,10 @@ public class BatEyesApplicator {
return initial; return initial;
} }
// TODO: Do we need this?
public void enable() { public void enable() {
if (client.world != null) { if (client.world != null && client.player != null) {
PlayerEntity player = client.player; if (!client.player.hasStatusEffect(StatusEffects.NIGHT_VISION) && EquinePredicates.PLAYER_BAT.test(client.player)) {
if (!player.hasStatusEffect(StatusEffects.NIGHT_VISION) && EquinePredicates.PLAYER_BAT.test(player)) { client.player.addStatusEffect(new StatusEffectInstance(StatusEffects.NIGHT_VISION, -1, 1, false, false));
player.addStatusEffect(new StatusEffectInstance(StatusEffects.NIGHT_VISION, 1, 1, false, false));
batEyesApplied = true; batEyesApplied = true;
} }
} }