|
| 1 | +/* |
| 2 | + * This file is part of the Carpet TIS Addition project, licensed under the |
| 3 | + * GNU Lesser General Public License v3.0 |
| 4 | + * |
| 5 | + * Copyright (C) 2026 Fallen_Breath and contributors |
| 6 | + * |
| 7 | + * Carpet TIS Addition is free software: you can redistribute it and/or modify |
| 8 | + * it under the terms of the GNU Lesser General Public License as published by |
| 9 | + * the Free Software Foundation, either version 3 of the License, or |
| 10 | + * (at your option) any later version. |
| 11 | + * |
| 12 | + * Carpet TIS Addition is distributed in the hope that it will be useful, |
| 13 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 15 | + * GNU Lesser General Public License for more details. |
| 16 | + * |
| 17 | + * You should have received a copy of the GNU Lesser General Public License |
| 18 | + * along with Carpet TIS Addition. If not, see <https://www.gnu.org/licenses/>. |
| 19 | + */ |
| 20 | + |
| 21 | +package carpettisaddition.mixins.rule.leaderZombieSpawnWithMaxHealthDisabled; |
| 22 | + |
| 23 | +import carpettisaddition.CarpetTISAdditionSettings; |
| 24 | +import com.llamalad7.mixinextras.injector.v2.WrapWithCondition; |
| 25 | +import net.minecraft.world.entity.monster.zombie.Zombie; |
| 26 | +import org.spongepowered.asm.mixin.Mixin; |
| 27 | +import org.spongepowered.asm.mixin.injection.At; |
| 28 | + |
| 29 | +@Mixin(Zombie.class) |
| 30 | +public abstract class ZombieEntityMixin |
| 31 | +{ |
| 32 | + @WrapWithCondition( |
| 33 | + method = "handleAttributes", |
| 34 | + at = @At( |
| 35 | + value = "INVOKE", |
| 36 | + target = "Lnet/minecraft/world/entity/monster/zombie/Zombie;setHealth(F)V" |
| 37 | + ) |
| 38 | + ) |
| 39 | + private boolean leaderZombieSpawnWithMaxHealthDisabled_skipSetHealthToMax(Zombie instance, float health) |
| 40 | + { |
| 41 | + return !CarpetTISAdditionSettings.leaderZombieSpawnWithMaxHealthDisabled; |
| 42 | + } |
| 43 | +} |
| 44 | + |
0 commit comments