Added an alchemy array, the Array of the Fast Miner

This commit is contained in:
WayofTime 2016-10-22 16:11:30 -04:00
parent 4e671d5132
commit 44e1c47e1c
6 changed files with 109 additions and 0 deletions

View file

@ -23,6 +23,7 @@ Version 2.1.0-66
- Fixed the displayed Lesser Tartaric Gem recipe in the Guide (#947) - Fixed the displayed Lesser Tartaric Gem recipe in the Guide (#947)
- Fixed Dagger of Sacrifice one-shotting bosses. It now just doesn't work (#932) - Fixed Dagger of Sacrifice one-shotting bosses. It now just doesn't work (#932)
- Fixed controls re-binding after each startup (#922) - Fixed controls re-binding after each startup (#922)
- Added an alchemy array, the Array of the Fast Miner
------------------------------------------------------ ------------------------------------------------------
Version 2.1.0-65 Version 2.1.0-65

View file

@ -0,0 +1,47 @@
package WayofTime.bloodmagic.alchemyArray;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import WayofTime.bloodmagic.api.alchemyCrafting.AlchemyArrayEffect;
import WayofTime.bloodmagic.api.iface.ISigil;
public class AlchemyArrayEffectSigil extends AlchemyArrayEffect
{
private final ISigil sigil;
public AlchemyArrayEffectSigil(String key, ISigil sigil)
{
super(key);
this.sigil = sigil;
}
@Override
public boolean update(TileEntity tile, int ticksActive)
{
//TODO: Need particles.
if (sigil.hasArrayEffect())
{
sigil.performArrayEffect(tile.getWorld(), tile.getPos());
}
return false;
}
@Override
public void writeToNBT(NBTTagCompound tag)
{
}
@Override
public void readFromNBT(NBTTagCompound tag)
{
}
@Override
public AlchemyArrayEffect getNewCopy()
{
return new AlchemyArrayEffectSigil(key, sigil);
}
}

View file

@ -1,9 +1,15 @@
package WayofTime.bloodmagic.api.iface; package WayofTime.bloodmagic.api.iface;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
/** /**
* Used for all {@link WayofTime.bloodmagic.api.impl.ItemSigil} <b>EXCEPT</b> * Used for all {@link WayofTime.bloodmagic.api.impl.ItemSigil} <b>EXCEPT</b>
* Sigils of Holdings. * Sigils of Holdings.
*/ */
public interface ISigil public interface ISigil
{ {
boolean performArrayEffect(World world, BlockPos pos);
boolean hasArrayEffect();
} }

View file

@ -5,6 +5,8 @@ import WayofTime.bloodmagic.api.iface.ISigil;
import WayofTime.bloodmagic.api.util.helper.NBTHelper; import WayofTime.bloodmagic.api.util.helper.NBTHelper;
import lombok.Getter; import lombok.Getter;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
/** /**
* Base class for all (static) sigils. * Base class for all (static) sigils.
@ -35,4 +37,16 @@ public class ItemSigil extends ItemBindable implements ISigil
stack.getTagCompound().setBoolean(Constants.NBT.UNUSABLE, unusable); stack.getTagCompound().setBoolean(Constants.NBT.UNUSABLE, unusable);
return stack; return stack;
} }
@Override
public boolean performArrayEffect(World world, BlockPos pos)
{
return false;
}
@Override
public boolean hasArrayEffect()
{
return false;
}
} }

View file

@ -1,9 +1,14 @@
package WayofTime.bloodmagic.item.sigil; package WayofTime.bloodmagic.item.sigil;
import java.util.List;
import WayofTime.bloodmagic.api.BloodMagicAPI;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.MobEffects; import net.minecraft.init.MobEffects;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.potion.PotionEffect; import net.minecraft.potion.PotionEffect;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World; import net.minecraft.world.World;
public class ItemSigilFastMiner extends ItemSigilToggleableBase public class ItemSigilFastMiner extends ItemSigilToggleableBase
@ -18,4 +23,35 @@ public class ItemSigilFastMiner extends ItemSigilToggleableBase
{ {
player.addPotionEffect(new PotionEffect(MobEffects.HASTE, 2, 0, true, false)); player.addPotionEffect(new PotionEffect(MobEffects.HASTE, 2, 0, true, false));
} }
@Override
public boolean performArrayEffect(World world, BlockPos pos)
{
double radius = 10;
int ticks = 600;
int potionPotency = 2;
AxisAlignedBB bb = new AxisAlignedBB(pos).expandXyz(radius);
List<EntityPlayer> playerList = world.getEntitiesWithinAABB(EntityPlayer.class, bb);
for (EntityPlayer player : playerList)
{
if (!player.isPotionActive(MobEffects.HASTE) || (player.isPotionActive(MobEffects.HASTE) && player.getActivePotionEffect(MobEffects.HASTE).getAmplifier() < potionPotency))
{
player.addPotionEffect(new PotionEffect(MobEffects.HASTE, ticks, potionPotency));
if (!player.capabilities.isCreativeMode)
{
player.hurtResistantTime = 0;
player.attackEntityFrom(BloodMagicAPI.getDamageSource(), 1.0F);
}
}
}
return false;
}
@Override
public boolean hasArrayEffect()
{
return true;
}
} }

View file

@ -29,11 +29,13 @@ import WayofTime.bloodmagic.alchemyArray.AlchemyArrayEffectAttractor;
import WayofTime.bloodmagic.alchemyArray.AlchemyArrayEffectBinding; import WayofTime.bloodmagic.alchemyArray.AlchemyArrayEffectBinding;
import WayofTime.bloodmagic.alchemyArray.AlchemyArrayEffectBounce; import WayofTime.bloodmagic.alchemyArray.AlchemyArrayEffectBounce;
import WayofTime.bloodmagic.alchemyArray.AlchemyArrayEffectMovement; import WayofTime.bloodmagic.alchemyArray.AlchemyArrayEffectMovement;
import WayofTime.bloodmagic.alchemyArray.AlchemyArrayEffectSigil;
import WayofTime.bloodmagic.alchemyArray.AlchemyArrayEffectSkeletonTurret; import WayofTime.bloodmagic.alchemyArray.AlchemyArrayEffectSkeletonTurret;
import WayofTime.bloodmagic.alchemyArray.AlchemyArrayEffectUpdraft; import WayofTime.bloodmagic.alchemyArray.AlchemyArrayEffectUpdraft;
import WayofTime.bloodmagic.api.Constants; import WayofTime.bloodmagic.api.Constants;
import WayofTime.bloodmagic.api.altar.EnumAltarTier; import WayofTime.bloodmagic.api.altar.EnumAltarTier;
import WayofTime.bloodmagic.api.compress.CompressionRegistry; import WayofTime.bloodmagic.api.compress.CompressionRegistry;
import WayofTime.bloodmagic.api.iface.ISigil;
import WayofTime.bloodmagic.api.recipe.AlchemyTableCustomRecipe; import WayofTime.bloodmagic.api.recipe.AlchemyTableCustomRecipe;
import WayofTime.bloodmagic.api.recipe.ShapedBloodOrbRecipe; import WayofTime.bloodmagic.api.recipe.ShapedBloodOrbRecipe;
import WayofTime.bloodmagic.api.recipe.ShapelessBloodOrbRecipe; import WayofTime.bloodmagic.api.recipe.ShapelessBloodOrbRecipe;
@ -300,6 +302,9 @@ public class ModRecipes
AlchemyArrayRecipeRegistry.registerRecipe(new ItemStack(Items.SLIME_BALL), new ItemStack(Items.REDSTONE), new AlchemyArrayEffectBounce("bounce"), new SingleAlchemyCircleRenderer(new ResourceLocation("bloodmagic", "textures/models/AlchemyArrays/BounceArray.png"))); AlchemyArrayRecipeRegistry.registerRecipe(new ItemStack(Items.SLIME_BALL), new ItemStack(Items.REDSTONE), new AlchemyArrayEffectBounce("bounce"), new SingleAlchemyCircleRenderer(new ResourceLocation("bloodmagic", "textures/models/AlchemyArrays/BounceArray.png")));
AlchemyArrayRecipeRegistry.registerRecipe(new ItemStack(Items.ARROW), new ItemStack(Items.FEATHER), new AlchemyArrayEffectSkeletonTurret("skeletonTurret"), new DualAlchemyCircleRenderer(new ResourceLocation("bloodmagic", "textures/models/AlchemyArrays/SkeletonTurret1.png"), new ResourceLocation("bloodmagic", "textures/models/AlchemyArrays/SkeletonTurret2.png"))); AlchemyArrayRecipeRegistry.registerRecipe(new ItemStack(Items.ARROW), new ItemStack(Items.FEATHER), new AlchemyArrayEffectSkeletonTurret("skeletonTurret"), new DualAlchemyCircleRenderer(new ResourceLocation("bloodmagic", "textures/models/AlchemyArrays/SkeletonTurret1.png"), new ResourceLocation("bloodmagic", "textures/models/AlchemyArrays/SkeletonTurret2.png")));
AlchemyArrayRecipeRegistry.registerRecipe(ItemComponent.getStack(ItemComponent.REAGENT_FASTMINER), new ItemStack(Items.IRON_PICKAXE), new AlchemyArrayEffectSigil("fastMiner", (ISigil) ModItems.SIGIL_FAST_MINER), new SingleAlchemyCircleRenderer(new ResourceLocation("bloodmagic", "textures/models/AlchemyArrays/FastMinerSigil.png")));
} }
public static void addCompressionHandlers() public static void addCompressionHandlers()