- Gameplay edits and disabling broadcaster code
This commit is contained in:
parent
66c9fa122c
commit
a4853e667c
@ -159,7 +159,7 @@ public class Arcade extends JavaPlugin
|
||||
PollManager pollManager = new PollManager(this, _clientManager, _donationManager);
|
||||
_gameManager = new ArcadeManager(this, serverStatusManager, ReadServerConfig(), _clientManager, _donationManager, _damageManager, statsManager, achievementManager, disguiseManager, creature, teleport, new Blood(this), chat, portal, preferenceManager, inventoryManager, packetHandler, cosmeticManager, projectileManager, petManager, hologramManager, webServerAddress, pollManager, npcmanager, giveawayManager, customDataManager);
|
||||
|
||||
new BroadcastManager(this, _gameManager);
|
||||
//new BroadcastManager(this, _gameManager);
|
||||
|
||||
new MemoryFix(this);
|
||||
new CustomTagFix(this, packetHandler);
|
||||
|
@ -679,4 +679,90 @@ public class MinecraftLeague extends TeamGame
|
||||
|
||||
event.setCancelled(true);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void controlPvP(EntityDamageByEntityEvent event)
|
||||
{
|
||||
if (!IsLive())
|
||||
return;
|
||||
|
||||
Player entity = null;
|
||||
Player damager = null;
|
||||
if (event.getEntity() instanceof Player)
|
||||
{
|
||||
entity = (Player)event.getEntity();
|
||||
if (UtilPlayer.isSpectator(entity))
|
||||
{
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (event.getDamager() instanceof Player)
|
||||
{
|
||||
damager = (Player)event.getDamager();
|
||||
if (UtilPlayer.isSpectator(damager))
|
||||
{
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (event.getDamager() instanceof Projectile)
|
||||
{
|
||||
Projectile proj = (Projectile)event.getDamager();
|
||||
if (proj.getShooter() instanceof Player)
|
||||
{
|
||||
damager = (Player)proj.getShooter();
|
||||
if (UtilPlayer.isSpectator(damager))
|
||||
{
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ((entity != null) && (damager != null))
|
||||
{
|
||||
if (GetTeam(entity).GetColor() == GetTeam(damager).GetColor())
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void protectSpectators(EntityDamageEvent event)
|
||||
{
|
||||
if (!IsLive())
|
||||
return;
|
||||
|
||||
if (event.getEntity() instanceof Player)
|
||||
{
|
||||
Player ent = (Player)event.getEntity();
|
||||
if (UtilPlayer.isSpectator(ent))
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void equip(GameStateChangeEvent event)
|
||||
{
|
||||
if (event.GetState() != GameState.Live)
|
||||
return;
|
||||
|
||||
for (Player red : GetTeam(ChatColor.RED).GetPlayers(true))
|
||||
{
|
||||
red.getInventory().setHelmet(new ItemStack(Material.IRON_HELMET));
|
||||
red.getInventory().setChestplate(new ItemStack(Material.IRON_CHESTPLATE));
|
||||
red.getInventory().setLeggings(new ItemStack(Material.IRON_LEGGINGS));
|
||||
red.getInventory().setBoots(new ItemStack(Material.IRON_BOOTS));
|
||||
red.getInventory().addItem(new ItemStack(Material.IRON_SWORD));
|
||||
}
|
||||
|
||||
for (Player blue : GetTeam(ChatColor.AQUA).GetPlayers(true))
|
||||
{
|
||||
blue.getInventory().setHelmet(new ItemStack(Material.IRON_HELMET));
|
||||
blue.getInventory().setChestplate(new ItemStack(Material.IRON_CHESTPLATE));
|
||||
blue.getInventory().setLeggings(new ItemStack(Material.IRON_LEGGINGS));
|
||||
blue.getInventory().setBoots(new ItemStack(Material.IRON_BOOTS));
|
||||
blue.getInventory().addItem(new ItemStack(Material.IRON_SWORD));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -10,7 +10,10 @@ import mineplex.core.common.util.UtilParticle.ViewDist;
|
||||
import mineplex.core.common.util.UtilPlayer;
|
||||
import mineplex.core.common.util.UtilServer;
|
||||
import mineplex.core.common.util.UtilTextMiddle;
|
||||
import mineplex.core.common.util.UtilTime;
|
||||
import mineplex.core.common.util.UtilTime.TimeUnit;
|
||||
import mineplex.core.hologram.Hologram;
|
||||
import mineplex.core.recharge.Recharge;
|
||||
import nautilus.game.arcade.game.GameTeam;
|
||||
import nautilus.game.arcade.game.games.minecraftleague.MinecraftLeague;
|
||||
|
||||
@ -38,7 +41,7 @@ public class TeamCrystal
|
||||
_host = host;
|
||||
_spawn = spawn.clone().add(0.5, 1.2, 0.5);
|
||||
_team = team;
|
||||
_health = 500D;
|
||||
_health = 1000D;
|
||||
_name = new Hologram(_host.getArcadeManager().getHologramManager(), _spawn.clone().add(0, 3, 0), team.GetColor() + team.getDisplayName() + "'s Respawn Crystal");
|
||||
_healthTag = new Hologram(_host.getArcadeManager().getHologramManager(), _spawn.clone().add(0, 2, 0), formatHealth(_health));
|
||||
|
||||
@ -115,6 +118,9 @@ public class TeamCrystal
|
||||
if (!_host.IsPlaying(player))
|
||||
return false;
|
||||
|
||||
if (!Recharge.Instance.usable(player, "Damage Teamcrystal"))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -151,6 +157,7 @@ public class TeamCrystal
|
||||
}
|
||||
|
||||
_health = newHealth;
|
||||
Recharge.Instance.use(player, "Damage Teamcrystal", UtilTime.convert(1, TimeUnit.SECONDS, TimeUnit.MILLISECONDS), false, false);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -24,6 +24,7 @@ public class KitPlayer extends Kit
|
||||
{
|
||||
"",
|
||||
"Entirely vanilla combat!",
|
||||
"Spawns with full iron!",
|
||||
""
|
||||
},
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user