Merge branch 'master' of ssh://184.154.0.242:7999/min/mineplex into MC_1.8
Conflicts: Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/turfforts/TurfForts.java
This commit is contained in:
commit
7fca42b0e0
@ -4,6 +4,30 @@ import java.lang.reflect.Field;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Effect;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.Sound;
|
||||
import org.bukkit.block.Block;
|
||||
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.Entity;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.HandlerList;
|
||||
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.PlayerDeathEvent;
|
||||
import org.bukkit.event.entity.ProjectileHitEvent;
|
||||
|
||||
import net.minecraft.server.v1_7_R4.EntityArrow;
|
||||
import net.minecraft.server.v1_7_R4.Item;
|
||||
import mineplex.core.common.util.C;
|
||||
import mineplex.core.common.util.F;
|
||||
import mineplex.core.common.util.MapUtil;
|
||||
@ -32,30 +56,6 @@ import nautilus.game.arcade.stats.BlockShreadStatTracker;
|
||||
import nautilus.game.arcade.stats.TheComebackStatTracker;
|
||||
import net.minecraft.server.v1_8_R3.EntityArrow;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Effect;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.Sound;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.block.BlockFace;
|
||||
import org.bukkit.craftbukkit.v1_8_R3.entity.CraftArrow;
|
||||
import org.bukkit.craftbukkit.v1_8_R3.entity.CraftPlayer;
|
||||
import org.bukkit.entity.Arrow;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.Item;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
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.PlayerDeathEvent;
|
||||
import org.bukkit.event.entity.ProjectileHitEvent;
|
||||
|
||||
public class TurfForts extends TeamGame
|
||||
{
|
||||
public static class ShredBlockEvent extends BlockEvent
|
||||
@ -113,7 +113,6 @@ public class TurfForts extends TeamGame
|
||||
|
||||
new Kit[]
|
||||
{
|
||||
|
||||
new KitMarksman(manager),
|
||||
new KitInfiltrator(manager),
|
||||
new KitShredder(manager),
|
||||
@ -125,7 +124,6 @@ public class TurfForts extends TeamGame
|
||||
"",
|
||||
"Each kill advances your turf forwards.",
|
||||
"Take over all the turf to win!"
|
||||
|
||||
});
|
||||
|
||||
this.StrictAntiHack = true;
|
||||
@ -301,11 +299,12 @@ public class TurfForts extends TeamGame
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
@EventHandler(ignoreCancelled = true)
|
||||
public void BlockPlace(BlockPlaceEvent event)
|
||||
{
|
||||
if (event.isCancelled())
|
||||
return;
|
||||
//Remoeved and replaced by ignoreCancelled = true
|
||||
//if (event.isCancelled())
|
||||
// return;
|
||||
|
||||
GameTeam team = GetTeam(event.getPlayer());
|
||||
if (team == null)
|
||||
@ -397,21 +396,22 @@ 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.breakNaturally();
|
||||
|
||||
|
||||
block.setType(Material.AIR);
|
||||
}
|
||||
|
||||
arrow.remove();
|
||||
@ -686,7 +686,8 @@ public class TurfForts extends TeamGame
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
@EventHandler
|
||||
public void ItemRemoval(UpdateEvent event)
|
||||
{
|
||||
@ -705,7 +706,37 @@ 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()
|
||||
{
|
||||
@ -735,7 +766,7 @@ public class TurfForts extends TeamGame
|
||||
if (player.isOnline())
|
||||
AddGems(player, 10, "Participation", false, false);
|
||||
}
|
||||
|
||||
|
||||
//End
|
||||
SetState(GameState.End);
|
||||
}
|
||||
@ -744,4 +775,4 @@ public class TurfForts extends TeamGame
|
||||
{
|
||||
return _enemyTurf.get(player);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user