*crosses fingers* please work!
This commit is contained in:
parent
be910cced9
commit
db5c5a9888
@ -60,7 +60,8 @@ public class UpdateRank extends CommandBase<CoreClientManager>
|
|||||||
|
|
||||||
final Rank rank = tempRank;
|
final Rank rank = tempRank;
|
||||||
|
|
||||||
if (rank == Rank.ADMIN || rank == Rank.YOUTUBE || rank == Rank.TWITCH || rank == Rank.MODERATOR || rank == Rank.HELPER || rank == Rank.ALL || rank == Rank.MAPDEV || rank == Rank.SNR_MODERATOR || rank == Rank.JNR_DEV || rank == Rank.DEVELOPER)
|
if (rank == Rank.ADMIN || rank == Rank.YOUTUBE || rank == Rank.TWITCH || rank == Rank.MODERATOR || rank == Rank.JNR_DEV || rank == Rank.HELPER || rank == Rank.ALL || rank == Rank.MAPDEV || rank == Rank.SNR_MODERATOR)
|
||||||
|
if (rank == Rank.ADMIN || rank == Rank.YOUTUBE || rank == Rank.TWITCH || rank == Rank.MODERATOR || rank == Rank.JNR_DEV || rank == Rank.HELPER || rank == Rank.ALL || rank == Rank.MAPDEV || rank == Rank.SNR_MODERATOR)
|
||||||
{
|
{
|
||||||
if (!testServer && rank.Has(Rank.ADMIN) && !Plugin.hasRank(caller, Rank.LT))
|
if (!testServer && rank.Has(Rank.ADMIN) && !Plugin.hasRank(caller, Rank.LT))
|
||||||
{
|
{
|
||||||
|
@ -73,7 +73,6 @@ public class WorldManager extends MiniPlugin
|
|||||||
else
|
else
|
||||||
world.setTime(6000);
|
world.setTime(6000);
|
||||||
world.setStorm(false);
|
world.setStorm(false);
|
||||||
world.setThundering(false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
|
@ -31,6 +31,7 @@ import nautilus.game.arcade.stats.BehindEnemyLinesStatTracker;
|
|||||||
import nautilus.game.arcade.stats.BlockShreadStatTracker;
|
import nautilus.game.arcade.stats.BlockShreadStatTracker;
|
||||||
import nautilus.game.arcade.stats.TheComebackStatTracker;
|
import nautilus.game.arcade.stats.TheComebackStatTracker;
|
||||||
import net.minecraft.server.v1_7_R4.EntityArrow;
|
import net.minecraft.server.v1_7_R4.EntityArrow;
|
||||||
|
import net.minecraft.server.v1_7_R4.Item;
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
@ -43,17 +44,15 @@ import org.bukkit.block.BlockFace;
|
|||||||
import org.bukkit.craftbukkit.v1_7_R4.entity.CraftArrow;
|
import org.bukkit.craftbukkit.v1_7_R4.entity.CraftArrow;
|
||||||
import org.bukkit.craftbukkit.v1_7_R4.entity.CraftPlayer;
|
import org.bukkit.craftbukkit.v1_7_R4.entity.CraftPlayer;
|
||||||
import org.bukkit.entity.Arrow;
|
import org.bukkit.entity.Arrow;
|
||||||
import org.bukkit.entity.EntityType;
|
import org.bukkit.entity.Entity;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.event.EventPriority;
|
|
||||||
import org.bukkit.event.HandlerList;
|
import org.bukkit.event.HandlerList;
|
||||||
import org.bukkit.event.block.BlockBreakEvent;
|
import org.bukkit.event.block.BlockBreakEvent;
|
||||||
import org.bukkit.event.block.BlockEvent;
|
import org.bukkit.event.block.BlockEvent;
|
||||||
import org.bukkit.event.block.BlockPlaceEvent;
|
import org.bukkit.event.block.BlockPlaceEvent;
|
||||||
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
|
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
|
||||||
import org.bukkit.event.entity.EntityShootBowEvent;
|
import org.bukkit.event.entity.EntityShootBowEvent;
|
||||||
import org.bukkit.event.entity.ItemSpawnEvent;
|
|
||||||
import org.bukkit.event.entity.PlayerDeathEvent;
|
import org.bukkit.event.entity.PlayerDeathEvent;
|
||||||
import org.bukkit.event.entity.ProjectileHitEvent;
|
import org.bukkit.event.entity.ProjectileHitEvent;
|
||||||
|
|
||||||
@ -114,6 +113,7 @@ public class TurfForts extends TeamGame
|
|||||||
|
|
||||||
new Kit[]
|
new Kit[]
|
||||||
{
|
{
|
||||||
|
|
||||||
new KitMarksman(manager),
|
new KitMarksman(manager),
|
||||||
new KitInfiltrator(manager),
|
new KitInfiltrator(manager),
|
||||||
new KitShredder(manager),
|
new KitShredder(manager),
|
||||||
@ -125,6 +125,7 @@ public class TurfForts extends TeamGame
|
|||||||
"",
|
"",
|
||||||
"Each kill advances your turf forwards.",
|
"Each kill advances your turf forwards.",
|
||||||
"Take over all the turf to win!"
|
"Take over all the turf to win!"
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
this.StrictAntiHack = true;
|
this.StrictAntiHack = true;
|
||||||
@ -281,12 +282,20 @@ public class TurfForts extends TeamGame
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler(ignoreCancelled = true)
|
@EventHandler
|
||||||
|
public void BlockBreak(BlockBreakEvent event)
|
||||||
|
{
|
||||||
|
if (event.isCancelled()) // this statement might save just a small amount of time
|
||||||
|
return;
|
||||||
|
|
||||||
|
if(getArcadeManager().isSpectator(event.getPlayer())) event.setCancelled(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
public void BlockPlace(BlockPlaceEvent event)
|
public void BlockPlace(BlockPlaceEvent event)
|
||||||
{
|
{
|
||||||
//Remoeved and replaced by ignoreCancelled = true
|
if (event.isCancelled())
|
||||||
//if (event.isCancelled())
|
return;
|
||||||
// return;
|
|
||||||
|
|
||||||
GameTeam team = GetTeam(event.getPlayer());
|
GameTeam team = GetTeam(event.getPlayer());
|
||||||
if (team == null)
|
if (team == null)
|
||||||
@ -325,17 +334,6 @@ public class TurfForts extends TeamGame
|
|||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@EventHandler(priority = EventPriority.HIGH)
|
|
||||||
public void BlockBreak(BlockBreakEvent event)
|
|
||||||
{
|
|
||||||
if (!IsAlive(event.getPlayer()))
|
|
||||||
{
|
|
||||||
event.setCancelled(true);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
@ -359,7 +357,6 @@ public class TurfForts extends TeamGame
|
|||||||
|
|
||||||
Manager.getPlugin().getServer().getScheduler().scheduleSyncDelayedTask(Manager.getPlugin(), new Runnable()
|
Manager.getPlugin().getServer().getScheduler().scheduleSyncDelayedTask(Manager.getPlugin(), new Runnable()
|
||||||
{
|
{
|
||||||
|
|
||||||
public void run()
|
public void run()
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
@ -382,19 +379,18 @@ public class TurfForts extends TeamGame
|
|||||||
|
|
||||||
if (block.getTypeId() == 35)
|
if (block.getTypeId() == 35)
|
||||||
{
|
{
|
||||||
if (block.getData() == 14 /* && team.GetColor() != ChatColor.RED */)
|
if (block.getData() == 14 && team.GetColor() != ChatColor.RED)
|
||||||
{
|
{
|
||||||
block.getWorld().playEffect(block.getLocation(), Effect.STEP_SOUND, Material.REDSTONE_BLOCK.getId());
|
block.getWorld().playEffect(block.getLocation(), Effect.STEP_SOUND, Material.REDSTONE_BLOCK.getId());
|
||||||
}
|
}
|
||||||
else if (block.getData() == 3 /* && team.GetColor() != ChatColor.AQUA */)
|
else if (block.getData() == 3 && team.GetColor() != ChatColor.AQUA)
|
||||||
{
|
{
|
||||||
block.getWorld().playEffect(block.getLocation(), Effect.STEP_SOUND, Material.LAPIS_BLOCK.getId());
|
block.getWorld().playEffect(block.getLocation(), Effect.STEP_SOUND, Material.LAPIS_BLOCK.getId());
|
||||||
}
|
}
|
||||||
|
|
||||||
Bukkit.getPluginManager().callEvent(new ShredBlockEvent(block, arrow));
|
Bukkit.getPluginManager().callEvent(new ShredBlockEvent(block, arrow));
|
||||||
|
|
||||||
|
block.breakNaturally();
|
||||||
block.setType(Material.AIR);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
arrow.remove();
|
arrow.remove();
|
||||||
@ -670,7 +666,6 @@ public class TurfForts extends TeamGame
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void ItemRemoval(UpdateEvent event)
|
public void ItemRemoval(UpdateEvent event)
|
||||||
{
|
{
|
||||||
@ -689,36 +684,6 @@ public class TurfForts extends TeamGame
|
|||||||
ent.remove();
|
ent.remove();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
|
|
||||||
//Added by TheMineBench.
|
|
||||||
@EventHandler
|
|
||||||
public void blockBreak(BlockBreakEvent event) {
|
|
||||||
|
|
||||||
Block block = event.getBlock();
|
|
||||||
|
|
||||||
GameTeam team = GetTeam(event.getPlayer());
|
|
||||||
GameTeam otherTeam = GetOtherTeam(team);
|
|
||||||
|
|
||||||
if (block.getType().equals(Material.WOOL) && (block.getData() == 14 && team.GetColor() != ChatColor.RED) || (block.getData() == 3 && team.GetColor() != ChatColor.AQUA))
|
|
||||||
{
|
|
||||||
UtilPlayer.message(event.getPlayer(), F.main("Game", "You cannot break the " + F.elem(otherTeam.GetColor() + otherTeam.GetName()) + " team's blocks!"));
|
|
||||||
event.setCancelled(true);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public GameTeam GetOtherTeam(GameTeam team) {
|
|
||||||
return team.GetColor() == ChatColor.RED ? GetTeam(ChatColor.AQUA) : GetTeam(ChatColor.RED);
|
|
||||||
}
|
|
||||||
|
|
||||||
@EventHandler
|
|
||||||
public void onItem(ItemSpawnEvent e) {
|
|
||||||
if (e.getEntityType().equals(EntityType.DROPPED_ITEM)) {
|
|
||||||
e.setCancelled(true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void EndCheck()
|
public void EndCheck()
|
||||||
|
Loading…
Reference in New Issue
Block a user