Remove unnecessary tabs. Make the judge guardian use it's own laser again.

This commit is contained in:
Virizion 2016-01-24 21:55:57 -05:00
parent 0eda813d41
commit bfe9aa7a59
7 changed files with 118 additions and 131 deletions

View File

@ -95,45 +95,44 @@ public class SpeedBuilders extends SoloGame
public int BuildSizeDiv2 = BuildSize / 2; public int BuildSizeDiv2 = BuildSize / 2;
public int BuildSizeMin1 = BuildSize - 1; public int BuildSizeMin1 = BuildSize - 1;
public int BuildSizePow3 = BuildSize * BuildSize * BuildSize; public int BuildSizePow3 = BuildSize * BuildSize * BuildSize;
private SpeedBuildersState _state = SpeedBuildersState.VIEWING; private SpeedBuildersState _state = SpeedBuildersState.VIEWING;
private long _stateTime = System.currentTimeMillis(); private long _stateTime = System.currentTimeMillis();
private int _roundsPlayed; private int _roundsPlayed;
private int _buildCountStage; private int _buildCountStage;
private int _viewCountStage; private int _viewCountStage;
private int _buildTimeTracker = 40; private int _buildTimeTracker = 40;
private int _buildTime = 40; private int _buildTime = 40;
private int _viewTime = 8; private int _viewTime = 8;
private Location _buildMiddle; private Location _buildMiddle;
private ArrayList<BuildData> _buildData = new ArrayList<BuildData>(); private ArrayList<BuildData> _buildData = new ArrayList<BuildData>();
private ArrayList<BuildData> _usedBuilds = new ArrayList<>(); private ArrayList<BuildData> _usedBuilds = new ArrayList<>();
private BuildData _currentBuild; private BuildData _currentBuild;
private BlockState[][] _defaultMiddleGround = new BlockState[BuildSize][BuildSize]; private BlockState[][] _defaultMiddleGround = new BlockState[BuildSize][BuildSize];
private ArrayList<Entity> _middleMobs = new ArrayList<Entity>(); private ArrayList<Entity> _middleMobs = new ArrayList<Entity>();
private NautHashMap<Player, RecreationData> _buildRecreations = new NautHashMap<Player, RecreationData>(); private NautHashMap<Player, RecreationData> _buildRecreations = new NautHashMap<Player, RecreationData>();
private ArmorStand _judgeEntity; private ArmorStand _judgeEntity;
private DisguiseGuardian _judgeDisguise; private DisguiseGuardian _judgeDisguise;
private Location _judgeSpawn; private Location _judgeSpawn;
private ArmorStand _judgeLaserHelper;
private ArmorStand _judgeLaserTarget; private ArmorStand _judgeLaserTarget;
private ArrayList<RecreationData> _toEliminate = new ArrayList<RecreationData>(); private ArrayList<RecreationData> _toEliminate = new ArrayList<RecreationData>();
private long _lastElimination; private long _lastElimination;
private boolean _eliminating; private boolean _eliminating;
// Track the time we switch to review so we can give players 8 seconds to look around // Track the time we switch to review so we can give players 8 seconds to look around
private long _reviewStartTime; private long _reviewStartTime;
private NautHashMap<Player, Long> _perfectBuild = new NautHashMap<Player, Long>(); private NautHashMap<Player, Long> _perfectBuild = new NautHashMap<Player, Long>();
private boolean _allPerfect; private boolean _allPerfect;
private Location _lookTarget; private Location _lookTarget;
private ArmorStand _lookStand; private ArmorStand _lookStand;
private long _targetReached; private long _targetReached;
@ -141,7 +140,7 @@ public class SpeedBuilders extends SoloGame
private RecreationData _lastRecreationTarget; private RecreationData _lastRecreationTarget;
private double _standMoveProgress; private double _standMoveProgress;
private Location _standStart; private Location _standStart;
public SpeedBuilders(ArcadeManager manager) public SpeedBuilders(ArcadeManager manager)
{ {
super(manager, GameType.SpeedBuilders, super(manager, GameType.SpeedBuilders,
@ -178,7 +177,7 @@ public class SpeedBuilders extends SoloGame
new SpeediestBuilderizerTracker(this) new SpeediestBuilderizerTracker(this)
); );
} }
@Override @Override
public void ParseData() public void ParseData()
{ {
@ -229,28 +228,28 @@ public class SpeedBuilders extends SoloGame
loc.setDirection(UtilAlg.getTrajectory(loc, _buildMiddle.clone().add(0.5, 0, 0.5))); loc.setDirection(UtilAlg.getTrajectory(loc, _buildMiddle.clone().add(0.5, 0, 0.5)));
} }
} }
public void setSpeedBuilderState(SpeedBuildersState state) public void setSpeedBuilderState(SpeedBuildersState state)
{ {
_state = state; _state = state;
_stateTime = System.currentTimeMillis(); _stateTime = System.currentTimeMillis();
} }
public SpeedBuildersState getSpeedBuilderState() public SpeedBuildersState getSpeedBuilderState()
{ {
return _state; return _state;
} }
public long getSpeedBuilderStateTime() public long getSpeedBuilderStateTime()
{ {
return _stateTime; return _stateTime;
} }
public int getRoundsPlayed() public int getRoundsPlayed()
{ {
return _roundsPlayed; return _roundsPlayed;
} }
public void clearCenterArea(boolean resetGround) public void clearCenterArea(boolean resetGround)
{ {
Location buildMin = _buildMiddle.clone().subtract(BuildSizeDiv2, 0, BuildSizeDiv2); Location buildMin = _buildMiddle.clone().subtract(BuildSizeDiv2, 0, BuildSizeDiv2);
@ -279,7 +278,7 @@ public class SpeedBuilders extends SoloGame
} }
} }
} }
public void pasteBuildInCenter(BuildData buildData) public void pasteBuildInCenter(BuildData buildData)
{ {
clearCenterArea(true); clearCenterArea(true);
@ -323,7 +322,7 @@ public class SpeedBuilders extends SoloGame
CreatureAllowOverride = false; CreatureAllowOverride = false;
} }
public void spawnJudge() public void spawnJudge()
{ {
CreatureAllowOverride = true; CreatureAllowOverride = true;
@ -344,7 +343,7 @@ public class SpeedBuilders extends SoloGame
Manager.GetDisguise().disguise(_judgeDisguise); Manager.GetDisguise().disguise(_judgeDisguise);
} }
public void despawnJudge() public void despawnJudge()
{ {
Manager.GetDisguise().undisguise(_judgeEntity); Manager.GetDisguise().undisguise(_judgeEntity);
@ -354,53 +353,41 @@ public class SpeedBuilders extends SoloGame
_judgeDisguise = null; _judgeDisguise = null;
_judgeEntity = null; _judgeEntity = null;
} }
public void judgeTargetLocation(Location loc) public void judgeTargetLocation(Location loc)
{ {
if (loc == null) if (loc == null)
{ {
if (_judgeLaserTarget == null) if (_judgeLaserTarget == null)
return; return;
Manager.GetDisguise().undisguise(_judgeLaserHelper);
_judgeLaserHelper.remove();
_judgeLaserTarget.remove(); _judgeLaserTarget.remove();
_judgeLaserHelper = null;
_judgeLaserTarget = null; _judgeLaserTarget = null;
_judgeDisguise.setTarget(0);
Manager.GetDisguise().updateDisguise(_judgeDisguise);
} }
else else
{ {
if (_judgeLaserTarget != null) if (_judgeLaserTarget != null)
judgeTargetLocation(null); judgeTargetLocation(null);
CreatureAllowOverride = true;
_judgeLaserHelper = _judgeEntity.getWorld().spawn(_judgeEntity.getLocation().subtract(_judgeEntity.getLocation().getDirection().multiply(2)), ArmorStand.class);
_judgeLaserTarget = _judgeEntity.getWorld().spawn(loc, ArmorStand.class); _judgeLaserTarget = _judgeEntity.getWorld().spawn(loc, ArmorStand.class);
CreatureAllowOverride = false;
_judgeLaserHelper.setVisible(false);
_judgeLaserHelper.setGravity(false);
_judgeLaserHelper.setSmall(true);
_judgeLaserTarget.setVisible(false); _judgeLaserTarget.setVisible(false);
_judgeLaserTarget.setGravity(false); _judgeLaserTarget.setGravity(false);
_judgeLaserTarget.setSmall(true); _judgeLaserTarget.setSmall(true);
UtilEnt.CreatureLook(_judgeEntity, _judgeLaserTarget.getLocation()); UtilEnt.CreatureLook(_judgeEntity, _judgeLaserTarget.getLocation());
DisguiseGuardian disguise = new DisguiseGuardian(_judgeLaserHelper);
disguise.setTarget(_judgeLaserTarget.getEntityId()); _judgeDisguise.setTarget(_judgeLaserTarget.getEntityId());
disguise.setInvisible(true);
Manager.GetDisguise().disguise(disguise); Manager.GetDisguise().updateDisguise(_judgeDisguise);
} }
} }
public void moveToGuardians(Player player, boolean elimination) public void moveToGuardians(Player player, boolean elimination)
{ {
if (elimination) if (elimination)
@ -424,7 +411,7 @@ public class SpeedBuilders extends SoloGame
EndCheck(); EndCheck();
} }
@EventHandler(priority = EventPriority.MONITOR) @EventHandler(priority = EventPriority.MONITOR)
public void teamGen(GameStateChangeEvent event) public void teamGen(GameStateChangeEvent event)
{ {
@ -439,7 +426,7 @@ public class SpeedBuilders extends SoloGame
AddTeam(guardians); AddTeam(guardians);
} }
@EventHandler(priority = EventPriority.LOWEST) @EventHandler(priority = EventPriority.LOWEST)
public void onPrepare(GameStateChangeEvent event) public void onPrepare(GameStateChangeEvent event)
{ {
@ -462,7 +449,7 @@ public class SpeedBuilders extends SoloGame
Manager.getCosmeticManager().setHideParticles(true); Manager.getCosmeticManager().setHideParticles(true);
} }
@EventHandler @EventHandler
public void onLive(GameStateChangeEvent event) public void onLive(GameStateChangeEvent event)
{ {
@ -515,7 +502,7 @@ public class SpeedBuilders extends SoloGame
setSpeedBuilderState(SpeedBuildersState.VIEWING); setSpeedBuilderState(SpeedBuildersState.VIEWING);
} }
@EventHandler @EventHandler
public void onEnd(GameStateChangeEvent event) public void onEnd(GameStateChangeEvent event)
{ {
@ -541,7 +528,7 @@ public class SpeedBuilders extends SoloGame
_toEliminate.remove(recreation); _toEliminate.remove(recreation);
} }
} }
@EventHandler @EventHandler
public void onBlockPlace(BlockPlaceEvent event) public void onBlockPlace(BlockPlaceEvent event)
{ {
@ -588,20 +575,20 @@ public class SpeedBuilders extends SoloGame
event.setCancelled(true); event.setCancelled(true);
UtilPlayer.message(event.getPlayer(), F.main("Build", "Cannot build outside your area!")); UtilPlayer.message(event.getPlayer(), F.main("Build", "Cannot build outside your area!"));
} }
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true) @EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
public void onBuildFinish(final BlockPlaceEvent event) public void onBuildFinish(final BlockPlaceEvent event)
{ {
checkPerfectBuild(event.getPlayer()); checkPerfectBuild(event.getPlayer());
} }
//This is here because if you open a door then close it you won't be informed of a perfect build //This is here because if you open a door then close it you won't be informed of a perfect build
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true) @EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
public void interactInformSuccess(PlayerInteractEvent event) public void interactInformSuccess(PlayerInteractEvent event)
{ {
checkPerfectBuild(event.getPlayer()); checkPerfectBuild(event.getPlayer());
} }
public void checkPerfectBuild(Player player) public void checkPerfectBuild(Player player)
{ {
if (_perfectBuild.containsKey(player)) if (_perfectBuild.containsKey(player))
@ -652,7 +639,7 @@ public class SpeedBuilders extends SoloGame
} }
}, 1L); }, 1L);
} }
@EventHandler(priority = EventPriority.HIGHEST) @EventHandler(priority = EventPriority.HIGHEST)
public void onPlayerPickupItem(PlayerPickupItemEvent event) public void onPlayerPickupItem(PlayerPickupItemEvent event)
{ {
@ -667,13 +654,13 @@ public class SpeedBuilders extends SoloGame
else else
event.setCancelled(true); event.setCancelled(true);
} }
@EventHandler @EventHandler
public void stopItemMerge(ItemMergeEvent event) public void stopItemMerge(ItemMergeEvent event)
{ {
event.setCancelled(true); event.setCancelled(true);
} }
@EventHandler @EventHandler
public void stopMoveOffArea(UpdateEvent event) public void stopMoveOffArea(UpdateEvent event)
{ {
@ -710,7 +697,7 @@ public class SpeedBuilders extends SoloGame
} }
} }
} }
@EventHandler @EventHandler
public void stopGuardiansBuildEnter(UpdateEvent event) public void stopGuardiansBuildEnter(UpdateEvent event)
{ {
@ -734,7 +721,7 @@ public class SpeedBuilders extends SoloGame
} }
} }
} }
@EventHandler @EventHandler
public void stateUpdate(UpdateEvent event) public void stateUpdate(UpdateEvent event)
{ {
@ -1013,7 +1000,7 @@ public class SpeedBuilders extends SoloGame
} }
} }
} }
@EventHandler @EventHandler
public void buildTimeProgressBar(UpdateEvent event) public void buildTimeProgressBar(UpdateEvent event)
{ {
@ -1033,7 +1020,7 @@ public class SpeedBuilders extends SoloGame
UtilTextBottom.displayProgress("Time Left", timeLeft / (_buildTime * 1000.0D), UtilTime.MakeStr(timeLeft), UtilServer.getPlayers()); UtilTextBottom.displayProgress("Time Left", timeLeft / (_buildTime * 1000.0D), UtilTime.MakeStr(timeLeft), UtilServer.getPlayers());
} }
@EventHandler @EventHandler
public void buildEndCountdown(UpdateEvent event) public void buildEndCountdown(UpdateEvent event)
{ {
@ -1072,7 +1059,7 @@ public class SpeedBuilders extends SoloGame
_buildCountStage++; _buildCountStage++;
} }
} }
@EventHandler @EventHandler
public void viewCountdown(UpdateEvent event) public void viewCountdown(UpdateEvent event)
{ {
@ -1103,7 +1090,7 @@ public class SpeedBuilders extends SoloGame
_viewCountStage++; _viewCountStage++;
} }
} }
@EventHandler @EventHandler
public void markBlockForDemolition(PlayerInteractEvent event) public void markBlockForDemolition(PlayerInteractEvent event)
{ {
@ -1127,7 +1114,7 @@ public class SpeedBuilders extends SoloGame
_buildRecreations.get(event.getPlayer()).addToDemolition(event.getClickedBlock()); _buildRecreations.get(event.getPlayer()).addToDemolition(event.getClickedBlock());
} }
@EventHandler @EventHandler
public void markMobForDemolition(EntityDamageByEntityEvent event) public void markMobForDemolition(EntityDamageByEntityEvent event)
{ {
@ -1150,7 +1137,7 @@ public class SpeedBuilders extends SoloGame
_buildRecreations.get(player).addToDemolition(event.getEntity()); _buildRecreations.get(player).addToDemolition(event.getEntity());
} }
@EventHandler @EventHandler
public void updateDemolitionBlocks(UpdateEvent event) public void updateDemolitionBlocks(UpdateEvent event)
{ {
@ -1170,13 +1157,13 @@ public class SpeedBuilders extends SoloGame
} }
} }
} }
@EventHandler @EventHandler
public void preventBlockGrowth(BlockGrowEvent event) public void preventBlockGrowth(BlockGrowEvent event)
{ {
event.setCancelled(true); event.setCancelled(true);
} }
@EventHandler @EventHandler
public void preventStructureGrowth(StructureGrowEvent event) public void preventStructureGrowth(StructureGrowEvent event)
{ {
@ -1242,7 +1229,7 @@ public class SpeedBuilders extends SoloGame
_standMoveProgress += 0.2; _standMoveProgress += 0.2;
} }
private void moveEntity(Location loc, Entity entity) private void moveEntity(Location loc, Entity entity)
{ {
double dx = loc.getX() - entity.getLocation().getX(); double dx = loc.getX() - entity.getLocation().getX();
@ -1251,7 +1238,7 @@ public class SpeedBuilders extends SoloGame
((CraftEntity) entity).getHandle().move(dx, dy, dz); ((CraftEntity) entity).getHandle().move(dx, dy, dz);
} }
@EventHandler @EventHandler
public void specNightVision(UpdateEvent event) public void specNightVision(UpdateEvent event)
{ {
@ -1292,7 +1279,7 @@ public class SpeedBuilders extends SoloGame
// Manager.GetCondition().Factory().Cloak("Guardian POV", player, null, 999999999, false, false); // Manager.GetCondition().Factory().Cloak("Guardian POV", player, null, 999999999, false, false);
// } // }
// } // }
@EventHandler @EventHandler
public void stopGuardianSpecPickup(PlayerPickupItemEvent event) public void stopGuardianSpecPickup(PlayerPickupItemEvent event)
{ {
@ -1302,7 +1289,7 @@ public class SpeedBuilders extends SoloGame
if (Manager.isSpectator(event.getPlayer()) || GetTeamList().get(1).HasPlayer(event.getPlayer())) if (Manager.isSpectator(event.getPlayer()) || GetTeamList().get(1).HasPlayer(event.getPlayer()))
event.setCancelled(true); event.setCancelled(true);
} }
@EventHandler @EventHandler
public void stopGuardianSpecPlace(BlockPlaceEvent event) public void stopGuardianSpecPlace(BlockPlaceEvent event)
{ {
@ -1312,7 +1299,7 @@ public class SpeedBuilders extends SoloGame
if (Manager.isSpectator(event.getPlayer()) || GetTeamList().get(1).HasPlayer(event.getPlayer())) if (Manager.isSpectator(event.getPlayer()) || GetTeamList().get(1).HasPlayer(event.getPlayer()))
event.setCancelled(true); event.setCancelled(true);
} }
@EventHandler @EventHandler
public void stopEntityChangeBlock(EntityChangeBlockEvent event) public void stopEntityChangeBlock(EntityChangeBlockEvent event)
{ {
@ -1321,7 +1308,7 @@ public class SpeedBuilders extends SoloGame
event.setCancelled(true); event.setCancelled(true);
} }
@EventHandler @EventHandler
public void stopBlockFade(BlockFadeEvent event) public void stopBlockFade(BlockFadeEvent event)
{ {
@ -1330,7 +1317,7 @@ public class SpeedBuilders extends SoloGame
event.setCancelled(true); event.setCancelled(true);
} }
@EventHandler @EventHandler
public void stopBlockBurn(BlockBurnEvent event) public void stopBlockBurn(BlockBurnEvent event)
{ {
@ -1339,7 +1326,7 @@ public class SpeedBuilders extends SoloGame
event.setCancelled(true); event.setCancelled(true);
} }
@EventHandler @EventHandler
public void stopLeavesDecay(LeavesDecayEvent event) public void stopLeavesDecay(LeavesDecayEvent event)
{ {
@ -1348,7 +1335,7 @@ public class SpeedBuilders extends SoloGame
event.setCancelled(true); event.setCancelled(true);
} }
@EventHandler @EventHandler
public void stopBlockForm(BlockFormEvent event) public void stopBlockForm(BlockFormEvent event)
{ {
@ -1357,7 +1344,7 @@ public class SpeedBuilders extends SoloGame
event.setCancelled(true); event.setCancelled(true);
} }
@EventHandler @EventHandler
public void stopBlockSpread(BlockSpreadEvent event) public void stopBlockSpread(BlockSpreadEvent event)
{ {
@ -1366,7 +1353,7 @@ public class SpeedBuilders extends SoloGame
event.setCancelled(true); event.setCancelled(true);
} }
@EventHandler @EventHandler
public void stopLiquidLeaks(BlockFromToEvent event) public void stopLiquidLeaks(BlockFromToEvent event)
{ {
@ -1376,7 +1363,7 @@ public class SpeedBuilders extends SoloGame
event.setCancelled(true); event.setCancelled(true);
} }
} }
@EventHandler @EventHandler
public void stopPhysics(BlockPhysicsEvent event) public void stopPhysics(BlockPhysicsEvent event)
{ {
@ -1385,7 +1372,7 @@ public class SpeedBuilders extends SoloGame
event.setCancelled(true); event.setCancelled(true);
} }
@EventHandler @EventHandler
public void onPlayerBucketEmpty(PlayerBucketEmptyEvent event) public void onPlayerBucketEmpty(PlayerBucketEmptyEvent event)
{ {
@ -1407,7 +1394,7 @@ public class SpeedBuilders extends SoloGame
UtilPlayer.message(event.getPlayer(), F.main("Build", "Cannot build outside your area!")); UtilPlayer.message(event.getPlayer(), F.main("Build", "Cannot build outside your area!"));
} }
} }
@EventHandler @EventHandler
public void onPlayerBucketFill(PlayerBucketFillEvent event) public void onPlayerBucketFill(PlayerBucketFillEvent event)
{ {
@ -1429,7 +1416,7 @@ public class SpeedBuilders extends SoloGame
UtilPlayer.message(event.getPlayer(), F.main("Build", "Cannot build outside your area!")); UtilPlayer.message(event.getPlayer(), F.main("Build", "Cannot build outside your area!"));
} }
} }
@EventHandler @EventHandler
public void addMob(PlayerInteractEvent event) public void addMob(PlayerInteractEvent event)
{ {
@ -1471,7 +1458,7 @@ public class SpeedBuilders extends SoloGame
UtilInv.remove(event.getPlayer(), Material.MONSTER_EGG, (byte) event.getItem().getDurability(), 1); UtilInv.remove(event.getPlayer(), Material.MONSTER_EGG, (byte) event.getItem().getDurability(), 1);
} }
@EventHandler @EventHandler
public void stopCombust(EntityCombustEvent event) public void stopCombust(EntityCombustEvent event)
{ {
@ -1480,7 +1467,7 @@ public class SpeedBuilders extends SoloGame
event.setCancelled(true); event.setCancelled(true);
} }
//Add to guardians before arcade manager adds to spectator to trick it into thinking the player is "alive" //Add to guardians before arcade manager adds to spectator to trick it into thinking the player is "alive"
@EventHandler(priority = EventPriority.LOW) @EventHandler(priority = EventPriority.LOW)
public void joinAddGuardian(PlayerJoinEvent event) public void joinAddGuardian(PlayerJoinEvent event)
@ -1508,7 +1495,7 @@ public class SpeedBuilders extends SoloGame
} }
}, 1); }, 1);
} }
@Override @Override
public void EndCheck() public void EndCheck()
{ {
@ -1542,7 +1529,7 @@ public class SpeedBuilders extends SoloGame
SetState(GameState.End); SetState(GameState.End);
} }
} }
@Override @Override
public List<Player> getLosers() public List<Player> getLosers()
{ {
@ -1558,7 +1545,7 @@ public class SpeedBuilders extends SoloGame
return losers; return losers;
} }
@Override @Override
@EventHandler @EventHandler
public void ScoreboardUpdate(UpdateEvent event) public void ScoreboardUpdate(UpdateEvent event)

