diff options
author | GunfighterJ <joseph.jenniges@gmail.com> | 2013-01-09 10:12:04 -0600 |
---|---|---|
committer | Chris Ward <chris@chrisgward.com> | 2013-01-10 03:25:57 +1100 |
commit | b04fa82be251608f829ff55e46d917b39a3fe7f3 (patch) | |
tree | 1700d823f81a732f371a146856f2c27c6b9d0e9f | |
parent | 5d210d81dcdb4280876d17df66bc00305a23eebd (diff) | |
download | Essentials-b04fa82be251608f829ff55e46d917b39a3fe7f3.tar Essentials-b04fa82be251608f829ff55e46d917b39a3fe7f3.tar.gz Essentials-b04fa82be251608f829ff55e46d917b39a3fe7f3.tar.lz Essentials-b04fa82be251608f829ff55e46d917b39a3fe7f3.tar.xz Essentials-b04fa82be251608f829ff55e46d917b39a3fe7f3.zip |
Add more items to Fireball command. Add delay option to /spawner
-rw-r--r-- | Essentials/src/com/earth2me/essentials/commands/Commandfireball.java | 12 | ||||
-rw-r--r-- | Essentials/src/com/earth2me/essentials/commands/Commandspawner.java | 12 |
2 files changed, 23 insertions, 1 deletions
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandfireball.java b/Essentials/src/com/earth2me/essentials/commands/Commandfireball.java index 1b7905ac3..f1aae3ca7 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandfireball.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandfireball.java @@ -38,6 +38,18 @@ public class Commandfireball extends EssentialsCommand { type = Egg.class; } + else if(args[0].equalsIgnoreCase("snowball")) + { + type = Snowball.class; + } + else if(args[0].equalsIgnoreCase("expbottle")) + { + type = ThrownExpBottle.class; + } + else if(args[0].equalsIgnoreCase("large")) + { + type = LargeFireball.class; + } } final Vector direction = user.getEyeLocation().getDirection().multiply(speed); projectile = (Projectile)user.getWorld().spawn(user.getEyeLocation().add(direction.getX(), direction.getY(), direction.getZ()), type); diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandspawner.java b/Essentials/src/com/earth2me/essentials/commands/Commandspawner.java index 351b6a8b4..035adabae 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandspawner.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandspawner.java @@ -6,6 +6,7 @@ import com.earth2me.essentials.Trade; import com.earth2me.essentials.User; import com.earth2me.essentials.Util; import java.util.Locale; +import org.bukkit.Bukkit; import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.Server; @@ -34,6 +35,7 @@ public class Commandspawner extends EssentialsCommand } String name = args[0]; + Integer delay = 0; Mob mob = null; mob = Mob.fromName(name); @@ -49,11 +51,19 @@ public class Commandspawner extends EssentialsCommand { throw new Exception(_("noPermToSpawnMob")); } + if(args.length > 1) + { + if(Util.isInt(args[1])){ + delay = Integer.parseInt(args[1]); + } + } final Trade charge = new Trade("spawner-" + mob.name.toLowerCase(Locale.ENGLISH), ess); charge.isAffordableFor(user); try { - ((CreatureSpawner)target.getBlock().getState()).setSpawnedType(mob.getType()); + CreatureSpawner spawner = (CreatureSpawner)target.getBlock().getState(); + spawner.setSpawnedType(mob.getType()); + spawner.setDelay(delay); } catch (Throwable ex) { |