mirror of
https://github.com/GTNewHorizons/ForbiddenMagic.git
synced 2026-11-20 20:12:13 +00:00
Fixing crash when old version of AM2 is present
This commit is contained in:
1 parent
6d7935d696
commit
6298fb2bc2
1 file changed
+21
-17
@@ -20,27 +20,31 @@ public class ManaWandUpdate implements IWandRodOnUpdate {
|
||||
{
|
||||
if(player.ticksExisted % 100 == 0){
|
||||
|
||||
IExtendedProperties prop = ArsMagicaApi.instance.getExtendedProperties(player);
|
||||
|
||||
float cost;
|
||||
if(((ItemWandCasting)itemstack.getItem()).getCap(itemstack).getTag().equals("vinteum"))
|
||||
cost = 90.0F;
|
||||
else
|
||||
cost = 150.0F;
|
||||
try
|
||||
{
|
||||
IExtendedProperties prop = ArsMagicaApi.instance.getExtendedProperties(player);
|
||||
|
||||
if(prop == null || prop.getCurrentMana() <= 0)
|
||||
return;
|
||||
|
||||
|
||||
for(int x = 0;x < primals.length;x++){
|
||||
if(((ItemWandCasting)itemstack.getItem()).getVis(itemstack, primals[x]) < ((ItemWandCasting)itemstack.getItem()).getMaxVis(itemstack)) {
|
||||
if(prop.getCurrentMana() > cost)
|
||||
{
|
||||
prop.setCurrentMana(prop.getCurrentMana() - cost);
|
||||
((ItemWandCasting)itemstack.getItem()).addVis(itemstack, primals[x], 1, true);
|
||||
float cost;
|
||||
if(((ItemWandCasting)itemstack.getItem()).getCap(itemstack).getTag().equals("vinteum"))
|
||||
cost = 90.0F;
|
||||
else
|
||||
cost = 150.0F;
|
||||
|
||||
if(prop == null || prop.getCurrentMana() <= 0)
|
||||
return;
|
||||
|
||||
|
||||
for(int x = 0;x < primals.length;x++){
|
||||
if(((ItemWandCasting)itemstack.getItem()).getVis(itemstack, primals[x]) < ((ItemWandCasting)itemstack.getItem()).getMaxVis(itemstack)) {
|
||||
if(prop.getCurrentMana() > cost)
|
||||
{
|
||||
prop.setCurrentMana(prop.getCurrentMana() - cost);
|
||||
((ItemWandCasting)itemstack.getItem()).addVis(itemstack, primals[x], 1, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch(Throwable e){}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user