<commit_before>package com.elmakers.mine.bukkit.plugins.magic.spells;

import java.lang.reflect.Field;
import java.lang.reflect.Method;

import org.bukkit.Location;
import org.bukkit.entity.Arrow;
import org.bukkit.util.Vector;

import com.elmakers.mine.bukkit.plugins.magic.Spell;
import com.elmakers.mine.bukkit.utilities.borrowed.ConfigurationNode;

public class ArrowSpell extends Spell
{ 
	@Override
	public boolean onCast(ConfigurationNode parameters) 
	{
		int arrowCount = 1;
		arrowCount = parameters.getInt("count", arrowCount);
		boolean useFire = parameters.getBoolean("fire", true);

		Arrow firstArrow = null;
		float speed = 3;
		float spread = 0.1f;
		for (int ai = 0; ai < arrowCount; ai++)
		{
			Arrow arrow = null;
			if (firstArrow == null) {
				arrow = player.launchProjectile(Arrow.class);
				firstArrow = arrow;
			} else {
				Location location = firstArrow.getLocation();
				Vector velocity = firstArrow.getVelocity();
				location.setX(location.getX() + velocity.getX() * (1 + Math.random() * arrowCount));
				location.setY(location.getY() + velocity.getY() * (1 + Math.random() * arrowCount));
				location.setZ(location.getZ() + velocity.getZ() * (1 + Math.random() * arrowCount));
				arrow = player.getWorld().spawnArrow(location, velocity, speed, spread);
			}

			if (arrow == null)
			{
				sendMessage(player, "One of your arrows fizzled");
				return false;
			}

			if (useFire) {
				arrow.setFireTicks(300);
			}

			// Hackily make this an infinite arrow<commit_msg>Don't add fire to arrows by default.<commit_after>package com.elmakers.mine.bukkit.plugins.magic.spells;

import java.lang.reflect.Field;
import java.lang.reflect.Method;

import org.bukkit.Location;
import org.bukkit.entity.Arrow;
import org.bukkit.util.Vector;

import com.elmakers.mine.bukkit.plugins.magic.Spell;
import com.elmakers.mine.bukkit.utilities.borrowed.ConfigurationNode;

public class ArrowSpell extends Spell
{ 
	@Override
	public boolean onCast(ConfigurationNode parameters) 
	{
		int arrowCount = 1;
		arrowCount = parameters.getInt("count", arrowCount);
		boolean useFire = parameters.getBoolean("fire", false);

		Arrow firstArrow = null;
		float speed = 3;
		float spread = 0.1f;
		for (int ai = 0; ai < arrowCount; ai++)
		{
			Arrow arrow = null;
			if (firstArrow == null) {
				arrow = player.launchProjectile(Arrow.class);
				firstArrow = arrow;
			} else {
				Location location = firstArrow.getLocation();
				Vector velocity = firstArrow.getVelocity();
				location.setX(location.getX() + velocity.getX() * (1 + Math.random() * arrowCount));
				location.setY(location.getY() + velocity.getY() * (1 + Math.random() * arrowCount));
				location.setZ(location.getZ() + velocity.getZ() * (1 + Math.random() * arrowCount));
				arrow = player.getWorld().spawnArrow(location, velocity, speed, spread);
			}

			if (arrow == null)
			{
				sendMessage(player, "One of your arrows fizzled");
				return false;
			}

			if (useFire) {
				arrow.setFireTicks(300);
			}

			// Hackily make this an infinite arrow
{'fraction_non_alphanumeric': 0.13272010512483573, 'fraction_numerical': 0.007227332457293035, 'mean_word_length': 3.895498392282958, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1091362', 'n_tokens_mistral': 1134, 'n_tokens_neox': 987, 'n_words': 223}