mirror of
https://github.com/garbagemule/MobArena.git
synced 2025-02-16 20:41:56 +01:00
Make piglins and hoglins immune to zombification
When piglins, piglin brutes, and hoglins go through zombification, the current entity is removed, and a new one spawns. MobArena prevents the zombified entity from spawning, so it feels like the mobs just "vanish". We don't actually want the mobs to zombify, however, so this commit makes them immune to the zombification process. Note that this shouldn't cause any problems on server versions prior to 1.16, because the piglin and hoglin keys never get registered on those versions, so there is no risk of hitting those branches in the `switch` statement. Fixes #684 Co-authored-by: Andreas Troelsen <garbagemule@gmail.com>
This commit is contained in:
parent
6be130daf1
commit
1c225d93f9
@ -24,6 +24,7 @@ These changes will (most likely) be included in the next version.
|
||||
|
||||
### Fixed
|
||||
- Pillagers and vindicators no longer spawn without their much-needed weapons.
|
||||
- Piglins, piglin brutes, and hoglins no longer zombify. This fixes a bug where the mobs would despawn due to the zombification process.
|
||||
- Reward groups with `nothing` in them no longer cause errors when earned/granted.
|
||||
|
||||
## [0.106] - 2021-05-09
|
||||
|
@ -12,6 +12,8 @@ import org.bukkit.entity.Creature;
|
||||
import org.bukkit.entity.Creeper;
|
||||
import org.bukkit.entity.EntityType;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Hoglin;
|
||||
import org.bukkit.entity.PiglinAbstract;
|
||||
import org.bukkit.entity.PigZombie;
|
||||
import org.bukkit.entity.Rabbit;
|
||||
import org.bukkit.entity.Sheep;
|
||||
@ -146,6 +148,13 @@ public class MACreature {
|
||||
case "killerbunny":
|
||||
((Rabbit) e).setRabbitType(Rabbit.Type.THE_KILLER_BUNNY);
|
||||
break;
|
||||
case "piglin":
|
||||
case "piglinbrute":
|
||||
((PiglinAbstract) e).setImmuneToZombification(true);
|
||||
break;
|
||||
case "hoglin":
|
||||
((Hoglin) e).setImmuneToZombification(true);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user