Renamed to Speed Builders from Speed Builder.

This commit is contained in:
Virizion 2016-01-22 00:20:58 -05:00
parent 0da921f3d2
commit 5c83f5c1e5
16 changed files with 118 additions and 91 deletions

View File

@ -856,29 +856,29 @@ public enum Achievement
new int[]{30},
AchievementCategory.TYPE_WARS),
SPEED_BUILDER_SPEED_MASTER("Speed Master", 800,
new String[]{"Speed Builder.Wins"},
SPEED_BUILDERS_SPEED_MASTER("Speed Master", 800,
new String[]{"Speed Builders.Wins"},
new String[]{"Win 10 Games of Speed Builder"},
new int[]{10},
AchievementCategory.SPEED_BUILDER),
AchievementCategory.SPEED_BUILDERS),
SPEED_BUILDER_DEPENDABLE("Dependable", 1200,
new String[]{"Speed Builder.PerfectBuild"},
SPEED_BUILDERS_DEPENDABLE("Dependable", 1200,
new String[]{"Speed Builders.PerfectBuild"},
new String[]{"Complete 10 Perfect Builds"},
new int[]{10},
AchievementCategory.SPEED_BUILDER),
AchievementCategory.SPEED_BUILDERS),
SPEED_BUILDER_FIRST_BUILD("First Build!", 1800,
new String[]{"Speed Builder.PerfectFirst"},
SPEED_BUILDERS_FIRST_BUILD("First Build!", 1800,
new String[]{"Speed Builders.PerfectFirst"},
new String[]{"Be the first person to complete a build in the game 10 times"},
new int[]{10},
AchievementCategory.SPEED_BUILDER),
AchievementCategory.SPEED_BUILDERS),
SPEED_BUILDER_PERFECTIONIST("Perfectionist", 2200,
new String[]{"Speed Builder.PerfectWins"},
SPEED_BUILDERS_PERFECTIONIST("Perfectionist", 2200,
new String[]{"Speed Builders.PerfectWins"},
new String[]{"Win a game of Speed Builder with a perfect build every round"},
new int[]{1},
AchievementCategory.SPEED_BUILDER);
AchievementCategory.SPEED_BUILDERS);
private String _name;
private String[] _desc;

View File

