Merge remote-tracking branch 'origin/clans/beta' into clans/beta

This commit is contained in:
Shaun Bennett 2016-04-04 12:53:07 +10:00
commit 29f2442be8
14 changed files with 52 additions and 29 deletions

View File

@ -226,6 +226,7 @@ public class Cannon extends SiegeWeapon
if(_inventory.getViewers().contains(event.getWhoClicked()))
{
event.setCancelled(true); //block shift right clicking tnt into this inventory
getClans().runSyncLater(() -> ((Player) event.getWhoClicked()).updateInventory(), 1L);
}
return;
}

View File

@ -6,14 +6,11 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import mineplex.core.common.util.*;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.entity.Player;
import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilServer;
import mineplex.core.common.util.UtilTime;
import mineplex.core.common.util.UtilWorld;
import mineplex.core.scoreboard.ScoreboardManager;
import mineplex.game.clans.clans.ClanInfo;
import mineplex.game.clans.clans.ClansManager;
@ -184,4 +181,15 @@ public class KingHill extends WorldEvent
{
public int TicksOnHill;
}
@Override
public void announceStart()
{
for(Player player : UtilServer.getPlayers()) {
if(_clansManager.getTutorials().isInTutorial(player)) continue;
UtilTextMiddle.display(C.cGreen + getName(), UtilWorld.locToStrClean(getCenterLocation()), 10, 100, 40, player);
player.sendMessage(F.main("Event", F.elem(getName()) + " has started at coordinates " + F.elem(UtilWorld.locToStrClean(getCenterLocation()))));
}
}
}

View File

@ -4,22 +4,18 @@ import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;
import mineplex.core.common.util.*;
import mineplex.game.clans.clans.ClansManager;
import org.bukkit.Effect;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.block.BlockFace;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.player.PlayerInteractEvent;
import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilBlock;
import mineplex.core.common.util.UtilMath;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilServer;
import mineplex.core.common.util.UtilWorld;
import mineplex.core.itemstack.ItemStackFactory;
import mineplex.core.recharge.Recharge;
import mineplex.core.updater.UpdateType;
@ -509,4 +505,16 @@ public class UndeadCamp extends WorldEvent
}
}
}
@Override
public void announceStart()
{
for(Player player : UtilServer.getPlayers()) {
if(ClansManager.getInstance().getTutorials().isInTutorial(player)) continue;
UtilTextMiddle.display(C.cGreen + getName(), UtilWorld.locToStrClean(getCenterLocation()), 10, 100, 40, player);
player.sendMessage(F.main("Event", F.elem(getName()) + " has started at coordinates " + F.elem(UtilWorld.locToStrClean(getCenterLocation()))));
}
}
}

View File

@ -432,11 +432,6 @@ public class Gameplay extends MiniPlugin
return;
}
if (_clansManager.getTutorials().isInTutorial(event.getPlayer()))
{
return;
}
Block block = event.getClickedBlock();
// Knock

View File

@ -29,7 +29,7 @@ public class PvpItem extends ShopItem
super(type, data, name, new String[] {
C.cWhite + " ",
LEFT_CLICK_BUY,
C.cWhite + "Costs " + C.cGreen + (buyPrice == 0 ? "Free" : buyPrice + "g"),
C.cWhite + "Costs " + C.cGreen + (buyPrice == 0 ? "Free (Tutorial)" : buyPrice + "g"),
C.cWhite + " ",
UtilItem.isArmor(type) || UtilItem.isTool(type) ? "" : C.cYellow + "Shift Left-Click" + C.cWhite + " to Buy " + C.cGreen + bulkCount,
UtilItem.isArmor(type) || UtilItem.isTool(type) ? "" : C.cWhite + "Costs " + C.cGreen + (buyPrice * bulkCount) + "g", C.cWhite + " ",

View File

@ -267,12 +267,12 @@ public abstract class Objective<Plugin extends Tutorial, Data extends ObjectiveD
private void showStartMessage(Player player)
{
UtilTextMiddle.display(C.cAqua + "Next Tutorial", getName(player), 20, 60, 20, player);
UtilTextMiddle.display(C.cAqua + "Next Tutorial Section", getName(player), 20, 60, 20, player);
}
private void showFinishMessage(Player player)
{
UtilTextMiddle.display(C.cGreen + "Tutorial Completed", getName(player), 20, 60, 20, player);
UtilTextMiddle.display(C.cGreen + "Tutorial Section Completed", getName(player), 20, 60, 20, player);
}
public void displayChatMessages(Player player)

View File

@ -11,6 +11,7 @@ import mineplex.core.common.util.*;
import mineplex.game.clans.clans.ClanInfo;
import mineplex.game.clans.clans.event.ClansPlayerBuyItemEvent;
import mineplex.game.clans.clans.event.ClansPlayerSellItemEvent;
import mineplex.game.clans.clans.event.PreEnergyShopBuyEvent;
import mineplex.game.clans.clans.gui.events.ClansButtonClickEvent;
import org.bukkit.*;
import org.bukkit.block.Block;
@ -510,4 +511,13 @@ public class ClansMainTutorial extends Tutorial
if(isInTutorial(event.getPlayer()))
event.setCancelled(true);
}
@EventHandler
public void energyBuy(PreEnergyShopBuyEvent event)
{
if (isInTutorial(event.getPlayer()))
{
event.setCancelled(true);
}
}
}

View File

@ -25,7 +25,8 @@ public class FieldsObjective extends OrderedObjective<ClansMainTutorial>
Material.MAP,
"Identify Fields on Map",
"Find the Orange Striped Area on your map",
"Fields are marked by " + C.cGold + "Orange Stripes" + C.mBody + "."
"Fields are marked by " + C.cGold + "Orange Stripes" + C.mBody + ".",
60L
));
addGoal(new GoToFieldsGoal(this));
addGoal(new MineDiamondsGoal(this));

View File

@ -43,7 +43,8 @@ public class ShopsObjective extends OrderedObjective<ClansMainTutorial>
Material.MAP,
"Identify Shops on Map",
"Find the Blue striped area on your map",
"Shops are marked on the map by the " + C.cDAqua + "Blue Stripes" + C.mBody + "."
"Shops are marked on the map by the " + C.cDAqua + "Blue Stripes" + C.mBody + ".",
60L
));
addGoal(new GoToShopsGoal(this));
addGoal(new SellPotatoesGoal(this));

View File

@ -16,19 +16,20 @@ public class HoldItemGoal extends ObjectiveGoal<Objective<?, ?>>
{
private DefaultHashMap<String, EnclosedObject<Integer>> _ticksHeld = new DefaultHashMap<>(key -> new EnclosedObject<>(Integer.valueOf(0)));
private Material _material;
private long _holdTicks;
public HoldItemGoal(Objective<?, ?> objective, Material material, String name, String description, String helpText, int startDelay)
public HoldItemGoal(Objective<?, ?> objective, Material material, String name, String description, String helpText, int startDelay, long holdTicks)
{
super(objective, name, description, helpText, null);
_material = material;
_holdTicks = holdTicks;
// setStartMessageDelay(startDelay);
}
public HoldItemGoal(Objective<?, ?> objective, Material material, String name, String description, String helpText)
public HoldItemGoal(Objective<?, ?> objective, Material material, String name, String description, String helpText, long holdTicks)
{
this(objective, material, name, description, helpText, 120);
this(objective, material, name, description, helpText, 120, holdTicks);
}
@Override

View File

@ -106,7 +106,7 @@ public class BlowUpWallGoal extends ObjectiveGoal<AttackEnemyObjective>
}
else
{
UtilPlayer.message(shooter, F.main("Clans", "You missed! Try to hit the enemies front wall, that should make a nice big hole!"));
UtilPlayer.message(shooter, F.main("Clans", "You missed! Try to hit the enemy's front wall, that should make a nice big hole!"));
UtilInv.give(shooter, Material.TNT);
}

View File

@ -48,7 +48,6 @@ public class BuyEnergyGoal extends ObjectiveGoal<EnergyObjective>
{
if (contains(event.getPlayer()))
{
event.setCancelled(true);
finish(event.getPlayer());
event.getPlayer().closeInventory();
}

View File

@ -51,7 +51,6 @@ public class PurchaseGoal extends ObjectiveGoal
if (contains(event.getPlayer()) && event.getMaterial() == _material)
{
event.setBuyPrice(0);
event.setSellPrice(0);
}
}

View File

@ -263,11 +263,11 @@ public abstract class WorldEvent implements Listener, ScoreboardElement
HandlerList.unregisterAll(creature);
_creatures.remove(creature);
}
public void announceStart()
{
UtilTextMiddle.display(C.cGreen + getName(), UtilWorld.locToStrClean(getCenterLocation()), 10, 100, 40);
UtilServer.broadcast(F.main("Event", F.elem(getName()) + " has started at coordinates " + F.elem(UtilWorld.locToStrClean(getCenterLocation()))));
}