2022-10-28 16:20:12 +02:00
|
|
|
package mffs.item.module.interdiction;
|
|
|
|
|
|
|
|
import mffs.ModularForceFieldSystem;
|
2023-01-08 16:58:21 +01:00
|
|
|
import mffs.api.security.IInterdictionMatrix;
|
|
|
|
import net.minecraft.entity.EntityLivingBase;
|
2022-10-28 16:20:12 +02:00
|
|
|
import net.minecraft.entity.INpc;
|
|
|
|
import net.minecraft.entity.monster.IMob;
|
|
|
|
|
2023-01-08 16:58:21 +01:00
|
|
|
public class ItemModuleAntiHostile extends ItemModuleInterdictionMatrix {
|
2022-10-28 16:20:12 +02:00
|
|
|
public ItemModuleAntiHostile() {
|
|
|
|
super("moduleAntiHostile");
|
|
|
|
}
|
2023-01-08 16:58:21 +01:00
|
|
|
|
2022-10-28 16:20:12 +02:00
|
|
|
@Override
|
2023-01-08 16:58:21 +01:00
|
|
|
public boolean onDefend(
|
|
|
|
final IInterdictionMatrix interdictionMatrix, final EntityLivingBase entityLiving
|
|
|
|
) {
|
2022-10-28 16:20:12 +02:00
|
|
|
if (entityLiving instanceof IMob && !(entityLiving instanceof INpc)) {
|
|
|
|
entityLiving.attackEntityFrom(ModularForceFieldSystem.damagefieldShock, 20);
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|