@ -159,7 +159,7 @@ public enum AchievementCategory
new StatDisplay[] {StatDisplay.WINS, StatDisplay.GAMES_PLAYED, new StatDisplay("Minions killed", "MinionKills"), new StatDisplay("Words Per Minute", false, true, "MinionKills", "TimeInGame"), StatDisplay.GEMS_EARNED},
Material.NAME_TAG, 0, GameCategory.CLASSICS, null),
SPEED_BUILDER("Speed Builder", null,
SPEED_BUILDERS("Speed Builders", null,
new StatDisplay[] {StatDisplay.WINS, StatDisplay.GAMES_PLAYED, StatDisplay.GEMS_EARNED},
Material.QUARTZ_BLOCK, 0, GameCategory.ARCADE, null);

View File

@ -68,7 +68,7 @@ public enum GameDisplay
Lobbers("Bomb Lobbers", Material.FIREBALL, (byte) 0, GameCategory.ARCADE, 54),
SpeedBuilder("Speed Builder", Material.QUARTZ_BLOCK, (byte) 0, GameCategory.ARCADE, 60),
SpeedBuilders("Speed Builders", Material.QUARTZ_BLOCK, (byte) 0, GameCategory.ARCADE, 60),
ChampionsCTF("Champions CTF", "Champions", Material.BANNER, DyeColor.RED.getDyeData(), GameCategory.CHAMPIONS, 56),
BouncyBalls("Bouncy Balls", Material.SLIME_BALL, (byte)0, GameCategory.ARCADE, 57),

View File

@ -52,7 +52,7 @@ import nautilus.game.arcade.game.games.smash.TeamSuperSmash;
import nautilus.game.arcade.game.games.snake.Snake;
import nautilus.game.arcade.game.games.sneakyassassins.SneakyAssassins;
import nautilus.game.arcade.game.games.snowfight.SnowFight;
import nautilus.game.arcade.game.games.speedbuilder.SpeedBuilder;
import nautilus.game.arcade.game.games.speedbuilders.SpeedBuilders;
import nautilus.game.arcade.game.games.spleef.Spleef;
import nautilus.game.arcade.game.games.spleef.SpleefTeams;
import nautilus.game.arcade.game.games.squidshooter.SquidShooter;
@ -114,7 +114,7 @@ public enum GameType
Snake(Snake.class, GameDisplay.Snake),
SneakyAssassins(SneakyAssassins.class, GameDisplay.SneakyAssassins),
SnowFight(SnowFight.class, GameDisplay.SnowFight),
SpeedBuilder(SpeedBuilder.class, GameDisplay.SpeedBuilder),
SpeedBuilders(SpeedBuilders.class, GameDisplay.SpeedBuilders),
Spleef(Spleef.class, GameDisplay.Spleef),
SpleefTeams(SpleefTeams.class, GameDisplay.SpleefTeams),
SquidShooter(SquidShooter.class, GameDisplay.SquidShooter),

View File

@ -1,10 +0,0 @@
package nautilus.game.arcade.game.games.speedbuilder;
public enum SpeedBuilderState
{
VIEWING,
BUILDING,
REVIEWING;
}

View File

@ -1,15 +1,15 @@
package nautilus.game.arcade.game.games.speedbuilder.stattrackers;
import nautilus.game.arcade.game.games.speedbuilder.SpeedBuilder;
import nautilus.game.arcade.game.games.speedbuilder.events.PerfectBuildEvent;
import nautilus.game.arcade.game.games.speedbuilders.SpeedBuilders;
import nautilus.game.arcade.game.games.speedbuilders.events.PerfectBuildEvent;
import nautilus.game.arcade.stats.StatTracker;
import org.bukkit.event.EventHandler;
public class DependableTracker extends StatTracker<SpeedBuilder>
public class DependableTracker extends StatTracker<SpeedBuilders>
{
public DependableTracker(SpeedBuilder game)
public DependableTracker(SpeedBuilders game)
{
super(game);
}

View File

@ -2,16 +2,16 @@ package nautilus.game.arcade.game.games.speedbuilder.stattrackers;
import org.bukkit.event.EventHandler;
import nautilus.game.arcade.game.games.speedbuilder.SpeedBuilder;
import nautilus.game.arcade.game.games.speedbuilder.events.PerfectBuildEvent;
import nautilus.game.arcade.game.games.speedbuilders.SpeedBuilders;
import nautilus.game.arcade.game.games.speedbuilders.events.PerfectBuildEvent;
import nautilus.game.arcade.stats.StatTracker;
public class FirstBuildTracker extends StatTracker<SpeedBuilder>
public class FirstBuildTracker extends StatTracker<SpeedBuilders>
{
private boolean _first = true;
public FirstBuildTracker(SpeedBuilder game)
public FirstBuildTracker(SpeedBuilders game)
{
super(game);
}

View File

@ -5,21 +5,21 @@ import java.util.Map.Entry;
import mineplex.core.common.util.NautHashMap;
import nautilus.game.arcade.events.GameStateChangeEvent;
import nautilus.game.arcade.game.Game.GameState;
import nautilus.game.arcade.game.games.speedbuilder.SpeedBuilder;
import nautilus.game.arcade.game.games.speedbuilder.events.PerfectBuildEvent;
import nautilus.game.arcade.game.games.speedbuilders.SpeedBuilders;
import nautilus.game.arcade.game.games.speedbuilders.events.PerfectBuildEvent;
import nautilus.game.arcade.stats.StatTracker;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
public class PerfectionistTracker extends StatTracker<SpeedBuilder>
public class PerfectionistTracker extends StatTracker<SpeedBuilders>
{
private SpeedBuilder _game;
private SpeedBuilders _game;
private NautHashMap<Player, Integer> _perfectBuilds = new NautHashMap<Player, Integer>();
public PerfectionistTracker(SpeedBuilder game)
public PerfectionistTracker(SpeedBuilders game)
{
super(game);

View File

@ -1,4 +1,4 @@
package nautilus.game.arcade.game.games.speedbuilder;
package nautilus.game.arcade.game.games.speedbuilders;
import java.util.ArrayList;
import java.util.HashSet;
@ -31,15 +31,15 @@ import nautilus.game.arcade.events.GameStateChangeEvent;
import nautilus.game.arcade.game.GameTeam;
import nautilus.game.arcade.game.GameTeam.PlayerState;
import nautilus.game.arcade.game.SoloGame;
import nautilus.game.arcade.game.games.speedbuilder.data.BuildData;
import nautilus.game.arcade.game.games.speedbuilder.data.DemolitionData;
import nautilus.game.arcade.game.games.speedbuilder.data.MobData;
import nautilus.game.arcade.game.games.speedbuilder.data.RecreationData;
import nautilus.game.arcade.game.games.speedbuilder.events.PerfectBuildEvent;
import nautilus.game.arcade.game.games.speedbuilder.kits.DefaultKit;
import nautilus.game.arcade.game.games.speedbuilder.stattrackers.DependableTracker;
import nautilus.game.arcade.game.games.speedbuilder.stattrackers.FirstBuildTracker;
import nautilus.game.arcade.game.games.speedbuilder.stattrackers.PerfectionistTracker;
import nautilus.game.arcade.game.games.speedbuilders.data.BuildData;
import nautilus.game.arcade.game.games.speedbuilders.data.DemolitionData;
import nautilus.game.arcade.game.games.speedbuilders.data.MobData;
import nautilus.game.arcade.game.games.speedbuilders.data.RecreationData;
import nautilus.game.arcade.game.games.speedbuilders.events.PerfectBuildEvent;
import nautilus.game.arcade.game.games.speedbuilders.kits.DefaultKit;
import nautilus.game.arcade.kit.Kit;
import net.minecraft.server.v1_8_R3.PacketPlayOutGameStateChange;
@ -84,7 +84,7 @@ import org.bukkit.potion.PotionEffect;
import org.bukkit.potion.PotionEffectType;
import org.bukkit.util.Vector;
public class SpeedBuilder extends SoloGame
public class SpeedBuilders extends SoloGame
{
private static final String GUARDIAN_NAME = "Gwen the Guardian";
@ -94,7 +94,7 @@ public class SpeedBuilder extends SoloGame
public int BuildSizeMin1 = BuildSize - 1;
public int BuildSizePow3 = BuildSize * BuildSize * BuildSize;
private SpeedBuilderState _state = SpeedBuilderState.VIEWING;
private SpeedBuildersState _state = SpeedBuildersState.VIEWING;
private long _stateTime = System.currentTimeMillis();
private int _roundsPlayed;
@ -137,9 +137,9 @@ public class SpeedBuilder extends SoloGame
private double _standMoveProgress;
private Location _standStart;
public SpeedBuilder(ArcadeManager manager)
public SpeedBuilders(ArcadeManager manager)
{
super(manager, GameType.SpeedBuilder,
super(manager, GameType.SpeedBuilders,
new Kit[]
{
new DefaultKit(manager)
@ -204,13 +204,13 @@ public class SpeedBuilder extends SoloGame
}
}
public void setSpeedBuilderState(SpeedBuilderState state)
public void setSpeedBuilderState(SpeedBuildersState state)
{
_state = state;
_stateTime = System.currentTimeMillis();
}
public SpeedBuilderState getSpeedBuilderState()
public SpeedBuildersState getSpeedBuilderState()
{
return _state;
}
@ -476,7 +476,7 @@ public class SpeedBuilder extends SoloGame
_roundsPlayed++;
setSpeedBuilderState(SpeedBuilderState.VIEWING);
setSpeedBuilderState(SpeedBuildersState.VIEWING);
}
@EventHandler
@ -508,7 +508,7 @@ public class SpeedBuilder extends SoloGame
@EventHandler
public void onBlockPlace(BlockPlaceEvent event)
{
if (_state != SpeedBuilderState.BUILDING)
if (_state != SpeedBuildersState.BUILDING)
return;
if (!_buildRecreations.containsKey(event.getPlayer()))
@ -578,7 +578,7 @@ public class SpeedBuilder extends SoloGame
if (!IsLive())
return;
if (_state != SpeedBuilderState.BUILDING)
if (_state != SpeedBuildersState.BUILDING)
return;
if (!_buildRecreations.containsKey(player))
@ -589,7 +589,7 @@ public class SpeedBuilder extends SoloGame
if (_buildRecreations.get(player).calculateScoreFromBuild(_currentBuild) == _currentBuild.getPerfectScore())
{
PerfectBuildEvent perfectBuildEvent = new PerfectBuildEvent(player, SpeedBuilder.this);
PerfectBuildEvent perfectBuildEvent = new PerfectBuildEvent(player, SpeedBuilders.this);
Bukkit.getServer().getPluginManager().callEvent(perfectBuildEvent);
@ -608,7 +608,7 @@ public class SpeedBuilder extends SoloGame
@EventHandler(priority = EventPriority.HIGHEST)
public void onPlayerPickupItem(PlayerPickupItemEvent event)
{
if (_state != SpeedBuilderState.BUILDING)
if (_state != SpeedBuildersState.BUILDING)
return;
if (!_buildRecreations.containsKey(event.getPlayer()))
@ -696,7 +696,7 @@ public class SpeedBuilder extends SoloGame
if (!IsLive())
return;
if (_state == SpeedBuilderState.VIEWING)
if (_state == SpeedBuildersState.VIEWING)
{
if (UtilTime.elapsed(_stateTime, _viewTime * 1000))
{
@ -718,10 +718,10 @@ public class SpeedBuilder extends SoloGame
UtilPlayer.message(player, F.main("Build", "Recreate the build shown."));
}
setSpeedBuilderState(SpeedBuilderState.BUILDING);
setSpeedBuilderState(SpeedBuildersState.BUILDING);
}
}
else if (_state == SpeedBuilderState.BUILDING)
else if (_state == SpeedBuildersState.BUILDING)
{
if (UtilTime.elapsed(_stateTime, _buildTime * 1000))
{
@ -797,7 +797,7 @@ public class SpeedBuilder extends SoloGame
pasteBuildInCenter(_currentBuild);
setSpeedBuilderState(SpeedBuilderState.REVIEWING);
setSpeedBuilderState(SpeedBuildersState.REVIEWING);
for (Player player : GetTeamList().get(0).GetPlayers(true))
{
@ -807,7 +807,7 @@ public class SpeedBuilder extends SoloGame
}
}
}
else if (_state == SpeedBuilderState.REVIEWING)
else if (_state == SpeedBuildersState.REVIEWING)
{
if (_toEliminate.isEmpty())
{
@ -884,7 +884,7 @@ public class SpeedBuilder extends SoloGame
UtilTextMiddle.display("", C.cGold + _currentBuild.BuildText, 0, 80, 10);
setSpeedBuilderState(SpeedBuilderState.VIEWING);
setSpeedBuilderState(SpeedBuildersState.VIEWING);
}
else
{
@ -958,7 +958,7 @@ public class SpeedBuilder extends SoloGame
if (!IsLive())
return;
if (_state != SpeedBuilderState.BUILDING)
if (_state != SpeedBuildersState.BUILDING)
return;
long timeLeft = 1000 * _buildTime - (System.currentTimeMillis() - _stateTime);
@ -978,7 +978,7 @@ public class SpeedBuilder extends SoloGame
if (!IsLive())
return;
if (_state != SpeedBuilderState.BUILDING)
if (_state != SpeedBuildersState.BUILDING)
return;
if (UtilTime.elapsed(_stateTime, 1000 * _buildCountStage))
@ -1009,7 +1009,7 @@ public class SpeedBuilder extends SoloGame
if (!IsLive())
return;
if (_state != SpeedBuilderState.VIEWING)
if (_state != SpeedBuildersState.VIEWING)
return;
if (UtilTime.elapsed(_stateTime, _viewCountStage * 1000))
@ -1026,7 +1026,7 @@ public class SpeedBuilder extends SoloGame
@EventHandler
public void markBlockForDemolition(PlayerInteractEvent event)
{
if (_state != SpeedBuilderState.BUILDING)
if (_state != SpeedBuildersState.BUILDING)
return;
if (!_buildRecreations.containsKey(event.getPlayer()))
@ -1055,7 +1055,7 @@ public class SpeedBuilder extends SoloGame
Player player = (Player) event.getDamager();
if (_state != SpeedBuilderState.BUILDING)
if (_state != SpeedBuildersState.BUILDING)
return;
if (!_buildRecreations.containsKey(player))
@ -1082,7 +1082,7 @@ public class SpeedBuilder extends SoloGame
for (DemolitionData demolition : blocksForDemolition)
{
if (_state != SpeedBuilderState.BUILDING || _perfectBuild.containsKey(demolition.Parent.Player))
if (_state != SpeedBuildersState.BUILDING || _perfectBuild.containsKey(demolition.Parent.Player))
demolition.cancelBreak();
else
demolition.update();
@ -1111,7 +1111,7 @@ public class SpeedBuilder extends SoloGame
if (!InProgress())
return;
if (_state != SpeedBuilderState.BUILDING && _state != SpeedBuilderState.VIEWING)
if (_state != SpeedBuildersState.BUILDING && _state != SpeedBuildersState.VIEWING)
return;
if (_buildRecreations.isEmpty())
@ -1235,36 +1235,54 @@ public class SpeedBuilder extends SoloGame
@EventHandler
public void stopEntityChangeBlock(EntityChangeBlockEvent event)
{
if (!IsLive())
return;
event.setCancelled(true);
}
@EventHandler
public void stopBlockFade(BlockFadeEvent event)
{
if (!IsLive())
return;
event.setCancelled(true);
}
@EventHandler
public void stopBlockBurn(BlockBurnEvent event)
{
if (!IsLive())
return;
event.setCancelled(true);
}
@EventHandler
public void stopLeavesDecay(LeavesDecayEvent event)
{
if (!IsLive())
return;
event.setCancelled(true);
}
@EventHandler
public void stopBlockForm(BlockFormEvent event)
{
if (!IsLive())
return;
event.setCancelled(true);
}
@EventHandler
public void stopBlockSpread(BlockSpreadEvent event)
{
if (!IsLive())
return;
event.setCancelled(true);
}
@ -1281,6 +1299,9 @@ public class SpeedBuilder extends SoloGame
@EventHandler
public void stopPhysics(BlockPhysicsEvent event)
{
if (!IsLive())
return;
event.setCancelled(true);
}
@ -1290,7 +1311,7 @@ public class SpeedBuilder extends SoloGame
if (!IsLive())
return;
if (_state != SpeedBuilderState.BUILDING)
if (_state != SpeedBuildersState.BUILDING)
return;
if (!_buildRecreations.containsKey(event.getPlayer()))
@ -1312,7 +1333,7 @@ public class SpeedBuilder extends SoloGame
if (!IsLive())
return;
if (_state != SpeedBuilderState.BUILDING)
if (_state != SpeedBuildersState.BUILDING)
return;
if (!_buildRecreations.containsKey(event.getPlayer()))
@ -1334,7 +1355,7 @@ public class SpeedBuilder extends SoloGame
if (!IsLive())
return;
if (_state != SpeedBuilderState.BUILDING)
if (_state != SpeedBuildersState.BUILDING)
return;
if (!UtilEvent.isAction(event, ActionType.R_BLOCK))
@ -1373,6 +1394,9 @@ public class SpeedBuilder extends SoloGame
@EventHandler
public void stopCombust(EntityCombustEvent event)
{
if (!IsLive())
return;
event.setCancelled(true);
}
@ -1444,7 +1468,7 @@ public class SpeedBuilder extends SoloGame
Scoreboard.WriteBlank();
if (_state == SpeedBuilderState.BUILDING)
if (_state == SpeedBuildersState.BUILDING)
{
long timeLeft = 1000 * _buildTime - (System.currentTimeMillis() - _stateTime);

View File

@ -0,0 +1,10 @@
package nautilus.game.arcade.game.games.speedbuilders;
public enum SpeedBuildersState
{
VIEWING,
BUILDING,
REVIEWING;
}

View File

@ -1,9 +1,9 @@
package nautilus.game.arcade.game.games.speedbuilder.data;
package nautilus.game.arcade.game.games.speedbuilders.data;
import java.util.ArrayList;
import mineplex.core.common.util.MapUtil;
import nautilus.game.arcade.game.games.speedbuilder.SpeedBuilder;
import nautilus.game.arcade.game.games.speedbuilders.SpeedBuilders;
import net.minecraft.server.v1_8_R3.BlockPosition;
import net.minecraft.server.v1_8_R3.BlockStairs;
import net.minecraft.server.v1_8_R3.BlockStairs.EnumStairShape;
@ -22,7 +22,7 @@ import org.bukkit.material.Stairs;
public class BuildData
{
public SpeedBuilder Game;
public SpeedBuilders Game;
public Location BuildMin;
@ -36,7 +36,7 @@ public class BuildData
public ArrayList<MobData> Mobs = new ArrayList<MobData>();
public BuildData(Location loc, String buildText, SpeedBuilder game)
public BuildData(Location loc, String buildText, SpeedBuilders game)
{
Build = new BlockState[game.BuildSize][game.BuildSize][game.BuildSize];
Ground = new BlockState[game.BuildSize][game.BuildSize];

View File

@ -1,4 +1,4 @@
package nautilus.game.arcade.game.games.speedbuilder.data;
package nautilus.game.arcade.game.games.speedbuilders.data;
import java.util.ArrayList;

View File

@ -1,4 +1,4 @@
package nautilus.game.arcade.game.games.speedbuilder.data;
package nautilus.game.arcade.game.games.speedbuilders.data;
import org.bukkit.entity.EntityType;

View File

@ -1,4 +1,4 @@
package nautilus.game.arcade.game.games.speedbuilder.data;
package nautilus.game.arcade.game.games.speedbuilders.data;
import java.util.ArrayList;
import java.util.List;
@ -9,7 +9,7 @@ import mineplex.core.common.util.UtilAlg;
import mineplex.core.common.util.UtilBlock;
import mineplex.core.common.util.UtilEnt;
import mineplex.core.common.util.UtilMath;
import nautilus.game.arcade.game.games.speedbuilder.SpeedBuilder;
import nautilus.game.arcade.game.games.speedbuilders.SpeedBuilders;
import net.minecraft.server.v1_8_R3.BlockPosition;
import net.minecraft.server.v1_8_R3.BlockStairs;
import net.minecraft.server.v1_8_R3.BlockStairs.EnumStairShape;
@ -35,7 +35,7 @@ import org.bukkit.util.Vector;
public class RecreationData
{
public SpeedBuilder Game;
public SpeedBuilders Game;
public Player Player;
@ -54,7 +54,7 @@ public class RecreationData
public ArrayList<Entity> Mobs = new ArrayList<Entity>();
public RecreationData(SpeedBuilder game, Player player, Location loc, Location playerSpawn)
public RecreationData(SpeedBuilders game, Player player, Location loc, Location playerSpawn)
{
Game = game;
@ -272,7 +272,10 @@ public class RecreationData
return false;
}
return !buildData.Mobs.isEmpty() && Mobs.isEmpty();
if (!buildData.Mobs.isEmpty())
return Mobs.isEmpty();
return true;
}
public int calculateScoreFromBuild(BuildData buildData)

View File

@ -1,6 +1,6 @@
package nautilus.game.arcade.game.games.speedbuilder.events;
package nautilus.game.arcade.game.games.speedbuilders.events;
import nautilus.game.arcade.game.games.speedbuilder.SpeedBuilder;
import nautilus.game.arcade.game.games.speedbuilders.SpeedBuilders;
import org.bukkit.entity.Player;
import org.bukkit.event.Event;
@ -12,9 +12,9 @@ public class PerfectBuildEvent extends Event
private static final HandlerList handlers = new HandlerList();
private Player _player;
private SpeedBuilder _game;
private SpeedBuilders _game;
public PerfectBuildEvent(Player player, SpeedBuilder game)
public PerfectBuildEvent(Player player, SpeedBuilders game)
{
_player = player;
_game = game;
@ -25,7 +25,7 @@ public class PerfectBuildEvent extends Event
return _player;
}
public SpeedBuilder getGame()
public SpeedBuilders getGame()
{
return _game;
}

View File

@ -1,4 +1,4 @@
package nautilus.game.arcade.game.games.speedbuilder.kits;
package nautilus.game.arcade.game.games.speedbuilders.kits;
import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.kit.Kit;