More tutorial tweaking
This commit is contained in:
parent
a1f284670a
commit
e11a9379b9
@ -486,6 +486,7 @@ public class NpcManager extends MiniPlugin
|
|||||||
public void removeFakeNpc(Npc npc)
|
public void removeFakeNpc(Npc npc)
|
||||||
{
|
{
|
||||||
_npcs.remove(npc);
|
_npcs.remove(npc);
|
||||||
|
npc.getEntity().remove();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void loadNpcs() throws SQLException
|
public void loadNpcs() throws SQLException
|
||||||
|
@ -130,7 +130,7 @@ public class Clans extends JavaPlugin
|
|||||||
new Explosion(this, blockRestore);
|
new Explosion(this, blockRestore);
|
||||||
new InventoryManager(this, _clientManager);
|
new InventoryManager(this, _clientManager);
|
||||||
ResourcePackManager resourcePackManager = new ResourcePackManager(this, portal);
|
ResourcePackManager resourcePackManager = new ResourcePackManager(this, portal);
|
||||||
resourcePackManager.setResourcePack("http://garblox.com/files/b/ResClans.zip", "http://garblox.com/files/mineplex/ResClans19.zip", true);
|
resourcePackManager.setResourcePack("http://phinary.ca/ResClans.zip", "http://phinary.ca/ResClans19.zip", true);
|
||||||
|
|
||||||
// Enable custom-gear related managers
|
// Enable custom-gear related managers
|
||||||
new CustomTagFix(this, packetHandler);
|
new CustomTagFix(this, packetHandler);
|
||||||
|
@ -821,7 +821,7 @@ public class ClansManager extends MiniClientPlugin<ClientClan>implements IRelati
|
|||||||
|
|
||||||
List<Player> recipients = new ArrayList<>();
|
List<Player> recipients = new ArrayList<>();
|
||||||
|
|
||||||
for (Player other : UtilServer.getPlayers())
|
for (Player other : event.getRecipients())
|
||||||
{
|
{
|
||||||
ClanInfo otherClan = _clanUtility.getClanByPlayer(other);
|
ClanInfo otherClan = _clanUtility.getClanByPlayer(other);
|
||||||
|
|
||||||
|
@ -159,7 +159,7 @@ public abstract class Tutorial implements Listener, ObjectiveListener
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
private void finish(Player player)
|
protected final void finish(Player player)
|
||||||
{
|
{
|
||||||
_objectives.forEach(objective -> objective.clean(player, getRegion(player)));
|
_objectives.forEach(objective -> objective.clean(player, getRegion(player)));
|
||||||
|
|
||||||
@ -281,7 +281,7 @@ public abstract class Tutorial implements Listener, ObjectiveListener
|
|||||||
|
|
||||||
for (Map.Entry<Player, TutorialSession> entry : _playerSessionMap.entrySet())
|
for (Map.Entry<Player, TutorialSession> entry : _playerSessionMap.entrySet())
|
||||||
{
|
{
|
||||||
String prefix = entry.getValue().incrementAndGetColorTick() % 2 == 0 ? C.cYellow : C.cGold;
|
String prefix = entry.getValue().incrementAndGetColorTick() % 2 == 0 ? C.cWhite : C.cGreen;
|
||||||
Objective objective = _objectives.get(entry.getValue().getObjectiveIndex());
|
Objective objective = _objectives.get(entry.getValue().getObjectiveIndex());
|
||||||
UtilTextBottom.display(prefix + objective.getDescription(entry.getKey()), entry.getKey());
|
UtilTextBottom.display(prefix + objective.getDescription(entry.getKey()), entry.getKey());
|
||||||
}
|
}
|
||||||
@ -297,12 +297,8 @@ public abstract class Tutorial implements Listener, ObjectiveListener
|
|||||||
|
|
||||||
for (Map.Entry<Player, TutorialSession> entry : _playerSessionMap.entrySet())
|
for (Map.Entry<Player, TutorialSession> entry : _playerSessionMap.entrySet())
|
||||||
{
|
{
|
||||||
String extra = _objectives.get(entry.getValue().getObjectiveIndex()).getExtraDescription(entry.getKey());
|
Player player = entry.getKey();
|
||||||
if (extra == null)
|
Objective objective = _objectives.get(entry.getValue().getObjectiveIndex());
|
||||||
{
|
|
||||||
// None defined.
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (entry.getValue().incrementAndGetTextSeconds() < 20)
|
if (entry.getValue().incrementAndGetTextSeconds() < 20)
|
||||||
{
|
{
|
||||||
@ -310,10 +306,7 @@ public abstract class Tutorial implements Listener, ObjectiveListener
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
UtilPlayer.message(entry.getKey(), C.cGold + C.Strike + "---------------------------------------------");
|
objective.displayChatMessages(player);
|
||||||
UtilPlayer.message(entry.getKey(), C.cGray + " " + extra);
|
|
||||||
UtilPlayer.message(entry.getKey(), C.cGold + C.Strike + "---------------------------------------------");
|
|
||||||
entry.getValue().setTextSeconds(0);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -327,6 +320,39 @@ public abstract class Tutorial implements Listener, ObjectiveListener
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setSpawnHologram(Player player, Location location, String... text)
|
||||||
|
{
|
||||||
|
if (_playerSessionMap.containsKey(player))
|
||||||
|
{
|
||||||
|
TutorialSession session = _playerSessionMap.get(player);
|
||||||
|
if (session.getSpawnHologram() == null && !session.isRemovedHologram())
|
||||||
|
{
|
||||||
|
Hologram hologram = new Hologram(_hologram, location, text);
|
||||||
|
session.setSpawnHologram(hologram);
|
||||||
|
hologram.start();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
session.getSpawnHologram().setText(text);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void removeSpawnHologram(Player player)
|
||||||
|
{
|
||||||
|
if (_playerSessionMap.containsKey(player))
|
||||||
|
{
|
||||||
|
TutorialSession session = _playerSessionMap.get(player);
|
||||||
|
if (session.getSpawnHologram() != null)
|
||||||
|
{
|
||||||
|
session.getSpawnHologram().stop();
|
||||||
|
session.setSpawnHologram(null);
|
||||||
|
}
|
||||||
|
|
||||||
|
session.setRemovedHologram(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public TutorialSession getTutorialSession(Player player)
|
public TutorialSession getTutorialSession(Player player)
|
||||||
{
|
{
|
||||||
return _playerSessionMap.get(player);
|
return _playerSessionMap.get(player);
|
||||||
|
@ -121,6 +121,15 @@ public class TutorialManager extends MiniPlugin implements ScoreboardElement
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void finishTutorial(Player player)
|
||||||
|
{
|
||||||
|
Tutorial tutorial = getTutorial(player);
|
||||||
|
if (tutorial != null)
|
||||||
|
{
|
||||||
|
tutorial.finish(player);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public boolean startTutorial(Player player, TutorialType type)
|
public boolean startTutorial(Player player, TutorialType type)
|
||||||
{
|
{
|
||||||
if (inTutorial(player))
|
if (inTutorial(player))
|
||||||
|
@ -9,6 +9,7 @@ import mineplex.core.hologram.Hologram;
|
|||||||
|
|
||||||
public class TutorialSession
|
public class TutorialSession
|
||||||
{
|
{
|
||||||
|
private final long _startTime;
|
||||||
private int _objectiveIndex;
|
private int _objectiveIndex;
|
||||||
private TutorialRegion _region;
|
private TutorialRegion _region;
|
||||||
private List<Hologram> _hologramList = new ArrayList<>();
|
private List<Hologram> _hologramList = new ArrayList<>();
|
||||||
@ -16,9 +17,12 @@ public class TutorialSession
|
|||||||
private int _colorTick;
|
private int _colorTick;
|
||||||
private int _textSeconds;
|
private int _textSeconds;
|
||||||
private Location _mapTargetLocation;
|
private Location _mapTargetLocation;
|
||||||
|
private Hologram _spawnHologram;
|
||||||
|
private boolean _removedHologram;
|
||||||
|
|
||||||
public TutorialSession()
|
public TutorialSession()
|
||||||
{
|
{
|
||||||
|
_startTime = System.currentTimeMillis();
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<Hologram> getHolograms()
|
public List<Hologram> getHolograms()
|
||||||
@ -81,4 +85,34 @@ public class TutorialSession
|
|||||||
{
|
{
|
||||||
return _mapTargetLocation;
|
return _mapTargetLocation;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public long getStartTime()
|
||||||
|
{
|
||||||
|
return _startTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getElapsedTime()
|
||||||
|
{
|
||||||
|
return System.currentTimeMillis() - _startTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isRemovedHologram()
|
||||||
|
{
|
||||||
|
return _removedHologram;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRemovedHologram(boolean removedHologram)
|
||||||
|
{
|
||||||
|
_removedHologram = removedHologram;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSpawnHologram(Hologram spawnHologram)
|
||||||
|
{
|
||||||
|
_spawnHologram = spawnHologram;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Hologram getSpawnHologram()
|
||||||
|
{
|
||||||
|
return _spawnHologram;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,23 @@
|
|||||||
|
package mineplex.game.clans.tutorial.command;
|
||||||
|
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
|
import mineplex.core.command.CommandBase;
|
||||||
|
import mineplex.core.common.Rank;
|
||||||
|
import mineplex.game.clans.tutorial.TutorialManager;
|
||||||
|
|
||||||
|
public class FinishCommand extends CommandBase<TutorialManager>
|
||||||
|
{
|
||||||
|
public FinishCommand(TutorialManager plugin)
|
||||||
|
{
|
||||||
|
super(plugin, Rank.MODERATOR, "finish", "end");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void Execute(Player caller, String[] args)
|
||||||
|
{
|
||||||
|
Plugin.finishTutorial(caller);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
@ -13,7 +13,7 @@ public class StartCommand extends CommandBase<TutorialManager>
|
|||||||
{
|
{
|
||||||
public StartCommand(TutorialManager plugin)
|
public StartCommand(TutorialManager plugin)
|
||||||
{
|
{
|
||||||
super(plugin, Rank.JNR_DEV, "start");
|
super(plugin, Rank.MODERATOR, "start");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -13,9 +13,10 @@ public class TutorialCommand extends MultiCommandBase<TutorialManager>
|
|||||||
{
|
{
|
||||||
public TutorialCommand(TutorialManager plugin)
|
public TutorialCommand(TutorialManager plugin)
|
||||||
{
|
{
|
||||||
super(plugin, Rank.JNR_DEV, "tutorial", "tut");
|
super(plugin, Rank.MODERATOR, "tutorial", "tut");
|
||||||
|
|
||||||
AddCommand(new StartCommand(plugin));
|
AddCommand(new StartCommand(plugin));
|
||||||
|
AddCommand(new FinishCommand(plugin));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -199,8 +199,6 @@ public abstract class Objective<Plugin extends Tutorial, Data extends ObjectiveD
|
|||||||
{
|
{
|
||||||
System.out.println(String.format("Tutorial> [%s] finished objective [%s]", player.getName(), getName(player)));
|
System.out.println(String.format("Tutorial> [%s] finished objective [%s]", player.getName(), getName(player)));
|
||||||
|
|
||||||
showFinishMessage(player);
|
|
||||||
|
|
||||||
_active.remove(player.getUniqueId());
|
_active.remove(player.getUniqueId());
|
||||||
|
|
||||||
if (_displayFinishMessage)
|
if (_displayFinishMessage)
|
||||||
@ -277,11 +275,36 @@ public abstract class Objective<Plugin extends Tutorial, Data extends ObjectiveD
|
|||||||
UtilTextMiddle.display(C.cGreen + "Tutorial Completed", getName(player), 20, 60, 20, player);
|
UtilTextMiddle.display(C.cGreen + "Tutorial Completed", getName(player), 20, 60, 20, player);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void displayChatMessages(Player player)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < 8; i++)
|
||||||
|
{
|
||||||
|
UtilPlayer.message(player, "");
|
||||||
|
}
|
||||||
|
|
||||||
|
ObjectiveGoal<?> goal = getLatestGoal(player);
|
||||||
|
String name = goal == null ? getName(player) : goal.getName(player);
|
||||||
|
String extra = getExtraDescription(player);
|
||||||
|
// UtilPlayer.message(player, C.cGold + C.Strike + "---------------------------------------------");
|
||||||
|
UtilPlayer.message(player, C.cPurpleB + name);
|
||||||
|
if (extra != null)
|
||||||
|
{
|
||||||
|
UtilPlayer.message(player, "");
|
||||||
|
UtilPlayer.message(player, C.cGray + " " + extra);
|
||||||
|
}
|
||||||
|
UtilPlayer.message(player, "");
|
||||||
|
UtilPlayer.message(player, C.cGreen + getDescription(player));
|
||||||
|
// UtilPlayer.message(player, C.cGold + C.Strike + "---------------------------------------------");
|
||||||
|
getPlugin().getTutorialSession(player).setTextSeconds(0);
|
||||||
|
}
|
||||||
|
|
||||||
public void setDisplayStartMessage(boolean displayStartMessage)
|
public void setDisplayStartMessage(boolean displayStartMessage)
|
||||||
{
|
{
|
||||||
_displayStartMessage = displayStartMessage;
|
_displayStartMessage = displayStartMessage;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public abstract ObjectiveGoal<?> getLatestGoal(Player player);
|
||||||
|
|
||||||
public void setDisplayFinishMessage(boolean displayFinishMessage)
|
public void setDisplayFinishMessage(boolean displayFinishMessage)
|
||||||
{
|
{
|
||||||
_displayFinishMessage = displayFinishMessage;
|
_displayFinishMessage = displayFinishMessage;
|
||||||
|
@ -152,7 +152,7 @@ public abstract class ObjectiveGoal <T extends Objective<?, ?>> implements Liste
|
|||||||
*/
|
*/
|
||||||
protected void clean(Player player, TutorialRegion region)
|
protected void clean(Player player, TutorialRegion region)
|
||||||
{
|
{
|
||||||
|
_removeList.add(player.getUniqueId());
|
||||||
}
|
}
|
||||||
|
|
||||||
public T getObjective()
|
public T getObjective()
|
||||||
@ -174,18 +174,7 @@ public abstract class ObjectiveGoal <T extends Objective<?, ?>> implements Liste
|
|||||||
|
|
||||||
UtilTextMiddle.display(C.cYellow + "New Objective", getName(player), player);
|
UtilTextMiddle.display(C.cYellow + "New Objective", getName(player), player);
|
||||||
|
|
||||||
if (getExtraDescription(player) != null)
|
_objective.displayChatMessages(player);
|
||||||
{
|
|
||||||
for (int i = 0; i < 5; i++)
|
|
||||||
{
|
|
||||||
UtilPlayer.message(player, "");
|
|
||||||
}
|
|
||||||
// Display extra information for the first time.
|
|
||||||
UtilPlayer.message(player, C.cGold + C.Strike + "---------------------------------------------");
|
|
||||||
UtilPlayer.message(player, C.cGray + " " + getExtraDescription(player));
|
|
||||||
UtilPlayer.message(player, C.cGold + C.Strike + "---------------------------------------------");
|
|
||||||
getObjective().getPlugin().getTutorialSession(player).setTextSeconds(0);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setDisplayStartMessage(boolean displayStartMessage)
|
public void setDisplayStartMessage(boolean displayStartMessage)
|
||||||
|
@ -73,6 +73,14 @@ public abstract class OrderedObjective<Plugin extends Tutorial> extends Objectiv
|
|||||||
return _goals.get(index).getExtraDescription(player);
|
return _goals.get(index).getExtraDescription(player);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ObjectiveGoal<?> getLatestGoal(Player player)
|
||||||
|
{
|
||||||
|
OrderedObjectiveData data = getData(player);
|
||||||
|
int index = data == null ? 0 : data.getIndex();
|
||||||
|
return _goals.get(index);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void customStart(Player player)
|
protected void customStart(Player player)
|
||||||
{
|
{
|
||||||
|
@ -36,6 +36,12 @@ public abstract class SingleObjective<Plugin extends Tutorial> extends Objective
|
|||||||
// Do Nothing
|
// Do Nothing
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ObjectiveGoal<?> getLatestGoal(Player player)
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected List<ObjectiveGoal<?>> getGoals()
|
protected List<ObjectiveGoal<?>> getGoals()
|
||||||
{
|
{
|
||||||
|
@ -74,6 +74,15 @@ public abstract class UnorderedObjective<Plugin extends Tutorial> extends Object
|
|||||||
return index == -1 ? super.getExtraDescription(player) : _goals.get(index).getExtraDescription(player);
|
return index == -1 ? super.getExtraDescription(player) : _goals.get(index).getExtraDescription(player);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ObjectiveGoal<?> getLatestGoal(Player player)
|
||||||
|
{
|
||||||
|
UnorderedObjectiveData data = getData(player);
|
||||||
|
if (data == null) return null;
|
||||||
|
int index = data.getFirstIncompleteIndex();
|
||||||
|
return index == -1 ? null : _goals.get(index);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void customStart(Player player)
|
protected void customStart(Player player)
|
||||||
{
|
{
|
||||||
|
@ -6,6 +6,7 @@ import java.util.List;
|
|||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
|
import mineplex.core.hologram.Hologram;
|
||||||
import mineplex.core.common.util.*;
|
import mineplex.core.common.util.*;
|
||||||
import mineplex.game.clans.clans.ClanInfo;
|
import mineplex.game.clans.clans.ClanInfo;
|
||||||
import mineplex.game.clans.clans.event.ClansPlayerBuyItemEvent;
|
import mineplex.game.clans.clans.event.ClansPlayerBuyItemEvent;
|
||||||
@ -40,6 +41,7 @@ import mineplex.game.clans.message.ClansMessageManager;
|
|||||||
import mineplex.game.clans.spawn.Spawn;
|
import mineplex.game.clans.spawn.Spawn;
|
||||||
import mineplex.game.clans.tutorial.Tutorial;
|
import mineplex.game.clans.tutorial.Tutorial;
|
||||||
import mineplex.game.clans.tutorial.TutorialRegion;
|
import mineplex.game.clans.tutorial.TutorialRegion;
|
||||||
|
import mineplex.game.clans.tutorial.TutorialSession;
|
||||||
import mineplex.game.clans.tutorial.TutorialWorldManager;
|
import mineplex.game.clans.tutorial.TutorialWorldManager;
|
||||||
import mineplex.game.clans.tutorial.map.TutorialMapManager;
|
import mineplex.game.clans.tutorial.map.TutorialMapManager;
|
||||||
import mineplex.game.clans.tutorial.tutorials.clans.objective.AttackEnemyObjective;
|
import mineplex.game.clans.tutorial.tutorials.clans.objective.AttackEnemyObjective;
|
||||||
@ -105,7 +107,7 @@ public class ClansMainTutorial extends Tutorial
|
|||||||
ClansManager.getInstance().getItemMapManager().setMap(player);
|
ClansManager.getInstance().getItemMapManager().setMap(player);
|
||||||
}, 20 * 10L);
|
}, 20 * 10L);
|
||||||
|
|
||||||
|
player.setWalkSpeed(0.2F);
|
||||||
|
|
||||||
//ClansManager.getInstance().getPvpTimer().unpause(player);
|
//ClansManager.getInstance().getPvpTimer().unpause(player);
|
||||||
|
|
||||||
@ -148,15 +150,17 @@ public class ClansMainTutorial extends Tutorial
|
|||||||
//ClansManager.getInstance().getPvpTimer().pause(player);
|
//ClansManager.getInstance().getPvpTimer().pause(player);
|
||||||
|
|
||||||
// Spawn Holograms
|
// Spawn Holograms
|
||||||
addHologram(player,
|
setSpawnHologram(player,
|
||||||
getPoint(region, ClansMainTutorial.Point.SPAWN).add(0, 1.5, -6),
|
getPoint(region, ClansMainTutorial.Point.SPAWN).add(0, 1.5, -3),
|
||||||
C.cGoldB + "Welcome to the Clans Tutorial!",
|
C.cGoldB + "Welcome to the Clans Tutorial!",
|
||||||
" ",
|
" ",
|
||||||
"This will teach you the basics of Clans.",
|
"This will teach you the basics of Clans.",
|
||||||
"It will take about 5 minutes to complete.",
|
"It will take about 5 minutes to complete.",
|
||||||
"You must complete it before playing Clans.",
|
"You must complete it before playing Clans.",
|
||||||
" ",
|
" ",
|
||||||
"Walk forward to begin!");
|
"Starting in " + C.cGreen + "10 Seconds");
|
||||||
|
|
||||||
|
player.setWalkSpeed(0);
|
||||||
|
|
||||||
addHologram(player,
|
addHologram(player,
|
||||||
getPoint(region, ClansMainTutorial.Point.SPAWN).add(0, 1.5, -23),
|
getPoint(region, ClansMainTutorial.Point.SPAWN).add(0, 1.5, -23),
|
||||||
@ -429,6 +433,39 @@ public class ClansMainTutorial extends Tutorial
|
|||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void preventMovement(UpdateEvent event)
|
||||||
|
{
|
||||||
|
if (event.getType() != UpdateType.FAST)
|
||||||
|
return;
|
||||||
|
|
||||||
|
for (Player player : getPlayers())
|
||||||
|
{
|
||||||
|
TutorialSession session = getTutorialSession(player);
|
||||||
|
long time = session.getElapsedTime();
|
||||||
|
if (time <= 10000) // 10 seconds
|
||||||
|
{
|
||||||
|
// player.teleport(getSpawn(session.getRegion()));
|
||||||
|
|
||||||
|
String secondsLeft = UtilTime.convertString(10000 - time, 0, UtilTime.TimeUnit.SECONDS);
|
||||||
|
setSpawnHologram(player,
|
||||||
|
getPoint(session.getRegion(), ClansMainTutorial.Point.SPAWN).add(0, 1.5, -3),
|
||||||
|
C.cGoldB + "Welcome to the Clans Tutorial!",
|
||||||
|
" ",
|
||||||
|
"This will teach you the basics of Clans.",
|
||||||
|
"It will take about 5 minutes to complete.",
|
||||||
|
"You must complete it before playing Clans.",
|
||||||
|
" ",
|
||||||
|
"Starting in " + C.cGreen + secondsLeft);
|
||||||
|
}
|
||||||
|
else if (!session.isRemovedHologram())
|
||||||
|
{
|
||||||
|
removeSpawnHologram(player);
|
||||||
|
player.setWalkSpeed(0.2F);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void performGateCheck(Player player, DyeColor key)
|
public void performGateCheck(Player player, DyeColor key)
|
||||||
{
|
{
|
||||||
if(player == null || !player.isOnline()) return;
|
if(player == null || !player.isOnline()) return;
|
||||||
@ -442,7 +479,7 @@ public class ClansMainTutorial extends Tutorial
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (player.getLocation().distanceSquared(fence) <= (GATE_OPEN_DISTANCE * 2))
|
if (player.getLocation().distanceSquared(fence) <= (GATE_OPEN_DISTANCE * GATE_OPEN_DISTANCE))
|
||||||
{
|
{
|
||||||
// Within the correct blocks of the gates.
|
// Within the correct blocks of the gates.
|
||||||
destroyFences(getRegion(player), key);
|
destroyFences(getRegion(player), key);
|
||||||
|
@ -115,7 +115,7 @@ public class StealEnemyPotatoesGoal extends ObjectiveGoal<AttackEnemyObjective>
|
|||||||
|
|
||||||
if (event.getItem().getItemStack().getType() == Material.POTATO_ITEM)
|
if (event.getItem().getItemStack().getType() == Material.POTATO_ITEM)
|
||||||
{
|
{
|
||||||
int count = _playersMap.get(event.getPlayer().getUniqueId()).getAndIncrement();
|
int count = _playersMap.get(event.getPlayer().getUniqueId()).incrementAndGet();
|
||||||
if (count == 10)
|
if (count == 10)
|
||||||
finish(event.getPlayer());
|
finish(event.getPlayer());
|
||||||
}
|
}
|
||||||
|
@ -33,7 +33,7 @@ public class LeaveSpawnGoal extends ObjectiveGoal<ClanObjective>
|
|||||||
);
|
);
|
||||||
|
|
||||||
// 2 seconds after start message
|
// 2 seconds after start message
|
||||||
// setStartMessageDelay(20 * 3);
|
setStartMessageDelay(20 * 11);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
Reference in New Issue
Block a user