nullcheck obtained entity entries (#1206, 1207)
No idea what's going on here but aight
This commit is contained in:
parent
27e41e2e77
commit
8be8cc30b9
|
@ -52,6 +52,8 @@ public class ItemDaggerOfSacrifice extends Item implements IVariantProvider {
|
|||
return false;
|
||||
|
||||
EntityEntry entityEntry = EntityRegistry.getEntry(target.getClass());
|
||||
if (entityEntry == null)
|
||||
return false;
|
||||
int lifeEssenceRatio = BloodMagicAPI.INSTANCE.getSacrificialValues().getOrDefault(entityEntry.getRegistryName(), 25);
|
||||
|
||||
if (lifeEssenceRatio <= 0)
|
||||
|
|
|
@ -104,7 +104,7 @@ public class RitualForsakenSoul extends Ritual {
|
|||
for (EntityLivingBase entity : entities) {
|
||||
EntityEntry entityEntry = EntityRegistry.getEntry(entity.getClass());
|
||||
|
||||
if (BloodMagicAPI.INSTANCE.getBlacklist().getSacrifice().contains(entityEntry.getRegistryName()))
|
||||
if (entityEntry == null || BloodMagicAPI.INSTANCE.getBlacklist().getSacrifice().contains(entityEntry.getRegistryName()))
|
||||
continue;
|
||||
|
||||
if (entity.isEntityAlive() && !(entity instanceof EntityPlayer)) {
|
||||
|
|
|
@ -79,7 +79,7 @@ public class RitualWellOfSuffering extends Ritual {
|
|||
for (EntityLivingBase entity : entities) {
|
||||
EntityEntry entityEntry = EntityRegistry.getEntry(entity.getClass());
|
||||
|
||||
if (BloodMagicAPI.INSTANCE.getBlacklist().getSacrifice().contains(entityEntry.getRegistryName()))
|
||||
if (entityEntry == null || BloodMagicAPI.INSTANCE.getBlacklist().getSacrifice().contains(entityEntry.getRegistryName()))
|
||||
continue;
|
||||
|
||||
int lifeEssenceRatio = BloodMagicAPI.INSTANCE.getSacrificialValues().getOrDefault(entityEntry.getRegistryName(), SACRIFICE_AMOUNT);
|
||||
|
|
|
@ -318,7 +318,7 @@ public class GenericHandler {
|
|||
@SubscribeEvent
|
||||
public static void onTeleposeEntity(TeleposeEvent.Ent event) {
|
||||
EntityEntry entry = EntityRegistry.getEntry(event.entity.getClass());
|
||||
if (BloodMagicAPI.INSTANCE.getBlacklist().getTeleposerEntities().contains(entry.getRegistryName()))
|
||||
if (entry != null && BloodMagicAPI.INSTANCE.getBlacklist().getTeleposerEntities().contains(entry.getRegistryName()))
|
||||
event.setCanceled(true);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue