Merge branch 'project-cosmetics' of

http://JustSomeDude@184.154.0.242:7990/scm/min/mineplex.git into
project-cosmetics

Conflicts:
	Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/Menu.java
	Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemPartyPopper.java
	Plugins/Mineplex.Core/src/mineplex/core/mount/types/MountBabyReindeer.java
This commit is contained in:
xGamingDudex 2015-12-11 18:06:35 +01:00
commit 9af6fd6904
237 changed files with 6298 additions and 2332 deletions

View File

@ -28,7 +28,7 @@
<processorPath useClasspath="true" />
</profile>
</annotationProcessing>
<bytecodeTargetLevel target="1.7" />
<bytecodeTargetLevel target="1.8" />
</component>
<component name="JavacSettings">
<option name="GENERATE_NO_WARNINGS" value="true" />

View File

@ -16,7 +16,7 @@
</set>
</option>
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" default="false" assert-keyword="true" jdk-15="true" project-jdk-name="1.7" project-jdk-type="JavaSDK">
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="false" assert-keyword="true" jdk-15="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
</project>

View File

@ -9,6 +9,7 @@
<jar jarfile="../bin/Mineplex.Core.Common.jar">
<fileset dir="../Mineplex.Core.Common/bin">
<include name="**/*.class"/>
<include name="**/*.png"/>
</fileset>
</jar>
<copy file="../bin/Mineplex.Core.Common.jar" todir="../Libraries"/>
@ -66,10 +67,10 @@
</fileset>
<fileset dir="../Mineplex.Core/bin">
<include name="**/*.class"/>
<include name="**/*.png"/>
</fileset>
<fileset dir="../Mineplex.Core.Common/bin">
<include name="**/*.class"/>
<include name="**/*.png"/>
</fileset>
<fileset dir="../Mineplex.Minecraft.Game.ClassCombat/bin">
<include name="**/*.class"/>
@ -110,6 +111,7 @@
<jar jarfile="../bin/Mineplex.Core.Common.jar">
<fileset dir="../Mineplex.Core.Common/bin">
<include name="**/*.class"/>
<include name="**/*.png"/>
</fileset>
</jar>
<copy file="../bin/Mineplex.Core.Common.jar" todir="../Libraries"/>
@ -142,6 +144,7 @@
</fileset>
<fileset dir="../Mineplex.Core.Common/bin">
<include name="**/*.class"/>
<include name="**/*.png"/>
</fileset>
<fileset dir="../Mineplex.Minecraft.Game.ClassCombat/bin">
<include name="**/*.class"/>
@ -191,6 +194,7 @@
</fileset>
<fileset dir="../Mineplex.Core.Common/bin">
<include name="**/*.class"/>
<include name="**/*.png"/>
</fileset>
<fileset dir="../Mineplex.Game.Clans.Core/bin">
<include name="**/*.class"/>
@ -239,6 +243,7 @@
</fileset>
<fileset dir="../Mineplex.Core.Common/bin">
<include name="**/*.class"/>
<include name="**/*.png"/>
</fileset>
<fileset dir="../Mineplex.StaffServer">
<include name="*.yml"/>
@ -276,6 +281,7 @@
<fileset dir="../Mineplex.Core.Common/bin">
<include name="**/*.class"/>
<include name="**/*.png"/>
</fileset>
<fileset dir="../Mineplex.MapParser">
@ -403,6 +409,7 @@
<jar jarfile="../bin/ServerMonitor.jar">
<fileset dir="../Mineplex.Core.Common/bin">
<include name="**/*.class"/>
<include name="**/*.png"/>
</fileset>
<fileset dir="../Mineplex.ServerMonitor/bin">
<include name="**/*.class"/>
@ -435,6 +442,7 @@
<jar jarfile="../bin/TaskConverter.jar">
<fileset dir="../Mineplex.Core.Common/bin">
<include name="**/*.class"/>
<include name="**/*.png"/>
</fileset>
<fileset dir="../Mineplex.ChestConverter/bin">
<include name="**/*.class"/>
@ -462,6 +470,7 @@
<jar jarfile="../bin/PetConverter.jar">
<fileset dir="../Mineplex.Core.Common/bin">
<include name="**/*.class"/>
<include name="**/*.png"/>
</fileset>
<fileset dir="../Mineplex.PetConverter/bin">
<include name="**/*.class"/>
@ -490,6 +499,7 @@
<jar jarfile="../bin/Queuer.jar">
<fileset dir="../Mineplex.Core.Common/bin">
<include name="**/*.class"/>
<include name="**/*.png"/>
</fileset>
<fileset dir="../Mineplex.Queuer/bin">
<include name="**/*.class"/>

View File

@ -56,11 +56,11 @@ public class MotdManager implements Listener, Runnable
//String motdLine = "§f§l◄ §c§lMaintenance§f§l ►";
//String motdLine = "§f§l◄ §a§lCarl the Creeper§f§l ►";
// String motdLine = " §2§l§n M O N S T E R M A Z E B E T A §f";
String motdLine = " §f§l◄ §b§lNew Game§f§l ▬ §3§lChampions CTF§f§l ►";
String motdLine = " §f❄ §2§lWinter Update §f❄ §2§lSnow Fight §f❄";
//String motdLine = " §d§lRank Sale §a§l40% Off");
//String motdLine = " §f§l◄§c§lMAINTENANCE§f§l►");
updateMainMotd(" §f§l§m §8§l§m[ §r §6§lMineplex§r §f§lGames§r §8§l§m ]§f§l§m §r", motdLine);
updateMainMotd(" §c§m §f§m §c§m §f§m §2§l§m[ §r §c§lMineplex§r §f§lGames§r §2§l§m ]§f§m §c§m §f§m §c§m §r", motdLine);
System.out.println("Updated Bungee MOTD");
}
}

View File

@ -26,7 +26,7 @@ public enum Rank
//Media
YOUTUBE("YouTube", ChatColor.RED),
YOUTUBE_SMALL("Tuber", ChatColor.DARK_PURPLE),
YOUTUBE_SMALL("YT", ChatColor.DARK_PURPLE),
TWITCH("Twitch", ChatColor.DARK_PURPLE),
//Player

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

View File

