|
32 | 32 | import net.minecraft.entity.ai.attributes.AttributeModifier; |
33 | 33 | import net.minecraft.entity.ai.attributes.IAttributeInstance; |
34 | 34 | import net.minecraft.entity.item.EntityItem; |
| 35 | +import net.minecraft.entity.monster.EntityCreeper; |
35 | 36 | import net.minecraft.entity.monster.EntityMob; |
36 | 37 | import net.minecraft.entity.monster.IMob; |
37 | 38 | import net.minecraft.entity.passive.EntityWolf; |
|
71 | 72 |
|
72 | 73 | import javax.vecmath.Vector3d; |
73 | 74 | import java.util.List; |
| 75 | +import java.util.Objects; |
74 | 76 | import java.util.stream.Collectors; |
75 | 77 |
|
76 | 78 | @EventBusSubscriber(modid = Nyx.ID) |
@@ -146,7 +148,7 @@ public static void onPlayerTick(TickEvent.PlayerTickEvent event) { |
146 | 148 | } |
147 | 149 | } |
148 | 150 |
|
149 | | - if (NyxWorld.get(player.world).currentLunarEvent instanceof NyxEventBlueMoon) { |
| 151 | + if (Objects.requireNonNull(NyxWorld.get(player.world)).currentLunarEvent instanceof NyxEventBlueMoon) { |
150 | 152 | player.addPotionEffect(new PotionEffect(MobEffects.LUCK, 2, 1, false, false)); |
151 | 153 | } |
152 | 154 | } |
@@ -397,7 +399,8 @@ public static void onSpawn(LivingSpawnEvent.SpecialSpawn event) { |
397 | 399 | effect = MobEffects.INVISIBILITY; |
398 | 400 | } |
399 | 401 |
|
400 | | - if (effect != null) entity.addPotionEffect(new PotionEffect(effect, Integer.MAX_VALUE)); |
| 402 | + // TODO: Add a configure list of mobs that can and cannot get effects. Maybe we could do this for all events as well |
| 403 | + if (effect != null && !(entity instanceof EntityCreeper)) entity.addPotionEffect(new PotionEffect(effect, Integer.MAX_VALUE)); |
401 | 404 | } |
402 | 405 | } else if (nyx.currentLunarEvent instanceof NyxEventStarShower) { |
403 | 406 | if (NyxConfig.EVENTS_LUNAR.STAR_SHOWER.spawnsExtraChance > 0 && entity.world.rand.nextInt(NyxConfig.EVENTS_LUNAR.STAR_SHOWER.spawnsExtraChance) == 0) { |
|
0 commit comments