mirror of
https://github.com/GTNewHorizons/ForbiddenMagic.git
synced 2026-10-26 14:23:53 +00:00
Replace part name checks with checks against ForbiddenItems.
Some still check against the name, notably blood_iron from Blood Arsenal and ones that check if the name *starts with* a certain phrase, like .startsWith("blood") to match multiple different cores.
This commit is contained in:
1 parent
8939088024
commit
091f1e4f4b
5 files changed
+25
-13
No files matched your search
@@ -68,6 +68,7 @@ import fox.spiteful.forbidden.items.tools.ItemTaintPickaxe;
|
||||
import fox.spiteful.forbidden.potions.DarkPotions;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.api.entities.ITaintedMob;
|
||||
import thaumcraft.api.wands.WandCap;
|
||||
import thaumcraft.common.config.ConfigItems;
|
||||
import thaumcraft.common.items.wands.ItemWandCasting;
|
||||
import thaumcraft.common.lib.utils.Utils;
|
||||
@@ -481,7 +482,7 @@ public class FMEventHandler {
|
||||
|
||||
ItemStack wand = ((EntityPlayer) event.entityLiving).getCurrentEquippedItem();
|
||||
if (event.source.getDamageType().equals("taint")
|
||||
&& ((ItemWandCasting) wand.getItem()).getRod(wand).getTag().equals("tainted")) {
|
||||
&& ((ItemWandCasting) wand.getItem()).getRod(wand) == ForbiddenItems.WAND_ROD_TAINTED) {
|
||||
|
||||
for (int x = 0; x < 3; x++) {
|
||||
((ItemWandCasting) wand.getItem()).addVis(wand, primals[randy.nextInt(6)], 1, true);
|
||||
@@ -489,7 +490,7 @@ public class FMEventHandler {
|
||||
}
|
||||
|
||||
if ((event.source.getDamageType().equals("wither") || event.source.isFireDamage())
|
||||
&& ((ItemWandCasting) wand.getItem()).getRod(wand).getTag().equals("infernal")) {
|
||||
&& ((ItemWandCasting) wand.getItem()).getRod(wand) == ForbiddenItems.WAND_ROD_INFERNAL) {
|
||||
|
||||
event.setCanceled(true);
|
||||
}
|
||||
@@ -498,8 +499,9 @@ public class FMEventHandler {
|
||||
if (event.source.getEntity() instanceof EntityPlayer player) {
|
||||
ItemStack equip = player.getCurrentEquippedItem();
|
||||
if (equip != null && equip.getItem() instanceof ItemWandCasting wand) {
|
||||
String capTag = wand.getCap(equip).getTag();
|
||||
if ((capTag.equals("alchemical") || capTag.equals("blood_iron"))
|
||||
WandCap cap = wand.getCap(equip);
|
||||
// "blood_iron" is the Blood Iron Infused Cap from Blood Arsenal
|
||||
if ((cap == ForbiddenItems.WAND_CAP_ALCHEMICAL || cap.getTag().equals("blood_iron"))
|
||||
&& wand.getRod(equip).getTag().startsWith("blood")) {
|
||||
event.entityLiving.addPotionEffect(new PotionEffect(Potion.weakness.id, 60, 2));
|
||||
}
|
||||
|
||||
@@ -6,7 +6,9 @@ import net.minecraft.item.ItemStack;
|
||||
import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler;
|
||||
import fox.spiteful.forbidden.Config;
|
||||
import fox.spiteful.forbidden.compat.Compat;
|
||||
import fox.spiteful.forbidden.items.ForbiddenItems;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.api.wands.WandCap;
|
||||
import thaumcraft.common.items.wands.ItemWandCasting;
|
||||
|
||||
public class BloodWandUpdate extends DarkWandRodOnUpdate {
|
||||
@@ -18,8 +20,10 @@ public class BloodWandUpdate extends DarkWandRodOnUpdate {
|
||||
try {
|
||||
SoulNetworkHandler.checkAndSetItemOwner(itemstack, player);
|
||||
|
||||
String capTag = ((ItemWandCasting) itemstack.getItem()).getCap(itemstack).getTag();
|
||||
int cost = capTag.equals("alchemical") || capTag.equals("blood_iron") ? Config.bloodvis - 1
|
||||
WandCap cap = ((ItemWandCasting) itemstack.getItem()).getCap(itemstack);
|
||||
// "blood_iron" is the Blood Iron Infused Cap from Blood Arsenal
|
||||
int cost = cap == ForbiddenItems.WAND_CAP_ALCHEMICAL || cap.getTag().equals("blood_iron")
|
||||
? Config.bloodvis - 1
|
||||
: Config.bloodvis;
|
||||
|
||||
cost = Math.max(0, cost);
|
||||
|
||||
@@ -16,7 +16,7 @@ public class ManaStaffUpdate extends ManaWandUpdate {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected float getCost(boolean vinteumCaps) {
|
||||
return vinteumCaps ? 0.5F : 1.0F;
|
||||
protected float getCost(boolean hasVinteumCaps) {
|
||||
return hasVinteumCaps ? 0.5F : 1.0F;
|
||||
}
|
||||
}
|
||||
@@ -7,6 +7,7 @@ import am2.api.ArsMagicaApi;
|
||||
import am2.api.IExtendedProperties;
|
||||
import fox.spiteful.forbidden.Config;
|
||||
import fox.spiteful.forbidden.compat.Compat;
|
||||
import fox.spiteful.forbidden.items.ForbiddenItems;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.common.items.wands.ItemWandCasting;
|
||||
|
||||
@@ -21,7 +22,8 @@ public class ManaWandUpdate extends DarkWandRodOnUpdate {
|
||||
IExtendedProperties prop = ArsMagicaApi.instance.getExtendedProperties(player);
|
||||
if (prop == null || prop.getCurrentMana() <= 0) return;
|
||||
|
||||
float cost = getCost(((ItemWandCasting) itemstack.getItem()).getCap(itemstack).getTag().equals("vinteum"));
|
||||
float cost = getCost(
|
||||
((ItemWandCasting) itemstack.getItem()).getCap(itemstack) == ForbiddenItems.WAND_CAP_VINTEUM);
|
||||
int maxVis = getMaxVis(itemstack);
|
||||
for (Aspect primal : primals) {
|
||||
int deficit = maxVis - ((ItemWandCasting) itemstack.getItem()).getVis(itemstack, primal);
|
||||
@@ -37,7 +39,7 @@ public class ManaWandUpdate extends DarkWandRodOnUpdate {
|
||||
} catch (Exception ignored) {}
|
||||
}
|
||||
|
||||
protected float getCost(boolean vinteumCaps) {
|
||||
return vinteumCaps ? 0.8F : 1.4F;
|
||||
protected float getCost(boolean hasVinteumCaps) {
|
||||
return hasVinteumCaps ? 0.8F : 1.4F;
|
||||
}
|
||||
}
|
||||
@@ -5,7 +5,9 @@ import net.minecraft.item.ItemStack;
|
||||
|
||||
import fox.spiteful.forbidden.Config;
|
||||
import fox.spiteful.forbidden.compat.Compat;
|
||||
import fox.spiteful.forbidden.items.ForbiddenItems;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.api.wands.WandCap;
|
||||
import thaumcraft.common.items.wands.ItemWandCasting;
|
||||
import vazkii.botania.api.mana.ManaItemHandler;
|
||||
|
||||
@@ -19,8 +21,10 @@ public class YandereWandUpdate extends DarkWandRodOnUpdate {
|
||||
}
|
||||
try {
|
||||
int cost;
|
||||
String capTag = ((ItemWandCasting) itemstack.getItem()).getCap(itemstack).getTag();
|
||||
cost = capTag.equals("manasteel") || capTag.equals("elementium") ? Config.manavis - 2 : Config.manavis;
|
||||
WandCap cap = ((ItemWandCasting) itemstack.getItem()).getCap(itemstack);
|
||||
cost = cap == ForbiddenItems.WAND_CAP_MANASTEEL || cap == ForbiddenItems.WAND_CAP_ELEMENTIUM
|
||||
? Config.manavis - 2
|
||||
: Config.manavis;
|
||||
|
||||
cost = Math.max(0, cost);
|
||||
|
||||
|
||||
Reference in new issue
Block a user