From f535e331dd0a5811e2a6507339888f7e89983600 Mon Sep 17 00:00:00 2001 From: Nicholas Ignoffo Date: Sat, 17 Mar 2018 22:30:14 -0700 Subject: [PATCH] Removed all usages of PleaseStopUsingMe --- .../AlchemyArrayEffectFurnaceFuel.java | 4 ++-- .../bloodmagic/core/data/SoulNetwork.java | 6 +++--- .../bloodmagic/item/ItemDaggerOfSacrifice.java | 4 ++-- .../bloodmagic/item/ItemSacrificialDagger.java | 6 +++--- .../item/sigil/ItemSigilFastMiner.java | 4 ++-- .../bloodmagic/potion/BMPotionUtils.java | 4 ++-- .../bloodmagic/ritual/types/RitualLava.java | 4 ++-- .../ritual/types/RitualRegeneration.java | 4 ++-- .../bloodmagic/util/DamageSourceBloodMagic.java | 3 +++ .../bloodmagic/util/PleaseStopUsingMe.java | 16 ---------------- 10 files changed, 21 insertions(+), 34 deletions(-) delete mode 100644 src/main/java/WayofTime/bloodmagic/util/PleaseStopUsingMe.java diff --git a/src/main/java/WayofTime/bloodmagic/alchemyArray/AlchemyArrayEffectFurnaceFuel.java b/src/main/java/WayofTime/bloodmagic/alchemyArray/AlchemyArrayEffectFurnaceFuel.java index 145b6143..b9f2f51b 100644 --- a/src/main/java/WayofTime/bloodmagic/alchemyArray/AlchemyArrayEffectFurnaceFuel.java +++ b/src/main/java/WayofTime/bloodmagic/alchemyArray/AlchemyArrayEffectFurnaceFuel.java @@ -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. } } } diff --git a/src/main/java/WayofTime/bloodmagic/core/data/SoulNetwork.java b/src/main/java/WayofTime/bloodmagic/core/data/SoulNetwork.java index a9ec1ff2..046c6b61 100644 --- a/src/main/java/WayofTime/bloodmagic/core/data/SoulNetwork.java +++ b/src/main/java/WayofTime/bloodmagic/core/data/SoulNetwork.java @@ -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 { 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); } } } diff --git a/src/main/java/WayofTime/bloodmagic/item/ItemDaggerOfSacrifice.java b/src/main/java/WayofTime/bloodmagic/item/ItemDaggerOfSacrifice.java index 3b5203a9..c3b3ecfd 100644 --- a/src/main/java/WayofTime/bloodmagic/item/ItemDaggerOfSacrifice.java +++ b/src/main/java/WayofTime/bloodmagic/item/ItemDaggerOfSacrifice.java @@ -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; diff --git a/src/main/java/WayofTime/bloodmagic/item/ItemSacrificialDagger.java b/src/main/java/WayofTime/bloodmagic/item/ItemSacrificialDagger.java index 11a6381d..6dc81125 100644 --- a/src/main/java/WayofTime/bloodmagic/item/ItemSacrificialDagger.java +++ b/src/main/java/WayofTime/bloodmagic/item/ItemSacrificialDagger.java @@ -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 0) { - entity.attackEntityFrom(PleaseStopUsingMe.damageSource, (float) incurredDamage); + entity.attackEntityFrom(DamageSourceBloodMagic.INSTANCE, (float) incurredDamage); } return incurredDamage; diff --git a/src/main/java/WayofTime/bloodmagic/ritual/types/RitualLava.java b/src/main/java/WayofTime/bloodmagic/ritual/types/RitualLava.java index 56e32be6..d81a2ace 100644 --- a/src/main/java/WayofTime/bloodmagic/ritual/types/RitualLava.java +++ b/src/main/java/WayofTime/bloodmagic/ritual/types/RitualLava.java @@ -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; } diff --git a/src/main/java/WayofTime/bloodmagic/ritual/types/RitualRegeneration.java b/src/main/java/WayofTime/bloodmagic/ritual/types/RitualRegeneration.java index 78e145ba..f480edc7 100644 --- a/src/main/java/WayofTime/bloodmagic/ritual/types/RitualRegeneration.java +++ b/src/main/java/WayofTime/bloodmagic/ritual/types/RitualRegeneration.java @@ -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) { diff --git a/src/main/java/WayofTime/bloodmagic/util/DamageSourceBloodMagic.java b/src/main/java/WayofTime/bloodmagic/util/DamageSourceBloodMagic.java index 303bea5a..28a29658 100644 --- a/src/main/java/WayofTime/bloodmagic/util/DamageSourceBloodMagic.java +++ b/src/main/java/WayofTime/bloodmagic/util/DamageSourceBloodMagic.java @@ -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"); diff --git a/src/main/java/WayofTime/bloodmagic/util/PleaseStopUsingMe.java b/src/main/java/WayofTime/bloodmagic/util/PleaseStopUsingMe.java deleted file mode 100644 index 368bd44e..00000000 --- a/src/main/java/WayofTime/bloodmagic/util/PleaseStopUsingMe.java +++ /dev/null @@ -1,16 +0,0 @@ -package WayofTime.bloodmagic.util; - -import net.minecraft.util.DamageSource; - -/** - * The primary API class. Includes helper methods and blacklists. - *

- * 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(); -}