View File

@ -6,5 +6,5 @@ public enum SpeedBuildersState
VIEWING, VIEWING,
BUILDING, BUILDING,
REVIEWING; REVIEWING;
} }

View File

@ -22,17 +22,17 @@ import org.bukkit.material.Stairs;
public class BuildData public class BuildData
{ {
public SpeedBuilders Game; public SpeedBuilders Game;
public Location BuildMin; public Location BuildMin;
public BlockState[][][] Build; public BlockState[][][] Build;
public BlockState[][] Ground; public BlockState[][] Ground;
//Store stair shapes for stair fix //Store stair shapes for stair fix
public EnumStairShape[][][] StairShapes; public EnumStairShape[][][] StairShapes;
public String BuildText; public String BuildText;
public ArrayList<MobData> Mobs = new ArrayList<MobData>(); public ArrayList<MobData> Mobs = new ArrayList<MobData>();
private int _timeAdd = 0; private int _timeAdd = 0;

View File

@ -24,19 +24,19 @@ import org.bukkit.material.Door;
public class DemolitionData public class DemolitionData
{ {
public RecreationData Parent; public RecreationData Parent;
public NautHashMap<Block, BlockState> Blocks; public NautHashMap<Block, BlockState> Blocks;
public ArrayList<Entity> Mobs; public ArrayList<Entity> Mobs;
public long Start; public long Start;
private Hologram _hologram; private Hologram _hologram;
private boolean _flickerAir = true; private boolean _flickerAir = true;
private long _lastFlicker = System.currentTimeMillis(); private long _lastFlicker = System.currentTimeMillis();
public DemolitionData(RecreationData parent, ArrayList<Block> blocks, ArrayList<Entity> mobs) public DemolitionData(RecreationData parent, ArrayList<Block> blocks, ArrayList<Entity> mobs)
{ {
Parent = parent; Parent = parent;
@ -53,7 +53,7 @@ public class DemolitionData
spawnHologram(); spawnHologram();
} }
public void spawnHologram() public void spawnHologram()
{ {
Location loc = Parent.getMidpoint(); Location loc = Parent.getMidpoint();
@ -67,14 +67,14 @@ public class DemolitionData
_hologram.start(); _hologram.start();
} }
public void despawnHologram() public void despawnHologram()
{ {
_hologram.stop(); _hologram.stop();
_hologram = null; _hologram = null;
} }
public void update() public void update()
{ {
int secondsLeft = (int) Math.ceil((3000 - (System.currentTimeMillis() - Start)) / 1000.0D); int secondsLeft = (int) Math.ceil((3000 - (System.currentTimeMillis() - Start)) / 1000.0D);
@ -110,7 +110,7 @@ public class DemolitionData
if (secondsLeft == 0) if (secondsLeft == 0)
breakBlocks(); breakBlocks();
} }
public void cancelBreak() public void cancelBreak()
{ {
despawnHologram(); despawnHologram();
@ -127,7 +127,7 @@ public class DemolitionData
Parent.BlocksForDemolition.remove(this); Parent.BlocksForDemolition.remove(this);
} }
public void breakBlocks() public void breakBlocks()
{ {
despawnHologram(); despawnHologram();
@ -207,5 +207,5 @@ public class DemolitionData
Parent.Game.checkPerfectBuild(Parent.Player); Parent.Game.checkPerfectBuild(Parent.Player);
} }
} }

View File

@ -4,13 +4,13 @@ import org.bukkit.entity.EntityType;
public class MobData public class MobData
{ {
public EntityType EntityType; public EntityType EntityType;
public int DX; public int DX;
public int DY; public int DY;
public int DZ; public int DZ;
public MobData(EntityType entityType, int dx, int dy, int dz) public MobData(EntityType entityType, int dx, int dy, int dz)
{ {
EntityType = entityType; EntityType = entityType;
@ -19,5 +19,5 @@ public class MobData
DY = dy; DY = dy;
DZ = dz; DZ = dz;
} }
} }

View File

@ -34,26 +34,26 @@ import org.bukkit.util.Vector;
public class RecreationData public class RecreationData
{ {
public SpeedBuilders Game; public SpeedBuilders Game;
public Player Player; public Player Player;
public BlockState[][] DefaultGround; public BlockState[][] DefaultGround;
public Location OriginalBuildLocation; public Location OriginalBuildLocation;
public Location CornerA; public Location CornerA;
public Location CornerB; public Location CornerB;
public Location PlayerSpawn; public Location PlayerSpawn;
public NautHashMap<Item, Long> DroppedItems = new NautHashMap<Item, Long>(); public NautHashMap<Item, Long> DroppedItems = new NautHashMap<Item, Long>();
public ArrayList<DemolitionData> BlocksForDemolition = new ArrayList<DemolitionData>(); public ArrayList<DemolitionData> BlocksForDemolition = new ArrayList<DemolitionData>();
public ArrayList<Entity> Mobs = new ArrayList<Entity>(); public ArrayList<Entity> Mobs = new ArrayList<Entity>();
public RecreationData(SpeedBuilders game, Player player, Location loc, Location playerSpawn) public RecreationData(SpeedBuilders game, Player player, Location loc, Location playerSpawn)
{ {
Game = game; Game = game;
@ -77,7 +77,7 @@ public class RecreationData
} }
} }
} }
public boolean inBuildArea(Block block) public boolean inBuildArea(Block block)
{ {
if (block.getX() < Math.min(CornerA.getBlockX(), CornerB.getBlockX())) if (block.getX() < Math.min(CornerA.getBlockX(), CornerB.getBlockX()))
@ -100,7 +100,7 @@ public class RecreationData
return true; return true;
} }
public boolean inBuildArea(Location loc) public boolean inBuildArea(Location loc)
{ {
if (loc.getX() < Math.min(CornerA.getBlockX(), CornerB.getBlockX())) if (loc.getX() < Math.min(CornerA.getBlockX(), CornerB.getBlockX()))
@ -123,7 +123,7 @@ public class RecreationData
return true; return true;
} }
public void clearBuildArea(boolean resetGround) public void clearBuildArea(boolean resetGround)
{ {
for (Block block : getBlocks()) for (Block block : getBlocks())
@ -149,7 +149,7 @@ public class RecreationData
} }
} }
} }
public void pasteBuildData(BuildData buildData) public void pasteBuildData(BuildData buildData)
{ {
clearBuildArea(true); clearBuildArea(true);
@ -189,7 +189,7 @@ public class RecreationData
Game.CreatureAllowOverride = false; Game.CreatureAllowOverride = false;
} }
public void breakAndDropItems() public void breakAndDropItems()
{ {
for (Block block : getBlocks()) for (Block block : getBlocks())
@ -263,7 +263,7 @@ public class RecreationData
item.setVelocity(Player.getLocation().toVector().subtract(item.getLocation().toVector()).normalize().add(new Vector(0, 0.4, 0)).multiply(mult)); item.setVelocity(Player.getLocation().toVector().subtract(item.getLocation().toVector()).normalize().add(new Vector(0, 0.4, 0)).multiply(mult));
} }
} }
public boolean isEmptyBuild(BuildData buildData) public boolean isEmptyBuild(BuildData buildData)
{ {
for (Block block : getBlocks()) for (Block block : getBlocks())
@ -277,7 +277,7 @@ public class RecreationData
return true; return true;
} }
public int calculateScoreFromBuild(BuildData buildData) public int calculateScoreFromBuild(BuildData buildData)
{ {
int score = 0; int score = 0;
@ -348,17 +348,17 @@ public class RecreationData
return score; return score;
} }
public Location getMidpoint() public Location getMidpoint()
{ {
return UtilAlg.getMidpoint(CornerA, CornerB.clone().add(1, 1, 1)); return UtilAlg.getMidpoint(CornerA, CornerB.clone().add(1, 1, 1));
} }
public List<Block> getBlocks() public List<Block> getBlocks()
{ {
return UtilBlock.getInBoundingBox(CornerA, CornerB); return UtilBlock.getInBoundingBox(CornerA, CornerB);
} }
public boolean isQueuedForDemolition(Block block) public boolean isQueuedForDemolition(Block block)
{ {
for (DemolitionData demolition : BlocksForDemolition) for (DemolitionData demolition : BlocksForDemolition)
@ -369,7 +369,7 @@ public class RecreationData
return false; return false;
} }
public boolean isQueuedForDemolition(Entity entity) public boolean isQueuedForDemolition(Entity entity)
{ {
for (DemolitionData demolition : BlocksForDemolition) for (DemolitionData demolition : BlocksForDemolition)
@ -380,7 +380,7 @@ public class RecreationData
return false; return false;
} }
public void addToDemolition(Block block) public void addToDemolition(Block block)
{ {
if (isQueuedForDemolition(block)) if (isQueuedForDemolition(block))
@ -418,7 +418,7 @@ public class RecreationData
BlocksForDemolition.add(new DemolitionData(this, blocks, new ArrayList<Entity>())); BlocksForDemolition.add(new DemolitionData(this, blocks, new ArrayList<Entity>()));
} }
public void addToDemolition(Entity entity) public void addToDemolition(Entity entity)
{ {
if (isQueuedForDemolition(entity)) if (isQueuedForDemolition(entity))
@ -429,5 +429,5 @@ public class RecreationData
BlocksForDemolition.add(new DemolitionData(this, new ArrayList<Block>(), mobs)); BlocksForDemolition.add(new DemolitionData(this, new ArrayList<Block>(), mobs));
} }
} }

View File

@ -20,7 +20,7 @@ public class DefaultKit extends Kit
}, },
new Perk[] new Perk[]
{ {
}, },
EntityType.ZOMBIE, null); EntityType.ZOMBIE, null);
} }