Merge master
This commit is contained in:
commit
5be91de006
@ -87,7 +87,7 @@
|
|||||||
<fileset dir="../Mineplex.ServerData/bin">
|
<fileset dir="../Mineplex.ServerData/bin">
|
||||||
<include name="**/*.class"/>
|
<include name="**/*.class"/>
|
||||||
</fileset>
|
</fileset>
|
||||||
<fileset dir="../Mineplex.PlayerCache/bin">
|
<fileset dir="../Mineplex.Cache/bin">
|
||||||
<include name="**/*.class"/>
|
<include name="**/*.class"/>
|
||||||
</fileset>
|
</fileset>
|
||||||
|
|
||||||
@ -161,7 +161,7 @@
|
|||||||
<fileset dir="../Mineplex.Database/bin">
|
<fileset dir="../Mineplex.Database/bin">
|
||||||
<include name="**/*.class"/>
|
<include name="**/*.class"/>
|
||||||
</fileset>
|
</fileset>
|
||||||
<fileset dir="../Mineplex.PlayerCache/bin">
|
<fileset dir="../Mineplex.Cache/bin">
|
||||||
<include name="**/*.class"/>
|
<include name="**/*.class"/>
|
||||||
</fileset>
|
</fileset>
|
||||||
<fileset dir="../Mineplex.ServerData/bin">
|
<fileset dir="../Mineplex.ServerData/bin">
|
||||||
@ -214,7 +214,7 @@
|
|||||||
<fileset dir="../Mineplex.ServerData/bin">
|
<fileset dir="../Mineplex.ServerData/bin">
|
||||||
<include name="**/*.class"/>
|
<include name="**/*.class"/>
|
||||||
</fileset>
|
</fileset>
|
||||||
<fileset dir="../Mineplex.PlayerCache/bin">
|
<fileset dir="../Mineplex.Cache/bin">
|
||||||
<include name="**/*.class"/>
|
<include name="**/*.class"/>
|
||||||
</fileset>
|
</fileset>
|
||||||
|
|
||||||
@ -254,7 +254,7 @@
|
|||||||
<fileset dir="../Mineplex.ServerData/bin">
|
<fileset dir="../Mineplex.ServerData/bin">
|
||||||
<include name="**/*.class"/>
|
<include name="**/*.class"/>
|
||||||
</fileset>
|
</fileset>
|
||||||
<fileset dir="../Mineplex.PlayerCache/bin">
|
<fileset dir="../Mineplex.Cache/bin">
|
||||||
<include name="**/*.class"/>
|
<include name="**/*.class"/>
|
||||||
</fileset>
|
</fileset>
|
||||||
|
|
||||||
@ -335,7 +335,7 @@
|
|||||||
<include name="**/*.class"/>
|
<include name="**/*.class"/>
|
||||||
</fileset>
|
</fileset>
|
||||||
|
|
||||||
<fileset dir="../Mineplex.PlayerCache/bin">
|
<fileset dir="../Mineplex.Cache/bin">
|
||||||
<include name="**/*.class"/>
|
<include name="**/*.class"/>
|
||||||
</fileset>
|
</fileset>
|
||||||
|
|
||||||
|
@ -1,11 +0,0 @@
|
|||||||
eclipse.preferences.version=1
|
|
||||||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
|
||||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
|
|
||||||
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
|
|
||||||
org.eclipse.jdt.core.compiler.compliance=1.7
|
|
||||||
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
|
|
||||||
org.eclipse.jdt.core.compiler.debug.localVariable=generate
|
|
||||||
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
|
|
||||||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
|
||||||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
|
||||||
org.eclipse.jdt.core.compiler.source=1.7
|
|
@ -1,11 +0,0 @@
|
|||||||
eclipse.preferences.version=1
|
|
||||||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
|
||||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
|
|
||||||
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
|
|
||||||
org.eclipse.jdt.core.compiler.compliance=1.7
|
|
||||||
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
|
|
||||||
org.eclipse.jdt.core.compiler.debug.localVariable=generate
|
|
||||||
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
|
|
||||||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
|
||||||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
|
||||||
org.eclipse.jdt.core.compiler.source=1.7
|
|
17
Plugins/Mineplex.Cache/.project
Normal file
17
Plugins/Mineplex.Cache/.project
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<projectDescription>
|
||||||
|
<name>Mineplex.Cache</name>
|
||||||
|
<comment></comment>
|
||||||
|
<projects>
|
||||||
|
</projects>
|
||||||
|
<buildSpec>
|
||||||
|
<buildCommand>
|
||||||
|
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||||
|
<arguments>
|
||||||
|
</arguments>
|
||||||
|
</buildCommand>
|
||||||
|
</buildSpec>
|
||||||
|
<natures>
|
||||||
|
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||||
|
</natures>
|
||||||
|
</projectDescription>
|
@ -1,11 +0,0 @@
|
|||||||
eclipse.preferences.version=1
|
|
||||||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
|
||||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
|
|
||||||
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
|
|
||||||
org.eclipse.jdt.core.compiler.compliance=1.7
|
|
||||||
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
|
|
||||||
org.eclipse.jdt.core.compiler.debug.localVariable=generate
|
|
||||||
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
|
|
||||||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
|
||||||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
|
||||||
org.eclipse.jdt.core.compiler.source=1.7
|
|
@ -35,6 +35,8 @@ import org.bukkit.craftbukkit.v1_8_R3.entity.CraftPlayer;
|
|||||||
import org.bukkit.entity.EntityType;
|
import org.bukkit.entity.EntityType;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
|
import org.bukkit.event.EventPriority;
|
||||||
|
import org.bukkit.event.player.PlayerJoinEvent;
|
||||||
import org.bukkit.event.player.PlayerQuitEvent;
|
import org.bukkit.event.player.PlayerQuitEvent;
|
||||||
import org.bukkit.event.player.PlayerToggleFlightEvent;
|
import org.bukkit.event.player.PlayerToggleFlightEvent;
|
||||||
import org.bukkit.event.player.PlayerVelocityEvent;
|
import org.bukkit.event.player.PlayerVelocityEvent;
|
||||||
@ -81,6 +83,15 @@ public class CustomTagFix extends MiniPlugin implements IPacketHandler, NCPHook
|
|||||||
_loggedIn.remove(event.getPlayer());
|
_loggedIn.remove(event.getPlayer());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@EventHandler(priority = EventPriority.LOW)
|
||||||
|
public void playerJoin(PlayerJoinEvent event)
|
||||||
|
{
|
||||||
|
Player player = event.getPlayer();
|
||||||
|
|
||||||
|
player.setCustomName("");
|
||||||
|
player.setCustomNameVisible(false);
|
||||||
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void ncpExempt(final PlayerToggleFlightEvent event)
|
public void ncpExempt(final PlayerToggleFlightEvent event)
|
||||||
{
|
{
|
||||||
@ -140,7 +151,8 @@ public class CustomTagFix extends MiniPlugin implements IPacketHandler, NCPHook
|
|||||||
{
|
{
|
||||||
Entry<UUID, NautHashMap<CheckType, Long>> entry = iterator.next();
|
Entry<UUID, NautHashMap<CheckType, Long>> entry = iterator.next();
|
||||||
|
|
||||||
for (Iterator<Entry<CheckType, Long>> innerIterator = entry.getValue().entrySet().iterator(); innerIterator.hasNext();)
|
for (Iterator<Entry<CheckType, Long>> innerIterator = entry.getValue().entrySet().iterator(); innerIterator
|
||||||
|
.hasNext();)
|
||||||
{
|
{
|
||||||
final Entry<CheckType, Long> entry2 = innerIterator.next();
|
final Entry<CheckType, Long> entry2 = innerIterator.next();
|
||||||
|
|
||||||
@ -247,7 +259,7 @@ public class CustomTagFix extends MiniPlugin implements IPacketHandler, NCPHook
|
|||||||
_entityNameMap.get(owner.getName()).put(spawnPacket.a, entityName);
|
_entityNameMap.get(owner.getName()).put(spawnPacket.a, entityName);
|
||||||
_entityMap.get(owner.getName()).put(spawnPacket.a, new Integer[]
|
_entityMap.get(owner.getName()).put(spawnPacket.a, new Integer[]
|
||||||
{
|
{
|
||||||
newId
|
newId
|
||||||
});
|
});
|
||||||
|
|
||||||
sendProtocolPackets(owner, spawnPacket.a, newId, entityName, verifier, true, -1);
|
sendProtocolPackets(owner, spawnPacket.a, newId, entityName, verifier, true, -1);
|
||||||
@ -349,7 +361,7 @@ public class CustomTagFix extends MiniPlugin implements IPacketHandler, NCPHook
|
|||||||
{
|
{
|
||||||
newId = new Integer[]
|
newId = new Integer[]
|
||||||
{
|
{
|
||||||
UtilEnt.getNewEntityId()
|
UtilEnt.getNewEntityId()
|
||||||
};
|
};
|
||||||
|
|
||||||
_entityMap.get(owner.getName()).put(metaPacket.a, newId);
|
_entityMap.get(owner.getName()).put(metaPacket.a, newId);
|
||||||
@ -469,8 +481,8 @@ public class CustomTagFix extends MiniPlugin implements IPacketHandler, NCPHook
|
|||||||
|
|
||||||
_entityRiding.get(owner.getName()).remove(attachPacket.b);
|
_entityRiding.get(owner.getName()).remove(attachPacket.b);
|
||||||
|
|
||||||
sendProtocolPackets(owner, vehicleId, ids[ids.length - 1],
|
sendProtocolPackets(owner, vehicleId, ids[ids.length - 1], _entityNameMap.get(owner.getName()).get(vehicleId),
|
||||||
_entityNameMap.get(owner.getName()).get(vehicleId), verifier, true, ids.length > 1 ? ids[0] : -1);
|
verifier, true, ids.length > 1 ? ids[0] : -1);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -105,7 +105,7 @@ public enum AchievementCategory
|
|||||||
|
|
||||||
ONE_IN_THE_QUIVER("One in the Quiver", null,
|
ONE_IN_THE_QUIVER("One in the Quiver", null,
|
||||||
new StatDisplay[] { StatDisplay.WINS, StatDisplay.GAMES_PLAYED, StatDisplay.KILLS, StatDisplay.DEATHS, StatDisplay.GEMS_EARNED },
|
new StatDisplay[] { StatDisplay.WINS, StatDisplay.GAMES_PLAYED, StatDisplay.KILLS, StatDisplay.DEATHS, StatDisplay.GEMS_EARNED },
|
||||||
Material.BOW, 0, GameCategory.ARCADE, "Slam Shooter Kit"),
|
Material.BOW, 0, GameCategory.ARCADE, "Ninja Kit"),
|
||||||
|
|
||||||
SUPER_PAINTBALL("Super Paintball", null,
|
SUPER_PAINTBALL("Super Paintball", null,
|
||||||
new StatDisplay[] { StatDisplay.WINS, StatDisplay.GAMES_PLAYED, StatDisplay.KILLS, StatDisplay.DEATHS, StatDisplay.GEMS_EARNED },
|
new StatDisplay[] { StatDisplay.WINS, StatDisplay.GAMES_PLAYED, StatDisplay.KILLS, StatDisplay.DEATHS, StatDisplay.GEMS_EARNED },
|
||||||
@ -137,7 +137,7 @@ public enum AchievementCategory
|
|||||||
|
|
||||||
MICRO_BATTLE("Micro Battle", null,
|
MICRO_BATTLE("Micro Battle", null,
|
||||||
new StatDisplay[] { StatDisplay.WINS, StatDisplay.GAMES_PLAYED, StatDisplay.KILLS, StatDisplay.DEATHS, StatDisplay.GEMS_EARNED },
|
new StatDisplay[] { StatDisplay.WINS, StatDisplay.GAMES_PLAYED, StatDisplay.KILLS, StatDisplay.DEATHS, StatDisplay.GEMS_EARNED },
|
||||||
Material.LAVA, 0, GameCategory.ARCADE, null),
|
Material.LAVA_BUCKET, 0, GameCategory.ARCADE, null),
|
||||||
|
|
||||||
BOMB_LOBBERS("Bomb Lobbers", null,
|
BOMB_LOBBERS("Bomb Lobbers", null,
|
||||||
new StatDisplay[] { StatDisplay.WINS, StatDisplay.GAMES_PLAYED, StatDisplay.KILLS, StatDisplay.DEATHS, StatDisplay.GEMS_EARNED },
|
new StatDisplay[] { StatDisplay.WINS, StatDisplay.GAMES_PLAYED, StatDisplay.KILLS, StatDisplay.DEATHS, StatDisplay.GEMS_EARNED },
|
||||||
|
@ -64,7 +64,16 @@ public class PetTagPage extends ShopPageBase<CosmeticManager, CosmeticShop>
|
|||||||
{
|
{
|
||||||
_tagName = ChatColor.stripColor(_tagName);
|
_tagName = ChatColor.stripColor(_tagName);
|
||||||
_tagName = _tagName.replaceAll("[^A-Za-z0-9]", "");
|
_tagName = _tagName.replaceAll("[^A-Za-z0-9]", "");
|
||||||
|
System.out.println("Pet name: " + _tagName + ".");
|
||||||
|
if (_tagName.length() == 0)
|
||||||
|
{
|
||||||
|
UtilPlayer.message(getPlayer(), F.main(getPlugin().getName(), ChatColor.RED + "Supplied pet name contains invalid characters."));
|
||||||
|
playDenySound(getPlayer());
|
||||||
|
|
||||||
|
getShop().openPageForPlayer(getPlayer(), new PetPage(getPlugin(), getShop(), getClientManager(), getDonationManager(), "Pets", getPlayer()));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (_tagName.length() > 16)
|
if (_tagName.length() > 16)
|
||||||
{
|
{
|
||||||
UtilPlayer.message(getPlayer(), F.main(getPlugin().getName(), ChatColor.RED + "Pet name cannot be longer than 16 characters."));
|
UtilPlayer.message(getPlayer(), F.main(getPlugin().getName(), ChatColor.RED + "Pet name cannot be longer than 16 characters."));
|
||||||
|
@ -21,7 +21,7 @@ public class ParticleLegend extends ParticleGadget
|
|||||||
{
|
{
|
||||||
public ParticleLegend(GadgetManager manager)
|
public ParticleLegend(GadgetManager manager)
|
||||||
{
|
{
|
||||||
super(manager, "Legendary Aura",
|
super(manager, "Legendary Aura",
|
||||||
UtilText.splitLineToArray(C.cGray + "This particle will be updated soon! Yay!", LineFormat.LORE),
|
UtilText.splitLineToArray(C.cGray + "This particle will be updated soon! Yay!", LineFormat.LORE),
|
||||||
-1,
|
-1,
|
||||||
Material.ENDER_PORTAL_FRAME, (byte)0);
|
Material.ENDER_PORTAL_FRAME, (byte)0);
|
||||||
|
@ -17,7 +17,7 @@ public class Ignore extends CommandBase<IgnoreManager>
|
|||||||
@Override
|
@Override
|
||||||
public void Execute(final Player caller, final String[] args)
|
public void Execute(final Player caller, final String[] args)
|
||||||
{
|
{
|
||||||
if (args == null)
|
if (args == null || args.length < 1)
|
||||||
{
|
{
|
||||||
Plugin.showIgnores(caller);
|
Plugin.showIgnores(caller);
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,9 @@ package mineplex.core.itemstack;
|
|||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
import java.util.Collection;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
import java.util.HashSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
@ -12,6 +14,7 @@ import org.bukkit.Color;
|
|||||||
import org.bukkit.FireworkEffect;
|
import org.bukkit.FireworkEffect;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.enchantments.Enchantment;
|
import org.bukkit.enchantments.Enchantment;
|
||||||
|
import org.bukkit.inventory.ItemFlag;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
import org.bukkit.inventory.meta.FireworkEffectMeta;
|
import org.bukkit.inventory.meta.FireworkEffectMeta;
|
||||||
import org.bukkit.inventory.meta.ItemMeta;
|
import org.bukkit.inventory.meta.ItemMeta;
|
||||||
@ -19,6 +22,8 @@ import org.bukkit.inventory.meta.LeatherArmorMeta;
|
|||||||
import org.bukkit.inventory.meta.SkullMeta;
|
import org.bukkit.inventory.meta.SkullMeta;
|
||||||
import org.bukkit.potion.Potion;
|
import org.bukkit.potion.Potion;
|
||||||
|
|
||||||
|
import mineplex.core.common.util.C;
|
||||||
|
|
||||||
public class ItemBuilder
|
public class ItemBuilder
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -48,20 +53,17 @@ public class ItemBuilder
|
|||||||
private final HashMap<Enchantment, Integer> _enchants = new HashMap<Enchantment, Integer>();
|
private final HashMap<Enchantment, Integer> _enchants = new HashMap<Enchantment, Integer>();
|
||||||
private final List<String> _lore = new ArrayList<String>();
|
private final List<String> _lore = new ArrayList<String>();
|
||||||
private Material _mat;
|
private Material _mat;
|
||||||
// private Potion potion;
|
|
||||||
private String _title = null;
|
private String _title = null;
|
||||||
private boolean _unbreakable;
|
private boolean _unbreakable;
|
||||||
private String _playerHeadName = null;
|
private String _playerHeadName = null;
|
||||||
|
private HashSet<ItemFlag> _itemFlags = new HashSet<ItemFlag>();
|
||||||
|
|
||||||
public ItemBuilder(ItemStack item)
|
public ItemBuilder(ItemStack item)
|
||||||
{
|
{
|
||||||
this(item.getType(), item.getDurability());
|
this(item.getType(), item.getDurability());
|
||||||
_amount = item.getAmount();
|
_amount = item.getAmount();
|
||||||
_enchants.putAll(item.getEnchantments());
|
_enchants.putAll(item.getEnchantments());
|
||||||
if (item.getType() == Material.POTION)
|
|
||||||
{
|
|
||||||
// setPotion(Potion.fromItemStack(item));
|
|
||||||
}
|
|
||||||
if (item.hasItemMeta())
|
if (item.hasItemMeta())
|
||||||
{
|
{
|
||||||
ItemMeta meta = item.getItemMeta();
|
ItemMeta meta = item.getItemMeta();
|
||||||
@ -81,6 +83,8 @@ public class ItemBuilder
|
|||||||
setColor(((LeatherArmorMeta) meta).getColor());
|
setColor(((LeatherArmorMeta) meta).getColor());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_itemFlags.addAll(meta.getItemFlags());
|
||||||
|
|
||||||
_unbreakable = meta.spigot().isUnbreakable();
|
_unbreakable = meta.spigot().isUnbreakable();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -107,13 +111,60 @@ public class ItemBuilder
|
|||||||
this(mat, 1, data);
|
this(mat, 1, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public HashSet<ItemFlag> getItemFlags()
|
||||||
|
{
|
||||||
|
return _itemFlags;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ItemBuilder addItemFlags(ItemFlag... flags)
|
||||||
|
{
|
||||||
|
getItemFlags().addAll(Arrays.asList(flags));
|
||||||
|
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ItemBuilder setItemFlags(ItemFlag... flags)
|
||||||
|
{
|
||||||
|
getItemFlags().clear();
|
||||||
|
addItemFlags(flags);
|
||||||
|
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ItemBuilder setItemFlags(Collection<ItemFlag> flags)
|
||||||
|
{
|
||||||
|
getItemFlags().clear();
|
||||||
|
addItemFlags(flags.toArray(new ItemFlag[0]));
|
||||||
|
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ItemBuilder setHideInfo(boolean hideInfo)
|
||||||
|
{
|
||||||
|
if (hideInfo)
|
||||||
|
{
|
||||||
|
for (ItemFlag flag : ItemFlag.values())
|
||||||
|
{
|
||||||
|
getItemFlags().add(flag);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
getItemFlags().clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
public ItemBuilder addEnchantment(Enchantment enchant, int level)
|
public ItemBuilder addEnchantment(Enchantment enchant, int level)
|
||||||
{
|
{
|
||||||
if (_enchants.containsKey(enchant))
|
if (_enchants.containsKey(enchant))
|
||||||
{
|
{
|
||||||
_enchants.remove(enchant);
|
_enchants.remove(enchant);
|
||||||
}
|
}
|
||||||
|
|
||||||
_enchants.put(enchant, level);
|
_enchants.put(enchant, level);
|
||||||
|
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -121,20 +172,31 @@ public class ItemBuilder
|
|||||||
{
|
{
|
||||||
for (String lore : lores)
|
for (String lore : lores)
|
||||||
{
|
{
|
||||||
_lore.add(ChatColor.GRAY + lore);
|
_lore.add(C.cGray + lore);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ItemBuilder setLore(String... lores)
|
||||||
|
{
|
||||||
|
_lore.clear();
|
||||||
|
_lore.addAll(Arrays.asList(lores));
|
||||||
|
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ItemBuilder addLore(String lore, int maxLength)
|
public ItemBuilder addLore(String lore, int maxLength)
|
||||||
{
|
{
|
||||||
_lore.addAll(split(lore, maxLength));
|
_lore.addAll(split(lore, maxLength));
|
||||||
|
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ItemBuilder addLores(List<String> lores)
|
public ItemBuilder addLores(List<String> lores)
|
||||||
{
|
{
|
||||||
_lore.addAll(lores);
|
_lore.addAll(lores);
|
||||||
|
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -144,6 +206,7 @@ public class ItemBuilder
|
|||||||
{
|
{
|
||||||
addLore(lore, maxLength);
|
addLore(lore, maxLength);
|
||||||
}
|
}
|
||||||
|
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -155,6 +218,7 @@ public class ItemBuilder
|
|||||||
public ItemStack build()
|
public ItemStack build()
|
||||||
{
|
{
|
||||||
Material mat = _mat;
|
Material mat = _mat;
|
||||||
|
|
||||||
if (mat == null)
|
if (mat == null)
|
||||||
{
|
{
|
||||||
mat = Material.AIR;
|
mat = Material.AIR;
|
||||||
@ -164,8 +228,10 @@ public class ItemBuilder
|
|||||||
{
|
{
|
||||||
Bukkit.getLogger().warning("Air material!");
|
Bukkit.getLogger().warning("Air material!");
|
||||||
}
|
}
|
||||||
|
|
||||||
ItemStack item = new ItemStack(mat, _amount, _data);
|
ItemStack item = new ItemStack(mat, _amount, _data);
|
||||||
ItemMeta meta = item.getItemMeta();
|
ItemMeta meta = item.getItemMeta();
|
||||||
|
|
||||||
if (meta != null)
|
if (meta != null)
|
||||||
{
|
{
|
||||||
if (_title != null)
|
if (_title != null)
|
||||||
@ -189,14 +255,13 @@ public class ItemBuilder
|
|||||||
((FireworkEffectMeta) meta).setEffect(FireworkEffect.builder().withColor(_color).build());
|
((FireworkEffectMeta) meta).setEffect(FireworkEffect.builder().withColor(_color).build());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
meta.addItemFlags(getItemFlags().toArray(new ItemFlag[0]));
|
||||||
meta.spigot().setUnbreakable(isUnbreakable());
|
meta.spigot().setUnbreakable(isUnbreakable());
|
||||||
item.setItemMeta(meta);
|
item.setItemMeta(meta);
|
||||||
}
|
}
|
||||||
|
|
||||||
item.addUnsafeEnchantments(_enchants);
|
item.addUnsafeEnchantments(_enchants);
|
||||||
// if (potion != null) {
|
|
||||||
// potion.apply(item);
|
|
||||||
// }
|
|
||||||
return item;
|
return item;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -263,52 +328,6 @@ public class ItemBuilder
|
|||||||
return _enchants.containsKey(enchant);
|
return _enchants.containsKey(enchant);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isItem(ItemStack item)
|
|
||||||
{
|
|
||||||
ItemMeta meta = item.getItemMeta();
|
|
||||||
|
|
||||||
if (item.getType() != getType())
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!meta.hasDisplayName() && getTitle() != null)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!meta.getDisplayName().equals(getTitle()))
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!meta.hasLore() && !getLore().isEmpty())
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (meta.hasLore())
|
|
||||||
{
|
|
||||||
for (String lore : meta.getLore())
|
|
||||||
{
|
|
||||||
if (!getLore().contains(lore))
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for (Enchantment enchant : item.getEnchantments().keySet())
|
|
||||||
{
|
|
||||||
if (!hasEnchantment(enchant))
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isUnbreakable()
|
public boolean isUnbreakable()
|
||||||
{
|
{
|
||||||
return _unbreakable;
|
return _unbreakable;
|
||||||
@ -317,17 +336,14 @@ public class ItemBuilder
|
|||||||
public ItemBuilder setAmount(int amount)
|
public ItemBuilder setAmount(int amount)
|
||||||
{
|
{
|
||||||
_amount = amount;
|
_amount = amount;
|
||||||
|
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ItemBuilder setColor(Color color)
|
public ItemBuilder setColor(Color color)
|
||||||
{
|
{
|
||||||
/* (!_mat.name().contains("LEATHER_"))
|
|
||||||
{
|
|
||||||
throw new IllegalArgumentException("Can only dye leather armor!");
|
|
||||||
}*/
|
|
||||||
|
|
||||||
_color = color;
|
_color = color;
|
||||||
|
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -338,19 +354,10 @@ public class ItemBuilder
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ItemBuilder setPotion(Potion potion)
|
|
||||||
{
|
|
||||||
if (_mat != Material.POTION)
|
|
||||||
{
|
|
||||||
_mat = Material.POTION;
|
|
||||||
}
|
|
||||||
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public ItemBuilder setRawTitle(String title)
|
public ItemBuilder setRawTitle(String title)
|
||||||
{
|
{
|
||||||
_title = title;
|
_title = title;
|
||||||
|
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -378,24 +385,28 @@ public class ItemBuilder
|
|||||||
}
|
}
|
||||||
|
|
||||||
setTitle(title);
|
setTitle(title);
|
||||||
|
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ItemBuilder setType(Material mat)
|
public ItemBuilder setType(Material mat)
|
||||||
{
|
{
|
||||||
_mat = mat;
|
_mat = mat;
|
||||||
|
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ItemBuilder setUnbreakable(boolean setUnbreakable)
|
public ItemBuilder setUnbreakable(boolean setUnbreakable)
|
||||||
{
|
{
|
||||||
_unbreakable = setUnbreakable;
|
_unbreakable = setUnbreakable;
|
||||||
|
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ItemBuilder setPlayerHead(String playerName)
|
public ItemBuilder setPlayerHead(String playerName)
|
||||||
{
|
{
|
||||||
_playerHeadName = playerName;
|
_playerHeadName = playerName;
|
||||||
|
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,11 +0,0 @@
|
|||||||
eclipse.preferences.version=1
|
|
||||||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
|
||||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
|
|
||||||
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
|
|
||||||
org.eclipse.jdt.core.compiler.compliance=1.7
|
|
||||||
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
|
|
||||||
org.eclipse.jdt.core.compiler.debug.localVariable=generate
|
|
||||||
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
|
|
||||||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
|
||||||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
|
||||||
org.eclipse.jdt.core.compiler.source=1.7
|
|
@ -1,11 +0,0 @@
|
|||||||
eclipse.preferences.version=1
|
|
||||||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
|
||||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
|
|
||||||
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
|
|
||||||
org.eclipse.jdt.core.compiler.compliance=1.7
|
|
||||||
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
|
|
||||||
org.eclipse.jdt.core.compiler.debug.localVariable=generate
|
|
||||||
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
|
|
||||||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
|
||||||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
|
||||||
org.eclipse.jdt.core.compiler.source=1.7
|
|
@ -1,11 +0,0 @@
|
|||||||
eclipse.preferences.version=1
|
|
||||||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
|
||||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
|
|
||||||
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
|
|
||||||
org.eclipse.jdt.core.compiler.compliance=1.7
|
|
||||||
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
|
|
||||||
org.eclipse.jdt.core.compiler.debug.localVariable=generate
|
|
||||||
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
|
|
||||||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
|
||||||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
|
||||||
org.eclipse.jdt.core.compiler.source=1.7
|
|
@ -1,11 +0,0 @@
|
|||||||
eclipse.preferences.version=1
|
|
||||||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
|
||||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
|
|
||||||
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
|
|
||||||
org.eclipse.jdt.core.compiler.compliance=1.7
|
|
||||||
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
|
|
||||||
org.eclipse.jdt.core.compiler.debug.localVariable=generate
|
|
||||||
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
|
|
||||||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
|
||||||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
|
||||||
org.eclipse.jdt.core.compiler.source=1.7
|
|
@ -2,6 +2,7 @@ package mineplex.hub.profile.buttons;
|
|||||||
|
|
||||||
import mineplex.core.common.util.C;
|
import mineplex.core.common.util.C;
|
||||||
import mineplex.core.gui.GuiItem;
|
import mineplex.core.gui.GuiItem;
|
||||||
|
import mineplex.core.itemstack.ItemBuilder;
|
||||||
import mineplex.core.itemstack.ItemStackFactory;
|
import mineplex.core.itemstack.ItemStackFactory;
|
||||||
import mineplex.hub.profile.gui.GUIProfile;
|
import mineplex.hub.profile.gui.GUIProfile;
|
||||||
|
|
||||||
@ -17,7 +18,7 @@ public class ButtonPrefs implements GuiItem
|
|||||||
|
|
||||||
private GUIProfile _profile;
|
private GUIProfile _profile;
|
||||||
private Player _player;
|
private Player _player;
|
||||||
|
|
||||||
public ButtonPrefs(GUIProfile profile, Player player)
|
public ButtonPrefs(GUIProfile profile, Player player)
|
||||||
{
|
{
|
||||||
_profile = profile;
|
_profile = profile;
|
||||||
@ -33,29 +34,27 @@ public class ButtonPrefs implements GuiItem
|
|||||||
@Override
|
@Override
|
||||||
public ItemStack getObject()
|
public ItemStack getObject()
|
||||||
{
|
{
|
||||||
return ItemStackFactory.Instance.CreateStack(Material.REDSTONE_COMPARATOR.getId(), (byte)0, 1,
|
return new ItemBuilder(Material.REDSTONE_COMPARATOR).setTitle(C.Reset + C.cYellow + "Preferences").addLore(new String[]
|
||||||
ChatColor.RESET + C.cYellow + "Preferences",
|
{
|
||||||
new String[]
|
"",
|
||||||
{
|
C.cWhite + "Set your preferences to your liking",
|
||||||
"",
|
C.cWhite + "so you can enjoy the game more!",
|
||||||
C.cWhite + "Set your preferences to your liking",
|
|
||||||
C.cWhite + "so you can enjoy the game more!",
|
"",
|
||||||
|
C.cWhite + "Type " + C.cGreen + "/prefs" + C.cWhite + " to access this anywhere!"
|
||||||
"",
|
}).build();
|
||||||
C.cWhite + "Type " + C.cGreen + "/prefs" + C.cWhite + " to access this anywhere!"
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setup()
|
public void setup()
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void close()
|
public void close()
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -4,13 +4,14 @@ import java.util.ArrayList;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.entity.Player;
|
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
import mineplex.core.account.CoreClientManager;
|
import mineplex.core.account.CoreClientManager;
|
||||||
import mineplex.core.common.util.C;
|
import mineplex.core.common.util.C;
|
||||||
import mineplex.core.donation.DonationManager;
|
import mineplex.core.donation.DonationManager;
|
||||||
|
import mineplex.core.itemstack.ItemBuilder;
|
||||||
import mineplex.core.itemstack.ItemStackFactory;
|
import mineplex.core.itemstack.ItemStackFactory;
|
||||||
import mineplex.core.shop.page.ShopPageBase;
|
import mineplex.core.shop.page.ShopPageBase;
|
||||||
import mineplex.hub.server.ServerManager;
|
import mineplex.hub.server.ServerManager;
|
||||||
@ -34,17 +35,18 @@ public class ServerGameMenu extends ShopPageBase<ServerManager, QuickShop>
|
|||||||
{
|
{
|
||||||
private List<ItemStack> _superSmashCycle = new ArrayList<ItemStack>();
|
private List<ItemStack> _superSmashCycle = new ArrayList<ItemStack>();
|
||||||
private List<ItemStack> _minigameCycle = new ArrayList<ItemStack>();
|
private List<ItemStack> _minigameCycle = new ArrayList<ItemStack>();
|
||||||
|
|
||||||
private int _ssmIndex;
|
private int _ssmIndex;
|
||||||
private int _minigameIndex;
|
private int _minigameIndex;
|
||||||
|
|
||||||
public ServerGameMenu(ServerManager plugin, QuickShop quickShop, CoreClientManager clientManager, DonationManager donationManager, String name, Player player)
|
public ServerGameMenu(ServerManager plugin, QuickShop quickShop, CoreClientManager clientManager,
|
||||||
|
DonationManager donationManager, String name, Player player)
|
||||||
{
|
{
|
||||||
super(plugin, quickShop, clientManager, donationManager, name, player, 47);
|
super(plugin, quickShop, clientManager, donationManager, name, player, 47);
|
||||||
|
|
||||||
createSuperSmashCycle();
|
createSuperSmashCycle();
|
||||||
createMinigameCycle();
|
createMinigameCycle();
|
||||||
|
|
||||||
buildPage();
|
buildPage();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -52,82 +54,93 @@ public class ServerGameMenu extends ShopPageBase<ServerManager, QuickShop>
|
|||||||
@Override
|
@Override
|
||||||
protected void buildPage()
|
protected void buildPage()
|
||||||
{
|
{
|
||||||
setItem(0, ItemStackFactory.Instance.CreateStack(Material.IRON_PICKAXE.getId(), (byte)0, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "The Bridges " + C.cGray + "4 Team Survival", new String[]
|
setItem(0, new ItemBuilder(Material.IRON_PICKAXE)
|
||||||
{
|
.setTitle(C.Reset + C.Bold + C.cYellow + "The Bridges " + C.cGray + "4 Team Survival").addLore(new String[]
|
||||||
ChatColor.RESET + "",
|
{
|
||||||
ChatColor.RESET + "4 Teams get 10 minutes to prepare.",
|
C.Reset + "",
|
||||||
ChatColor.RESET + "Then the bridges drop, and all hell",
|
C.Reset + "4 Teams get 10 minutes to prepare.",
|
||||||
ChatColor.RESET + "breaks loose as you battle to the",
|
C.Reset + "Then the bridges drop, and all hell",
|
||||||
ChatColor.RESET + "death with the other teams.",
|
C.Reset + "breaks loose as you battle to the",
|
||||||
ChatColor.RESET + "",
|
C.Reset + "death with the other teams.",
|
||||||
ChatColor.RESET + "Join " + ChatColor.GREEN + getPlugin().getGroupTagPlayerCount("BR") + ChatColor.RESET + " other players!",
|
C.Reset + "",
|
||||||
}));
|
C.Reset + "Join " + C.cGreen + getPlugin().getGroupTagPlayerCount("BR") + C.Reset + " other players!"
|
||||||
|
}).setHideInfo(true).build());
|
||||||
setItem(2, ItemStackFactory.Instance.CreateStack(Material.DIAMOND_SWORD.getId(), (byte)0, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Survival Games " + C.cGray + "Solo/Team Survival", new String[]
|
|
||||||
{
|
|
||||||
ChatColor.RESET + "",
|
|
||||||
ChatColor.RESET + "Search for chests to find loot and ",
|
|
||||||
ChatColor.RESET + "fight others to be the last man standing. ",
|
|
||||||
ChatColor.RESET + "Stay away from the borders!",
|
|
||||||
ChatColor.RESET + "",
|
|
||||||
ChatColor.RESET + "Join " + ChatColor.GREEN + (getPlugin().getGroupTagPlayerCount("HG") + getPlugin().getGroupTagPlayerCount("SG2")) + ChatColor.RESET + " other players!",
|
|
||||||
}));
|
|
||||||
|
|
||||||
setItem(4, ItemStackFactory.Instance.CreateStack(Material.FEATHER.getId(), (byte) 0, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Skywars " + C.cGray + "Solo/Team Survival", new String[]
|
setItem(2, new ItemBuilder(Material.DIAMOND_SWORD)
|
||||||
{
|
.setTitle(C.Reset + C.Bold + C.cYellow + "Survival Games " + C.cGray + "Solo/Team Survival").addLore(new String[]
|
||||||
ChatColor.RESET + "",
|
{
|
||||||
ChatColor.RESET + "16 contenders fight for the right to rule the skies!",
|
C.Reset + "",
|
||||||
ChatColor.RESET + "Spawn on a sky island and build your path!",
|
C.Reset + "Search for chests to find loot and ",
|
||||||
ChatColor.RESET + "Find weapons to take your enemies down!",
|
C.Reset + "fight others to be the last man standing. ",
|
||||||
ChatColor.RESET + "Way up there, death ever looming if you fall..",
|
C.Reset + "Stay away from the borders!",
|
||||||
ChatColor.RESET + "Can you fight? Can you live? Can you win Skywars?",
|
C.Reset + "",
|
||||||
ChatColor.RESET + "",
|
C.Reset + "Join " + C.cGreen
|
||||||
ChatColor.RESET + "Join " + ChatColor.GREEN + (getPlugin().getGroupTagPlayerCount("SKY") + getPlugin().getGroupTagPlayerCount("SKY2")) + ChatColor.RESET + " other players!",
|
+ (getPlugin().getGroupTagPlayerCount("HG") + getPlugin().getGroupTagPlayerCount("SG2")) + C.Reset
|
||||||
}));
|
+ " other players!"
|
||||||
|
}).setHideInfo(true).build());
|
||||||
|
|
||||||
setItem(6, ItemStackFactory.Instance.CreateStack(Material.GOLDEN_APPLE.getId(), (byte)0, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "UHC " + C.cGray + "Ultra Hardcore Mode", new String[]
|
setItem(4, new ItemBuilder(Material.FEATHER)
|
||||||
{
|
.setTitle(C.Reset + C.Bold + C.cYellow + "Skywars " + C.cGray + "Solo/Team Survival").addLore(new String[]
|
||||||
ChatColor.RESET + "",
|
{
|
||||||
ChatColor.RESET + "Extremely hard team-based survival ",
|
C.Reset + "",
|
||||||
ChatColor.RESET + "Gather materials and fight your way",
|
C.Reset + "16 contenders fight to rule the skies!",
|
||||||
ChatColor.RESET + "to become the last team standing!",
|
C.Reset + "Spawn on a sky island and build your path!",
|
||||||
ChatColor.RESET + "",
|
C.Reset + "Find weapons to take your enemies down!",
|
||||||
ChatColor.RESET + "Join " + ChatColor.GREEN + getPlugin().getGroupTagPlayerCount("UHC") + ChatColor.RESET + " other players!",
|
C.Reset + "Up in the skies, death looming if you fall..",
|
||||||
}));
|
C.Reset + "Win! Fight! Send enemies flying in Skywars!",
|
||||||
|
C.Reset + "",
|
||||||
|
C.Reset + "Join " + C.cGreen
|
||||||
|
+ (getPlugin().getGroupTagPlayerCount("SKY") + getPlugin().getGroupTagPlayerCount("SKY2")) + C.Reset
|
||||||
|
+ " other players!",
|
||||||
|
}).setHideInfo(true).build());
|
||||||
|
|
||||||
setItem(8, ItemStackFactory.Instance.CreateStack(Material.BLAZE_ROD.getId(), (byte) 0, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Wizards " + C.cGray + "Last Man Standing", new String[]
|
setItem(6, new ItemBuilder(Material.GOLDEN_APPLE)
|
||||||
{
|
.setTitle(C.Reset + C.Bold + C.cYellow + "UHC " + C.cGray + "Ultra Hardcore Mode").addLore(new String[]
|
||||||
ChatColor.RESET + "",
|
{
|
||||||
ChatColor.RESET + "Wield powerful spells to fight",
|
C.Reset + "",
|
||||||
ChatColor.RESET + "against other players in this",
|
C.Reset + "Extremely hard team-based survival ",
|
||||||
ChatColor.RESET + "exciting free-for-all brawl!",
|
C.Reset + "Gather materials and fight your way",
|
||||||
ChatColor.RESET + "",
|
C.Reset + "to become the last team standing!",
|
||||||
ChatColor.RESET + "Join " + ChatColor.GREEN + getPlugin().getGroupTagPlayerCount("WIZ") + ChatColor.RESET + " other players!",
|
C.Reset + "",
|
||||||
}));
|
C.Reset + "Join " + C.cGreen + getPlugin().getGroupTagPlayerCount("UHC") + C.Reset + " other players!",
|
||||||
|
}).setHideInfo(true).build());
|
||||||
|
|
||||||
setItem(18, ItemStackFactory.Instance.CreateStack(Material.DIAMOND_CHESTPLATE, (byte)0, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Castle Siege " + C.cGray + "Team Game", new String[]
|
setItem(8, new ItemBuilder(Material.BLAZE_ROD)
|
||||||
{
|
.setTitle(C.Reset + C.Bold + C.cYellow + "Wizards " + C.cGray + "Last Man Standing").addLore(new String[]
|
||||||
ChatColor.RESET + "",
|
{
|
||||||
ChatColor.RESET + "Defenders must protect King Sparklez",
|
C.Reset + "",
|
||||||
ChatColor.RESET + "from the endless waves of Undead",
|
C.Reset + "Wield powerful spells to fight",
|
||||||
ChatColor.RESET + "until the sun rises!",
|
C.Reset + "against other players in this",
|
||||||
ChatColor.RESET + "",
|
C.Reset + "exciting free-for-all brawl!",
|
||||||
ChatColor.RESET + "Join " + ChatColor.GREEN + getPlugin().getGroupTagPlayerCount("CS") + ChatColor.RESET + " other players!",
|
C.Reset + "",
|
||||||
}));
|
C.Reset + "Join " + C.cGreen + getPlugin().getGroupTagPlayerCount("WIZ") + C.Reset + " other players!",
|
||||||
|
}).setHideInfo(true).build());
|
||||||
|
|
||||||
setItem(20, ItemStackFactory.Instance.CreateStack(Material.GRASS.getId(), (byte)0, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Block Hunt " + C.cGray + "Cat and Mouse", new String[]
|
setItem(18, new ItemBuilder(Material.DIAMOND_CHESTPLATE)
|
||||||
{
|
.setTitle(C.Reset + C.Bold + C.cYellow + "Castle Siege " + C.cGray + "Team Game").addLore(new String[]
|
||||||
ChatColor.RESET + "",
|
{
|
||||||
ChatColor.RESET + "Hide as blocks/animals, upgrade your ",
|
C.Reset + "",
|
||||||
ChatColor.RESET + "weapon and fight to survive against",
|
C.Reset + "Defenders must protect King Sparklez",
|
||||||
ChatColor.RESET + "the Hunters!",
|
C.Reset + "from the endless waves of Undead",
|
||||||
ChatColor.RESET + "",
|
C.Reset + "until the sun rises!",
|
||||||
ChatColor.RESET + "Join " + ChatColor.GREEN + getPlugin().getGroupTagPlayerCount("BH") + ChatColor.RESET + " other players!",
|
C.Reset + "",
|
||||||
}));
|
C.Reset + "Join " + C.cGreen + getPlugin().getGroupTagPlayerCount("CS") + C.Reset + " other players!",
|
||||||
|
}).setHideInfo(true).build());
|
||||||
|
|
||||||
|
setItem(20, new ItemBuilder(Material.GRASS)
|
||||||
|
.setTitle(C.Reset + C.Bold + C.cYellow + "Block Hunt " + C.cGray + "Cat and Mouse").addLore(new String[]
|
||||||
|
{
|
||||||
|
C.Reset + "",
|
||||||
|
C.Reset + "Hide as blocks/animals, upgrade your ",
|
||||||
|
C.Reset + "weapon and fight to survive against",
|
||||||
|
C.Reset + "the Hunters!",
|
||||||
|
C.Reset + "",
|
||||||
|
C.Reset + "Join " + C.cGreen + getPlugin().getGroupTagPlayerCount("BH") + C.Reset + " other players!",
|
||||||
|
}).setHideInfo(true).build());
|
||||||
|
|
||||||
setItem(22, _superSmashCycle.get(_ssmIndex));
|
setItem(22, _superSmashCycle.get(_ssmIndex));
|
||||||
|
|
||||||
setItem(24, ItemStackFactory.Instance.CreateStack(Material.TNT.getId(), (byte) 0, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Mine-Strike " + C.cGray + "Team Survival", new String[]
|
setItem(24, ItemStackFactory.Instance.CreateStack(Material.TNT.getId(), (byte) 0, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Mine-Strike" + C.cGray + "Team Survival", new String[]
|
||||||
{
|
{
|
||||||
ChatColor.RESET + "",
|
ChatColor.RESET + "",
|
||||||
ChatColor.RESET + "One team must defend two bomb sites from",
|
ChatColor.RESET + "One team must defend two bomb sites from",
|
||||||
@ -177,23 +190,79 @@ public class ServerGameMenu extends ShopPageBase<ServerManager, QuickShop>
|
|||||||
ChatColor.RESET + "Join " + ChatColor.GREEN + getPlugin().getGroupTagPlayerCount("BLD") + ChatColor.RESET + " other players!",
|
ChatColor.RESET + "Join " + ChatColor.GREEN + getPlugin().getGroupTagPlayerCount("BLD") + ChatColor.RESET + " other players!",
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
setItem(24, new ItemBuilder(Material.TNT)
|
||||||
|
.setTitle(C.Reset + C.Bold + C.cYellow + "Mine-Strike " + C.cGray + "Team Survival").addLore(new String[]
|
||||||
|
{
|
||||||
|
C.Reset + "",
|
||||||
|
C.Reset + "One team must defend two bomb sites from",
|
||||||
|
C.Reset + "the other team, who are trying to plant a bomb",
|
||||||
|
C.Reset + "and blow them up!",
|
||||||
|
C.Reset + "",
|
||||||
|
C.Reset + "Join " + C.cGreen + getPlugin().getGroupTagPlayerCount("MS") + C.Reset + " other players!",
|
||||||
|
}).setHideInfo(true).build());
|
||||||
|
|
||||||
|
setItem(26, new ItemBuilder(Material.BOOK_AND_QUILL)
|
||||||
|
.setTitle(C.Reset + C.Bold + C.cYellow + "Draw My Thing " + C.cGray + "Pictionary!").addLore(new String[]
|
||||||
|
{
|
||||||
|
C.Reset + "",
|
||||||
|
C.Reset + "Players take turns at drawing a random",
|
||||||
|
C.Reset + "word. Whoever guesses it within the time",
|
||||||
|
C.Reset + "limit gets some points!",
|
||||||
|
C.Reset + "",
|
||||||
|
C.Reset + "Join " + C.cGreen + getPlugin().getGroupTagPlayerCount("DMT") + C.Reset + " other players!",
|
||||||
|
}).setHideInfo(true).build());
|
||||||
|
|
||||||
|
setItem(36, new ItemBuilder(Material.BEACON).setTitle(C.Reset + C.Bold + C.cYellow + "Dominate " + C.cGray + "Team Game")
|
||||||
|
.addLore(new String[]
|
||||||
|
{
|
||||||
|
C.Reset + "",
|
||||||
|
C.Reset + "Customize one of five exciting champions",
|
||||||
|
C.Reset + "and battle with the opposing team for the",
|
||||||
|
C.Reset + "control points on the map.",
|
||||||
|
C.Reset + "",
|
||||||
|
C.Reset + "Join " + C.cGreen + getPlugin().getGroupTagPlayerCount("DOM") + C.Reset + " other players!",
|
||||||
|
}).setHideInfo(true).build());
|
||||||
|
|
||||||
|
setItem(38, new ItemBuilder(Material.GOLD_SWORD)
|
||||||
|
.setTitle(C.Reset + C.Bold + C.cYellow + "Team Deathmatch " + C.cGray + "Team Game").addLore(new String[]
|
||||||
|
{
|
||||||
|
C.Reset + "",
|
||||||
|
C.Reset + "Customize one of five exciting champions",
|
||||||
|
C.Reset + "and battle with the opposing team to the",
|
||||||
|
C.Reset + "last man standing.",
|
||||||
|
C.Reset + "",
|
||||||
|
C.Reset + "Join " + C.cGreen + getPlugin().getGroupTagPlayerCount("TDM") + C.Reset + " other players!",
|
||||||
|
}).setHideInfo(true).build());
|
||||||
|
|
||||||
|
setItem(40, new ItemBuilder(Material.WOOD)
|
||||||
|
.setTitle(C.Reset + C.Bold + C.cYellow + "Master Builders " + C.cGray + "Creative Build").addLore(new String[]
|
||||||
|
{
|
||||||
|
C.Reset + "",
|
||||||
|
C.Reset + "Players are given a Build Theme and ",
|
||||||
|
C.Reset + "must use blocks, monsters and more",
|
||||||
|
C.Reset + "to create a masterpiece!",
|
||||||
|
C.Reset + "",
|
||||||
|
C.Reset + "Join " + C.cGreen + getPlugin().getGroupTagPlayerCount("BLD") + C.Reset + " other players!",
|
||||||
|
}).setHideInfo(true).build());
|
||||||
|
|
||||||
setItem(42, _minigameCycle.get(_minigameIndex));
|
setItem(42, _minigameCycle.get(_minigameIndex));
|
||||||
|
|
||||||
setItem(44, ItemStackFactory.Instance.CreateStack(Material.SKULL_ITEM.getId(), (byte) 3, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Player Servers " + C.cGray + "Player Hosted Games", new String[]
|
setItem(44, new ItemBuilder(Material.SKULL_ITEM, 1, (byte) 3)
|
||||||
{
|
.setTitle(C.Reset + C.Bold + C.cYellow + "Player Servers " + C.cGray + "Player Hosted Games").addLore(new String[]
|
||||||
ChatColor.RESET + "",
|
{
|
||||||
ChatColor.RESET + "Join your friends in their own ",
|
C.Reset + "",
|
||||||
ChatColor.RESET + "Mineplex Player Server. You can play",
|
C.Reset + "Join your friends in their own ",
|
||||||
ChatColor.RESET + "the games you want, when you want.",
|
C.Reset + "Mineplex Player Server. You can play",
|
||||||
ChatColor.RESET + "",
|
C.Reset + "the games you want, when you want.",
|
||||||
}));
|
C.Reset + "",
|
||||||
|
}).setHideInfo(true).build());
|
||||||
|
|
||||||
getButtonMap().put(0, new SelectBRButton(this));
|
getButtonMap().put(0, new SelectBRButton(this));
|
||||||
getButtonMap().put(2, new SelectSGButton(this));
|
getButtonMap().put(2, new SelectSGButton(this));
|
||||||
getButtonMap().put(4, new SelectSKYButton(this));
|
getButtonMap().put(4, new SelectSKYButton(this));
|
||||||
getButtonMap().put(6, new SelectUHCButton(this));
|
getButtonMap().put(6, new SelectUHCButton(this));
|
||||||
getButtonMap().put(8, new SelectWIZButton(this));
|
getButtonMap().put(8, new SelectWIZButton(this));
|
||||||
|
|
||||||
getButtonMap().put(18, new SelectCSButton(this));
|
getButtonMap().put(18, new SelectCSButton(this));
|
||||||
getButtonMap().put(20, new SelectBHButton(this));
|
getButtonMap().put(20, new SelectBHButton(this));
|
||||||
getButtonMap().put(22, new SelectSSMButton(this));
|
getButtonMap().put(22, new SelectSSMButton(this));
|
||||||
@ -204,271 +273,280 @@ public class ServerGameMenu extends ShopPageBase<ServerManager, QuickShop>
|
|||||||
getButtonMap().put(40, new SelectBLDButton(this));
|
getButtonMap().put(40, new SelectBLDButton(this));
|
||||||
getButtonMap().put(42, new SelectMINButton(this));
|
getButtonMap().put(42, new SelectMINButton(this));
|
||||||
getButtonMap().put(44, new SelectPLAYERButton(this));
|
getButtonMap().put(44, new SelectPLAYERButton(this));
|
||||||
// getButtonMap().put(44, new SelectBETAButton(this));
|
// getButtonMap().put(44, new SelectBETAButton(this));
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("deprecation")
|
@SuppressWarnings("deprecation")
|
||||||
private void createMinigameCycle()
|
private void createMinigameCycle()
|
||||||
{
|
{
|
||||||
int playerCount = getPlugin().getGroupTagPlayerCount("MIN") +
|
int playerCount = getPlugin().getGroupTagPlayerCount("MIN") + getPlugin().getGroupTagPlayerCount("DR")
|
||||||
getPlugin().getGroupTagPlayerCount("DR") +
|
+ getPlugin().getGroupTagPlayerCount("DE") + getPlugin().getGroupTagPlayerCount("PB")
|
||||||
getPlugin().getGroupTagPlayerCount("DE") +
|
+ getPlugin().getGroupTagPlayerCount("TF") + getPlugin().getGroupTagPlayerCount("RUN")
|
||||||
getPlugin().getGroupTagPlayerCount("PB") +
|
+ getPlugin().getGroupTagPlayerCount("SN") + getPlugin().getGroupTagPlayerCount("DT")
|
||||||
getPlugin().getGroupTagPlayerCount("TF") +
|
+ getPlugin().getGroupTagPlayerCount("SQ") + getPlugin().getGroupTagPlayerCount("SA")
|
||||||
getPlugin().getGroupTagPlayerCount("RUN") +
|
+ getPlugin().getGroupTagPlayerCount("SS") + getPlugin().getGroupTagPlayerCount("OITQ");
|
||||||
getPlugin().getGroupTagPlayerCount("SN") +
|
_minigameCycle.add(new ItemBuilder(Material.SMOOTH_BRICK)
|
||||||
getPlugin().getGroupTagPlayerCount("DT") +
|
.setTitle(C.Reset + C.Bold + C.cYellow + "Arcade " + C.cGray + "Mixed Games").addLore(new String[]
|
||||||
getPlugin().getGroupTagPlayerCount("SQ") +
|
{
|
||||||
getPlugin().getGroupTagPlayerCount("SA") +
|
C.Reset + "",
|
||||||
getPlugin().getGroupTagPlayerCount("SS") +
|
C.Reset + "Play all of these fun minigames:",
|
||||||
getPlugin().getGroupTagPlayerCount("OITQ");
|
C.Reset + "",
|
||||||
_minigameCycle.add(ItemStackFactory.Instance.CreateStack(98, (byte)0, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Arcade " + C.cGray + "Mixed Games", new String []
|
C.Reset + C.Bold + C.cGreen + "Super Spleef",
|
||||||
{
|
C.Reset + "Runner",
|
||||||
ChatColor.RESET + "",
|
C.Reset + "Dragons",
|
||||||
ChatColor.RESET + "Play all of these fun minigames:",
|
C.Reset + "One in the Quiver",
|
||||||
ChatColor.RESET + "",
|
C.Reset + "Dragon Escape",
|
||||||
ChatColor.RESET + C.Bold + ChatColor.GREEN + "Super Spleef",
|
C.Reset + "Sneaky Assassins",
|
||||||
ChatColor.RESET + "Runner",
|
C.Reset + "Micro Battle",
|
||||||
ChatColor.RESET + "Dragons",
|
C.Reset + "Super Paintball",
|
||||||
ChatColor.RESET + "One in the Quiver",
|
C.Reset + "Turf Wars",
|
||||||
ChatColor.RESET + "Dragon Escape",
|
C.Reset + "Death Tag",
|
||||||
ChatColor.RESET + "Sneaky Assassins",
|
C.Reset + "Bacon Brawl",
|
||||||
ChatColor.RESET + "Micro Battle",
|
C.Reset + "",
|
||||||
ChatColor.RESET + "Super Paintball",
|
C.Reset + "Join " + C.cGreen + playerCount + C.Reset + " other players!",
|
||||||
ChatColor.RESET + "Turf Wars",
|
}).setHideInfo(true).build());
|
||||||
ChatColor.RESET + "Death Tag",
|
|
||||||
ChatColor.RESET + "Bacon Brawl",
|
_minigameCycle.add(new ItemBuilder(Material.GOLD_BOOTS)
|
||||||
ChatColor.RESET + "",
|
.setTitle(C.Reset + C.Bold + C.cYellow + "Arcade " + C.cGray + "Mixed Games").addLore(new String[]
|
||||||
ChatColor.RESET + "Join " + ChatColor.GREEN + playerCount + ChatColor.RESET + " other players!",
|
{
|
||||||
}));
|
C.Reset + "",
|
||||||
|
C.Reset + "Play all of these fun minigames:",
|
||||||
_minigameCycle.add(ItemStackFactory.Instance.CreateStack(Material.GOLD_BOOTS.getId(), (byte)0, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Arcade " + C.cGray + "Mixed Games", new String []
|
C.Reset + "",
|
||||||
{
|
C.Reset + "Super Spleef",
|
||||||
ChatColor.RESET + "",
|
C.Reset + C.Bold + C.cGreen + "Runner",
|
||||||
ChatColor.RESET + "Play all of these fun minigames:",
|
C.Reset + "Dragons",
|
||||||
ChatColor.RESET + "",
|
C.Reset + "One in the Quiver",
|
||||||
ChatColor.RESET + "Super Spleef",
|
C.Reset + "Dragon Escape",
|
||||||
ChatColor.RESET + C.Bold + ChatColor.GREEN + "Runner",
|
C.Reset + "Sneaky Assassins",
|
||||||
ChatColor.RESET + "Dragons",
|
C.Reset + "Micro Battle",
|
||||||
ChatColor.RESET + "One in the Quiver",
|
C.Reset + "Super Paintball",
|
||||||
ChatColor.RESET + "Dragon Escape",
|
C.Reset + "Turf Wars",
|
||||||
ChatColor.RESET + "Sneaky Assassins",
|
C.Reset + "Death Tag",
|
||||||
ChatColor.RESET + "Micro Battle",
|
C.Reset + "Bacon Brawl",
|
||||||
ChatColor.RESET + "Super Paintball",
|
C.Reset + "",
|
||||||
ChatColor.RESET + "Turf Wars",
|
C.Reset + "Join " + C.cGreen + playerCount + C.Reset + " other players!",
|
||||||
ChatColor.RESET + "Death Tag",
|
}).setHideInfo(true).build());
|
||||||
ChatColor.RESET + "Bacon Brawl",
|
|
||||||
ChatColor.RESET + "",
|
_minigameCycle.add(new ItemBuilder(Material.DRAGON_EGG)
|
||||||
ChatColor.RESET + "Join " + ChatColor.GREEN + playerCount + ChatColor.RESET + " other players!",
|
.setTitle(C.Reset + C.Bold + C.cYellow + "Arcade " + C.cGray + "Mixed Games").addLore(new String[]
|
||||||
}));
|
{
|
||||||
|
C.Reset + "",
|
||||||
_minigameCycle.add(ItemStackFactory.Instance.CreateStack(122, (byte)0, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Arcade " + C.cGray + "Mixed Games", new String []
|
C.Reset + "Play all of these fun minigames:",
|
||||||
{
|
C.Reset + "",
|
||||||
ChatColor.RESET + "",
|
C.Reset + "Super Spleef",
|
||||||
ChatColor.RESET + "Play all of these fun minigames:",
|
C.Reset + "Runner",
|
||||||
ChatColor.RESET + "",
|
C.Reset + C.Bold + C.cGreen + "Dragons",
|
||||||
ChatColor.RESET + "Super Spleef",
|
C.Reset + "One in the Quiver",
|
||||||
ChatColor.RESET + "Runner",
|
C.Reset + "Dragon Escape",
|
||||||
ChatColor.RESET + C.Bold + ChatColor.GREEN + "Dragons",
|
C.Reset + "Sneaky Assassins",
|
||||||
ChatColor.RESET + "One in the Quiver",
|
C.Reset + "Micro Battle",
|
||||||
ChatColor.RESET + "Dragon Escape",
|
C.Reset + "Super Paintball",
|
||||||
ChatColor.RESET + "Sneaky Assassins",
|
C.Reset + "Turf Wars",
|
||||||
ChatColor.RESET + "Micro Battle",
|
C.Reset + "Death Tag",
|
||||||
ChatColor.RESET + "Super Paintball",
|
C.Reset + "Bacon Brawl",
|
||||||
ChatColor.RESET + "Turf Wars",
|
C.Reset + "",
|
||||||
ChatColor.RESET + "Death Tag",
|
C.Reset + "Join " + C.cGreen + playerCount + C.Reset + " other players!",
|
||||||
ChatColor.RESET + "Bacon Brawl",
|
}).setHideInfo(true).build());
|
||||||
ChatColor.RESET + "",
|
|
||||||
ChatColor.RESET + "Join " + ChatColor.GREEN + playerCount + ChatColor.RESET + " other players!",
|
_minigameCycle.add(new ItemBuilder(Material.BOW)
|
||||||
}));
|
.setTitle(C.Reset + C.Bold + C.cYellow + "Arcade " + C.cGray + "Mixed Games").addLore(new String[]
|
||||||
|
{
|
||||||
_minigameCycle.add(ItemStackFactory.Instance.CreateStack(Material.BOW, (byte)0, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Arcade " + C.cGray + "Mixed Games", new String []
|
C.Reset + "",
|
||||||
{
|
C.Reset + "Play all of these fun minigames:",
|
||||||
ChatColor.RESET + "",
|
C.Reset + "",
|
||||||
ChatColor.RESET + "Play all of these fun minigames:",
|
C.Reset + "Super Spleef",
|
||||||
ChatColor.RESET + "",
|
C.Reset + "Runner",
|
||||||
ChatColor.RESET + "Super Spleef",
|
C.Reset + "Dragons",
|
||||||
ChatColor.RESET + "Runner",
|
C.Reset + C.Bold + C.cGreen + "One in the Quiver",
|
||||||
ChatColor.RESET + "Dragons",
|
C.Reset + "Dragon Escape",
|
||||||
ChatColor.RESET + C.Bold + ChatColor.GREEN + "One in the Quiver",
|
C.Reset + "Sneaky Assassins",
|
||||||
ChatColor.RESET + "Dragon Escape",
|
C.Reset + "Micro Battle",
|
||||||
ChatColor.RESET + "Sneaky Assassins",
|
C.Reset + "Super Paintball",
|
||||||
ChatColor.RESET + "Micro Battle",
|
C.Reset + "Turf Wars",
|
||||||
ChatColor.RESET + "Super Paintball",
|
C.Reset + "Death Tag",
|
||||||
ChatColor.RESET + "Turf Wars",
|
C.Reset + "Bacon Brawl",
|
||||||
ChatColor.RESET + "Death Tag",
|
C.Reset + "",
|
||||||
ChatColor.RESET + "Bacon Brawl",
|
C.Reset + "Join " + C.cGreen + playerCount + C.Reset + " other players!",
|
||||||
ChatColor.RESET + "",
|
}).setHideInfo(true).build());
|
||||||
ChatColor.RESET + "Join " + ChatColor.GREEN + playerCount + ChatColor.RESET + " other players!",
|
|
||||||
}));
|
_minigameCycle.add(new ItemBuilder(Material.LEATHER_BOOTS)
|
||||||
|
.setTitle(C.Reset + C.Bold + C.cYellow + "Arcade " + C.cGray + "Mixed Games").addLore(new String[]
|
||||||
_minigameCycle.add(ItemStackFactory.Instance.CreateStack(Material.LEATHER_BOOTS.getId(), (byte)0, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Arcade " + C.cGray + "Mixed Games", new String []
|
{
|
||||||
{
|
C.Reset + "",
|
||||||
ChatColor.RESET + "",
|
C.Reset + "Play all of these fun minigames:",
|
||||||
ChatColor.RESET + "Play all of these fun minigames:",
|
C.Reset + "",
|
||||||
ChatColor.RESET + "",
|
C.Reset + "Super Spleef",
|
||||||
ChatColor.RESET + "Super Spleef",
|
C.Reset + "Runner",
|
||||||
ChatColor.RESET + "Runner",
|
C.Reset + "Dragons",
|
||||||
ChatColor.RESET + "Dragons",
|
C.Reset + "One in the Quiver",
|
||||||
ChatColor.RESET + "One in the Quiver",
|
C.Reset + C.Bold + C.cGreen + "Dragon Escape",
|
||||||
ChatColor.RESET + C.Bold + ChatColor.GREEN + "Dragon Escape",
|
C.Reset + "Sneaky Assassins",
|
||||||
ChatColor.RESET + "Sneaky Assassins",
|
C.Reset + "Micro Battle",
|
||||||
ChatColor.RESET + "Micro Battle",
|
C.Reset + "Super Paintball",
|
||||||
ChatColor.RESET + "Super Paintball",
|
C.Reset + "Turf Wars",
|
||||||
ChatColor.RESET + "Turf Wars",
|
C.Reset + "Death Tag",
|
||||||
ChatColor.RESET + "Death Tag",
|
C.Reset + "Bacon Brawl",
|
||||||
ChatColor.RESET + "Bacon Brawl",
|
C.Reset + "",
|
||||||
ChatColor.RESET + "",
|
C.Reset + "Join " + C.cGreen + playerCount + C.Reset + " other players!",
|
||||||
ChatColor.RESET + "Join " + ChatColor.GREEN + playerCount + ChatColor.RESET + " other players!",
|
}).setHideInfo(true).build());
|
||||||
}));
|
|
||||||
|
_minigameCycle.add(new ItemBuilder(Material.MILK_BUCKET)
|
||||||
_minigameCycle.add(ItemStackFactory.Instance.CreateStack(Material.MILK_BUCKET.getId(), (byte)0, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Arcade " + C.cGray + "Mixed Games", new String []
|
.setTitle(C.Reset + C.Bold + C.cYellow + "Arcade " + C.cGray + "Mixed Games").addLore(new String[]
|
||||||
{
|
{
|
||||||
ChatColor.RESET + "",
|
C.Reset + "",
|
||||||
ChatColor.RESET + "Play all of these fun minigames:",
|
C.Reset + "Play all of these fun minigames:",
|
||||||
ChatColor.RESET + "",
|
C.Reset + "",
|
||||||
ChatColor.RESET + "Super Spleef",
|
C.Reset + "Super Spleef",
|
||||||
ChatColor.RESET + "Runner",
|
C.Reset + "Runner",
|
||||||
ChatColor.RESET + "Dragons",
|
C.Reset + "Dragons",
|
||||||
ChatColor.RESET + "One in the Quiver",
|
C.Reset + "One in the Quiver",
|
||||||
ChatColor.RESET + "Dragon Escape",
|
C.Reset + "Dragon Escape",
|
||||||
ChatColor.RESET + C.Bold + ChatColor.GREEN + "Sneaky Assassins",
|
C.Reset + C.Bold + C.cGreen + "Sneaky Assassins",
|
||||||
ChatColor.RESET + "Micro Battle",
|
C.Reset + "Micro Battle",
|
||||||
ChatColor.RESET + "Super Paintball",
|
C.Reset + "Super Paintball",
|
||||||
ChatColor.RESET + "Turf Wars",
|
C.Reset + "Turf Wars",
|
||||||
ChatColor.RESET + "Death Tag",
|
C.Reset + "Death Tag",
|
||||||
ChatColor.RESET + "Bacon Brawl",
|
C.Reset + "Bacon Brawl",
|
||||||
ChatColor.RESET + "",
|
C.Reset + "",
|
||||||
ChatColor.RESET + "Join " + ChatColor.GREEN + playerCount + ChatColor.RESET + " other players!",
|
C.Reset + "Join " + C.cGreen + playerCount + C.Reset + " other players!",
|
||||||
}));
|
}).setHideInfo(true).build());
|
||||||
|
|
||||||
_minigameCycle.add(ItemStackFactory.Instance.CreateStack(Material.MILK_BUCKET.getId(), (byte)0, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Arcade " + C.cGray + "Mixed Games", new String []
|
_minigameCycle.add(new ItemBuilder(Material.MILK_BUCKET)
|
||||||
{
|
.setTitle(C.Reset + C.Bold + C.cYellow + "Arcade " + C.cGray + "Mixed Games").addLore(new String[]
|
||||||
ChatColor.RESET + "",
|
{
|
||||||
ChatColor.RESET + "Play all of these fun minigames:",
|
C.Reset + "",
|
||||||
ChatColor.RESET + "",
|
C.Reset + "Play all of these fun minigames:",
|
||||||
ChatColor.RESET + "Super Spleef",
|
C.Reset + "",
|
||||||
ChatColor.RESET + "Runner",
|
C.Reset + "Super Spleef",
|
||||||
ChatColor.RESET + "Dragons",
|
C.Reset + "Runner",
|
||||||
ChatColor.RESET + "One in the Quiver",
|
C.Reset + "Dragons",
|
||||||
ChatColor.RESET + "Dragon Escape",
|
C.Reset + "One in the Quiver",
|
||||||
ChatColor.RESET + "Sneaky Assassins",
|
C.Reset + "Dragon Escape",
|
||||||
ChatColor.RESET + C.Bold + ChatColor.GREEN + "Micro Battle",
|
C.Reset + "Sneaky Assassins",
|
||||||
ChatColor.RESET + "Super Paintball",
|
C.Reset + C.Bold + C.cGreen + "Micro Battle",
|
||||||
ChatColor.RESET + "Turf Wars",
|
C.Reset + "Super Paintball",
|
||||||
ChatColor.RESET + "Death Tag",
|
C.Reset + "Turf Wars",
|
||||||
ChatColor.RESET + "Bacon Brawl",
|
C.Reset + "Death Tag",
|
||||||
ChatColor.RESET + "",
|
C.Reset + "Bacon Brawl",
|
||||||
ChatColor.RESET + "Join " + ChatColor.GREEN + playerCount + ChatColor.RESET + " other players!",
|
C.Reset + "",
|
||||||
}));
|
C.Reset + "Join " + C.cGreen + playerCount + C.Reset + " other players!",
|
||||||
|
}).setHideInfo(true).build());
|
||||||
_minigameCycle.add(ItemStackFactory.Instance.CreateStack(Material.DIAMOND_BARDING.getId(), (byte)0, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Arcade " + C.cGray + "Mixed Games", new String []
|
|
||||||
{
|
_minigameCycle.add(new ItemBuilder(Material.DIAMOND_BARDING)
|
||||||
ChatColor.RESET + "",
|
.setTitle(C.Reset + C.Bold + C.cYellow + "Arcade " + C.cGray + "Mixed Games").addLore(new String[]
|
||||||
ChatColor.RESET + "Play all of these fun minigames:",
|
{
|
||||||
ChatColor.RESET + "",
|
C.Reset + "",
|
||||||
ChatColor.RESET + "Super Spleef",
|
C.Reset + "Play all of these fun minigames:",
|
||||||
ChatColor.RESET + "Runner",
|
C.Reset + "",
|
||||||
ChatColor.RESET + "Dragons",
|
C.Reset + "Super Spleef",
|
||||||
ChatColor.RESET + "One in the Quiver",
|
C.Reset + "Runner",
|
||||||
ChatColor.RESET + "Dragon Escape",
|
C.Reset + "Dragons",
|
||||||
ChatColor.RESET + "Sneaky Assassins",
|
C.Reset + "One in the Quiver",
|
||||||
ChatColor.RESET + "Micro Battle",
|
C.Reset + "Dragon Escape",
|
||||||
ChatColor.RESET + C.Bold + ChatColor.GREEN + "Super Paintball",
|
C.Reset + "Sneaky Assassins",
|
||||||
ChatColor.RESET + "Turf Wars",
|
C.Reset + "Micro Battle",
|
||||||
ChatColor.RESET + "Death Tag",
|
C.Reset + C.Bold + C.cGreen + "Super Paintball",
|
||||||
ChatColor.RESET + "Bacon Brawl",
|
C.Reset + "Turf Wars",
|
||||||
ChatColor.RESET + "",
|
C.Reset + "Death Tag",
|
||||||
ChatColor.RESET + "Join " + ChatColor.GREEN + playerCount + ChatColor.RESET + " other players!",
|
C.Reset + "Bacon Brawl",
|
||||||
}));
|
C.Reset + "",
|
||||||
|
C.Reset + "Join " + C.cGreen + playerCount + C.Reset + " other players!",
|
||||||
_minigameCycle.add(ItemStackFactory.Instance.CreateStack(159, (byte)14, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Arcade " + C.cGray + "Mixed Games", new String []
|
}).setHideInfo(true).build());
|
||||||
{
|
|
||||||
ChatColor.RESET + "",
|
_minigameCycle.add(new ItemBuilder(Material.STAINED_CLAY, 1, (byte) 14)
|
||||||
ChatColor.RESET + "Play all of these fun minigames:",
|
.setTitle(C.Reset + C.Bold + C.cYellow + "Arcade " + C.cGray + "Mixed Games").addLore(new String[]
|
||||||
ChatColor.RESET + "",
|
{
|
||||||
ChatColor.RESET + "Super Spleef",
|
C.Reset + "",
|
||||||
ChatColor.RESET + "Runner",
|
C.Reset + "Play all of these fun minigames:",
|
||||||
ChatColor.RESET + "Dragons",
|
C.Reset + "",
|
||||||
ChatColor.RESET + "One in the Quiver",
|
C.Reset + "Super Spleef",
|
||||||
ChatColor.RESET + "Dragon Escape",
|
C.Reset + "Runner",
|
||||||
ChatColor.RESET + "Sneaky Assassins",
|
C.Reset + "Dragons",
|
||||||
ChatColor.RESET + "Micro Battle",
|
C.Reset + "One in the Quiver",
|
||||||
ChatColor.RESET + "Super Paintball",
|
C.Reset + "Dragon Escape",
|
||||||
ChatColor.RESET + C.Bold + ChatColor.GREEN + "Turf Wars",
|
C.Reset + "Sneaky Assassins",
|
||||||
ChatColor.RESET + "Death Tag",
|
C.Reset + "Micro Battle",
|
||||||
ChatColor.RESET + "Bacon Brawl",
|
C.Reset + "Super Paintball",
|
||||||
ChatColor.RESET + "",
|
C.Reset + C.Bold + C.cGreen + "Turf Wars",
|
||||||
ChatColor.RESET + "Join " + ChatColor.GREEN + playerCount + ChatColor.RESET + " other players!",
|
C.Reset + "Death Tag",
|
||||||
}));
|
C.Reset + "Bacon Brawl",
|
||||||
|
C.Reset + "",
|
||||||
_minigameCycle.add(ItemStackFactory.Instance.CreateStack(309, (byte)0, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Arcade " + C.cGray + "Mixed Games", new String []
|
C.Reset + "Join " + C.cGreen + playerCount + C.Reset + " other players!",
|
||||||
{
|
}).setHideInfo(true).build());
|
||||||
ChatColor.RESET + "",
|
|
||||||
ChatColor.RESET + "Play all of these fun minigames:",
|
_minigameCycle.add(new ItemBuilder(Material.IRON_BOOTS)
|
||||||
ChatColor.RESET + "",
|
.setTitle(C.Reset + C.Bold + C.cYellow + "Arcade " + C.cGray + "Mixed Games").addLore(new String[]
|
||||||
ChatColor.RESET + "Super Spleef",
|
{
|
||||||
ChatColor.RESET + "Runner",
|
C.Reset + "",
|
||||||
ChatColor.RESET + "Dragons",
|
C.Reset + "Play all of these fun minigames:",
|
||||||
ChatColor.RESET + "One in the Quiver",
|
C.Reset + "",
|
||||||
ChatColor.RESET + "Dragon Escape",
|
C.Reset + "Super Spleef",
|
||||||
ChatColor.RESET + "Sneaky Assassins",
|
C.Reset + "Runner",
|
||||||
ChatColor.RESET + "Micro Battle",
|
C.Reset + "Dragons",
|
||||||
ChatColor.RESET + "Super Paintball",
|
C.Reset + "One in the Quiver",
|
||||||
ChatColor.RESET + "Turf Wars",
|
C.Reset + "Dragon Escape",
|
||||||
ChatColor.RESET + C.Bold + ChatColor.GREEN + "Death Tag",
|
C.Reset + "Sneaky Assassins",
|
||||||
ChatColor.RESET + "Bacon Brawl",
|
C.Reset + "Micro Battle",
|
||||||
ChatColor.RESET + "",
|
C.Reset + "Super Paintball",
|
||||||
ChatColor.RESET + "Join " + ChatColor.GREEN + playerCount + ChatColor.RESET + " other players!",
|
C.Reset + "Turf Wars",
|
||||||
}));
|
C.Reset + C.Bold + C.cGreen + "Death Tag",
|
||||||
|
C.Reset + "Bacon Brawl",
|
||||||
_minigameCycle.add(ItemStackFactory.Instance.CreateStack(319, (byte)0, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Arcade " + C.cGray + "Mixed Games", new String []
|
C.Reset + "",
|
||||||
{
|
C.Reset + "Join " + C.cGreen + playerCount + C.Reset + " other players!",
|
||||||
ChatColor.RESET + "",
|
}).setHideInfo(true).build());
|
||||||
ChatColor.RESET + "Play all of these fun minigames:",
|
|
||||||
ChatColor.RESET + "",
|
_minigameCycle.add(new ItemBuilder(Material.PORK)
|
||||||
ChatColor.RESET + "Super Spleef",
|
.setTitle(C.Reset + C.Bold + C.cYellow + "Arcade " + C.cGray + "Mixed Games").addLore(new String[]
|
||||||
ChatColor.RESET + "Runner",
|
{
|
||||||
ChatColor.RESET + "Dragons",
|
C.Reset + "",
|
||||||
ChatColor.RESET + "One in the Quiver",
|
C.Reset + "Play all of these fun minigames:",
|
||||||
ChatColor.RESET + "Dragon Escape",
|
C.Reset + "",
|
||||||
ChatColor.RESET + "Sneaky Assassins",
|
C.Reset + "Super Spleef",
|
||||||
ChatColor.RESET + "Micro Battle",
|
C.Reset + "Runner",
|
||||||
ChatColor.RESET + "Super Paintball",
|
C.Reset + "Dragons",
|
||||||
ChatColor.RESET + "Turf Wars",
|
C.Reset + "One in the Quiver",
|
||||||
ChatColor.RESET + "Death Tag",
|
C.Reset + "Dragon Escape",
|
||||||
ChatColor.RESET + C.Bold + ChatColor.GREEN + "Bacon Brawl",
|
C.Reset + "Sneaky Assassins",
|
||||||
ChatColor.RESET + "",
|
C.Reset + "Micro Battle",
|
||||||
ChatColor.RESET + "Join " + ChatColor.GREEN + playerCount + ChatColor.RESET + " other players!",
|
C.Reset + "Super Paintball",
|
||||||
}));
|
C.Reset + "Turf Wars",
|
||||||
|
C.Reset + "Death Tag",
|
||||||
|
C.Reset + C.Bold + C.cGreen + "Bacon Brawl",
|
||||||
|
C.Reset + "",
|
||||||
|
C.Reset + "Join " + C.cGreen + playerCount + C.Reset + " other players!",
|
||||||
|
}).setHideInfo(true).build());
|
||||||
}
|
}
|
||||||
|
|
||||||
private void createSuperSmashCycle()
|
private void createSuperSmashCycle()
|
||||||
{
|
{
|
||||||
String[] desc = new String[]
|
String[] desc = new String[]
|
||||||
{
|
{
|
||||||
ChatColor.RESET + "",
|
C.Reset + "",
|
||||||
ChatColor.RESET + "Pick from a selection of monsters,",
|
C.Reset + "Pick from a selection of monsters,",
|
||||||
ChatColor.RESET + "then battle other players to the ",
|
C.Reset + "then battle other players to the ",
|
||||||
ChatColor.RESET + "death with your monsters skills!",
|
C.Reset + "death with your monsters skills!",
|
||||||
ChatColor.RESET + "",
|
C.Reset + "",
|
||||||
ChatColor.RESET + "Join " + ChatColor.GREEN + (getPlugin().getGroupTagPlayerCount("SSM") + getPlugin().getGroupTagPlayerCount("SSM2")) + ChatColor.RESET + " other players!",
|
C.Reset + "Join " + C.cGreen
|
||||||
};
|
+ (getPlugin().getGroupTagPlayerCount("SSM") + getPlugin().getGroupTagPlayerCount("SSM2")) + C.Reset
|
||||||
|
+ " other players!",
|
||||||
_superSmashCycle.add(ItemStackFactory.Instance.CreateStack(397, (byte)4, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Super Smash Mobs " + C.cGray + "Solo/Team Deathmatch", desc));
|
};
|
||||||
|
|
||||||
|
_superSmashCycle.add(new ItemBuilder(Material.SKULL_ITEM, 1, (byte) 4)
|
||||||
|
.setTitle(C.Reset + C.Bold + C.cYellow + "Super Smash Mobs " + C.cGray + "Solo/Team Deathmatch").addLore(desc)
|
||||||
|
.setHideInfo(true).build());
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Update()
|
public void Update()
|
||||||
{
|
{
|
||||||
_ssmIndex++;
|
_ssmIndex++;
|
||||||
_minigameIndex++;
|
_minigameIndex++;
|
||||||
|
|
||||||
if (_ssmIndex >= _superSmashCycle.size())
|
if (_ssmIndex >= _superSmashCycle.size())
|
||||||
_ssmIndex = 0;
|
_ssmIndex = 0;
|
||||||
|
|
||||||
if (_minigameIndex >= _minigameCycle.size())
|
if (_minigameIndex >= _minigameCycle.size())
|
||||||
_minigameIndex = 0;
|
_minigameIndex = 0;
|
||||||
|
|
||||||
buildPage();
|
buildPage();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -491,12 +569,12 @@ public class ServerGameMenu extends ShopPageBase<ServerManager, QuickShop>
|
|||||||
{
|
{
|
||||||
getPlugin().getCastleSiegeShop().attemptShopOpen(player);
|
getPlugin().getCastleSiegeShop().attemptShopOpen(player);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void OpenBR(Player player)
|
public void OpenBR(Player player)
|
||||||
{
|
{
|
||||||
getPlugin().getBridgesShop().attemptShopOpen(player);
|
getPlugin().getBridgesShop().attemptShopOpen(player);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void OpenBH(Player player)
|
public void OpenBH(Player player)
|
||||||
{
|
{
|
||||||
getPlugin().getBlockHuntShop().attemptShopOpen(player);
|
getPlugin().getBlockHuntShop().attemptShopOpen(player);
|
||||||
|
@ -15,7 +15,9 @@ import org.bukkit.inventory.meta.SkullMeta;
|
|||||||
import mineplex.core.account.CoreClientManager;
|
import mineplex.core.account.CoreClientManager;
|
||||||
import mineplex.core.common.Rank;
|
import mineplex.core.common.Rank;
|
||||||
import mineplex.core.common.util.C;
|
import mineplex.core.common.util.C;
|
||||||
|
import mineplex.core.common.util.F;
|
||||||
import mineplex.core.common.util.UtilMath;
|
import mineplex.core.common.util.UtilMath;
|
||||||
|
import mineplex.core.common.util.UtilPlayer;
|
||||||
import mineplex.core.common.util.UtilTime;
|
import mineplex.core.common.util.UtilTime;
|
||||||
import mineplex.core.donation.DonationManager;
|
import mineplex.core.donation.DonationManager;
|
||||||
import mineplex.core.game.GameDisplay;
|
import mineplex.core.game.GameDisplay;
|
||||||
@ -78,17 +80,8 @@ public class ServerNpcPage extends ShopPageInventory<ServerManager, ServerNpcSho
|
|||||||
exception.printStackTrace();
|
exception.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (_onMainPage)
|
if (_onMainPage)
|
||||||
{
|
{
|
||||||
addButton(4, ItemStackFactory.Instance.CreateStack(Material.DIAMOND_BLOCK, (byte) 0, 1, C.cGreen + "Click to join instantly!"), new IButton() {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onClick(Player player, ClickType clickType) {
|
|
||||||
getPlugin().selectServer(player, _serverGroupName);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
buildAvailableServerPage(serverList, slotsNeeded);
|
buildAvailableServerPage(serverList, slotsNeeded);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -108,7 +101,7 @@ public class ServerNpcPage extends ShopPageInventory<ServerManager, ServerNpcSho
|
|||||||
ChatColor.RESET + timeLeft + " Remaining...",
|
ChatColor.RESET + timeLeft + " Remaining...",
|
||||||
ChatColor.RESET + "",
|
ChatColor.RESET + "",
|
||||||
ChatColor.RESET + C.cGreen + "Do you love playing on Mineplex?",
|
ChatColor.RESET + C.cGreen + "Do you love playing on Mineplex?",
|
||||||
ChatColor.RESET + "If you do, please consider purchasing Ultra or Hero",
|
ChatColor.RESET + "If you do, please consider purchasing a premium rank",
|
||||||
ChatColor.RESET + "from the store! Money goes towards running servers",
|
ChatColor.RESET + "from the store! Money goes towards running servers",
|
||||||
ChatColor.RESET + "and creating exciting new games for everyone!",
|
ChatColor.RESET + "and creating exciting new games for everyone!",
|
||||||
ChatColor.RESET + "",
|
ChatColor.RESET + "",
|
||||||
@ -297,15 +290,25 @@ public class ServerNpcPage extends ShopPageInventory<ServerManager, ServerNpcSho
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
addButton(40, new ShopItem(Material.GOLD_BLOCK, C.cAqua + yellowCount + " Game" + (yellowCount == 1 ? "" : "s") + " In Progress", new String[]{MESSAGE_SPECTATE}, yellowCount > 64 ? 64 : yellowCount, false), new IButton()
|
if(showGreen) {
|
||||||
{
|
addButton(40, new ShopItem(Material.GOLD_BLOCK, C.cAqua + yellowCount + " Game" + (yellowCount == 1 ? "" : "s") + " In Progress", new String[]{MESSAGE_SPECTATE}, yellowCount > 64 ? 64 : yellowCount, false), new IButton()
|
||||||
@Override
|
|
||||||
public void onClick(Player player, ClickType clickType)
|
|
||||||
{
|
{
|
||||||
_onMainPage = false;
|
@Override
|
||||||
}
|
public void onClick(Player player, ClickType clickType)
|
||||||
});
|
{
|
||||||
|
_onMainPage = false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
addButton(4, ItemStackFactory.Instance.CreateStack(Material.DIAMOND_BLOCK, (byte) 0, 1, C.cGreen + "Click to join instantly!"), new IButton() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onClick(Player player, ClickType clickType) {
|
||||||
|
getPlugin().selectServer(player, _serverGroupName);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
// Clear empty slots
|
// Clear empty slots
|
||||||
if (showGreen)
|
if (showGreen)
|
||||||
{
|
{
|
||||||
|
@ -18,6 +18,7 @@ import mineplex.core.common.util.C;
|
|||||||
import mineplex.core.common.util.UtilTime;
|
import mineplex.core.common.util.UtilTime;
|
||||||
import mineplex.core.donation.DonationManager;
|
import mineplex.core.donation.DonationManager;
|
||||||
import mineplex.core.game.GameDisplay;
|
import mineplex.core.game.GameDisplay;
|
||||||
|
import mineplex.core.itemstack.ItemBuilder;
|
||||||
import mineplex.core.itemstack.ItemStackFactory;
|
import mineplex.core.itemstack.ItemStackFactory;
|
||||||
import mineplex.core.shop.item.IButton;
|
import mineplex.core.shop.item.IButton;
|
||||||
import mineplex.core.shop.item.ShopItem;
|
import mineplex.core.shop.item.ShopItem;
|
||||||
@ -35,11 +36,11 @@ public class ServerTypePage extends ShopPageBase<ServerManager, ServerNpcShop>
|
|||||||
|
|
||||||
private ServerGroup _serverGroup;
|
private ServerGroup _serverGroup;
|
||||||
|
|
||||||
public ServerTypePage(ServerManager plugin, ServerNpcShop shop, CoreClientManager clientManager, DonationManager donationManager,
|
public ServerTypePage(ServerManager plugin, ServerNpcShop shop, CoreClientManager clientManager,
|
||||||
Player player, ServerGroup serverGroup)
|
DonationManager donationManager, Player player, ServerGroup serverGroup)
|
||||||
{
|
{
|
||||||
super(plugin, shop, clientManager, donationManager, serverGroup.getServerNpcName(), player, 27);
|
super(plugin, shop, clientManager, donationManager, serverGroup.getServerNpcName(), player, 27);
|
||||||
|
|
||||||
_serverGroup = serverGroup;
|
_serverGroup = serverGroup;
|
||||||
|
|
||||||
buildPage();
|
buildPage();
|
||||||
@ -49,23 +50,25 @@ public class ServerTypePage extends ShopPageBase<ServerManager, ServerNpcShop>
|
|||||||
protected void buildPage()
|
protected void buildPage()
|
||||||
{
|
{
|
||||||
String friendlyName = _serverGroup.getServerNpcName();
|
String friendlyName = _serverGroup.getServerNpcName();
|
||||||
|
|
||||||
setItem(12, ItemStackFactory.Instance.CreateStack(Material.SKULL_ITEM.getId(), (byte)3, 1, ChatColor.RESET + C.cYellow + "Solo " + friendlyName, new String[]
|
setItem(12, new ItemBuilder(Material.SKULL_ITEM, 1, (byte) 3).setTitle(C.Reset + C.cYellow + "Solo " + friendlyName)
|
||||||
{
|
.addLore(new String[]
|
||||||
ChatColor.RESET + "",
|
{
|
||||||
ChatColor.RESET + C.cRed + C.Bold + "WARNING: " + ChatColor.RESET + "Teaming in Solo Mode is bannable!",
|
C.Reset + "",
|
||||||
ChatColor.RESET + "",
|
C.Reset + C.cRed + C.Bold + "WARNING: " + C.Reset + "Teaming in Solo Mode is bannable!",
|
||||||
ChatColor.RESET + C.cGreen + "Click to Play",
|
C.Reset + "",
|
||||||
}));
|
C.Reset + C.cGreen + "Click to Play",
|
||||||
|
}).build());
|
||||||
setItem(14, ItemStackFactory.Instance.CreateStack(Material.SKULL_ITEM.getId(), (byte)3, 2, ChatColor.RESET + C.cYellow + "Team " + friendlyName, new String[]
|
|
||||||
{
|
setItem(14, new ItemBuilder(Material.SKULL_ITEM, 2, (byte) 3).setTitle(C.Reset + C.cYellow + "Team " + friendlyName)
|
||||||
ChatColor.RESET + "",
|
.addLore(new String[]
|
||||||
ChatColor.RESET + C.cGray + "2 Player Teams",
|
{
|
||||||
ChatColor.RESET + "",
|
C.Reset + "",
|
||||||
ChatColor.RESET + C.cGreen + "Click to Play"
|
C.Reset + C.cGray + "2 Player Teams",
|
||||||
}));
|
C.Reset + "",
|
||||||
|
C.Reset + C.cGreen + "Click to Play"
|
||||||
|
}).build());
|
||||||
|
|
||||||
getButtonMap().put(12, new SelectTypeButton(this, false));
|
getButtonMap().put(12, new SelectTypeButton(this, false));
|
||||||
getButtonMap().put(14, new SelectTypeButton(this, true));
|
getButtonMap().put(14, new SelectTypeButton(this, true));
|
||||||
}
|
}
|
||||||
@ -77,14 +80,16 @@ public class ServerTypePage extends ShopPageBase<ServerManager, ServerNpcShop>
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void selectServer(Player player, boolean team)
|
public void selectServer(Player player, boolean team)
|
||||||
{
|
{
|
||||||
if (team)
|
if (team)
|
||||||
{
|
{
|
||||||
getShop().openPageForPlayer(player, new ServerNpcPage(getPlugin(), getShop(), getClientManager(), getDonationManager(), _serverGroup.getServerNpcName() + " Teams", player, _serverGroup.getTeamServerKey()));
|
getShop().openPageForPlayer(player, new ServerNpcPage(getPlugin(), getShop(), getClientManager(),
|
||||||
|
getDonationManager(), _serverGroup.getServerNpcName() + " Teams", player, _serverGroup.getTeamServerKey()));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
getShop().openPageForPlayer(player, new ServerNpcPage(getPlugin(), getShop(), getClientManager(), getDonationManager(), _serverGroup.getServerNpcName() + " Solo", player, _serverGroup.getPrefix()));
|
getShop().openPageForPlayer(player, new ServerNpcPage(getPlugin(), getShop(), getClientManager(),
|
||||||
|
getDonationManager(), _serverGroup.getServerNpcName() + " Solo", player, _serverGroup.getPrefix()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,11 +0,0 @@
|
|||||||
eclipse.preferences.version=1
|
|
||||||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
|
||||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
|
|
||||||
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
|
|
||||||
org.eclipse.jdt.core.compiler.compliance=1.7
|
|
||||||
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
|
|
||||||
org.eclipse.jdt.core.compiler.debug.localVariable=generate
|
|
||||||
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
|
|
||||||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
|
||||||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
|
||||||
org.eclipse.jdt.core.compiler.source=1.7
|
|
@ -1,11 +0,0 @@
|
|||||||
eclipse.preferences.version=1
|
|
||||||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
|
||||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
|
|
||||||
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
|
|
||||||
org.eclipse.jdt.core.compiler.compliance=1.7
|
|
||||||
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
|
|
||||||
org.eclipse.jdt.core.compiler.debug.localVariable=generate
|
|
||||||
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
|
|
||||||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
|
||||||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
|
||||||
org.eclipse.jdt.core.compiler.source=1.7
|
|
@ -134,9 +134,30 @@ public class Flash extends SkillActive
|
|||||||
while (curRange <= maxRange)
|
while (curRange <= maxRange)
|
||||||
{
|
{
|
||||||
Location newTarget = player.getLocation().add(new Vector(0,0.2,0)).add(player.getLocation().getDirection().multiply(curRange));
|
Location newTarget = player.getLocation().add(new Vector(0,0.2,0)).add(player.getLocation().getDirection().multiply(curRange));
|
||||||
|
Location aboveTarget = newTarget.getBlock().getRelative(BlockFace.UP).getLocation();
|
||||||
if (!UtilBlock.airFoliage(newTarget.getBlock()) ||
|
|
||||||
!UtilBlock.airFoliage(newTarget.getBlock().getRelative(BlockFace.UP)))
|
// half-slab
|
||||||
|
boolean newTargetIsSlab = newTarget.getBlock().getType() == Material.STEP || newTarget.getBlock().getType() == Material.WOOD_STEP;
|
||||||
|
boolean aboveTargetIsSlab = aboveTarget.getBlock().getType() == Material.STEP || aboveTarget.getBlock().getType() == Material.WOOD_STEP;
|
||||||
|
|
||||||
|
boolean newTargetSlabIsBottom = false;
|
||||||
|
boolean aboveTargetSlabIsBottom = false;
|
||||||
|
|
||||||
|
if(newTargetIsSlab && curRange < 0.5)
|
||||||
|
{
|
||||||
|
int newTargetData = (int) newTarget.getBlock().getData();
|
||||||
|
|
||||||
|
if(newTargetData <= 7) newTargetSlabIsBottom = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(aboveTargetIsSlab && curRange < 0.25)
|
||||||
|
{
|
||||||
|
int aboveTargetData = (int) aboveTarget.getBlock().getData();
|
||||||
|
|
||||||
|
if(aboveTargetData <= 7) aboveTargetSlabIsBottom = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((!newTargetSlabIsBottom && UtilBlock.fullSolid(newTarget.getBlock())) || (!aboveTargetSlabIsBottom && UtilBlock.fullSolid(aboveTarget.getBlock())))
|
||||||
break;
|
break;
|
||||||
|
|
||||||
//Progress Forwards
|
//Progress Forwards
|
||||||
|
@ -84,6 +84,9 @@ public class ShieldSmash extends SkillActive
|
|||||||
|
|
||||||
if (cur.equals(player))
|
if (cur.equals(player))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
if (UtilPlayer.isSpectator(cur))
|
||||||
|
continue;
|
||||||
|
|
||||||
if (UtilMath.offset(loc, cur.getLocation()) > 2.5)
|
if (UtilMath.offset(loc, cur.getLocation()) > 2.5)
|
||||||
continue;
|
continue;
|
||||||
|
@ -94,13 +94,16 @@ public class FissureData
|
|||||||
_loc.getWorld().playEffect(block.getLocation(), Effect.STEP_SOUND, block.getTypeId());
|
_loc.getWorld().playEffect(block.getLocation(), Effect.STEP_SOUND, block.getTypeId());
|
||||||
|
|
||||||
//Slow
|
//Slow
|
||||||
for (Player cur : block.getWorld().getPlayers())
|
for (Player cur : block.getWorld().getPlayers()) {
|
||||||
|
if(UtilPlayer.isSpectator(cur)) continue;
|
||||||
|
|
||||||
if (!cur.equals(_player))
|
if (!cur.equals(_player))
|
||||||
if (UtilMath.offset(block.getLocation().add(0.5, 0.5, 0.5), cur.getLocation()) < 1.5)
|
if (UtilMath.offset(block.getLocation().add(0.5, 0.5, 0.5), cur.getLocation()) < 1.5)
|
||||||
{
|
{
|
||||||
//Condition
|
//Condition
|
||||||
Host.Factory.Condition().Factory().Slow("Fissure", cur, _player, 1 + _level, 1, false, true, true, true);
|
Host.Factory.Condition().Factory().Slow("Fissure", cur, _player, 1 + _level, 1, false, true, true, true);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -146,7 +149,10 @@ public class FissureData
|
|||||||
up.getWorld().playEffect(up.getLocation(), Effect.STEP_SOUND, block.getTypeId());
|
up.getWorld().playEffect(up.getLocation(), Effect.STEP_SOUND, block.getTypeId());
|
||||||
|
|
||||||
//Damage
|
//Damage
|
||||||
for (Player cur : up.getWorld().getPlayers())
|
for (Player cur : up.getWorld().getPlayers()) {
|
||||||
|
if (UtilPlayer.isSpectator(cur))
|
||||||
|
continue;
|
||||||
|
|
||||||
if (!cur.equals(_player))
|
if (!cur.equals(_player))
|
||||||
{
|
{
|
||||||
//Teleport
|
//Teleport
|
||||||
@ -172,7 +178,7 @@ public class FissureData
|
|||||||
UtilPlayer.message(cur, F.main(Host.GetClassType().name(), F.name(_player.getName()) +" hit you with " + F.skill(Host.GetName(_level)) + "."));
|
UtilPlayer.message(cur, F.main(Host.GetClassType().name(), F.name(_player.getName()) +" hit you with " + F.skill(Host.GetName(_level)) + "."));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
//Next Column
|
//Next Column
|
||||||
if (_height >= Math.min(3, _handled/2 + 1))
|
if (_height >= Math.min(3, _handled/2 + 1))
|
||||||
{
|
{
|
||||||
|
@ -1,11 +0,0 @@
|
|||||||
eclipse.preferences.version=1
|
|
||||||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
|
||||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
|
|
||||||
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
|
|
||||||
org.eclipse.jdt.core.compiler.compliance=1.7
|
|
||||||
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
|
|
||||||
org.eclipse.jdt.core.compiler.debug.localVariable=generate
|
|
||||||
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
|
|
||||||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
|
||||||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
|
||||||
org.eclipse.jdt.core.compiler.source=1.7
|
|
@ -1,11 +0,0 @@
|
|||||||
eclipse.preferences.version=1
|
|
||||||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
|
||||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
|
|
||||||
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
|
|
||||||
org.eclipse.jdt.core.compiler.compliance=1.7
|
|
||||||
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
|
|
||||||
org.eclipse.jdt.core.compiler.debug.localVariable=generate
|
|
||||||
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
|
|
||||||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
|
||||||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
|
||||||
org.eclipse.jdt.core.compiler.source=1.7
|
|
@ -1,12 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<module type="JAVA_MODULE" version="4">
|
|
||||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
|
||||||
<exclude-output />
|
|
||||||
<content url="file://$MODULE_DIR$">
|
|
||||||
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
|
||||||
</content>
|
|
||||||
<orderEntry type="inheritedJdk" />
|
|
||||||
<orderEntry type="sourceFolder" forTests="false" />
|
|
||||||
<orderEntry type="module" module-name="Mineplex.ServerData" />
|
|
||||||
</component>
|
|
||||||
</module>
|
|
@ -1,15 +0,0 @@
|
|||||||
eclipse.preferences.version=1
|
|
||||||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
|
||||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
|
|
||||||
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
|
|
||||||
org.eclipse.jdt.core.compiler.compliance=1.8
|
|
||||||
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
|
|
||||||
org.eclipse.jdt.core.compiler.debug.localVariable=generate
|
|
||||||
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
|
|
||||||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
|
||||||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
|
||||||
org.eclipse.jdt.core.compiler.source=1.8
|
|
||||||
org.eclipse.jdt.core.formatter.brace_position_for_lambda_body=next_line
|
|
||||||
org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation=do not insert
|
|
||||||
org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow=insert
|
|
||||||
org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow=insert
|
|
@ -921,6 +921,9 @@ public class ArcadeManager extends MiniPlugin implements IRelation
|
|||||||
|
|
||||||
((CraftEntity) player).getHandle().getDataWatcher().watch(0, Byte.valueOf((byte) 0));
|
((CraftEntity) player).getHandle().getDataWatcher().watch(0, Byte.valueOf((byte) 0));
|
||||||
|
|
||||||
|
player.setCustomName("");
|
||||||
|
player.setCustomNameVisible(false);
|
||||||
|
|
||||||
player.setSprinting(false);
|
player.setSprinting(false);
|
||||||
player.setSneaking(false);
|
player.setSneaking(false);
|
||||||
|
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
package nautilus.game.arcade.game;
|
package nautilus.game.arcade.game;
|
||||||
|
|
||||||
import java.lang.reflect.Field;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
@ -36,7 +35,6 @@ import org.bukkit.event.entity.FoodLevelChangeEvent;
|
|||||||
import org.bukkit.event.entity.ItemSpawnEvent;
|
import org.bukkit.event.entity.ItemSpawnEvent;
|
||||||
import org.bukkit.event.hanging.HangingBreakEvent;
|
import org.bukkit.event.hanging.HangingBreakEvent;
|
||||||
import org.bukkit.event.hanging.HangingPlaceEvent;
|
import org.bukkit.event.hanging.HangingPlaceEvent;
|
||||||
import org.bukkit.event.player.PlayerJoinEvent;
|
|
||||||
import org.bukkit.event.player.PlayerLoginEvent;
|
import org.bukkit.event.player.PlayerLoginEvent;
|
||||||
import org.bukkit.event.player.PlayerQuitEvent;
|
import org.bukkit.event.player.PlayerQuitEvent;
|
||||||
import org.bukkit.event.world.WorldLoadEvent;
|
import org.bukkit.event.world.WorldLoadEvent;
|
||||||
@ -54,8 +52,8 @@ import mineplex.core.common.util.UtilBlock;
|
|||||||
import mineplex.core.common.util.UtilPlayer;
|
import mineplex.core.common.util.UtilPlayer;
|
||||||
import mineplex.core.common.util.UtilServer;
|
import mineplex.core.common.util.UtilServer;
|
||||||
import mineplex.core.common.util.UtilTabTitle;
|
import mineplex.core.common.util.UtilTabTitle;
|
||||||
import mineplex.core.common.util.UtilTime;
|
|
||||||
import mineplex.core.common.util.UtilTextMiddle;
|
import mineplex.core.common.util.UtilTextMiddle;
|
||||||
|
import mineplex.core.common.util.UtilTime;
|
||||||
import mineplex.core.disguise.disguises.DisguisePlayer;
|
import mineplex.core.disguise.disguises.DisguisePlayer;
|
||||||
import mineplex.core.itemstack.ItemBuilder;
|
import mineplex.core.itemstack.ItemBuilder;
|
||||||
import mineplex.core.packethandler.IPacketHandler;
|
import mineplex.core.packethandler.IPacketHandler;
|
||||||
@ -72,18 +70,24 @@ import nautilus.game.arcade.events.GameStateChangeEvent;
|
|||||||
import nautilus.game.arcade.events.PlayerGameRespawnEvent;
|
import nautilus.game.arcade.events.PlayerGameRespawnEvent;
|
||||||
import nautilus.game.arcade.events.PlayerStateChangeEvent;
|
import nautilus.game.arcade.events.PlayerStateChangeEvent;
|
||||||
import nautilus.game.arcade.game.GameTeam.PlayerState;
|
import nautilus.game.arcade.game.GameTeam.PlayerState;
|
||||||
import nautilus.game.arcade.gametutorial.GameTutorial;
|
|
||||||
import nautilus.game.arcade.kit.Kit;
|
import nautilus.game.arcade.kit.Kit;
|
||||||
import nautilus.game.arcade.kit.KitAvailability;
|
import nautilus.game.arcade.kit.KitAvailability;
|
||||||
import nautilus.game.arcade.kit.Perk;
|
import nautilus.game.arcade.kit.Perk;
|
||||||
import nautilus.game.arcade.managers.GameLobbyManager;
|
import nautilus.game.arcade.managers.GameLobbyManager;
|
||||||
import nautilus.game.arcade.scoreboard.GameScoreboard;
|
import nautilus.game.arcade.scoreboard.GameScoreboard;
|
||||||
import nautilus.game.arcade.stats.*;
|
import nautilus.game.arcade.stats.AssistsStatTracker;
|
||||||
|
import nautilus.game.arcade.stats.DamageDealtStatTracker;
|
||||||
|
import nautilus.game.arcade.stats.DamageTakenStatTracker;
|
||||||
|
import nautilus.game.arcade.stats.DeathsStatTracker;
|
||||||
|
import nautilus.game.arcade.stats.ExperienceStatTracker;
|
||||||
|
import nautilus.game.arcade.stats.GamesPlayedStatTracker;
|
||||||
|
import nautilus.game.arcade.stats.KillsStatTracker;
|
||||||
|
import nautilus.game.arcade.stats.LoseStatTracker;
|
||||||
|
import nautilus.game.arcade.stats.StatTracker;
|
||||||
|
import nautilus.game.arcade.stats.WinStatTracker;
|
||||||
import nautilus.game.arcade.world.WorldData;
|
import nautilus.game.arcade.world.WorldData;
|
||||||
import net.minecraft.server.v1_8_R3.EntityItem;
|
import net.minecraft.server.v1_8_R3.EntityItem;
|
||||||
import net.minecraft.server.v1_8_R3.PacketPlayInUseEntity;
|
import net.minecraft.server.v1_8_R3.PacketPlayInUseEntity;
|
||||||
import net.minecraft.server.v1_8_R3.PacketPlayOutScoreboardTeam;
|
|
||||||
import net.minecraft.server.v1_8_R3.ScoreboardTeam;
|
|
||||||
import net.minecraft.server.v1_8_R3.WorldServer;
|
import net.minecraft.server.v1_8_R3.WorldServer;
|
||||||
|
|
||||||
public abstract class Game implements Listener
|
public abstract class Game implements Listener
|
||||||
@ -124,6 +128,7 @@ public abstract class Game implements Listener
|
|||||||
private boolean _countdownForce = false;
|
private boolean _countdownForce = false;
|
||||||
|
|
||||||
private String _customWinLine = "";
|
private String _customWinLine = "";
|
||||||
|
private NautHashMap<Player, String> _customWinMessages = new NautHashMap<Player, String>();
|
||||||
|
|
||||||
// Kits
|
// Kits
|
||||||
private Kit[] _kits;
|
private Kit[] _kits;
|
||||||
@ -492,6 +497,11 @@ public abstract class Game implements Listener
|
|||||||
{
|
{
|
||||||
_customWinLine = line;
|
_customWinLine = line;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void SetCustomWinMessage(Player player, String message)
|
||||||
|
{
|
||||||
|
_customWinMessages.put(player, message);
|
||||||
|
}
|
||||||
|
|
||||||
public GameScoreboard GetScoreboard()
|
public GameScoreboard GetScoreboard()
|
||||||
{
|
{
|
||||||
@ -1156,7 +1166,20 @@ public abstract class Game implements Listener
|
|||||||
UtilPlayer.message(player, "Nobody won the game!");
|
UtilPlayer.message(player, "Nobody won the game!");
|
||||||
}
|
}
|
||||||
|
|
||||||
UtilPlayer.message(player, _customWinLine);
|
if (_customWinMessages.containsKey(player))
|
||||||
|
{
|
||||||
|
if (!_customWinLine.trim().equalsIgnoreCase(""))
|
||||||
|
{
|
||||||
|
UtilPlayer.message(player, _customWinLine);
|
||||||
|
}
|
||||||
|
|
||||||
|
UtilPlayer.message(player, _customWinMessages.get(player));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
UtilPlayer.message(player, _customWinLine);
|
||||||
|
}
|
||||||
|
|
||||||
UtilPlayer.message(player, "");
|
UtilPlayer.message(player, "");
|
||||||
UtilPlayer.message(player, "§aMap - §f§l" + WorldData.MapName + C.cGray + " created by " + "§f§l"
|
UtilPlayer.message(player, "§aMap - §f§l" + WorldData.MapName + C.cGray + " created by " + "§f§l"
|
||||||
+ WorldData.MapAuthor);
|
+ WorldData.MapAuthor);
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
package nautilus.game.arcade.game;
|
package nautilus.game.arcade.game;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
@ -13,8 +14,6 @@ import mineplex.core.updater.event.UpdateEvent;
|
|||||||
import nautilus.game.arcade.ArcadeManager;
|
import nautilus.game.arcade.ArcadeManager;
|
||||||
import nautilus.game.arcade.GameType;
|
import nautilus.game.arcade.GameType;
|
||||||
import nautilus.game.arcade.events.GameStateChangeEvent;
|
import nautilus.game.arcade.events.GameStateChangeEvent;
|
||||||
import nautilus.game.arcade.events.PlayerStateChangeEvent;
|
|
||||||
import nautilus.game.arcade.game.GameTeam.PlayerState;
|
|
||||||
import nautilus.game.arcade.kit.Kit;
|
import nautilus.game.arcade.kit.Kit;
|
||||||
|
|
||||||
public abstract class SoloGame extends Game
|
public abstract class SoloGame extends Game
|
||||||
@ -36,6 +35,11 @@ public abstract class SoloGame extends Game
|
|||||||
_players.SetColor(ChatColor.YELLOW);
|
_players.SetColor(ChatColor.YELLOW);
|
||||||
_players.SetName("Players");
|
_players.SetName("Players");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public GameTeam getPlayersTeam()
|
||||||
|
{
|
||||||
|
return _players;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void EndCheck()
|
public void EndCheck()
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
package nautilus.game.arcade.game.games.christmas;
|
package nautilus.game.arcade.game.games.christmas;
|
||||||
|
|
||||||
import java.lang.reflect.Field;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
|
||||||
@ -8,9 +7,8 @@ import org.bukkit.ChatColor;
|
|||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.block.Block;
|
import org.bukkit.block.Block;
|
||||||
import org.bukkit.craftbukkit.v1_8_R3.CraftServer;
|
import org.bukkit.craftbukkit.v1_8_R3.entity.CraftEntity;
|
||||||
import org.bukkit.craftbukkit.v1_8_R3.entity.CraftPlayer;
|
import org.bukkit.craftbukkit.v1_8_R3.entity.CraftHorse;
|
||||||
import org.bukkit.entity.EntityType;
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.entity.Villager;
|
import org.bukkit.entity.Villager;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
@ -18,13 +16,16 @@ import org.bukkit.event.EventPriority;
|
|||||||
import org.bukkit.event.HandlerList;
|
import org.bukkit.event.HandlerList;
|
||||||
import org.bukkit.event.block.BlockFadeEvent;
|
import org.bukkit.event.block.BlockFadeEvent;
|
||||||
import org.bukkit.event.entity.EntityCombustEvent;
|
import org.bukkit.event.entity.EntityCombustEvent;
|
||||||
import org.bukkit.event.entity.ItemSpawnEvent;
|
|
||||||
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
|
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
|
||||||
|
import org.bukkit.event.entity.ItemSpawnEvent;
|
||||||
import org.bukkit.event.entity.ProjectileHitEvent;
|
import org.bukkit.event.entity.ProjectileHitEvent;
|
||||||
import org.bukkit.event.player.PlayerCommandPreprocessEvent;
|
import org.bukkit.event.player.PlayerCommandPreprocessEvent;
|
||||||
|
import org.bukkit.event.player.PlayerInteractAtEntityEvent;
|
||||||
import org.bukkit.util.Vector;
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
import mineplex.core.common.util.C;
|
import mineplex.core.common.util.C;
|
||||||
|
import mineplex.core.common.util.Callback;
|
||||||
|
import mineplex.core.common.util.F;
|
||||||
import mineplex.core.common.util.MapUtil;
|
import mineplex.core.common.util.MapUtil;
|
||||||
import mineplex.core.common.util.UtilBlock;
|
import mineplex.core.common.util.UtilBlock;
|
||||||
import mineplex.core.common.util.UtilMath;
|
import mineplex.core.common.util.UtilMath;
|
||||||
@ -34,7 +35,6 @@ import mineplex.core.common.util.UtilTime;
|
|||||||
import mineplex.core.packethandler.IPacketHandler;
|
import mineplex.core.packethandler.IPacketHandler;
|
||||||
import mineplex.core.packethandler.PacketInfo;
|
import mineplex.core.packethandler.PacketInfo;
|
||||||
import mineplex.core.recharge.Recharge;
|
import mineplex.core.recharge.Recharge;
|
||||||
import mineplex.core.reward.rewards.PetReward;
|
|
||||||
import mineplex.core.updater.UpdateType;
|
import mineplex.core.updater.UpdateType;
|
||||||
import mineplex.core.updater.event.UpdateEvent;
|
import mineplex.core.updater.event.UpdateEvent;
|
||||||
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
|
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
|
||||||
@ -45,14 +45,22 @@ import nautilus.game.arcade.events.GameStateChangeEvent;
|
|||||||
import nautilus.game.arcade.game.GameTeam;
|
import nautilus.game.arcade.game.GameTeam;
|
||||||
import nautilus.game.arcade.game.SoloGame;
|
import nautilus.game.arcade.game.SoloGame;
|
||||||
import nautilus.game.arcade.game.games.christmas.kits.KitPlayer;
|
import nautilus.game.arcade.game.games.christmas.kits.KitPlayer;
|
||||||
import nautilus.game.arcade.game.games.christmas.parts.*;
|
import nautilus.game.arcade.game.games.christmas.parts.Part;
|
||||||
|
import nautilus.game.arcade.game.games.christmas.parts.Part1;
|
||||||
|
import nautilus.game.arcade.game.games.christmas.parts.Part2;
|
||||||
|
import nautilus.game.arcade.game.games.christmas.parts.Part3;
|
||||||
|
import nautilus.game.arcade.game.games.christmas.parts.Part4;
|
||||||
|
import nautilus.game.arcade.game.games.christmas.parts.Part5;
|
||||||
import nautilus.game.arcade.kit.Kit;
|
import nautilus.game.arcade.kit.Kit;
|
||||||
|
import net.minecraft.server.v1_8_R3.PacketPlayOutAttachEntity;
|
||||||
import net.minecraft.server.v1_8_R3.PacketPlayOutEntityDestroy;
|
import net.minecraft.server.v1_8_R3.PacketPlayOutEntityDestroy;
|
||||||
import net.minecraft.server.v1_8_R3.PacketPlayOutNamedSoundEffect;
|
import net.minecraft.server.v1_8_R3.PacketPlayOutNamedSoundEffect;
|
||||||
import net.minecraft.server.v1_8_R3.PacketPlayOutSpawnEntityLiving;
|
import net.minecraft.server.v1_8_R3.PacketPlayOutSpawnEntityLiving;
|
||||||
|
|
||||||
public class Christmas extends SoloGame
|
public class Christmas extends SoloGame
|
||||||
{
|
{
|
||||||
|
private GameTeam _badGuys;
|
||||||
|
|
||||||
private Sleigh _sleigh;
|
private Sleigh _sleigh;
|
||||||
|
|
||||||
private Location _sleighSpawn;
|
private Location _sleighSpawn;
|
||||||
@ -201,7 +209,7 @@ public class Christmas extends SoloGame
|
|||||||
for (Location loc : WorldData.GetCustomLocs("129"))
|
for (Location loc : WorldData.GetCustomLocs("129"))
|
||||||
{
|
{
|
||||||
_barrier.add(loc.getBlock().getLocation());
|
_barrier.add(loc.getBlock().getLocation());
|
||||||
MapUtil.QuickChangeBlockAt(loc, 65, (byte)3);
|
MapUtil.QuickChangeBlockAt(loc, 166, (byte)0);
|
||||||
}
|
}
|
||||||
|
|
||||||
//Parts
|
//Parts
|
||||||
@ -250,7 +258,8 @@ public class Christmas extends SoloGame
|
|||||||
if (event.GetState() != GameState.Live)
|
if (event.GetState() != GameState.Live)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
GetTeamList().add(new GameTeam(this, "Christmas Thieves", ChatColor.RED, WorldData.GetDataLocs("RED")));
|
_badGuys = new GameTeam(this, "Christmas Thieves", ChatColor.RED, WorldData.GetDataLocs("RED"));
|
||||||
|
AddTeam(_badGuys);
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
@ -366,7 +375,7 @@ public class Christmas extends SoloGame
|
|||||||
|
|
||||||
for (Location loc : _barrier)
|
for (Location loc : _barrier)
|
||||||
{
|
{
|
||||||
if (UtilMath.offset(GetSleigh().GetLocation(), loc) > 15)
|
if (UtilMath.offset(GetSleigh().GetLocation(), loc) > 20)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
breakAt = loc;
|
breakAt = loc;
|
||||||
@ -458,14 +467,39 @@ public class Christmas extends SoloGame
|
|||||||
|
|
||||||
for (Player player : GetPlayers(false))
|
for (Player player : GetPlayers(false))
|
||||||
{
|
{
|
||||||
Manager.rewardPet(player, "Christmas Elf", EntityType.VILLAGER);
|
if (Manager.IsRewardItems())
|
||||||
|
{
|
||||||
|
if (Manager.GetTaskManager().hasCompletedTask(player, "CC Reward 2015"))
|
||||||
|
{
|
||||||
|
SetCustomWinMessage(player, "You already earned your reward");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
SetCustomWinMessage(player, "You earned " + C.cYellow + "2x Winter Holiday Treasure");
|
||||||
|
|
||||||
|
Manager.GetTaskManager().completedTask(new Callback<Boolean>()
|
||||||
|
{
|
||||||
|
@Override
|
||||||
|
public void run(Boolean data)
|
||||||
|
{
|
||||||
|
if (data)
|
||||||
|
{
|
||||||
|
Manager.getInventoryManager().addItemToInventory(player, "Winter Chest", 2);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
UtilPlayer.message(player, F.main("Inventory", "An error occured while giving you " + C.cRed + "2x Winter Holiday Treasure" + C.cGray + "."));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, player, "CC Reward 2015");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Manager.GetGame().AddGems(player, 30, "Slaying the Pumpkin King", false, false);
|
Manager.GetGame().AddGems(player, 30, "Slaying the Pumpkin King", false, false);
|
||||||
Manager.GetGame().AddGems(player, 10, "Participation", false, false);
|
Manager.GetGame().AddGems(player, 10, "Participation", false, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
SetCustomWinLine("You earned Christmas Elf Pet!");
|
AnnounceEnd(getPlayersTeam());
|
||||||
AnnounceEnd(this.GetTeamList().get(0));
|
|
||||||
SetState(GameState.End);
|
SetState(GameState.End);
|
||||||
}
|
}
|
||||||
else if (GetPlayers(true).size() == 0)
|
else if (GetPlayers(true).size() == 0)
|
||||||
@ -476,7 +510,7 @@ public class Christmas extends SoloGame
|
|||||||
}
|
}
|
||||||
|
|
||||||
SetCustomWinLine("You all died...");
|
SetCustomWinLine("You all died...");
|
||||||
AnnounceEnd(this.GetTeamList().get(1));
|
AnnounceEnd(_badGuys);
|
||||||
SetState(GameState.End);
|
SetState(GameState.End);
|
||||||
}
|
}
|
||||||
else if (UtilTime.elapsed(GetStateTime(), _gameTime))
|
else if (UtilTime.elapsed(GetStateTime(), _gameTime))
|
||||||
@ -487,7 +521,7 @@ public class Christmas extends SoloGame
|
|||||||
}
|
}
|
||||||
|
|
||||||
SetCustomWinLine("You did not save Christmas in time.");
|
SetCustomWinLine("You did not save Christmas in time.");
|
||||||
AnnounceEnd(this.GetTeamList().get(1));
|
AnnounceEnd(_badGuys);
|
||||||
SetState(GameState.End);
|
SetState(GameState.End);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -504,7 +538,7 @@ public class Christmas extends SoloGame
|
|||||||
}
|
}
|
||||||
|
|
||||||
SetCustomWinLine("Santa Claus was killed by the Giant!");
|
SetCustomWinLine("Santa Claus was killed by the Giant!");
|
||||||
AnnounceEnd(this.GetTeamList().get(1));
|
AnnounceEnd(_badGuys);
|
||||||
SetState(GameState.End);
|
SetState(GameState.End);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -572,30 +606,60 @@ public class Christmas extends SoloGame
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
if (!IsLive())
|
if (!IsLive())
|
||||||
|
{
|
||||||
|
Scoreboard.Reset();
|
||||||
|
|
||||||
|
String line = "";
|
||||||
|
for (int i = 0 ; i < 20 ; i++)
|
||||||
|
line += ((i % 2 == 0 ? C.cRed : C.cDGreen) + "█");
|
||||||
|
|
||||||
|
Scoreboard.WriteBlank();
|
||||||
|
Scoreboard.Write(line);
|
||||||
|
|
||||||
|
Scoreboard.WriteBlank();
|
||||||
|
|
||||||
|
Scoreboard.Write(C.cWhiteB + "May your winter");
|
||||||
|
Scoreboard.Write(C.cWhiteB + "be filled with");
|
||||||
|
Scoreboard.Write(C.cYellowB + "joy" + C.cWhiteB + " and " + C.cYellowB + "cheer.");
|
||||||
|
|
||||||
|
Scoreboard.WriteBlank();
|
||||||
|
|
||||||
|
Scoreboard.Write(C.cAquaB + "Happy Holidays!");
|
||||||
|
|
||||||
|
Scoreboard.WriteBlank();
|
||||||
|
|
||||||
|
Scoreboard.Write(C.cWhiteB + "- Your friends at");
|
||||||
|
Scoreboard.Write(C.cGoldB + "MINEPLEX");
|
||||||
|
|
||||||
|
Scoreboard.WriteBlank();
|
||||||
|
Scoreboard.Write(line);
|
||||||
|
|
||||||
|
Scoreboard.Draw();
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
//Wipe Last
|
//Wipe Last
|
||||||
Scoreboard.Reset();
|
Scoreboard.Reset();
|
||||||
|
|
||||||
//Rounds
|
//Rounds
|
||||||
Scoreboard.WriteBlank();
|
Scoreboard.WriteBlank();
|
||||||
Scoreboard.Write(C.cWhite + "Challenge:");
|
Scoreboard.Write(C.cGoldB + "Challenge");
|
||||||
Scoreboard.Write(C.cYellow + (5 - _parts.size()) + " of " + 5);
|
Scoreboard.Write(C.cWhite + (5 - _parts.size()) + " of " + 5);
|
||||||
|
|
||||||
//Presents
|
//Presents
|
||||||
Scoreboard.WriteBlank();
|
Scoreboard.WriteBlank();
|
||||||
Scoreboard.Write(C.cWhite + "Presents:");
|
Scoreboard.Write(C.cGreenB + "Presents");
|
||||||
Scoreboard.Write(C.cYellow + GetSleigh().GetPresents().size() + " of " + 10);
|
Scoreboard.Write(C.cWhite + GetSleigh().GetPresents().size() + " of " + 10);
|
||||||
|
|
||||||
//Players
|
//Players
|
||||||
Scoreboard.WriteBlank();
|
Scoreboard.WriteBlank();
|
||||||
Scoreboard.Write(C.cWhite + "Players:");
|
Scoreboard.Write(C.cYellowB + "Players");
|
||||||
Scoreboard.Write(C.cYellow + GetPlayers(true).size());
|
Scoreboard.Write(C.cWhite + GetPlayers(true).size());
|
||||||
|
|
||||||
//Time
|
//Time
|
||||||
Scoreboard.WriteBlank();
|
Scoreboard.WriteBlank();
|
||||||
Scoreboard.Write(C.cWhite + "Time Left:");
|
Scoreboard.Write(C.cYellowB + "Time Left");
|
||||||
Scoreboard.Write(C.cYellow + UtilTime.MakeStr(_gameTime - (System.currentTimeMillis() - GetStateTime())));
|
Scoreboard.Write(C.cWhite + UtilTime.MakeStr(_gameTime - (System.currentTimeMillis() - GetStateTime())));
|
||||||
|
|
||||||
Scoreboard.Draw();
|
Scoreboard.Draw();
|
||||||
}
|
}
|
||||||
@ -679,4 +743,37 @@ public class Christmas extends SoloGame
|
|||||||
UtilPlayer.sendPacket(player, packet);
|
UtilPlayer.sendPacket(player, packet);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void updateReigns(UpdateEvent event)
|
||||||
|
{
|
||||||
|
if (!InProgress())
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (event.getType() != UpdateType.FASTER)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (_sleigh == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (_sleigh.getSanta() == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
for (SleighHorse horse : _sleigh.getHorses())
|
||||||
|
{
|
||||||
|
if (horse.Ent == null || !horse.Ent.isValid())
|
||||||
|
continue;
|
||||||
|
|
||||||
|
PacketPlayOutAttachEntity packet = new PacketPlayOutAttachEntity(1, ((CraftHorse) horse.Ent).getHandle(), (((CraftEntity) _sleigh.getSanta()).getHandle()));
|
||||||
|
|
||||||
|
for (Player player : UtilServer.getPlayers())
|
||||||
|
UtilPlayer.sendPacket(player, packet);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void preventStand(PlayerInteractAtEntityEvent event)
|
||||||
|
{
|
||||||
|
event.setCancelled(true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,30 +2,28 @@ package nautilus.game.arcade.game.games.christmas;
|
|||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
import org.bukkit.ChatColor;
|
||||||
|
import org.bukkit.Color;
|
||||||
|
import org.bukkit.Effect;
|
||||||
|
import org.bukkit.FireworkEffect;
|
||||||
|
import org.bukkit.FireworkEffect.Type;
|
||||||
|
import org.bukkit.Location;
|
||||||
|
import org.bukkit.Material;
|
||||||
|
import org.bukkit.block.BlockFace;
|
||||||
|
import org.bukkit.entity.Chicken;
|
||||||
|
import org.bukkit.entity.Entity;
|
||||||
|
import org.bukkit.entity.LivingEntity;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
import mineplex.core.common.util.C;
|
import mineplex.core.common.util.C;
|
||||||
import mineplex.core.common.util.UtilAction;
|
import mineplex.core.common.util.UtilAction;
|
||||||
import mineplex.core.common.util.UtilAlg;
|
import mineplex.core.common.util.UtilAlg;
|
||||||
import mineplex.core.common.util.UtilEnt;
|
import mineplex.core.common.util.UtilEnt;
|
||||||
import mineplex.core.common.util.UtilFirework;
|
import mineplex.core.common.util.UtilFirework;
|
||||||
import mineplex.core.common.util.UtilMath;
|
|
||||||
import mineplex.core.common.util.UtilPlayer;
|
import mineplex.core.common.util.UtilPlayer;
|
||||||
import mineplex.core.recharge.Recharge;
|
import mineplex.core.recharge.Recharge;
|
||||||
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
|
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
|
||||||
import nautilus.game.arcade.game.games.christmas.parts.Part;
|
|
||||||
|
|
||||||
import org.bukkit.ChatColor;
|
|
||||||
import org.bukkit.Color;
|
|
||||||
import org.bukkit.Effect;
|
|
||||||
import org.bukkit.FireworkEffect;
|
|
||||||
import org.bukkit.Location;
|
|
||||||
import org.bukkit.Material;
|
|
||||||
import org.bukkit.FireworkEffect.Type;
|
|
||||||
import org.bukkit.block.BlockFace;
|
|
||||||
import org.bukkit.entity.Chicken;
|
|
||||||
import org.bukkit.entity.Entity;
|
|
||||||
import org.bukkit.entity.FallingBlock;
|
|
||||||
import org.bukkit.entity.Player;
|
|
||||||
import org.bukkit.util.Vector;
|
|
||||||
|
|
||||||
public class Sleigh
|
public class Sleigh
|
||||||
{
|
{
|
||||||
@ -41,6 +39,8 @@ public class Sleigh
|
|||||||
private ArrayList<Location> PresentsCollected = new ArrayList<Location>();;
|
private ArrayList<Location> PresentsCollected = new ArrayList<Location>();;
|
||||||
|
|
||||||
private Location Target;
|
private Location Target;
|
||||||
|
|
||||||
|
private Entity Santa;
|
||||||
|
|
||||||
public void setupSleigh(Christmas host, Location loc)
|
public void setupSleigh(Christmas host, Location loc)
|
||||||
{
|
{
|
||||||
@ -52,24 +52,25 @@ public class Sleigh
|
|||||||
|
|
||||||
CentralEntity = loc.getWorld().spawn(loc, Chicken.class);
|
CentralEntity = loc.getWorld().spawn(loc, Chicken.class);
|
||||||
UtilEnt.Vegetate(CentralEntity, true);
|
UtilEnt.Vegetate(CentralEntity, true);
|
||||||
UtilEnt.ghost(CentralEntity, true, true);
|
UtilEnt.ghost(CentralEntity, true, false);
|
||||||
|
Host.Manager.GetCondition().Factory().Invisible("Sleigh", (LivingEntity) CentralEntity, null, Double.MAX_VALUE, 3, false, false, true);
|
||||||
|
|
||||||
//Presents
|
//Presents
|
||||||
PresentSlots = new ArrayList<SleighPart>();
|
PresentSlots = new ArrayList<SleighPart>();
|
||||||
|
|
||||||
PresentSlots.add(new SleighPart(2, 0, 0, loc.clone(), -1, -2));
|
PresentSlots.add(new SleighPart(this, 2, 0, 0, loc.clone(), -1, -2));
|
||||||
PresentSlots.add(new SleighPart(2, 0, 0, loc.clone(), 0, -2));
|
PresentSlots.add(new SleighPart(this, 2, 0, 0, loc.clone(), 0, -2));
|
||||||
PresentSlots.add(new SleighPart(2, 0, 0, loc.clone(), 1, -2));
|
PresentSlots.add(new SleighPart(this, 2, 0, 0, loc.clone(), 1, -2));
|
||||||
PresentSlots.add(new SleighPart(2, 0, 0, loc.clone(), -1, -1));
|
PresentSlots.add(new SleighPart(this, 2, 0, 0, loc.clone(), -1, -1));
|
||||||
PresentSlots.add(new SleighPart(2, 0, 0, loc.clone(), 0, -1));
|
PresentSlots.add(new SleighPart(this, 2, 0, 0, loc.clone(), 0, -1));
|
||||||
PresentSlots.add(new SleighPart(2, 0, 0, loc.clone(), 1, -1));
|
PresentSlots.add(new SleighPart(this, 2, 0, 0, loc.clone(), 1, -1));
|
||||||
|
|
||||||
PresentSlots.add(new SleighPart(6, 0, 0, loc.clone(), -1, -2));
|
PresentSlots.add(new SleighPart(this, 6, 0, 0, loc.clone(), -1, -2));
|
||||||
PresentSlots.add(new SleighPart(6, 0, 0, loc.clone(), 0, -2));
|
PresentSlots.add(new SleighPart(this, 6, 0, 0, loc.clone(), 0, -2));
|
||||||
PresentSlots.add(new SleighPart(6, 0, 0, loc.clone(), 1, -2));
|
PresentSlots.add(new SleighPart(this, 6, 0, 0, loc.clone(), 1, -2));
|
||||||
PresentSlots.add(new SleighPart(6, 0, 0, loc.clone(), -1, -1));
|
PresentSlots.add(new SleighPart(this, 6, 0, 0, loc.clone(), -1, -1));
|
||||||
PresentSlots.add(new SleighPart(6, 0, 0, loc.clone(), 0, -1));
|
PresentSlots.add(new SleighPart(this, 6, 0, 0, loc.clone(), 0, -1));
|
||||||
PresentSlots.add(new SleighPart(6, 0, 0, loc.clone(), 1, -1));
|
PresentSlots.add(new SleighPart(this, 6, 0, 0, loc.clone(), 1, -1));
|
||||||
|
|
||||||
//Sleigh
|
//Sleigh
|
||||||
SleighEnts = new ArrayList<SleighPart>();
|
SleighEnts = new ArrayList<SleighPart>();
|
||||||
@ -77,65 +78,71 @@ public class Sleigh
|
|||||||
for (SleighPart part : PresentSlots)
|
for (SleighPart part : PresentSlots)
|
||||||
SleighEnts.add(part);
|
SleighEnts.add(part);
|
||||||
|
|
||||||
SleighEnts.add(new SleighPart(0, 159, 14, loc.clone(), 0, -3));
|
SleighEnts.add(new SleighPart(this, 0, 159, 14, loc.clone(), 0, -3));
|
||||||
SleighEnts.add(new SleighPart(0, 159, 14, loc.clone(), -1, -3));
|
SleighEnts.add(new SleighPart(this, 0, 159, 14, loc.clone(), -1, -3));
|
||||||
SleighEnts.add(new SleighPart(0, 159, 14, loc.clone(), -2, -3));
|
SleighEnts.add(new SleighPart(this, 0, 159, 14, loc.clone(), -2, -3));
|
||||||
SleighEnts.add(new SleighPart(0, 159, 14, loc.clone(), 1, -3));
|
SleighEnts.add(new SleighPart(this, 0, 159, 14, loc.clone(), 1, -3));
|
||||||
SleighEnts.add(new SleighPart(0, 159, 14, loc.clone(), 2, -3));
|
SleighEnts.add(new SleighPart(this, 0, 159, 14, loc.clone(), 2, -3));
|
||||||
|
|
||||||
SleighEnts.add(new SleighPart(0, 159, 14, loc.clone(), -2, -2));
|
SleighEnts.add(new SleighPart(this, 0, 159, 14, loc.clone(), -2, -2));
|
||||||
SleighEnts.add(new SleighPart(0, 44, 7, loc.clone(), -1, -2));
|
SleighEnts.add(new SleighPart(this, 0, 44, 7, loc.clone(), -1, -2));
|
||||||
SleighEnts.add(new SleighPart(0, 44, 7, loc.clone(), 0, -2));
|
SleighEnts.add(new SleighPart(this, 0, 44, 7, loc.clone(), 0, -2));
|
||||||
SleighEnts.add(new SleighPart(0, 44, 7, loc.clone(), 1, -2));
|
SleighEnts.add(new SleighPart(this, 0, 44, 7, loc.clone(), 1, -2));
|
||||||
SleighEnts.add(new SleighPart(0, 159, 14, loc.clone(), 2, -2));
|
SleighEnts.add(new SleighPart(this, 0, 159, 14, loc.clone(), 2, -2));
|
||||||
|
|
||||||
SleighEnts.add(new SleighPart(0, 159, 14, loc.clone(), -2, -1));
|
SleighEnts.add(new SleighPart(this, 0, 159, 14, loc.clone(), -2, -1));
|
||||||
SleighEnts.add(new SleighPart(0, 44, 7, loc.clone(), -1, -1));
|
SleighEnts.add(new SleighPart(this, 0, 44, 7, loc.clone(), -1, -1));
|
||||||
SleighEnts.add(new SleighPart(0, 44, 7, loc.clone(), 0, -1));
|
SleighEnts.add(new SleighPart(this, 0, 44, 7, loc.clone(), 0, -1));
|
||||||
SleighEnts.add(new SleighPart(0, 44, 7, loc.clone(), 1, -1));
|
SleighEnts.add(new SleighPart(this, 0, 44, 7, loc.clone(), 1, -1));
|
||||||
SleighEnts.add(new SleighPart(0, 159, 14, loc.clone(), 2, -1));
|
SleighEnts.add(new SleighPart(this, 0, 159, 14, loc.clone(), 2, -1));
|
||||||
|
|
||||||
|
|
||||||
SleighEnts.add(new SleighPart(0, 159, 14, loc.clone(), -2, 0));
|
SleighEnts.add(new SleighPart(this, 0, 159, 14, loc.clone(), -2, 0));
|
||||||
SleighEnts.add(new SleighPart(0, 159, 14, loc.clone(), -1, 0));
|
SleighEnts.add(new SleighPart(this, 0, 159, 14, loc.clone(), -1, 0));
|
||||||
SleighEnts.add(new SleighPart(0, 159, 14, loc.clone(), 0, 0));
|
SleighEnts.add(new SleighPart(this, 0, 159, 14, loc.clone(), 0, 0));
|
||||||
SleighEnts.add(new SleighPart(0, 159, 14, loc.clone(), 1, 0));
|
SleighEnts.add(new SleighPart(this, 0, 159, 14, loc.clone(), 1, 0));
|
||||||
SleighEnts.add(new SleighPart(0, 159, 14, loc.clone(), 2, 0));
|
SleighEnts.add(new SleighPart(this, 0, 159, 14, loc.clone(), 2, 0));
|
||||||
|
|
||||||
SleighEnts.add(new SleighPart(0, 159, 14, loc.clone(), -2, 1));
|
SleighEnts.add(new SleighPart(this, 0, 159, 14, loc.clone(), -2, 1));
|
||||||
SleighEnts.add(new SleighPart(0, 44, 7, loc.clone(), -1, 1));
|
SleighEnts.add(new SleighPart(this, 0, 44, 7, loc.clone(), -1, 1));
|
||||||
SleighEnts.add(new SleighPart(0, 159, 15, loc.clone(), 0, 1));
|
SleighEnts.add(new SleighPart(this, 0, 159, 15, loc.clone(), 0, 1));
|
||||||
SleighEnts.add(new SleighPart(0, 44, 7, loc.clone(), 1, 1));
|
SleighEnts.add(new SleighPart(this, 0, 44, 7, loc.clone(), 1, 1));
|
||||||
SleighEnts.add(new SleighPart(0, 159, 14, loc.clone(), 2, 1));
|
SleighEnts.add(new SleighPart(this, 0, 159, 14, loc.clone(), 2, 1));
|
||||||
|
|
||||||
SleighEnts.add(new SleighPart(0, 44, 7, loc.clone(), -2, 2));
|
SleighEnts.add(new SleighPart(this, 0, 44, 7, loc.clone(), -2, 2));
|
||||||
SleighEnts.add(new SleighPart(0, 44, 7, loc.clone(), -1, 2));
|
SleighEnts.add(new SleighPart(this, 0, 44, 7, loc.clone(), -1, 2));
|
||||||
SleighEnts.add(new SleighPart(0, 44, 7, loc.clone(), 0, 2));
|
SleighEnts.add(new SleighPart(this, 0, 44, 7, loc.clone(), 0, 2));
|
||||||
SleighEnts.add(new SleighPart(0, 44, 7, loc.clone(), 1, 2));
|
SleighEnts.add(new SleighPart(this, 0, 44, 7, loc.clone(), 1, 2));
|
||||||
SleighEnts.add(new SleighPart(0, 44, 7, loc.clone(), 2, 2));
|
SleighEnts.add(new SleighPart(this, 0, 44, 7, loc.clone(), 2, 2));
|
||||||
|
|
||||||
SleighEnts.add(new SleighPart(0, 159, 14, loc.clone(), -2, 3));
|
SleighEnts.add(new SleighPart(this, 0, 159, 14, loc.clone(), -2, 3));
|
||||||
SleighEnts.add(new SleighPart(0, 159, 14, loc.clone(), -1, 3));
|
SleighEnts.add(new SleighPart(this, 0, 159, 14, loc.clone(), -1, 3));
|
||||||
SleighEnts.add(new SleighPart(0, 159, 14, loc.clone(), 0, 3));
|
SleighEnts.add(new SleighPart(this, 0, 159, 14, loc.clone(), 0, 3));
|
||||||
SleighEnts.add(new SleighPart(0, 159, 14, loc.clone(), 1, 3));
|
SleighEnts.add(new SleighPart(this, 0, 159, 14, loc.clone(), 1, 3));
|
||||||
SleighEnts.add(new SleighPart(0, 159, 14, loc.clone(), 2, 3));
|
SleighEnts.add(new SleighPart(this, 0, 159, 14, loc.clone(), 2, 3));
|
||||||
|
|
||||||
//Santa
|
//Santa
|
||||||
SleighPart santa = new SleighPart(3, 0, 0, loc.clone(), 0, 1);
|
SleighPart santa = new SleighPart(this, 3, 0, 0, loc.clone(), 0, 1);
|
||||||
santa.AddSanta();
|
Santa = santa.AddSanta();
|
||||||
SleighEnts.add(santa);
|
SleighEnts.add(santa);
|
||||||
|
|
||||||
SleighHorses.add(new SleighHorse(loc.clone(), -1.5, 8));
|
SleighHorses.add(new SleighHorse(loc.clone(), "Dasher", -1.5, 8));
|
||||||
SleighHorses.add(new SleighHorse(loc.clone(), 1.5, 8));
|
SleighHorses.add(new SleighHorse(loc.clone(), "Dancer", 1.5, 8));
|
||||||
|
|
||||||
|
SleighHorses.add(new SleighHorse(loc.clone(), "Prancer", -1.5, 11));
|
||||||
|
SleighHorses.add(new SleighHorse(loc.clone(), "Vixen", 1.5, 11));
|
||||||
|
|
||||||
|
SleighHorses.add(new SleighHorse(loc.clone(), "Comet", -1.5, 14));
|
||||||
|
SleighHorses.add(new SleighHorse(loc.clone(), "Cupid", 1.5, 14));
|
||||||
|
|
||||||
SleighHorses.add(new SleighHorse(loc.clone(), -1.5, 11));
|
SleighHorses.add(new SleighHorse(loc.clone(), "Donner", -1.5, 17));
|
||||||
SleighHorses.add(new SleighHorse(loc.clone(), 1.5, 11));
|
SleighHorses.add(new SleighHorse(loc.clone(), "Blitzen", 1.5, 17));
|
||||||
|
|
||||||
for (SleighHorse horse : SleighHorses)
|
for (SleighHorse horse : SleighHorses)
|
||||||
horse.spawnHorse();
|
horse.spawnHorse();
|
||||||
|
|
||||||
for (SleighHorse horse : SleighHorses)
|
// for (SleighHorse horse : SleighHorses)
|
||||||
UtilEnt.Leash(horse.Ent, santa.GetTop(), false, false);
|
// UtilEnt.Leash(horse.Ent, santa.GetTop(), true, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Location GetLocation()
|
public Location GetLocation()
|
||||||
@ -157,6 +164,8 @@ public class Sleigh
|
|||||||
|
|
||||||
Move(CentralEntity, Target, 1);
|
Move(CentralEntity, Target, 1);
|
||||||
|
|
||||||
|
Santa.setTicksLived(1);
|
||||||
|
|
||||||
//Move Sleigh
|
//Move Sleigh
|
||||||
for (SleighPart part : SleighEnts)
|
for (SleighPart part : SleighEnts)
|
||||||
{
|
{
|
||||||
@ -184,24 +193,6 @@ public class Sleigh
|
|||||||
{
|
{
|
||||||
for (Player player : Host.GetPlayers(true))
|
for (Player player : Host.GetPlayers(true))
|
||||||
{
|
{
|
||||||
if (!Recharge.Instance.usable(player, "Sleigh Bump"))
|
|
||||||
continue;
|
|
||||||
|
|
||||||
for (SleighPart part : SleighEnts)
|
|
||||||
if (UtilMath.offset(player, part.Ent) < 1)
|
|
||||||
{
|
|
||||||
UtilAction.velocity(player, UtilAlg.getTrajectory2d(CentralEntity, player), 0.4, true, 0.2, 0, 0, true);
|
|
||||||
Recharge.Instance.useForce(player, "Sleigh Bump", 400);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
for (SleighHorse part : SleighHorses)
|
|
||||||
if (UtilMath.offset(player, part.Ent) < 1)
|
|
||||||
{
|
|
||||||
UtilAction.velocity(player, UtilAlg.getTrajectory2d(CentralEntity, player), 0.4, true, 0.2, 0, 0, true);
|
|
||||||
Recharge.Instance.useForce(player, "Sleigh Bump", 400);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (player.getLocation().getZ() < CentralEntity.getLocation().getZ() - 24)
|
if (player.getLocation().getZ() < CentralEntity.getLocation().getZ() - 24)
|
||||||
{
|
{
|
||||||
player.damage(1);
|
player.damage(1);
|
||||||
@ -211,6 +202,44 @@ public class Sleigh
|
|||||||
Recharge.Instance.useForce(player, "Sleigh Bump", 400);
|
Recharge.Instance.useForce(player, "Sleigh Bump", 400);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (SleighPart part : SleighEnts)
|
||||||
|
{
|
||||||
|
for (Entity ent : UtilEnt.getInRadius(part.Ent.getLocation(), 1).keySet())
|
||||||
|
{
|
||||||
|
if (isPart(ent))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (ent instanceof Player)
|
||||||
|
{
|
||||||
|
if (!Recharge.Instance.usable((Player) ent, "Sleigh Bump"))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
Recharge.Instance.useForce((Player) ent, "Sleigh Bump", 400);
|
||||||
|
}
|
||||||
|
|
||||||
|
UtilAction.velocity(ent, UtilAlg.getTrajectory2d(CentralEntity, ent), 0.4, true, 0.2, 0, 0, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for (SleighHorse part : SleighHorses)
|
||||||
|
{
|
||||||
|
for (Entity ent : UtilEnt.getInRadius(part.Ent.getLocation(), 1).keySet())
|
||||||
|
{
|
||||||
|
if (isPart(ent))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (ent instanceof Player)
|
||||||
|
{
|
||||||
|
if (!Recharge.Instance.usable((Player) ent, "Sleigh Bump"))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
Recharge.Instance.useForce((Player) ent, "Sleigh Bump", 400);
|
||||||
|
}
|
||||||
|
|
||||||
|
UtilAction.velocity(ent, UtilAlg.getTrajectory2d(CentralEntity, ent), 0.4, true, 0.2, 0, 0, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean HasPresent(Location loc)
|
public boolean HasPresent(Location loc)
|
||||||
@ -222,6 +251,7 @@ public class Sleigh
|
|||||||
{
|
{
|
||||||
PresentsCollected.add(loc);
|
PresentsCollected.add(loc);
|
||||||
loc.getBlock().setType(Material.AIR);
|
loc.getBlock().setType(Material.AIR);
|
||||||
|
loc.getBlock().getRelative(BlockFace.DOWN).getRelative(BlockFace.DOWN).setType(Material.IRON_BLOCK);
|
||||||
loc.getBlock().getRelative(BlockFace.DOWN).setType(Material.GLASS);
|
loc.getBlock().getRelative(BlockFace.DOWN).setType(Material.GLASS);
|
||||||
UtilFirework.launchFirework(loc.clone().add(0.5, 0.5, 0.5), FireworkEffect.builder().flicker(false).withColor(Color.YELLOW).with(Type.BALL).trail(true).build(), new Vector(0,1,0), 0);
|
UtilFirework.launchFirework(loc.clone().add(0.5, 0.5, 0.5), FireworkEffect.builder().flicker(false).withColor(Color.YELLOW).with(Type.BALL).trail(true).build(), new Vector(0,1,0), 0);
|
||||||
|
|
||||||
@ -267,4 +297,35 @@ public class Sleigh
|
|||||||
{
|
{
|
||||||
return SleighHorses;
|
return SleighHorses;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Entity getSanta()
|
||||||
|
{
|
||||||
|
return Santa;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isPart(Entity ent)
|
||||||
|
{
|
||||||
|
if (ent == null)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (ent == CentralEntity)
|
||||||
|
return true;
|
||||||
|
|
||||||
|
if (ent == Santa)
|
||||||
|
return true;
|
||||||
|
|
||||||
|
for (SleighPart part : SleighEnts)
|
||||||
|
if (part.Block == ent || part.Ent == ent || (ent instanceof LivingEntity && part.HasEntity((LivingEntity) ent)))
|
||||||
|
return true;
|
||||||
|
|
||||||
|
for (SleighHorse horse : SleighHorses)
|
||||||
|
if (horse.Ent == ent || (ent instanceof LivingEntity && horse.HasEntity((LivingEntity) ent)))
|
||||||
|
return true;
|
||||||
|
|
||||||
|
for (SleighPart part : PresentSlots)
|
||||||
|
if (part.Block == ent || part.Ent == ent || (ent instanceof LivingEntity && part.HasEntity((LivingEntity) ent)))
|
||||||
|
return true;
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,6 +2,19 @@ package nautilus.game.arcade.game.games.christmas;
|
|||||||
|
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
|
|
||||||
|
import org.bukkit.Location;
|
||||||
|
import org.bukkit.Material;
|
||||||
|
import org.bukkit.craftbukkit.v1_8_R3.CraftWorld;
|
||||||
|
import org.bukkit.craftbukkit.v1_8_R3.inventory.CraftItemStack;
|
||||||
|
import org.bukkit.entity.Horse;
|
||||||
|
import org.bukkit.entity.Horse.Color;
|
||||||
|
import org.bukkit.entity.Horse.Style;
|
||||||
|
import org.bukkit.entity.LivingEntity;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
|
import mineplex.core.common.util.C;
|
||||||
import mineplex.core.common.util.UtilEnt;
|
import mineplex.core.common.util.UtilEnt;
|
||||||
import mineplex.core.common.util.UtilPlayer;
|
import mineplex.core.common.util.UtilPlayer;
|
||||||
import net.minecraft.server.v1_8_R3.DataWatcher;
|
import net.minecraft.server.v1_8_R3.DataWatcher;
|
||||||
@ -14,19 +27,6 @@ import net.minecraft.server.v1_8_R3.PacketPlayOutEntityTeleport;
|
|||||||
import net.minecraft.server.v1_8_R3.PacketPlayOutSpawnEntityLiving;
|
import net.minecraft.server.v1_8_R3.PacketPlayOutSpawnEntityLiving;
|
||||||
import net.minecraft.server.v1_8_R3.Vector3f;
|
import net.minecraft.server.v1_8_R3.Vector3f;
|
||||||
|
|
||||||
import org.bukkit.Location;
|
|
||||||
import org.bukkit.Material;
|
|
||||||
import org.bukkit.craftbukkit.v1_8_R3.CraftWorld;
|
|
||||||
import org.bukkit.craftbukkit.v1_8_R3.entity.CraftPlayer;
|
|
||||||
import org.bukkit.craftbukkit.v1_8_R3.inventory.CraftItemStack;
|
|
||||||
import org.bukkit.entity.Horse;
|
|
||||||
import org.bukkit.entity.Player;
|
|
||||||
import org.bukkit.entity.Horse.Color;
|
|
||||||
import org.bukkit.entity.Horse.Style;
|
|
||||||
import org.bukkit.entity.LivingEntity;
|
|
||||||
import org.bukkit.inventory.ItemStack;
|
|
||||||
import org.bukkit.util.Vector;
|
|
||||||
|
|
||||||
public class SleighHorse
|
public class SleighHorse
|
||||||
{
|
{
|
||||||
private Location _lastFacing;
|
private Location _lastFacing;
|
||||||
@ -40,9 +40,11 @@ public class SleighHorse
|
|||||||
public int horseId;
|
public int horseId;
|
||||||
public double OffsetX;
|
public double OffsetX;
|
||||||
public double OffsetZ;
|
public double OffsetZ;
|
||||||
|
public String Name;
|
||||||
|
|
||||||
public SleighHorse(Location loc, double x, double z)
|
public SleighHorse(Location loc, String name, double x, double z)
|
||||||
{
|
{
|
||||||
|
Name = name;
|
||||||
OffsetX = x;
|
OffsetX = x;
|
||||||
OffsetZ = z;
|
OffsetZ = z;
|
||||||
_lastFacing = loc.add(x, 0.5, z);
|
_lastFacing = loc.add(x, 0.5, z);
|
||||||
@ -182,6 +184,10 @@ public class SleighHorse
|
|||||||
Ent = _lastFacing.getWorld().spawn(_lastFacing.subtract(0, 0.5, 0), Horse.class);
|
Ent = _lastFacing.getWorld().spawn(_lastFacing.subtract(0, 0.5, 0), Horse.class);
|
||||||
UtilEnt.Vegetate(Ent);
|
UtilEnt.Vegetate(Ent);
|
||||||
UtilEnt.ghost(Ent, true, false);
|
UtilEnt.ghost(Ent, true, false);
|
||||||
|
Ent.setRemoveWhenFarAway(false);
|
||||||
|
|
||||||
|
Ent.setCustomName(C.cWhiteB + Name);
|
||||||
|
Ent.setCustomNameVisible(true);
|
||||||
|
|
||||||
Ent.setStyle(Style.BLACK_DOTS);
|
Ent.setStyle(Style.BLACK_DOTS);
|
||||||
Ent.setColor(Color.BROWN);
|
Ent.setColor(Color.BROWN);
|
||||||
|
@ -1,9 +1,5 @@
|
|||||||
package nautilus.game.arcade.game.games.christmas;
|
package nautilus.game.arcade.game.games.christmas;
|
||||||
|
|
||||||
import mineplex.core.common.util.C;
|
|
||||||
import mineplex.core.common.util.UtilEnt;
|
|
||||||
import mineplex.core.common.util.UtilMath;
|
|
||||||
|
|
||||||
import org.bukkit.Color;
|
import org.bukkit.Color;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
@ -16,6 +12,10 @@ import org.bukkit.entity.Skeleton;
|
|||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
import org.bukkit.inventory.meta.LeatherArmorMeta;
|
import org.bukkit.inventory.meta.LeatherArmorMeta;
|
||||||
|
|
||||||
|
import mineplex.core.common.util.C;
|
||||||
|
import mineplex.core.common.util.UtilEnt;
|
||||||
|
import mineplex.core.common.util.UtilMath;
|
||||||
|
|
||||||
public class SleighPart
|
public class SleighPart
|
||||||
{
|
{
|
||||||
public Chicken Ent;
|
public Chicken Ent;
|
||||||
@ -23,38 +23,32 @@ public class SleighPart
|
|||||||
public double OffsetX;
|
public double OffsetX;
|
||||||
public double OffsetZ;
|
public double OffsetZ;
|
||||||
|
|
||||||
public SleighPart(int rise, int id, int data, Location loc, double x, double z)
|
public int Rise;
|
||||||
|
public int Id;
|
||||||
|
public int Data;
|
||||||
|
public Location Location;
|
||||||
|
|
||||||
|
public SleighPart(Sleigh sleigh, int rise, int id, int data, Location loc, double x, double z)
|
||||||
{
|
{
|
||||||
//Base
|
//Base
|
||||||
Ent = loc.getWorld().spawn(loc.add(x, 0, z), Chicken.class);
|
Ent = loc.getWorld().spawn(loc.add(x, 0, z), Chicken.class);
|
||||||
Ent.setBaby();
|
Ent.setBaby();
|
||||||
Ent.setAgeLock(true);
|
Ent.setAgeLock(true);
|
||||||
|
Ent.setRemoveWhenFarAway(false);
|
||||||
|
|
||||||
UtilEnt.Vegetate(Ent, true);
|
UtilEnt.Vegetate(Ent, true);
|
||||||
UtilEnt.ghost(Ent, true, true);
|
UtilEnt.ghost(Ent, true, false);
|
||||||
|
sleigh.Host.Manager.GetCondition().Factory().Invisible("Sleigh", Ent, null, Double.MAX_VALUE, 3, false, false, true);
|
||||||
|
|
||||||
//Height
|
//Height
|
||||||
Chicken top = Ent;
|
Rise = rise;
|
||||||
for (int i=0 ; i<rise ; i++)
|
Id = id;
|
||||||
{
|
Data = data;
|
||||||
Chicken newTop = loc.getWorld().spawn(loc.add(x, 0, z), Chicken.class);
|
Location = loc;
|
||||||
newTop.setBaby();
|
|
||||||
newTop.setAgeLock(true);
|
|
||||||
UtilEnt.Vegetate(newTop, true);
|
|
||||||
UtilEnt.ghost(newTop, true, true);
|
|
||||||
|
|
||||||
top.setPassenger(newTop);
|
|
||||||
top = newTop;
|
|
||||||
}
|
|
||||||
|
|
||||||
//Block
|
|
||||||
if (id != 0)
|
|
||||||
{
|
|
||||||
Block = loc.getWorld().spawnFallingBlock(loc.add(0, 1, 0), id, (byte)data);
|
|
||||||
top.setPassenger(Block);
|
|
||||||
}
|
|
||||||
|
|
||||||
OffsetX = x;
|
OffsetX = x;
|
||||||
OffsetZ = z;
|
OffsetZ = z;
|
||||||
|
|
||||||
|
addRise(sleigh);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void RefreshBlocks()
|
public void RefreshBlocks()
|
||||||
@ -70,7 +64,7 @@ public class SleighPart
|
|||||||
|
|
||||||
if (ent instanceof FallingBlock)
|
if (ent instanceof FallingBlock)
|
||||||
((CraftFallingSand)ent).getHandle().ticksLived = 1;
|
((CraftFallingSand)ent).getHandle().ticksLived = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SetPresent()
|
public void SetPresent()
|
||||||
@ -87,10 +81,10 @@ public class SleighPart
|
|||||||
top.setPassenger(Block);
|
top.setPassenger(Block);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void AddSanta()
|
public Entity AddSanta()
|
||||||
{
|
{
|
||||||
if (Ent == null)
|
if (Ent == null)
|
||||||
return;
|
return null;
|
||||||
|
|
||||||
Skeleton skel = Ent.getWorld().spawn(Ent.getLocation().add(0, 1, 0), Skeleton.class);
|
Skeleton skel = Ent.getWorld().spawn(Ent.getLocation().add(0, 1, 0), Skeleton.class);
|
||||||
UtilEnt.Vegetate(skel);
|
UtilEnt.Vegetate(skel);
|
||||||
@ -99,6 +93,7 @@ public class SleighPart
|
|||||||
ItemStack head = new ItemStack(Material.LEATHER_HELMET);
|
ItemStack head = new ItemStack(Material.LEATHER_HELMET);
|
||||||
LeatherArmorMeta meta = (LeatherArmorMeta)head.getItemMeta();
|
LeatherArmorMeta meta = (LeatherArmorMeta)head.getItemMeta();
|
||||||
meta.setColor(Color.RED);
|
meta.setColor(Color.RED);
|
||||||
|
meta.spigot().setUnbreakable(true);
|
||||||
head.setItemMeta(meta);
|
head.setItemMeta(meta);
|
||||||
skel.getEquipment().setHelmet(head);
|
skel.getEquipment().setHelmet(head);
|
||||||
|
|
||||||
@ -116,18 +111,22 @@ public class SleighPart
|
|||||||
|
|
||||||
ItemStack boots = new ItemStack(Material.LEATHER_BOOTS);
|
ItemStack boots = new ItemStack(Material.LEATHER_BOOTS);
|
||||||
meta = (LeatherArmorMeta)boots.getItemMeta();
|
meta = (LeatherArmorMeta)boots.getItemMeta();
|
||||||
meta.setColor(Color.RED);
|
meta.setColor(Color.BLACK);
|
||||||
boots.setItemMeta(meta);
|
boots.setItemMeta(meta);
|
||||||
skel.getEquipment().setBoots(boots);
|
skel.getEquipment().setBoots(boots);
|
||||||
|
|
||||||
skel.setCustomName(C.Bold + "Santa Claus");
|
|
||||||
skel.setCustomNameVisible(true);
|
|
||||||
|
|
||||||
Entity top = Ent;
|
Entity top = Ent;
|
||||||
while (top.getPassenger() != null)
|
while (top.getPassenger() != null)
|
||||||
top = top.getPassenger();
|
top = top.getPassenger();
|
||||||
|
|
||||||
top.setPassenger(skel);
|
top.setPassenger(skel);
|
||||||
|
|
||||||
|
skel.setCustomName(C.Bold + "Santa Claus");
|
||||||
|
skel.setCustomNameVisible(true);
|
||||||
|
|
||||||
|
skel.setRemoveWhenFarAway(false);
|
||||||
|
|
||||||
|
return skel;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean HasEntity(LivingEntity ent)
|
public boolean HasEntity(LivingEntity ent)
|
||||||
@ -159,4 +158,30 @@ public class SleighPart
|
|||||||
|
|
||||||
return ent;
|
return ent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void addRise(Sleigh sleigh)
|
||||||
|
{
|
||||||
|
Chicken top = Ent;
|
||||||
|
for (int i=0 ; i<Rise ; i++)
|
||||||
|
{
|
||||||
|
Chicken newTop = Location.getWorld().spawn(Ent.getLocation(), Chicken.class);
|
||||||
|
newTop.setBaby();
|
||||||
|
newTop.setAgeLock(true);
|
||||||
|
newTop.setRemoveWhenFarAway(false);
|
||||||
|
|
||||||
|
UtilEnt.Vegetate(newTop, true);
|
||||||
|
UtilEnt.ghost(newTop, true, false);
|
||||||
|
sleigh.Host.Manager.GetCondition().Factory().Invisible("Sleigh", newTop, null, Double.MAX_VALUE, 3, false, false, true);
|
||||||
|
|
||||||
|
top.setPassenger(newTop);
|
||||||
|
top = newTop;
|
||||||
|
}
|
||||||
|
|
||||||
|
//Block
|
||||||
|
if (Id != 0)
|
||||||
|
{
|
||||||
|
Block = Location.getWorld().spawnFallingBlock(Ent.getLocation().add(0, 1, 0), Id, (byte) Data);
|
||||||
|
top.setPassenger(Block);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -3,21 +3,20 @@ package nautilus.game.arcade.game.games.christmas.content;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
|
||||||
import mineplex.core.common.util.C;
|
|
||||||
import mineplex.core.common.util.MapUtil;
|
|
||||||
import mineplex.core.common.util.UtilServer;
|
|
||||||
import mineplex.core.common.util.UtilTime;
|
|
||||||
import mineplex.core.itemstack.ItemStackFactory;
|
|
||||||
import nautilus.game.arcade.game.games.christmas.Christmas;
|
|
||||||
import nautilus.game.arcade.game.games.christmas.ChristmasAudio;
|
|
||||||
import nautilus.game.arcade.game.games.christmas.parts.Part5;
|
|
||||||
|
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.block.BlockFace;
|
import org.bukkit.block.BlockFace;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
|
import mineplex.core.common.util.C;
|
||||||
|
import mineplex.core.common.util.MapUtil;
|
||||||
|
import mineplex.core.common.util.UtilServer;
|
||||||
|
import mineplex.core.common.util.UtilTime;
|
||||||
|
import mineplex.core.itemstack.ItemStackFactory;
|
||||||
|
import nautilus.game.arcade.game.games.christmas.ChristmasAudio;
|
||||||
|
import nautilus.game.arcade.game.games.christmas.parts.Part5;
|
||||||
|
|
||||||
public class BossFloor
|
public class BossFloor
|
||||||
{
|
{
|
||||||
private Part5 Host;
|
private Part5 Host;
|
||||||
@ -114,9 +113,10 @@ public class BossFloor
|
|||||||
_restoreLoc = Host.GetBoss().GetEntity().getLocation().getBlock().getLocation().add(0.5, 0, 0.5);
|
_restoreLoc = Host.GetBoss().GetEntity().getLocation().getBlock().getLocation().add(0.5, 0, 0.5);
|
||||||
|
|
||||||
//Give Wool
|
//Give Wool
|
||||||
for (Player player : UtilServer.getPlayers())
|
for (Player player : Host.Host.GetPlayers(true))
|
||||||
for (int i=3 ; i<9 ; i++)
|
for (int i=0 ; i<9 ; i++)
|
||||||
player.getInventory().setItem(i, ItemStackFactory.Instance.CreateStack(Material.WOOL, _color));
|
if (player.getInventory().getItem(i) == null || player.getInventory().getItem(i).getType() == Material.AIR)
|
||||||
|
player.getInventory().setItem(i, ItemStackFactory.Instance.CreateStack(Material.WOOL, _color));
|
||||||
}
|
}
|
||||||
//Countdown
|
//Countdown
|
||||||
else if (_state == 1)
|
else if (_state == 1)
|
||||||
|
@ -32,8 +32,8 @@ public class CaveGiant
|
|||||||
Host.Host.CreatureAllowOverride = false;
|
Host.Host.CreatureAllowOverride = false;
|
||||||
UtilEnt.Vegetate(_ent);
|
UtilEnt.Vegetate(_ent);
|
||||||
|
|
||||||
_ent.setMaxHealth(200);
|
_ent.setMaxHealth(300);
|
||||||
_ent.setHealth(200);
|
_ent.setHealth(300);
|
||||||
|
|
||||||
_tpLoc = _ent.getLocation();
|
_tpLoc = _ent.getLocation();
|
||||||
|
|
||||||
|
@ -1,17 +1,18 @@
|
|||||||
package nautilus.game.arcade.game.games.christmas.content;
|
package nautilus.game.arcade.game.games.christmas.content;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collections;
|
||||||
import mineplex.core.common.util.UtilAlg;
|
import java.util.Comparator;
|
||||||
import mineplex.core.common.util.UtilBlock;
|
|
||||||
import mineplex.core.common.util.UtilMath;
|
|
||||||
import mineplex.core.common.util.UtilWorld;
|
|
||||||
import nautilus.game.arcade.game.games.christmas.Christmas;
|
|
||||||
|
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.block.Block;
|
import org.bukkit.block.Block;
|
||||||
|
|
||||||
|
import mineplex.core.common.util.UtilAlg;
|
||||||
|
import mineplex.core.common.util.UtilBlock;
|
||||||
|
import mineplex.core.common.util.UtilMath;
|
||||||
|
import nautilus.game.arcade.game.games.christmas.Christmas;
|
||||||
|
|
||||||
public class IceMaze
|
public class IceMaze
|
||||||
{
|
{
|
||||||
private Christmas Host;
|
private Christmas Host;
|
||||||
@ -22,6 +23,18 @@ public class IceMaze
|
|||||||
|
|
||||||
private Location _present;
|
private Location _present;
|
||||||
|
|
||||||
|
private Comparator<Block> _heightComparator = new Comparator<Block>()
|
||||||
|
{
|
||||||
|
@Override
|
||||||
|
public int compare(Block o1, Block o2)
|
||||||
|
{
|
||||||
|
if (o1.getLocation().getBlockY() == o2.getLocation().getBlockY())
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
return o1.getLocation().getBlockY() > o2.getLocation().getBlockY() ? 1 : -1;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
public IceMaze(Christmas host, ArrayList<Location> mazeCorners, ArrayList<Location> mazeExits, Location[] presents)
|
public IceMaze(Christmas host, ArrayList<Location> mazeCorners, ArrayList<Location> mazeExits, Location[] presents)
|
||||||
{
|
{
|
||||||
Host = host;
|
Host = host;
|
||||||
@ -71,6 +84,8 @@ public class IceMaze
|
|||||||
if (_blocks.isEmpty())
|
if (_blocks.isEmpty())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
Collections.sort(_blocks, _heightComparator);
|
||||||
|
|
||||||
for (int i=0 ; i<20 ; i++)
|
for (int i=0 ; i<20 ; i++)
|
||||||
{
|
{
|
||||||
if (_blocks.isEmpty())
|
if (_blocks.isEmpty())
|
||||||
|
@ -1,17 +1,15 @@
|
|||||||
package nautilus.game.arcade.game.games.christmas.content;
|
package nautilus.game.arcade.game.games.christmas.content;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import org.bukkit.Effect;
|
import org.bukkit.Effect;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.craftbukkit.v1_8_R3.entity.CraftCreature;
|
import org.bukkit.craftbukkit.v1_8_R3.entity.CraftCreature;
|
||||||
import org.bukkit.entity.Creature;
|
|
||||||
import org.bukkit.entity.Entity;
|
import org.bukkit.entity.Entity;
|
||||||
import org.bukkit.entity.IronGolem;
|
import org.bukkit.entity.IronGolem;
|
||||||
import org.bukkit.entity.LivingEntity;
|
import org.bukkit.entity.LivingEntity;
|
||||||
import org.bukkit.entity.IronGolem;
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.entity.Slime;
|
|
||||||
import org.bukkit.entity.Snowball;
|
import org.bukkit.entity.Snowball;
|
||||||
import org.bukkit.entity.Snowman;
|
import org.bukkit.entity.Snowman;
|
||||||
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
|
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
|
||||||
@ -51,8 +49,8 @@ public class SnowmanBoss
|
|||||||
_minions.add(new SnowmanMinion(_spawn.getWorld().spawn(_spawn, Snowman.class)));
|
_minions.add(new SnowmanMinion(_spawn.getWorld().spawn(_spawn, Snowman.class)));
|
||||||
|
|
||||||
_heart = _spawn.getWorld().spawn(_spawn, IronGolem.class);
|
_heart = _spawn.getWorld().spawn(_spawn, IronGolem.class);
|
||||||
_heart.setMaxHealth(1000);
|
_heart.setMaxHealth(1400);
|
||||||
_heart.setHealth(1000);
|
_heart.setHealth(1400);
|
||||||
UtilEnt.Vegetate(_heart);
|
UtilEnt.Vegetate(_heart);
|
||||||
|
|
||||||
Host.CreatureAllowOverride = false;
|
Host.CreatureAllowOverride = false;
|
||||||
@ -147,7 +145,17 @@ public class SnowmanBoss
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
if ((minion.Target == null || !minion.Target.isValid() || !Host.IsAlive(minion.Target)) && !Host.GetPlayers(true).isEmpty())
|
if ((minion.Target == null || !minion.Target.isValid() || !Host.IsAlive(minion.Target)) && !Host.GetPlayers(true).isEmpty())
|
||||||
minion.Target = UtilAlg.Random(Host.GetPlayers(true));
|
{
|
||||||
|
List<Player> valid = new ArrayList<Player>();
|
||||||
|
for (Player player : Host.GetPlayers(true))
|
||||||
|
if (UtilMath.offset(player, minion.Ent) <= 25 && player.getLocation().getBlockY() >= minion.Ent.getLocation().getBlockY())
|
||||||
|
valid.add(player);
|
||||||
|
|
||||||
|
minion.Target = UtilAlg.Random(valid);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (minion.Target == null)
|
||||||
|
continue;
|
||||||
|
|
||||||
//Move
|
//Move
|
||||||
UtilEnt.CreatureMoveFast(minion.Ent, minion.Target.getLocation(), 1.6f);
|
UtilEnt.CreatureMoveFast(minion.Ent, minion.Target.getLocation(), 1.6f);
|
||||||
|
@ -6,17 +6,6 @@ import java.util.HashSet;
|
|||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.Map.Entry;
|
import java.util.Map.Entry;
|
||||||
|
|
||||||
import mineplex.core.common.util.F;
|
|
||||||
import mineplex.core.common.util.UtilAction;
|
|
||||||
import mineplex.core.common.util.UtilAlg;
|
|
||||||
import mineplex.core.common.util.UtilEnt;
|
|
||||||
import mineplex.core.common.util.UtilMath;
|
|
||||||
import mineplex.core.common.util.UtilPlayer;
|
|
||||||
import mineplex.core.common.util.UtilTime;
|
|
||||||
import mineplex.core.common.util.UtilWorld;
|
|
||||||
import mineplex.core.recharge.Recharge;
|
|
||||||
import nautilus.game.arcade.game.games.christmas.Christmas;
|
|
||||||
|
|
||||||
import org.bukkit.Effect;
|
import org.bukkit.Effect;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
@ -28,6 +17,16 @@ import org.bukkit.entity.Snowman;
|
|||||||
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
|
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
|
||||||
import org.bukkit.util.Vector;
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
|
import mineplex.core.common.util.F;
|
||||||
|
import mineplex.core.common.util.UtilAction;
|
||||||
|
import mineplex.core.common.util.UtilAlg;
|
||||||
|
import mineplex.core.common.util.UtilEnt;
|
||||||
|
import mineplex.core.common.util.UtilMath;
|
||||||
|
import mineplex.core.common.util.UtilPlayer;
|
||||||
|
import mineplex.core.recharge.Recharge;
|
||||||
|
import nautilus.game.arcade.game.games.christmas.Christmas;
|
||||||
|
import nautilus.game.arcade.game.games.christmas.content.SnowmanWaypoint.CardinalDirection;
|
||||||
|
|
||||||
public class SnowmanMaze
|
public class SnowmanMaze
|
||||||
{
|
{
|
||||||
private Christmas Host;
|
private Christmas Host;
|
||||||
@ -163,48 +162,90 @@ public class SnowmanMaze
|
|||||||
if (south != null) nextBlock.add(south);
|
if (south != null) nextBlock.add(south);
|
||||||
if (east != null) nextBlock.add(east);
|
if (east != null) nextBlock.add(east);
|
||||||
if (west != null) nextBlock.add(west);
|
if (west != null) nextBlock.add(west);
|
||||||
|
|
||||||
//Random Direction
|
if(nextBlock.isEmpty())
|
||||||
if (!nextBlock.isEmpty())
|
|
||||||
{
|
{
|
||||||
data.getValue().Target = UtilAlg.Random(nextBlock).getLocation().add(0.5, 0, 0.5);
|
entIterator.remove();
|
||||||
UtilEnt.CreatureMove(data.getKey(), data.getValue().Target, 1.4f);
|
data.getKey().remove();
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(nextBlock.size() > 1 && data.getValue().Direction != CardinalDirection.NULL) // they can do a uturn if they're stuck
|
||||||
|
{
|
||||||
|
if(data.getValue().Direction == CardinalDirection.NORTH)
|
||||||
|
{
|
||||||
|
nextBlock.remove(south);
|
||||||
|
}
|
||||||
|
else if(data.getValue().Direction == CardinalDirection.SOUTH)
|
||||||
|
{
|
||||||
|
nextBlock.remove(north);
|
||||||
|
}
|
||||||
|
else if(data.getValue().Direction == CardinalDirection.WEST)
|
||||||
|
{
|
||||||
|
nextBlock.remove(east);
|
||||||
|
}
|
||||||
|
else if(data.getValue().Direction == CardinalDirection.EAST)
|
||||||
|
{
|
||||||
|
nextBlock.remove(west);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (nextBlock.isEmpty())
|
||||||
|
{
|
||||||
|
entIterator.remove();
|
||||||
|
data.getKey().remove();
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
//Random Direction
|
||||||
|
Location nextLoc = UtilAlg.Random(nextBlock).getLocation();
|
||||||
|
data.getValue().Target = nextLoc.clone().add(0.5, 0, 0.5);
|
||||||
|
if(north != null && nextLoc.equals(north.getLocation()))
|
||||||
|
{
|
||||||
|
data.getValue().Direction = CardinalDirection.NORTH;
|
||||||
|
}
|
||||||
|
else if(south != null && nextLoc.equals(south.getLocation()))
|
||||||
|
{
|
||||||
|
data.getValue().Direction = CardinalDirection.SOUTH;
|
||||||
|
}
|
||||||
|
else if(east != null && nextLoc.equals(east.getLocation()))
|
||||||
|
{
|
||||||
|
data.getValue().Direction = CardinalDirection.EAST;
|
||||||
|
}
|
||||||
|
else if(west != null && nextLoc.equals(west.getLocation()))
|
||||||
|
{
|
||||||
|
data.getValue().Direction = CardinalDirection.WEST;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//Timeout Move
|
UtilEnt.CreatureMoveFast(data.getKey(), data.getValue().Target, 1.4f);
|
||||||
if (UtilMath.offset(data.getKey().getLocation(), data.getValue().Last) > 0.1)
|
|
||||||
data.getValue().Time = System.currentTimeMillis();
|
|
||||||
|
|
||||||
if (UtilTime.elapsed(data.getValue().Time, 2000))
|
|
||||||
UtilEnt.CreatureMove(data.getKey(), data.getValue().Target, 1.4f);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private Block getTarget(Block start, Block cur, BlockFace face)
|
private Block getTarget(Block start, Block cur, BlockFace face)
|
||||||
{
|
{
|
||||||
if (cur == null)
|
if (cur == null)
|
||||||
cur = start;
|
cur = start;
|
||||||
|
|
||||||
while (_waypoints.contains(cur.getRelative(face)))
|
while (_waypoints.contains(cur.getRelative(face)))
|
||||||
{
|
{
|
||||||
cur = cur.getRelative(face);
|
cur = cur.getRelative(face);
|
||||||
|
|
||||||
//Stop at intersection
|
//Stop at intersection
|
||||||
int count = 0;
|
int count = 0;
|
||||||
|
|
||||||
if (face != BlockFace.NORTH && _waypoints.contains(cur.getRelative(BlockFace.NORTH))) count++;
|
if (face != BlockFace.NORTH && _waypoints.contains(cur.getRelative(BlockFace.NORTH))) count++;
|
||||||
if (face != BlockFace.SOUTH && _waypoints.contains(cur.getRelative(BlockFace.SOUTH))) count++;
|
if (face != BlockFace.SOUTH && _waypoints.contains(cur.getRelative(BlockFace.SOUTH))) count++;
|
||||||
if (face != BlockFace.EAST && _waypoints.contains(cur.getRelative(BlockFace.EAST))) count++;
|
if (face != BlockFace.EAST && _waypoints.contains(cur.getRelative(BlockFace.EAST))) count++;
|
||||||
if (face != BlockFace.WEST && _waypoints.contains(cur.getRelative(BlockFace.WEST))) count++;
|
if (face != BlockFace.WEST && _waypoints.contains(cur.getRelative(BlockFace.WEST))) count++;
|
||||||
|
|
||||||
if (count > 1)
|
if (count > 1)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cur.equals(start))
|
if (cur.equals(start))
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
return cur;
|
return cur;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -213,7 +254,7 @@ public class SnowmanMaze
|
|||||||
//Spawn
|
//Spawn
|
||||||
if (!Host.GetSleigh().HasPresent(_present))
|
if (!Host.GetSleigh().HasPresent(_present))
|
||||||
{
|
{
|
||||||
while (_ents.size() < 36)
|
while (_ents.size() < 44)
|
||||||
{
|
{
|
||||||
Location loc = UtilAlg.Random(_spawns);
|
Location loc = UtilAlg.Random(_spawns);
|
||||||
|
|
||||||
|
@ -6,6 +6,7 @@ public class SnowmanWaypoint
|
|||||||
{
|
{
|
||||||
public Location Last;
|
public Location Last;
|
||||||
public Location Target;
|
public Location Target;
|
||||||
|
public CardinalDirection Direction = CardinalDirection.NULL;
|
||||||
public long Time;
|
public long Time;
|
||||||
|
|
||||||
public SnowmanWaypoint(Location last)
|
public SnowmanWaypoint(Location last)
|
||||||
@ -14,4 +15,9 @@ public class SnowmanWaypoint
|
|||||||
Target = null;
|
Target = null;
|
||||||
Time = System.currentTimeMillis();
|
Time = System.currentTimeMillis();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static enum CardinalDirection
|
||||||
|
{
|
||||||
|
NORTH, SOUTH, EAST, WEST, NULL // such order much not care
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,12 +1,15 @@
|
|||||||
package nautilus.game.arcade.game.games.christmas.kits;
|
package nautilus.game.arcade.game.games.christmas.kits;
|
||||||
|
|
||||||
|
import org.bukkit.Color;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.enchantments.Enchantment;
|
import org.bukkit.enchantments.Enchantment;
|
||||||
import org.bukkit.entity.EntityType;
|
import org.bukkit.entity.EntityType;
|
||||||
|
import org.bukkit.entity.LivingEntity;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
import mineplex.core.common.util.C;
|
import mineplex.core.common.util.C;
|
||||||
|
import mineplex.core.itemstack.ItemBuilder;
|
||||||
import mineplex.core.itemstack.ItemStackFactory;
|
import mineplex.core.itemstack.ItemStackFactory;
|
||||||
import nautilus.game.arcade.ArcadeManager;
|
import nautilus.game.arcade.ArcadeManager;
|
||||||
import nautilus.game.arcade.kit.Kit;
|
import nautilus.game.arcade.kit.Kit;
|
||||||
@ -21,15 +24,23 @@ public class KitPlayer extends Kit
|
|||||||
|
|
||||||
new String[]
|
new String[]
|
||||||
{
|
{
|
||||||
"Help Santa retreive the lost presents!"
|
"Help Santa retrieve the lost presents!"
|
||||||
},
|
},
|
||||||
|
|
||||||
new Perk[]
|
new Perk[]
|
||||||
{
|
{
|
||||||
},
|
},
|
||||||
EntityType.ZOMBIE,
|
EntityType.SKELETON,
|
||||||
new ItemStack(Material.IRON_SWORD));
|
new ItemStack(Material.IRON_SWORD));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void SpawnCustom(LivingEntity ent)
|
||||||
|
{
|
||||||
|
ent.getEquipment().setHelmet(new ItemBuilder(Material.LEATHER_HELMET).setColor(Color.RED).setUnbreakable(true).build());
|
||||||
|
ent.getEquipment().setChestplate(new ItemBuilder(Material.LEATHER_CHESTPLATE).setColor(Color.RED).build());
|
||||||
|
ent.getEquipment().setLeggings(new ItemBuilder(Material.LEATHER_LEGGINGS).setColor(Color.RED).build());
|
||||||
|
ent.getEquipment().setBoots(new ItemBuilder(Material.LEATHER_BOOTS).setColor(Color.BLACK).build());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -43,7 +54,7 @@ public class KitPlayer extends Kit
|
|||||||
item = ItemStackFactory.Instance.CreateStack(Material.BOW, (byte)0, 1, C.cGreen + C.Bold + "Toy Bow");
|
item = ItemStackFactory.Instance.CreateStack(Material.BOW, (byte)0, 1, C.cGreen + C.Bold + "Toy Bow");
|
||||||
item.addEnchantment(Enchantment.ARROW_INFINITE, 1);
|
item.addEnchantment(Enchantment.ARROW_INFINITE, 1);
|
||||||
player.getInventory().setItem(1, item);
|
player.getInventory().setItem(1, item);
|
||||||
player.getInventory().setItem(28, ItemStackFactory.Instance.CreateStack(Material.ARROW));
|
player.getInventory().setItem(9, ItemStackFactory.Instance.CreateStack(Material.ARROW));
|
||||||
|
|
||||||
//Axe
|
//Axe
|
||||||
item = ItemStackFactory.Instance.CreateStack(Material.STONE_PICKAXE, (byte)0, 1, C.cGreen + C.Bold + "Coal Digger");
|
item = ItemStackFactory.Instance.CreateStack(Material.STONE_PICKAXE, (byte)0, 1, C.cGreen + C.Bold + "Coal Digger");
|
||||||
|
@ -1,35 +1,42 @@
|
|||||||
package nautilus.game.arcade.game.games.christmas.parts;
|
package nautilus.game.arcade.game.games.christmas.parts;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
|
|
||||||
|
import org.bukkit.Location;
|
||||||
|
import org.bukkit.Material;
|
||||||
|
import org.bukkit.block.BlockFace;
|
||||||
|
import org.bukkit.craftbukkit.v1_8_R3.entity.CraftCreature;
|
||||||
|
import org.bukkit.entity.Ageable;
|
||||||
|
import org.bukkit.entity.ArmorStand;
|
||||||
|
import org.bukkit.entity.Creature;
|
||||||
|
import org.bukkit.entity.Entity;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.EventHandler;
|
||||||
|
import org.bukkit.event.EventPriority;
|
||||||
|
import org.bukkit.event.HandlerList;
|
||||||
|
import org.bukkit.event.Listener;
|
||||||
|
import org.bukkit.event.entity.EntityDamageEvent;
|
||||||
|
import org.bukkit.event.player.PlayerInteractAtEntityEvent;
|
||||||
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
import org.bukkit.inventory.meta.SkullMeta;
|
||||||
|
|
||||||
import mineplex.core.common.util.C;
|
import mineplex.core.common.util.C;
|
||||||
|
import mineplex.core.common.util.NautHashMap;
|
||||||
import mineplex.core.common.util.UtilAlg;
|
import mineplex.core.common.util.UtilAlg;
|
||||||
import mineplex.core.common.util.UtilMath;
|
import mineplex.core.common.util.UtilMath;
|
||||||
|
import mineplex.core.common.util.UtilParticle;
|
||||||
|
import mineplex.core.common.util.UtilParticle.ParticleType;
|
||||||
|
import mineplex.core.common.util.UtilParticle.ViewDist;
|
||||||
import mineplex.core.common.util.UtilServer;
|
import mineplex.core.common.util.UtilServer;
|
||||||
import mineplex.core.common.util.UtilTextTop;
|
import mineplex.core.common.util.UtilTextTop;
|
||||||
|
import mineplex.core.itemstack.ItemStackFactory;
|
||||||
import mineplex.core.updater.UpdateType;
|
import mineplex.core.updater.UpdateType;
|
||||||
import mineplex.core.updater.event.UpdateEvent;
|
import mineplex.core.updater.event.UpdateEvent;
|
||||||
import nautilus.game.arcade.game.games.christmas.Christmas;
|
import nautilus.game.arcade.game.games.christmas.Christmas;
|
||||||
import nautilus.game.arcade.game.games.christmas.ChristmasAudio;
|
import nautilus.game.arcade.game.games.christmas.ChristmasAudio;
|
||||||
import net.minecraft.server.v1_8_R3.EntityCreature;
|
import net.minecraft.server.v1_8_R3.EntityCreature;
|
||||||
|
|
||||||
import org.bukkit.Location;
|
|
||||||
import org.bukkit.Material;
|
|
||||||
import org.bukkit.SkullType;
|
|
||||||
import org.bukkit.block.Block;
|
|
||||||
import org.bukkit.block.BlockFace;
|
|
||||||
import org.bukkit.block.Skull;
|
|
||||||
import org.bukkit.craftbukkit.v1_8_R3.entity.CraftCreature;
|
|
||||||
import org.bukkit.entity.Ageable;
|
|
||||||
import org.bukkit.entity.Creature;
|
|
||||||
import org.bukkit.entity.Player;
|
|
||||||
import org.bukkit.event.EventHandler;
|
|
||||||
import org.bukkit.event.HandlerList;
|
|
||||||
import org.bukkit.event.Listener;
|
|
||||||
import org.bukkit.event.player.PlayerInteractEvent;
|
|
||||||
|
|
||||||
public abstract class Part implements Listener
|
public abstract class Part implements Listener
|
||||||
{
|
{
|
||||||
public Christmas Host;
|
public Christmas Host;
|
||||||
@ -42,6 +49,7 @@ public abstract class Part implements Listener
|
|||||||
protected double _objectiveHealth = 1;
|
protected double _objectiveHealth = 1;
|
||||||
|
|
||||||
protected HashMap<Creature, Player> _creatures = new HashMap<Creature, Player>();
|
protected HashMap<Creature, Player> _creatures = new HashMap<Creature, Player>();
|
||||||
|
protected NautHashMap<Entity, Location> _spawnedPresents = new NautHashMap<Entity, Location>();
|
||||||
|
|
||||||
public Part(Christmas host, Location sleigh, Location[] presents)
|
public Part(Christmas host, Location sleigh, Location[] presents)
|
||||||
{
|
{
|
||||||
@ -53,38 +61,63 @@ public abstract class Part implements Listener
|
|||||||
loc.getBlock().setType(Material.AIR);
|
loc.getBlock().setType(Material.AIR);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
public void Prepare()
|
public void Prepare()
|
||||||
{
|
{
|
||||||
Activate();
|
Activate();
|
||||||
|
|
||||||
for (Location loc : _presents)
|
for (Location loc : _presents)
|
||||||
{
|
{
|
||||||
Block present = loc.getBlock();
|
Location standLoc = loc.clone().add(0, -1.45, 0);
|
||||||
present.setTypeIdAndData(Material.SKULL.getId(), (byte)1, true);
|
standLoc.setYaw(UtilMath.r(100));
|
||||||
|
|
||||||
Skull skull = (Skull) present.getState();
|
|
||||||
skull.setSkullType(SkullType.PLAYER);
|
|
||||||
|
|
||||||
//Present Type
|
Host.CreatureAllowOverride = true;
|
||||||
double r = Math.random();
|
ArmorStand stand = loc.getWorld().spawn(standLoc, ArmorStand.class);
|
||||||
if (r > 0.75) skull.setOwner("CruXXx");
|
Host.CreatureAllowOverride = false;
|
||||||
else if (r > 0.5) skull.setOwner("CruXXx");
|
|
||||||
else if (r > 0.25) skull.setOwner("CruXXx");
|
|
||||||
else skull.setOwner("CruXXx");
|
|
||||||
|
|
||||||
//Angle
|
stand.setVisible(false);
|
||||||
BlockFace face = BlockFace.UP;
|
stand.setGravity(false);
|
||||||
while (face == BlockFace.UP || face == BlockFace.DOWN || face == BlockFace.SELF)
|
|
||||||
face = BlockFace.values()[UtilMath.r(BlockFace.values().length)];
|
ItemStack stack = ItemStackFactory.Instance.CreateStack(Material.SKULL_ITEM, (byte) 3);
|
||||||
skull.setRotation(face);
|
SkullMeta meta = (SkullMeta) stack.getItemMeta();
|
||||||
|
meta.setOwner("CruXXx");
|
||||||
skull.update();
|
stack.setItemMeta(meta);
|
||||||
|
|
||||||
|
stand.setHelmet(stack);
|
||||||
|
//
|
||||||
|
// present.setTypeIdAndData(Material.SKULL.getId(), (byte)1, true);
|
||||||
|
//
|
||||||
|
// Skull skull = (Skull) present.getState();
|
||||||
|
// skull.setSkullType(SkullType.PLAYER);
|
||||||
|
//
|
||||||
|
// //Present Type
|
||||||
|
// double r = Math.random();
|
||||||
|
// if (r > 0.75) skull.setOwner("CruXXx");
|
||||||
|
// else if (r > 0.5) skull.setOwner("CruXXx");
|
||||||
|
// else if (r > 0.25) skull.setOwner("CruXXx");
|
||||||
|
// else skull.setOwner("CruXXx");
|
||||||
|
//
|
||||||
|
// //Angle
|
||||||
|
// BlockFace face = BlockFace.UP;
|
||||||
|
// while (face == BlockFace.UP || face == BlockFace.DOWN || face == BlockFace.SELF)
|
||||||
|
// face = BlockFace.values()[UtilMath.r(BlockFace.values().length)];
|
||||||
|
// skull.setRotation(face);
|
||||||
|
//
|
||||||
|
// skull.update();
|
||||||
|
|
||||||
|
_spawnedPresents.put(stand, loc);
|
||||||
|
|
||||||
//Beacon
|
//Beacon
|
||||||
present.getRelative(BlockFace.DOWN).setType(Material.BEACON);
|
|
||||||
for (int x=-1 ; x<=1 ; x++)
|
for (int x=-1 ; x<=1 ; x++)
|
||||||
for (int z=-1 ; z<=1 ; z++)
|
for (int z=-1 ; z<=1 ; z++)
|
||||||
present.getRelative(x, -2, z).setType(Material.IRON_BLOCK);
|
{
|
||||||
|
loc.getBlock().getRelative(x, -2, z).setType(Material.IRON_BLOCK);
|
||||||
|
loc.getBlock().getRelative(x, -3, z).setType(Material.IRON_BLOCK);
|
||||||
|
}
|
||||||
|
|
||||||
|
loc.getBlock().getRelative(BlockFace.DOWN).getRelative(BlockFace.DOWN).setType(Material.BEACON);
|
||||||
|
loc.getBlock().getRelative(BlockFace.DOWN).setType(Material.STAINED_GLASS);
|
||||||
|
loc.getBlock().getRelative(BlockFace.DOWN).setData(UtilMath.randomElement(new Byte[]{14, 5, 13}));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -157,35 +190,38 @@ public abstract class Part implements Listener
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler(priority = EventPriority.LOW, ignoreCancelled = false)
|
||||||
public void PresentCollect(PlayerInteractEvent event)
|
public void PresentCollect(PlayerInteractAtEntityEvent event)
|
||||||
{
|
{
|
||||||
if (event.getClickedBlock() == null)
|
Location present = _spawnedPresents.get(event.getRightClicked());
|
||||||
|
if (present == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
boolean contains = false;
|
boolean contains = false;
|
||||||
for (Location loc : _presents)
|
for (Location loc : _presents)
|
||||||
if (loc.getBlock().equals(event.getClickedBlock()))
|
if (loc.getBlock().equals(present.getBlock()))
|
||||||
contains = true;
|
contains = true;
|
||||||
|
|
||||||
if (!contains)
|
if (!contains)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
event.setCancelled(true);
|
|
||||||
|
|
||||||
if (!Host.IsLive())
|
if (!Host.IsLive())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!Host.IsAlive(event.getPlayer()))
|
if (!Host.IsAlive(event.getPlayer()))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (Host.GetSleigh().HasPresent(event.getClickedBlock().getLocation()))
|
if (Host.GetSleigh().HasPresent(present.getBlock().getLocation()))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (UtilMath.offset(event.getPlayer().getLocation(), event.getClickedBlock().getLocation().add(0.5, 0.5, 0.5)) > 2)
|
if (UtilMath.offset(event.getPlayer().getLocation(), present.clone().add(0.5, 0.5, 0.5)) > 2)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Host.GetSleigh().AddPresent(event.getClickedBlock().getLocation());
|
_spawnedPresents.remove(event.getRightClicked());
|
||||||
|
|
||||||
|
event.getRightClicked().remove();
|
||||||
|
|
||||||
|
Host.GetSleigh().AddPresent(present.getBlock().getLocation());
|
||||||
|
|
||||||
Host.SantaSay("Well done " + event.getPlayer().getName() + "! You collected a present!", null);
|
Host.SantaSay("Well done " + event.getPlayer().getName() + "! You collected a present!", null);
|
||||||
}
|
}
|
||||||
@ -276,4 +312,21 @@ public abstract class Part implements Listener
|
|||||||
_creatures.clear();
|
_creatures.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void onDamagePresent(EntityDamageEvent event)
|
||||||
|
{
|
||||||
|
event.setCancelled(_spawnedPresents.containsKey(event.getEntity()));
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void PresentParticles(UpdateEvent event)
|
||||||
|
{
|
||||||
|
if (event.getType() != UpdateType.FAST)
|
||||||
|
return;
|
||||||
|
|
||||||
|
for (Entity ent : _spawnedPresents.keySet())
|
||||||
|
{
|
||||||
|
UtilParticle.PlayParticle(ParticleType.HAPPY_VILLAGER, ent.getLocation().clone().add(0, 1.5, 0), .3F, .3F, .3F, 0F, 1, ViewDist.LONG, UtilServer.getPlayers());
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,41 +1,33 @@
|
|||||||
package nautilus.game.arcade.game.games.christmas.parts;
|
package nautilus.game.arcade.game.games.christmas.parts;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
|
|
||||||
import mineplex.core.common.util.UtilAlg;
|
|
||||||
import mineplex.core.common.util.UtilEnt;
|
|
||||||
import mineplex.core.common.util.UtilMath;
|
|
||||||
import mineplex.core.common.util.UtilParticle;
|
|
||||||
import mineplex.core.common.util.UtilServer;
|
|
||||||
import mineplex.core.common.util.UtilTime;
|
|
||||||
import mineplex.core.common.util.UtilParticle.ParticleType;
|
|
||||||
import mineplex.core.common.util.UtilParticle.ViewDist;
|
|
||||||
import mineplex.core.updater.UpdateType;
|
|
||||||
import mineplex.core.updater.event.UpdateEvent;
|
|
||||||
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
|
|
||||||
import nautilus.game.arcade.events.GameStateChangeEvent;
|
|
||||||
import nautilus.game.arcade.game.Game.GameState;
|
|
||||||
import nautilus.game.arcade.game.games.christmas.Christmas;
|
|
||||||
import nautilus.game.arcade.game.games.christmas.ChristmasAudio;
|
|
||||||
|
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.Sound;
|
import org.bukkit.Sound;
|
||||||
import org.bukkit.block.Block;
|
import org.bukkit.block.Block;
|
||||||
import org.bukkit.block.BlockFace;
|
import org.bukkit.block.BlockFace;
|
||||||
import org.bukkit.entity.Entity;
|
|
||||||
import org.bukkit.entity.Player;
|
|
||||||
import org.bukkit.entity.Skeleton;
|
import org.bukkit.entity.Skeleton;
|
||||||
import org.bukkit.entity.TNTPrimed;
|
import org.bukkit.entity.TNTPrimed;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.event.EventPriority;
|
import org.bukkit.event.EventPriority;
|
||||||
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
|
|
||||||
import org.bukkit.event.entity.EntityExplodeEvent;
|
import org.bukkit.event.entity.EntityExplodeEvent;
|
||||||
import org.bukkit.event.entity.ExplosionPrimeEvent;
|
import org.bukkit.event.entity.ExplosionPrimeEvent;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
|
import mineplex.core.common.util.UtilAlg;
|
||||||
|
import mineplex.core.common.util.UtilMath;
|
||||||
|
import mineplex.core.common.util.UtilParticle;
|
||||||
|
import mineplex.core.common.util.UtilParticle.ParticleType;
|
||||||
|
import mineplex.core.common.util.UtilParticle.ViewDist;
|
||||||
|
import mineplex.core.common.util.UtilServer;
|
||||||
|
import mineplex.core.common.util.UtilTime;
|
||||||
|
import mineplex.core.updater.UpdateType;
|
||||||
|
import mineplex.core.updater.event.UpdateEvent;
|
||||||
|
import nautilus.game.arcade.game.games.christmas.Christmas;
|
||||||
|
import nautilus.game.arcade.game.games.christmas.ChristmasAudio;
|
||||||
|
|
||||||
public class Part1 extends Part
|
public class Part1 extends Part
|
||||||
{
|
{
|
||||||
private ArrayList<Location> _skeletons;
|
private ArrayList<Location> _skeletons;
|
||||||
@ -145,7 +137,7 @@ public class Part1 extends Part
|
|||||||
|
|
||||||
_presents = System.currentTimeMillis();
|
_presents = System.currentTimeMillis();
|
||||||
|
|
||||||
Host.SantaSay("Theres some of the presents up ahead!", ChristmasAudio.P1_B);
|
Host.SantaSay("There are some of the presents up ahead!", ChristmasAudio.P1_B);
|
||||||
SetObjectivePresents();
|
SetObjectivePresents();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -189,7 +181,7 @@ public class Part1 extends Part
|
|||||||
}
|
}
|
||||||
|
|
||||||
Host.SantaSay("Clear the path! Watch out for the undead!", ChristmasAudio.P1_D);
|
Host.SantaSay("Clear the path! Watch out for the undead!", ChristmasAudio.P1_D);
|
||||||
SetObjectiveText("Clear a path for Santas Sleigh!", 1);
|
SetObjectiveText("Clear a path for Santa's Sleigh!", 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void UpdateClear()
|
private void UpdateClear()
|
||||||
|
@ -3,10 +3,22 @@ package nautilus.game.arcade.game.games.christmas.parts;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
|
|
||||||
|
import org.bukkit.Effect;
|
||||||
|
import org.bukkit.Location;
|
||||||
|
import org.bukkit.Material;
|
||||||
|
import org.bukkit.Sound;
|
||||||
|
import org.bukkit.entity.FallingBlock;
|
||||||
|
import org.bukkit.entity.Giant;
|
||||||
|
import org.bukkit.entity.Zombie;
|
||||||
|
import org.bukkit.event.EventHandler;
|
||||||
|
import org.bukkit.event.EventPriority;
|
||||||
|
import org.bukkit.event.entity.EntityChangeBlockEvent;
|
||||||
|
import org.bukkit.event.player.PlayerInteractEvent;
|
||||||
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
import mineplex.core.common.util.C;
|
import mineplex.core.common.util.C;
|
||||||
import mineplex.core.common.util.UtilAlg;
|
import mineplex.core.common.util.UtilAlg;
|
||||||
import mineplex.core.common.util.UtilMath;
|
import mineplex.core.common.util.UtilMath;
|
||||||
import mineplex.core.common.util.UtilPlayer;
|
|
||||||
import mineplex.core.hologram.Hologram;
|
import mineplex.core.hologram.Hologram;
|
||||||
import mineplex.core.hologram.HologramManager;
|
import mineplex.core.hologram.HologramManager;
|
||||||
import mineplex.core.updater.UpdateType;
|
import mineplex.core.updater.UpdateType;
|
||||||
@ -17,24 +29,6 @@ import nautilus.game.arcade.game.games.christmas.ChristmasAudio;
|
|||||||
import nautilus.game.arcade.game.games.christmas.content.CaveGiant;
|
import nautilus.game.arcade.game.games.christmas.content.CaveGiant;
|
||||||
import nautilus.game.arcade.game.games.christmas.content.Snake;
|
import nautilus.game.arcade.game.games.christmas.content.Snake;
|
||||||
|
|
||||||
import org.bukkit.ChatColor;
|
|
||||||
import org.bukkit.Effect;
|
|
||||||
import org.bukkit.Location;
|
|
||||||
import org.bukkit.Material;
|
|
||||||
import org.bukkit.Sound;
|
|
||||||
import org.bukkit.block.Block;
|
|
||||||
import org.bukkit.block.BlockFace;
|
|
||||||
import org.bukkit.entity.FallingBlock;
|
|
||||||
import org.bukkit.entity.Giant;
|
|
||||||
import org.bukkit.entity.Spider;
|
|
||||||
import org.bukkit.entity.Zombie;
|
|
||||||
import org.bukkit.event.EventHandler;
|
|
||||||
import org.bukkit.event.EventPriority;
|
|
||||||
import org.bukkit.event.entity.EntityChangeBlockEvent;
|
|
||||||
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
|
|
||||||
import org.bukkit.event.player.PlayerInteractEvent;
|
|
||||||
import org.bukkit.inventory.ItemStack;
|
|
||||||
|
|
||||||
public class Part4 extends Part
|
public class Part4 extends Part
|
||||||
{
|
{
|
||||||
private ArrayList<Location> _roofIce;
|
private ArrayList<Location> _roofIce;
|
||||||
@ -51,6 +45,13 @@ public class Part4 extends Part
|
|||||||
private boolean _b = false;
|
private boolean _b = false;
|
||||||
private HologramManager _holoManager;
|
private HologramManager _holoManager;
|
||||||
|
|
||||||
|
private String[] _evilElfNames = new String[]
|
||||||
|
{ "Bing", "Bling", "Blitz", "Larry", "Buddy", "Buster", "Cedar", "Dash", "Eggnog", "Elfie", "Elm", "Elvis",
|
||||||
|
"Evergreen", "Figgy", "Flake", "Frank", "Frost", "Gabriel", "George", "Henry", "Hermey", "Ice", "Jangle",
|
||||||
|
"Jingle", "Jinx", "Kringle", "Kris", "Louie", "Max", "Mistletoe", "Nat", "Nick", "Noel", "Pax", "Peppermin",
|
||||||
|
"Pine", "Ralphie", "Rudy", "Snow", "Snowball", "Star", "Tinsel", "Tiny", "Topper", "Trinket", "Wayne",
|
||||||
|
"Wink", "Yule", "Zippy" };
|
||||||
|
|
||||||
public Part4(HologramManager holoManager, Christmas host, Location sleigh, Location[] presents, ArrayList<Location> roofIce, ArrayList<Location> mobs,
|
public Part4(HologramManager holoManager, Christmas host, Location sleigh, Location[] presents, ArrayList<Location> roofIce, ArrayList<Location> mobs,
|
||||||
ArrayList<Location> snakeHead, ArrayList<Location> snakeTrail, ArrayList<Location> gate, ArrayList<Location> checkpoints, Location giant)
|
ArrayList<Location> snakeHead, ArrayList<Location> snakeTrail, ArrayList<Location> gate, ArrayList<Location> checkpoints, Location giant)
|
||||||
{
|
{
|
||||||
@ -85,7 +86,7 @@ public class Part4 extends Part
|
|||||||
@EventHandler
|
@EventHandler
|
||||||
public void GateUpdate(UpdateEvent event)
|
public void GateUpdate(UpdateEvent event)
|
||||||
{
|
{
|
||||||
if (event.getType() != UpdateType.SEC)
|
if (event.getType() != UpdateType.FAST)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (_gate.isEmpty())
|
if (_gate.isEmpty())
|
||||||
@ -187,6 +188,8 @@ public class Part4 extends Part
|
|||||||
ent.getEquipment().setLeggings(new ItemStack(Material.LEATHER_LEGGINGS));
|
ent.getEquipment().setLeggings(new ItemStack(Material.LEATHER_LEGGINGS));
|
||||||
ent.getEquipment().setBoots(new ItemStack(Material.LEATHER_BOOTS));
|
ent.getEquipment().setBoots(new ItemStack(Material.LEATHER_BOOTS));
|
||||||
ent.setVillager(true);
|
ent.setVillager(true);
|
||||||
|
|
||||||
|
ent.setCustomName("Evil Elf " + UtilMath.randomElement(_evilElfNames));
|
||||||
|
|
||||||
ent.setHealth(9);
|
ent.setHealth(9);
|
||||||
|
|
||||||
|
@ -2,41 +2,37 @@ package nautilus.game.arcade.game.games.christmas.parts;
|
|||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
import mineplex.core.common.util.UtilAction;
|
|
||||||
import mineplex.core.common.util.UtilAlg;
|
|
||||||
import mineplex.core.common.util.UtilEnt;
|
|
||||||
import mineplex.core.common.util.UtilMath;
|
|
||||||
import mineplex.core.common.util.UtilServer;
|
|
||||||
import mineplex.core.common.util.UtilTime;
|
|
||||||
import mineplex.core.updater.UpdateType;
|
|
||||||
import mineplex.core.updater.event.UpdateEvent;
|
|
||||||
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
|
|
||||||
import nautilus.game.arcade.game.games.christmas.Christmas;
|
|
||||||
import nautilus.game.arcade.game.games.christmas.ChristmasAudio;
|
|
||||||
import nautilus.game.arcade.game.games.christmas.content.*;
|
|
||||||
import net.minecraft.server.v1_8_R3.EntityCreature;
|
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.Effect;
|
import org.bukkit.Effect;
|
||||||
import org.bukkit.EntityEffect;
|
import org.bukkit.EntityEffect;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.Sound;
|
import org.bukkit.Sound;
|
||||||
import org.bukkit.block.Block;
|
|
||||||
import org.bukkit.block.BlockFace;
|
|
||||||
import org.bukkit.craftbukkit.v1_8_R3.entity.CraftCreature;
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.entity.Snowman;
|
import org.bukkit.entity.Snowman;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.event.EventPriority;
|
import org.bukkit.event.EventPriority;
|
||||||
import org.bukkit.event.HandlerList;
|
|
||||||
import org.bukkit.event.block.BlockBurnEvent;
|
import org.bukkit.event.block.BlockBurnEvent;
|
||||||
import org.bukkit.event.block.BlockIgniteEvent;
|
import org.bukkit.event.block.BlockIgniteEvent;
|
||||||
import org.bukkit.event.entity.EntityCombustEvent;
|
import org.bukkit.event.entity.EntityCombustEvent;
|
||||||
import org.bukkit.event.entity.EntityExplodeEvent;
|
|
||||||
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
|
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
|
||||||
|
import org.bukkit.event.entity.EntityExplodeEvent;
|
||||||
import org.bukkit.event.player.PlayerCommandPreprocessEvent;
|
import org.bukkit.event.player.PlayerCommandPreprocessEvent;
|
||||||
|
|
||||||
|
import mineplex.core.common.util.UtilAction;
|
||||||
|
import mineplex.core.common.util.UtilAlg;
|
||||||
|
import mineplex.core.common.util.UtilMath;
|
||||||
|
import mineplex.core.common.util.UtilTime;
|
||||||
|
import mineplex.core.updater.UpdateType;
|
||||||
|
import mineplex.core.updater.event.UpdateEvent;
|
||||||
|
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
|
||||||
|
import nautilus.game.arcade.game.games.christmas.Christmas;
|
||||||
|
import nautilus.game.arcade.game.games.christmas.ChristmasAudio;
|
||||||
|
import nautilus.game.arcade.game.games.christmas.content.BossFloor;
|
||||||
|
import nautilus.game.arcade.game.games.christmas.content.BossMobs;
|
||||||
|
import nautilus.game.arcade.game.games.christmas.content.BossSnowmanPattern;
|
||||||
|
import nautilus.game.arcade.game.games.christmas.content.PumpkinKing;
|
||||||
|
|
||||||
public class Part5 extends Part
|
public class Part5 extends Part
|
||||||
{
|
{
|
||||||
private ArrayList<Location> _spawn;
|
private ArrayList<Location> _spawn;
|
||||||
@ -385,6 +381,9 @@ public class Part5 extends Part
|
|||||||
@EventHandler
|
@EventHandler
|
||||||
public void Damage(CustomDamageEvent event)
|
public void Damage(CustomDamageEvent event)
|
||||||
{
|
{
|
||||||
|
if (event.isCancelled())
|
||||||
|
return;
|
||||||
|
|
||||||
if (_boss == null)
|
if (_boss == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -258,8 +258,23 @@ public class Arena
|
|||||||
|
|
||||||
public void closeDoor()
|
public void closeDoor()
|
||||||
{
|
{
|
||||||
for (Location loc : _doorBlocks)
|
_host.Manager.getScheduler().scheduleSyncDelayedTask(_host.Manager.getPlugin(), new Runnable()
|
||||||
loc.getBlock().setType(Material.OBSIDIAN);
|
{
|
||||||
|
@Override
|
||||||
|
public void run()
|
||||||
|
{
|
||||||
|
for (Location loc : _doorBlocks)
|
||||||
|
loc.getBlock().setType(Material.OBSIDIAN);
|
||||||
|
|
||||||
|
// Lag exploit check
|
||||||
|
for (Player p : getPastPlayers())
|
||||||
|
{
|
||||||
|
Arena closest = _host.getArenaByMid(UtilAlg.findClosest(p.getLocation(), _host.getAllArenaMids()));
|
||||||
|
if (closest != _host.getPlayerArenas().get(p))
|
||||||
|
p.teleport(UtilAlg.findClosest(p.getLocation(), getSpawns()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, 5L);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isOpenDoor()
|
public boolean isOpenDoor()
|
||||||
|
@ -1,8 +1,10 @@
|
|||||||
package nautilus.game.arcade.game.games.gladiators;
|
package nautilus.game.arcade.game.games.gladiators;
|
||||||
|
|
||||||
|
import java.text.DecimalFormat;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
import java.util.HashSet;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.LinkedList;
|
import java.util.LinkedList;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@ -23,7 +25,6 @@ import org.bukkit.event.entity.EntityDamageEvent;
|
|||||||
import org.bukkit.event.entity.EntityShootBowEvent;
|
import org.bukkit.event.entity.EntityShootBowEvent;
|
||||||
import org.bukkit.event.player.PlayerMoveEvent;
|
import org.bukkit.event.player.PlayerMoveEvent;
|
||||||
import org.bukkit.event.player.PlayerQuitEvent;
|
import org.bukkit.event.player.PlayerQuitEvent;
|
||||||
import org.bukkit.inventory.ItemStack;
|
|
||||||
|
|
||||||
import net.minecraft.server.v1_8_R3.PacketPlayOutAnimation;
|
import net.minecraft.server.v1_8_R3.PacketPlayOutAnimation;
|
||||||
|
|
||||||
@ -107,6 +108,10 @@ public class Gladiators extends SoloGame
|
|||||||
DontAllowOverfill = true;
|
DontAllowOverfill = true;
|
||||||
EnableTutorials = false;
|
EnableTutorials = false;
|
||||||
|
|
||||||
|
BlockBreakAllow.add(Material.SUGAR_CANE_BLOCK.getId());
|
||||||
|
BlockBreakAllow.add(Material.GRASS.getId());
|
||||||
|
BlockBreakAllow.add(Material.LONG_GRASS.getId());
|
||||||
|
|
||||||
registerStatTrackers(
|
registerStatTrackers(
|
||||||
new BrawlerTracker(this),
|
new BrawlerTracker(this),
|
||||||
//new UntouchableTracker(this),
|
//new UntouchableTracker(this),
|
||||||
@ -464,6 +469,11 @@ public class Gladiators extends SoloGame
|
|||||||
return mids;
|
return mids;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public HashMap<Player, Arena> getPlayerArenas()
|
||||||
|
{
|
||||||
|
return _playerArenas;
|
||||||
|
}
|
||||||
|
|
||||||
public ArrayList<Location> getAllArenaMids()
|
public ArrayList<Location> getAllArenaMids()
|
||||||
{
|
{
|
||||||
ArrayList<Location> mids = new ArrayList<>();
|
ArrayList<Location> mids = new ArrayList<>();
|
||||||
@ -671,9 +681,15 @@ public class Gladiators extends SoloGame
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!_playerArenas.get(p).isOpenDoor())
|
||||||
|
return;
|
||||||
|
|
||||||
//p.sendMessage("ARENA MOVE CHECK METHOD!");
|
//p.sendMessage("ARENA MOVE CHECK METHOD!");
|
||||||
Manager.getPluginManager().callEvent(new PlayerChangeArenaEvent(e.getPlayer(), closest, _playerArenas.get(p)));
|
Manager.getPluginManager().callEvent(new PlayerChangeArenaEvent(e.getPlayer(), closest, _playerArenas.get(p)));
|
||||||
_playerArenas.put(p, closest);
|
_playerArenas.put(p, closest);
|
||||||
|
|
||||||
|
// Push player a little
|
||||||
|
UtilAction.velocity(p, UtilAlg.getTrajectory2d(p.getLocation(), closest.getMid()), 1.7, false, 0.2, 0, 3, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -892,8 +908,8 @@ public class Gladiators extends SoloGame
|
|||||||
|
|
||||||
if (e.getEntity() instanceof Player)
|
if (e.getEntity() instanceof Player)
|
||||||
{
|
{
|
||||||
((Player)e.getEntity()).getInventory().addItem(new ItemStack(Material.ARROW, 1)); // Arrow fix.
|
// ((Player)e.getEntity()).getInventory().addItem(new ItemStack(Material.ARROW, 1)); // Arrow fix.
|
||||||
((Player)e.getEntity()).updateInventory();
|
// ((Player)e.getEntity()).updateInventory();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1007,6 +1023,9 @@ public class Gladiators extends SoloGame
|
|||||||
{
|
{
|
||||||
if (_playerArenas.containsKey(e.getPlayer()))
|
if (_playerArenas.containsKey(e.getPlayer()))
|
||||||
{
|
{
|
||||||
|
if (_playerArenas.get(e.getPlayer()).getState() != ArenaState.FIGHTING)
|
||||||
|
return;
|
||||||
|
|
||||||
for (Player p : _playerArenas.get(e.getPlayer()).getPastPlayers())
|
for (Player p : _playerArenas.get(e.getPlayer()).getPastPlayers())
|
||||||
{
|
{
|
||||||
if (p.equals(e.getPlayer()))
|
if (p.equals(e.getPlayer()))
|
||||||
@ -1019,4 +1038,39 @@ public class Gladiators extends SoloGame
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void deathHealth(CombatDeathEvent e)
|
||||||
|
{
|
||||||
|
if (!(e.GetEvent().getEntity() instanceof Player))
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (e.GetLog().GetKiller().IsPlayer())
|
||||||
|
{
|
||||||
|
Player killer = UtilPlayer.searchExact(e.GetLog().GetKiller().GetName());
|
||||||
|
((Player)e.GetEvent().getEntity()).sendMessage(F.main("Game", "Your killer had " + C.cRed + new DecimalFormat("#").format(killer.getHealth()) + "❤" + C.cGray + " left."));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void scoreboardEnd(GameStateChangeEvent e)
|
||||||
|
{
|
||||||
|
if (e.GetState() != GameState.End)
|
||||||
|
return;
|
||||||
|
|
||||||
|
Scoreboard.Reset();
|
||||||
|
|
||||||
|
Scoreboard.WriteBlank();
|
||||||
|
Scoreboard.Write(C.cGreen + C.Bold + "Status");
|
||||||
|
Scoreboard.Write(C.cWhite + "Ended");
|
||||||
|
Scoreboard.WriteBlank();
|
||||||
|
Scoreboard.Write(C.cAqua + C.Bold + "Matches Left");
|
||||||
|
Scoreboard.Write(C.cWhite + "0");
|
||||||
|
Scoreboard.WriteBlank();
|
||||||
|
Scoreboard.Write(C.cYellow + C.Bold + "Players");
|
||||||
|
if (getWinners() != null && !getWinners().isEmpty())
|
||||||
|
Scoreboard.Write(C.cWhite + getWinners().get(0).getName());
|
||||||
|
|
||||||
|
Scoreboard.Draw();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -358,27 +358,6 @@ public class MonsterMaze extends SoloGame
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean _announced = false;
|
|
||||||
@EventHandler
|
|
||||||
public void sendF5Message(UpdateEvent event)
|
|
||||||
{
|
|
||||||
if (event.getType() != UpdateType.FASTEST)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (GetState() != GameState.Prepare)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (_announced)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (!UtilTime.elapsed(GetStateTime(), 4000))
|
|
||||||
return;
|
|
||||||
|
|
||||||
_announced = true;
|
|
||||||
UtilTextMiddle.display(C.cYellow + C.Bold + "Press F5", C.cAqua + C.Bold + "Monster Maze is best in 3rd person!");
|
|
||||||
Announce(C.cYellow + C.Scramble + "@@" + C.cAqua + C.Bold + " Monster Maze is best played in 3rd Person! (Push F5) " + C.cYellow + C.Scramble + "@@");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void ScoreboardUpdate(UpdateEvent event)
|
public void ScoreboardUpdate(UpdateEvent event)
|
||||||
|
@ -61,7 +61,7 @@ public class KitCreeper extends SmashKit
|
|||||||
}));
|
}));
|
||||||
|
|
||||||
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.IRON_SPADE, (byte)0, 1,
|
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.IRON_SPADE, (byte)0, 1,
|
||||||
C.cYellow + C.Bold + "Right-Click" + C.cWhite + C.Bold + " - " + C.cGreen + C.Bold + "Explosive Leap",
|
C.cYellow + C.Bold + "Right-Click" + C.cWhite + C.Bold + " - " + C.cGreen + C.Bold + "Explode",
|
||||||
new String[]
|
new String[]
|
||||||
{
|
{
|
||||||
ChatColor.RESET + "You freeze in location and charge up",
|
ChatColor.RESET + "You freeze in location and charge up",
|
||||||
|
@ -13,10 +13,10 @@ import org.bukkit.event.player.PlayerQuitEvent;
|
|||||||
|
|
||||||
import mineplex.core.common.util.C;
|
import mineplex.core.common.util.C;
|
||||||
import mineplex.core.common.util.UtilParticle;
|
import mineplex.core.common.util.UtilParticle;
|
||||||
import mineplex.core.common.util.UtilServer;
|
|
||||||
import mineplex.core.common.util.UtilTextMiddle;
|
|
||||||
import mineplex.core.common.util.UtilParticle.ParticleType;
|
import mineplex.core.common.util.UtilParticle.ParticleType;
|
||||||
import mineplex.core.common.util.UtilParticle.ViewDist;
|
import mineplex.core.common.util.UtilParticle.ViewDist;
|
||||||
|
import mineplex.core.common.util.UtilServer;
|
||||||
|
import mineplex.core.common.util.UtilTextMiddle;
|
||||||
import mineplex.core.recharge.Recharge;
|
import mineplex.core.recharge.Recharge;
|
||||||
import mineplex.core.updater.UpdateType;
|
import mineplex.core.updater.UpdateType;
|
||||||
import mineplex.core.updater.event.UpdateEvent;
|
import mineplex.core.updater.event.UpdateEvent;
|
||||||
@ -37,10 +37,13 @@ public class PerkEndermanTeleport extends SmashPerk
|
|||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void update(UpdateEvent event)
|
public void update(UpdateEvent event)
|
||||||
{
|
{
|
||||||
if (event.getType() != UpdateType.TICK)
|
if (event.getType() != UpdateType.TICK)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if(!Manager.GetGame().IsLive())
|
||||||
|
return;
|
||||||
|
|
||||||
for (Player player : UtilServer.getPlayers())
|
for (Player player : UtilServer.getPlayers())
|
||||||
{
|
{
|
||||||
if (!Kit.HasKit(player))
|
if (!Kit.HasKit(player))
|
||||||
@ -88,7 +91,7 @@ public class PerkEndermanTeleport extends SmashPerk
|
|||||||
}
|
}
|
||||||
|
|
||||||
player.playSound(player.getLocation(), Sound.ENDERMAN_TELEPORT, 1f, 0.5f);
|
player.playSound(player.getLocation(), Sound.ENDERMAN_TELEPORT, 1f, 0.5f);
|
||||||
player.teleport(block.getLocation().add(0.5, 1, 0.5));
|
player.teleport(block.getLocation().add(0.5, 1, 0.5).setDirection(player.getLocation().getDirection()));
|
||||||
player.playSound(player.getLocation(), Sound.ENDERMAN_TELEPORT, 1f, 0.5f);
|
player.playSound(player.getLocation(), Sound.ENDERMAN_TELEPORT, 1f, 0.5f);
|
||||||
|
|
||||||
UtilParticle.PlayParticle(ParticleType.WITCH_MAGIC, player.getLocation().add(0, 1, 0), 1f, 1f, 1f, 0.1f, 100, ViewDist.LONG, UtilServer.getPlayers());
|
UtilParticle.PlayParticle(ParticleType.WITCH_MAGIC, player.getLocation().add(0, 1, 0), 1f, 1f, 1f, 0.1f, 100, ViewDist.LONG, UtilServer.getPlayers());
|
||||||
|
@ -941,7 +941,7 @@ public abstract class SurvivalGames extends Game
|
|||||||
|
|
||||||
for (Player alive : GetPlayers(true))
|
for (Player alive : GetPlayers(true))
|
||||||
{
|
{
|
||||||
if (alive != player)
|
if (alive != player && getArcadeManager().canHurt(player, alive))
|
||||||
{
|
{
|
||||||
double distance = alive.getLocation().distance(
|
double distance = alive.getLocation().distance(
|
||||||
player.getLocation());
|
player.getLocation());
|
||||||
@ -1838,6 +1838,9 @@ public abstract class SurvivalGames extends Game
|
|||||||
|
|
||||||
if (!UtilInv.IsItem(player.getItemInHand(), Material.TNT, (byte) 0))
|
if (!UtilInv.IsItem(player.getItemInHand(), Material.TNT, (byte) 0))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if(!IsAlive(player))
|
||||||
|
return;
|
||||||
|
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
|
|
||||||
|
@ -11,7 +11,7 @@ public class GiveAdminPage extends PlayerPage
|
|||||||
{
|
{
|
||||||
public GiveAdminPage(ArcadeManager plugin, PrivateServerShop shop, Player player)
|
public GiveAdminPage(ArcadeManager plugin, PrivateServerShop shop, Player player)
|
||||||
{
|
{
|
||||||
super(plugin, shop, "Give Admin", player);
|
super(plugin, shop, "Give Co-Host", player);
|
||||||
buildPage();
|
buildPage();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -26,12 +26,12 @@ public class GiveAdminPage extends PlayerPage
|
|||||||
{
|
{
|
||||||
removeButton(slot);
|
removeButton(slot);
|
||||||
_manager.giveAdmin(player);
|
_manager.giveAdmin(player);
|
||||||
UtilPlayer.message(getPlayer(), F.main("Server", "You gave " + F.name(player.getName()) + " admin power."));
|
UtilPlayer.message(getPlayer(), F.main("Server", "You gave " + F.name(player.getName()) + " Co-Host power."));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getDisplayString(Player player)
|
public String getDisplayString(Player player)
|
||||||
{
|
{
|
||||||
return "Click to Make Admin";
|
return "Click to Make Co-Host";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -19,7 +19,7 @@ public class RemoveAdminPage extends BasePage
|
|||||||
{
|
{
|
||||||
public RemoveAdminPage(ArcadeManager plugin, PrivateServerShop shop, Player player)
|
public RemoveAdminPage(ArcadeManager plugin, PrivateServerShop shop, Player player)
|
||||||
{
|
{
|
||||||
super(plugin, shop, "Remove Admin", player);
|
super(plugin, shop, "Remove Co-Host", player);
|
||||||
|
|
||||||
buildPage();
|
buildPage();
|
||||||
}
|
}
|
||||||
@ -36,7 +36,7 @@ public class RemoveAdminPage extends BasePage
|
|||||||
while (iterator.hasNext())
|
while (iterator.hasNext())
|
||||||
{
|
{
|
||||||
String name = iterator.next();
|
String name = iterator.next();
|
||||||
ItemStack head = getPlayerHead(name, C.cGreen + C.Bold + name, new String[] {ChatColor.RESET + C.cGray + "Click to Remove Admin"});
|
ItemStack head = getPlayerHead(name, C.cGreen + C.Bold + name, new String[] {ChatColor.RESET + C.cGray + "Click to Remove Co-Host"});
|
||||||
addButton(slot, head, getRemoveAdminButton(slot, name));
|
addButton(slot, head, getRemoveAdminButton(slot, name));
|
||||||
|
|
||||||
slot++;
|
slot++;
|
||||||
@ -52,7 +52,7 @@ public class RemoveAdminPage extends BasePage
|
|||||||
{
|
{
|
||||||
_manager.removeAdmin(playerName);
|
_manager.removeAdmin(playerName);
|
||||||
removeButton(slot);
|
removeButton(slot);
|
||||||
UtilPlayer.message(getPlayer(), F.main("Server", "You removed admin power from " + F.name(playerName) + "."));
|
UtilPlayer.message(getPlayer(), F.main("Server", "You removed Co-Host power from " + F.name(playerName) + "."));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package nautilus.game.arcade.kit.perks;
|
package nautilus.game.arcade.kit.perks;
|
||||||
|
|
||||||
|
import org.bukkit.Location;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.Sound;
|
import org.bukkit.Sound;
|
||||||
import org.bukkit.block.Block;
|
import org.bukkit.block.Block;
|
||||||
@ -109,7 +110,9 @@ public class PerkBaconBlast extends Perk implements IThrown
|
|||||||
|
|
||||||
public void Explode(ProjectileUser data)
|
public void Explode(ProjectileUser data)
|
||||||
{
|
{
|
||||||
data.GetThrown().getWorld().createExplosion(data.GetThrown().getLocation(), 0.5f);
|
// for whatever reason, you can't put a location in createExplosion if you don't want it to break blocks >.>
|
||||||
|
Location loc = data.GetThrown().getLocation();
|
||||||
|
data.GetThrown().getWorld().createExplosion(loc.getX(), loc.getY(), loc.getZ(), 0.5f, false, false);
|
||||||
data.GetThrown().remove();
|
data.GetThrown().remove();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -53,6 +53,10 @@ public class PerkBladeVortex extends Perk
|
|||||||
|
|
||||||
if (!UtilGear.isWeapon(event.getPlayer().getItemInHand()))
|
if (!UtilGear.isWeapon(event.getPlayer().getItemInHand()))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
//Dont allow usage in early game
|
||||||
|
if (!UtilTime.elapsed(Manager.GetGame().GetStateTime(), 30000))
|
||||||
|
return;
|
||||||
|
|
||||||
final Player player = event.getPlayer();
|
final Player player = event.getPlayer();
|
||||||
|
|
||||||
|
@ -125,7 +125,7 @@ public class PerkDoubleJump extends Perk
|
|||||||
if (!Recharge.Instance.usable(player, "Double Jump"))
|
if (!Recharge.Instance.usable(player, "Double Jump"))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (UtilEnt.isGrounded(player) || UtilBlock.solid(player.getLocation().getBlock().getRelative(BlockFace.DOWN)))
|
if (player.isOnGround() || (UtilBlock.solid(player.getLocation().getBlock().getRelative(BlockFace.DOWN)) && UtilBlock.solid(player.getLocation().getBlock())))
|
||||||
player.setAllowFlight(true);
|
player.setAllowFlight(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -93,7 +93,8 @@ public class PerkFlameDash extends Perk
|
|||||||
|
|
||||||
_data.add(new FireflyData(player));
|
_data.add(new FireflyData(player));
|
||||||
|
|
||||||
Manager.GetCondition().Factory().Invisible(GetName(), player, player, 2.5, 0, false, false, true);
|
Manager.GetCondition().Factory().Cloak(GetName(), player, player, 2.5, false, false);
|
||||||
|
//Manager.GetCondition().Factory().Invisible(GetName(), player, player, 2.5, 0, false, false, true);
|
||||||
|
|
||||||
UtilPlayer.message(player, F.main("Skill", "You used " + F.skill(GetName()) + "."));
|
UtilPlayer.message(player, F.main("Skill", "You used " + F.skill(GetName()) + "."));
|
||||||
}
|
}
|
||||||
|
@ -109,6 +109,8 @@ public class PerkWitchPotion extends SmashPerk
|
|||||||
Manager.GetDamage().NewDamageEvent(player, thrower, null,
|
Manager.GetDamage().NewDamageEvent(player, thrower, null,
|
||||||
DamageCause.CUSTOM, 5, true, true, false,
|
DamageCause.CUSTOM, 5, true, true, false,
|
||||||
UtilEnt.getName((LivingEntity)event.getEntity().getShooter()), GetName());
|
UtilEnt.getName((LivingEntity)event.getEntity().getShooter()), GetName());
|
||||||
|
|
||||||
|
Manager.GetCondition().Factory().Slow("Witch Potion", player, null, 3, 1, true, false, false, false);
|
||||||
}
|
}
|
||||||
//Super Effect
|
//Super Effect
|
||||||
else
|
else
|
||||||
@ -121,6 +123,7 @@ public class PerkWitchPotion extends SmashPerk
|
|||||||
DamageCause.CUSTOM, 5 + bonus, true, true, false,
|
DamageCause.CUSTOM, 5 + bonus, true, true, false,
|
||||||
UtilEnt.getName((LivingEntity)event.getEntity().getShooter()), GetName());
|
UtilEnt.getName((LivingEntity)event.getEntity().getShooter()), GetName());
|
||||||
|
|
||||||
|
Manager.GetCondition().Factory().Slow("Witch Potion", player, null, 7, 2, true, false, false, false);
|
||||||
//Manager.GetCondition().Factory().Confuse(reason, ent, source, duration, mult, extend, showIndicator, ambient)
|
//Manager.GetCondition().Factory().Confuse(reason, ent, source, duration, mult, extend, showIndicator, ambient)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -396,7 +396,7 @@ public class GameHostManager implements Listener
|
|||||||
|
|
||||||
if (!isAdmin(event.getPlayer(), true))
|
if (!isAdmin(event.getPlayer(), true))
|
||||||
{
|
{
|
||||||
event.getPlayer().sendMessage(F.main("Broadcast", "Only MPS admins can use this command."));
|
event.getPlayer().sendMessage(F.main("Broadcast", "Only Co-Hosts can use this command."));
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -304,14 +304,16 @@ public class HolidayManager implements Listener
|
|||||||
if (Manager.GetGame() != null && !Manager.GetGame().IsAlive(event.getPlayer()))
|
if (Manager.GetGame() != null && !Manager.GetGame().IsAlive(event.getPlayer()))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!_active.contains(event.getClickedBlock()))
|
|
||||||
return;
|
|
||||||
|
|
||||||
specialBlockBreak(event.getPlayer(), event.getClickedBlock());
|
specialBlockBreak(event.getPlayer(), event.getClickedBlock());
|
||||||
}
|
}
|
||||||
|
|
||||||
private void specialBlockBreak(Player player, final Block block)
|
private void specialBlockBreak(Player player, final Block block)
|
||||||
{
|
{
|
||||||
|
if (!_active.contains(block))
|
||||||
|
return;
|
||||||
|
|
||||||
|
_active.remove(block);
|
||||||
|
|
||||||
block.getWorld().playEffect(block.getLocation(), Effect.STEP_SOUND, type.getBlockType());
|
block.getWorld().playEffect(block.getLocation(), Effect.STEP_SOUND, type.getBlockType());
|
||||||
block.setType(Material.AIR);
|
block.setType(Material.AIR);
|
||||||
|
|
||||||
|
@ -46,6 +46,11 @@ public class DeathBomberStatTracker extends StatTracker<Game>
|
|||||||
|
|
||||||
if (!event.GetLog().GetPlayer().IsPlayer())
|
if (!event.GetLog().GetPlayer().IsPlayer())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
Player killed = UtilPlayer.searchExact(event.GetLog().GetPlayer().GetName());
|
||||||
|
|
||||||
|
if(killer.equals(killed))
|
||||||
|
return;
|
||||||
|
|
||||||
if (event.GetLog().GetKiller() != null && event.GetLog().GetKiller().GetReason().contains("Throwing TNT"))
|
if (event.GetLog().GetKiller() != null && event.GetLog().GetKiller().GetReason().contains("Throwing TNT"))
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user