Merge remote-tracking branch 'origin/master'

This commit is contained in:
Shaun Bennett 2014-08-27 14:08:47 -05:00
commit b67e127902
10 changed files with 70 additions and 26 deletions

View File

@ -4,7 +4,6 @@ import mineplex.core.common.util.C;
import mineplex.core.common.util.F;
import mineplex.core.common.util.MapUtil;
import mineplex.core.common.util.UtilBlock;
import mineplex.core.common.util.UtilInv;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilServer;
import mineplex.core.disguise.disguises.DisguiseCat;
@ -22,7 +21,6 @@ import org.bukkit.craftbukkit.v1_7_R4.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_7_R4.entity.CraftFallingSand;
import org.bukkit.entity.FallingBlock;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
public class BlockForm
{
@ -228,6 +226,8 @@ public class BlockForm
((CraftFallingSand)block).getHandle().spectating = true;
Player.setPassenger(block);
Host.fallingBlockRegister(block);
}
//Ensure Falling doesnt Despawn

View File

@ -1,11 +1,15 @@
package mineplex.core.gadget.gadgets;
import java.util.ArrayList;
import java.util.Iterator;
import org.bukkit.Color;
import org.bukkit.FireworkEffect;
import org.bukkit.Material;
import org.bukkit.FireworkEffect.Type;
import org.bukkit.craftbukkit.v1_7_R4.entity.CraftPlayer;
import org.bukkit.entity.EnderPearl;
import org.bukkit.entity.Item;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.player.PlayerTeleportEvent;
@ -33,7 +37,7 @@ public class ItemEtherealPearl extends ItemGadget
},
-1,
Material.ENDER_PEARL, (byte)0,
500, new Ammo("Ethereal Pearl", "50 Bats", Material.ENDER_PEARL, (byte)0, new String[] { C.cWhite + "50 Pearls to get around with!" }, 500, 50));
500, new Ammo("Ethereal Pearl", "50 Pearls", Material.ENDER_PEARL, (byte)0, new String[] { C.cWhite + "50 Pearls to get around with!" }, 500, 50));
}
@Override
@ -50,7 +54,7 @@ public class ItemEtherealPearl extends ItemGadget
EnderPearl pearl = player.launchProjectile(EnderPearl.class);
pearl.setPassenger(player);
//Inform
UtilPlayer.message(player, F.main("Skill", "You threw " + F.skill(GetName()) + "."));
@ -63,6 +67,9 @@ public class ItemEtherealPearl extends ItemGadget
@EventHandler
public void teleportCancel(PlayerTeleportEvent event)
{
if (!IsActive(event.getPlayer()))
return;
if (event.getCause() == TeleportCause.ENDER_PEARL)
{
//Firework

View File

@ -2,12 +2,17 @@ package mineplex.core.gadget.gadgets;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import org.bukkit.Material;
import org.bukkit.entity.FallingBlock;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.block.Action;
import org.bukkit.event.entity.EntityChangeBlockEvent;
import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.util.BlockIterator;
import mineplex.core.common.util.C;
import mineplex.core.common.util.UtilEvent;
@ -23,6 +28,7 @@ import mineplex.core.updater.event.UpdateEvent;
public class MorphBlock extends MorphGadget
{
private HashMap<Player, BlockForm> _active = new HashMap<Player, BlockForm>();
private HashSet<FallingBlock> _blocks = new HashSet<FallingBlock>();
public MorphBlock(GadgetManager manager)
{
@ -69,11 +75,10 @@ public class MorphBlock extends MorphGadget
form.SolidifyUpdate();
form.FallingBlockCheck();
}
}
@EventHandler
public void stacker(PlayerInteractEvent event)
public void formChange(PlayerInteractEvent event)
{
if (event.getClickedBlock() == null)
return;
@ -100,4 +105,36 @@ public class MorphBlock extends MorphGadget
if (_active.containsKey(event.getEntity()))
event.setCancelled(true);
}
public void fallingBlockRegister(FallingBlock block)
{
_blocks.add(block);
}
@EventHandler
public void fallingBlockForm(EntityChangeBlockEvent event)
{
if (_blocks.remove(event.getEntity()))
event.setCancelled(true);
}
@EventHandler
public void fallingBlockClean(UpdateEvent event)
{
if (event.getType() != UpdateType.SEC)
return;
Iterator<FallingBlock> blockIterator = _blocks.iterator();
while (blockIterator.hasNext())
{
FallingBlock block = blockIterator.next();
if (!block.isValid() || block.getVehicle() == null)
{
block.remove();
blockIterator.remove();
}
}
}
}

View File

@ -57,8 +57,8 @@ import mineplex.minecraft.game.core.fire.Fire;
public class Hub extends JavaPlugin implements IRelation
{
private String WEB_CONFIG = "webServer";
@Override
@Override
public void onEnable()
{
getConfig().addDefault(WEB_CONFIG, "http://accounts.mineplex.com/");
@ -68,7 +68,7 @@ public class Hub extends JavaPlugin implements IRelation
String webServerAddress = getConfig().getString(WEB_CONFIG);
Logger.initialize(this);
//Static Modules
CommandCenter.Initialize(this);
CoreClientManager clientManager = new CoreClientManager(this, webServerAddress);

View File

@ -95,7 +95,7 @@ public class ParkourManager extends MiniPlugin
"and great agility! Some say it was created",
"by the devil as a cruel joke!"
}, 8000, new Location(Manager.GetSpawn().getWorld(), 22,70,-54),
new Location(Manager.GetSpawn().getWorld(), 28,-50,-88), new Location(Manager.GetSpawn().getWorld(), -24,90,-46)));
new Location(Manager.GetSpawn().getWorld(), 35,-200,-90), new Location(Manager.GetSpawn().getWorld(), -30,250,-46)));
_lavaParkourReturn = new Location(Manager.GetSpawn().getWorld(), -89.5,68,36.5);
_lavaParkourReturn.setYaw(90);

