Fixed a bunch of bugs. Still need to fix clicking compass ending game.
This commit is contained in:
parent
54911bb213
commit
d8f44434ff
@ -4,6 +4,7 @@ import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import mineplex.core.common.Rank;
|
||||
import mineplex.core.common.util.C;
|
||||
import mineplex.core.common.util.F;
|
||||
import mineplex.core.common.util.MapUtil;
|
||||
@ -54,10 +55,11 @@ import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.block.BlockGrowEvent;
|
||||
import org.bukkit.event.block.BlockPlaceEvent;
|
||||
import org.bukkit.event.entity.EntityChangeBlockEvent;
|
||||
import org.bukkit.event.player.PlayerCommandPreprocessEvent;
|
||||
import org.bukkit.event.player.PlayerInteractEvent;
|
||||
import org.bukkit.event.player.PlayerPickupItemEvent;
|
||||
import org.bukkit.event.player.PlayerQuitEvent;
|
||||
import org.bukkit.event.player.PlayerToggleSneakEvent;
|
||||
import org.bukkit.event.world.StructureGrowEvent;
|
||||
import org.bukkit.material.Bed;
|
||||
import org.bukkit.util.Vector;
|
||||
@ -348,7 +350,7 @@ public class SpeedBuilder extends SoloGame
|
||||
return;
|
||||
}
|
||||
|
||||
_currentBuild = UtilAlg.Random(_buildData);
|
||||
_currentBuild = _buildData.get(_build);
|
||||
|
||||
for (Player player : GetPlayers(true))
|
||||
{
|
||||
@ -520,7 +522,7 @@ public class SpeedBuilder extends SoloGame
|
||||
@EventHandler
|
||||
public void stopGuardiansBuildEnter(UpdateEvent event)
|
||||
{
|
||||
if (event.getType() != UpdateType.FAST)
|
||||
if (event.getType() != UpdateType.FASTER)
|
||||
return;
|
||||
|
||||
if (!IsLive())
|
||||
@ -530,8 +532,13 @@ public class SpeedBuilder extends SoloGame
|
||||
{
|
||||
for (RecreationData recreation : _buildRecreations.values())
|
||||
{
|
||||
Vector vec = player.getLocation().getDirection().multiply(-1);
|
||||
|
||||
if (UtilMath.offsetSquared(player.getLocation(), recreation.getMidpoint()) < 64)
|
||||
UtilAction.velocity(player, player.getLocation().getDirection().multiply(-1));
|
||||
{
|
||||
player.playSound(player.getEyeLocation(), Sound.NOTE_PLING, 10F, 0.5F);
|
||||
UtilAction.velocity(player, vec, 1.6, false, 0, 0.4, vec.length(), false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -916,22 +923,67 @@ public class SpeedBuilder extends SoloGame
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void stopJudgeUnspec(final PlayerToggleSneakEvent event)
|
||||
public void stopJudgeUnspec(UpdateEvent event)
|
||||
{
|
||||
if (event.getType() != UpdateType.TICK)
|
||||
return;
|
||||
|
||||
if (!IsLive())
|
||||
return;
|
||||
|
||||
if (_state != SpeedBuilderState.REVIEWING)
|
||||
return;
|
||||
|
||||
Manager.runSyncLater(new Runnable()
|
||||
for (Player player : UtilServer.getPlayers())
|
||||
{
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
event.getPlayer().setSpectatorTarget(_judgeEntity);
|
||||
player.setGameMode(GameMode.SPECTATOR);
|
||||
player.setSpectatorTarget(_judgeEntity);
|
||||
}
|
||||
}, 1L);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void stopGuardianSpecPickup(PlayerPickupItemEvent event)
|
||||
{
|
||||
if (GetState().ordinal() < GameState.Prepare.ordinal())
|
||||
return;
|
||||
|
||||
if (Manager.isSpectator(event.getPlayer()) || GetTeamList().get(1).HasPlayer(event.getPlayer()))
|
||||
event.setCancelled(true);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void stopGuardianSpecPlace(BlockPlaceEvent event)
|
||||
{
|
||||
if (GetState().ordinal() < GameState.Prepare.ordinal())
|
||||
return;
|
||||
|
||||
if (Manager.isSpectator(event.getPlayer()) || GetTeamList().get(1).HasPlayer(event.getPlayer()))
|
||||
event.setCancelled(true);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void stopEntityChangeBlock(EntityChangeBlockEvent event)
|
||||
{
|
||||
event.setCancelled(true);
|
||||
}
|
||||
|
||||
private int _build;
|
||||
|
||||
@EventHandler
|
||||
public void setBuild(PlayerCommandPreprocessEvent event)
|
||||
{
|
||||
if (GetState() != GameState.Recruit)
|
||||
return;
|
||||
|
||||
if (!event.getMessage().startsWith("/setbuild "))
|
||||
return;
|
||||
|
||||
if (!Manager.GetClients().hasRank(event.getPlayer(), Rank.SNR_MODERATOR))
|
||||
return;
|
||||
|
||||
_build = Integer.parseInt(event.getMessage().split(" ")[1]);
|
||||
|
||||
Announce(F.main("Build", "BUILD SET TO " + C.mElem + _build));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -18,6 +18,7 @@ import org.bukkit.Material;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.block.BlockFace;
|
||||
import org.bukkit.block.BlockState;
|
||||
import org.bukkit.block.Skull;
|
||||
import org.bukkit.craftbukkit.v1_8_R3.CraftWorld;
|
||||
import org.bukkit.craftbukkit.v1_8_R3.util.CraftMagicNumbers;
|
||||
import org.bukkit.entity.Item;
|
||||
@ -235,6 +236,15 @@ public class RecreationData
|
||||
continue;
|
||||
}
|
||||
|
||||
//Sapling growth fix
|
||||
if (expectedState.getType() == Material.SAPLING && currentBlock.getType() == Material.SAPLING)
|
||||
{
|
||||
if (currentBlock.getData() % 8 == expectedState.getRawData() % 8)
|
||||
score++;
|
||||
|
||||
Game.Announce("SPECIAL SAPLING CHECK = " + (currentBlock.getData() % 8 == expectedState.getRawData() % 8));
|
||||
}
|
||||
|
||||
//Fix for corner stair shape
|
||||
if (currentBlock.getState().getData() instanceof Stairs && expectedState.getData() instanceof Stairs)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user