Merge branch 'Myst_HALLOWEEN'
This commit is contained in:
commit
21dc0dc962
@ -3,17 +3,6 @@ package mineplex.core.mount;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.Horse;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.entity.ItemSpawnEvent;
|
||||
import org.bukkit.event.entity.PlayerDeathEvent;
|
||||
import org.bukkit.event.player.PlayerInteractEntityEvent;
|
||||
import org.bukkit.event.player.PlayerQuitEvent;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
import mineplex.core.MiniPlugin;
|
||||
import mineplex.core.account.CoreClientManager;
|
||||
import mineplex.core.blockrestore.BlockRestore;
|
||||
@ -23,7 +12,23 @@ import mineplex.core.common.util.UtilPlayer;
|
||||
import mineplex.core.common.util.UtilServer;
|
||||
import mineplex.core.disguise.DisguiseManager;
|
||||
import mineplex.core.donation.DonationManager;
|
||||
import mineplex.core.mount.types.*;
|
||||
import mineplex.core.mount.types.MountCart;
|
||||
import mineplex.core.mount.types.MountDragon;
|
||||
import mineplex.core.mount.types.MountFrost;
|
||||
import mineplex.core.mount.types.MountMule;
|
||||
import mineplex.core.mount.types.MountSlime;
|
||||
import mineplex.core.mount.types.MountSpider;
|
||||
import mineplex.core.mount.types.MountUndead;
|
||||
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.Horse;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.entity.ItemSpawnEvent;
|
||||
import org.bukkit.event.entity.PlayerDeathEvent;
|
||||
import org.bukkit.event.player.PlayerInteractEntityEvent;
|
||||
import org.bukkit.event.player.PlayerQuitEvent;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
public class MountManager extends MiniPlugin
|
||||
{
|
||||
@ -57,6 +62,7 @@ public class MountManager extends MiniPlugin
|
||||
_types.add(new MountDragon(this));
|
||||
_types.add(new MountSlime(this));
|
||||
_types.add(new MountCart(this));
|
||||
_types.add(new MountSpider(this));
|
||||
_types.add(new MountUndead(this));
|
||||
//_types.add(new MountSheep(this));
|
||||
}
|
||||
|
@ -0,0 +1,248 @@
|
||||
package mineplex.core.mount.types;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Set;
|
||||
|
||||
import mineplex.core.common.util.C;
|
||||
import mineplex.core.common.util.F;
|
||||
import mineplex.core.common.util.UtilAction;
|
||||
import mineplex.core.common.util.UtilBlock;
|
||||
import mineplex.core.common.util.UtilEnt;
|
||||
import mineplex.core.common.util.UtilMath;
|
||||
import mineplex.core.common.util.UtilPlayer;
|
||||
import mineplex.core.disguise.disguises.DisguiseBase;
|
||||
import mineplex.core.disguise.disguises.DisguiseBat;
|
||||
import mineplex.core.disguise.disguises.DisguiseChicken;
|
||||
import mineplex.core.disguise.disguises.DisguiseEnderman;
|
||||
import mineplex.core.disguise.disguises.DisguiseSpider;
|
||||
import mineplex.core.disguise.disguises.DisguiseWither;
|
||||
import mineplex.core.mount.HorseMount;
|
||||
import mineplex.core.mount.MountManager;
|
||||
import mineplex.core.recharge.Recharge;
|
||||
import mineplex.core.updater.UpdateType;
|
||||
import mineplex.core.updater.event.UpdateEvent;
|
||||
import net.minecraft.server.v1_7_R4.EntityLiving;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.GameMode;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.Sound;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.craftbukkit.v1_7_R4.entity.CraftPlayer;
|
||||
import org.bukkit.entity.Horse;
|
||||
import org.bukkit.entity.Horse.Color;
|
||||
import org.bukkit.entity.Horse.Style;
|
||||
import org.bukkit.entity.Horse.Variant;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.player.PlayerToggleFlightEvent;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
public class MountSpider extends HorseMount
|
||||
{
|
||||
/**
|
||||
* @author Mysticate
|
||||
*/
|
||||
|
||||
public MountSpider(MountManager manager)
|
||||
{
|
||||
super(manager, "Spider Mount", new String[]
|
||||
{
|
||||
C.cWhite + "Why ride a horse when you can",
|
||||
C.cWhite + "ride a cute and cuddly spider!",
|
||||
C.cBlack,
|
||||
C.cYellow + "Look Up" + C.cGray + " to use " + C.cGreen + "Wall Climb",
|
||||
C.cYellow + "Jump" + C.cGray + " to use " + C.cGreen + "Jump",
|
||||
C.cYellow + "Double Jump" + C.cGray + " to use " + C.cGreen + "Leap",
|
||||
C.cBlack,
|
||||
C.cPurple + "Only available during " + C.Line + "Halloween 2015",
|
||||
C.cPurple + "Purchase at " + C.Line + "www.mineplex.com/shop"
|
||||
}, Material.WEB, (byte) 0, -1, Color.BLACK, Style.NONE, Variant.HORSE, 2.0, Material.AIR);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void EnableCustom(Player player)
|
||||
{
|
||||
player.leaveVehicle();
|
||||
player.eject();
|
||||
|
||||
//Remove other mounts
|
||||
Manager.DeregisterAll(player);
|
||||
|
||||
Horse horse = player.getWorld().spawn(player.getLocation(), Horse.class);
|
||||
horse.setAdult();
|
||||
horse.setAgeLock(true);
|
||||
horse.setColor(_color);
|
||||
horse.setStyle(_style);
|
||||
horse.setVariant(_variant);
|
||||
horse.setOwner(player);
|
||||
horse.setMaxDomestication(1);
|
||||
horse.setJumpStrength(_jump);
|
||||
horse.getInventory().setSaddle(new ItemStack(Material.SADDLE));
|
||||
|
||||
if (horse.getVariant() == Variant.MULE)
|
||||
horse.setCarryingChest(true);
|
||||
|
||||
if (_armor != null)
|
||||
horse.getInventory().setArmor(new ItemStack(_armor));
|
||||
|
||||
horse.setCustomName(player.getName() + "'s " + GetName());
|
||||
|
||||
//Inform
|
||||
UtilPlayer.message(player, F.main("Mount", "You spawned " + F.elem(GetName()) + "."));
|
||||
|
||||
//Store
|
||||
_active.put(player, horse);
|
||||
|
||||
DisguiseSpider spider = new DisguiseSpider(horse);
|
||||
spider.setName(player.getName() + "'s Spider Mount");
|
||||
Manager.getDisguiseManager().disguise(spider);
|
||||
|
||||
UtilEnt.silence(horse, true);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void sounds(UpdateEvent event)
|
||||
{
|
||||
if (event.getType() != UpdateType.FASTEST)
|
||||
return;
|
||||
|
||||
ArrayList<Horse> used = new ArrayList<Horse>();
|
||||
for (Player player : GetActive().keySet())
|
||||
{
|
||||
Horse horse = GetActive().get(player);
|
||||
|
||||
used.add(horse);
|
||||
|
||||
if (!Recharge.Instance.use(player, "Spider Mount Sounds", (1000 * UtilMath.r(3)) + 500, false, false))
|
||||
continue;
|
||||
|
||||
//Moving
|
||||
if (horse.getVelocity().length() != 0 && UtilEnt.isGrounded(horse))
|
||||
{
|
||||
horse.getWorld().playSound(horse.getLocation(), Sound.SPIDER_WALK, .4F, 1.0F);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void wallClimb(UpdateEvent event)
|
||||
{
|
||||
if (event.getType() != UpdateType.TICK)
|
||||
return;
|
||||
|
||||
for (Entry<Player, Horse> horse : GetActive().entrySet())
|
||||
{
|
||||
//If player is looking up
|
||||
if (horse.getKey().getEyeLocation().getPitch() > -45)
|
||||
continue;
|
||||
|
||||
for (Block block : UtilBlock.getSurrounding(horse.getValue().getLocation().getBlock(), true))
|
||||
{
|
||||
if (UtilBlock.airFoliage(block) || block.isLiquid())
|
||||
continue;
|
||||
|
||||
UtilAction.velocity(horse.getValue(), new Vector(horse.getValue().getVelocity().getX(), 0.2, horse.getValue().getVelocity().getZ()));
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private Set<Horse> _jumpCancel = new HashSet<Horse>();
|
||||
|
||||
@EventHandler(priority = EventPriority.LOW)
|
||||
public void doubleJump(PlayerToggleFlightEvent event)
|
||||
{
|
||||
Player player = event.getPlayer();
|
||||
|
||||
if (player.getGameMode() == GameMode.CREATIVE)
|
||||
return;
|
||||
|
||||
if (!GetActive().containsKey(player))
|
||||
return;
|
||||
|
||||
if (GetActive().get(player).getPassenger() != event.getPlayer())
|
||||
return;
|
||||
|
||||
//Chicken Cancel
|
||||
DisguiseBase disguise = Manager.getDisguiseManager().getDisguise(player);
|
||||
if (disguise != null && ((disguise instanceof DisguiseChicken && !((DisguiseChicken)disguise).isBaby()) || disguise instanceof DisguiseBat || disguise instanceof DisguiseEnderman || disguise instanceof DisguiseWither))
|
||||
return;
|
||||
|
||||
Horse horse = GetActive().get(event.getPlayer());
|
||||
|
||||
if (!UtilEnt.isGrounded(horse))
|
||||
return;
|
||||
|
||||
_jumpCancel.remove(horse);
|
||||
|
||||
event.setCancelled(true);
|
||||
player.setFlying(false);
|
||||
|
||||
//Disable Flight
|
||||
player.setAllowFlight(false);
|
||||
|
||||
//Velocity
|
||||
UtilAction.velocity(horse, 1.4, 0.38, 1, true);
|
||||
|
||||
//Sound
|
||||
player.playSound(horse.getLocation(), Sound.SPIDER_IDLE, .4F, 1.0F);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void jump(UpdateEvent event)
|
||||
{
|
||||
for (Player player : GetActive().keySet())
|
||||
{
|
||||
final Horse horse = GetActive().get(player);
|
||||
|
||||
if (!UtilEnt.isGrounded(horse))
|
||||
continue;
|
||||
|
||||
try
|
||||
{
|
||||
Field jump = EntityLiving.class.getDeclaredField("bc");
|
||||
final boolean accessable = jump.isAccessible();
|
||||
|
||||
jump.setAccessible(true);
|
||||
boolean isJumping = jump.getBoolean(((CraftPlayer) player).getHandle());
|
||||
|
||||
jump.setAccessible(accessable);
|
||||
|
||||
if (!isJumping)
|
||||
continue;
|
||||
|
||||
if (!Recharge.Instance.use(player, "Spider Mount Jump", 100, false, false))
|
||||
continue;
|
||||
|
||||
//Not jumping anymore
|
||||
((CraftPlayer) player).getHandle().f(false);
|
||||
|
||||
_jumpCancel.add(horse);
|
||||
|
||||
//Prevent jump effect when the mount double jumps
|
||||
Bukkit.getScheduler().scheduleSyncDelayedTask(Manager.getPlugin(), new Runnable()
|
||||
{
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
if (!_jumpCancel.contains(horse))
|
||||
return;
|
||||
|
||||
_jumpCancel.remove(horse);
|
||||
UtilAction.velocity(horse, new Vector(horse.getVelocity().getX(), 0.5, horse.getVelocity().getZ()));
|
||||
}
|
||||
}, 5);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
ex.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -64,7 +64,7 @@ public class ServerGameMenu extends ShopPageBase<ServerManager, QuickShop>
|
||||
ChatColor.RESET + "Join " + ChatColor.GREEN + getPlugin().getGroupTagPlayerCount("BR") + ChatColor.RESET + " other players!",
|
||||
}));
|
||||
|
||||
setItem(2, ItemStackFactory.Instance.CreateStack(Material.IRON_SWORD.getId(), (byte)0, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Survival Games " + C.cGray + "Solo/Team Survival", new String[]
|
||||
setItem(2, ItemStackFactory.Instance.CreateStack(Material.DIAMOND_SWORD.getId(), (byte)0, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Survival Games " + C.cGray + "Solo/Team Survival", new String[]
|
||||
{
|
||||
ChatColor.RESET + "",
|
||||
ChatColor.RESET + "Search for chests to find loot and ",
|
||||
|
@ -403,7 +403,7 @@ public class SkillPage extends ShopPageBase<ClassShopManager, ClassCombatShop>
|
||||
|
||||
private boolean isSkillLocked(ISkill skill)
|
||||
{
|
||||
if (skill.IsFree() || getClientManager().Get(getPlayer().getName()).GetRank().has(Rank.ULTRA) || getDonationManager().Get(getPlayer().getName()).OwnsUnknownPackage("Champions ULTRA") || getDonationManager().Get(getPlayer().getName()).OwnsUnknownPackage("Champions " + skill.GetName()))
|
||||
if (skill.IsFree() || getDonationManager().Get(getPlayer().getName()).OwnsUnknownPackage("Champions " + skill.GetName()))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
@ -411,7 +411,7 @@ public class SkillPage extends ShopPageBase<ClassShopManager, ClassCombatShop>
|
||||
|
||||
private boolean isItemLocked(Item item)
|
||||
{
|
||||
if (item.isFree() || getClientManager().Get(getPlayer().getName()).GetRank().has(Rank.ULTRA) || getDonationManager().Get(getPlayer().getName()).OwnsUnknownPackage("Champions ULTRA") || getDonationManager().Get(getPlayer().getName()).OwnsUnknownPackage("Champions " + item.GetName()))
|
||||
if (item.isFree() || getDonationManager().Get(getPlayer().getName()).OwnsUnknownPackage("Champions " + item.GetName()))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
|
@ -4,7 +4,42 @@ import java.util.AbstractMap;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import mineplex.core.common.util.C;
|
||||
import mineplex.core.common.util.F;
|
||||
import mineplex.core.common.util.NautHashMap;
|
||||
import mineplex.core.common.util.UtilAction;
|
||||
import mineplex.core.common.util.UtilAlg;
|
||||
import mineplex.core.common.util.UtilEvent;
|
||||
import mineplex.core.common.util.UtilEvent.ActionType;
|
||||
import mineplex.core.common.util.UtilGear;
|
||||
import mineplex.core.common.util.UtilInv;
|
||||
import mineplex.core.common.util.UtilMath;
|
||||
import mineplex.core.common.util.UtilParticle;
|
||||
import mineplex.core.common.util.UtilParticle.ParticleType;
|
||||
import mineplex.core.common.util.UtilParticle.ViewDist;
|
||||
import mineplex.core.common.util.UtilPlayer;
|
||||
import mineplex.core.common.util.UtilServer;
|
||||
import mineplex.core.common.util.UtilTextBottom;
|
||||
import mineplex.core.common.util.UtilTextMiddle;
|
||||
import mineplex.core.common.util.UtilTime;
|
||||
import mineplex.core.explosion.ExplosionEvent;
|
||||
import mineplex.core.itemstack.ItemStackFactory;
|
||||
import mineplex.core.recharge.Recharge;
|
||||
import mineplex.core.updater.UpdateType;
|
||||
import mineplex.core.updater.event.UpdateEvent;
|
||||
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
|
||||
import nautilus.game.arcade.ArcadeManager;
|
||||
import nautilus.game.arcade.GameType;
|
||||
import nautilus.game.arcade.events.GameStateChangeEvent;
|
||||
import nautilus.game.arcade.events.PlayerPrepareTeleportEvent;
|
||||
import nautilus.game.arcade.game.SoloGame;
|
||||
import nautilus.game.arcade.game.games.build.gui.MobShop;
|
||||
import nautilus.game.arcade.game.games.build.gui.OptionsShop;
|
||||
import nautilus.game.arcade.game.games.build.kits.KitBuilder;
|
||||
import nautilus.game.arcade.kit.Kit;
|
||||
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Effect;
|
||||
import org.bukkit.GameMode;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
@ -13,6 +48,7 @@ import org.bukkit.block.Block;
|
||||
import org.bukkit.entity.Boat;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.EntityType;
|
||||
import org.bukkit.entity.FallingBlock;
|
||||
import org.bukkit.entity.Hanging;
|
||||
import org.bukkit.entity.Item;
|
||||
import org.bukkit.entity.ItemFrame;
|
||||
@ -41,6 +77,7 @@ import org.bukkit.event.block.BlockPistonRetractEvent;
|
||||
import org.bukkit.event.block.BlockPlaceEvent;
|
||||
import org.bukkit.event.entity.CreatureSpawnEvent;
|
||||
import org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason;
|
||||
import org.bukkit.event.entity.EntityChangeBlockEvent;
|
||||
import org.bukkit.event.entity.EntityCombustEvent;
|
||||
import org.bukkit.event.entity.EntityDamageByEntityEvent;
|
||||
import org.bukkit.event.entity.EntityDamageEvent;
|
||||
@ -63,42 +100,6 @@ import org.bukkit.event.vehicle.VehicleCreateEvent;
|
||||
import org.bukkit.event.vehicle.VehicleDamageEvent;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
import mineplex.core.common.Rank;
|
||||
import mineplex.core.common.util.C;
|
||||
import mineplex.core.common.util.F;
|
||||
import mineplex.core.common.util.NautHashMap;
|
||||
import mineplex.core.common.util.UtilAction;
|
||||
import mineplex.core.common.util.UtilAlg;
|
||||
import mineplex.core.common.util.UtilEvent;
|
||||
import mineplex.core.common.util.UtilEvent.ActionType;
|
||||
import mineplex.core.common.util.UtilParticle.ParticleType;
|
||||
import mineplex.core.common.util.UtilParticle.ViewDist;
|
||||
import mineplex.core.common.util.UtilGear;
|
||||
import mineplex.core.common.util.UtilInv;
|
||||
import mineplex.core.common.util.UtilMath;
|
||||
import mineplex.core.common.util.UtilParticle;
|
||||
import mineplex.core.common.util.UtilPlayer;
|
||||
import mineplex.core.common.util.UtilServer;
|
||||
import mineplex.core.common.util.UtilTextBottom;
|
||||
import mineplex.core.common.util.UtilTime;
|
||||
import mineplex.core.common.util.UtilTextMiddle;
|
||||
import mineplex.core.explosion.ExplosionEvent;
|
||||
import mineplex.core.itemstack.ItemStackFactory;
|
||||
import mineplex.core.recharge.Recharge;
|
||||
import mineplex.core.updater.UpdateType;
|
||||
import mineplex.core.updater.event.UpdateEvent;
|
||||
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
|
||||
import nautilus.game.arcade.ArcadeManager;
|
||||
import nautilus.game.arcade.GameType;
|
||||
import nautilus.game.arcade.events.GameStateChangeEvent;
|
||||
import nautilus.game.arcade.events.PlayerPrepareTeleportEvent;
|
||||
import nautilus.game.arcade.game.SoloGame;
|
||||
import nautilus.game.arcade.game.Game.GameState;
|
||||
import nautilus.game.arcade.game.games.build.gui.MobShop;
|
||||
import nautilus.game.arcade.game.games.build.gui.OptionsShop;
|
||||
import nautilus.game.arcade.game.games.build.kits.KitBuilder;
|
||||
import nautilus.game.arcade.kit.Kit;
|
||||
|
||||
public class Build extends SoloGame
|
||||
{
|
||||
private NautHashMap<Player, BuildData> _data = new NautHashMap<Player, BuildData>();
|
||||
@ -932,6 +933,30 @@ public class Build extends SoloGame
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void blockForm(EntityChangeBlockEvent event)
|
||||
{
|
||||
if (!(event.getEntity() instanceof FallingBlock))
|
||||
return;
|
||||
|
||||
if (!event.getBlock().isLiquid())
|
||||
return;
|
||||
|
||||
for (BuildData data : _data.values())
|
||||
{
|
||||
if (!data.inBuildArea(event.getBlock()))
|
||||
{
|
||||
event.setCancelled(true);
|
||||
|
||||
event.getEntity().remove();
|
||||
|
||||
//Effect
|
||||
event.getBlock().getWorld().playEffect(event.getBlock().getLocation(), Effect.STEP_SOUND, ((FallingBlock) event.getEntity()).getBlockId());
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void entityCombust(EntityCombustEvent event)
|
||||
|
@ -308,6 +308,17 @@ public class BuildData
|
||||
if (mat == Material.LAVA_BUCKET) mat = Material.LAVA;
|
||||
else if (mat == Material.WATER_BUCKET) mat = Material.WATER;
|
||||
|
||||
//Set everything to air first to prevent the forming of obby.
|
||||
if (mat == Material.LAVA || mat == Material.WATER)
|
||||
{
|
||||
int y = Math.min(CornerA.getBlockY(), CornerB.getBlockY()) - 1;
|
||||
for (int x= Math.min(CornerA.getBlockX(), CornerB.getBlockX()) ; x <= Math.max(CornerA.getBlockX(), CornerB.getBlockX()) ; x++)
|
||||
for (int z= Math.min(CornerA.getBlockZ(), CornerB.getBlockZ()) ; z <= Math.max(CornerA.getBlockZ(), CornerB.getBlockZ()) ; z++)
|
||||
{
|
||||
MapUtil.QuickChangeBlockAt(Player.getWorld(), x, y, z, Material.AIR, data);
|
||||
}
|
||||
}
|
||||
|
||||
int y = Math.min(CornerA.getBlockY(), CornerB.getBlockY()) - 1;
|
||||
for (int x= Math.min(CornerA.getBlockX(), CornerB.getBlockX()) ; x <= Math.max(CornerA.getBlockX(), CornerB.getBlockX()) ; x++)
|
||||
for (int z= Math.min(CornerA.getBlockZ(), CornerB.getBlockZ()) ; z <= Math.max(CornerA.getBlockZ(), CornerB.getBlockZ()) ; z++)
|
||||
|
@ -32,7 +32,7 @@ public class GroundPage extends ShopPageBase<ArcadeManager, OptionsShop>
|
||||
new GroundData(Material.STAINED_CLAY, (byte) 0), new GroundData(Material.STAINED_CLAY, (byte) 15),
|
||||
new GroundData(Material.STAINED_CLAY, (byte) 4), new GroundData(Material.STAINED_CLAY, (byte) 3),
|
||||
new GroundData(Material.STAINED_CLAY, (byte) 5), new GroundData(Material.STAINED_CLAY, (byte) 6),
|
||||
new GroundData(Material.QUARTZ_BLOCK), new GroundData(Material.ICE), new GroundData(Material.IRON_BLOCK),
|
||||
new GroundData(Material.QUARTZ_BLOCK), new GroundData(Material.PACKED_ICE), new GroundData(Material.IRON_BLOCK),
|
||||
new GroundData(Material.GOLD_BLOCK), new GroundData(Material.DIAMOND_BLOCK)};
|
||||
|
||||
private Build _game;
|
||||
|
@ -401,12 +401,20 @@ public class Halloween extends SoloGame
|
||||
{
|
||||
for (Player player : GetPlayers(false))
|
||||
{
|
||||
Manager.GetDonation().PurchaseUnknownSalesPackage(null, player.getName(), Manager.GetClients().Get(player).getAccountId(), "Decrepit Warhorse", false, 0, true);
|
||||
Manager.GetGame().AddGems(player, 30, "Killing the Pumpkin King", false, false);
|
||||
Manager.GetGame().AddGems(player, 10, "Participation", false, false);
|
||||
}
|
||||
|
||||
SetCustomWinLine("You earned Decrepit Warhorse Mount!");
|
||||
if (Manager.IsRewardItems())
|
||||
{
|
||||
SetCustomWinLine("You earned the Decrepit Warhorse Mount!");
|
||||
|
||||
for (Player player : GetPlayers(false))
|
||||
{
|
||||
Manager.GetDonation().PurchaseUnknownSalesPackage(null, player.getName(), Manager.GetClients().Get(player).getAccountId(), "Decrepit Warhorse", false, 0, true);
|
||||
}
|
||||
}
|
||||
|
||||
AnnounceEnd(this.GetTeamList().get(0));
|
||||
|
||||
SetState(GameState.End);
|
||||
|
@ -84,7 +84,8 @@ public class BlockForm extends Form
|
||||
// Player > Chicken
|
||||
DisguiseChicken disguise = new DisguiseChicken(Player);
|
||||
disguise.setBaby();
|
||||
disguise.setInvisible(true);
|
||||
|
||||
// disguise.setInvisible(true);
|
||||
disguise.setSoundDisguise(new DisguiseCat(Player));
|
||||
Host.Manager.GetDisguise().disguise(disguise);
|
||||
|
||||
|
@ -4,7 +4,9 @@ import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
import mineplex.core.common.util.C;
|
||||
import mineplex.core.common.util.F;
|
||||
import mineplex.core.common.util.UtilEvent;
|
||||
import mineplex.core.common.util.UtilPlayer;
|
||||
import mineplex.core.common.util.UtilEvent.ActionType;
|
||||
import mineplex.core.common.util.UtilInv;
|
||||
import nautilus.game.arcade.game.games.lobbers.events.TNTThrowEvent;
|
||||
@ -68,6 +70,12 @@ public class PerkWaller extends Perk
|
||||
if (!UtilInv.IsItem(event.getItem(), Material.STONE_SPADE, (byte) 0))
|
||||
return;
|
||||
|
||||
if (event.getClickedBlock().isLiquid())
|
||||
{
|
||||
UtilPlayer.message(event.getPlayer(), F.main("Game", "You may not place a wall in a liquid!"));
|
||||
return;
|
||||
}
|
||||
|
||||
UtilInv.remove(event.getPlayer(), Material.STONE_SPADE, (byte) 0, 1);
|
||||
|
||||
_wallBlocks.addAll(buildWall(event.getClickedBlock().getLocation(), event.getPlayer().getLocation().getYaw()));
|
||||
|
@ -107,6 +107,9 @@ public abstract class StrikeItem
|
||||
|
||||
if (this instanceof Gun)
|
||||
{
|
||||
//Fixes it so it stops reloading when dropped. Allows other players to reload when it's dropped if its ammo is 0.
|
||||
((Gun) this).forceCancelReload(player);
|
||||
|
||||
game.deregisterGun((Gun)this);
|
||||
|
||||
if (!onlyDeregisterAndRemove)
|
||||
|
@ -17,6 +17,7 @@ import mineplex.core.common.util.C;
|
||||
import mineplex.core.common.util.F;
|
||||
import mineplex.core.common.util.UtilAction;
|
||||
import mineplex.core.common.util.UtilEnt;
|
||||
import mineplex.core.common.util.UtilInv;
|
||||
import mineplex.core.common.util.UtilPlayer;
|
||||
import nautilus.game.arcade.game.games.minestrike.MineStrike;
|
||||
import nautilus.game.arcade.game.games.minestrike.items.StrikeItem;
|
||||
@ -82,52 +83,47 @@ public abstract class Grenade extends StrikeItem
|
||||
}
|
||||
|
||||
public boolean giveToPlayer(Player player, boolean setOwnerName)
|
||||
{
|
||||
int slot = 3;
|
||||
|
||||
{
|
||||
int alreadyHas = 0;
|
||||
int bestSlot = -1;
|
||||
|
||||
while (player.getInventory().getItem(slot) != null && player.getInventory().getItem(slot).getType() != Material.AIR && slot <= 6)
|
||||
for (int i = 3 ; i < 7 ; i++)
|
||||
{
|
||||
if (player.getInventory().getItem(slot).getType() == getSkin())
|
||||
{
|
||||
if (UtilInv.IsItem(player.getInventory().getItem(i), getSkin(), (byte) -1))
|
||||
alreadyHas++;
|
||||
|
||||
if (alreadyHas >= _limit)
|
||||
return false;
|
||||
}
|
||||
|
||||
slot++;
|
||||
if (alreadyHas >= _limit)
|
||||
return false;
|
||||
|
||||
if ((player.getInventory().getItem(i) == null || isStack(player.getInventory().getItem(i))) && bestSlot == -1)
|
||||
bestSlot = i;
|
||||
}
|
||||
|
||||
if (slot > 6)
|
||||
if (bestSlot == -1 || bestSlot > 6)
|
||||
return false;
|
||||
|
||||
giveToPlayer(player, slot, setOwnerName);
|
||||
|
||||
giveToPlayer(player, bestSlot, setOwnerName);
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean canGiveToPlayer(Player player)
|
||||
{
|
||||
int slot = 3;
|
||||
|
||||
{
|
||||
int alreadyHas = 0;
|
||||
int bestSlot = -1;
|
||||
|
||||
while (player.getInventory().getItem(slot) != null && player.getInventory().getItem(slot).getType() != Material.AIR && slot <= 6)
|
||||
for (int i = 3 ; i < 7 ; i++)
|
||||
{
|
||||
if (player.getInventory().getItem(slot).getType() == getSkin())
|
||||
{
|
||||
if (UtilInv.IsItem(player.getInventory().getItem(i), getSkin(), (byte) -1))
|
||||
alreadyHas++;
|
||||
|
||||
if (alreadyHas >= _limit)
|
||||
return false;
|
||||
}
|
||||
|
||||
slot++;
|
||||
if (alreadyHas >= _limit)
|
||||
return false;
|
||||
|
||||
if ((player.getInventory().getItem(i) == null || isStack(player.getInventory().getItem(i))) && bestSlot == -1)
|
||||
bestSlot = i;
|
||||
}
|
||||
|
||||
if (slot > 6)
|
||||
if (bestSlot == -1 || bestSlot > 6)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
|
@ -269,6 +269,12 @@ public class Gun extends StrikeItem
|
||||
|
||||
_reloading = true;
|
||||
}
|
||||
|
||||
public void forceCancelReload(Player player)
|
||||
{
|
||||
_reloading = false;
|
||||
Recharge.Instance.recharge(player, getName() + " Reload");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fixStackName()
|
||||
|
@ -274,6 +274,9 @@ public class Paintball extends TeamGame
|
||||
PlayerOut(damagee);
|
||||
|
||||
AddGems(damager, 2, "Kills", true, true);
|
||||
|
||||
AddStat(damager, "Kills", 1, false, false);
|
||||
AddStat(damagee, "Deaths", 1, false, false);
|
||||
}
|
||||
|
||||
//Hit Sound
|
||||
|
@ -1256,7 +1256,7 @@ public abstract class Skywars extends Game
|
||||
|
||||
Player shooter = (Player)event.getEntity().getShooter();
|
||||
|
||||
if (GetKit(shooter) instanceof KitDestructor)
|
||||
if (event.getEntity().hasMetadata("Destructor"))
|
||||
return;
|
||||
|
||||
event.getEntity().setPassenger(shooter);
|
||||
|
@ -1,10 +1,12 @@
|
||||
package nautilus.game.arcade.game.games.wizards.spells;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import mineplex.core.common.util.UtilPlayer;
|
||||
import mineplex.minecraft.game.core.damage.DamageChange;
|
||||
import nautilus.game.arcade.game.games.wizards.Spell;
|
||||
import nautilus.game.arcade.game.games.wizards.spellinterfaces.SpellClick;
|
||||
|
||||
@ -57,6 +59,8 @@ public class SpellGust extends Spell implements SpellClick
|
||||
|
||||
Wizards.getArcadeManager().GetCondition().Factory().Falling("Gust", target, player, 40, false, true);
|
||||
|
||||
Wizards.Manager.GetDamage().GetCombatManager().Get(target).Attacked(player.getName(), 0, player, "Gust", new ArrayList<DamageChange>());
|
||||
|
||||
target.setVelocity(vec);
|
||||
|
||||
target.getWorld().playSound(target.getLocation(), Sound.BAT_TAKEOFF, 1, 0.7F);
|
||||
|
@ -1,26 +1,44 @@
|
||||
package nautilus.game.arcade.kit.perks;
|
||||
|
||||
import mineplex.core.common.util.*;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
|
||||
import mineplex.core.common.util.C;
|
||||
import mineplex.core.common.util.F;
|
||||
import mineplex.core.common.util.UtilBlock;
|
||||
import mineplex.core.common.util.UtilEvent;
|
||||
import mineplex.core.common.util.UtilEvent.ActionType;
|
||||
import mineplex.core.common.util.UtilInv;
|
||||
import mineplex.core.common.util.UtilParticle;
|
||||
import mineplex.core.common.util.UtilParticle.ParticleType;
|
||||
import mineplex.core.common.util.UtilParticle.ViewDist;
|
||||
import mineplex.core.itemstack.*;
|
||||
import mineplex.core.recharge.*;
|
||||
import mineplex.core.updater.*;
|
||||
import mineplex.core.updater.event.*;
|
||||
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
|
||||
import nautilus.game.arcade.kit.*;
|
||||
import mineplex.core.common.util.UtilPlayer;
|
||||
import mineplex.core.common.util.UtilServer;
|
||||
import mineplex.core.common.util.UtilTime;
|
||||
import mineplex.core.itemstack.ItemStackFactory;
|
||||
import mineplex.core.recharge.Recharge;
|
||||
import mineplex.core.updater.UpdateType;
|
||||
import mineplex.core.updater.event.UpdateEvent;
|
||||
import nautilus.game.arcade.kit.Perk;
|
||||
import nautilus.game.arcade.kit.perks.event.PerkDestructorBlockEvent;
|
||||
|
||||
import org.bukkit.*;
|
||||
import org.bukkit.block.*;
|
||||
import org.bukkit.entity.*;
|
||||
import org.bukkit.event.*;
|
||||
import org.bukkit.event.entity.*;
|
||||
import org.bukkit.event.inventory.*;
|
||||
import org.bukkit.event.player.*;
|
||||
import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause;
|
||||
|
||||
import java.util.*;
|
||||
import org.bukkit.Effect;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.Sound;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.block.BlockFace;
|
||||
import org.bukkit.entity.EnderPearl;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.entity.Projectile;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.entity.PlayerDeathEvent;
|
||||
import org.bukkit.event.entity.ProjectileHitEvent;
|
||||
import org.bukkit.event.entity.ProjectileLaunchEvent;
|
||||
import org.bukkit.event.inventory.InventoryClickEvent;
|
||||
import org.bukkit.event.player.PlayerDropItemEvent;
|
||||
import org.bukkit.event.player.PlayerInteractEvent;
|
||||
import org.bukkit.metadata.FixedMetadataValue;
|
||||
|
||||
public class PerkDestructor extends Perk
|
||||
{
|
||||
@ -31,6 +49,7 @@ public class PerkDestructor extends Perk
|
||||
|
||||
private long _fallTime;
|
||||
|
||||
private HashSet<String> _preparing = new HashSet<String>();
|
||||
private HashMap<Block, Long> _blocks = new HashMap<Block, Long>();
|
||||
|
||||
public PerkDestructor(int spawnRate, int max, long fallTime, boolean enabled)
|
||||
@ -74,7 +93,7 @@ public class PerkDestructor extends Perk
|
||||
if (!Recharge.Instance.use(cur, GetName(), _spawnRate * 1000, false, false))
|
||||
continue;
|
||||
|
||||
if (UtilInv.contains(cur, Material.ENDER_PEARL, (byte) 0, _max))
|
||||
if (UtilInv.contains(cur, "Seismic Charge", Material.ENDER_PEARL, (byte) 0, _max))
|
||||
continue;
|
||||
|
||||
//Add
|
||||
@ -119,7 +138,25 @@ public class PerkDestructor extends Perk
|
||||
UtilInv.DisallowMovementOf(event, "Seismic Charge", Material.ENDER_PEARL, (byte) 0, true);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
@EventHandler(priority = EventPriority.MONITOR)
|
||||
public void preThrowItem(PlayerInteractEvent event)
|
||||
{
|
||||
if (!UtilEvent.isAction(event, ActionType.R))
|
||||
return;
|
||||
|
||||
if (!Manager.GetGame().IsLive())
|
||||
return;
|
||||
|
||||
if (!Manager.IsAlive(event.getPlayer()))
|
||||
return;
|
||||
|
||||
if (!UtilInv.IsItem(event.getItem(), "Seismic Charge", Material.ENDER_PEARL, (byte) 0))
|
||||
return;
|
||||
|
||||
_preparing.add(event.getPlayer().getName());
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.LOW)
|
||||
public void throwItem(ProjectileLaunchEvent event)
|
||||
{
|
||||
if (Manager.GetGame() == null || !Manager.GetGame().IsLive())
|
||||
@ -128,47 +165,112 @@ public class PerkDestructor extends Perk
|
||||
if (!(event.getEntity() instanceof EnderPearl))
|
||||
return;
|
||||
|
||||
event.getEntity().setVelocity(event.getEntity().getVelocity().multiply(0.7));
|
||||
if (!(event.getEntity().getShooter() instanceof Player))
|
||||
return;
|
||||
|
||||
Player player = (Player) event.getEntity().getShooter();
|
||||
|
||||
if (!Manager.IsAlive(player))
|
||||
return;
|
||||
|
||||
if (_preparing.contains(player.getName()))
|
||||
{
|
||||
_preparing.remove(player.getName());
|
||||
event.getEntity().setMetadata("Destructor", new FixedMetadataValue(Manager.getPlugin(), 1));
|
||||
|
||||
event.getEntity().setVelocity(event.getEntity().getVelocity().multiply(0.7));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@EventHandler
|
||||
public void collide(PlayerTeleportEvent event)
|
||||
public void collide(ProjectileHitEvent event)
|
||||
{
|
||||
if (Manager.GetGame() == null || !Manager.GetGame().IsLive())
|
||||
if (!Manager.GetGame().IsLive())
|
||||
return;
|
||||
|
||||
Projectile proj = event.getEntity();
|
||||
|
||||
if (!(proj.getShooter() instanceof Player))
|
||||
return;
|
||||
|
||||
Player player = (Player) proj.getShooter();
|
||||
|
||||
if (!Manager.IsAlive(player))
|
||||
return;
|
||||
|
||||
if (!Kit.HasKit(player))
|
||||
return;
|
||||
|
||||
if (event.getCause() != TeleportCause.ENDER_PEARL)
|
||||
if (!proj.hasMetadata("Destructor"))
|
||||
return;
|
||||
|
||||
if (!Kit.HasKit(event.getPlayer()))
|
||||
return;
|
||||
|
||||
for (Block block : UtilBlock.getInRadius(event.getTo(), 4).keySet())
|
||||
for (Block block : UtilBlock.getInRadius(proj.getLocation(), 4).keySet())
|
||||
{
|
||||
if (block.getType() == Material.AIR || block.getType() == Material.BEDROCK || block.isLiquid())
|
||||
continue;
|
||||
|
||||
//Event
|
||||
PerkDestructorBlockEvent blockEvent = new PerkDestructorBlockEvent(event.getPlayer(), block);
|
||||
PerkDestructorBlockEvent blockEvent = new PerkDestructorBlockEvent(player, block);
|
||||
UtilServer.getServer().getPluginManager().callEvent(blockEvent);
|
||||
|
||||
if (!blockEvent.isCancelled())
|
||||
{
|
||||
_blocks.put(block, System.currentTimeMillis());
|
||||
|
||||
|
||||
block.getWorld().playEffect(block.getLocation(), Effect.STEP_SOUND, block.getType());
|
||||
}
|
||||
}
|
||||
|
||||
UtilParticle.PlayParticle(ParticleType.LARGE_EXPLODE, event.getTo(), 0f, 0f, 0f, 0f, 1,
|
||||
ViewDist.MAX, UtilServer.getPlayers());
|
||||
|
||||
event.getTo().getWorld().playSound(event.getTo(), Sound.EXPLODE, 1f, 0.5f);
|
||||
event.getTo().getWorld().playSound(event.getTo(), Sound.FIREWORK_TWINKLE, 2f, 0.5f);
|
||||
|
||||
event.setCancelled(true);
|
||||
|
||||
UtilParticle.PlayParticle(ParticleType.LARGE_EXPLODE, proj.getLocation(), 0f, 0f, 0f, 0f, 1, ViewDist.MAX, UtilServer.getPlayers());
|
||||
|
||||
proj.getWorld().playSound(proj.getLocation(), Sound.EXPLODE, 1f, 0.5f);
|
||||
proj.getWorld().playSound(proj.getLocation(), Sound.FIREWORK_TWINKLE, 2f, 0.5f);
|
||||
}
|
||||
|
||||
// @EventHandler
|
||||
// public void collide(PlayerTeleportEvent event)
|
||||
// {
|
||||
// if (Manager.GetGame() == null || !Manager.GetGame().IsLive())
|
||||
// return;
|
||||
//
|
||||
// if (event.getCause() != TeleportCause.ENDER_PEARL)
|
||||
// return;
|
||||
//
|
||||
// if (!Manager.IsAlive(event.getPlayer()))
|
||||
// return;
|
||||
//
|
||||
// if (!Kit.HasKit(event.getPlayer()))
|
||||
// return;
|
||||
//
|
||||
//
|
||||
//
|
||||
// for (Block block : UtilBlock.getInRadius(event.getTo(), 4).keySet())
|
||||
// {
|
||||
// if (block.getType() == Material.AIR || block.getType() == Material.BEDROCK || block.isLiquid())
|
||||
// continue;
|
||||
//
|
||||
// //Event
|
||||
// PerkDestructorBlockEvent blockEvent = new PerkDestructorBlockEvent(event.getPlayer(), block);
|
||||
// UtilServer.getServer().getPluginManager().callEvent(blockEvent);
|
||||
//
|
||||
// if (!blockEvent.isCancelled())
|
||||
// {
|
||||
// _blocks.put(block, System.currentTimeMillis());
|
||||
//
|
||||
// block.getWorld().playEffect(block.getLocation(), Effect.STEP_SOUND, block.getType());
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// UtilParticle.PlayParticle(ParticleType.LARGE_EXPLODE, event.getTo(), 0f, 0f, 0f, 0f, 1,
|
||||
// ViewDist.MAX, UtilServer.getPlayers());
|
||||
//
|
||||
// event.getTo().getWorld().playSound(event.getTo(), Sound.EXPLODE, 1f, 0.5f);
|
||||
// event.getTo().getWorld().playSound(event.getTo(), Sound.FIREWORK_TWINKLE, 2f, 0.5f);
|
||||
//
|
||||
// event.setCancelled(true);
|
||||
// }
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
@EventHandler
|
||||
public void fall(UpdateEvent event)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user