View File

@ -623,7 +623,8 @@ public class ArcadeManager extends MiniPlugin implements IRelation
((CraftEntity) player).getHandle().getDataWatcher().watch(0, Byte.valueOf((byte) 0));
player.setSprinting(false);
player.setSneaking(false);
player.setFoodLevel(20);
player.setSaturation(3f);
player.setExhaustion(0f);

View File

@ -26,6 +26,7 @@ import nautilus.game.arcade.game.games.halloween.Halloween;
import nautilus.game.arcade.game.games.hideseek.HideSeek;
import nautilus.game.arcade.game.games.micro.Micro;
import nautilus.game.arcade.game.games.milkcow.MilkCow;
//import nautilus.game.arcade.game.games.minestrike.MineStrike;
import nautilus.game.arcade.game.games.mineware.MineWare;
import nautilus.game.arcade.game.games.quiver.Quiver;
import nautilus.game.arcade.game.games.quiver.QuiverTeams;

View File

@ -1361,6 +1361,9 @@ public class Bridge extends TeamGame implements OreObsfucation
if (event.getBlock().getType() != Material.CHEST)
return;
if (!IsAlive(event.getPlayer()))
return;
for (Location loc : WorldData.GetCustomLocs("54"))
{
@ -1384,6 +1387,9 @@ public class Bridge extends TeamGame implements OreObsfucation
if (event.getClickedBlock().getType() != Material.CHEST)
return;
if (!IsAlive(event.getPlayer()))
return;
for (Location loc : WorldData.GetCustomLocs("54"))
{

View File

@ -518,15 +518,7 @@ public class SheepGame extends TeamGame
//Write New
for (GameTeam team : _sheepPens.keySet())
{
int score = 0;
for (Sheep sheep : _sheep.keySet())
{
if (_sheepPens.get(team).contains(sheep.getLocation().getBlock()))
{
score++;
}
}
int score = getSheepCount(team);
Scoreboard.WriteOrdered("Sheep", team.GetColor() + team.GetName(), score, true);
@ -682,14 +674,14 @@ public class SheepGame extends TeamGame
public int getSheepCount(GameTeam team)
{
int count = 0;
int score = 0;
for (SheepData data : _sheep.values())
for (Sheep sheep : _sheep.keySet())
{
if (data.HolderTeam == team)
count++;
if (_sheepPens.get(team).contains(sheep.getLocation().getBlock()))
score++;
}
return count;
return score;
}
}

View File

@ -23,7 +23,7 @@ public class ParalympicsStatTracker extends StatTracker<Game>
}
@EventHandler(ignoreCancelled = true, priority = EventPriority.MONITOR)
public void onePerkLeap(PerkLeapEvent event)
public void onPerkLeap(PerkLeapEvent event)
{
if (getGame().GetState() != Game.GameState.Live)
return;