@ -4,6 +4,8 @@ import org.bukkit.ChatColor;
public class C
{
public static final String blankLine = ChatColor.RESET + " ";
public static String Scramble = "§k";
public static String Bold = "§l";
public static String Strike = "§m";

View File

@ -106,6 +106,11 @@ public class F
return rank.getTag(false, false);
}
public static String value(String variable, int value)
{
return value(variable, "" + value);
}
public static String value(String variable, String value)
{
return value(0, variable, value);

View File

@ -0,0 +1,18 @@
package mineplex.core.common.util;
public enum LineFormat
{
LORE(220), CHAT(319);
private int _length;
private LineFormat(int length)
{
_length = length;
}
public int getLength()
{
return _length;
}
}

View File

@ -552,8 +552,8 @@ public class UtilBlock
if (diagonals)
{
for (int x = -1; x <= 1; x++)
for (int y = -1; y <= 1; y++)
for (int z = -1; z <= 1; z++)
for (int z = -1; z <= 1; z++)
for (int y = 1; y >= -1; y--)
{
if (x == 0 && y == 0 && z == 0) continue;
@ -563,11 +563,11 @@ public class UtilBlock
else
{
blocks.add(block.getRelative(BlockFace.UP));
blocks.add(block.getRelative(BlockFace.DOWN));
blocks.add(block.getRelative(BlockFace.NORTH));
blocks.add(block.getRelative(BlockFace.SOUTH));
blocks.add(block.getRelative(BlockFace.EAST));
blocks.add(block.getRelative(BlockFace.WEST));
blocks.add(block.getRelative(BlockFace.DOWN));
}
return blocks;
@ -835,7 +835,7 @@ public class UtilBlock
return getBedHead(bed.getBlock()) != null && getBedFoot(bed.getBlock()) != null;
}
public static HashSet<Block> findConnectedBlocks(Block block, HashSet<Block> blocks, int limit)
public static HashSet<Block> findConnectedBlocks(Block source, Block block, HashSet<Block> blocks, int limit, double range)
{
if (blocks == null)
blocks = new HashSet<Block>();
@ -852,10 +852,13 @@ public class UtilBlock
{
if (neighbour.getType() == Material.AIR)
continue;
if (UtilMath.offset(source.getLocation(), neighbour.getLocation()) > range)
continue;
//If neighbour hasn't been searched, recursively search it!
if (!blocks.contains(neighbour))
findConnectedBlocks(neighbour, blocks, limit);
findConnectedBlocks(source, neighbour, blocks, limit, range);
}
return blocks;

View File

@ -1,5 +1,7 @@
package mineplex.core.common.util;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashMap;
import java.util.LinkedList;
@ -509,13 +511,21 @@ public class UtilPlayer
if (cur.isDead())
continue;
//Ignore Check
if (ignore != null)
{
for (int i = 0; i < ignore.length; i++)
boolean shouldIgnore = false;
for (Entity ent : ignore)
{
if (cur.equals(ignore[i]))
continue;
if (cur.equals(ent))
{
shouldIgnore = true;
break;
}
}
if (shouldIgnore)
continue;
}
double dist = UtilMath.offset(cur.getLocation(), loc);

View File

@ -1,10 +1,12 @@
package mineplex.core.common.util;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.Comparator;
import java.util.LinkedList;
import java.util.List;
import java.util.stream.Stream;
import org.bukkit.Bukkit;
import org.bukkit.Server;
@ -18,6 +20,11 @@ public class UtilServer
return getServer().getOnlinePlayers().toArray(new Player[0]);
}
public static Collection<? extends Player> getPlayersCollection()
{
return getServer().getOnlinePlayers();
}
public static List<Player> getSortedPlayers()
{
return getSortedPlayers(new Comparator<Player>()

View File

@ -1,52 +1,487 @@
package mineplex.core.common.util;
import java.awt.image.BufferedImage;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import javax.imageio.ImageIO;
import mineplex.core.common.CurrencyType;
import org.apache.commons.lang.WordUtils;
import org.bukkit.Material;
import org.bukkit.ChatColor;
public class UtilText {
public static <T> String listToString(Collection<T> inputList, boolean comma) {
String out = "";
public class UtilText
{
private static HashMap<Character, Integer> _characters = new HashMap<Character, Integer>();
for (T cur : inputList) {
out += cur.toString() + (comma ? ", " : " ");
static
{
try
{
InputStream inputStream = CurrencyType.class.getResourceAsStream("ascii.png");
BufferedImage image = ImageIO.read(inputStream);
char[] text = new char[]
{
' ',
'!',
'"',
'#',
'$',
'%',
'&',
'\'',
'(',
')',
'*',
'+',
',',
'-',
'.',
'/',
'0',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
':',
';',
'<',
'=',
'>',
'?',
'@',
'A',
'B',
'C',
'D',
'E',
'F',
'G',
'H',
'I',
'J',
'K',
'L',
'M',
'N',
'O',
'P',
'Q',
'R',
'S',
'T',
'U',
'V',
'W',
'X',
'Y',
'Z',
'[',
'\\',
']',
'^',
'_',
'`',
'a',
'b',
'c',
'd',
'e',
'f',
'g',
'h',
'i',
'j',
'k',
'l',
'm',
'n',
'o',
'p',
'q',
'r',
's',
't',
'u',
'v',
'w',
'x',
'y',
'z',
'{',
'|',
'}',
'~'
};
int x = 0;
int y = 16;
for (char c : text)
{
grab(c, image, x, y);
if (x < 15 * 8)
{
x += 8;
}
else
{
x = 0;
y += 8;
}
}
inputStream.close();
}
catch (IOException e)
{
e.printStackTrace();
}
}
public static String center(String string, LineFormat lineFormat)
{
int length = getLength(string);
if (length > lineFormat.getLength())
{
return string;
}
if (out.length() > 0) {
out = out.substring(0, out.length() - (comma ? 2 : 1));
// Get the number of empty pixels on both sides of the string
int div = (int) Math.floor((lineFormat.getLength() - length) / 2D);
div -= 2; // For the gap between the strings
return fillLine(" ", div) + string + fillLine(" ", div);
}
public static String alignRight(String string, LineFormat lineFormat)
{
int length = getLength(string);
if (length > lineFormat.getLength())
{
return string;
}
return out;
// Get the number of empty pixels on both sides of the string
int div = lineFormat.getLength() - length;
div -= 1; // For the gap between the strings
return fillLine(" ", div) + string;
}
public static String centerChat(String string, LineFormat lineFormat)
{
int length = getLength(string);
if (length > lineFormat.getLength())
{
return string;
}
// Get the number of empty pixels on both sides of the string
int div = (int) Math.floor(((lineFormat.getLength() + 10) - length) / 2D);
div -= 2; // For the gap between the strings
return fillLine(" ", div) + string;
}
public static String substringPixels(String string, int cutoff)
{
int len = 0;
char[] array = string.toCharArray();
boolean bold = false;
for (int i = 0; i < array.length; i++)
{
char c = array[i];
if (c == '<27>')
{
if (++i < array.length)
{
ChatColor color = ChatColor.getByChar(array[i]);
if (color != null)
{
if (color.equals(ChatColor.BOLD))
{
bold = true;
}
else if (color.equals(ChatColor.RESET) || color.isColor())
{
bold = false;
}
}
}
continue;
}
if (!_characters.containsKey(c))
{
continue;
}
int toAdd = _characters.get(c);
if (bold)
{
toAdd++;
}
if (len + toAdd > cutoff)
{
return string.substring(0, Math.max(0, i - 1));
}
if (i + 1 < array.length)
{
len++;
}
}
return string;
}
public static String[] splitLinesToArray(String[] strings, LineFormat lineFormat)
{
ArrayList<String> lineList = splitLines(strings, lineFormat);
String[] lineArray = new String[lineList.size()];
lineArray = lineList.toArray(lineArray);
return lineArray;
}
public static int upperCaseCount(String input) {
int count = 0;
for (int k = 0; k < input.length(); k++) {
char ch = input.charAt(k);
if (Character.isUpperCase(ch))
count++;
public static ArrayList<String> splitLines(String[] strings, LineFormat lineFormat)
{
ArrayList<String> lines = new ArrayList<String>();
for (String s : strings)
{
lines.addAll(splitLine(s, lineFormat));
}
return count;
return lines;
}
public static int lowerCaseCount(String input) {
int count = 0;
public static String[] splitLineToArray(String string, LineFormat lineFormat)
{
ArrayList<String> lineList = splitLine(string, lineFormat);
for (int k = 0; k < input.length(); k++) {
char ch = input.charAt(k);
if (Character.isLowerCase(ch))
count++;
String[] lineArray = new String[lineList.size()];
lineArray = lineList.toArray(lineArray);
return lineArray;
}
public static ArrayList<String> splitLine(String string, LineFormat lineFormat)
{
ArrayList<String> strings = new ArrayList<String>();
//Ignore lines with #
if (string.startsWith("#"))
{
strings.add(string.substring(1, string.length()));
return strings;
}
return count;
//Empty
if (string.equals("") || string.equals(" "))
{
strings.add(string);
return strings;
}
String current = "";
int currentLength = 0;
String[] split = string.split(" ");
String colors = "";
for (int i = 0; i < split.length; i++)
{
String word = split[i];
int wordLength = getLength(colors + word);
if (currentLength + wordLength + 4 > lineFormat.getLength() && !current.isEmpty())
{
strings.add(current);
current = colors + word;
currentLength = wordLength + 1;
continue;
}
if (i != 0)
{
current += " ";
currentLength += 4;
}
current += word;
currentLength += wordLength;
colors = ChatColor.getLastColors(current);
}
if (!current.isEmpty())
{
strings.add(current);
}
return strings;
}
public static String fillLine(String filler, int maxPixels)
{
int pixels = getLength(filler);
if (pixels <= 0)
{
return "";
}
String toReturn = "";
int currentLen = 0;
int offset = maxPixels % 4;
boolean isOffset = false;
if (offset > 0)
{
toReturn += C.Bold;
}
while (currentLen + pixels <= maxPixels)
{
currentLen += pixels + 1;
toReturn += filler;
if (offset-- > 0)
{
currentLen++;
if (offset == 0)
{
isOffset = false;
toReturn += ChatColor.RESET;
}
}
}
if (isOffset)
{
toReturn += ChatColor.RESET;
}
return toReturn;
}
public static boolean fitsOneLine(String string, LineFormat lineFormat)
{
return getLength(string) <= lineFormat.getLength();
}
public static int getLength(String string)
{
int len = 0;
char[] array = string.toCharArray();
boolean bold = false;
for (int i = 0; i < array.length; i++)
{
char c = array[i];
if (c == '<27>')
{
if (++i < array.length)
{
ChatColor color = ChatColor.getByChar(array[i]);
if (color != null)
{
if (color.equals(ChatColor.BOLD))
{
bold = true;
}
else if (color.equals(ChatColor.RESET) || color.isColor())
{
bold = false;
}
}
}
continue;
}
if (!_characters.containsKey(c))
{
continue;
}
len += _characters.get(c);
if (bold)
{
len++;
}
if (i + 1 < array.length)
{
len++;
}
}
return len;
}
private static void grab(Character character, BufferedImage image, int imageX, int imageY)
{
if (character == ' ')
{
_characters.put(character, 3);
return;
}
for (int x = 0; x < 8; x++)
{
boolean isTransparentLine = true;
for (int y = 0; y < 8; y++)
{
int pixel = image.getRGB(imageX + x, imageY + y);
if ((pixel >> 24) != 0x00)
{
isTransparentLine = false;
break;
}
}
if (isTransparentLine)
{
_characters.put(character, x);
return;
}
}
_characters.put(character, 8);
}
public static boolean isStringSimilar(String newString, String oldString, float matchRequirement)
@ -55,59 +490,136 @@ public class UtilText {
{
return newString.toLowerCase().equals(oldString.toLowerCase());
}
for (int i=0 ; i < newString.length() * matchRequirement ; i++)
for (int i = 0; i < newString.length() * matchRequirement; i++)
{
int matchFromIndex = 0;
//Look for substrings starting at i
for (int j=0 ; j < oldString.length() ; j++)
// Look for substrings starting at i
for (int j = 0; j < oldString.length(); j++)
{
//End of newString
if (i+j >= newString.length())
// End of newString
if (i + j >= newString.length())
{
break;
}
//Matched
if (newString.charAt(i+j) == oldString.charAt(j))
// Matched
if (newString.charAt(i + j) == oldString.charAt(j))
{
matchFromIndex++;
if (matchFromIndex >= newString.length() * matchRequirement)
return true;
}
//No Match > Reset
// No Match > Reset
else
{
break;
}
}
}
return false;
}
public static <T> String listToString(Collection<T> inputList, boolean comma)
{
String out = "";
for (T cur : inputList)
{
out += cur.toString() + (comma ? ", " : " ");
}
if (out.length() > 0)
{
out = out.substring(0, out.length() - (comma ? 2 : 1));
}
return out;
}
public static int lowerCaseCount(String input)
{
int count = 0;
for (int k = 0; k < input.length(); k++)
{
char ch = input.charAt(k);
if (Character.isLowerCase(ch))
count++;
}
return count;
}
public static int upperCaseCount(String input)
{
int count = 0;
for (int k = 0; k < input.length(); k++)
{
char ch = input.charAt(k);
if (Character.isUpperCase(ch))
count++;
}
return count;
}
public static String[] wrap(String text, int lineLength)
{
return wrap(text, lineLength, true);
}
public static String[] wrap(String text, int lineLength, boolean wrapLongerWords) {
public static String[] wrap(String text, int lineLength, boolean wrapLongerWords)
{
return WordUtils.wrap(text, lineLength, "\00D0", wrapLongerWords).split("\00D0");
}
public static String repeat(String txt, int times)
{
return new String(new byte[times]).replace("\0", txt);
}
public static boolean plural(int x){
public static boolean plural(int x)
{
return x <= 0 ? true : x > 1;
}
public static String trim(int maxLength, String s) {
public static String trim(int maxLength, String s)
{
return s.length() <= maxLength ? s : s.substring(0, maxLength);
}
}
public static <X> String arrayToString(X[] array, String delimiter)
{
StringBuilder string = new StringBuilder();
int index = 0;
for (X x : array)
{
string.append(x.toString());
if (index != array.length - 1)
{
string.append(delimiter);
}
index++;
}
return string.toString();
}
public static <X> String arrayToString(X[] array)
{
return arrayToString(array, null);
}
}

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<classpathentry kind="var" path="REPO_DIR/Plugins/Libraries/httpcore-4.2.jar"/>
<classpathentry kind="var" path="REPO_DIR/Plugins/Libraries/httpclient-4.2.jar"/>
<classpathentry kind="var" path="REPO_DIR/Plugins/Libraries/commons-codec-1.6.jar"/>

View File

@ -1,12 +1,12 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.7
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.7
org.eclipse.jdt.core.compiler.source=1.8

View File

@ -19,13 +19,13 @@ import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
import net.minecraft.server.v1_8_R3.DataWatcher;
import net.minecraft.server.v1_8_R3.DataWatcher.WatchableObject;
import net.minecraft.server.v1_8_R3.MathHelper;
import net.minecraft.server.v1_8_R3.Packet;
import net.minecraft.server.v1_8_R3.PacketPlayInUseEntity;
import net.minecraft.server.v1_8_R3.PacketPlayInUseEntity.EnumEntityUseAction;
import net.minecraft.server.v1_8_R3.PacketPlayOutAttachEntity;
import net.minecraft.server.v1_8_R3.PacketPlayOutEntityDestroy;
import net.minecraft.server.v1_8_R3.PacketPlayOutEntityMetadata;
import net.minecraft.server.v1_8_R3.PacketPlayOutNamedEntitySpawn;
import net.minecraft.server.v1_8_R3.PacketPlayOutSpawnEntity;
import net.minecraft.server.v1_8_R3.PacketPlayOutSpawnEntityLiving;
@ -49,8 +49,10 @@ import fr.neatmonster.nocheatplus.hooks.NCPHookManager;
public class CustomTagFix extends MiniPlugin implements IPacketHandler, NCPHook
{
private NautHashMap<String, NautHashMap<Integer, Integer>> _entityMap = new NautHashMap<String, NautHashMap<Integer, Integer>>();
private NautHashMap<String, NautHashMap<Integer, Integer[]>> _entityMap = new NautHashMap<String, NautHashMap<Integer, Integer[]>>();
private NautHashMap<String, NautHashMap<Integer, String>> _entityNameMap = new NautHashMap<String, NautHashMap<Integer, String>>();
private NautHashMap<String, NautHashMap<Integer, Integer>> _entityRiding = new NautHashMap<String, NautHashMap<Integer, Integer>>();
private HashSet<String> _loggedIn = new HashSet<String>();
private HashSet<Integer> _ignoreSkulls = new HashSet<Integer>();
@ -63,7 +65,7 @@ public class CustomTagFix extends MiniPlugin implements IPacketHandler, NCPHook
packetHandler.addPacketHandler(this, true, PacketPlayOutAttachEntity.class, PacketPlayOutEntityDestroy.class,
PacketPlayOutEntityMetadata.class, PacketPlayOutSpawnEntity.class, PacketPlayOutSpawnEntityLiving.class,
PacketPlayInUseEntity.class);
PacketPlayOutNamedEntitySpawn.class, PacketPlayInUseEntity.class, PacketPlayOutAttachEntity.class);
NCPHookManager.addHook(CheckType.MOVING_SURVIVALFLY, this);
NCPHookManager.addHook(CheckType.MOVING_PASSABLE, this);
@ -75,6 +77,7 @@ public class CustomTagFix extends MiniPlugin implements IPacketHandler, NCPHook
{
_entityMap.remove(event.getPlayer().getName());
_entityNameMap.remove(event.getPlayer().getName());
_entityRiding.remove(event.getPlayer().getName());
_loggedIn.remove(event.getPlayer());
}
@ -167,6 +170,7 @@ public class CustomTagFix extends MiniPlugin implements IPacketHandler, NCPHook
iterator.remove();
_entityMap.remove(player);
_entityNameMap.remove(player);
_entityRiding.remove(player);
}
}
@ -190,7 +194,7 @@ public class CustomTagFix extends MiniPlugin implements IPacketHandler, NCPHook
{
if (owner.isOnline() && !_entityMap.containsKey(owner.getName()))
{
_entityMap.put(owner.getName(), new NautHashMap<Integer, Integer>());
_entityMap.put(owner.getName(), new NautHashMap<Integer, Integer[]>());
_entityNameMap.put(owner.getName(), new NautHashMap<Integer, String>());
_loggedIn.add(owner.getName());
}
@ -217,10 +221,15 @@ public class CustomTagFix extends MiniPlugin implements IPacketHandler, NCPHook
{
if (_entityMap.get(owner.getName()).containsKey(spawnPacket.a))
{
UtilPlayer.sendPacket(owner, new PacketPlayOutEntityDestroy(new int[]
{
_entityMap.get(owner.getName()).get(spawnPacket.a)
}));
Integer[] ids = _entityMap.get(owner.getName()).get(spawnPacket.a);
int[] newIds = new int[ids.length];
for (int a = 0; a < ids.length; a++)
{
newIds[a] = ids[a];
}
UtilPlayer.sendPacket(owner, new PacketPlayOutEntityDestroy(newIds));
_entityNameMap.get(owner.getName()).remove(spawnPacket.a);
_entityMap.get(owner.getName()).remove(spawnPacket.a);
@ -236,9 +245,59 @@ public class CustomTagFix extends MiniPlugin implements IPacketHandler, NCPHook
int newId = UtilEnt.getNewEntityId();
_entityNameMap.get(owner.getName()).put(spawnPacket.a, entityName);
_entityMap.get(owner.getName()).put(spawnPacket.a, newId);
_entityMap.get(owner.getName()).put(spawnPacket.a, new Integer[]
{
newId
});
sendProtocolPackets(owner, spawnPacket.a, newId, entityName, verifier, true);
sendProtocolPackets(owner, spawnPacket.a, newId, entityName, verifier, true, -1);
break;
}
}
}
else if (packet instanceof PacketPlayOutNamedEntitySpawn)
{
PacketPlayOutNamedEntitySpawn spawnPacket = (PacketPlayOutNamedEntitySpawn) packet;
for (WatchableObject watchable : (List<WatchableObject>) spawnPacket.i.c())
{
if (watchable.a() == 3 && watchable.b() instanceof Byte && ((Byte) watchable.b()) == 1)
{
if (_entityMap.get(owner.getName()).containsKey(spawnPacket.a))
{
Integer[] ids = _entityMap.get(owner.getName()).get(spawnPacket.a);
int[] newIds = new int[ids.length];
for (int a = 0; a < ids.length; a++)
{
newIds[a] = ids[a];
}
UtilPlayer.sendPacket(owner, new PacketPlayOutEntityDestroy(newIds));
_entityNameMap.get(owner.getName()).remove(spawnPacket.a);
_entityMap.get(owner.getName()).remove(spawnPacket.a);
}
final String entityName = spawnPacket.i.getString(2);
if (entityName.isEmpty())
{
return;
}
int newId = UtilEnt.getNewEntityId();
int newId2 = UtilEnt.getNewEntityId();
_entityNameMap.get(owner.getName()).put(spawnPacket.a, entityName);
_entityMap.get(owner.getName()).put(spawnPacket.a, new Integer[]
{
newId,
newId2
});
sendProtocolPackets(owner, spawnPacket.a, newId2, entityName, verifier, true, newId);
break;
}
}
@ -247,7 +306,7 @@ public class CustomTagFix extends MiniPlugin implements IPacketHandler, NCPHook
{
PacketPlayOutEntityMetadata metaPacket = (PacketPlayOutEntityMetadata) packet;
if (metaPacket.a != 777777 && !_ignoreSkulls.contains(metaPacket.a))
if (metaPacket.a != 777777 && !_ignoreSkulls.contains(metaPacket.a) && metaPacket.a != owner.getEntityId())
{
boolean isDisplaying = _entityMap.get(owner.getName()).containsKey(metaPacket.a);
String currentName = _entityNameMap.get(owner.getName()).get(metaPacket.a);
@ -279,7 +338,7 @@ public class CustomTagFix extends MiniPlugin implements IPacketHandler, NCPHook
// If name is still being displayed
if (newDisplay)
{
int newId;
Integer[] newId;
if (isDisplaying) // Sending metadata
{
@ -288,22 +347,28 @@ public class CustomTagFix extends MiniPlugin implements IPacketHandler, NCPHook
else
// Spawning new entity
{
newId = UtilEnt.getNewEntityId();
newId = new Integer[]
{
UtilEnt.getNewEntityId()
};
_entityMap.get(owner.getName()).put(metaPacket.a, newId);
}
sendProtocolPackets(owner, metaPacket.a, newId, newName, verifier, !isDisplaying);
_entityNameMap.get(owner.getName()).put(metaPacket.a, newName);
sendProtocolPackets(owner, metaPacket.a, newId[0], newName, verifier, !isDisplaying, -1);
}
else
{ // Lets delete it
int id = _entityMap.get(owner.getName()).get(metaPacket.a);
Integer[] ids = _entityMap.get(owner.getName()).get(metaPacket.a);
int[] newIds = new int[ids.length];
verifier.bypassProcess(new PacketPlayOutEntityDestroy(new int[]
{
id
}));
for (int a = 0; a < ids.length; a++)
{
newIds[a] = ids[a];
}
verifier.bypassProcess(new PacketPlayOutEntityDestroy(newIds));
_entityMap.get(owner.getName()).remove(metaPacket.a);
_entityNameMap.get(owner.getName()).remove(metaPacket.a);
@ -319,10 +384,15 @@ public class CustomTagFix extends MiniPlugin implements IPacketHandler, NCPHook
{
if (_entityMap.get(owner.getName()).containsKey(id))
{
UtilPlayer.sendPacket(owner, new PacketPlayOutEntityDestroy(new int[]
{
_entityMap.get(owner.getName()).get(id)
}));
Integer[] ids = _entityMap.get(owner.getName()).get(id);
int[] newIds = new int[ids.length];
for (int a = 0; a < ids.length; a++)
{
newIds[a] = ids[a];
}
UtilPlayer.sendPacket(owner, new PacketPlayOutEntityDestroy(newIds));
_entityMap.get(owner.getName()).remove(id);
_entityNameMap.get(owner.getName()).remove(id);
}
@ -345,19 +415,79 @@ public class CustomTagFix extends MiniPlugin implements IPacketHandler, NCPHook
{
PacketPlayInUseEntity usePacket = (PacketPlayInUseEntity) packet;
for (Entry<Integer, Integer> entry : _entityMap.get(owner.getName()).entrySet())
{
if (entry.getValue() == usePacket.a)
{
PacketPlayInUseEntity newPacket = new PacketPlayInUseEntity();
newPacket.a = entry.getKey();
newPacket.action = usePacket.action == EnumEntityUseAction.ATTACK ? EnumEntityUseAction.ATTACK
: EnumEntityUseAction.INTERACT;
loop:
for (Entry<Integer, Integer[]> entry : _entityMap.get(owner.getName()).entrySet())
{
for (int id : entry.getValue())
{
if (id == usePacket.a)
{
((CraftPlayer) owner).getHandle().playerConnection.a(newPacket);
PacketPlayInUseEntity newPacket = new PacketPlayInUseEntity();
newPacket.a = entry.getKey();
newPacket.action = usePacket.action == EnumEntityUseAction.ATTACK ? EnumEntityUseAction.ATTACK
: EnumEntityUseAction.INTERACT;
{
((CraftPlayer) owner).getHandle().playerConnection.a(newPacket);
}
break loop;
}
break;
}
}
}
else if (packet instanceof PacketPlayOutAttachEntity)
{
PacketPlayOutAttachEntity attachPacket = (PacketPlayOutAttachEntity) packet;
// c = rider, b = ridden
// When detaching, c is sent, b is -1
// If this attach packet is for a player that has the fix
// If the attach packet isn't ordained by me
if (!_entityMap.containsKey(owner.getName()))
{
return;
}
if (!_entityRiding.containsKey(owner.getName()))
{
_entityRiding.put(owner.getName(), new NautHashMap<Integer, Integer>());
}
int vehicleId = -1;
if (_entityRiding.get(owner.getName()).containsKey(attachPacket.b))
{
vehicleId = _entityRiding.get(owner.getName()).get(attachPacket.b);
}
if (attachPacket.c == -1 && _entityMap.get(owner.getName()).containsKey(vehicleId))
{
Integer[] ids = _entityMap.get(owner.getName()).get(vehicleId);
_entityRiding.get(owner.getName()).remove(attachPacket.b);
sendProtocolPackets(owner, vehicleId, ids[ids.length - 1],
_entityNameMap.get(owner.getName()).get(vehicleId), verifier, true, ids.length > 1 ? ids[0] : -1);
}
else
{
Integer[] ids = _entityMap.get(owner.getName()).get(attachPacket.c);
if (ids != null && ids[0] != attachPacket.b)
{
_entityRiding.get(owner.getName()).put(attachPacket.b, attachPacket.c);
int[] newIds = new int[ids.length];
for (int a = 0; a < ids.length; a++)
{
newIds[a] = ids[a];
}
UtilPlayer.sendPacket(owner, new PacketPlayOutEntityDestroy(newIds));
}
}
}
@ -365,7 +495,7 @@ public class CustomTagFix extends MiniPlugin implements IPacketHandler, NCPHook
}
private void sendProtocolPackets(final Player owner, final int entityId, final int newEntityId, String entityName,
final PacketVerifier packetList, final boolean newPacket)
final PacketVerifier packetList, final boolean newPacket, final int squidId)
{
CustomTagEvent event = new CustomTagEvent(owner, entityId, entityName);
_plugin.getServer().getPluginManager().callEvent(event);
@ -375,82 +505,47 @@ public class CustomTagFix extends MiniPlugin implements IPacketHandler, NCPHook
{
public void run()
{
final DataWatcher watcher = new DataWatcher(new DummyEntity(((CraftWorld) owner.getWorld()).getHandle()));
DataWatcher watcher = new DataWatcher(new DummyEntity(((CraftWorld) owner.getWorld()).getHandle()));
watcher.a(0, Byte.valueOf((byte) 0));
watcher.a(0, (byte) (0 | 1 << 5)); // Invisible
watcher.a(1, Short.valueOf((short) 300));
watcher.a(2, "");
watcher.a(3, Byte.valueOf((byte) 0));
watcher.a(2, finalEntityName);
watcher.a(3, (byte) 1);
watcher.a(4, Byte.valueOf((byte) 0));
watcher.a(7, Integer.valueOf(0));
watcher.a(8, Byte.valueOf((byte) 0));
watcher.a(9, Byte.valueOf((byte) 0));
watcher.a(6, Float.valueOf(1.0F));
watcher.a(10, Byte.valueOf((byte) 0));
// Set invisible
int i1 = watcher.getByte(0);
watcher.watch(0, Byte.valueOf((byte) (i1 | 1 << 5)));
// Set small
byte b1 = watcher.getByte(10);
b1 = (byte) (b1 | 0x1);
watcher.watch(10, Byte.valueOf(b1));
watcher.watch(2, finalEntityName);
watcher.watch(3, Byte.valueOf((byte) 1));
watcher.a(10, (byte) (0 | 0x1)); // Small
if (newPacket)
{
if (squidId >= 0)
{
watcher.watch(10, (byte) 16);
DataWatcher squidWatcher = new DataWatcher(new DummyEntity(((CraftWorld) owner.getWorld()).getHandle()));
squidWatcher.a(0, (byte) (0 | 1 << 5));
final PacketPlayOutSpawnEntityLiving spawnPacket = new PacketPlayOutSpawnEntityLiving();
spawnPacket.a = squidId;
spawnPacket.b = (byte) EntityType.SQUID.getTypeId();
spawnPacket.l = squidWatcher;
UtilPlayer.sendPacket(owner, spawnPacket);
PacketPlayOutAttachEntity vehiclePacket = new PacketPlayOutAttachEntity();
vehiclePacket.a = 0;
vehiclePacket.b = spawnPacket.a;
vehiclePacket.c = entityId;
UtilPlayer.sendPacket(owner, vehiclePacket);
}
final PacketPlayOutSpawnEntityLiving spawnPacket = new PacketPlayOutSpawnEntityLiving();
spawnPacket.a = newEntityId;
spawnPacket.b = (byte) 30;
spawnPacket.c = (int) MathHelper.floor(100 * 32);
spawnPacket.d = (int) MathHelper.floor(64 * 32.0D);
spawnPacket.e = (int) MathHelper.floor(100 * 32);
spawnPacket.i = (byte) ((int) (0 * 256.0F / 360.0F));
spawnPacket.j = (byte) ((int) (0 * 256.0F / 360.0F));
spawnPacket.k = (byte) ((int) (0 * 256.0F / 360.0F));
double var2 = 3.9D;
double var4 = 0;
double var6 = 0;
double var8 = 0;
if (var4 < -var2)
{
var4 = -var2;
}
if (var6 < -var2)
{
var6 = -var2;
}
if (var8 < -var2)
{
var8 = -var2;
}
if (var4 > var2)
{
var4 = var2;
}
if (var6 > var2)
{
var6 = var2;
}
if (var8 > var2)
{
var8 = var2;
}
spawnPacket.f = (int) (var4 * 8000.0D);
spawnPacket.g = (int) (var6 * 8000.0D);
spawnPacket.h = (int) (var8 * 8000.0D);
spawnPacket.l = watcher;
@ -459,7 +554,7 @@ public class CustomTagFix extends MiniPlugin implements IPacketHandler, NCPHook
PacketPlayOutAttachEntity vehiclePacket = new PacketPlayOutAttachEntity();
vehiclePacket.a = 0;
vehiclePacket.b = spawnPacket.a;
vehiclePacket.c = entityId;
vehiclePacket.c = squidId >= 0 ? squidId : entityId;
UtilPlayer.sendPacket(owner, vehiclePacket);
}

View File

@ -345,7 +345,10 @@ public class AntiHack extends MiniPlugin
}
//Auto-Kick
if (!handled && _clientManager.Get(player).GetRank() != Rank.YOUTUBE && _clientManager.Get(player).GetRank() != Rank.TWITCH)
if (!handled &&
_clientManager.Get(player).GetRank() != Rank.YOUTUBE &&
_clientManager.Get(player).GetRank() != Rank.YOUTUBE_SMALL &&
_clientManager.Get(player).GetRank() != Rank.TWITCH)
{
player.playSound(player.getLocation(), Sound.ENDERDRAGON_GROWL, 2f, 0.5f);

View File

@ -16,6 +16,8 @@ import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.player.PlayerMoveEvent;
import org.bukkit.potion.PotionEffect;
import org.bukkit.potion.PotionEffectType;
public class Fly extends MiniPlugin implements Detector
{
@ -128,6 +130,10 @@ public class Fly extends MiniPlugin implements Detector
}
}
for (PotionEffect effect : player.getActivePotionEffects())
if (effect.getType() == PotionEffectType.JUMP || effect.getType().equals(PotionEffectType.JUMP))
nearBlocks = true;
if (nearBlocks)
{
count = 0;

View File

@ -7,29 +7,21 @@ import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Timestamp;
import java.sql.Types;
import java.util.Map;
import com.sun.org.apache.xpath.internal.operations.Bool;
import mineplex.core.bonuses.gui.SpinGui;
import mineplex.core.common.Pair;
import mineplex.core.common.util.Callback;
import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.database.DBPool;
import mineplex.core.database.RepositoryBase;
import mineplex.core.database.ResultSetCallable;
import mineplex.core.database.column.ColumnInt;
import mineplex.core.donation.DonationManager;
import mineplex.core.recharge.Recharge;
import mineplex.database.Tables;
import mineplex.database.tables.records.BonusRecord;
import org.jooq.Configuration;
import org.jooq.DSLContext;
import org.jooq.Record2;
import org.jooq.SQLDialect;
import org.jooq.TableField;
import org.jooq.impl.DSL;
import org.jooq.impl.DefaultConfiguration;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;

View File

@ -1,6 +1,7 @@
package mineplex.core.cosmetic.ui.page;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import org.bukkit.Bukkit;
@ -9,13 +10,14 @@ import org.bukkit.Sound;
import org.bukkit.entity.Player;
import org.bukkit.event.inventory.ClickType;
import com.sun.org.glassfish.gmbal.ManagedAttribute;
import mineplex.core.account.CoreClientManager;
import mineplex.core.common.CurrencyType;
import mineplex.core.common.util.C;
import mineplex.core.cosmetic.CosmeticManager;
import mineplex.core.cosmetic.ui.CosmeticShop;
import mineplex.core.donation.DonationManager;
import mineplex.core.gadget.gadgets.outfit.OutfitRaveSuit;
import mineplex.core.gadget.gadgets.outfit.OutfitSpaceSuit;
import mineplex.core.gadget.types.Gadget;
import mineplex.core.gadget.types.GadgetType;
import mineplex.core.gadget.types.ItemGadget;
@ -39,19 +41,20 @@ public class CostumePage extends GadgetPage
{
int slot;
List<Class> costumeClasses = new ArrayList<Class>();
for (Gadget gadget : getPlugin().getGadgetManager().getGadgets(GadgetType.Costume))
{
if (gadget.GetCost(CurrencyType.Coins) == -1)
continue;
OutfitGadget outfitGadget = ((OutfitGadget) gadget);
Class clazz = gadget.getClass();
if (!costumeClasses.contains(clazz))
{
costumeClasses.add(clazz);
}
slot = (costumeClasses.indexOf(clazz) * 2) + 3 + 18;
int offset = 0;
if (gadget instanceof OutfitRaveSuit) offset = 0;
else if (gadget instanceof OutfitSpaceSuit) offset = 1;
else offset = 2;
slot = offset + 1 + 18; //1 buffer to left, 18 = 2 lines down
if (outfitGadget.GetSlot() == OutfitGadget.ArmorSlot.Chest)
slot += 9;

View File

@ -4,6 +4,8 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import net.md_5.bungee.api.ChatColor;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.event.inventory.ClickType;
@ -20,7 +22,6 @@ import mineplex.core.cosmetic.ui.button.DeactivateGadgetButton;
import mineplex.core.cosmetic.ui.button.GadgetButton;
import mineplex.core.donation.DonationManager;
import mineplex.core.gadget.gadgets.morph.MorphBlock;
import mineplex.core.gadget.gadgets.morph.MorphNotch;
import mineplex.core.gadget.types.Gadget;
import mineplex.core.gadget.types.GadgetType;
import mineplex.core.gadget.types.ItemGadget;
@ -69,68 +70,182 @@ public class GadgetPage extends ShopPageBase<CosmeticManager, CosmeticShop>
protected void addGadget(Gadget gadget, int slot)
{
if (gadget instanceof MorphNotch)
{
//setItem(slot, new ShopItem(gadget.GetDisplayMaterial(), gadget.GetDisplayData(), "Disabled " + gadget.GetName(), new String[] { "Sorry! Currently disabled until fix is made for 1.8 players!" }, 1, false, false));
//return;
}
else if (gadget instanceof MorphBlock)
if (gadget instanceof MorphBlock)
{
//Prevent stacker bug
if (getPlayer().getPassenger() != null)
return;
}
List<String> itemLore = new ArrayList<String>();
if (gadget.GetCost(CurrencyType.Coins) >= 0)
{
itemLore.add(C.cYellow + gadget.GetCost(CurrencyType.Coins) + " Coins");
}
else if (gadget.GetCost(CurrencyType.Coins) == -2)
{
itemLore.add(C.cGold + "Found in Treasure Chests.");
}
else if (gadget.GetCost(CurrencyType.Coins) == -3)
{
}
itemLore.add(C.cBlack);
itemLore.addAll(Arrays.asList(gadget.GetDescription()));
if (gadget.getSet() != null)
{
itemLore.add(C.cBlack);
itemLore.add(C.cGray + gadget.getSet().getName() + " Set;");
//Elements
for (Gadget cur : gadget.getSet().getGadgets())
itemLore.add(" "+ (cur.ownsGadget(getPlayer()) ? C.cDGreen + '▪' : C.cDRed + '▪' ) + (cur.IsActive(getPlayer()) ? C.cGreen : C.cGray) + cur.GetName());
itemLore.add(C.cBlack);
//Bonus
itemLore.add(C.cGray + gadget.getSet().getName() + " Set Bonus;");
for (String bonus : gadget.getSet().getBonus())
itemLore.add(" " + (gadget.getSet().isActive(getPlayer()) ? C.cGreen : C.cGray) + bonus);
}
if (!gadget.ownsGadget(getPlayer()))
{
if (gadget.GetCost(CurrencyType.Coins) == -1)
{
//Nothing
}
//Chest Unlocks
else if (gadget.GetCost(CurrencyType.Coins) == -2 || gadget.GetCost(CurrencyType.Coins) > 0)
{
itemLore.add(C.cBlack);
itemLore.add(C.cBlue + "Found in Treasure Chests");
}
else if (gadget.GetCost(CurrencyType.Coins) == -3)
{
itemLore.add(C.cBlack);
itemLore.add(C.cBlue + "Found in Winter Holiday Treasure");
}
else if (gadget.GetCost(CurrencyType.Coins) == -4)
{
itemLore.add(C.cBlack);
itemLore.add(C.cBlue + "Found in Halloween Pumpkin Treasure");
}
else if (gadget.GetCost(CurrencyType.Coins) == -5)
{
itemLore.add(C.cBlack);
itemLore.add(C.cBlue + "Found in Easter Holiday Treasure");
}
//Rank Unlocks
else if (gadget.GetCost(CurrencyType.Coins) == -10)
{
itemLore.add(C.cBlack);
itemLore.add(C.cAqua + "Unlocked with Ultra Rank");
}
else if (gadget.GetCost(CurrencyType.Coins) == -11)
{
itemLore.add(C.cBlack);
itemLore.add(C.cPurple + "Unlocked with Hero Rank");
}
else if (gadget.GetCost(CurrencyType.Coins) == -12)
{
itemLore.add(C.cBlack);
itemLore.add(C.cGreen + "Unlocked with Legend Rank");
}
else if (gadget.GetCost(CurrencyType.Coins) == -13)
{
itemLore.add(C.cBlack);
itemLore.add(C.cRed + "Unlocked with Titan Rank");
}
}
//Special case for item gadgets!
if (gadget instanceof ItemGadget)
{
ItemGadget itemGadget = (ItemGadget)gadget;
itemLore.add(C.cBlack);
itemLore.add(C.cGreen + "Right-Click To Purchase:");
itemLore.add(C.cWhite + ((ItemGadget)gadget).getAmmo().GetDisplayName() + " for " + C.cYellow + ((ItemGadget)gadget).getAmmo().GetCost(CurrencyType.Coins) + " Coins");
itemLore.add(C.cBlack);
itemLore.add(C.cWhite + "Your Ammo : " + C.cGreen + getPlugin().getInventoryManager().Get(getPlayer()).getItemCount(gadget.GetName()));
itemLore.add(C.cWhite + "You Have: " + C.cGreen + getPlugin().getInventoryManager().Get(getPlayer()).getItemCount(gadget.GetName()));
boolean canAffordAmmo = true;
if (itemGadget.getAmmo().GetCost(CurrencyType.Coins) > 0)
{
itemLore.add(C.cBlack);
itemLore.add(C.cWhite + ((ItemGadget)gadget).getAmmo().GetDisplayName() + " for " + C.cYellow + ((ItemGadget)gadget).getAmmo().GetCost(CurrencyType.Coins) + " Coins");
if (getDonationManager().Get(getPlayer().getName()).GetBalance(CurrencyType.Coins) >= itemGadget.getAmmo().GetCost(CurrencyType.Coins))
{
itemLore.add(C.cGreen + "Right-Click To Purchase");
}
else
{
itemLore.add(C.cRed + "Not Enough Treasure Shards.");
canAffordAmmo = false;
}
}
if (itemGadget.hasAmmo(getPlayer()))
{
itemLore.add(C.cBlack);
itemLore.add(C.cGreen + "Left-Click to Enable");
addButton(slot, new ShopItem(gadget.GetDisplayMaterial(), gadget.GetDisplayData(), gadget.GetName(), itemLore.toArray(new String[itemLore.size()]), 1, false, false), new ActivateGadgetButton(gadget, this));
}
else
{
addButton(slot, new ShopItem(gadget.GetDisplayMaterial(), gadget.GetDisplayData(), gadget.GetName(), itemLore.toArray(new String[itemLore.size()]), 1, true, false), new ActivateGadgetButton(gadget, this));
}
return;
}
//Standard
if (gadget.ownsGadget(getPlayer()))
{
if (gadget.GetActive().contains(getPlayer()))
{
addButton(slot, new ShopItem(gadget.GetDisplayMaterial(), gadget.GetDisplayData(), "Deactivate " + gadget.GetName(), itemLore.toArray(new String[itemLore.size()]), 1, false, false), new DeactivateGadgetButton(gadget, this));
itemLore.add(C.cBlack);
itemLore.add(C.cGreen + "Click to Disable");
addButton(slot, new ShopItem(gadget.GetDisplayMaterial(), gadget.GetDisplayData(), gadget.GetName(), itemLore.toArray(new String[itemLore.size()]), 1, false, false), new DeactivateGadgetButton(gadget, this));
}
else
{
addButton(slot, new ShopItem(gadget.GetDisplayMaterial(), gadget.GetDisplayData(), "Activate " + gadget.GetName(), itemLore.toArray(new String[itemLore.size()]), 1, false, false), new ActivateGadgetButton(gadget, this));
itemLore.add(C.cBlack);
itemLore.add(C.cGreen + "Click to Enable");
addButton(slot, new ShopItem(gadget.GetDisplayMaterial(), gadget.GetDisplayData(), gadget.GetName(), itemLore.toArray(new String[itemLore.size()]), 1, false, false), new ActivateGadgetButton(gadget, this));
}
}
else
{
else
{
if (gadget.GetCost(CurrencyType.Coins) > 0)
{
itemLore.add(C.cBlack);
itemLore.add(C.cWhiteB + "Cost: " + C.cAqua + gadget.GetCost(CurrencyType.Coins) + " Treasure Shards");
}
if (gadget.GetCost(CurrencyType.Coins) > 0 && getDonationManager().Get(getPlayer().getName()).GetBalance(CurrencyType.Coins) >= gadget.GetCost(CurrencyType.Coins))
addButton(slot, new ShopItem(Material.INK_SACK, (byte) 8, (gadget.GetCost(CurrencyType.Coins) < 0 ? "" : "Purchase ") + gadget.GetName(), itemLore.toArray(new String[itemLore.size()]), 1, false, false), new GadgetButton(gadget, this));
else
setItem(slot, new ShopItem(Material.INK_SACK, (byte)8, (gadget.GetCost(CurrencyType.Coins) < 0 ? "" : "Purchase ") + gadget.GetName(), itemLore.toArray(new String[itemLore.size()]), 1, true, false));
{
itemLore.add(C.cBlack);
itemLore.add(C.cGreen + "Click to Purchase");
addButton(slot, new ShopItem(Material.INK_SACK, (byte) 8, gadget.GetName(), itemLore.toArray(new String[itemLore.size()]), 1, true, false), new GadgetButton(gadget, this));
}
else if (gadget.GetCost(CurrencyType.Coins) > 0)
{
itemLore.add(C.cBlack);
itemLore.add(C.cRed + "Not enough Treasure Shards.");
setItem(slot, new ShopItem(Material.INK_SACK, (byte)8, gadget.GetName(), itemLore.toArray(new String[itemLore.size()]), 1, true, false));
}
else
{
setItem(slot, new ShopItem(Material.INK_SACK, (byte)8, gadget.GetName(), itemLore.toArray(new String[itemLore.size()]), 1, true, false));
}
}
}
public void purchaseGadget(final Player player, final Gadget gadget)
{
//Dont allow purchase!
if (gadget instanceof ItemGadget)
{
ItemGadget itemGadget = (ItemGadget)gadget;
if (itemGadget.getAmmo().GetCost(CurrencyType.Coins) < 0)
return;
}
if(getClientManager().Get(player).isDisguised())
{
UtilPlayer.message(player, F.main("Disguise", "You cant buy things while you are disguised!"));

View File

@ -53,37 +53,20 @@ public class Menu extends ShopPageBase<CosmeticManager, CosmeticShop>
// " "
// }, 1, false));
addItem(4, new ShopItem(175, getDonationManager().Get(getPlayer().getName()).getCoins() + " Coins", new String[]
{
" ",
ChatColor.RESET + C.cYellow + "Purchase Coins",
ChatColor.RESET + "www.mineplex.com/shop",
" ",
ChatColor.RESET + C.cAqua + "Ultra Rank",
ChatColor.RESET + "Receives 7500 Coins per Month",
" ",
ChatColor.RESET + C.cPurple + "Hero Rank",
ChatColor.RESET + "Receives 15000 Coins per Month",
" ",
ChatColor.RESET + C.cGreen + "Legend Rank",
ChatColor.RESET + "Receives 30000 Coins per Month"
}, 1, false));
addButton(10, new ShopItem(Material.NETHER_STAR, "Particle Effects", 1, false), new OpenParticles(this));
addButton(12, new ShopItem(Material.ARROW, "Arrow Trails", 1, false), new OpenArrowTrails(this));
addButton(14, new ShopItem(Material.GOLD_BOOTS, "Double Jump Effects", 1, false), new OpenDoubleJump(this));
addButton(16, new ShopItem(Material.SKULL_ITEM, "Death Animations", 1, false), new OpenDeathAnimations(this));
addButton(1, new ShopItem(Material.NETHER_STAR, "Particle Effects", 1, false), new OpenParticles(this));
addButton(3, new ShopItem(Material.ARROW, "Arrow Trails", 1, false), new OpenArrowTrails(this));
addButton(5, new ShopItem(Material.GOLD_BOOTS, "Double Jump Effects", 1, false), new OpenDoubleJump(this));
addButton(7, new ShopItem(Material.SKULL_ITEM, "Death Animations", 1, false), new OpenDeathAnimations(this));
addButton(28, new ShopItem(Material.MELON_BLOCK, "Gadgets", 1, false), new OpenGadgets(this));
addButton(30, new ShopItem(Material.LEATHER, "Morphs", 1, false), new OpenMorphs(this));
addButton(32, new ShopItem(Material.IRON_BARDING, "Mounts", 1, false), new OpenMounts(this));
addButton(34, new ShopItem(Material.BONE, "Pets", 1, false), new OpenPets(this));
addButton(19, new ShopItem(Material.MELON_BLOCK, "Gadgets", 1, false), new OpenGadgets(this));
addButton(21, new ShopItem(Material.LEATHER, "Morphs", 1, false), new OpenMorphs(this));
addButton(23, new ShopItem(Material.IRON_BARDING, "Mounts", 1, false), new OpenMounts(this));
addButton(25, new ShopItem(Material.BONE, "Pets", 1, false), new OpenPets(this));
addButton(46, new ShopItem(Material.GOLD_HELMET, "Hats", 1, false), new OpenHats(this));
addButton(48, new ShopItem(Material.DIAMOND_CHESTPLATE, "Costumes", 1, false), new OpenCostumes(this));
addButton(50, new ShopItem(Material.GREEN_RECORD, "Music", 1, false), new OpenMusic(this));
addButton(52, new ShopItem(Material.NAME_TAG, "Taunts", new String[]{C.Bold + "", C.cDGreen + C.Italics + "Coming soon!"}, 1, false), new IButton()
addButton(37, new ShopItem(Material.GOLD_HELMET, "Hats", 1, false), new OpenHats(this));
addButton(39, new ShopItem(Material.DIAMOND_CHESTPLATE, "Costumes", 1, false), new OpenCostumes(this));
addButton(41, new ShopItem(Material.GREEN_RECORD, "Music", 1, false), new OpenMusic(this));
addButton(43, new ShopItem(Material.NAME_TAG, "Taunts", new String[]{C.Bold + "", C.cDGreen + C.Italics + "Coming soon!"}, 1, false), new IButton()
{
@Override
public void onClick(Player player, ClickType clickType)
@ -101,37 +84,37 @@ public class Menu extends ShopPageBase<CosmeticManager, CosmeticShop>
switch (type)
{
case Particle:
slot = 10;
slot = 1;
break;
case ArrowTrail:
slot = 12;
slot = 3;
break;
case DoubleJump:
slot = 14;
slot = 5;
break;
case Death:
slot = 16;
slot = 7;
break;
case Item:
slot = 28;
slot = 19;
break;
case Morph:
slot = 30;
slot = 21;
break;
case Hat:
slot = 46;
slot = 37;
break;
case Costume:
slot = 48;
slot = 39;
break;
case MusicDisc:
slot = 50;
slot = 41;
break;
case Taunt:
slot = 52;
slot = 43;
break;
default:
slot = 10;
slot = 1;
break;
}
slot += 9;
@ -151,7 +134,7 @@ public class Menu extends ShopPageBase<CosmeticManager, CosmeticShop>
{
final Mount<?> mount = getPlugin().getMountManager().getActive(getPlayer());
addButton(32 + 9,
addButton(23 + 9,
new ShopItem(mount.GetDisplayMaterial(), mount.GetDisplayData(), C.mItem + mount.GetName(), new String[0], 1, false, false),
new IButton()
{
@ -168,7 +151,7 @@ public class Menu extends ShopPageBase<CosmeticManager, CosmeticShop>
{
Creature activePet = getPlugin().getPetManager().getActivePet(getPlayer().getName());
String petName = activePet.getType() == EntityType.WITHER ? "Widder" : activePet.getCustomName();
addButton(34 + 9, new ShopItem(Material.MONSTER_EGG, (byte) getPlugin().getPetManager().getActivePet(getPlayer().getName()).getType().getTypeId(), C.mItem + petName, new String[0], 1, false, false),
addButton(25 + 9, new ShopItem(Material.MONSTER_EGG, (byte) getPlugin().getPetManager().getActivePet(getPlayer().getName()).getType().getTypeId(), C.mItem + petName, new String[0], 1, false, false),
new IButton()
{
public void onClick(Player player, ClickType clickType)

View File

@ -24,65 +24,137 @@ import mineplex.core.shop.page.ShopPageBase;
public class MountPage extends ShopPageBase<CosmeticManager, CosmeticShop>
{
public MountPage(CosmeticManager plugin, CosmeticShop shop, CoreClientManager clientManager, DonationManager donationManager, String name, Player player)
{
super(plugin, shop, clientManager, donationManager, name, player, 54);
buildPage();
}
protected void buildPage()
{
int slot = 19;
for (Mount<?> mount : getPlugin().getMountManager().getMounts())
{
addMount(mount, slot);
slot++;
if (slot == 26)
slot = 28;
}
addButton(4, new ShopItem(Material.BED, C.cGray + " \u21FD Go Back", new String[]{}, 1, false), new IButton()
public MountPage(CosmeticManager plugin, CosmeticShop shop, CoreClientManager clientManager, DonationManager donationManager, String name, Player player)
{
super(plugin, shop, clientManager, donationManager, name, player, 54);
buildPage();
}
protected void buildPage()
{
int slot = 19;
for (Mount<?> mount : getPlugin().getMountManager().getMounts())
{
addMount(mount, slot);
slot++;
if (slot == 26)
slot = 28;
}
addButton(4, new ShopItem(Material.BED, C.cGray + " \u21FD Go Back", new String[]{}, 1, false), new IButton()
{
public void onClick(Player player, ClickType clickType)
{
getShop().openPageForPlayer(getPlayer(), new Menu(getPlugin(), getShop(), getClientManager(), getDonationManager(), player));
}
});
}
protected void addMount(Mount<?> mount, int slot)
{
List<String> itemLore = new ArrayList<String>();
if (mount.GetCost(CurrencyType.Coins) != -1)
{
itemLore.add(C.cYellow + mount.GetCost(CurrencyType.Coins) + " Coins");
}
itemLore.add(C.cBlack);
itemLore.addAll(Arrays.asList(mount.GetDescription()));
if (getDonationManager().Get(getPlayer().getName()).OwnsUnknownPackage(mount.GetName()))
{
if (mount.GetActive().containsKey(getPlayer()))
{
addButton(slot, new ShopItem(mount.GetDisplayMaterial(), mount.GetDisplayData(), "Deactivate " + mount.GetName(), itemLore.toArray(new String[itemLore.size()]), 1, false, false), new DeactivateMountButton(mount, this));
}
else
{
addButton(slot, new ShopItem(mount.GetDisplayMaterial(), mount.GetDisplayData(), "Activate " + mount.GetName(), itemLore.toArray(new String[itemLore.size()]), 1, false, false), new ActivateMountButton(mount, this));
}
}
else
{
if (mount.GetCost(CurrencyType.Coins) != -1 && getDonationManager().Get(getPlayer().getName()).GetBalance(CurrencyType.Coins) >= mount.GetCost(CurrencyType.Coins))
addButton(slot, new ShopItem(mount.GetDisplayMaterial(), mount.GetDisplayData(), (mount.GetCost(CurrencyType.Coins) < 0 ? "" : "Purchase ") + mount.GetName(), itemLore.toArray(new String[itemLore.size()]), 1, false, false), new MountButton(mount, this));
else
setItem(slot, new ShopItem(mount.GetDisplayMaterial(), mount.GetDisplayData(), (mount.GetCost(CurrencyType.Coins) < 0 ? "" : "Purchase ") + mount.GetName(), itemLore.toArray(new String[itemLore.size()]), 1, true, false));
}
}
}
protected void addMount(Mount<?> mount, int slot)
{
List<String> itemLore = new ArrayList<String>();
itemLore.add(C.cBlack);
itemLore.addAll(Arrays.asList(mount.GetDescription()));
if (!getDonationManager().Get(getPlayer().getName()).OwnsUnknownPackage(mount.GetName()))
{
if (mount.GetCost(CurrencyType.Coins) == -1)
{
//Nothing
}
//Chest Unlocks
else if (mount.GetCost(CurrencyType.Coins) == -2 || mount.GetCost(CurrencyType.Coins) > 0)
{
itemLore.add(C.cBlack);
itemLore.add(C.cBlue + "Found in Treasure Chests");
}
else if (mount.GetCost(CurrencyType.Coins) == -3)
{
itemLore.add(C.cBlack);
itemLore.add(C.cBlue + "Found in Winter Holiday Treasure");
}
else if (mount.GetCost(CurrencyType.Coins) == -4)
{
itemLore.add(C.cBlack);
itemLore.add(C.cBlue + "Found in Halloween Pumpkin Treasure");
}
else if (mount.GetCost(CurrencyType.Coins) == -5)
{
itemLore.add(C.cBlack);
itemLore.add(C.cBlue + "Found in Easter Holiday Treasure");
}
//Rank Unlocks
else if (mount.GetCost(CurrencyType.Coins) == -10)
{
itemLore.add(C.cBlack);
itemLore.add(C.cAqua + "Unlocked with Ultra Rank");
}
else if (mount.GetCost(CurrencyType.Coins) == -11)
{
itemLore.add(C.cBlack);
itemLore.add(C.cPurple + "Unlocked with Hero Rank");
}
else if (mount.GetCost(CurrencyType.Coins) == -12)
{
itemLore.add(C.cBlack);
itemLore.add(C.cGreen + "Unlocked with Legend Rank");
}
else if (mount.GetCost(CurrencyType.Coins) == -13)
{
itemLore.add(C.cBlack);
itemLore.add(C.cRed + "Unlocked with Titan Rank");
}
}
if (getDonationManager().Get(getPlayer().getName()).OwnsUnknownPackage(mount.GetName()))
{
if (mount.GetActive().containsKey(getPlayer()))
{
itemLore.add(C.cBlack);
itemLore.add(C.cGreen + "Click to Disable");
addButton(slot, new ShopItem(mount.GetDisplayMaterial(), mount.GetDisplayData(), mount.GetName(), itemLore.toArray(new String[itemLore.size()]), 1, false, false), new DeactivateMountButton(mount, this));
}
else
{
itemLore.add(C.cBlack);
itemLore.add(C.cGreen + "Click to Enable");
addButton(slot, new ShopItem(mount.GetDisplayMaterial(), mount.GetDisplayData(), mount.GetName(), itemLore.toArray(new String[itemLore.size()]), 1, false, false), new ActivateMountButton(mount, this));
}
}
else
{
if (mount.GetCost(CurrencyType.Coins) > 0)
{
itemLore.add(C.cBlack);
itemLore.add(C.cWhiteB + "Cost: " + C.cAqua + mount.GetCost(CurrencyType.Coins) + " Treasure Shards");
}
if (mount.GetCost(CurrencyType.Coins) > 0 && getDonationManager().Get(getPlayer().getName()).GetBalance(CurrencyType.Coins) >= mount.GetCost(CurrencyType.Coins))
{
itemLore.add(C.cBlack);
itemLore.add(C.cGreen + "Click to Purchase");
addButton(slot, new ShopItem(mount.GetDisplayMaterial(), mount.GetDisplayData(), mount.GetName(), itemLore.toArray(new String[itemLore.size()]), 1, true, false), new MountButton(mount, this));
}
else if (mount.GetCost(CurrencyType.Coins) > 0)
{
itemLore.add(C.cBlack);
itemLore.add(C.cRed + "Not enough Treasure Shards.");
setItem(slot, new ShopItem(mount.GetDisplayMaterial(), mount.GetDisplayData(), mount.GetName(), itemLore.toArray(new String[itemLore.size()]), 1, true, false));
}
else
{
setItem(slot, new ShopItem(mount.GetDisplayMaterial(), mount.GetDisplayData(), mount.GetName(), itemLore.toArray(new String[itemLore.size()]), 1, true, false));
}
}
}
}

View File

@ -61,27 +61,60 @@ public class PetPage extends ShopPageBase<CosmeticManager, CosmeticShop>
{
List<String> itemLore = new ArrayList<String>();
//Halloween Name
if (pet.GetCost(CurrencyType.Coins) == -1)
itemLore.add(C.cBlack);
itemLore.add(C.cGray + "Your very own " + pet.GetName() + "!");
//Chest Unlocks
if (!getPlugin().getPetManager().Get(getPlayer()).GetPets().containsKey(pet.GetPetType()))
{
if (pet instanceof Pumpkin)
{
itemLore.add(C.cBlack);
itemLore.add(ChatColor.RESET + C.cYellow + "Earned by defeating the Pumpkin King");
itemLore.add(ChatColor.RESET + C.cYellow + "in the 2014 Halloween Horror Event.");
}
if (pet instanceof Elf)
{
itemLore.add(C.cBlack);
itemLore.add(ChatColor.RESET + C.cYellow + "Earned by defeating the Pumpkin King");
itemLore.add(ChatColor.RESET + C.cYellow + "in the 2014 Christmas Chaos Event.");
}
if (pet.GetPetType() == EntityType.WITHER)
{
itemLore.add(C.cBlack);
itemLore.add(ChatColor.RESET + C.cGreen + "Unlocked with Legend Rank");
}
}
if (pet.GetCost(CurrencyType.Coins) == -1)
{
//Nothing
}
else if (pet.GetCost(CurrencyType.Coins) == -2 || pet.GetCost(CurrencyType.Coins) > 0)
{
itemLore.add(C.cBlack);
itemLore.add(C.cBlue + "Found in Treasure Chests");
}
else if (pet.GetCost(CurrencyType.Coins) == -3)
{
itemLore.add(C.cBlack);
itemLore.add(C.cBlue + "Found in Winter Holiday Treasure");
}
else if (pet.GetCost(CurrencyType.Coins) == -4)
{
itemLore.add(C.cBlack);
itemLore.add(C.cBlue + "Found in Halloween Pumpkin Treasure");
}
else if (pet.GetCost(CurrencyType.Coins) == -5)
{
itemLore.add(C.cBlack);
itemLore.add(C.cBlue + "Found in Easter Holiday Treasure");
}
//Rank Unlocks
else if (pet.GetCost(CurrencyType.Coins) == -10)
{
itemLore.add(C.cBlack);
itemLore.add(C.cAqua + "Unlocked with Ultra Rank");
}
else if (pet.GetCost(CurrencyType.Coins) == -11)
{
itemLore.add(C.cBlack);
itemLore.add(C.cPurple + "Unlocked with Hero Rank");
}
else if (pet.GetCost(CurrencyType.Coins) == -12)
{
itemLore.add(C.cBlack);
itemLore.add(C.cGreen + "Unlocked with Legend Rank");
}
else if (pet.GetCost(CurrencyType.Coins) == -13)
{
itemLore.add(C.cBlack);
itemLore.add(C.cRed + "Unlocked with Titan Rank");
}
}
//Owned
if (getPlugin().getPetManager().Get(getPlayer()).GetPets().containsKey(pet.GetPetType()))
@ -94,35 +127,52 @@ public class PetPage extends ShopPageBase<CosmeticManager, CosmeticShop>
if (getPlugin().getPetManager().hasActivePet(getPlayer().getName()) && getPlugin().getPetManager().getActivePet(getPlayer().getName()).getType() == pet.GetPetType())
{
itemLore.add(C.cBlack);
itemLore.add(C.cGreen + "Click to Disable");
addButton(slot, new ShopItem(Material.MONSTER_EGG, (byte) pet.GetPetType().getTypeId(),
"Deactivate " + pet.GetPetName() + " (" + C.cWhite + petName + C.cGreen + ")",
pet.GetPetName() + " (" + C.cWhite + petName + C.cGreen + ")",
itemLore.toArray(new String[itemLore.size()]), 1, false, false), new DeactivatePetButton(this, getPlugin().getPetManager()));
addGlow(slot);
}
else
{
itemLore.add(C.cBlack);
itemLore.add(C.cGreen + "Click to Enable");
addButton(slot, new ShopItem(Material.MONSTER_EGG, (byte) pet.GetPetType().getTypeId(),
"Activate " + pet.GetPetName() + " (" + C.cWhite + petName + C.cGreen + ")",
pet.GetPetName() + " (" + C.cWhite + petName + C.cGreen + ")",
itemLore.toArray(new String[itemLore.size()]), 1, false, false), new ActivatePetButton(pet, this));
}
}
//Not Owned
else
{
//Cost Lore
if (pet.GetCost(CurrencyType.Coins) > 0)
{
itemLore.add(C.cYellow + pet.GetCost(CurrencyType.Coins) + " Coins");
itemLore.add(C.cBlack);
}
{
itemLore.add(C.cBlack);
itemLore.add(C.cWhiteB + "Cost: " + C.cAqua + pet.GetCost(CurrencyType.Coins) + " Treasure Shards");
}
if (pet.GetCost(CurrencyType.Coins) == -1)
if (pet.GetCost(CurrencyType.Coins) > 0 && getDonationManager().Get(getPlayer().getName()).GetBalance(CurrencyType.Coins) >= pet.GetCost(CurrencyType.Coins))
{
itemLore.add(C.cBlack);
itemLore.add(C.cGreen + "Click to Purchase");
addButton(slot, new ShopItem(Material.INK_SACK, (byte) 8, pet.GetPetName(), itemLore.toArray(new String[itemLore.size()]), 1, true, false), new PetButton(pet, this));
}
else if (pet.GetCost(CurrencyType.Coins) > 0)
{
itemLore.add(C.cBlack);
itemLore.add(C.cRed + "Not enough Treasure Shards.");
setItem(slot, new ShopItem(Material.INK_SACK, (byte)8, pet.GetPetName(), itemLore.toArray(new String[itemLore.size()]), 1, true, false));
else if (getDonationManager().Get(getPlayer().getName()).GetBalance(CurrencyType.Coins) >= pet.GetCost(CurrencyType.Coins))
addButton(slot, new ShopItem(Material.INK_SACK, (byte) 8, "Purchase " + pet.GetPetName(), itemLore.toArray(new String[itemLore.size()]), 1, false, false), new PetButton(pet, this));
}
else
setItem(slot, new ShopItem(Material.INK_SACK, (byte)8, "Purchase " + pet.GetPetName(), itemLore.toArray(new String[itemLore.size()]), 1, true, false));
{
setItem(slot, new ShopItem(Material.INK_SACK, (byte)8, pet.GetPetName(), itemLore.toArray(new String[itemLore.size()]), 1, true, false));
}
}
slot++;

View File

@ -31,65 +31,20 @@ import mineplex.core.common.util.UtilTime;
import mineplex.core.disguise.DisguiseManager;
import mineplex.core.donation.DonationManager;
import mineplex.core.gadget.event.GadgetCollideEntityEvent;
import mineplex.core.gadget.gadgets.arrowtrail.ArrowTrailCandyCane;
import mineplex.core.gadget.gadgets.arrowtrail.ArrowTrailFrostLord;
import mineplex.core.gadget.gadgets.arrowtrail.ArrowTrailTitan;
import mineplex.core.gadget.gadgets.death.DeathCandyCane;
import mineplex.core.gadget.gadgets.death.DeathFrostLord;
import mineplex.core.gadget.gadgets.death.DeathTitan;
import mineplex.core.gadget.gadgets.doublejump.DoubleJumpCandyCane;
import mineplex.core.gadget.gadgets.doublejump.DoubleJumpFrostLord;
import mineplex.core.gadget.gadgets.doublejump.DoubleJumpTitan;
import mineplex.core.gadget.gadgets.hat.HatCoal;
import mineplex.core.gadget.gadgets.hat.HatPresent;
import mineplex.core.gadget.gadgets.hat.HatSanta;
import mineplex.core.gadget.gadgets.hat.HatSnowman;
import mineplex.core.gadget.gadgets.item.ItemBatGun;
import mineplex.core.gadget.gadgets.item.ItemCoal;
import mineplex.core.gadget.gadgets.item.ItemCoinBomb;
import mineplex.core.gadget.gadgets.item.ItemDuelingSword;
import mineplex.core.gadget.gadgets.item.ItemEtherealPearl;
import mineplex.core.gadget.gadgets.item.ItemFirework;
import mineplex.core.gadget.gadgets.item.ItemFleshHook;
import mineplex.core.gadget.gadgets.item.ItemFreezeCannon;
import mineplex.core.gadget.gadgets.item.ItemMelonLauncher;
import mineplex.core.gadget.gadgets.item.ItemPaintballGun;
import mineplex.core.gadget.gadgets.item.ItemPaintbrush;
import mineplex.core.gadget.gadgets.item.ItemPartyPopper;
import mineplex.core.gadget.gadgets.item.ItemSnowball;
import mineplex.core.gadget.gadgets.item.ItemTNT;
import mineplex.core.gadget.gadgets.morph.MorphBat;
import mineplex.core.gadget.gadgets.morph.MorphBlaze;
import mineplex.core.gadget.gadgets.morph.MorphBlock;
import mineplex.core.gadget.gadgets.morph.MorphBunny;
import mineplex.core.gadget.gadgets.morph.MorphChicken;
import mineplex.core.gadget.gadgets.morph.MorphCow;
import mineplex.core.gadget.gadgets.morph.MorphCreeper;
import mineplex.core.gadget.gadgets.morph.MorphEnderman;
import mineplex.core.gadget.gadgets.morph.MorphPig;
import mineplex.core.gadget.gadgets.morph.MorphPumpkinKing;
import mineplex.core.gadget.gadgets.morph.MorphSlime;
import mineplex.core.gadget.gadgets.morph.MorphSnowman;
import mineplex.core.gadget.gadgets.morph.MorphTitan;
import mineplex.core.gadget.gadgets.morph.MorphVillager;
import mineplex.core.gadget.gadgets.morph.MorphWither;
import mineplex.core.gadget.gadgets.outfit.OutfitRaveSuit;
import mineplex.core.gadget.gadgets.outfit.OutfitSpaceSuit;
import mineplex.core.gadget.gadgets.outfit.OutfitTeam;
import mineplex.core.gadget.gadgets.particle.ParticleCandyCane;
import mineplex.core.gadget.gadgets.particle.ParticleCoalFumes;
import mineplex.core.gadget.gadgets.particle.ParticleEnchant;
import mineplex.core.gadget.gadgets.particle.ParticleFairy;
import mineplex.core.gadget.gadgets.particle.ParticleFireRings;
import mineplex.core.gadget.gadgets.particle.ParticleFoot;
import mineplex.core.gadget.gadgets.particle.ParticleFrostLord;
import mineplex.core.gadget.gadgets.particle.ParticleGreen;
import mineplex.core.gadget.gadgets.particle.ParticleHeart;
import mineplex.core.gadget.gadgets.particle.ParticleHelix;
import mineplex.core.gadget.gadgets.particle.ParticleLegend;
import mineplex.core.gadget.gadgets.particle.ParticleRain;
import mineplex.core.gadget.gadgets.particle.ParticleTitan;
import mineplex.core.gadget.event.GadgetEnableEvent;
import mineplex.core.gadget.gadgets.arrowtrail.*;
import mineplex.core.gadget.gadgets.death.*;
import mineplex.core.gadget.gadgets.doublejump.*;
import mineplex.core.gadget.gadgets.hat.*;
import mineplex.core.gadget.gadgets.item.*;
import mineplex.core.gadget.gadgets.morph.*;
import mineplex.core.gadget.gadgets.outfit.*;
import mineplex.core.gadget.gadgets.particle.*;
import mineplex.core.gadget.set.SetCandyCane;
import mineplex.core.gadget.set.SetFrostLord;
import mineplex.core.gadget.set.SetRaveSuit;
import mineplex.core.gadget.set.SetSpaceSuit;
import mineplex.core.gadget.set.SetTitan;
import mineplex.core.gadget.types.Gadget;
import mineplex.core.gadget.types.GadgetSet;
import mineplex.core.gadget.types.GadgetType;
@ -100,6 +55,7 @@ import mineplex.core.gadget.types.OutfitGadget.ArmorSlot;
import mineplex.core.gadget.types.ParticleGadget;
import mineplex.core.inventory.InventoryManager;
import mineplex.core.mount.MountManager;
import mineplex.core.mount.event.MountActivateEvent;
import mineplex.core.pet.PetManager;
import mineplex.core.preferences.PreferencesManager;
import mineplex.core.projectile.ProjectileManager;
@ -115,6 +71,7 @@ public class GadgetManager extends MiniPlugin
private BlockRestore _blockRestore;
private ProjectileManager _projectileManager;
private AchievementManager _achievementManager;
private MountManager _mountManager;
private NautHashMap<GadgetType, List<Gadget>> _gadgets;
@ -125,6 +82,7 @@ public class GadgetManager extends MiniPlugin
private boolean _hideParticles = false;
private int _activeItemSlot = 3;
private boolean _gadgetsEnabled = true;
public GadgetManager(JavaPlugin plugin, CoreClientManager clientManager, DonationManager donationManager, InventoryManager inventoryManager,
MountManager mountManager, PetManager petManager, PreferencesManager preferencesManager,
@ -141,6 +99,7 @@ public class GadgetManager extends MiniPlugin
_blockRestore = blockRestore;
_projectileManager = projectileManager;
_achievementManager = achievementManager;
_mountManager = mountManager;
CreateGadgets();
createSets();
@ -148,7 +107,14 @@ public class GadgetManager extends MiniPlugin
private void createSets()
{
//Particles
addSet(new SetFrostLord(this));
addSet(new SetCandyCane(this));
addSet(new SetTitan(this));
//Costumes
addSet(new SetRaveSuit(this));
addSet(new SetSpaceSuit(this));
}
private void CreateGadgets()
@ -172,15 +138,15 @@ public class GadgetManager extends MiniPlugin
addGadget(new ItemSnowball(this));
// Costume
addGadget(new OutfitRaveSuit(this, "Rave Hat", -2, ArmorSlot.Helmet, Material.LEATHER_HELMET, (byte)0));
addGadget(new OutfitRaveSuit(this, "Rave Shirt", -2, ArmorSlot.Chest, Material.LEATHER_CHESTPLATE, (byte)0));
addGadget(new OutfitRaveSuit(this, "Rave Pants", -2, ArmorSlot.Legs, Material.LEATHER_LEGGINGS, (byte)0));
addGadget(new OutfitRaveSuit(this, "Rave Boots", -2, ArmorSlot.Boots, Material.LEATHER_BOOTS, (byte)0));
addGadget(new OutfitRaveSuitHelmet(this));
addGadget(new OutfitRaveSuitChestplate(this));
addGadget(new OutfitRaveSuitLeggings(this));
addGadget(new OutfitRaveSuitBoots(this));
addGadget(new OutfitSpaceSuit(this, "Space Helmet", -2, ArmorSlot.Helmet, Material.GLASS, (byte)0));
addGadget(new OutfitSpaceSuit(this, "Space Jacket", -2, ArmorSlot.Chest, Material.GOLD_CHESTPLATE, (byte)0));
addGadget(new OutfitSpaceSuit(this, "Space Pants", -2, ArmorSlot.Legs, Material.GOLD_LEGGINGS, (byte)0));
addGadget(new OutfitSpaceSuit(this, "Space Boots", -2, ArmorSlot.Boots, Material.GOLD_BOOTS, (byte)0));
addGadget(new OutfitSpaceSuitHelmet(this));
addGadget(new OutfitSpaceSuitChestplate(this));
addGadget(new OutfitSpaceSuitLeggings(this));
addGadget(new OutfitSpaceSuitBoots(this));
addGadget(new OutfitTeam(this, "Team Helmet", -1, ArmorSlot.Helmet, Material.LEATHER_HELMET, (byte)0));
addGadget(new OutfitTeam(this, "Team Shirt", -1, ArmorSlot.Chest, Material.LEATHER_CHESTPLATE, (byte)0));
@ -342,7 +308,7 @@ public class GadgetManager extends MiniPlugin
}
}
public void removeGadetType(Player player, GadgetType type)
public void removeGadgetType(Player player, GadgetType type)
{
List<Gadget> gadgets = _gadgets.get(type);
if(gadgets == null) return;
@ -551,6 +517,40 @@ public class GadgetManager extends MiniPlugin
return true;
}
public boolean isGadgetEnabled()
{
return _gadgetsEnabled;
}
public void toggleGadgetEnabled()
{
setGadgetEnabled(!_gadgetsEnabled);
}
public void setGadgetEnabled(boolean enabled)
{
if (_gadgetsEnabled != enabled)
{
_gadgetsEnabled = enabled;
DisableAll();
_mountManager.DisableAll();
}
}
@EventHandler
public void GadgetActivate(GadgetEnableEvent event)
{
if (!_gadgetsEnabled)
event.setCancelled(true);
}
@EventHandler
public void MountActivate(MountActivateEvent event)
{
if (!_gadgetsEnabled)
event.setCancelled(true);
}
@EventHandler
public void chissMeow(PlayerToggleSneakEvent event)

View File

@ -5,9 +5,11 @@ import org.bukkit.Material;
import org.bukkit.entity.Arrow;
import mineplex.core.common.util.C;
import mineplex.core.common.util.LineFormat;
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.UtilText;
import mineplex.core.common.util.UtilTime;
import mineplex.core.gadget.GadgetManager;
import mineplex.core.gadget.types.ArrowEffectGadget;
@ -17,11 +19,9 @@ public class ArrowTrailCandyCane extends ArrowEffectGadget
public ArrowTrailCandyCane(GadgetManager manager)
{
super(manager, "Candy Cane Arrow Effect", new String[]
{
C.cWhite + "We whish you a marry " + C.Scramble + "christmas" + C.cWhite + ".",
},
1,
super(manager, "Candy Cane Arrows",
UtilText.splitLineToArray(C.cGray + "The real reason no one visits the North Pole? Santas Elves are deadly shots.", LineFormat.LORE),
-3,
Material.SNOW_BALL, (byte)0);
}

View File

@ -4,8 +4,10 @@ import org.bukkit.Material;
import org.bukkit.entity.Arrow;
import mineplex.core.common.util.C;
import mineplex.core.common.util.LineFormat;
import mineplex.core.common.util.UtilParticle;
import mineplex.core.common.util.UtilServer;
import mineplex.core.common.util.UtilText;
import mineplex.core.common.util.UtilParticle.ParticleType;
import mineplex.core.common.util.UtilParticle.ViewDist;
import mineplex.core.gadget.types.ArrowEffectGadget;
@ -15,13 +17,9 @@ public class ArrowTrailFrostLord extends ArrowEffectGadget
{
public ArrowTrailFrostLord(GadgetManager manager)
{
super(manager, "Arrows of the Frost Lord", new String[]
{
C.cWhite + "You are a mighty frost lord.",
C.cWhite + "Your double jumps and arrows",
C.cWhite + "are enchanted with snow powers.",
},
10,
super(manager, "Arrows of the Frost Lord",
UtilText.splitLineToArray(C.cGray + "The Frost Lords arrows bring a blast of winter in the wind of their passing.", LineFormat.LORE),
-3,
Material.SNOW_BALL, (byte)0, "Frost Lord");
}

View File

@ -7,8 +7,10 @@ import org.bukkit.event.player.PlayerJoinEvent;
import mineplex.core.common.Rank;
import mineplex.core.common.util.C;
import mineplex.core.common.util.LineFormat;
import mineplex.core.common.util.UtilParticle;
import mineplex.core.common.util.UtilServer;
import mineplex.core.common.util.UtilText;
import mineplex.core.common.util.UtilParticle.ParticleType;
import mineplex.core.common.util.UtilParticle.ViewDist;
import mineplex.core.gadget.GadgetManager;
@ -18,15 +20,9 @@ public class ArrowTrailTitan extends ArrowEffectGadget
{
public ArrowTrailTitan(GadgetManager manager)
{
super(manager, "Arrows of the Titans", new String[]
{
C.cWhite + "These flames are said to be the",
C.cWhite + "souls of a lost civilisation of",
C.cWhite + "Titans, forgotten by time.",
" ",
C.cRed + "Unlocked with Titan Rank",
},
-3,
super(manager, "Arrows of the Titans",
UtilText.splitLineToArray(C.cGray + "Arrows forged in the Fires of Creation, they leave fiery trails in their wake.", LineFormat.LORE),
-13,
Material.FIREBALL, (byte)0);
}

View File

@ -6,7 +6,9 @@ import org.bukkit.event.EventHandler;
import mineplex.core.blood.BloodEvent;
import mineplex.core.common.util.C;
import mineplex.core.common.util.LineFormat;
import mineplex.core.common.util.UtilParticle;
import mineplex.core.common.util.UtilText;
import mineplex.core.common.util.UtilParticle.ParticleType;
import mineplex.core.common.util.UtilParticle.ViewDist;
import mineplex.core.gadget.types.DeathEffectGadget;
@ -16,12 +18,9 @@ public class DeathCandyCane extends DeathEffectGadget
{
public DeathCandyCane(GadgetManager manager)
{
super(manager, "Candy Cane Effect", new String[]
{
C.cWhite + "COLORS FTW!",
C.cWhite + "Take damage with SWAG B)",
},
10,
super(manager, "Candy Cane Remains",
UtilText.splitLineToArray(C.cGray + "The biggest enemy of the Holidays, is January.", LineFormat.LORE),
-3,
Material.SNOW_BALL, (byte)0);
}

View File

@ -5,6 +5,8 @@ import org.bukkit.event.EventHandler;
import mineplex.core.blood.BloodEvent;
import mineplex.core.common.util.C;
import mineplex.core.common.util.LineFormat;
import mineplex.core.common.util.UtilText;
import mineplex.core.gadget.types.DeathEffectGadget;
import mineplex.core.gadget.GadgetManager;
@ -12,13 +14,9 @@ public class DeathFrostLord extends DeathEffectGadget
{
public DeathFrostLord(GadgetManager manager)
{
super(manager, "Frost Lord Death Effect", new String[]
{
C.cWhite + "You are a mighty frost lord.",
C.cWhite + "Your double jumps and arrows",
C.cWhite + "are enchanted with snow powers.",
},
10,
super(manager, "Fall of the Frost Lord",
UtilText.splitLineToArray(C.cGray + "The power of Winter must eventually give way to Spring.", LineFormat.LORE),
-3,
Material.SNOW_BALL, (byte)0, "Frost Lord");
}

View File

@ -7,6 +7,8 @@ import org.bukkit.event.player.PlayerJoinEvent;
import mineplex.core.blood.BloodEvent;
import mineplex.core.common.Rank;
import mineplex.core.common.util.C;
import mineplex.core.common.util.LineFormat;
import mineplex.core.common.util.UtilText;
import mineplex.core.gadget.GadgetManager;
import mineplex.core.gadget.types.DeathEffectGadget;
@ -14,15 +16,9 @@ public class DeathTitan extends DeathEffectGadget
{
public DeathTitan(GadgetManager manager)
{
super(manager, "Ashes of the Titans", new String[]
{
C.cWhite + "These flames are said to be the",
C.cWhite + "souls of a lost civilisation of",
C.cWhite + "Titans, forgotten by time.",
" ",
C.cRed + "Unlocked with Titan Rank",
},
-3,
super(manager, "Ashes of the Titans",
UtilText.splitLineToArray(C.cGray + "Even a Titan can fall in combat if their opponent is fierce enough.", LineFormat.LORE),
-13,
Material.FIREBALL, (byte)0);
}

View File

@ -5,9 +5,11 @@ import org.bukkit.Material;
import org.bukkit.entity.Player;
import mineplex.core.common.util.C;
import mineplex.core.common.util.LineFormat;
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.UtilText;
import mineplex.core.gadget.GadgetManager;
import mineplex.core.gadget.types.DoubleJumpEffectGadget;
@ -16,11 +18,9 @@ public class DoubleJumpCandyCane extends DoubleJumpEffectGadget
public DoubleJumpCandyCane(GadgetManager manager)
{
super(manager, "Candy Cane Jump Effect", new String[]
{
C.cWhite + "We whish you a marry " + C.Scramble + "christmas" + C.cWhite + ".",
},
1,
super(manager, "Candy Cane Blast",
UtilText.splitLineToArray(C.cGray + "It is said every time an elf jumps, bits of Candy Cane fall out of their pockets.", LineFormat.LORE),
-3,
Material.SNOW_BALL, (byte)0);
}

View File

@ -4,7 +4,9 @@ import org.bukkit.Material;
import org.bukkit.entity.Player;
import mineplex.core.common.util.C;
import mineplex.core.common.util.LineFormat;
import mineplex.core.common.util.UtilParticle;
import mineplex.core.common.util.UtilText;
import mineplex.core.common.util.UtilParticle.ParticleType;
import mineplex.core.common.util.UtilParticle.ViewDist;
import mineplex.core.common.util.UtilServer;
@ -15,11 +17,9 @@ public class DoubleJumpFrostLord extends DoubleJumpEffectGadget
{
public DoubleJumpFrostLord(GadgetManager manager)
{
super(manager, "Boots of the Frost Lord", new String[]
{
C.cWhite + "More snow incomming.",
},
1,
super(manager, "Gust of the Frost Lord",
UtilText.splitLineToArray(C.cGray + "Listen, the Frost Lord is a very proper individual. Stop making fart jokes!", LineFormat.LORE),
-3,
Material.SNOW_BALL, (byte)0, "Frost Lord");
}

View File

@ -8,8 +8,10 @@ import org.bukkit.event.player.PlayerToggleFlightEvent;
import mineplex.core.common.Rank;
import mineplex.core.common.util.C;
import mineplex.core.common.util.LineFormat;
import mineplex.core.common.util.UtilParticle;
import mineplex.core.common.util.UtilServer;
import mineplex.core.common.util.UtilText;
import mineplex.core.common.util.UtilParticle.ParticleType;
import mineplex.core.common.util.UtilParticle.ViewDist;
import mineplex.core.gadget.GadgetManager;
@ -19,15 +21,9 @@ public class DoubleJumpTitan extends DoubleJumpEffectGadget
{
public DoubleJumpTitan(GadgetManager manager)
{
super(manager, "Leap of the Titans", new String[]
{
C.cWhite + "These flames are said to be the",
C.cWhite + "souls of a lost civilisation of",
C.cWhite + "Titans, forgotten by time.",
" ",
C.cRed + "Unlocked with Titan Rank",
},
-3,
super(manager, "Leap of the Titans",
UtilText.splitLineToArray(C.cGray + "Out of the frying pan and into the fire.", LineFormat.LORE),
-13,
Material.FIREBALL, (byte)0);
}

View File

@ -4,6 +4,8 @@ import org.bukkit.Material;
import org.bukkit.inventory.ItemStack;
import mineplex.core.common.util.C;
import mineplex.core.common.util.LineFormat;
import mineplex.core.common.util.UtilText;
import mineplex.core.gadget.GadgetManager;
import mineplex.core.gadget.types.HatGadget;
@ -12,7 +14,10 @@ public class HatCoal extends HatGadget
public HatCoal(GadgetManager manager)
{
super(manager, "Coal Hat", new String[]{C.cWhite + "Coal Hat"}, 10, new ItemStack(Material.COAL_BLOCK));
super(manager, "Lump of Coal Hat",
UtilText.splitLineToArray(C.cGray + "When life gives you coal, make a wierd cube hat out it!", LineFormat.LORE),
-1,
new ItemStack(Material.COAL_BLOCK));
}
}

View File

@ -0,0 +1,20 @@
package mineplex.core.gadget.gadgets.hat;
import mineplex.core.common.util.C;
import mineplex.core.common.util.LineFormat;
import mineplex.core.common.util.UtilText;
import mineplex.core.gadget.GadgetManager;
import mineplex.core.gadget.types.HatGadget;
public class HatGrinch extends HatGadget
{
public HatGrinch(GadgetManager manager)
{
super(manager, "The Grinch",
UtilText.splitLineToArray(C.cGray + "Great! Now wheres the Roast Beast?!", LineFormat.LORE),
-3,
"christmasgift");
}
}

View File

@ -1,6 +1,8 @@
package mineplex.core.gadget.gadgets.hat;
import mineplex.core.common.util.C;
import mineplex.core.common.util.LineFormat;
import mineplex.core.common.util.UtilText;
import mineplex.core.gadget.GadgetManager;
import mineplex.core.gadget.types.HatGadget;
@ -9,7 +11,10 @@ public class HatPresent extends HatGadget
public HatPresent(GadgetManager manager)
{
super(manager, "Present Hat", new String[]{C.cWhite + "Present Hat"}, 10, "christmasgift");
super(manager, "Present",
UtilText.splitLineToArray(C.cGray + "WHAT IN THE PRESENT? Oh, it's just you...", LineFormat.LORE),
-3,
"christmasgift");
}
}

View File

@ -1,6 +1,8 @@
package mineplex.core.gadget.gadgets.hat;
import mineplex.core.common.util.C;
import mineplex.core.common.util.LineFormat;
import mineplex.core.common.util.UtilText;
import mineplex.core.gadget.GadgetManager;
import mineplex.core.gadget.types.HatGadget;
@ -9,7 +11,10 @@ public class HatSanta extends HatGadget
public HatSanta(GadgetManager manager)
{
super(manager, "Santa Hat", new String[]{C.cWhite + "Santa Hat"}, 10, "Presents");
super(manager, "Santa",
UtilText.splitLineToArray(C.cGray + "Now you can work the Mall circuit!", LineFormat.LORE),
-3,
"Presents");
}
}

View File

@ -1,6 +1,8 @@
package mineplex.core.gadget.gadgets.hat;
import mineplex.core.common.util.C;
import mineplex.core.common.util.LineFormat;
import mineplex.core.common.util.UtilText;
import mineplex.core.gadget.GadgetManager;
import mineplex.core.gadget.types.HatGadget;
@ -9,7 +11,10 @@ public class HatSnowman extends HatGadget
public HatSnowman(GadgetManager manager)
{
super(manager, "Snowman Hat", new String[]{C.cWhite + "Snowman Hat"}, 10, "snowman002");
super(manager, "Snowmans Head",
UtilText.splitLineToArray(C.cGray + "Do you want to be a snowman?", LineFormat.LORE),
-3,
"snowman002");
}
}

View File

@ -13,12 +13,14 @@ import org.bukkit.util.Vector;
import mineplex.core.common.util.C;
import mineplex.core.common.util.F;
import mineplex.core.common.util.LineFormat;
import mineplex.core.common.util.UtilAction;
import mineplex.core.common.util.UtilAlg;
import mineplex.core.common.util.UtilEnt;
import mineplex.core.common.util.UtilParticle;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilServer;
import mineplex.core.common.util.UtilText;
import mineplex.core.common.util.UtilTime;
import mineplex.core.common.util.UtilParticle.ParticleType;
import mineplex.core.common.util.UtilParticle.ViewDist;
@ -37,11 +39,8 @@ public class ItemBatGun extends ItemGadget
public ItemBatGun(GadgetManager manager)
{
super(manager, "Bat Blaster", new String[]
{
C.cWhite + "Launch waves of annoying bats",
C.cWhite + "at people you don't like!",
},
super(manager, "Bat Blaster",
UtilText.splitLineToArray(C.cGray + "Unleash waves of terrifying bats at people you don't like!", LineFormat.LORE),
-1,
Material.IRON_BARDING, (byte)0,
5000, new Ammo("Bat Blaster", "50 Bats", Material.IRON_BARDING, (byte)0, new String[] { C.cWhite + "50 Bats for your Bat Blaster!" }, 500, 50));

View File

@ -3,6 +3,7 @@ package mineplex.core.gadget.gadgets.item;
import org.bukkit.Bukkit;
import org.bukkit.Material;
import org.bukkit.Sound;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.block.Action;
@ -11,6 +12,7 @@ import org.bukkit.event.player.PlayerInteractEvent;
import mineplex.core.common.util.C;
import mineplex.core.common.util.Callback;
import mineplex.core.common.util.F;
import mineplex.core.common.util.LineFormat;
import mineplex.core.common.util.UtilBlock;
import mineplex.core.common.util.UtilGear;
import mineplex.core.common.util.UtilInv;
@ -19,73 +21,192 @@ import mineplex.core.common.util.UtilParticle;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilParticle.ParticleType;
import mineplex.core.common.util.UtilParticle.ViewDist;
import mineplex.core.common.util.UtilText;
import mineplex.core.gadget.GadgetManager;
import mineplex.core.gadget.event.ItemGadgetOutOfAmmoEvent;
import mineplex.core.gadget.gadgets.Ammo;
import mineplex.core.gadget.gadgets.hat.HatCoal;
import mineplex.core.gadget.gadgets.particle.ParticleCoalFumes;
import mineplex.core.gadget.types.ItemGadget;
import mineplex.core.itemstack.ItemStackFactory;
import mineplex.core.recharge.Recharge;
import mineplex.core.reward.RewardData;
import mineplex.core.reward.RewardRarity;
import mineplex.core.reward.rewards.PetReward;
public class ItemCoal extends ItemGadget
{
public String[] Messages = new String[]
{
"Maybe you could.... eat it?",
"Yep, you're holding some coal...",
"This sure is a nice piece of coal!",
"Na na na na Na na na na " + C.cDGray + "BLACK COAL" + C.mBody + "!",
"Did you know that coal can be used for " + C.Scramble + "nothing" + C.mBody + "!",
"Maybe you could.... eat it?",
"Yep, you're holding some coal...",
"This sure is a nice piece of coal!",
"Na na na na, Na na na na, " + C.cDGray + "BLACK COAL" + C.cGray + "!",
"Did you know that coal can be used for " + C.Scramble + "nothing" + C.mBody + "!",
"Now... if only you had a furnace.",
"I hope you didnt miss any diamonds.",
"With 9 of these you could make a block!",
"Were you really that naughty this year?",
"With a few more of these you could make a snowman face!",
"Lava is hotter but Coal is quicker.",
"What do you even need Coal for on a Minigame server?",
"Maybe if I got more I could start a really big fire.",
"Maybe you can give this to your siblings next Christmas.",
"Did you know a diamond is formed from coal?",
"Coal is a word that sounds weird if you say it too much.",
"Who do you think mined the first block of coal?",
"Maybe if you get enough, something cool will happen! Or perhaps not...",
};
public ItemCoal(GadgetManager manager)
{
super(manager, "Coal", new String[]
{
super(manager, "Coal",
UtilText.splitLineToArray(C.cGray + "Just a large chunk of coal. Maybe you were naughty or something?", LineFormat.LORE)
, -1, Material.COAL, (byte) 0, 1000, new Ammo("Coal", "1 Piece of Coal", Material.COAL, (byte) 0, new String[]
{
C.cDGray + "Exclusive Coal!",
C.cDGray + "Earned by beeing naughty"
}
, -1, Material.COAL, (byte) 0, 1000, new Ammo("Coal", "1 Piece of Coal", Material.COAL, (byte) 0, new String[]
{
C.cDGray + "Exclusive Coal!",
C.cDGray + "Earned by beeing naughty"
}
, 100, 100));
}
, -1, 1));
}
@Override
public void ActivateCustom(final Player player)
{
if(Manager.getInventoryManager().Get(player).getItemCount(GetName()) >= 1000)
{
Manager.getInventoryManager().addItemToInventory(new Callback<Boolean>()
{
@Override
public void run(Boolean data)
{
if(data)
{
player.sendMessage(F.main("Coal", "You unlocked " + C.cDGray + "COAL FUMES!"));
UtilParticle.PlayParticleToAll(ParticleType.LARGE_SMOKE, player.getLocation().add(0, 0.5, 0), 0.2f, 0.5f, 0.2f, 0, 500, ViewDist.LONG);
UtilParticle.PlayParticleToAll(ParticleType.LARGE_SMOKE, player.getLocation(), 1.5f, 0.0f, 1.5f, 0, 500, ViewDist.LONG);
player.getWorld().playSound(player.getLocation(), Sound.WITHER_DEATH, 0.8f, 0);
Manager.getInventoryManager().addItemToInventory(player, GetName(), -1000);
player.getInventory().setItem(Manager.getActiveItemSlot(), ItemStackFactory.Instance.CreateStack(GetDisplayMaterial(), GetDisplayData(), 1, F.item(Manager.getInventoryManager().Get(player).getItemCount(GetName()) + " " + GetName())));
} else {
player.sendMessage("Something went wrong...");
}
}
}, player, "Coal Fumes", 1);
return;
}
int goal = -1;
int i = UtilMath.r(Messages.length);
String msg = Messages[i];
player.sendMessage(F.main("Coal", msg));
player.playSound(player.getLocation(), Sound.GHAST_FIREBALL, 0.2f, 1.5f*(i/(float)Messages.length));
//Coal Hat
if (!Manager.getGadget(HatCoal.class).ownsGadget(player))
{
goal = 250;
if(Manager.getInventoryManager().Get(player).getItemCount(GetName()) >= 250)
{
Recharge.Instance.recharge(player, GetName());
Recharge.Instance.use(player, GetName(), 30000, true, true);
Manager.getInventoryManager().addItemToInventory(new Callback<Boolean>()
{
@Override
public void run(Boolean data)
{
if(data)
{
Bukkit.broadcastMessage(F.main("Treasure", C.cGreen + player.getName() + C.cGray + " crafted " + C.cGreen + "Legendary Coal Hat"));
UtilParticle.PlayParticleToAll(ParticleType.LARGE_SMOKE, player.getLocation().add(0, 0.5, 0), 0.1f, 0.5f, 0.1f, 0, 100, ViewDist.LONG);
UtilParticle.PlayParticleToAll(ParticleType.LARGE_SMOKE, player.getLocation(), 0.5f, 0.0f, 0.5f, 0, 100, ViewDist.LONG);
player.getWorld().playSound(player.getLocation(), Sound.WITHER_DEATH, 0.8f, 0);
Manager.getInventoryManager().addItemToInventory(player, GetName(), -250);
player.getInventory().setItem(Manager.getActiveItemSlot(), ItemStackFactory.Instance.CreateStack(GetDisplayMaterial(), GetDisplayData(), 1, F.item(Manager.getInventoryManager().Get(player).getItemCount(GetName()) + " " + GetName())));
Manager.getDonationManager().Get(player).AddUnknownSalesPackagesOwned("Lump of Coal Hat");
}
else
{
player.sendMessage("Something went wrong...");
}
}
}, player, "Lump of Coal Hat", 1);
return;
}
}
//Coal Apparition
if (!Manager.getPetManager().Get(player).GetPets().containsKey(EntityType.PIG_ZOMBIE))
{
goal = 1000;
if(Manager.getInventoryManager().Get(player).getItemCount(GetName()) >= 1000)
{
Recharge.Instance.recharge(player, GetName());
Recharge.Instance.use(player, GetName(), 30000, true, true);
PetReward reward = new PetReward(
Manager.getPetManager(),
Manager.getInventoryManager(),
Manager.getDonationManager(),
"Coal Apparition", "Coal Apparition", EntityType.PIG_ZOMBIE, RewardRarity.OTHER, 0);
if (reward.canGiveReward(player))
reward.giveReward(null, player, new Callback<RewardData>()
{
@Override
public void run(RewardData data)
{
Bukkit.broadcastMessage(F.main("Treasure", C.cGreen + player.getName() + C.cGray + " crafted " + C.cGreen + "Legendary Coal Apparition Pet"));
UtilParticle.PlayParticleToAll(ParticleType.LARGE_SMOKE, player.getLocation().add(0, 0.5, 0), 0.15f, 0.5f, 0.15f, 0, 250, ViewDist.LONG);
UtilParticle.PlayParticleToAll(ParticleType.LARGE_SMOKE, player.getLocation(), 1f, 0.0f, 1f, 0, 250, ViewDist.LONG);
player.getWorld().playSound(player.getLocation(), Sound.WITHER_DEATH, 0.8f, 0);
Manager.getInventoryManager().addItemToInventory(player, GetName(), -1000);
player.getInventory().setItem(Manager.getActiveItemSlot(), ItemStackFactory.Instance.CreateStack(GetDisplayMaterial(), GetDisplayData(), 1, F.item(Manager.getInventoryManager().Get(player).getItemCount(GetName()) + " " + GetName())));
Manager.getDonationManager().Get(player).AddUnknownSalesPackagesOwned("Coal Apparition");
}
});
return;
}
}
//Coal Particle
if (!Manager.getGadget(ParticleCoalFumes.class).ownsGadget(player))
{
goal = 2500;
if(Manager.getInventoryManager().Get(player).getItemCount(GetName()) >= 2500)
{
Recharge.Instance.recharge(player, GetName());
Recharge.Instance.use(player, GetName(), 30000, true, true);
Manager.getInventoryManager().addItemToInventory(new Callback<Boolean>()
{
@Override
public void run(Boolean data)
{
if(data)
{
Bukkit.broadcastMessage(F.main("Treasure", C.cRed + player.getName() + C.cGray + " crafted " + C.cRed + "Mythical Coal Fumes Particles"));
UtilParticle.PlayParticleToAll(ParticleType.LARGE_SMOKE, player.getLocation().add(0, 0.5, 0), 0.2f, 0.5f, 0.2f, 0, 500, ViewDist.LONG);
UtilParticle.PlayParticleToAll(ParticleType.LARGE_SMOKE, player.getLocation(), 1.5f, 0.0f, 1.5f, 0, 500, ViewDist.LONG);
player.getWorld().playSound(player.getLocation(), Sound.WITHER_DEATH, 0.8f, 0);
Manager.getInventoryManager().addItemToInventory(player, GetName(), -2500);
player.getInventory().setItem(Manager.getActiveItemSlot(), ItemStackFactory.Instance.CreateStack(GetDisplayMaterial(), GetDisplayData(), 1, F.item(Manager.getInventoryManager().Get(player).getItemCount(GetName()) + " " + GetName())));
Manager.getDonationManager().Get(player).AddUnknownSalesPackagesOwned("Coal Fumes");
}
else
{
player.sendMessage("Something went wrong...");
}
}
}, player, "Coal Fumes", 1);
return;
}
}
goal -= Manager.getInventoryManager().Get(player).getItemCount(GetName());
if (goal > 0 && Math.random() > 0.95)
{
player.sendMessage(F.main("Coal", "Only " + goal + " to go..."));
player.playSound(player.getLocation(), Sound.IRONGOLEM_DEATH, 0.2f, 0.5f);
}
else
{
int i = UtilMath.r(Messages.length);
String msg = Messages[i];
player.sendMessage(F.main("Coal", msg));
player.playSound(player.getLocation(), Sound.GHAST_FIREBALL, 0.2f, 1.5f*(i/(float)Messages.length));
}
}
@EventHandler @Override
public void Activate(PlayerInteractEvent event)
{
@ -102,21 +223,21 @@ public class ItemCoal extends ItemGadget
if (!IsActive(player))
return;
event.setCancelled(true);
//Stock
if (Manager.getInventoryManager().Get(player).getItemCount(GetName()) <= 0)
{
UtilPlayer.message(player, F.main("Gadget", "You do not have any " + GetName() + " left."));
ItemGadgetOutOfAmmoEvent ammoEvent = new ItemGadgetOutOfAmmoEvent(event.getPlayer(), this);
Bukkit.getServer().getPluginManager().callEvent(ammoEvent);
return;
}
//Recharge
if (!Recharge.Instance.use(player, GetName(), GetName(), _recharge, _recharge > 1000, true, false, true, "Cosmetics"))
{
@ -125,7 +246,7 @@ public class ItemCoal extends ItemGadget
}
player.getInventory().setItem(Manager.getActiveItemSlot(), ItemStackFactory.Instance.CreateStack(GetDisplayMaterial(), GetDisplayData(), 1, F.item(Manager.getInventoryManager().Get(player).getItemCount(GetName()) + " " + GetName())));
ActivateCustom(event.getPlayer());
}

View File

@ -17,10 +17,12 @@ import org.bukkit.inventory.ItemStack;
import org.bukkit.util.Vector;
import mineplex.core.common.util.C;
import mineplex.core.common.util.LineFormat;
import mineplex.core.common.util.UtilAction;
import mineplex.core.common.util.UtilFirework;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilServer;
import mineplex.core.common.util.UtilText;
import mineplex.core.common.util.UtilTime;
import mineplex.core.gadget.GadgetManager;
import mineplex.core.gadget.gadgets.Ammo;
@ -35,27 +37,23 @@ public class ItemCoinBomb extends ItemGadget
public ItemCoinBomb(GadgetManager manager)
{
super(manager, "Coin Party Bomb", new String[]
{
C.cWhite + "It's party time! You will be",
C.cWhite + "everyones favourite player",
C.cWhite + "when you use one of these!",
},
super(manager, "Treasure Party Bomb",
UtilText.splitLineToArray(C.cWhite + "It's party time! You'll be everyones favourite player when you use one of these!", LineFormat.LORE),
-1,
Material.getMaterial(175), (byte)0,
30000, new Ammo("Coin Party Bomb", "1 Coin Party Bomb", Material.getMaterial(175), (byte)0, new String[] { C.cWhite + "1 Coin Party Bomb to PARTY!" }, 2000, 1));
Material.PRISMARINE, (byte)0,
30000, new Ammo("Treasure Party Bomb", "1 Coin Party Bomb", Material.PRISMARINE, (byte)0, new String[] { C.cWhite + "1 Treasure Party Bomb" }, 2000, 1));
}
@Override
public void ActivateCustom(Player player)
{
Item item = player.getWorld().dropItem(player.getEyeLocation().add(player.getLocation().getDirection()), new ItemStack(Material.GOLD_BLOCK));
Item item = player.getWorld().dropItem(player.getEyeLocation().add(player.getLocation().getDirection()), new ItemStack(Material.PRISMARINE));
UtilAction.velocity(item, player.getLocation().getDirection(), 1, false, 0, 0.2, 1, false);
_active.put(item, System.currentTimeMillis());
//Inform
for (Player other : UtilServer.getPlayers())
UtilPlayer.message(other, C.cYellow + C.Bold + player.getName() + C.cWhite + C.Bold + " has thrown a " + C.cYellow + C.Bold + "Coin Party Bomb" + C.cWhite + C.Bold + "!");
UtilPlayer.message(other, C.cAqua + C.Bold + player.getName() + C.cWhite + C.Bold + " has thrown a " + C.cAqua + C.Bold + "Treasure Party Bomb" + C.cWhite + C.Bold + "!");
}
@EventHandler
@ -74,11 +72,11 @@ public class ItemCoinBomb extends ItemGadget
if (UtilTime.elapsed(time, 3000))
{
if (Math.random() > 0.80)
UtilFirework.playFirework(item.getLocation(), FireworkEffect.builder().flicker(false).withColor(Color.YELLOW).with(Type.BURST).trail(false).build());
UtilFirework.playFirework(item.getLocation(), FireworkEffect.builder().flicker(false).withColor(Color.AQUA).with(Type.BURST).trail(false).build());
else
item.getWorld().playSound(item.getLocation(), Sound.FIREWORK_LAUNCH, 1f, 1f);
Item coin = item.getWorld().dropItem(item.getLocation().add(0, 1, 0), new ItemStack(Material.getMaterial(175)));
Item coin = item.getWorld().dropItem(item.getLocation().add(0, 1, 0), new ItemStack(Material.PRISMARINE_SHARD));
//Velocity
long passed = System.currentTimeMillis() - time;

View File

@ -28,7 +28,7 @@ public class ItemDuelingSword extends ItemGadget
@Override
public void ApplyItem(Player player, boolean inform)
{
Manager.removeGadetType(player, GadgetType.Item);
Manager.removeGadgetType(player, GadgetType.Item);
_active.add(player);

View File

@ -19,10 +19,12 @@ import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause;
import mineplex.core.common.util.C;
import mineplex.core.common.util.F;
import mineplex.core.common.util.LineFormat;
import mineplex.core.common.util.UtilFirework;
import mineplex.core.common.util.UtilInv;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilServer;
import mineplex.core.common.util.UtilText;
import mineplex.core.gadget.GadgetManager;
import mineplex.core.gadget.gadgets.Ammo;
import mineplex.core.gadget.types.ItemGadget;
@ -35,11 +37,8 @@ public class ItemEtherealPearl extends ItemGadget
public ItemEtherealPearl(GadgetManager manager)
{
super(manager, "Ethereal Pearl", new String[]
{
C.cWhite + "Take a ride through the skies",
C.cWhite + "on your very own Ethereal Pearl!",
},
super(manager, "Ethereal Pearl",
UtilText.splitLineToArray(C.cWhite + "These Pearls are stolen from sleeping Endermen!", LineFormat.LORE),
-1,
Material.ENDER_PEARL, (byte)0,
500, new Ammo("Ethereal Pearl", "50 Pearls", Material.ENDER_PEARL, (byte)0, new String[] { C.cWhite + "50 Pearls to get around with!" }, 500, 50));

View File

@ -11,9 +11,11 @@ import org.bukkit.util.Vector;
import mineplex.core.common.util.C;
import mineplex.core.common.util.F;
import mineplex.core.common.util.LineFormat;
import mineplex.core.common.util.UtilBlock;
import mineplex.core.common.util.UtilFirework;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilText;
import mineplex.core.gadget.GadgetManager;
import mineplex.core.gadget.gadgets.Ammo;
import mineplex.core.gadget.types.ItemGadget;
@ -22,12 +24,8 @@ public class ItemFirework extends ItemGadget
{
public ItemFirework(GadgetManager manager)
{
super(manager, "Fireworks", new String[]
{
C.cWhite + "Need to celebrate?!",
C.cWhite + "Use some fireworks!",
C.cWhite + "Pew pew pew!",
},
super(manager, "Fireworks",
UtilText.splitLineToArray(C.cWhite + "Need to celebrate? These fireworks should do the trick!", LineFormat.LORE),
-1,
Material.FIREWORK, (byte)0,
500, new Ammo("Fireworks", "50 Fireworks", Material.FIREWORK, (byte)0, new String[] { C.cWhite + "50 Fireworks for you to launch!" }, 500, 50));

View File

@ -11,9 +11,11 @@ import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
import mineplex.core.common.util.C;
import mineplex.core.common.util.F;
import mineplex.core.common.util.LineFormat;
import mineplex.core.common.util.UtilAction;
import mineplex.core.common.util.UtilAlg;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilText;
import mineplex.core.common.util.UtilParticle.ParticleType;
import mineplex.core.gadget.GadgetManager;
import mineplex.core.gadget.gadgets.Ammo;
@ -27,12 +29,8 @@ public class ItemFleshHook extends ItemGadget implements IThrown
{
public ItemFleshHook(GadgetManager manager)
{
super(manager, "Flesh Hook", new String[]
{
C.cWhite + "Make new friends by throwing a hook",
C.cWhite + "into their face and pulling them",
C.cWhite + "towards you!",
},
super(manager, "Flesh Hook",
UtilText.splitLineToArray(C.cWhite + "Make new friends by throwing a hook into their face and pulling them towards you!", LineFormat.LORE),
-1,
Material.getMaterial(131), (byte)0,
2000, new Ammo("Flesh Hook", "50 Flesh Hooks", Material.getMaterial(131), (byte)0, new String[] { C.cWhite + "50 Flesh Hooks for you to use!" }, 1000, 50));

View File

@ -27,10 +27,12 @@ import org.bukkit.potion.PotionEffectType;
import mineplex.core.common.util.C;
import mineplex.core.common.util.F;
import mineplex.core.common.util.LineFormat;
import mineplex.core.common.util.UtilAction;
import mineplex.core.common.util.UtilBlock;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilServer;
import mineplex.core.common.util.UtilText;
import mineplex.core.gadget.GadgetManager;
import mineplex.core.gadget.gadgets.Ammo;
import mineplex.core.gadget.types.ItemGadget;
@ -47,14 +49,13 @@ public class ItemFreezeCannon extends ItemGadget implements IThrown
public ItemFreezeCannon(GadgetManager manager)
{
super(manager, "Freeze Cannon", new String[]
{
C.cWhite + "Freeze your nemesis inside a block of ice!"
}
, -1, Material.ICE, (byte) 0, 2000, new Ammo("Freeze Cannon", "100 Ice Blocks", Material.ICE, (byte) 0, new String[]
super(manager, "Freeze Cannon",
UtilText.splitLineToArray(C.cWhite + "Let someone cool off inside their very own ice cube!", LineFormat.LORE),
-1,
Material.ICE, (byte) 0, 2000, new Ammo("Freeze Cannon", "100 Ice Blocks", Material.ICE, (byte) 0, new String[]
{
C.cWhite + "100 Ice Blocks for you to launch!"
}, 500, 100));
}, -1, 1));
}
@Override

View File

@ -1,218 +0,0 @@
package mineplex.core.gadget.gadgets.item;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Color;
import org.bukkit.FireworkEffect;
import org.bukkit.Material;
import org.bukkit.Sound;
import org.bukkit.FireworkEffect.Type;
import org.bukkit.entity.Item;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.block.Action;
import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.event.player.PlayerPickupItemEvent;
import org.bukkit.inventory.ItemStack;
import org.bukkit.util.Vector;
import mineplex.core.common.CurrencyType;
import mineplex.core.common.util.C;
import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilAction;
import mineplex.core.common.util.UtilBlock;
import mineplex.core.common.util.UtilFirework;
import mineplex.core.common.util.UtilGear;
import mineplex.core.common.util.UtilInv;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilServer;
import mineplex.core.common.util.UtilTime;
import mineplex.core.gadget.GadgetManager;
import mineplex.core.gadget.event.ItemGadgetOutOfAmmoEvent;
import mineplex.core.gadget.gadgets.Ammo;
import mineplex.core.gadget.types.ItemGadget;
import mineplex.core.itemstack.ItemStackFactory;
import mineplex.core.recharge.Recharge;
import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
public class ItemGemBomb extends ItemGadget
{
private HashMap<Item, Long> _activeBombs = new HashMap<Item, Long>();
private HashSet<Item> _gems = new HashSet<Item>();
public ItemGemBomb(GadgetManager manager)
{
super(manager, "Gem Party Bomb", new String[]
{
C.cWhite + "It's party time! You will be",
C.cWhite + "everyones favourite player",
C.cWhite + "when you use one of these!",
" ",
C.cRed +C.Bold + "WARNING: " + ChatColor.RESET + "This uses 2000 Gems"
},
-1,
Material.EMERALD, (byte)0,
30000, new Ammo("Gem Party Bomb", "10 Gem Party Bomb", Material.EMERALD, (byte)0, new String[] { C.cWhite + "10 Coin Party Bomb to PARTY!" }, 10, 10));
}
@Override
@EventHandler
public void Activate(PlayerInteractEvent event)
{
if (event.getAction() != Action.RIGHT_CLICK_AIR && event.getAction() != Action.RIGHT_CLICK_BLOCK)
return;
if (UtilBlock.usable(event.getClickedBlock()))
return;
if (!UtilGear.isMat(event.getPlayer().getItemInHand(), this.GetDisplayMaterial()))
return;
Player player = event.getPlayer();
if (!IsActive(player))
return;
event.setCancelled(true);
//Stock
if (Manager.getInventoryManager().Get(player).getItemCount(GetName()) <= 0)
{
UtilPlayer.message(player, F.main("Gadget", "You do not have any " + GetName() + " left."));
ItemGadgetOutOfAmmoEvent ammoEvent = new ItemGadgetOutOfAmmoEvent(event.getPlayer(), this);
Bukkit.getServer().getPluginManager().callEvent(ammoEvent);
return;
}
//Gems
if (Manager.getDonationManager().Get(player.getName()).GetBalance(CurrencyType.Gems) < 2000)
{
UtilPlayer.message(player, F.main("Inventory", "You do not have the required " + C.cGreen + "2000 Gems") + ".");
return;
}
//Already In Use
if (!_activeBombs.isEmpty())
{
UtilPlayer.message(player, F.main("Inventory", "There is already a " + F.elem(C.cGreen + "Gem Bomb")) + " being used.");
return;
}
//Recharge
if (!Recharge.Instance.use(player, GetName(), _recharge, _recharge > 1000, false))
{
UtilInv.Update(player);
return;
}
//Use Stock/Gems
Manager.getInventoryManager().addItemToInventory(player, GetName(), -1);
Manager.getDonationManager().RewardGems(null, GetName(), event.getPlayer().getName(), event.getPlayer().getUniqueId(), -2000);
player.getInventory().setItem(Manager.getActiveItemSlot(), ItemStackFactory.Instance.CreateStack(GetDisplayMaterial(), GetDisplayData(), 1, F.item(GetName())));
ActivateCustom(event.getPlayer());
}
@Override
public void ActivateCustom(Player player)
{
Item item = player.getWorld().dropItem(player.getEyeLocation().add(player.getLocation().getDirection()), new ItemStack(Material.EMERALD_BLOCK));
UtilAction.velocity(item, player.getLocation().getDirection(), 1, false, 0, 0.2, 1, false);
_activeBombs.put(item, System.currentTimeMillis());
//Inform
for (Player other : UtilServer.getPlayers())
UtilPlayer.message(other, C.cGreen + C.Bold + player.getName() + C.cWhite + C.Bold + " has thrown a " + C.cGreen + C.Bold + "Gem Party Bomb" + C.cWhite + C.Bold + "!");
}
@EventHandler
public void Update(UpdateEvent event)
{
if (event.getType() != UpdateType.TICK)
return;
Iterator<Item> itemIterator = _activeBombs.keySet().iterator();
while (itemIterator.hasNext())
{
Item item = itemIterator.next();
long time = _activeBombs.get(item);
if (UtilTime.elapsed(time, 3000))
{
if (Math.random() > 0.80)
UtilFirework.playFirework(item.getLocation(), FireworkEffect.builder().flicker(false).withColor(Color.GREEN).with(Type.BURST).trail(false).build());
else
item.getWorld().playSound(item.getLocation(), Sound.FIREWORK_LAUNCH, 1f, 1f);
Item gem = item.getWorld().dropItem(item.getLocation().add(0, 1, 0), new ItemStack(Material.EMERALD));
//Velocity
long passed = System.currentTimeMillis() - time;
Vector vel = new Vector(Math.sin(passed/300d), 0, Math.cos(passed/300d));
UtilAction.velocity(gem, vel, Math.abs(Math.sin(passed/3000d)), false, 0, 0.2 + Math.abs(Math.cos(passed/3000d))*0.8, 1, false);
gem.setPickupDelay(40);
_gems.add(gem);
}
if (UtilTime.elapsed(time, 23000))
{
item.remove();
itemIterator.remove();
}
}
}
@EventHandler
public void Pickup(PlayerPickupItemEvent event)
{
if (_activeBombs.keySet().contains(event.getItem()))
{
event.setCancelled(true);
}
else if (_gems.contains(event.getItem()))
{
event.setCancelled(true);
event.getItem().remove();
Manager.getDonationManager().RewardGemsLater(GetName() + " Pickup", event.getPlayer(), 4);
event.getPlayer().getWorld().playSound(event.getPlayer().getLocation(), Sound.ORB_PICKUP, 1f, 2f);
}
}
@EventHandler
public void Clean(UpdateEvent event)
{
if (event.getType() != UpdateType.FAST)
return;
Iterator<Item> gemIterator = _gems.iterator();
while (gemIterator.hasNext())
{
Item gem = gemIterator.next();
if (!gem.isValid() || gem.getTicksLived() > 1200)
{
gem.remove();
gemIterator.remove();
}
}
}
}

View File

@ -1,5 +0,0 @@
package mineplex.core.gadget.gadgets.item;
public class ItemKothSword {
}

View File

@ -20,10 +20,12 @@ import org.bukkit.util.Vector;
import mineplex.core.common.util.C;
import mineplex.core.common.util.F;
import mineplex.core.common.util.LineFormat;
import mineplex.core.common.util.UtilAction;
import mineplex.core.common.util.UtilAlg;
import mineplex.core.common.util.UtilMath;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilText;
import mineplex.core.gadget.GadgetManager;
import mineplex.core.gadget.gadgets.Ammo;
import mineplex.core.gadget.types.ItemGadget;
@ -39,12 +41,8 @@ public class ItemMelonLauncher extends ItemGadget implements IThrown
public ItemMelonLauncher(GadgetManager manager)
{
super(manager, "Melon Launcher", new String[]
{
C.cWhite + "Deliciously fun!",
C.cWhite + "Eat the melon slices for a",
C.cWhite + "temporary speed boost!",
},
super(manager, "Melon Launcher",
UtilText.splitLineToArray(C.cWhite + "Because who doesn't want to shoot watermelons at people?!", LineFormat.LORE),
-1,
Material.MELON_BLOCK, (byte)0,
1000, new Ammo("Melon Launcher", "100 Melons", Material.MELON_BLOCK, (byte)0, new String[] { C.cWhite + "100 Melons for you to launch!" }, 500, 100));

View File

@ -21,9 +21,11 @@ import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause;
import org.bukkit.util.Vector;
import mineplex.core.common.util.C;
import mineplex.core.common.util.LineFormat;
import mineplex.core.common.util.UtilBlock;
import mineplex.core.common.util.UtilMath;
import mineplex.core.common.util.UtilParticle;
import mineplex.core.common.util.UtilText;
import mineplex.core.common.util.UtilParticle.ParticleType;
import mineplex.core.common.util.UtilParticle.ViewDist;
import mineplex.core.common.util.UtilServer;
@ -40,10 +42,9 @@ public class ItemPaintballGun extends ItemGadget
public ItemPaintballGun(GadgetManager manager)
{
super(manager, "Paintball Gun", new String[]
{
C.cWhite + "PEW PEW PEW PEW!",
}, -1, Material.GOLD_BARDING, (byte) 0, 200, new Ammo("Paintball Gun", "100 Paintballs", Material.GOLD_BARDING,
super(manager, "Paintball Gun",
UtilText.splitLineToArray(C.cWhite + "PEW PEW PEW!", LineFormat.LORE),
-1, Material.GOLD_BARDING, (byte) 0, 200, new Ammo("Paintball Gun", "100 Paintballs", Material.GOLD_BARDING,
(byte) 0, new String[]
{
C.cWhite + "100 Paintballs for you to shoot!"

View File

@ -18,6 +18,7 @@ import org.bukkit.event.player.PlayerInteractEvent;
import mineplex.core.common.util.C;
import mineplex.core.common.util.F;
import mineplex.core.common.util.LineFormat;
import mineplex.core.common.util.NautHashMap;
import mineplex.core.common.util.UtilAlg;
import mineplex.core.common.util.UtilEvent;
@ -25,6 +26,7 @@ import mineplex.core.common.util.UtilGear;
import mineplex.core.common.util.UtilMath;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilServer;
import mineplex.core.common.util.UtilText;
import mineplex.core.common.util.UtilEvent.ActionType;
import mineplex.core.gadget.GadgetManager;
import mineplex.core.gadget.gadgets.Ammo;
@ -43,12 +45,8 @@ public class ItemPaintbrush extends ItemGadget
public ItemPaintbrush(GadgetManager manager)
{
super(manager, "Paintbrush", new String[]
{
C.cWhite + "Unleash your inner creativity!",
C.cWhite + "",
C.cGreen + "Activated at a Painter NPC",
},
super(manager, "Paintbrush",
UtilText.splitLineToArray(C.cWhite + "Unleash your inner Bob Ross! Happy little trees!", LineFormat.LORE),
-3,
Material.WOOD_SWORD, (byte)0,
200, new Ammo("Paint", "100 Pixels", Material.INK_SACK, (byte)0, new String[] { C.cWhite + "100 Pixels worth of Paint!" }, 500, 100));
@ -57,7 +55,7 @@ public class ItemPaintbrush extends ItemGadget
@Override
public void ApplyItem(Player player, boolean inform)
{
Manager.removeGadetType(player, GadgetType.Item);
Manager.removeGadgetType(player, GadgetType.Item);
_active.add(player);
@ -202,7 +200,7 @@ public class ItemPaintbrush extends ItemGadget
Villager villager = (Villager)event.getRightClicked();
if (villager.getCustomName() != null && villager.getCustomName().contains("Painter"))
if (villager.getCustomName() != null && villager.getCustomName().contains("Bob Ross"))
{
Enable(event.getPlayer());
}

View File

@ -12,7 +12,9 @@ import org.bukkit.event.EventHandler;
import org.bukkit.util.Vector;
import mineplex.core.common.util.C;
import mineplex.core.common.util.LineFormat;
import mineplex.core.common.util.UtilParticle;
import mineplex.core.common.util.UtilText;
import mineplex.core.common.util.UtilParticle.ParticleType;
import mineplex.core.common.util.UtilParticle.ViewDist;
import mineplex.core.gadget.GadgetManager;
@ -29,26 +31,26 @@ public class ItemPartyPopper extends ItemGadget implements IThrown
public ItemPartyPopper(GadgetManager manager)
{
super(manager, "Confetti Bomb", new String[]
{
C.cWhite + "POP BANG!",
}, -1, Material.GOLDEN_CARROT, (byte) 0, 1000, new Ammo("Confetti Bomb", "100 Party Poppers", Material.DIAMOND_BARDING,
super(manager, "Party Popper",
UtilText.splitLineToArray(C.cWhite + "Celebrate by blasting confetti into peoples eyes!", LineFormat.LORE),
1, Material.GOLDEN_CARROT, (byte) 0, 1000, new Ammo("Party Popper", "1 Party Popper", Material.GOLDEN_CARROT,
(byte) 0, new String[]
{
C.cWhite + "100 Party Poppers for you to shoot!"
}, 500, 100));
}, -2, 1));
}
@Override
public void ActivateCustom(Player player)
{
/*
Item ent = player.getWorld().dropItem(player.getEyeLocation().add(player.getLocation().getDirection()),
ItemStackFactory.Instance.CreateStack(Material.REDSTONE_LAMP_OFF, (byte)0, 1, "Lamp" + Math.random()));
// Item ent = player.getWorld().dropItem(player.getEyeLocation().add(player.getLocation().getDirection()),
// ItemStackFactory.Instance.CreateStack(Material.REDSTONE_LAMP_OFF, (byte)0, 1, "Lamp" + Math.random()));
//
// UtilAction.velocity(ent, player.getLocation().getDirection().normalize().multiply(0.1), 1, false, 0, 0.2, 10, false);
//
// Manager.getProjectileManager().AddThrow(ent, player, this, 3000, false, false, true, true, 0.5f);
UtilAction.velocity(ent, player.getLocation().getDirection().normalize().multiply(0.1), 1, false, 0, 0.2, 10, false);
Manager.getProjectileManager().AddThrow(ent, player, this, 3000, false, false, true, true, 0.5f);
*/
@ -67,7 +69,7 @@ public class ItemPartyPopper extends ItemGadget implements IThrown
UtilParticle.PlayParticleToAll(ParticleType.ICON_CRACK.getParticle(Material.INK_SACK, data), player.getEyeLocation(), v, 1, 0, ViewDist.LONG);
}
/*
Item ent = player.getWorld().dropItem(player.getEyeLocation().add(player.getLocation().getDirection()),
ItemStackFactory.Instance.CreateStack(Material.INK_SACK, (byte)data, 1, "Ink" + Math.random()));
_items.add(ent);

View File

@ -11,7 +11,9 @@ import org.bukkit.event.entity.EntityDamageByEntityEvent;
import org.bukkit.util.Vector;
import mineplex.core.common.util.C;
import mineplex.core.common.util.LineFormat;
import mineplex.core.common.util.UtilAction;
import mineplex.core.common.util.UtilText;
import mineplex.core.gadget.GadgetManager;
import mineplex.core.gadget.event.GadgetCollideEntityEvent;
import mineplex.core.gadget.gadgets.Ammo;
@ -24,16 +26,13 @@ public class ItemSnowball extends ItemGadget
public ItemSnowball(GadgetManager manager)
{
super(manager, "Snowball", new String[]
{
C.cWhite + "Throw snowball!",
C.cWhite + "Start epic snowfights!"
}
, -1, Material.SNOW_BALL, (byte) 0, 1, new Ammo("Snowball", "50 Snowballs", Material.SNOW_BALL, (byte) 0, new String[]
super(manager, "Snowball",
UtilText.splitLineToArray(C.cWhite + "Join in on the festive fun by throwing snow at people!", LineFormat.LORE),
-1, Material.SNOW_BALL, (byte) 0, 1, new Ammo("Snowball", "1 Snowball", Material.SNOW_BALL, (byte) 0, new String[]
{
C.cWhite + "50 Snowballs for you to throw!"
}
, 100, 50));
, -3, 1));
}

View File

@ -12,11 +12,13 @@ import org.bukkit.event.entity.EntityExplodeEvent;
import mineplex.core.common.util.C;
import mineplex.core.common.util.F;
import mineplex.core.common.util.LineFormat;
import mineplex.core.common.util.UtilAction;
import mineplex.core.common.util.UtilAlg;
import mineplex.core.common.util.UtilParticle;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilServer;
import mineplex.core.common.util.UtilText;
import mineplex.core.common.util.UtilParticle.ParticleType;
import mineplex.core.common.util.UtilParticle.ViewDist;
import mineplex.core.gadget.GadgetManager;
@ -31,11 +33,8 @@ public class ItemTNT extends ItemGadget
public ItemTNT(GadgetManager manager)
{
super(manager, "TNT", new String[]
{
C.cWhite + "Blow some people up!",
C.cWhite + "KABOOM!",
},
super(manager, "TNT",
UtilText.splitLineToArray(C.cWhite + "Throwing TNT at Mineplex Staff is highly encouraged.", LineFormat.LORE),
-1,
Material.TNT, (byte)0,
1000, new Ammo("TNT", "20 TNT", Material.TNT, (byte)0, new String[] { C.cWhite + "20 TNT for you to explode!" }, 500, 20));

View File

@ -19,12 +19,14 @@ import org.bukkit.potion.PotionEffectType;
import mineplex.core.common.util.C;
import mineplex.core.common.util.F;
import mineplex.core.common.util.LineFormat;
import mineplex.core.common.util.UtilAction;
import mineplex.core.common.util.UtilAlg;
import mineplex.core.common.util.UtilBlock;
import mineplex.core.common.util.UtilEnt;
import mineplex.core.common.util.UtilEvent;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilText;
import mineplex.core.common.util.UtilEvent.ActionType;
import mineplex.core.disguise.disguises.DisguiseBat;
import mineplex.core.projectile.IThrown;
@ -40,15 +42,15 @@ public class MorphBat extends MorphGadget implements IThrown
{
public MorphBat(GadgetManager manager)
{
super(manager, "Bat Morph", new String[]
super(manager, "Bat Morph",
UtilText.splitLinesToArray(new String[]
{
C.cWhite + "Flap around and annoy people by",
C.cWhite + "screeching loudly into their ears!",
" ",
C.cYellow + "Left Click" + C.cGray + " to use " + C.cGreen + "Screech",
C.cYellow + "Double Jump" + C.cGray + " to use " + C.cGreen + "Flap",
C.cYellow + "Tap Sneak" + C.cGray + " to use " + C.cGreen + "Poop",
},
C.cGray + "Flap around and annoy people by screeching loudly into their ears!",
C.blankLine,
"#" + C.cWhite + "Left-Click to use Screech",
"#" + C.cWhite + "Double Jump to use Flap",
"#" + C.cWhite + "Sneak to use Poop",
}, LineFormat.LORE),
40000,
Material.SKULL_ITEM, (byte)1);
}

View File

@ -9,9 +9,11 @@ import org.bukkit.event.player.PlayerJoinEvent;
import mineplex.core.common.Rank;
import mineplex.core.common.util.C;
import mineplex.core.common.util.LineFormat;
import mineplex.core.common.util.UtilAction;
import mineplex.core.common.util.UtilParticle;
import mineplex.core.common.util.UtilServer;
import mineplex.core.common.util.UtilText;
import mineplex.core.common.util.UtilParticle.ParticleType;
import mineplex.core.common.util.UtilParticle.ViewDist;
import mineplex.core.disguise.disguises.DisguiseBlaze;
@ -24,15 +26,14 @@ public class MorphBlaze extends MorphGadget
{
public MorphBlaze(GadgetManager manager)
{
super(manager, "Blaze Morph", new String[]
super(manager, "Blaze Morph",
UtilText.splitLinesToArray(new String[]
{
C.cWhite + "Transforms the wearer into a fiery Blaze!",
" ",
C.cYellow + "Crouch" + C.cGray + " to use " + C.cGreen + "Firefly",
" ",
C.cPurple + "Unlocked with Hero Rank",
},
-1,
C.cGray + "Transform into a fiery Blaze, straight from the Nether!",
C.blankLine,
"#" + C.cWhite + "Crouch to use Firefly",
}, LineFormat.LORE),
-11,
Material.BLAZE_POWDER, (byte)0);
}

View File

@ -14,9 +14,11 @@ import org.bukkit.event.entity.ItemSpawnEvent;
import org.bukkit.event.player.PlayerInteractEvent;
import mineplex.core.common.util.C;
import mineplex.core.common.util.LineFormat;
import mineplex.core.common.util.UtilBlock;
import mineplex.core.common.util.UtilEvent;
import mineplex.core.common.util.UtilMath;
import mineplex.core.common.util.UtilText;
import mineplex.core.common.util.UtilEvent.ActionType;
import mineplex.core.event.StackerEvent;
import mineplex.core.gadget.GadgetManager;
@ -32,13 +34,13 @@ public class MorphBlock extends MorphGadget
public MorphBlock(GadgetManager manager)
{
super(manager, "Block Morph", new String[]
super(manager, "Block Morph", UtilText.splitLinesToArray(new String[]
{
C.cWhite + "The blockiest block that ever blocked.",
" ",
C.cYellow + "Left Click" + C.cGray + " to use " + C.cGreen + "Change Block",
C.cYellow + "Stay Still" + C.cGray + " to use " + C.cGreen + "Solidify",
},
C.cGray + "The blockiest block that ever blocked.",
C.blankLine,
"#" + C.cWhite + "Left Click to use Change Block",
"#" + C.cWhite + "Stay Still to use Solidify",
}, LineFormat.LORE),
30000,
Material.EMERALD_BLOCK, (byte)0);
}

View File

@ -24,12 +24,14 @@ import org.bukkit.potion.PotionEffectType;
import mineplex.core.common.CurrencyType;
import mineplex.core.common.util.C;
import mineplex.core.common.util.F;
import mineplex.core.common.util.LineFormat;
import mineplex.core.common.util.UtilAction;
import mineplex.core.common.util.UtilEnt;
import mineplex.core.common.util.UtilEvent;
import mineplex.core.common.util.UtilFirework;
import mineplex.core.common.util.UtilMath;
import mineplex.core.common.util.UtilParticle;
import mineplex.core.common.util.UtilText;
import mineplex.core.common.util.UtilParticle.ParticleType;
import mineplex.core.common.util.UtilParticle.ViewDist;
import mineplex.core.common.util.UtilPlayer;
@ -50,18 +52,16 @@ public class MorphBunny extends MorphGadget
public MorphBunny(GadgetManager manager)
{
super(manager, "Easter Bunny Morph", new String[]
super(manager, "Easter Bunny Morph", UtilText.splitLinesToArray(new String[]
{
C.cWhite + "Happy Easter!",
" ",
C.cYellow + "Charge Crouch" + C.cGray + " to use " + C.cGreen + "Super Jump",
C.cYellow + "Left Click" + C.cGray + " to use " + C.cGreen + "Hide Easter Egg",
" ",
C.cRed +C.Bold + "WARNING: " + ChatColor.RESET + "Hide Easter Egg uses 500 Coins" ,
" ",
C.cPurple + "No longer available",
},
-1,
C.cGray + "Happy Easter!",
C.blankLine,
"#" + C.cWhite + "Charge Crouch to use Super Jump",
"#" + C.cWhite + "Left Click to use Hide Easter Egg",
C.blankLine,
"#" + C.cRed +C.Bold + "WARNING: " + ChatColor.RESET + "Hide Easter Egg uses 500 Coins" ,
}, LineFormat.LORE),
-5,
Material.MONSTER_EGG, (byte)98);
}

View File

@ -17,10 +17,12 @@ import org.bukkit.util.Vector;
import mineplex.core.common.Rank;
import mineplex.core.common.util.C;
import mineplex.core.common.util.LineFormat;
import mineplex.core.common.util.UtilAction;
import mineplex.core.common.util.UtilBlock;
import mineplex.core.common.util.UtilEnt;
import mineplex.core.common.util.UtilEvent;
import mineplex.core.common.util.UtilText;
import mineplex.core.common.util.UtilEvent.ActionType;
import mineplex.core.disguise.disguises.DisguiseChicken;
import mineplex.core.recharge.Recharge;
@ -33,13 +35,13 @@ public class MorphChicken extends MorphGadget
{
public MorphChicken(GadgetManager manager)
{
super(manager, "Chicken Morph", new String[]
super(manager, "Chicken Morph", UtilText.splitLinesToArray(new String[]
{
C.cWhite + "Soar through the air like a fat Chicken!",
" ",
C.cYellow + "Left Click" + C.cGray + " to use " + C.cGreen + "Egg Shot",
C.cYellow + "Double Jump" + C.cGray + " to use " + C.cGreen + "Flap",
},
C.cGray + "Soar through the air like a fat Chicken!",
C.blankLine,
"#" + C.cWhite + "Left Click to use Egg Shot",
"#" + C.cWhite + "Double Jump to use Flap",
}, LineFormat.LORE),
20000,
Material.FEATHER, (byte)0);
}

View File

@ -7,7 +7,9 @@ import org.bukkit.event.EventHandler;
import org.bukkit.event.player.*;
import mineplex.core.common.util.C;
import mineplex.core.common.util.LineFormat;
import mineplex.core.common.util.UtilEvent;
import mineplex.core.common.util.UtilText;
import mineplex.core.common.util.UtilEvent.ActionType;
import mineplex.core.disguise.disguises.DisguiseCow;
import mineplex.core.recharge.Recharge;
@ -18,12 +20,12 @@ public class MorphCow extends MorphGadget
{
public MorphCow(GadgetManager manager)
{
super(manager, "Cow Morph", new String[]
super(manager, "Cow Morph", UtilText.splitLinesToArray(new String[]
{
C.cWhite + "How now brown cow?",
" ",
C.cYellow + "Left Click" + C.cGray + " to use " + C.cGreen + "Moo",
},
C.cGray + "How now brown cow?",
C.blankLine,
"#" + C.cWhite + "Left Click to use Moo",
}, LineFormat.LORE),
6000,
Material.LEATHER, (byte)0);
}

View File

@ -13,11 +13,13 @@ import org.bukkit.event.player.PlayerQuitEvent;
import mineplex.core.common.Rank;
import mineplex.core.common.util.C;
import mineplex.core.common.util.LineFormat;
import mineplex.core.common.util.UtilAction;
import mineplex.core.common.util.UtilAlg;
import mineplex.core.common.util.UtilParticle;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilServer;
import mineplex.core.common.util.UtilText;
import mineplex.core.common.util.UtilParticle.ParticleType;
import mineplex.core.common.util.UtilParticle.ViewDist;
import mineplex.core.disguise.disguises.DisguiseBase;
@ -33,15 +35,13 @@ public class MorphCreeper extends MorphGadget
public MorphCreeper(GadgetManager manager)
{
super(manager, "Creeper Morph", new String[]
super(manager, "Creeper Morph", UtilText.splitLinesToArray(new String[]
{
C.cWhite + "Transforms the wearer into a creepy Creeper!",
" ",
C.cYellow + "Crouch" + C.cGray + " to use " + C.cGreen + "Detonate",
" ",
C.cPurple + "Unlocked with Hero Rank",
},
-1,
C.cGray + "Become the creepiest of Creepers that ever creeped!",
C.blankLine,
C.cWhite + "Crouch to use Detonate",
}, LineFormat.LORE),
-11,
Material.SKULL_ITEM, (byte)4);
}

View File

@ -16,8 +16,10 @@ import org.bukkit.event.player.PlayerToggleFlightEvent;
import org.bukkit.util.Vector;
import mineplex.core.common.util.C;
import mineplex.core.common.util.LineFormat;
import mineplex.core.common.util.UtilBlock;
import mineplex.core.common.util.UtilFirework;
import mineplex.core.common.util.UtilText;
import mineplex.core.disguise.disguises.DisguiseEnderman;
import mineplex.core.gadget.GadgetManager;
import mineplex.core.gadget.types.MorphGadget;
@ -29,12 +31,12 @@ public class MorphEnderman extends MorphGadget
{
public MorphEnderman(GadgetManager manager)
{
super(manager, "Enderman Morph", new String[]
super(manager, "Enderman Morph", UtilText.splitLinesToArray(new String[]
{
C.cWhite + "Transforms the wearer into an Enderman!",
" ",
C.cYellow + "Double Jump" + C.cGray + " to use " + C.cGreen + "Blink",
},
C.cGray + "Using this morph is the ultimate diet! Guaranteed instant results!",
C.blankLine,
"#" + C.cWhite + "Double Jump to use Blink",
}, LineFormat.LORE),
30000,
Material.ENDER_PEARL, (byte)0);
}

View File

@ -1,75 +0,0 @@
package mineplex.core.gadget.gadgets.morph;
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.Sound;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.player.*;
import com.mojang.authlib.GameProfile;
import mineplex.core.common.util.C;
import mineplex.core.common.util.ProfileLoader;
import mineplex.core.common.util.UUIDFetcher;
import mineplex.core.common.util.UtilEvent;
import mineplex.core.common.util.UtilEvent.ActionType;
import mineplex.core.disguise.disguises.DisguisePlayer;
import mineplex.core.recharge.Recharge;
import mineplex.core.gadget.GadgetManager;
import mineplex.core.gadget.types.MorphGadget;
public class MorphGeno extends MorphGadget
{
private GameProfile _profile = null;
public MorphGeno(GadgetManager manager)
{
super(manager, "Genocide604", new String[]
{
"Say goodbye to Genocide604 by burping",
"and eating a lot.",
" ",
C.cYellow + "Left Click" + C.cGray + " to use " + C.cGreen + "Burp",
" ",
C.cRed + C.Bold + "WARNING: " + ChatColor.RESET + "This is a temporary item!",
},
10,
Material.SKULL_ITEM, (byte)3);
_profile = new ProfileLoader(UUIDFetcher.getUUIDOf("Genocide604").toString(), "Genocide604").loadProfile();
}
@Override
public void EnableCustom(final Player player)
{
this.ApplyArmor(player);
DisguisePlayer disguise = new DisguisePlayer(player, _profile);
Manager.getDisguiseManager().disguise(disguise);
}
@Override
public void DisableCustom(Player player)
{
this.RemoveArmor(player);
Manager.getDisguiseManager().undisguise(player);
}
@EventHandler
public void Action(PlayerInteractEvent event)
{
Player player = event.getPlayer();
if (!IsActive(player))
return;
if (!UtilEvent.isAction(event, ActionType.L))
return;
if (!Recharge.Instance.use(player, GetName(), 1500, false, false))
return;
player.getWorld().playSound(player.getEyeLocation(), Sound.BURP, 1f, (float) (0.8f + Math.random() * 0.4f));
}
}

View File

@ -1,70 +0,0 @@
package mineplex.core.gadget.gadgets.morph;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.player.*;
import com.mojang.authlib.GameProfile;
import mineplex.core.common.util.C;
import mineplex.core.common.util.ProfileLoader;
import mineplex.core.common.util.UUIDFetcher;
import mineplex.core.common.util.UtilEvent;
import mineplex.core.common.util.UtilEvent.ActionType;
import mineplex.core.disguise.disguises.DisguisePlayer;
import mineplex.core.recharge.Recharge;
import mineplex.core.gadget.GadgetManager;
import mineplex.core.gadget.types.MorphGadget;
public class MorphNotch extends MorphGadget
{
private GameProfile _notchProfile = null;
public MorphNotch(GadgetManager manager)
{
super(manager, "Notch", new String[]
{
"Who wouldn't want to be Notch?!",
//C.cYellow + "Left Click" + C.cGray + " to use " + C.cGreen + "Enforce EULA",
},
50000,
Material.SKULL_ITEM, (byte)3);
_notchProfile = new ProfileLoader(UUIDFetcher.getUUIDOf("Notch").toString(), "Notch").loadProfile();
}
@Override
public void EnableCustom(final Player player)
{
this.ApplyArmor(player);
DisguisePlayer disguise = new DisguisePlayer(player, _notchProfile);
Manager.getDisguiseManager().disguise(disguise);
}
@Override
public void DisableCustom(Player player)
{
this.RemoveArmor(player);
Manager.getDisguiseManager().undisguise(player);
}
//@EventHandler
public void Action(PlayerInteractEvent event)
{
Player player = event.getPlayer();
if (!IsActive(player))
return;
if (!UtilEvent.isAction(event, ActionType.L))
return;
if (!Recharge.Instance.use(player, GetName(), 1500, false, false))
return;
player.sendMessage("You have enforced the EULA.");
}
}

View File

@ -11,11 +11,13 @@ import org.bukkit.event.player.*;
import mineplex.core.common.Rank;
import mineplex.core.common.util.C;
import mineplex.core.common.util.LineFormat;
import mineplex.core.common.util.UtilAction;
import mineplex.core.common.util.UtilAlg;
import mineplex.core.common.util.UtilEnt;
import mineplex.core.common.util.UtilEvent;
import mineplex.core.common.util.UtilMath;
import mineplex.core.common.util.UtilText;
import mineplex.core.common.util.UtilEvent.ActionType;
import mineplex.core.common.util.UtilServer;
import mineplex.core.disguise.disguises.DisguisePig;
@ -31,16 +33,14 @@ public class MorphPig extends MorphGadget
public MorphPig(GadgetManager manager)
{
super(manager, "Pig Morph", new String[]
super(manager, "Pig Morph", UtilText.splitLinesToArray(new String[]
{
C.cWhite + "Oink. Oink. Oink.... Oink?",
" ",
C.cYellow + "Left Click" + C.cGray + " to use " + C.cGreen + "Oink",
C.cYellow + "Collide" + C.cGray + " to use " + C.cGreen + "Pig Bounce",
" ",
C.cAqua + "Unlocked with Ultra Rank",
},
-1,
C.cGray + "Oink. Oink. Oink.... Oink?",
C.blankLine,
"#" + C.cWhite + "Left Click to use Oink",
"#" + C.cWhite + "Collide to use Pig Bounce",
}, LineFormat.LORE),
-10,
Material.PORK, (byte)0);
}

View File

@ -7,7 +7,9 @@ import org.bukkit.entity.Skeleton.SkeletonType;
import org.bukkit.inventory.ItemStack;
import mineplex.core.common.util.C;
import mineplex.core.common.util.LineFormat;
import mineplex.core.common.util.UtilServer;
import mineplex.core.common.util.UtilText;
import mineplex.core.disguise.disguises.DisguiseSkeleton;
import mineplex.core.gadget.GadgetManager;
import mineplex.core.gadget.types.MorphGadget;
@ -17,15 +19,11 @@ public class MorphPumpkinKing extends MorphGadget
{
public MorphPumpkinKing(GadgetManager manager)
{
super(manager, "Pumpkin Kings Head", new String[]
super(manager, "Pumpkin Kings Head", UtilText.splitLinesToArray(new String[]
{
C.cWhite + "Transforms the wearer into",
C.cWhite + "the dreaded Pumpkin King!",
"",
C.cYellow + "Earned by defeating the Pumpkin King",
C.cYellow + "in the 2013 Halloween Horror Event.",
},
-1,
C.cGray + "Transforms the wearer into the dreaded Pumpkin King!",
}, LineFormat.LORE),
-4,
Material.PUMPKIN, (byte)0);
}

View File

@ -9,9 +9,11 @@ import org.bukkit.event.player.*;
import mineplex.core.account.CoreClientManager;
import mineplex.core.achievement.AchievementManager;
import mineplex.core.common.util.C;
import mineplex.core.common.util.LineFormat;
import mineplex.core.common.util.UtilAction;
import mineplex.core.common.util.UtilEnt;
import mineplex.core.common.util.UtilEvent;
import mineplex.core.common.util.UtilText;
import mineplex.core.common.util.UtilEvent.ActionType;
import mineplex.core.disguise.disguises.DisguiseSlime;
import mineplex.core.recharge.Recharge;
@ -25,14 +27,14 @@ public class MorphSlime extends MorphGadget
public MorphSlime(GadgetManager manager, AchievementManager achievements)
{
super(manager, "Big Larry Morph", new String[]
super(manager, "Big Larry Morph", UtilText.splitLinesToArray(new String[]
{
C.cWhite + "Become a slime like Big Larry!",
" ",
C.cYellow + "Left Click" + C.cGray + " to use " + C.cGreen + "Bounce",
" ",
C.cWhite + "+1 Slime Size for every 10 Mineplex Levels",
},
C.cGray + "Have you ever looked at Big Larry and thought, \'I really want to be that guy!\'? Well, today is your lucky day!",
C.blankLine,
"#" + C.cWhite + "Left Click to use Bounce",
C.blankLine,
"#" + C.cWhite + "+1 Size per 10 Mineplex Levels",
}, LineFormat.LORE),
80000,
Material.SLIME_BALL, (byte)0);

View File

@ -14,10 +14,12 @@ import org.bukkit.util.Vector;
import mineplex.core.common.util.C;
import mineplex.core.common.util.F;
import mineplex.core.common.util.LineFormat;
import mineplex.core.common.util.NautHashMap;
import mineplex.core.common.util.UtilAction;
import mineplex.core.common.util.UtilEnt;
import mineplex.core.common.util.UtilEvent;
import mineplex.core.common.util.UtilText;
import mineplex.core.common.util.UtilEvent.ActionType;
import mineplex.core.common.util.UtilMath;
import mineplex.core.common.util.UtilParticle;
@ -39,10 +41,17 @@ public class MorphSnowman extends MorphGadget
public MorphSnowman(GadgetManager manager)
{
super(manager, "Snowman Morph",
new String[]{ C.cWhite + "Do you wanna build a snowman?", C.cWhite + "It doesn't have to be a snowman...",
C.cWhite + "Or... it kind of does...", " ", C.cYellow + "Left Click" + C.cGray + " to use " + C.cGreen + "Snowball", },
6000, Material.SNOW_BALL, (byte) 0);
super(manager, "Olaf Morph",
UtilText.splitLinesToArray(new String[]
{
C.cGray + "Do you wanna build a snowman?",
C.cGray + "It doesn't have to be a snowman...",
C.cGray + "Or... it kind of does...",
C.blankLine,
"#" + C.cWhite + "Left-Click to use Blizzard",
"#" + C.cWhite + "Sneak to use Snow Slide",
}, LineFormat.LORE),
-3, Material.SNOW_BALL, (byte) 0);
}
@Override

View File

@ -9,9 +9,7 @@ import org.bukkit.Material;
import org.bukkit.Sound;
import org.bukkit.entity.ArmorStand;
import org.bukkit.entity.Entity;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import org.bukkit.entity.Zombie;
import org.bukkit.event.EventHandler;
import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.event.player.PlayerJoinEvent;
@ -19,12 +17,13 @@ import org.bukkit.util.Vector;
import mineplex.core.common.Rank;
import mineplex.core.common.util.C;
import mineplex.core.common.util.MapUtil;
import mineplex.core.common.util.LineFormat;
import mineplex.core.common.util.UtilAction;
import mineplex.core.common.util.UtilAlg;
import mineplex.core.common.util.UtilEnt;
import mineplex.core.common.util.UtilEvent;
import mineplex.core.common.util.UtilParticle;
import mineplex.core.common.util.UtilText;
import mineplex.core.common.util.UtilParticle.ParticleType;
import mineplex.core.common.util.UtilParticle.ViewDist;
import mineplex.core.common.util.UtilPlayer;
@ -45,16 +44,14 @@ public class MorphTitan extends MorphGadget
public MorphTitan(GadgetManager manager)
{
super(manager, "Elder Guardian Morph", new String[]
super(manager, "Elder Guardian Morph", UtilText.splitLinesToArray(new String[]
{
C.cWhite + "From the depths of the sea, the",
C.cWhite + "Elder Guardian posseses powers",
C.cWhite + "more amazing than any seen before!",
" ",
C.cRed + "Unlocked with Titan Rank",
},
-1,
Material.PRISMARINE_SHARD, (byte)0);
C.cGray + "From the depths of the sea, the Elder Guardian posseses powers more amazing than any seen before!",
C.blankLine,
"#" + C.cWhite + "Left-Click to use Guardians Laser",
}, LineFormat.LORE),
-13,
Material.PRISMARINE_CRYSTALS, (byte)0);
}
@Override

View File

@ -19,10 +19,12 @@ import org.bukkit.util.Vector;
import mineplex.core.common.CurrencyType;
import mineplex.core.common.util.C;
import mineplex.core.common.util.F;
import mineplex.core.common.util.LineFormat;
import mineplex.core.common.util.UtilAction;
import mineplex.core.common.util.UtilAlg;
import mineplex.core.common.util.UtilEvent;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilText;
import mineplex.core.common.util.UtilEvent.ActionType;
import mineplex.core.common.util.UtilParticle.ParticleType;
import mineplex.core.disguise.disguises.DisguiseVillager;
@ -40,14 +42,14 @@ public class MorphVillager extends MorphGadget implements IThrown
public MorphVillager(GadgetManager manager)
{
super(manager, "Villager Morph", new String[]
super(manager, "Villager Morph", UtilText.splitLinesToArray(new String[]
{
C.cWhite + "HURRRR! MURR HURRR!",
" ",
C.cYellow + "Left Click" + C.cGray + " to use " + C.cGreen + "Gem Throw",
" ",
C.cRed +C.Bold + "WARNING: " + ChatColor.RESET + "Gem Throw uses 20 Gems"
},
C.cGray + "HURRRR! MURR HURRR!",
C.blankLine,
"#" + C.cWhite + "Left Click to use Gem Throw",
C.blankLine,
"#" + C.cRed +C.Bold + "WARNING: " + ChatColor.RESET + "Gem Throw uses 20 Gems"
}, LineFormat.LORE),
12000,
Material.EMERALD, (byte)0);
}

View File

@ -6,10 +6,12 @@ import java.util.Iterator;
import mineplex.core.common.Rank;
import mineplex.core.common.util.C;
import mineplex.core.common.util.LineFormat;
import mineplex.core.common.util.UtilAction;
import mineplex.core.common.util.UtilAlg;
import mineplex.core.common.util.UtilEnt;
import mineplex.core.common.util.UtilEvent;
import mineplex.core.common.util.UtilText;
import mineplex.core.common.util.UtilEvent.ActionType;
import mineplex.core.common.util.UtilParticle;
import mineplex.core.common.util.UtilParticle.ParticleType;
@ -43,15 +45,13 @@ public class MorphWither extends MorphGadget
public MorphWither(GadgetManager manager)
{
super(manager, "Wither Morph", new String[]
super(manager, "Wither Morph", UtilText.splitLinesToArray(new String[]
{
C.cWhite + "Become a legendary Wither!",
" ",
C.cYellow + "Left Click" + C.cGray + " to use " + C.cGreen + "Wither Skull",
" ",
C.cGreen + "Unlocked with Legend Rank",
},
-1,
C.cGray + "Legends have foretold the coming of a powerful Wither...",
C.blankLine,
"#" + C.cWhite + "Left Click to use Wither Skull",
}, LineFormat.LORE),
-12,
Material.SKULL_ITEM, (byte)1);
}

View File

@ -11,9 +11,14 @@ import org.bukkit.event.player.PlayerCommandPreprocessEvent;
import org.bukkit.event.player.PlayerQuitEvent;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.LeatherArmorMeta;
import org.bukkit.potion.PotionEffect;
import org.bukkit.potion.PotionEffectType;
import mineplex.core.common.util.C;
import mineplex.core.common.util.LineFormat;
import mineplex.core.common.util.UtilGear;
import mineplex.core.common.util.UtilServer;
import mineplex.core.common.util.UtilText;
import mineplex.core.gadget.GadgetManager;
import mineplex.core.gadget.types.OutfitGadget;
import mineplex.core.updater.UpdateType;
@ -27,7 +32,9 @@ public class OutfitRaveSuit extends OutfitGadget
public OutfitRaveSuit(GadgetManager manager, String name,
int cost, ArmorSlot slot, Material mat, byte data)
{
super(manager, name, new String[] {ChatColor.RESET + "Wear the complete set for",ChatColor.RESET + "awesome bonus effects!", ChatColor.RESET + "Bonus coming soon..."}, cost, slot, mat, data);
super(manager, name,
UtilText.splitLineToArray(C.cWhite + "There's nothing more suitable for celebration than this high tech flashing outfit!", LineFormat.LORE),
cost, slot, mat, data);
}
@Override
@ -155,4 +162,18 @@ public class OutfitRaveSuit extends OutfitGadget
{
_colorPhase.remove(event.getPlayer().getName());
}
@EventHandler
public void setBonus(UpdateEvent event)
{
if (event.getType() != UpdateType.FAST)
return;
if (GetSlot() != ArmorSlot.Helmet)
return;
for (Player player : UtilServer.getPlayers())
if (getSet() != null && getSet().isActive(player))
player.addPotionEffect(new PotionEffect(PotionEffectType.SPEED, 39, 4, true, false), true);
}
}

View File

@ -0,0 +1,15 @@
package mineplex.core.gadget.gadgets.outfit;
import mineplex.core.gadget.GadgetManager;
import org.bukkit.Material;
public class OutfitRaveSuitBoots extends OutfitRaveSuit
{
public OutfitRaveSuitBoots(GadgetManager manager)
{
super(manager, "Rave Boots", -2, ArmorSlot.Boots, Material.LEATHER_BOOTS, (byte)0);
}
}

View File

@ -0,0 +1,15 @@
package mineplex.core.gadget.gadgets.outfit;
import mineplex.core.gadget.GadgetManager;
import org.bukkit.Material;
public class OutfitRaveSuitChestplate extends OutfitRaveSuit
{
public OutfitRaveSuitChestplate(GadgetManager manager)
{
super(manager, "Rave Shirt", -2, ArmorSlot.Chest, Material.LEATHER_CHESTPLATE, (byte)0);
}
}

View File

@ -0,0 +1,15 @@
package mineplex.core.gadget.gadgets.outfit;
import mineplex.core.gadget.GadgetManager;
import org.bukkit.Material;
public class OutfitRaveSuitHelmet extends OutfitRaveSuit
{
public OutfitRaveSuitHelmet(GadgetManager manager)
{
super(manager, "Rave Hat", -2, ArmorSlot.Helmet, Material.LEATHER_HELMET, (byte)0);
}
}

View File

@ -0,0 +1,15 @@
package mineplex.core.gadget.gadgets.outfit;
import mineplex.core.gadget.GadgetManager;
import org.bukkit.Material;
public class OutfitRaveSuitLeggings extends OutfitRaveSuit
{
public OutfitRaveSuitLeggings(GadgetManager manager)
{
super(manager, "Rave Pants", -2, ArmorSlot.Legs, Material.LEATHER_LEGGINGS, (byte)0);
}
}

View File

@ -3,16 +3,28 @@ package mineplex.core.gadget.gadgets.outfit;
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.potion.PotionEffect;
import org.bukkit.potion.PotionEffectType;
import mineplex.core.common.util.C;
import mineplex.core.common.util.LineFormat;
import mineplex.core.common.util.UtilServer;
import mineplex.core.common.util.UtilText;
import mineplex.core.gadget.GadgetManager;
import mineplex.core.gadget.types.OutfitGadget;
import mineplex.core.gadget.types.OutfitGadget.ArmorSlot;
import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
public class OutfitSpaceSuit extends OutfitGadget
{
public OutfitSpaceSuit(GadgetManager manager, String name,
int cost, ArmorSlot slot, Material mat, byte data)
{
super(manager, name, new String[] {ChatColor.RESET + "Wear the complete set for",ChatColor.RESET + "awesome bonus effects!", ChatColor.RESET + "Bonus coming soon..."}, cost, slot, mat, data);
super(manager, name,
UtilText.splitLineToArray(C.cWhite + "Designed specifically for combat in deep space for a sport known as \'Gravity\'", LineFormat.LORE),
cost, slot, mat, data);
}
@Override
@ -26,4 +38,18 @@ public class OutfitSpaceSuit extends OutfitGadget
{
RemoveArmor(player);
}
@EventHandler
public void setBonus(UpdateEvent event)
{
if (event.getType() != UpdateType.FAST)
return;
if (GetSlot() != ArmorSlot.Helmet)
return;
for (Player player : UtilServer.getPlayers())
if (getSet() != null && getSet().isActive(player))
player.addPotionEffect(new PotionEffect(PotionEffectType.JUMP, 39, 7, true, false), true);
}
}

View File

@ -0,0 +1,15 @@
package mineplex.core.gadget.gadgets.outfit;
import mineplex.core.gadget.GadgetManager;
import org.bukkit.Material;
public class OutfitSpaceSuitBoots extends OutfitSpaceSuit
{
public OutfitSpaceSuitBoots(GadgetManager manager)
{
super(manager, "Space Boots", -2, ArmorSlot.Boots, Material.GOLD_BOOTS, (byte)0);
}
}

View File

@ -0,0 +1,15 @@
package mineplex.core.gadget.gadgets.outfit;
import mineplex.core.gadget.GadgetManager;
import org.bukkit.Material;
public class OutfitSpaceSuitChestplate extends OutfitSpaceSuit
{
public OutfitSpaceSuitChestplate(GadgetManager manager)
{
super(manager, "Space Jacket", -2, ArmorSlot.Chest, Material.GOLD_CHESTPLATE, (byte)0);
}
}

View File

@ -0,0 +1,15 @@
package mineplex.core.gadget.gadgets.outfit;
import mineplex.core.gadget.GadgetManager;
import org.bukkit.Material;
public class OutfitSpaceSuitHelmet extends OutfitSpaceSuit
{
public OutfitSpaceSuitHelmet(GadgetManager manager)
{
super(manager, "Space Helmet", -2, ArmorSlot.Helmet, Material.GLASS, (byte)0);
}
}

View File

@ -0,0 +1,15 @@
package mineplex.core.gadget.gadgets.outfit;
import mineplex.core.gadget.GadgetManager;
import org.bukkit.Material;
public class OutfitSpaceSuitLeggings extends OutfitSpaceSuit
{
public OutfitSpaceSuitLeggings(GadgetManager manager)
{
super(manager, "Space Pants", -2, ArmorSlot.Legs, Material.GOLD_LEGGINGS, (byte)0);
}
}

View File

@ -56,7 +56,7 @@ public class OutfitTeam extends OutfitGadget
@Override
public void ApplyArmor(Player player)
{
Manager.removeGadetType(player, GadgetType.Morph);
Manager.removeGadgetType(player, GadgetType.Morph);
Manager.RemoveOutfit(player, _slot);

View File

@ -10,7 +10,10 @@ import org.bukkit.event.EventHandler;
import org.bukkit.event.player.PlayerQuitEvent;
import org.bukkit.util.Vector;
import mineplex.core.common.util.C;
import mineplex.core.common.util.LineFormat;
import mineplex.core.common.util.UtilParticle;
import mineplex.core.common.util.UtilText;
import mineplex.core.common.util.UtilParticle.ParticleType;
import mineplex.core.common.util.UtilParticle.ViewDist;
import mineplex.core.gadget.GadgetManager;
@ -25,7 +28,9 @@ public class ParticleCandyCane extends ParticleGadget
public ParticleCandyCane(GadgetManager manager)
{
super(manager, "Candy Cane Particle", new String[]{"Christmas. Nuf said."}, 10, Material.CHEST, (byte)0);
super(manager, "Crushed Candy Cane",
UtilText.splitLineToArray(C.cGray + "Theres no such thing as too much Christmas Candy. Dont listen to your dentist.", LineFormat.LORE),
-3, Material.CHEST, (byte)0);
}
@EventHandler

View File

@ -5,7 +5,9 @@ import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import mineplex.core.common.util.C;
import mineplex.core.common.util.LineFormat;
import mineplex.core.common.util.UtilParticle;
import mineplex.core.common.util.UtilText;
import mineplex.core.common.util.UtilParticle.ParticleType;
import mineplex.core.common.util.UtilParticle.ViewDist;
import mineplex.core.gadget.GadgetManager;
@ -18,10 +20,9 @@ public class ParticleCoalFumes extends ParticleGadget
public ParticleCoalFumes(GadgetManager manager)
{
super(manager, "Coal Fumes", new String[]
{
C.cDGray + "Nothing to read here. Please move on."
}, -1, Material.COAL, (byte) 0);
super(manager, "Coal Fumes",
UtilText.splitLineToArray(C.cGray + "Being on the Naughty List does have some perks... if you love coal, that is...", LineFormat.LORE),
-1, Material.COAL, (byte) 0);
}
@EventHandler

View File

@ -6,8 +6,10 @@ import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import mineplex.core.common.util.C;
import mineplex.core.common.util.LineFormat;
import mineplex.core.common.util.UtilParticle;
import mineplex.core.common.util.UtilServer;
import mineplex.core.common.util.UtilText;
import mineplex.core.common.util.UtilParticle.ParticleType;
import mineplex.core.common.util.UtilParticle.ViewDist;
import mineplex.core.gadget.types.ParticleGadget;
@ -19,13 +21,8 @@ public class ParticleEnchant extends ParticleGadget
{
public ParticleEnchant(GadgetManager manager)
{
super(manager, "Enchanted", new String[]
{
C.cWhite + "The wisdom of the universe",
C.cWhite + "suddenly finds you extremely",
C.cWhite + "attractive, and wants to",
C.cWhite + "\'enchant\' you.",
},
super(manager, "Enchanted",
UtilText.splitLineToArray(C.cGray + "The wisdom of the universe suddenly find you extremely attractive, and wants to \'enchant\' you.", LineFormat.LORE),
-2,
Material.BOOK, (byte)0);
}

View File

@ -23,9 +23,9 @@ public class ParticleFairy extends ParticleGadget
{
super(manager, "Flame Fairy", new String[]
{
C.cWhite + "HEY! LISTEN!",
C.cWhite + "HEY! LISTEN!",
C.cWhite + "HEY! LISTEN!",
C.cGray + "HEY! LISTEN!",
C.cGray + "HEY! LISTEN!",
C.cGray + "HEY! LISTEN!",
},
-2,
Material.BLAZE_POWDER, (byte)0);

View File

@ -7,8 +7,10 @@ import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import mineplex.core.common.util.C;
import mineplex.core.common.util.LineFormat;
import mineplex.core.common.util.UtilParticle;
import mineplex.core.common.util.UtilServer;
import mineplex.core.common.util.UtilText;
import mineplex.core.common.util.UtilParticle.ParticleType;
import mineplex.core.common.util.UtilParticle.ViewDist;
import mineplex.core.gadget.types.ParticleGadget;
@ -21,12 +23,8 @@ public class ParticleFireRings extends ParticleGadget
public ParticleFireRings(GadgetManager manager)
{
super(manager, "Flame Rings", new String[]
{
C.cWhite + "Forged from the burning ashes",
C.cWhite + "of 1000 Blazes by the infamous",
C.cWhite + "Flame King of the Nether realm.",
},
super(manager, "Flame Rings",
UtilText.splitLineToArray(C.cGray + "Forged from the blazing rods of 1000 Blazes by the infamous Nether King.", LineFormat.LORE),
-2,
Material.BLAZE_POWDER, (byte)0);
}

View File

@ -14,11 +14,13 @@ import org.bukkit.event.EventHandler;
import org.bukkit.util.Vector;
import mineplex.core.common.util.C;
import mineplex.core.common.util.LineFormat;
import mineplex.core.common.util.UtilBlock;
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.UtilText;
import mineplex.core.common.util.UtilTime;
import mineplex.core.common.util.UtilParticle.ParticleType;
import mineplex.core.common.util.UtilParticle.ViewDist;
@ -35,13 +37,8 @@ public class ParticleFoot extends ParticleGadget
public ParticleFoot(GadgetManager manager)
{
super(manager, "Shadow Walk", new String[]
{
C.cWhite + "In a world where footprints",
C.cWhite + "do not exist, leaving your",
C.cWhite + "shadow behind is the next",
C.cWhite + "best thing.",
},
super(manager, "Shadow Walk",
UtilText.splitLineToArray(C.cGray + "In a world where footprints do not exist, leaving your shadow behind is the next best thing!", LineFormat.LORE),
-2,
Material.LEATHER_BOOTS, (byte)0);
}

View File

@ -9,7 +9,9 @@ import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import mineplex.core.common.util.C;
import mineplex.core.common.util.LineFormat;
import mineplex.core.common.util.UtilParticle;
import mineplex.core.common.util.UtilText;
import mineplex.core.common.util.UtilParticle.ParticleType;
import mineplex.core.common.util.UtilParticle.ViewDist;
import mineplex.core.common.util.UtilServer;
@ -23,17 +25,11 @@ import mineplex.core.updater.event.UpdateEvent;
public class ParticleFrostLord extends ParticleGadget
{
private HashSet<Arrow> _arrows = new HashSet<Arrow>();
public ParticleFrostLord(GadgetManager manager)
{
super(manager, "Wind of the Frost Lord", new String[]
{
C.cWhite + "You are a mighty frost lord.",
C.cWhite + "Your double jumps and arrows",
C.cWhite + "are enchanted with snow powers.",
},
10,
super(manager, "Wind of the Frost Lord",
UtilText.splitLineToArray(C.cGray + "Hes not passing wind okay? HE HAS A CONDITION!", LineFormat.LORE),
-3,
Material.SNOW_BALL, (byte)0, "Frost Lord");
}
@ -61,8 +57,8 @@ public class ParticleFrostLord extends ParticleGadget
int amount = 4;
GadgetSet set = Manager.getGadgetSet(SetFrostLord.class);
if(set.isActive(player)) amount = 6;
if(getSet() != null && getSet().isActive(player))
amount = 6;
double ang = Math.PI*2/amount;

View File

@ -7,8 +7,10 @@ import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import mineplex.core.common.util.C;
import mineplex.core.common.util.LineFormat;
import mineplex.core.common.util.UtilParticle;
import mineplex.core.common.util.UtilServer;
import mineplex.core.common.util.UtilText;
import mineplex.core.common.util.UtilParticle.ParticleType;
import mineplex.core.common.util.UtilParticle.ViewDist;
import mineplex.core.gadget.types.ParticleGadget;
@ -21,12 +23,8 @@ public class ParticleGreen extends ParticleGadget
public ParticleGreen(GadgetManager manager)
{
super(manager, "Green Ring", new String[]
{
C.cWhite + "With these sparkles, you",
C.cWhite + "can now sparkle while you",
C.cWhite + "sparkle with CaptainSparklez.",
},
super(manager, "Green Ring",
UtilText.splitLineToArray(C.cGray + "With these sparkles, you can sparkle while sparkle with CaptainSparklez!", LineFormat.LORE),
-2,
Material.EMERALD, (byte)0);
}

View File

@ -13,11 +13,13 @@ import org.bukkit.event.player.PlayerQuitEvent;
import mineplex.core.common.util.C;
import mineplex.core.common.util.F;
import mineplex.core.common.util.LineFormat;
import mineplex.core.common.util.UtilAlg;
import mineplex.core.common.util.UtilMath;
import mineplex.core.common.util.UtilParticle;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilServer;
import mineplex.core.common.util.UtilText;
import mineplex.core.common.util.UtilParticle.ParticleType;
import mineplex.core.common.util.UtilParticle.ViewDist;
import mineplex.core.gadget.types.ParticleGadget;
@ -31,12 +33,8 @@ public class ParticleHeart extends ParticleGadget {
public ParticleHeart(GadgetManager manager)
{
super(manager, "I Heart You", new String[]
{
C.cWhite + "With these particles, you can",
C.cWhite + "show off how much you heart",
C.cWhite + "everyone on Mineplex!",
},
super(manager, "I Heart You",
UtilText.splitLineToArray(C.cGray + "Show off how much you love Mineplex and everyone on it!", LineFormat.LORE),
-2,
Material.APPLE, (byte)0);
}

View File

@ -7,7 +7,9 @@ import org.bukkit.event.EventHandler;
import org.bukkit.util.Vector;
import mineplex.core.common.util.C;
import mineplex.core.common.util.LineFormat;
import mineplex.core.common.util.UtilParticle;
import mineplex.core.common.util.UtilText;
import mineplex.core.common.util.UtilParticle.ParticleType;
import mineplex.core.common.util.UtilParticle.ViewDist;
import mineplex.core.common.util.UtilServer;
@ -21,12 +23,8 @@ public class ParticleHelix extends ParticleGadget
public ParticleHelix(GadgetManager manager)
{
super(manager, "Blood Helix", new String[]
{
C.cWhite + "Ancient legend says this magic",
C.cWhite + "empowers the blood of its user,",
C.cWhite + "giving them godly powers.",
},
super(manager, "Blood Helix",
UtilText.splitLineToArray(C.cGray + "Blood magic is very dangerous... but also very cool!", LineFormat.LORE),
-2,
Material.REDSTONE, (byte)0);
}

View File

@ -25,9 +25,9 @@ public class ParticleKronos extends ParticleGadget
{
super(manager, "Titanic Aura", new String[]
{
C.cWhite + "A symbol of Titan power",
C.cWhite + "whos ancestry traces back to Kronos,",
C.cWhite + "Titan Lord of Time.",
C.cGray + "A symbol of Titan power",
C.cGray + "whos ancestry traces back to Kronos,",
C.cGray + "Titan Lord of Time.",
" ",
C.cRed + "???"
//When purchasable: C.cRed + "Unlocked with Titan Rank"

View File

@ -8,6 +8,8 @@ import org.bukkit.event.player.PlayerJoinEvent;
import mineplex.core.common.Rank;
import mineplex.core.common.util.C;
import mineplex.core.common.util.LineFormat;
import mineplex.core.common.util.UtilText;
import mineplex.core.gadget.types.ParticleGadget;
import mineplex.core.inventory.ClientItem;
import mineplex.core.inventory.data.Item;
@ -19,14 +21,9 @@ public class ParticleLegend extends ParticleGadget
{
public ParticleLegend(GadgetManager manager)
{
super(manager, "Legendary Aura", new String[]
{
C.cWhite + "These mystic particle attach to",
C.cWhite + "only the most legendary of players!",
" ",
C.cGreen + "Unlocked with Legend Rank",
},
-3,
super(manager, "Legendary Aura",
UtilText.splitLineToArray(C.cGray + "This particle will be updated soon! Yay!", LineFormat.LORE),
-1,
Material.ENDER_PORTAL_FRAME, (byte)0);
}

View File

@ -7,8 +7,10 @@ import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import mineplex.core.common.util.C;
import mineplex.core.common.util.LineFormat;
import mineplex.core.common.util.UtilParticle;
import mineplex.core.common.util.UtilServer;
import mineplex.core.common.util.UtilText;
import mineplex.core.common.util.UtilParticle.ParticleType;
import mineplex.core.common.util.UtilParticle.ViewDist;
import mineplex.core.gadget.types.ParticleGadget;
@ -21,12 +23,8 @@ public class ParticleRain extends ParticleGadget
public ParticleRain(GadgetManager manager)
{
super(manager, "Rain Cloud", new String[]
{
C.cWhite + "Your very own rain cloud!",
C.cWhite + "Now you never have to worry",
C.cWhite + "about not being wet. Woo...",
},
super(manager, "Rain Cloud",
UtilText.splitLineToArray(C.cGray + "Bring your sadness wherever you go, with your very own portable rain cloud!", LineFormat.LORE),
-2,
Material.INK_SACK, (byte)4);
}

View File

@ -9,7 +9,9 @@ import org.bukkit.util.Vector;
import mineplex.core.common.Rank;
import mineplex.core.common.util.C;
import mineplex.core.common.util.LineFormat;
import mineplex.core.common.util.UtilParticle;
import mineplex.core.common.util.UtilText;
import mineplex.core.common.util.UtilParticle.ParticleType;
import mineplex.core.common.util.UtilParticle.ViewDist;
import mineplex.core.gadget.GadgetManager;
@ -24,15 +26,9 @@ public class ParticleTitan extends ParticleGadget
public ParticleTitan(GadgetManager manager)
{
super(manager, "Flame of the Titans", new String[]
{
C.cWhite + "These flames are said to be the",
C.cWhite + "souls of a lost civilisation of",
C.cWhite + "Titans, forgotten by time.",
" ",
C.cRed + "Unlocked with Titan Rank",
},
-3,
super(manager, "Flame of the Titans",
UtilText.splitLineToArray(C.cGray + "These flames are said to be the spirit of a Titan.", LineFormat.LORE),
-1,
Material.FIREBALL, (byte)0);
}
@ -52,6 +48,10 @@ public class ParticleTitan extends ParticleGadget
continue;
double total = 3;
if(getSet() != null && getSet().isActive(player))
total = 4;
double step = (1/total)*Math.PI*2;
double offset1 = (step/20)*_tick%20;
double offset2 = (step/31)*_tick%31;

View File

@ -0,0 +1,24 @@
package mineplex.core.gadget.set;
import org.bukkit.entity.Player;
import mineplex.core.common.util.F;
import mineplex.core.gadget.GadgetManager;
import mineplex.core.gadget.gadgets.arrowtrail.ArrowTrailCandyCane;
import mineplex.core.gadget.gadgets.death.DeathCandyCane;
import mineplex.core.gadget.gadgets.doublejump.DoubleJumpCandyCane;
import mineplex.core.gadget.gadgets.particle.ParticleCandyCane;
import mineplex.core.gadget.types.GadgetSet;
public class SetCandyCane extends GadgetSet
{
public SetCandyCane(GadgetManager manager)
{
super(manager, "Candy Cane", "Coming Soon...",
manager.getGadget(ArrowTrailCandyCane.class),
manager.getGadget(DeathCandyCane.class),
manager.getGadget(DoubleJumpCandyCane.class),
manager.getGadget(ParticleCandyCane.class));
}
}

View File

@ -15,24 +15,10 @@ public class SetFrostLord extends GadgetSet
public SetFrostLord(GadgetManager manager)
{
super(manager,
super(manager, "Frost Lord", "Improved Wind of the Frost Lord",
manager.getGadget(ArrowTrailFrostLord.class),
manager.getGadget(DeathFrostLord.class),
manager.getGadget(DoubleJumpFrostLord.class),
manager.getGadget(ParticleFrostLord.class));
}
@Override
public void customEnable(Player player)
{
player.sendMessage(F.main("GadgetSet", "Enabled full set of " + F.elem("Frost Lord")));
}
@Override
public void customDisable(Player player)
{
player.sendMessage(F.main("GadgetSet", "Disabled full set of " + F.elem("Frost Lord")));
}
}

View File

@ -0,0 +1,17 @@
package mineplex.core.gadget.set;
import mineplex.core.gadget.GadgetManager;
import mineplex.core.gadget.gadgets.outfit.*;
import mineplex.core.gadget.types.GadgetSet;
public class SetRaveSuit extends GadgetSet
{
public SetRaveSuit(GadgetManager manager)
{
super(manager, "Rave Suit", "Hyper Speed",
manager.getGadget(OutfitRaveSuitHelmet.class),
manager.getGadget(OutfitRaveSuitChestplate.class),
manager.getGadget(OutfitRaveSuitLeggings.class),
manager.getGadget(OutfitRaveSuitBoots.class));
}
}

Some files were not shown because too many files have changed in this diff Show More