Removed all usages of PleaseStopUsingMe

This commit is contained in:
Nicholas Ignoffo 2018-03-17 22:30:14 -07:00
parent 77e5beb9e1
commit f535e331dd
10 changed files with 21 additions and 34 deletions

View file

@ -2,6 +2,7 @@ package WayofTime.bloodmagic.alchemyArray;
import java.util.List;
import WayofTime.bloodmagic.util.DamageSourceBloodMagic;
import net.minecraft.block.Block;
import net.minecraft.block.BlockFurnace;
import net.minecraft.entity.player.EntityPlayer;
@ -15,7 +16,6 @@ import net.minecraft.util.EnumFacing;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import WayofTime.bloodmagic.util.PleaseStopUsingMe;
public class AlchemyArrayEffectFurnaceFuel extends AlchemyArrayEffect
{
@ -67,7 +67,7 @@ public class AlchemyArrayEffectFurnaceFuel extends AlchemyArrayEffect
if (!sacrifice.capabilities.isCreativeMode)
{
sacrifice.hurtResistantTime = 0;
sacrifice.attackEntityFrom(PleaseStopUsingMe.damageSource, 1.0F); //No.
sacrifice.attackEntityFrom(DamageSourceBloodMagic.INSTANCE, 1.0F); //No.
}
}
}

View file

