Skip to content

Commit

Permalink
Merge pull request #22 from Zereff06/fix
Browse files Browse the repository at this point in the history
fix deflect effect
  • Loading branch information
Dream-Master authored Jan 3, 2023
2 parents dc69ee1 + edcac6b commit d87599e
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 25 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ buildscript {
}
}
dependencies {
classpath 'com.github.GTNewHorizons:ForgeGradle:1.2.7'
classpath 'com.github.GTNewHorizons:ForgeGradle:1.2.13'
}
}

Expand Down
12 changes: 2 additions & 10 deletions src/main/java/thaumic/tinkerer/common/compat/BotaniaFunctions.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,7 @@ public static void AddBotaniaClasses( )
}

public static boolean isEntityHarmless(Entity entity) {
if(entity instanceof IManaBurst) {
ItemStack lens = ((IManaBurst)entity).getSourceLens();
if(lens.getItemDamage()!=8 && lens.getItemDamage()!=11)
return true;
else
return false;
}
else
return true;

ItemStack lens = ((IManaBurst)entity).getSourceLens();
return lens.getItemDamage() != 8 && lens.getItemDamage() != 11;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@
import thaumic.tinkerer.common.research.IRegisterableResearch;
import thaumic.tinkerer.common.research.ResearchHelper;
import thaumic.tinkerer.common.research.TTResearchItem;
import vazkii.botania.api.internal.IManaBurst;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

public class ItemFocusDeflect extends ItemModFocus {
Expand All @@ -65,9 +65,9 @@ public static void protectFromProjectiles(EntityPlayer p, ItemStack stack) {
int range = 0;
if (stack != null) {
ItemWandCasting wand = (ItemWandCasting) stack.getItem();
range = wand.getFocusEnlarge(stack);
range = wand.getFocusEnlarge(stack);
}

List<Entity> projectiles = p.worldObj.getEntitiesWithinAABB(IProjectile.class, AxisAlignedBB.getBoundingBox(p.posX - (4 + range), p.posY - (4 + range), p.posZ - (4 + range), p.posX + (3 + range), p.posY + (3 + range), p.posZ + (3 + range)));

for (Entity e : projectiles) {
Expand All @@ -89,15 +89,15 @@ public FocusUpgradeType[] getPossibleUpgradesByRank(ItemStack itemstack, int ran
{
switch (rank)
{
case 1:
case 1:
return new FocusUpgradeType[] { FocusUpgradeType.frugal};
case 2:
case 2:
return new FocusUpgradeType[] { FocusUpgradeType.frugal, FocusUpgradeType.enlarge};
case 3:
case 3:
return new FocusUpgradeType[] { FocusUpgradeType.frugal};
case 4:
case 4:
return new FocusUpgradeType[] { FocusUpgradeType.frugal, FocusUpgradeType.enlarge};
case 5:
case 5:
return new FocusUpgradeType[] { FocusUpgradeType.frugal};
}
return null;
Expand All @@ -107,15 +107,14 @@ private static boolean CheckBlackList(Entity entity) {
Class<? extends Entity> aClass=entity.getClass();
if(DeflectBlacklist.contains(aClass))
return true;
if (Loader.isModLoaded("Botania"))
if (Loader.isModLoaded("Botania") && entity instanceof IManaBurst)
{
return BotaniaFunctions.isEntityHarmless(entity);
}
for(Class<?> testClass:DeflectBlacklist)
{
if(testClass.isInterface())
if(testClass.isAssignableFrom(aClass))
return true;
if(testClass.isInterface() && testClass.isAssignableFrom(aClass))
return true;
}
return false;
}
Expand Down Expand Up @@ -148,8 +147,8 @@ public int getFocusColor(ItemStack stack) {
public AspectList getVisCost(ItemStack stack) {
return visUsage;
}




@Override
Expand Down

0 comments on commit d87599e

Please sign in to comment.