Merge branch 'master' of ssh://184.154.0.242:7999/min/Mineplex

This commit is contained in:
Jonathan Williams 2015-01-23 23:33:39 -08:00
commit d6e8fdd2ed
7 changed files with 28 additions and 37 deletions

View File

@ -179,12 +179,6 @@ public class CompassAddon extends MiniPlugin
event.getDrops().remove(item);
}
@EventHandler
public void InventoryClick(InventoryClickEvent event)
{
//UtilInv.DisallowMovementOf(event, "Target Compass", Material.COMPASS, (byte)0, true);
}
@EventHandler
public void SpectatorTeleport(PlayerInteractEvent event)
{

View File

@ -153,7 +153,7 @@ public enum SpellType // ❤
10, // Cooldown change per level
5, // Item amount in loot
C.cGold + C.Bold + "Heals: " + C.Bold + C.cWhite + "Spell Level x 2",
C.cGold + C.Bold + "Heals: " + C.Bold + C.cWhite + "(Spell Level / 2) + 1.5",
"",
@ -689,7 +689,7 @@ public enum SpellType // ❤
+ _spellCooldown - _cooldownChangePerLevel)
* wizard.getCooldownModifier()));
* (this == SpellType.Heal ? 1 : wizard.getCooldownModifier())));
}
public ItemStack getSpellItem()

View File

@ -927,7 +927,7 @@ public class WizardBattles extends SoloGame
if (item.getType() == Material.BLAZE_ROD)
{
if (event.getClickedBlock() == null || !(event.getClickedBlock().getState() instanceof InventoryHolder))
if (event.getClickedBlock() == null)
{
onCastSpell(p, event.getClickedBlock());

View File

@ -6,7 +6,9 @@ import nautilus.game.arcade.game.Game.GameState;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.block.Action;
import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.inventory.InventoryHolder;
import org.bukkit.inventory.ItemStack;
import org.bukkit.plugin.java.JavaPlugin;
@ -35,7 +37,10 @@ public class WizardSpellMenu extends MiniPlugin
{
Player p = event.getPlayer();
if (event.getAction().name().contains("RIGHT") && p.getInventory().getHeldItemSlot() < 5)
if (event.getAction().name().contains("RIGHT")
&& p.getInventory().getHeldItemSlot() < 5
&& (event.getAction() != Action.RIGHT_CLICK_BLOCK || event.getClickedBlock().getState() instanceof InventoryHolder))
{
_wizardShop.attemptShopOpen(p);

View File

@ -3,14 +3,17 @@ package nautilus.game.arcade.game.games.wizards.spells;
import mineplex.minecraft.game.core.explosion.CustomExplosion;
import nautilus.game.arcade.game.games.wizards.Spell;
import nautilus.game.arcade.game.games.wizards.spellinterfaces.SpellClick;
import net.minecraft.server.v1_7_R4.EntityFireball;
import org.bukkit.Sound;
import org.bukkit.craftbukkit.v1_7_R4.entity.CraftFireball;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Player;
import org.bukkit.entity.Projectile;
import org.bukkit.event.EventHandler;
import org.bukkit.event.entity.ProjectileHitEvent;
import org.bukkit.metadata.FixedMetadataValue;
import org.bukkit.util.Vector;
public class SpellFireball extends Spell implements SpellClick
{
@ -24,15 +27,14 @@ public class SpellFireball extends Spell implements SpellClick
projectile.remove();
CustomExplosion explosion = new CustomExplosion(Wizards.getArcadeManager().GetDamage(), projectile.getLocation(),
((org.bukkit.entity.Fireball) projectile).getYield(), "Fireball");
projectile.getMetadata("FireballYield").get(0).asFloat(), "Fireball");
explosion.setPlayer((Player) projectile.getMetadata("FireballSpell").get(0).value(), true);
explosion.setDropItems(false);
explosion.explode();
((org.bukkit.entity.Fireball) projectile).setYield(0);
}
}
@ -41,14 +43,22 @@ public class SpellFireball extends Spell implements SpellClick
{
org.bukkit.entity.Fireball fireball = (org.bukkit.entity.Fireball) p.getWorld().spawnEntity(p.getEyeLocation(),
EntityType.FIREBALL);
fireball.setVelocity(p.getEyeLocation().getDirection());
Vector vector = p.getEyeLocation().getDirection();
// We can't call the bukkit methods because for some weird reason, it enforces a certain speed.
EntityFireball eFireball = ((CraftFireball) fireball).getHandle();
eFireball.dirX = vector.getX();
eFireball.dirY = vector.getY();
eFireball.dirZ = vector.getZ();
fireball.setBounce(false);
fireball.setDirection(fireball.getVelocity());
fireball.setShooter(p);
fireball.setYield((getSpellLevel(p) * 0.2F) + 0.8F);
fireball.setYield(0);
fireball.setMetadata("FireballSpell", new FixedMetadataValue(Wizards.getArcadeManager().GetPlugin(), p));
fireball.setMetadata("FireballYield", new FixedMetadataValue(Wizards.getArcadeManager().GetPlugin(),
(getSpellLevel(p) * 0.2F) + 0.8F));
p.getWorld().playSound(p.getLocation(), Sound.BLAZE_BREATH, 0.5F, 5F);
charge(p);
}

View File

@ -28,7 +28,7 @@ public class SpellHeal extends Spell implements SpellClick, SpellClickEntity
if (entity.getHealth() < entity.getMaxHealth())
{
double health = entity.getHealth() + (4 * getSpellLevel(p));
double health = entity.getHealth() + (3 + getSpellLevel(p));
if (health > entity.getMaxHealth())
health = entity.getMaxHealth();

View File

@ -1,18 +0,0 @@
package nautilus.game.arcade.game.games.wizards.spells;
import nautilus.game.arcade.game.games.wizards.Spell;
import nautilus.game.arcade.game.games.wizards.spellinterfaces.SpellClick;
import org.bukkit.entity.Player;
public class SpellTunnel extends Spell implements SpellClick
{
@Override
public void castSpell(Player player)
{
// TODO Auto-generated method stub
}
}