*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;
|
||||
|
||||
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))
|
||||
{
|
||||
@ -122,4 +123,4 @@ public class UpdateRank extends CommandBase<CoreClientManager>
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -73,7 +73,6 @@ public class WorldManager extends MiniPlugin
|
||||
else
|
||||
world.setTime(6000);
|
||||
world.setStorm(false);
|
||||
world.setThundering(false);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
@ -341,4 +340,4 @@ public class WorldManager extends MiniPlugin
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -31,6 +31,7 @@ import nautilus.game.arcade.stats.BehindEnemyLinesStatTracker;
|
||||
import nautilus.game.arcade.stats.BlockShreadStatTracker;
|
||||
import nautilus.game.arcade.stats.TheComebackStatTracker;
|
||||
import net.minecraft.server.v1_7_R4.EntityArrow;
|
||||
import net.minecraft.server.v1_7_R4.Item;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
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.CraftPlayer;
|
||||
import org.bukkit.entity.Arrow;
|
||||
import org.bukkit.entity.EntityType;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.HandlerList;
|
||||
import org.bukkit.event.block.BlockBreakEvent;
|
||||
import org.bukkit.event.block.BlockEvent;
|
||||
import org.bukkit.event.block.BlockPlaceEvent;
|
||||
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
|
||||
import org.bukkit.event.entity.EntityShootBowEvent;
|
||||
import org.bukkit.event.entity.ItemSpawnEvent;
|
||||
import org.bukkit.event.entity.PlayerDeathEvent;
|
||||
import org.bukkit.event.entity.ProjectileHitEvent;
|
||||
|
||||
@ -114,6 +113,7 @@ public class TurfForts extends TeamGame
|
||||
|
||||
new Kit[]
|
||||
{
|
||||
|
||||
new KitMarksman(manager),
|
||||
new KitInfiltrator(manager),
|
||||
new KitShredder(manager),
|
||||
@ -125,6 +125,7 @@ public class TurfForts extends TeamGame
|
||||
"",
|
||||
"Each kill advances your turf forwards.",
|
||||
"Take over all the turf to win!"
|
||||
|
||||
});
|
||||
|
||||
this.StrictAntiHack = true;
|
||||
@ -268,7 +269,7 @@ public class TurfForts extends TeamGame
|
||||
EndCheck();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@EventHandler
|
||||
public void BowCancel(EntityShootBowEvent event)
|
||||
{
|
||||
@ -280,13 +281,21 @@ public class TurfForts extends TeamGame
|
||||
((Player) event.getEntity()).updateInventory();
|
||||
}
|
||||
}
|
||||
|
||||
@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(ignoreCancelled = true)
|
||||
@EventHandler
|
||||
public void BlockPlace(BlockPlaceEvent event)
|
||||
{
|
||||
//Remoeved and replaced by ignoreCancelled = true
|
||||
//if (event.isCancelled())
|
||||
// return;
|
||||
if (event.isCancelled())
|
||||
return;
|
||||
|
||||
GameTeam team = GetTeam(event.getPlayer());
|
||||
if (team == null)
|
||||
@ -325,17 +334,6 @@ public class TurfForts extends TeamGame
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGH)
|
||||
public void BlockBreak(BlockBreakEvent event)
|
||||
{
|
||||
if (!IsAlive(event.getPlayer()))
|
||||
{
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
@ -343,7 +341,7 @@ public class TurfForts extends TeamGame
|
||||
{
|
||||
if (event.getEntity().getShooter() == null)
|
||||
return;
|
||||
|
||||
|
||||
if (!(event.getEntity() instanceof Arrow))
|
||||
return;
|
||||
|
||||
@ -359,7 +357,6 @@ public class TurfForts extends TeamGame
|
||||
|
||||
Manager.getPlugin().getServer().getScheduler().scheduleSyncDelayedTask(Manager.getPlugin(), new Runnable()
|
||||
{
|
||||
|
||||
public void run()
|
||||
{
|
||||
try
|
||||
@ -379,22 +376,21 @@ public class TurfForts extends TeamGame
|
||||
int z = fieldZ.getInt(entityArrow);
|
||||
|
||||
Block block = arrow.getWorld().getBlockAt(x, y, z);
|
||||
|
||||
|
||||
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());
|
||||
}
|
||||
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());
|
||||
}
|
||||
|
||||
|
||||
Bukkit.getPluginManager().callEvent(new ShredBlockEvent(block, arrow));
|
||||
|
||||
|
||||
block.setType(Material.AIR);
|
||||
|
||||
block.breakNaturally();
|
||||
}
|
||||
|
||||
arrow.remove();
|
||||
@ -669,8 +665,7 @@ public class TurfForts extends TeamGame
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@EventHandler
|
||||
public void ItemRemoval(UpdateEvent event)
|
||||
{
|
||||
@ -689,37 +684,7 @@ public class TurfForts extends TeamGame
|
||||
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
|
||||
public void EndCheck()
|
||||
{
|
||||
@ -749,7 +714,7 @@ public class TurfForts extends TeamGame
|
||||
if (player.isOnline())
|
||||
AddGems(player, 10, "Participation", false, false);
|
||||
}
|
||||
|
||||
|
||||
//End
|
||||
SetState(GameState.End);
|
||||
}
|
||||
@ -758,4 +723,4 @@ public class TurfForts extends TeamGame
|
||||
{
|
||||
return _enemyTurf.get(player);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user