/**
* This class was created by <Vazkii>. It's distributed as
* part of the Botania Mod. Get the Source Code in github:
* https://github.com/Vazkii/Botania
*
* Botania is Open Source and distributed under the
* Botania License: http://botaniamod.net/license.php
*
* File Created @ [Jul 25, 2015, 12:24:10 AM (GMT)]
*/
package vazkii.botania.common.block;
import net.minecraft.block.Block;
import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.stats.Achievement;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import vazkii.botania.api.internal.IManaBurst;
import vazkii.botania.api.lexicon.ILexiconable;
import vazkii.botania.api.lexicon.LexiconEntry;
import vazkii.botania.api.mana.IManaTrigger;
import vazkii.botania.common.achievement.ICraftAchievement;
import vazkii.botania.common.achievement.ModAchievements;
import vazkii.botania.common.entity.EntityManaStorm;
import vazkii.botania.common.lexicon.LexiconData;
import vazkii.botania.common.lib.LibBlockNames;
public class BlockManaBomb extends BlockMod implements IManaTrigger, ILexiconable, ICraftAchievement {
public BlockManaBomb() {
super(Material.WOOD, LibBlockNames.MANA_BOMB);
setHardness(12.0F);
setSoundType(SoundType.WOOD);
}
@Override
public void onBurstCollision(IManaBurst burst, World world, BlockPos pos) {
if(!burst.isFake() && !world.isRemote) {
world.playEvent(2001, pos, Block.getStateId(getDefaultState()));
world.setBlockToAir(pos);
EntityManaStorm storm = new EntityManaStorm(world);
storm.setPosition(pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5);
world.spawnEntity(storm);
}
}
@Override
public LexiconEntry getEntry(World world, BlockPos pos, EntityPlayer player, ItemStack lexicon) {
return LexiconData.manaBomb;
}
@Override
public Achievement getAchievementOnCraft(ItemStack stack, EntityPlayer player, IInventory matrix) {
return ModAchievements.manaBombIgnite;
}
}