Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class AirStrikeI extends Item {
- public AirStrikeI() {
- super();
- this.setCreativeTab(CreativeTabs.tabMisc);
- this.setUnlocalizedName("airStrike1");
- // Chick this
- this.setTextureName(Main.MODID + ":" + "LightningSword");
- }
- boolean active = false;
- public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player)
- {
- active = true;
- return stack;
- }
- public void onUpdate(ItemStack stack, World world, Entity player, int p_77663_4_, boolean p_77663_5_) {
- //Block target = null;
- int i = 0, j = 0, k = 0;
- boolean gotTarget = false;
- if (active) {
- MovingObjectPosition mop = Minecraft.getMinecraft().renderViewEntity.rayTrace(200, 1.0F);
- if(mop != null) {
- i = mop.blockX;
- j = mop.blockY;
- k = mop.blockZ;
- gotTarget = true;
- //int blockHitSide = mop.sideHit;
- //target = mop.worldObj.getBlock(mop.blockX, mop.blockY, mop.blockZ);
- }
- active = false;
- //Block event = Infos.getPointingBlock();
- if (gotTarget) {
- // Spawn stuff right there.
- world.spawnEntityInWorld(new Meteor(world, i, j, k));
- world.spawnEntityInWorld(new EntityLightningBolt(world, i, j, k));
- gotTarget = false;
- }
- }
- return;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement