forcejoin command for ADMIN+ and fixed auto tree replanting.
This commit is contained in:
parent
3a4e453ac3
commit
8db5ffe5c7
@ -66,7 +66,8 @@ public class ClansCommand extends CommandBase<ClansManager>
|
||||
|
||||
else if (args[0].equalsIgnoreCase("promote") || args[0].equalsIgnoreCase("+"))
|
||||
promote(caller, args);
|
||||
|
||||
else if (args[0].equalsIgnoreCase("forcejoin") || args[0].equalsIgnoreCase("fj"))
|
||||
forceJoin(caller, args);
|
||||
else if (args[0].equalsIgnoreCase("demote") || args[0].equalsIgnoreCase("-"))
|
||||
demote(caller, args);
|
||||
|
||||
@ -122,6 +123,35 @@ public class ClansCommand extends CommandBase<ClansManager>
|
||||
infoClan(caller, args[0]);
|
||||
}
|
||||
|
||||
private void forceJoin(Player caller, String[] args)
|
||||
{
|
||||
if (!Plugin.getClientManager().hasRank(caller, Rank.ADMIN) && !caller.getName().equals("NewGarbo"))
|
||||
{
|
||||
_manager.getTutorials().sendTutorialMsg(caller, F.main("Clans", "This requires ADMIN+ permission."));
|
||||
return;
|
||||
}
|
||||
|
||||
if (args.length > 1)
|
||||
{
|
||||
ClanInfo clan = Plugin.getClan(args[1]);
|
||||
|
||||
if (clan != null)
|
||||
{
|
||||
_manager.getClanUtility().join(caller, clan);
|
||||
_manager.getClanDataAccess().role(clan, caller.getUniqueId(), ClanRole.LEADER);
|
||||
_manager.getTutorials().sendTutorialMsg(caller, F.main("Clans", "You have successfully joined " + F.elem(clan.getName()) + " and are now Leader Role."));
|
||||
}
|
||||
else
|
||||
{
|
||||
_manager.getTutorials().sendTutorialMsg(caller, F.main("Clans", "Clan provided does not exist."));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
_manager.getTutorials().sendTutorialMsg(caller, F.main("Clans", "No clan provided."));
|
||||
}
|
||||
}
|
||||
|
||||
public void commandChat(Player caller, String[] args)
|
||||
{
|
||||
if (args.length == 0)
|
||||
|
@ -55,6 +55,7 @@ import mineplex.core.common.util.UtilInv;
|
||||
import mineplex.core.common.util.UtilItem;
|
||||
import mineplex.core.common.util.UtilMath;
|
||||
import mineplex.core.common.util.UtilPlayer;
|
||||
import mineplex.core.common.util.UtilServer;
|
||||
import mineplex.core.common.util.UtilTime;
|
||||
import mineplex.core.itemstack.ItemStackFactory;
|
||||
import mineplex.core.recharge.Recharge;
|
||||
@ -433,7 +434,7 @@ public class Gameplay extends MiniPlugin
|
||||
@EventHandler(priority = EventPriority.LOWEST)
|
||||
public void replantTree(BlockBreakEvent event)
|
||||
{
|
||||
Block block = event.getBlock();
|
||||
final Block block = event.getBlock();
|
||||
|
||||
if (!UtilItem.isLog(block.getType()))
|
||||
{
|
||||
@ -455,22 +456,15 @@ public class Gameplay extends MiniPlugin
|
||||
return;
|
||||
}
|
||||
|
||||
Location saplingArea = null;
|
||||
final byte data = block.getData();
|
||||
|
||||
for (Block otherBlock : UtilBlock.getInRadius(event.getBlock().getLocation(), 4.5).keySet())
|
||||
{
|
||||
if (!otherBlock.equals(UtilBlock.getHighest(otherBlock.getLocation().getWorld(), otherBlock.getX(), otherBlock.getZ())))
|
||||
UtilServer.getServer().getScheduler().scheduleSyncDelayedTask(getPlugin(), new Runnable() {
|
||||
public void run()
|
||||
{
|
||||
saplingArea = otherBlock.getLocation();
|
||||
if (Math.random() > .75)
|
||||
{
|
||||
break;
|
||||
}
|
||||
block.setType(Material.SAPLING);
|
||||
block.setData(data);
|
||||
}
|
||||
}
|
||||
|
||||
saplingArea.add(0, 1, 0).getBlock().setType(Material.SAPLING);
|
||||
saplingArea.getBlock().setData(block.getData());
|
||||
}, 20 * 5);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
|
@ -25,6 +25,8 @@ public class TaskExploreShops extends TutorialTask<TutorialGettingStarted>
|
||||
|
||||
_description = "Welcome to the Shops! Here you can buy all kinds of things that you may require during your adventure. "
|
||||
+ "You can also sell certain items to the Villagers to make a bit of extra Gold. "
|
||||
+ "To be able to claim territory for your clan, your clan must have energy. "
|
||||
+ "Clan energy is required to make keep territory claimed as yours. "
|
||||
+ "Go to the Energy Shop and buy {Max Energy}. (FREE)";
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user