@ -1,7 +1,7 @@
package WayofTime.bloodmagic.core.data;
import WayofTime.bloodmagic.util.BMLog;
import WayofTime.bloodmagic.util.PleaseStopUsingMe;
import WayofTime.bloodmagic.util.DamageSourceBloodMagic;
import WayofTime.bloodmagic.event.AddToNetworkEvent;
import WayofTime.bloodmagic.event.SoulNetworkEvent;
import WayofTime.bloodmagic.util.helper.PlayerHelper;
@ -113,14 +113,14 @@ public class SoulNetwork implements INBTSerializable<NBTTagCompound> {
if (syphon < 100 && syphon > 0) {
if (!user.capabilities.isCreativeMode) {
user.hurtResistantTime = 0;
user.attackEntityFrom(PleaseStopUsingMe.damageSource, 1.0F);
user.attackEntityFrom(DamageSourceBloodMagic.INSTANCE, 1.0F);
}
} else if (syphon >= 100) {
if (!user.capabilities.isCreativeMode) {
for (int i = 0; i < ((syphon + 99) / 100); i++) {
user.hurtResistantTime = 0;
user.attackEntityFrom(PleaseStopUsingMe.damageSource, 1.0F);
user.attackEntityFrom(DamageSourceBloodMagic.INSTANCE, 1.0F);
}
}
}

View file

@ -3,7 +3,7 @@ package WayofTime.bloodmagic.item;
import WayofTime.bloodmagic.BloodMagic;
import WayofTime.bloodmagic.api.impl.BloodMagicAPI;
import WayofTime.bloodmagic.client.IVariantProvider;
import WayofTime.bloodmagic.util.PleaseStopUsingMe;
import WayofTime.bloodmagic.util.DamageSourceBloodMagic;
import WayofTime.bloodmagic.util.helper.PlayerSacrificeHelper;
import WayofTime.bloodmagic.util.helper.PurificationHelper;
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
@ -71,7 +71,7 @@ public class ItemDaggerOfSacrifice extends Item implements IVariantProvider {
if (PlayerSacrificeHelper.findAndFillAltar(attacker.getEntityWorld(), target, lifeEssence, true)) {
target.getEntityWorld().playSound(null, target.posX, target.posY, target.posZ, SoundEvents.BLOCK_FIRE_EXTINGUISH, SoundCategory.BLOCKS, 0.5F, 2.6F + (target.getEntityWorld().rand.nextFloat() - target.getEntityWorld().rand.nextFloat()) * 0.8F);
target.setHealth(-1);
target.onDeath(PleaseStopUsingMe.damageSource);
target.onDeath(DamageSourceBloodMagic.INSTANCE);
}
return false;

View file

@ -7,7 +7,7 @@ import WayofTime.bloodmagic.event.SacrificeKnifeUsedEvent;
import WayofTime.bloodmagic.item.types.ISubItem;
import WayofTime.bloodmagic.tile.TileAltar;
import WayofTime.bloodmagic.util.Constants;
import WayofTime.bloodmagic.util.PleaseStopUsingMe;
import WayofTime.bloodmagic.util.DamageSourceBloodMagic;
import WayofTime.bloodmagic.util.helper.NBTHelper;
import WayofTime.bloodmagic.util.helper.PlayerHelper;
import WayofTime.bloodmagic.util.helper.PlayerSacrificeHelper;
@ -97,10 +97,10 @@ public class ItemSacrificialDagger extends ItemEnum<ItemSacrificialDagger.Dagger
if (evt.shouldDrainHealth) {
player.hurtResistantTime = 0;
player.attackEntityFrom(PleaseStopUsingMe.damageSource, 0.001F);
player.attackEntityFrom(DamageSourceBloodMagic.INSTANCE, 0.001F);
player.setHealth(Math.max(player.getHealth() - 2, 0.0001f));
if (player.getHealth() <= 0.001f) {
player.onDeath(PleaseStopUsingMe.damageSource);
player.onDeath(DamageSourceBloodMagic.INSTANCE);
player.setHealth(0);
}
// player.attackEntityFrom(BloodMagicAPI.getDamageSource(), 2.0F);

View file

@ -1,6 +1,6 @@
package WayofTime.bloodmagic.item.sigil;
import WayofTime.bloodmagic.util.PleaseStopUsingMe;
import WayofTime.bloodmagic.util.DamageSourceBloodMagic;
import WayofTime.bloodmagic.util.helper.PlayerHelper;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.MobEffects;
@ -37,7 +37,7 @@ public class ItemSigilFastMiner extends ItemSigilToggleableBase {
player.addPotionEffect(new PotionEffect(MobEffects.HASTE, ticks, potionPotency));
if (!player.capabilities.isCreativeMode) {
player.hurtResistantTime = 0;
player.attackEntityFrom(PleaseStopUsingMe.damageSource, 1.0F);
player.attackEntityFrom(DamageSourceBloodMagic.INSTANCE, 1.0F);
}
}
}

View file

@ -2,7 +2,7 @@ package WayofTime.bloodmagic.potion;
import WayofTime.bloodmagic.api.impl.BloodMagicAPI;
import WayofTime.bloodmagic.util.Constants;
import WayofTime.bloodmagic.util.PleaseStopUsingMe;
import WayofTime.bloodmagic.util.DamageSourceBloodMagic;
import WayofTime.bloodmagic.util.helper.NBTHelper;
import WayofTime.bloodmagic.recipe.alchemyTable.AlchemyTablePotionAugmentRecipe;
import net.minecraft.block.Block;
@ -67,7 +67,7 @@ public class BMPotionUtils {
}
if (incurredDamage > 0) {
entity.attackEntityFrom(PleaseStopUsingMe.damageSource, (float) incurredDamage);
entity.attackEntityFrom(DamageSourceBloodMagic.INSTANCE, (float) incurredDamage);
}
return incurredDamage;

View file

@ -2,7 +2,7 @@ package WayofTime.bloodmagic.ritual.types;
import WayofTime.bloodmagic.BloodMagic;
import WayofTime.bloodmagic.ritual.*;
import WayofTime.bloodmagic.util.PleaseStopUsingMe;
import WayofTime.bloodmagic.util.DamageSourceBloodMagic;
import WayofTime.bloodmagic.soul.DemonWillHolder;
import WayofTime.bloodmagic.soul.EnumDemonWillType;
import WayofTime.bloodmagic.core.RegistrarBloodMagic;
@ -198,7 +198,7 @@ public class RitualLava extends Ritual {
}
if (!entity.isDead && entity.hurtTime <= 0 && Utils.isImmuneToFireDamage(entity)) {
if (entity.attackEntityFrom(PleaseStopUsingMe.damageSource, damage)) {
if (entity.attackEntityFrom(DamageSourceBloodMagic.INSTANCE, damage)) {
corrosiveDrained += corrosiveWillDrain;
corrosiveWill -= corrosiveWillDrain;
}

View file

@ -2,7 +2,7 @@ package WayofTime.bloodmagic.ritual.types;
import WayofTime.bloodmagic.BloodMagic;
import WayofTime.bloodmagic.ritual.*;
import WayofTime.bloodmagic.util.PleaseStopUsingMe;
import WayofTime.bloodmagic.util.DamageSourceBloodMagic;
import WayofTime.bloodmagic.soul.EnumDemonWillType;
import WayofTime.bloodmagic.demonAura.WorldDemonWillHandler;
import WayofTime.bloodmagic.util.Utils;
@ -92,7 +92,7 @@ public class RitualRegeneration extends Ritual {
float currentHealth = damagedEntity.getHealth();
damagedEntity.attackEntityFrom(PleaseStopUsingMe.damageSource, Math.min(player.getMaxHealth() - player.getHealth(), syphonedHealthAmount));
damagedEntity.attackEntityFrom(DamageSourceBloodMagic.INSTANCE, Math.min(player.getMaxHealth() - player.getHealth(), syphonedHealthAmount));
float healthDifference = currentHealth - damagedEntity.getHealth();
if (healthDifference > 0) {

View file

@ -7,6 +7,9 @@ import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.TextComponentString;
public class DamageSourceBloodMagic extends DamageSource {
public static final DamageSourceBloodMagic INSTANCE = new DamageSourceBloodMagic();
public DamageSourceBloodMagic() {
super("bloodMagic");

View file

@ -1,16 +0,0 @@
package WayofTime.bloodmagic.util;
import net.minecraft.util.DamageSource;
/**
* The primary API class. Includes helper methods and blacklists.
* <p>
* Some API methods can be used via IMC instead. The supported methods are:
*/
// TODO - Nuke this class
@Deprecated
public class PleaseStopUsingMe {
public static boolean loggingEnabled;
public static DamageSource damageSource = new DamageSourceBloodMagic();
}