Merge with master
This commit is contained in:
commit
88709f85b6
1
.gitignore
vendored
1
.gitignore
vendored
@ -17,6 +17,7 @@ update
|
|||||||
Reference
|
Reference
|
||||||
|
|
||||||
/Plugins/.idea/workspace.xml
|
/Plugins/.idea/workspace.xml
|
||||||
|
/Plugins/.idea/tasks.xml
|
||||||
/Plugins/out
|
/Plugins/out
|
||||||
BungeeCord
|
BungeeCord
|
||||||
/Plugins/Mineplex.Bungee.Mineplexer/*.gitignore
|
/Plugins/Mineplex.Bungee.Mineplexer/*.gitignore
|
||||||
|
BIN
Art/Halloween Horror.jpg
Normal file
BIN
Art/Halloween Horror.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 356 KiB |
BIN
Art/Pumpkin.png
Normal file
BIN
Art/Pumpkin.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 692 KiB |
BIN
Art/Spooky Sale.png
Normal file
BIN
Art/Spooky Sale.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 176 KiB |
19
Plugins/.idea/dataSources.xml
Normal file
19
Plugins/.idea/dataSources.xml
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="DataSourceManagerImpl" format="xml" hash="1293212710">
|
||||||
|
<data-source source="LOCAL" name="Mineplex" uuid="14dfc55d-5343-47c4-ab24-76a055b8059e">
|
||||||
|
<driver-ref>mysql</driver-ref>
|
||||||
|
<synchronize>true</synchronize>
|
||||||
|
<jdbc-driver>com.mysql.jdbc.Driver</jdbc-driver>
|
||||||
|
<jdbc-url>jdbc:mysql://db.mineplex.com:3306</jdbc-url>
|
||||||
|
<driver-properties>
|
||||||
|
<property name="zeroDateTimeBehavior" value="convertToNull" />
|
||||||
|
<property name="tinyInt1isBit" value="false" />
|
||||||
|
<property name="characterEncoding" value="utf8" />
|
||||||
|
<property name="characterSetResults" value="utf8" />
|
||||||
|
<property name="yearIsDateType" value="false" />
|
||||||
|
</driver-properties>
|
||||||
|
<libraries />
|
||||||
|
</data-source>
|
||||||
|
</component>
|
||||||
|
</project>
|
BIN
Plugins/Libraries/Votifier.jar
Normal file
BIN
Plugins/Libraries/Votifier.jar
Normal file
Binary file not shown.
@ -55,12 +55,12 @@ public class MotdManager implements Listener, Runnable
|
|||||||
|
|
||||||
//String motdLine = "§f§l◄ §c§lMaintenance§f§l ►";
|
//String motdLine = "§f§l◄ §c§lMaintenance§f§l ►";
|
||||||
//String motdLine = "§f§l◄ §a§lCarl the Creeper§f§l ►";
|
//String motdLine = "§f§l◄ §a§lCarl the Creeper§f§l ►";
|
||||||
String motdLine = " §b§l◄§f§lNEW GAME§b§l► §f§l◄§b§lEVOLUTION§f§l► §b§l◄§f§lNEW GAME§b§l►";
|
String motdLine = " §4§l§n H A L L O W E E N H O R R O R §f";
|
||||||
//String motdLine = " §f§l◄ §a§lCarl the Creeper§f§l ▬ §c§l75% OFF SALE§f§l ►";
|
//String motdLine = " §f§l◄ §a§lCarl the Creeper§f§l ▬ §c§l75% OFF SALE§f§l ►";
|
||||||
//String motdLine = " §d§lRank Sale §a§l40% Off");
|
//String motdLine = " §d§lRank Sale §a§l40% Off");
|
||||||
//String motdLine = " §f§l◄§c§lMAINTENANCE§f§l►");
|
//String motdLine = " §f§l◄§c§lMAINTENANCE§f§l►");
|
||||||
|
|
||||||
updateMainMotd(" §b§l§m §8§l§m[ §r §9§lMineplex§r §f§lGames§r §8§l§m ]§b§l§m §r", motdLine);
|
updateMainMotd(" §4§l§m §f§l§m §8§l§m[ §r §4§lMineplex§r §f§lGames§r §8§l§m ]§f§l§m §4§l§m §r", motdLine);
|
||||||
System.out.println("Updated Bungee MOTD");
|
System.out.println("Updated Bungee MOTD");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -9,15 +9,16 @@ import mineplex.core.common.util.UtilPlayer;
|
|||||||
public enum Rank
|
public enum Rank
|
||||||
{
|
{
|
||||||
//Staff
|
//Staff
|
||||||
LT("LT", ChatColor.DARK_RED),
|
LT("Leader", ChatColor.GOLD),
|
||||||
OWNER("Owner", ChatColor.DARK_RED),
|
OWNER("Owner", ChatColor.GOLD),
|
||||||
DEVELOPER("Dev", ChatColor.RED),
|
DEVELOPER("Dev", ChatColor.GOLD),
|
||||||
ADMIN("Admin", ChatColor.RED),
|
ADMIN("Admin", ChatColor.GOLD),
|
||||||
JNR_DEV("Jr.Dev", ChatColor.RED),
|
JNR_DEV("Jr.Dev", ChatColor.GOLD),
|
||||||
|
SUPPORT("Support", ChatColor.BLUE),
|
||||||
SNR_MODERATOR("Sr.Mod", ChatColor.GOLD),
|
SNR_MODERATOR("Sr.Mod", ChatColor.GOLD),
|
||||||
MODERATOR("Mod", ChatColor.GOLD),
|
MODERATOR("Mod", ChatColor.GOLD),
|
||||||
HELPER("Trainee", ChatColor.DARK_AQUA),
|
HELPER("Trainee", ChatColor.DARK_AQUA),
|
||||||
MAPLEAD("MapLead", ChatColor.DARK_PURPLE),
|
MAPLEAD("MapLead", ChatColor.BLUE),
|
||||||
MAPDEV("Builder", ChatColor.BLUE),
|
MAPDEV("Builder", ChatColor.BLUE),
|
||||||
MEDIA("Media", ChatColor.BLUE),
|
MEDIA("Media", ChatColor.BLUE),
|
||||||
|
|
||||||
@ -29,6 +30,7 @@ public enum Rank
|
|||||||
TWITCH("Twitch", ChatColor.DARK_PURPLE),
|
TWITCH("Twitch", ChatColor.DARK_PURPLE),
|
||||||
|
|
||||||
//Player
|
//Player
|
||||||
|
TITAN("Titan", ChatColor.RED, true),
|
||||||
LEGEND("Legend", ChatColor.GREEN, true),
|
LEGEND("Legend", ChatColor.GREEN, true),
|
||||||
HERO("Hero", ChatColor.LIGHT_PURPLE, true),
|
HERO("Hero", ChatColor.LIGHT_PURPLE, true),
|
||||||
ULTRA("Ultra", ChatColor.AQUA, true),
|
ULTRA("Ultra", ChatColor.AQUA, true),
|
||||||
|
@ -0,0 +1,232 @@
|
|||||||
|
package mineplex.core.common.lang;
|
||||||
|
|
||||||
|
import java.text.Format;
|
||||||
|
import java.text.MessageFormat;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Locale;
|
||||||
|
|
||||||
|
import org.bukkit.ChatColor;
|
||||||
|
import org.bukkit.entity.Entity;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
|
public class IntlString
|
||||||
|
{
|
||||||
|
|
||||||
|
public static IntlString[] toIntl(String... strings)
|
||||||
|
{
|
||||||
|
IntlString[] intl = new IntlString[strings.length];
|
||||||
|
|
||||||
|
for (int i = 0; i < strings.length; i++) {
|
||||||
|
final String string = strings[i];
|
||||||
|
intl[i] = new IntlString("")
|
||||||
|
{
|
||||||
|
public String tr(Locale locale)
|
||||||
|
{
|
||||||
|
return string;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
return intl;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* An empty {@link IntlString}.
|
||||||
|
*/
|
||||||
|
public static final IntlString EMPTY = toIntl("")[0];
|
||||||
|
|
||||||
|
private final Argument<String> key;
|
||||||
|
private final List<Argument<Object>> arguments = new ArrayList<>();
|
||||||
|
|
||||||
|
public IntlString(String key, ChatColor... styles)
|
||||||
|
{
|
||||||
|
this.key = new Argument<>(key, styles);
|
||||||
|
}
|
||||||
|
|
||||||
|
IntlString(String key, String style)
|
||||||
|
{
|
||||||
|
this.key = new Argument<>(key, style);
|
||||||
|
}
|
||||||
|
|
||||||
|
private IntlString arg(Argument<Object> argument)
|
||||||
|
{
|
||||||
|
IntlString result = new IntlString(getKey().getArgument(), getKey().getStyle());
|
||||||
|
result.arguments.addAll(getArguments());
|
||||||
|
result.arguments.add(argument);
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Argument<String> getKey()
|
||||||
|
{
|
||||||
|
return key;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<Argument<Object>> getArguments()
|
||||||
|
{
|
||||||
|
return Collections.unmodifiableList(arguments);
|
||||||
|
}
|
||||||
|
|
||||||
|
public IntlString arg(Object value, ChatColor... styles)
|
||||||
|
{
|
||||||
|
return arg(new Argument<>(value, styles));
|
||||||
|
}
|
||||||
|
|
||||||
|
public IntlString arg(Object value, String style)
|
||||||
|
{
|
||||||
|
return arg(new Argument<>(value, style));
|
||||||
|
}
|
||||||
|
|
||||||
|
public String tr()
|
||||||
|
{
|
||||||
|
return tr(Locale.getDefault());
|
||||||
|
}
|
||||||
|
|
||||||
|
public String tr(Entity entity)
|
||||||
|
{
|
||||||
|
if (entity instanceof Player)
|
||||||
|
return tr((Player) entity);
|
||||||
|
else
|
||||||
|
return tr();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String tr(Player player)
|
||||||
|
{
|
||||||
|
return tr(Lang.getPlayerLocale(player));
|
||||||
|
}
|
||||||
|
|
||||||
|
public String tr(Locale locale)
|
||||||
|
{
|
||||||
|
if (locale == null)
|
||||||
|
locale = Locale.getDefault();
|
||||||
|
|
||||||
|
String formatString = Lang.get(getKey().getArgument(), locale);
|
||||||
|
|
||||||
|
if (getKey().getArgument().equals("stats.achievements.disabled.requires.0.players"))
|
||||||
|
{
|
||||||
|
int x = 8;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (getArguments().isEmpty())
|
||||||
|
return getKey().getStyle() + formatString;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
MessageFormat format = new MessageFormat(formatString, locale);
|
||||||
|
|
||||||
|
Format[] formats = format.getFormatsByArgumentIndex();
|
||||||
|
Object[] argArray = new Object[getArguments().size()];
|
||||||
|
for (int i = 0; i < formats.length; i++)
|
||||||
|
{
|
||||||
|
argArray[i] = getArguments().get(i);
|
||||||
|
if (argArray[i] instanceof IntlString)
|
||||||
|
argArray[i] = ((IntlString) argArray[i]).tr(locale);
|
||||||
|
|
||||||
|
if (formats[i] != null)
|
||||||
|
{
|
||||||
|
argArray[i] = formats[i].format(argArray[i]);
|
||||||
|
format.setFormatByArgumentIndex(i, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
String style = getArguments().get(i).getStyle();
|
||||||
|
if (!style.isEmpty())
|
||||||
|
argArray[i] = style + argArray[i] + ChatColor.RESET;
|
||||||
|
|
||||||
|
argArray[i] = argArray[i] + getKey().getStyle();
|
||||||
|
}
|
||||||
|
|
||||||
|
return getKey().getStyle() + format.format(argArray, new StringBuffer(), null).toString();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean equals(Object o)
|
||||||
|
{
|
||||||
|
if (!(o instanceof IntlString))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
IntlString s = (IntlString) o;
|
||||||
|
|
||||||
|
return getKey().equals(s.getKey()) && getArguments().equals(s.getArguments());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode()
|
||||||
|
{
|
||||||
|
return toString().hashCode();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString()
|
||||||
|
{
|
||||||
|
return toEnglishString();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String toEnglishString()
|
||||||
|
{
|
||||||
|
return tr(Locale.ENGLISH);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static class Argument<T>
|
||||||
|
{
|
||||||
|
private final T argument;
|
||||||
|
private final String style;
|
||||||
|
|
||||||
|
public Argument(T value, ChatColor... styles)
|
||||||
|
{
|
||||||
|
this.argument = value;
|
||||||
|
|
||||||
|
String s = "";
|
||||||
|
ChatColor color = null;
|
||||||
|
for (ChatColor style : styles)
|
||||||
|
{
|
||||||
|
if (style.isColor())
|
||||||
|
color = style;
|
||||||
|
else if (style.isFormat())
|
||||||
|
s += style;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.style = ChatColor.getLastColors((color == null ? "" : color) + s);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Argument(T value, String style)
|
||||||
|
{
|
||||||
|
this.argument = value;
|
||||||
|
this.style = style == null ? "" : ChatColor.getLastColors(style);
|
||||||
|
}
|
||||||
|
|
||||||
|
public T getArgument()
|
||||||
|
{
|
||||||
|
return argument;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getStyle()
|
||||||
|
{
|
||||||
|
return style;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean equals(Object o)
|
||||||
|
{
|
||||||
|
if (!(o instanceof Argument))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
Argument<?> p = (Argument<?>) o;
|
||||||
|
|
||||||
|
return getArgument().equals(p.getArgument()) && getStyle().equals(p.getStyle());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode()
|
||||||
|
{
|
||||||
|
return toString().hashCode();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString()
|
||||||
|
{
|
||||||
|
return getStyle() + getArgument();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,154 @@
|
|||||||
|
package mineplex.core.common.lang;
|
||||||
|
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Locale;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.MissingResourceException;
|
||||||
|
import java.util.ResourceBundle;
|
||||||
|
|
||||||
|
import mineplex.core.common.util.F;
|
||||||
|
|
||||||
|
import org.bukkit.ChatColor;
|
||||||
|
import org.bukkit.entity.Entity;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
|
public final class Lang
|
||||||
|
{
|
||||||
|
public static interface PlayerLocaleFunction
|
||||||
|
{
|
||||||
|
public Locale getLocaleOfPlayer(Player player);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private static PlayerLocaleFunction _playerLocaleFunction = null;
|
||||||
|
private static final Map<Locale, ResourceBundle> _localeResourceBundles = Collections.synchronizedMap(new HashMap<Locale, ResourceBundle>());
|
||||||
|
|
||||||
|
|
||||||
|
public Lang()
|
||||||
|
{
|
||||||
|
init();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void init()
|
||||||
|
{
|
||||||
|
System.out.println(F.main("i18n","Attempting to initialize resource bundles..."));
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// Locales over which we should iterate and load.
|
||||||
|
for (Locale loc : new Locale[] {
|
||||||
|
Locale.ENGLISH,
|
||||||
|
Locale.GERMAN
|
||||||
|
})
|
||||||
|
{
|
||||||
|
ResourceBundle bundle = ResourceBundle.getBundle("mineplex.core.common.lang.MineplexBundle", loc);
|
||||||
|
_localeResourceBundles.put(loc, bundle);
|
||||||
|
System.out.println("Loaded " + loc.toString() + "...");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (MissingResourceException e)
|
||||||
|
{
|
||||||
|
System.err.println("AN ERROR OCCURED WHILE ATTEMPTING TO LOAD RESOURCE LOCALES");
|
||||||
|
// For now at least, crash the runtime.
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static PlayerLocaleFunction getPlayerLocaleFunction()
|
||||||
|
{
|
||||||
|
return _playerLocaleFunction;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void setPlayerLocaleFunction(PlayerLocaleFunction playerLocaleFunction)
|
||||||
|
{
|
||||||
|
_playerLocaleFunction = playerLocaleFunction;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Locale getPlayerLocale(Player player)
|
||||||
|
{
|
||||||
|
if (getPlayerLocaleFunction() == null)
|
||||||
|
return Locale.getDefault();
|
||||||
|
else
|
||||||
|
return getPlayerLocaleFunction().getLocaleOfPlayer(player);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static ResourceBundle getResourceBundle(Locale locale)
|
||||||
|
{
|
||||||
|
synchronized (_localeResourceBundles)
|
||||||
|
{
|
||||||
|
if (_localeResourceBundles.containsKey(locale))
|
||||||
|
return _localeResourceBundles.get(locale);
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return _localeResourceBundles.get(Locale.ENGLISH);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static ResourceBundle getBestResourceBundle(Locale locale)
|
||||||
|
{
|
||||||
|
ResourceBundle bundle = getResourceBundle(locale);
|
||||||
|
|
||||||
|
if (bundle == null && !locale.equals(Locale.getDefault()))
|
||||||
|
bundle = getResourceBundle(Locale.getDefault());
|
||||||
|
|
||||||
|
if (bundle == null && !locale.equals(Locale.ENGLISH))
|
||||||
|
bundle = getResourceBundle(Locale.ENGLISH);
|
||||||
|
|
||||||
|
return bundle;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Shorthand method for obtaining and translating a key.
|
||||||
|
*/
|
||||||
|
public static String tr(String key, Entity entity, Object... args)
|
||||||
|
{
|
||||||
|
IntlString string = key(key);
|
||||||
|
|
||||||
|
for (Object a : args)
|
||||||
|
string.arg(a);
|
||||||
|
|
||||||
|
return string.tr(entity);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String get(String key)
|
||||||
|
{
|
||||||
|
return get(key, (Locale) null);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String get(String key, Locale locale)
|
||||||
|
{
|
||||||
|
if (key == null)
|
||||||
|
return null;
|
||||||
|
else if (key.isEmpty())
|
||||||
|
return "";
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (locale == null)
|
||||||
|
locale = Locale.getDefault();
|
||||||
|
|
||||||
|
ResourceBundle bundle = getBestResourceBundle(locale);
|
||||||
|
if (bundle == null)
|
||||||
|
return null;
|
||||||
|
|
||||||
|
return bundle.getString(key);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String get(String key, Player player)
|
||||||
|
{
|
||||||
|
return get(key, getPlayerLocale(player));
|
||||||
|
}
|
||||||
|
|
||||||
|
public static IntlString key(String key, ChatColor... styles)
|
||||||
|
{
|
||||||
|
return new IntlString(key, styles);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static IntlString key(String key, String style)
|
||||||
|
{
|
||||||
|
return new IntlString(key, style);
|
||||||
|
}
|
||||||
|
}
|
@ -28,6 +28,23 @@ public class C
|
|||||||
public static String cWhite = "" + ChatColor.WHITE;
|
public static String cWhite = "" + ChatColor.WHITE;
|
||||||
public static String cYellow = "" + ChatColor.YELLOW;
|
public static String cYellow = "" + ChatColor.YELLOW;
|
||||||
|
|
||||||
|
public static String cAquaB = "" + ChatColor.AQUA + "" + ChatColor.BOLD;
|
||||||
|
public static String cBlackB = "" + ChatColor.BLACK + "" + ChatColor.BOLD;
|
||||||
|
public static String cBlueB = "" + ChatColor.BLUE + "" + ChatColor.BOLD;
|
||||||
|
public static String cDAquaB = "" + ChatColor.DARK_AQUA + "" + ChatColor.BOLD;
|
||||||
|
public static String cDBlueB = "" + ChatColor.DARK_BLUE + "" + ChatColor.BOLD;
|
||||||
|
public static String cDGrayB = "" + ChatColor.DARK_GRAY + "" + ChatColor.BOLD;
|
||||||
|
public static String cDGreenB = "" + ChatColor.DARK_GREEN + "" + ChatColor.BOLD;
|
||||||
|
public static String cDPurpleB = "" + ChatColor.DARK_PURPLE + "" + ChatColor.BOLD;
|
||||||
|
public static String cDRedB = "" + ChatColor.DARK_RED + "" + ChatColor.BOLD;
|
||||||
|
public static String cGoldB = "" + ChatColor.GOLD + "" + ChatColor.BOLD;
|
||||||
|
public static String cGrayB = "" + ChatColor.GRAY + "" + ChatColor.BOLD;
|
||||||
|
public static String cGreenB = "" + ChatColor.GREEN + "" + ChatColor.BOLD;
|
||||||
|
public static String cPurpleB = "" + ChatColor.LIGHT_PURPLE + "" + ChatColor.BOLD;
|
||||||
|
public static String cRedB = "" + ChatColor.RED + "" + ChatColor.BOLD;
|
||||||
|
public static String cWhiteB = "" + ChatColor.WHITE + "" + ChatColor.BOLD;
|
||||||
|
public static String cYellowB = "" + ChatColor.YELLOW + "" + ChatColor.BOLD;
|
||||||
|
|
||||||
public static String mHead = "" + ChatColor.BLUE;
|
public static String mHead = "" + ChatColor.BLUE;
|
||||||
public static String mBody = "" + ChatColor.GRAY;
|
public static String mBody = "" + ChatColor.GRAY;
|
||||||
public static String mChat = "" + ChatColor.WHITE;
|
public static String mChat = "" + ChatColor.WHITE;
|
||||||
|
@ -739,4 +739,11 @@ public class UtilPlayer
|
|||||||
player.setPlayerListName(playerName);
|
player.setPlayerListName(playerName);
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
public static Location getTargetLocation(Player player, double distance)
|
||||||
|
{
|
||||||
|
Vector looking = player.getLocation().getDirection().clone();
|
||||||
|
looking.multiply(distance);
|
||||||
|
return player.getEyeLocation().clone().add(looking);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -29,6 +29,19 @@ public class UtilTime
|
|||||||
return sdf.format(cal.getTime());
|
return sdf.format(cal.getTime());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static String getDayOfMonthSuffix(final int n)
|
||||||
|
{
|
||||||
|
if (n >= 11 && n <= 13) {
|
||||||
|
return "th";
|
||||||
|
}
|
||||||
|
switch (n % 10) {
|
||||||
|
case 1: return "st";
|
||||||
|
case 2: return "nd";
|
||||||
|
case 3: return "rd";
|
||||||
|
default: return "th";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public enum TimeUnit
|
public enum TimeUnit
|
||||||
{
|
{
|
||||||
FIT(1),
|
FIT(1),
|
||||||
|
@ -60,7 +60,7 @@ public class UpdateRank extends CommandBase<CoreClientManager>
|
|||||||
|
|
||||||
final Rank rank = tempRank;
|
final Rank rank = tempRank;
|
||||||
|
|
||||||
if (rank == Rank.ADMIN || rank == Rank.YOUTUBE || rank == Rank.TWITCH || rank == Rank.MODERATOR || rank == Rank.JNR_DEV || rank == Rank.HELPER || rank == Rank.ALL || rank == Rank.MAPDEV || rank == Rank.SNR_MODERATOR)
|
if (rank == Rank.ADMIN || rank == Rank.YOUTUBE || rank == Rank.TWITCH || rank == Rank.MODERATOR || rank == Rank.JNR_DEV || rank == Rank.HELPER || rank == Rank.ALL || rank == Rank.MAPDEV || rank == Rank.SNR_MODERATOR || rank == Rank.SUPPORT)
|
||||||
{
|
{
|
||||||
if (!testServer && rank.has(Rank.ADMIN) && !Plugin.hasRank(caller, Rank.LT))
|
if (!testServer && rank.has(Rank.ADMIN) && !Plugin.hasRank(caller, Rank.LT))
|
||||||
{
|
{
|
||||||
|
@ -209,7 +209,7 @@ public class AccountRepository extends RepositoryBase
|
|||||||
{
|
{
|
||||||
public void run(final Rank response)
|
public void run(final Rank response)
|
||||||
{
|
{
|
||||||
if (rank == Rank.ULTRA || rank == Rank.HERO || rank == Rank.LEGEND)
|
if (rank == Rank.ULTRA || rank == Rank.HERO || rank == Rank.LEGEND || rank == Rank.TITAN)
|
||||||
{
|
{
|
||||||
if (perm)
|
if (perm)
|
||||||
executeUpdate(UPDATE_ACCOUNT_RANK_DONOR_PERM, new ColumnVarChar("rank", 100, rank.toString()), new ColumnVarChar("donorRank", 100, rank.toString()), new ColumnVarChar("uuid", 100, uuid.toString()));
|
executeUpdate(UPDATE_ACCOUNT_RANK_DONOR_PERM, new ColumnVarChar("rank", 100, rank.toString()), new ColumnVarChar("donorRank", 100, rank.toString()), new ColumnVarChar("uuid", 100, uuid.toString()));
|
||||||
|
@ -16,6 +16,13 @@ public enum Achievement
|
|||||||
new int[]{10000, 15000, 20000, 25000, 30000, 35000, 40000, 45000, 50000, 55000, 60000, 65000},
|
new int[]{10000, 15000, 20000, 25000, 30000, 35000, 40000, 45000, 50000, 55000, 60000, 65000},
|
||||||
AchievementCategory.GLOBAL),
|
AchievementCategory.GLOBAL),
|
||||||
|
|
||||||
|
GLOBAL_PUMPKIN_SMASHER_2015("2015 Pumpkin Smasher", 4000,
|
||||||
|
new String[]{"Global.Halloween Pumpkins 2015"},
|
||||||
|
new String[]{"Smash 200 Flaming Pumpkins,",
|
||||||
|
"during Halloween 2015!"},
|
||||||
|
new int[]{200},
|
||||||
|
AchievementCategory.HOLIDAY),
|
||||||
|
|
||||||
//Bridges
|
//Bridges
|
||||||
BRIDGES_WINS("Bridge Champion", 600,
|
BRIDGES_WINS("Bridge Champion", 600,
|
||||||
new String[]{"The Bridges.Wins"},
|
new String[]{"The Bridges.Wins"},
|
||||||
@ -777,7 +784,7 @@ public enum Achievement
|
|||||||
public static String getExperienceString(int level)
|
public static String getExperienceString(int level)
|
||||||
{
|
{
|
||||||
if (level < 0)
|
if (level < 0)
|
||||||
return C.cPurple + level;
|
return C.cAqua + level;
|
||||||
|
|
||||||
if (level < 20)
|
if (level < 20)
|
||||||
return C.cGray + level;
|
return C.cGray + level;
|
||||||
|
@ -6,9 +6,11 @@ import mineplex.core.account.CoreClientManager;
|
|||||||
import mineplex.core.common.Rank;
|
import mineplex.core.common.Rank;
|
||||||
import mineplex.core.common.util.C;
|
import mineplex.core.common.util.C;
|
||||||
import mineplex.core.common.util.UtilTime;
|
import mineplex.core.common.util.UtilTime;
|
||||||
|
import mineplex.core.game.GameDisplay;
|
||||||
import mineplex.core.stats.PlayerStats;
|
import mineplex.core.stats.PlayerStats;
|
||||||
import mineplex.core.stats.StatsManager;
|
import mineplex.core.stats.StatsManager;
|
||||||
|
|
||||||
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
@ -19,16 +21,28 @@ public enum AchievementCategory
|
|||||||
new StatDisplay("Daily Rewards", "DailyReward"), new StatDisplay("Times Voted", "DailyVote"), null, new StatDisplay("Chests Opened", "Treasure.Old", "Treasure.Ancient", "Treasure.Mythical") },
|
new StatDisplay("Daily Rewards", "DailyReward"), new StatDisplay("Times Voted", "DailyVote"), null, new StatDisplay("Chests Opened", "Treasure.Old", "Treasure.Ancient", "Treasure.Mythical") },
|
||||||
Material.EMERALD, 0, GameCategory.GLOBAL, "None"),
|
Material.EMERALD, 0, GameCategory.GLOBAL, "None"),
|
||||||
|
|
||||||
|
HOLIDAY("Holiday Achievements", null,
|
||||||
|
new StatDisplay[] {},
|
||||||
|
Material.PUMPKIN_PIE, 0, GameCategory.HOLIDAY, "None"),
|
||||||
|
|
||||||
BRIDGES("The Bridges", null,
|
BRIDGES("The Bridges", null,
|
||||||
new StatDisplay[] { StatDisplay.WINS, StatDisplay.GAMES_PLAYED, StatDisplay.KILLS, StatDisplay.DEATHS, StatDisplay.GEMS_EARNED },
|
new StatDisplay[] { StatDisplay.WINS, StatDisplay.GAMES_PLAYED, StatDisplay.KILLS, StatDisplay.DEATHS, StatDisplay.GEMS_EARNED },
|
||||||
Material.IRON_PICKAXE, 0, GameCategory.SURVIVAL, "Destructor Kit"),
|
Material.IRON_PICKAXE, 0, GameCategory.SURVIVAL, "Destructor Kit"),
|
||||||
|
|
||||||
SURVIVAL_GAMES("Survival Games", null,
|
SURVIVAL_GAMES("Survival Games", null,
|
||||||
new StatDisplay[] { StatDisplay.WINS, StatDisplay.GAMES_PLAYED, StatDisplay.KILLS, StatDisplay.DEATHS, StatDisplay.GEMS_EARNED },
|
new StatDisplay[] { StatDisplay.WINS, StatDisplay.GAMES_PLAYED, StatDisplay.KILLS, StatDisplay.DEATHS, StatDisplay.GEMS_EARNED,
|
||||||
|
null, null, new StatDisplay(C.Bold + "Teams Stats", true), null,
|
||||||
|
StatDisplay.fromGame("Wins", GameDisplay.SurvivalGamesTeams, "Wins"), StatDisplay.fromGame("Games Played", GameDisplay.SurvivalGamesTeams, "Wins", "Losses"),
|
||||||
|
StatDisplay.fromGame("Kills", GameDisplay.SurvivalGamesTeams, "Kills"), StatDisplay.fromGame("Deaths", GameDisplay.SurvivalGamesTeams, "Deaths"),
|
||||||
|
StatDisplay.fromGame("Gems Earned", GameDisplay.SurvivalGamesTeams, "GemsEarned") },
|
||||||
Material.DIAMOND_SWORD, 0, GameCategory.SURVIVAL, "Horseman Kit"),
|
Material.DIAMOND_SWORD, 0, GameCategory.SURVIVAL, "Horseman Kit"),
|
||||||
|
|
||||||
SKYWARS("Skywars",null,
|
SKYWARS("Skywars",null,
|
||||||
new StatDisplay[]{StatDisplay.WINS, StatDisplay.GAMES_PLAYED, StatDisplay.KILLS, StatDisplay.DEATHS, StatDisplay.GEMS_EARNED},
|
new StatDisplay[]{StatDisplay.WINS, StatDisplay.GAMES_PLAYED, StatDisplay.KILLS, StatDisplay.DEATHS, StatDisplay.GEMS_EARNED,
|
||||||
|
null, null, new StatDisplay(C.Bold + "Team Stats", true), null,
|
||||||
|
StatDisplay.fromGame("Wins", GameDisplay.SkywarsTeams, "Wins"), StatDisplay.fromGame("Games Played", GameDisplay.SkywarsTeams, "Wins", "Losses"),
|
||||||
|
StatDisplay.fromGame("Kills", GameDisplay.SkywarsTeams, "Kills"), StatDisplay.fromGame("Deaths", GameDisplay.SkywarsTeams, "Deaths"),
|
||||||
|
StatDisplay.fromGame("Gems Earned", GameDisplay.SkywarsTeams, "GemsEarned") },
|
||||||
Material.FEATHER, 0, GameCategory.SURVIVAL, "Destructor Kit"),
|
Material.FEATHER, 0, GameCategory.SURVIVAL, "Destructor Kit"),
|
||||||
|
|
||||||
UHC("Ultra Hardcore", null,
|
UHC("Ultra Hardcore", null,
|
||||||
@ -49,7 +63,11 @@ public enum AchievementCategory
|
|||||||
Material.GRASS, 0, GameCategory.CLASSICS, "Infestor Kit"),
|
Material.GRASS, 0, GameCategory.CLASSICS, "Infestor Kit"),
|
||||||
|
|
||||||
SMASH_MOBS("Super Smash Mobs", null,
|
SMASH_MOBS("Super Smash Mobs", null,
|
||||||
new StatDisplay[] { StatDisplay.WINS, StatDisplay.GAMES_PLAYED, StatDisplay.KILLS, StatDisplay.DEATHS, StatDisplay.GEMS_EARNED },
|
new StatDisplay[] { StatDisplay.WINS, StatDisplay.GAMES_PLAYED, StatDisplay.KILLS, StatDisplay.DEATHS, StatDisplay.GEMS_EARNED,
|
||||||
|
null, null, new StatDisplay(C.Bold + "Team Stats", true), null,
|
||||||
|
StatDisplay.fromGame("Wins", GameDisplay.SmashTeams, "Wins"), StatDisplay.fromGame("Games Played", GameDisplay.SmashTeams, "Wins", "Losses"),
|
||||||
|
StatDisplay.fromGame("Kills", GameDisplay.SmashTeams, "Kills"), StatDisplay.fromGame("Deaths", GameDisplay.SmashTeams, "Deaths"),
|
||||||
|
StatDisplay.fromGame("Gems Earned", GameDisplay.SmashTeams, "GemsEarned")},
|
||||||
Material.SKULL_ITEM, 4, GameCategory.CLASSICS, "Sheep Kit"),
|
Material.SKULL_ITEM, 4, GameCategory.CLASSICS, "Sheep Kit"),
|
||||||
|
|
||||||
MINE_STRIKE("MineStrike", null,
|
MINE_STRIKE("MineStrike", null,
|
||||||
@ -203,6 +221,11 @@ public enum AchievementCategory
|
|||||||
lore.add(" ");
|
lore.add(" ");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
else if (_statDisplays[i].isJustDisplayName())
|
||||||
|
{
|
||||||
|
lore.add(ChatColor.RESET + _statDisplays[i].getDisplayName());
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
String displayName = _statDisplays[i].getDisplayName();
|
String displayName = _statDisplays[i].getDisplayName();
|
||||||
|
|
||||||
@ -211,9 +234,21 @@ public enum AchievementCategory
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
int statNumber = 0;
|
int statNumber = 0;
|
||||||
|
|
||||||
|
|
||||||
|
// This is so we could load stats from other games
|
||||||
|
// (Refer to team games, displaying team stats in the normal game view)
|
||||||
|
if (_statDisplays[i].isFullStat())
|
||||||
|
{
|
||||||
|
for (String statName : _statDisplays[i].getStats())
|
||||||
|
statNumber += stats.getStat(statName);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
for (String statToPull : _statsToPull)
|
for (String statToPull : _statsToPull)
|
||||||
for (String statName : _statDisplays[i].getStats())
|
for (String statName : _statDisplays[i].getStats())
|
||||||
statNumber += stats.getStat(statToPull + "." + statName);
|
statNumber += stats.getStat(statToPull + "." + statName);
|
||||||
|
}
|
||||||
|
|
||||||
String statString = C.cWhite + statNumber;
|
String statString = C.cWhite + statNumber;
|
||||||
// Need to display special for time
|
// Need to display special for time
|
||||||
@ -224,8 +259,8 @@ public enum AchievementCategory
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static enum GameCategory
|
public enum GameCategory
|
||||||
{
|
{
|
||||||
GLOBAL, SURVIVAL, CLASSICS, CHAMPIONS, ARCADE;
|
GLOBAL, HOLIDAY, SURVIVAL, CLASSICS, CHAMPIONS, ARCADE
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
package mineplex.core.achievement;
|
package mineplex.core.achievement;
|
||||||
|
|
||||||
|
import mineplex.core.game.GameDisplay;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The purpose of extracting stats to this class is so we can display stats that are a combination
|
* The purpose of extracting stats to this class is so we can display stats that are a combination
|
||||||
* of different stat values. For example, since we don't have a specific stat for games played of a game,
|
* of different stat values. For example, since we don't have a specific stat for games played of a game,
|
||||||
@ -8,19 +10,34 @@ package mineplex.core.achievement;
|
|||||||
*/
|
*/
|
||||||
public class StatDisplay
|
public class StatDisplay
|
||||||
{
|
{
|
||||||
public String _displayName;
|
private String _displayName;
|
||||||
public String[] _stats;
|
private String[] _stats;
|
||||||
|
private boolean _fullStat;
|
||||||
|
private boolean _justDisplayName;
|
||||||
|
|
||||||
public StatDisplay(String stat)
|
public StatDisplay(String stat)
|
||||||
|
{
|
||||||
|
this(stat, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
public StatDisplay(String stat, boolean justDisplayName)
|
||||||
{
|
{
|
||||||
_displayName = stat;
|
_displayName = stat;
|
||||||
_stats = new String[] { stat };
|
_stats = new String[] { stat };
|
||||||
|
_fullStat = false;
|
||||||
|
_justDisplayName = justDisplayName;
|
||||||
}
|
}
|
||||||
|
|
||||||
public StatDisplay(String displayName, String... stats)
|
public StatDisplay(String displayName, String... stats)
|
||||||
|
{
|
||||||
|
this(displayName, false, stats);
|
||||||
|
}
|
||||||
|
|
||||||
|
public StatDisplay(String displayName, boolean fullStat, String... stats)
|
||||||
{
|
{
|
||||||
_displayName = displayName;
|
_displayName = displayName;
|
||||||
_stats = stats;
|
_stats = stats;
|
||||||
|
_fullStat = fullStat;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getDisplayName()
|
public String getDisplayName()
|
||||||
@ -28,11 +45,32 @@ public class StatDisplay
|
|||||||
return _displayName;
|
return _displayName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isJustDisplayName()
|
||||||
|
{
|
||||||
|
return _justDisplayName;
|
||||||
|
}
|
||||||
|
|
||||||
public String[] getStats()
|
public String[] getStats()
|
||||||
{
|
{
|
||||||
return _stats;
|
return _stats;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isFullStat()
|
||||||
|
{
|
||||||
|
return _fullStat;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static StatDisplay fromGame(String name, GameDisplay gameDisplay, String... stats)
|
||||||
|
{
|
||||||
|
String[] formattedStats = new String[stats.length];
|
||||||
|
for (int i = 0; i < stats.length; i++)
|
||||||
|
{
|
||||||
|
formattedStats[i] = gameDisplay.getName() + "." + stats[i];
|
||||||
|
}
|
||||||
|
|
||||||
|
return new StatDisplay(name, true, formattedStats);
|
||||||
|
}
|
||||||
|
|
||||||
public static final StatDisplay WINS = new StatDisplay("Wins");
|
public static final StatDisplay WINS = new StatDisplay("Wins");
|
||||||
public static final StatDisplay LOSSES = new StatDisplay("Losses");
|
public static final StatDisplay LOSSES = new StatDisplay("Losses");
|
||||||
public static final StatDisplay KILLS = new StatDisplay("Kills");
|
public static final StatDisplay KILLS = new StatDisplay("Kills");
|
||||||
|
@ -41,7 +41,7 @@ public class AchievementMainPage extends ShopPageBase<AchievementManager, Achiev
|
|||||||
protected void buildPage()
|
protected void buildPage()
|
||||||
{
|
{
|
||||||
ArrayList<Integer> pageLayout = new ItemLayout(
|
ArrayList<Integer> pageLayout = new ItemLayout(
|
||||||
"XXXXOXXXX",
|
"XXXXOXXXO",
|
||||||
"OXOXOXOXO",
|
"OXOXOXOXO",
|
||||||
"OXOXOXOXO",
|
"OXOXOXOXO",
|
||||||
"XXOXOXOXX").getItemSlots();
|
"XXOXOXOXX").getItemSlots();
|
||||||
|
@ -24,7 +24,7 @@ public class BenefitManagerRepository extends RepositoryBase
|
|||||||
@Override
|
@Override
|
||||||
protected void initialize()
|
protected void initialize()
|
||||||
{
|
{
|
||||||
executeUpdate(CREATE_BENEFIT_TABLE);
|
//executeUpdate(CREATE_BENEFIT_TABLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -38,6 +38,6 @@ public class Christmas2014 extends BenefitBase
|
|||||||
UtilPlayer.message(player, C.cPurple + C.Strike + "=============================================");
|
UtilPlayer.message(player, C.cPurple + C.Strike + "=============================================");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, player, "Treasure", "Treasure Key", 2);
|
}, player, "Treasure Key", 2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -40,6 +40,6 @@ public class Players40k extends BenefitBase
|
|||||||
UtilPlayer.message(player, C.cGold + C.Strike + "=============================================");
|
UtilPlayer.message(player, C.cGold + C.Strike + "=============================================");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, player, "Treasure", "Ancient Chest", 1);
|
}, player, "Ancient Chest", 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -38,6 +38,6 @@ public class Thanksgiving2014 extends BenefitBase
|
|||||||
UtilPlayer.message(player, C.cPurple + C.Strike + "=============================================");
|
UtilPlayer.message(player, C.cPurple + C.Strike + "=============================================");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, player, "Treasure", "Treasure Key", 1);
|
}, player, "Treasure Key", 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -132,8 +132,8 @@ public class BonusManager extends MiniClientPlugin<BonusClientData> implements I
|
|||||||
private int _visualTick;
|
private int _visualTick;
|
||||||
|
|
||||||
// Streak
|
// Streak
|
||||||
private StreakRecord _dailyStreak;
|
// private StreakRecord _dailyStreak;
|
||||||
private StreakRecord _voteStreak;
|
// private StreakRecord _voteStreak;
|
||||||
|
|
||||||
private ArrayList<String> _voteList;
|
private ArrayList<String> _voteList;
|
||||||
|
|
||||||
@ -220,7 +220,7 @@ public class BonusManager extends MiniClientPlugin<BonusClientData> implements I
|
|||||||
new VoteHandler(this));
|
new VoteHandler(this));
|
||||||
|
|
||||||
updateOffSet();
|
updateOffSet();
|
||||||
updateStreakRecord();
|
// updateStreakRecord();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -240,45 +240,45 @@ public class BonusManager extends MiniClientPlugin<BonusClientData> implements I
|
|||||||
updateOffSet();
|
updateOffSet();
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
// @EventHandler
|
||||||
public void updateStreak(UpdateEvent event)
|
// public void updateStreak(UpdateEvent event)
|
||||||
{
|
// {
|
||||||
if (event.getType() != UpdateType.MIN_16)
|
// if (event.getType() != UpdateType.MIN_16)
|
||||||
return;
|
// return;
|
||||||
|
//
|
||||||
updateStreakRecord();
|
// updateStreakRecord();
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
private void updateStreakRecord()
|
// private void updateStreakRecord()
|
||||||
{
|
// {
|
||||||
_repository.getDailyStreakRecord(new Callback<StreakRecord>()
|
// _repository.getDailyStreakRecord(new Callback<StreakRecord>()
|
||||||
{
|
// {
|
||||||
@Override
|
// @Override
|
||||||
public void run(StreakRecord data)
|
// public void run(StreakRecord data)
|
||||||
{
|
// {
|
||||||
_dailyStreak = data;
|
// _dailyStreak = data;
|
||||||
}
|
// }
|
||||||
});
|
// });
|
||||||
|
//
|
||||||
_repository.getVoteStreakRecord(new Callback<StreakRecord>()
|
// _repository.getVoteStreakRecord(new Callback<StreakRecord>()
|
||||||
{
|
// {
|
||||||
@Override
|
// @Override
|
||||||
public void run(StreakRecord data)
|
// public void run(StreakRecord data)
|
||||||
{
|
// {
|
||||||
_voteStreak = data;
|
// _voteStreak = data;
|
||||||
}
|
// }
|
||||||
});
|
// });
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
public StreakRecord getDailyStreak()
|
// public StreakRecord getDailyStreak()
|
||||||
{
|
// {
|
||||||
return _dailyStreak;
|
// return _dailyStreak;
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
public StreakRecord getVoteStreak()
|
// public StreakRecord getVoteStreak()
|
||||||
{
|
// {
|
||||||
return _voteStreak;
|
// return _voteStreak;
|
||||||
}
|
// }
|
||||||
|
|
||||||
public void handleVote(final Player player, final int gemsReceived)
|
public void handleVote(final Player player, final int gemsReceived)
|
||||||
{
|
{
|
||||||
|
@ -435,7 +435,7 @@ public class BonusRepository extends RepositoryBase
|
|||||||
@Override
|
@Override
|
||||||
protected void initialize()
|
protected void initialize()
|
||||||
{
|
{
|
||||||
executeUpdate(CREATE_BONUS_TABLE);
|
//executeUpdate(CREATE_BONUS_TABLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -160,13 +160,13 @@ public class DailyBonusButton implements GuiItem, Listener
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
StreakRecord streakRecord = _bonusManager.getDailyStreak();
|
// StreakRecord streakRecord = _bonusManager.getDailyStreak();
|
||||||
if (streakRecord != null)
|
// if (streakRecord != null)
|
||||||
{
|
// {
|
||||||
lore.add(" ");
|
// lore.add(" ");
|
||||||
lore.add(C.cYellow + "Record: " + C.cWhite + streakRecord.getPlayerName());
|
// lore.add(C.cYellow + "Record: " + C.cWhite + streakRecord.getPlayerName());
|
||||||
lore.add(C.cYellow + "Streak: " + C.cWhite + streakRecord.getStreak());
|
// lore.add(C.cYellow + "Streak: " + C.cWhite + streakRecord.getStreak());
|
||||||
}
|
// }
|
||||||
|
|
||||||
|
|
||||||
_item = new ShopItem(material, itemName, lore.toArray(new String[0]), 1, false, false);
|
_item = new ShopItem(material, itemName, lore.toArray(new String[0]), 1, false, false);
|
||||||
|
@ -145,13 +145,13 @@ public class VoteButton implements GuiItem, Listener {
|
|||||||
lore.add(" ");
|
lore.add(" ");
|
||||||
lore.add(C.cYellow + "Highest Streak: " + C.cWhite + client.getMaxVoteStreak());
|
lore.add(C.cYellow + "Highest Streak: " + C.cWhite + client.getMaxVoteStreak());
|
||||||
|
|
||||||
StreakRecord streakRecord = _bonusManager.getVoteStreak();
|
// StreakRecord streakRecord = _bonusManager.getVoteStreak();
|
||||||
if (streakRecord != null)
|
// if (streakRecord != null)
|
||||||
{
|
// {
|
||||||
lore.add(" ");
|
// lore.add(" ");
|
||||||
lore.add(C.cYellow + "Record: " + C.cWhite + streakRecord.getPlayerName());
|
// lore.add(C.cYellow + "Record: " + C.cWhite + streakRecord.getPlayerName());
|
||||||
lore.add(C.cYellow + "Streak: " + C.cWhite + streakRecord.getStreak());
|
// lore.add(C.cYellow + "Streak: " + C.cWhite + streakRecord.getStreak());
|
||||||
}
|
// }
|
||||||
|
|
||||||
_item = new ShopItem(material, itemName, lore.toArray(new String[0]), 1, false, false);
|
_item = new ShopItem(material, itemName, lore.toArray(new String[0]), 1, false, false);
|
||||||
}
|
}
|
||||||
|
@ -5,6 +5,7 @@ import java.util.List;
|
|||||||
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
|
import org.bukkit.event.player.AsyncPlayerChatEvent;
|
||||||
import org.bukkit.plugin.java.JavaPlugin;
|
import org.bukkit.plugin.java.JavaPlugin;
|
||||||
|
|
||||||
import mineplex.core.MiniPlugin;
|
import mineplex.core.MiniPlugin;
|
||||||
@ -54,6 +55,27 @@ public class BotSpamManager extends MiniPlugin
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void onChatMessage(final AsyncPlayerChatEvent event)
|
||||||
|
{
|
||||||
|
for (final SpamText spamText : _spam)
|
||||||
|
{
|
||||||
|
if (spamText.isEnabled() && spamText.isSpam(event.getMessage()))
|
||||||
|
{
|
||||||
|
runSync(new Runnable()
|
||||||
|
{
|
||||||
|
@Override
|
||||||
|
public void run()
|
||||||
|
{
|
||||||
|
punishBot(event.getPlayer(), spamText);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
event.setCancelled(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void punishBot(Player player, final SpamText botText)
|
public void punishBot(Player player, final SpamText botText)
|
||||||
{
|
{
|
||||||
_punish.AddPunishment(player.getName(), Category.Other, "Bot Spam #" + botText.getId(), "Chiss", 1, true, -1, true);
|
_punish.AddPunishment(player.getName(), Category.Other, "Bot Spam #" + botText.getId(), "Chiss", 1, true, -1, true);
|
||||||
|
@ -29,7 +29,7 @@ public class MountButton implements IButton
|
|||||||
{
|
{
|
||||||
public void run()
|
public void run()
|
||||||
{
|
{
|
||||||
_page.getPlugin().getInventoryManager().addItemToInventory(null, player, "Mount", _mount.GetName(), 1);
|
_page.getPlugin().getInventoryManager().addItemToInventory(null, player, _mount.GetName(), 1);
|
||||||
_page.refresh();
|
_page.refresh();
|
||||||
}
|
}
|
||||||
}, _page, _mount, CurrencyType.Coins, player));
|
}, _page, _mount, CurrencyType.Coins, player));
|
||||||
|
@ -140,7 +140,7 @@ public class GadgetPage extends ShopPageBase<CosmeticManager, CosmeticShop>
|
|||||||
{
|
{
|
||||||
public void run()
|
public void run()
|
||||||
{
|
{
|
||||||
getPlugin().getInventoryManager().addItemToInventory(getPlayer(), gadget.getGadgetType().name(), gadget.GetName(), (gadget instanceof ItemGadget ? ((ItemGadget) gadget).getAmmo().getQuantity() : gadget.getQuantity()));
|
getPlugin().getInventoryManager().addItemToInventory(getPlayer(), gadget.GetName(), (gadget instanceof ItemGadget ? ((ItemGadget) gadget).getAmmo().getQuantity() : gadget.getQuantity()));
|
||||||
refresh();
|
refresh();
|
||||||
}
|
}
|
||||||
}, this, (gadget instanceof ItemGadget ? ((ItemGadget) gadget).getAmmo() : gadget), CurrencyType.Coins, getPlayer()));
|
}, this, (gadget instanceof ItemGadget ? ((ItemGadget) gadget).getAmmo() : gadget), CurrencyType.Coins, getPlayer()));
|
||||||
|
@ -180,7 +180,7 @@ public class Menu extends ShopPageBase<CosmeticManager, CosmeticShop>
|
|||||||
{
|
{
|
||||||
public void run()
|
public void run()
|
||||||
{
|
{
|
||||||
getPlugin().getInventoryManager().addItemToInventory(getPlayer(), "Treasure", "Treasure Key", 1);
|
getPlugin().getInventoryManager().addItemToInventory(getPlayer(), "Treasure Key", 1);
|
||||||
refresh();
|
refresh();
|
||||||
}
|
}
|
||||||
}, this, new TreasureKey(), CurrencyType.Coins, getPlayer()));
|
}, this, new TreasureKey(), CurrencyType.Coins, getPlayer()));
|
||||||
|
@ -16,6 +16,7 @@ import mineplex.core.pet.repository.token.PetChangeToken;
|
|||||||
import mineplex.core.pet.repository.token.PetToken;
|
import mineplex.core.pet.repository.token.PetToken;
|
||||||
import mineplex.core.shop.page.ConfirmationPage;
|
import mineplex.core.shop.page.ConfirmationPage;
|
||||||
import mineplex.core.shop.page.ShopPageBase;
|
import mineplex.core.shop.page.ShopPageBase;
|
||||||
|
import mineplex.playerCache.PlayerCache;
|
||||||
import net.minecraft.server.v1_7_R4.ItemStack;
|
import net.minecraft.server.v1_7_R4.ItemStack;
|
||||||
import net.minecraft.server.v1_7_R4.Items;
|
import net.minecraft.server.v1_7_R4.Items;
|
||||||
|
|
||||||
@ -85,6 +86,8 @@ public class PetTagPage extends ShopPageBase<CosmeticManager, CosmeticShop>
|
|||||||
|
|
||||||
if (getClientManager().Get(getPlayer()) != null)
|
if (getClientManager().Get(getPlayer()) != null)
|
||||||
token.AccountId = getClientManager().Get(getPlayer()).getAccountId();
|
token.AccountId = getClientManager().Get(getPlayer()).getAccountId();
|
||||||
|
else
|
||||||
|
token.AccountId = PlayerCache.getInstance().getPlayer(getPlayer().getUniqueId()).getAccountId();
|
||||||
|
|
||||||
token.Name = getPlayer().getName();
|
token.Name = getPlayer().getName();
|
||||||
token.PetType = _pet.GetPetType().toString();
|
token.PetType = _pet.GetPetType().toString();
|
||||||
@ -107,7 +110,7 @@ public class PetTagPage extends ShopPageBase<CosmeticManager, CosmeticShop>
|
|||||||
|
|
||||||
getPlugin().getPetManager().Get(getPlayer()).GetPets().put(_pet.GetPetType(), token.PetName);
|
getPlugin().getPetManager().Get(getPlayer()).GetPets().put(_pet.GetPetType(), token.PetName);
|
||||||
|
|
||||||
getPlugin().getInventoryManager().addItemToInventory(null, getPlayer(), "Pet", _pet.GetPetType().toString(), 1);
|
getPlugin().getInventoryManager().addItemToInventory(null, getPlayer(), _pet.GetPetType().toString(), 1);
|
||||||
getShop().openPageForPlayer(getPlayer(), new Menu(getPlugin(), getShop(), getClientManager(), getDonationManager(), getPlayer()));
|
getShop().openPageForPlayer(getPlayer(), new Menu(getPlugin(), getShop(), getClientManager(), getDonationManager(), getPlayer()));
|
||||||
}
|
}
|
||||||
}, null, _petPurchase ? _pet : tag, CurrencyType.Coins, getPlayer()));
|
}, null, _petPurchase ? _pet : tag, CurrencyType.Coins, getPlayer()));
|
||||||
|
@ -22,8 +22,8 @@ public final class DBPool
|
|||||||
source.setUrl(url);
|
source.setUrl(url);
|
||||||
source.setUsername(username);
|
source.setUsername(username);
|
||||||
source.setPassword(password);
|
source.setPassword(password);
|
||||||
source.setMaxTotal(4);
|
source.setMaxTotal(3);
|
||||||
source.setMaxIdle(4);
|
source.setMaxIdle(3);
|
||||||
source.setTimeBetweenEvictionRunsMillis(180 * 1000);
|
source.setTimeBetweenEvictionRunsMillis(180 * 1000);
|
||||||
source.setSoftMinEvictableIdleTimeMillis(180 * 1000);
|
source.setSoftMinEvictableIdleTimeMillis(180 * 1000);
|
||||||
|
|
||||||
|
@ -9,31 +9,49 @@ import java.util.HashSet;
|
|||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.Map.Entry;
|
import java.util.Map.Entry;
|
||||||
|
|
||||||
|
import mineplex.core.MiniPlugin;
|
||||||
|
import mineplex.core.common.util.NautHashMap;
|
||||||
|
import mineplex.core.common.util.UtilEnt;
|
||||||
|
import mineplex.core.common.util.UtilPlayer;
|
||||||
|
import mineplex.core.disguise.disguises.DisguiseArmorStand;
|
||||||
|
import mineplex.core.disguise.disguises.DisguiseBase;
|
||||||
|
import mineplex.core.disguise.disguises.DisguiseBlock;
|
||||||
|
import mineplex.core.disguise.disguises.DisguiseInsentient;
|
||||||
|
import mineplex.core.disguise.disguises.DisguiseLiving;
|
||||||
|
import mineplex.core.disguise.disguises.DisguisePlayer;
|
||||||
|
import mineplex.core.disguise.disguises.DisguiseRabbit;
|
||||||
|
import mineplex.core.packethandler.IPacketHandler;
|
||||||
|
import mineplex.core.packethandler.PacketHandler;
|
||||||
|
import mineplex.core.packethandler.PacketInfo;
|
||||||
|
import mineplex.core.packethandler.PacketVerifier;
|
||||||
|
import mineplex.core.timing.TimingManager;
|
||||||
|
import mineplex.core.updater.UpdateType;
|
||||||
|
import mineplex.core.updater.event.UpdateEvent;
|
||||||
import net.minecraft.server.v1_7_R4.Block;
|
import net.minecraft.server.v1_7_R4.Block;
|
||||||
import net.minecraft.server.v1_7_R4.Chunk;
|
import net.minecraft.server.v1_7_R4.Chunk;
|
||||||
import net.minecraft.server.v1_7_R4.ChunkSection;
|
|
||||||
import net.minecraft.server.v1_7_R4.EntityTrackerEntry;
|
|
||||||
import net.minecraft.server.v1_7_R4.PacketPlayOutAnimation;
|
|
||||||
import net.minecraft.server.v1_7_R4.ChunkAddEntityEvent;
|
import net.minecraft.server.v1_7_R4.ChunkAddEntityEvent;
|
||||||
|
import net.minecraft.server.v1_7_R4.ChunkSection;
|
||||||
import net.minecraft.server.v1_7_R4.EntityPlayer;
|
import net.minecraft.server.v1_7_R4.EntityPlayer;
|
||||||
|
import net.minecraft.server.v1_7_R4.EntityTrackerEntry;
|
||||||
import net.minecraft.server.v1_7_R4.Packet;
|
import net.minecraft.server.v1_7_R4.Packet;
|
||||||
|
import net.minecraft.server.v1_7_R4.PacketPlayOutAnimation;
|
||||||
import net.minecraft.server.v1_7_R4.PacketPlayOutBed;
|
import net.minecraft.server.v1_7_R4.PacketPlayOutBed;
|
||||||
|
import net.minecraft.server.v1_7_R4.PacketPlayOutEntityDestroy;
|
||||||
|
import net.minecraft.server.v1_7_R4.PacketPlayOutEntityEquipment;
|
||||||
|
import net.minecraft.server.v1_7_R4.PacketPlayOutEntityMetadata;
|
||||||
import net.minecraft.server.v1_7_R4.PacketPlayOutEntityStatus;
|
import net.minecraft.server.v1_7_R4.PacketPlayOutEntityStatus;
|
||||||
|
import net.minecraft.server.v1_7_R4.PacketPlayOutEntityTeleport;
|
||||||
|
import net.minecraft.server.v1_7_R4.PacketPlayOutEntityVelocity;
|
||||||
import net.minecraft.server.v1_7_R4.PacketPlayOutMapChunk;
|
import net.minecraft.server.v1_7_R4.PacketPlayOutMapChunk;
|
||||||
import net.minecraft.server.v1_7_R4.PacketPlayOutMapChunkBulk;
|
import net.minecraft.server.v1_7_R4.PacketPlayOutMapChunkBulk;
|
||||||
import net.minecraft.server.v1_7_R4.PacketPlayOutNamedEntitySpawn;
|
import net.minecraft.server.v1_7_R4.PacketPlayOutNamedEntitySpawn;
|
||||||
|
import net.minecraft.server.v1_7_R4.PacketPlayOutNamedSoundEffect;
|
||||||
import net.minecraft.server.v1_7_R4.PacketPlayOutPlayerInfo;
|
import net.minecraft.server.v1_7_R4.PacketPlayOutPlayerInfo;
|
||||||
import net.minecraft.server.v1_7_R4.PacketPlayOutSpawnEntity;
|
|
||||||
import net.minecraft.server.v1_7_R4.PacketPlayOutEntityVelocity;
|
|
||||||
import net.minecraft.server.v1_7_R4.PacketPlayOutEntityDestroy;
|
|
||||||
import net.minecraft.server.v1_7_R4.PacketPlayOutRelEntityMove;
|
import net.minecraft.server.v1_7_R4.PacketPlayOutRelEntityMove;
|
||||||
import net.minecraft.server.v1_7_R4.PacketPlayOutRelEntityMoveLook;
|
import net.minecraft.server.v1_7_R4.PacketPlayOutRelEntityMoveLook;
|
||||||
import net.minecraft.server.v1_7_R4.PacketPlayOutEntityTeleport;
|
import net.minecraft.server.v1_7_R4.PacketPlayOutSpawnEntity;
|
||||||
import net.minecraft.server.v1_7_R4.PacketPlayOutEntityMetadata;
|
|
||||||
import net.minecraft.server.v1_7_R4.PacketPlayOutSpawnEntityLiving;
|
import net.minecraft.server.v1_7_R4.PacketPlayOutSpawnEntityLiving;
|
||||||
import net.minecraft.server.v1_7_R4.PacketPlayOutUpdateAttributes;
|
import net.minecraft.server.v1_7_R4.PacketPlayOutUpdateAttributes;
|
||||||
import net.minecraft.server.v1_7_R4.PacketPlayOutEntityEquipment;
|
|
||||||
import net.minecraft.server.v1_7_R4.PacketPlayOutNamedSoundEffect;
|
|
||||||
import net.minecraft.server.v1_7_R4.WorldServer;
|
import net.minecraft.server.v1_7_R4.WorldServer;
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
@ -57,24 +75,6 @@ import org.bukkit.event.player.PlayerTeleportEvent;
|
|||||||
import org.bukkit.event.world.ChunkUnloadEvent;
|
import org.bukkit.event.world.ChunkUnloadEvent;
|
||||||
import org.bukkit.plugin.java.JavaPlugin;
|
import org.bukkit.plugin.java.JavaPlugin;
|
||||||
|
|
||||||
import mineplex.core.MiniPlugin;
|
|
||||||
import mineplex.core.common.util.NautHashMap;
|
|
||||||
import mineplex.core.common.util.UtilEnt;
|
|
||||||
import mineplex.core.common.util.UtilPlayer;
|
|
||||||
import mineplex.core.disguise.disguises.DisguiseBase;
|
|
||||||
import mineplex.core.disguise.disguises.DisguiseBlock;
|
|
||||||
import mineplex.core.disguise.disguises.DisguiseInsentient;
|
|
||||||
import mineplex.core.disguise.disguises.DisguiseLiving;
|
|
||||||
import mineplex.core.disguise.disguises.DisguisePlayer;
|
|
||||||
import mineplex.core.disguise.disguises.DisguiseRabbit;
|
|
||||||
import mineplex.core.packethandler.IPacketHandler;
|
|
||||||
import mineplex.core.packethandler.PacketHandler;
|
|
||||||
import mineplex.core.packethandler.PacketVerifier;
|
|
||||||
import mineplex.core.packethandler.PacketInfo;
|
|
||||||
import mineplex.core.timing.TimingManager;
|
|
||||||
import mineplex.core.updater.UpdateType;
|
|
||||||
import mineplex.core.updater.event.UpdateEvent;
|
|
||||||
|
|
||||||
public class DisguiseManager extends MiniPlugin implements IPacketHandler
|
public class DisguiseManager extends MiniPlugin implements IPacketHandler
|
||||||
{
|
{
|
||||||
private NautHashMap<Integer, DisguiseBase> _spawnPacketMap = new NautHashMap<Integer, DisguiseBase>();
|
private NautHashMap<Integer, DisguiseBase> _spawnPacketMap = new NautHashMap<Integer, DisguiseBase>();
|
||||||
@ -847,7 +847,7 @@ public class DisguiseManager extends MiniPlugin implements IPacketHandler
|
|||||||
{
|
{
|
||||||
final Player player = packetInfo.getPlayer();
|
final Player player = packetInfo.getPlayer();
|
||||||
|
|
||||||
if (!UtilPlayer.is1_8(player) && disguise instanceof DisguiseRabbit)
|
if (!UtilPlayer.is1_8(player) && (disguise instanceof DisguiseRabbit || disguise instanceof DisguiseArmorStand))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -163,7 +163,7 @@ public class DonationRepository extends RepositoryBase
|
|||||||
{
|
{
|
||||||
if (response)
|
if (response)
|
||||||
{
|
{
|
||||||
executeUpdate(UPDATE_ACCOUNT_COINS, new ColumnInt("coins", coins), new ColumnInt("id", accountId));
|
//executeUpdate(UPDATE_ACCOUNT_COINS, new ColumnInt("coins", coins), new ColumnInt("id", accountId));
|
||||||
//executeUpdate(INSERT_COIN_TRANSACTION, new ColumnInt("id", accountId), new ColumnVarChar("reason", 100, "Rewarded by " + giver), new ColumnInt("coins", coins));
|
//executeUpdate(INSERT_COIN_TRANSACTION, new ColumnInt("id", accountId), new ColumnVarChar("reason", 100, "Rewarded by " + giver), new ColumnInt("coins", coins));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -202,8 +202,8 @@ public class DonationRepository extends RepositoryBase
|
|||||||
@Override
|
@Override
|
||||||
protected void initialize()
|
protected void initialize()
|
||||||
{
|
{
|
||||||
executeUpdate(CREATE_COIN_TRANSACTION_TABLE);
|
//executeUpdate(CREATE_COIN_TRANSACTION_TABLE);
|
||||||
executeUpdate(CREATE_GEM_TRANSACTION_TABLE);
|
//executeUpdate(CREATE_GEM_TRANSACTION_TABLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -3,19 +3,6 @@ package mineplex.core.gadget;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
|
||||||
import org.bukkit.Location;
|
|
||||||
import org.bukkit.Material;
|
|
||||||
import org.bukkit.Sound;
|
|
||||||
import org.bukkit.entity.Player;
|
|
||||||
import org.bukkit.event.EventHandler;
|
|
||||||
import org.bukkit.event.entity.PlayerDeathEvent;
|
|
||||||
import org.bukkit.event.player.PlayerJoinEvent;
|
|
||||||
import org.bukkit.event.player.PlayerMoveEvent;
|
|
||||||
import org.bukkit.event.player.PlayerQuitEvent;
|
|
||||||
import org.bukkit.event.player.PlayerToggleSneakEvent;
|
|
||||||
import org.bukkit.plugin.java.JavaPlugin;
|
|
||||||
|
|
||||||
import mineplex.core.MiniPlugin;
|
import mineplex.core.MiniPlugin;
|
||||||
import mineplex.core.account.CoreClientManager;
|
import mineplex.core.account.CoreClientManager;
|
||||||
import mineplex.core.achievement.AchievementManager;
|
import mineplex.core.achievement.AchievementManager;
|
||||||
@ -28,7 +15,44 @@ import mineplex.core.common.util.UtilTime;
|
|||||||
import mineplex.core.disguise.DisguiseManager;
|
import mineplex.core.disguise.DisguiseManager;
|
||||||
import mineplex.core.donation.DonationManager;
|
import mineplex.core.donation.DonationManager;
|
||||||
import mineplex.core.gadget.event.GadgetCollideEntityEvent;
|
import mineplex.core.gadget.event.GadgetCollideEntityEvent;
|
||||||
import mineplex.core.gadget.gadgets.*;
|
import mineplex.core.gadget.gadgets.ItemBatGun;
|
||||||
|
import mineplex.core.gadget.gadgets.ItemCoinBomb;
|
||||||
|
import mineplex.core.gadget.gadgets.ItemDuelingSword;
|
||||||
|
import mineplex.core.gadget.gadgets.ItemEtherealPearl;
|
||||||
|
import mineplex.core.gadget.gadgets.ItemFirework;
|
||||||
|
import mineplex.core.gadget.gadgets.ItemFleshHook;
|
||||||
|
import mineplex.core.gadget.gadgets.ItemMelonLauncher;
|
||||||
|
import mineplex.core.gadget.gadgets.ItemPaintballGun;
|
||||||
|
import mineplex.core.gadget.gadgets.ItemPaintbrush;
|
||||||
|
import mineplex.core.gadget.gadgets.ItemTNT;
|
||||||
|
import mineplex.core.gadget.gadgets.MorphBat;
|
||||||
|
import mineplex.core.gadget.gadgets.MorphBlaze;
|
||||||
|
import mineplex.core.gadget.gadgets.MorphBlock;
|
||||||
|
import mineplex.core.gadget.gadgets.MorphBunny;
|
||||||
|
import mineplex.core.gadget.gadgets.MorphChicken;
|
||||||
|
import mineplex.core.gadget.gadgets.MorphCow;
|
||||||
|
import mineplex.core.gadget.gadgets.MorphCreeper;
|
||||||
|
import mineplex.core.gadget.gadgets.MorphEnderman;
|
||||||
|
import mineplex.core.gadget.gadgets.MorphPig;
|
||||||
|
import mineplex.core.gadget.gadgets.MorphPumpkinKing;
|
||||||
|
import mineplex.core.gadget.gadgets.MorphSlime;
|
||||||
|
import mineplex.core.gadget.gadgets.MorphTitan;
|
||||||
|
import mineplex.core.gadget.gadgets.MorphVillager;
|
||||||
|
import mineplex.core.gadget.gadgets.MorphWither;
|
||||||
|
import mineplex.core.gadget.gadgets.OutfitRaveSuit;
|
||||||
|
import mineplex.core.gadget.gadgets.OutfitSpaceSuit;
|
||||||
|
import mineplex.core.gadget.gadgets.OutfitTeam;
|
||||||
|
import mineplex.core.gadget.gadgets.ParticleBlizzard;
|
||||||
|
import mineplex.core.gadget.gadgets.ParticleEnchant;
|
||||||
|
import mineplex.core.gadget.gadgets.ParticleFairy;
|
||||||
|
import mineplex.core.gadget.gadgets.ParticleFireRings;
|
||||||
|
import mineplex.core.gadget.gadgets.ParticleFoot;
|
||||||
|
import mineplex.core.gadget.gadgets.ParticleGreen;
|
||||||
|
import mineplex.core.gadget.gadgets.ParticleHeart;
|
||||||
|
import mineplex.core.gadget.gadgets.ParticleHelix;
|
||||||
|
import mineplex.core.gadget.gadgets.ParticleLegend;
|
||||||
|
import mineplex.core.gadget.gadgets.ParticleRain;
|
||||||
|
import mineplex.core.gadget.gadgets.ParticleTitan;
|
||||||
import mineplex.core.gadget.types.Gadget;
|
import mineplex.core.gadget.types.Gadget;
|
||||||
import mineplex.core.gadget.types.GadgetType;
|
import mineplex.core.gadget.types.GadgetType;
|
||||||
import mineplex.core.gadget.types.ItemGadget;
|
import mineplex.core.gadget.types.ItemGadget;
|
||||||
@ -43,6 +67,19 @@ import mineplex.core.pet.PetManager;
|
|||||||
import mineplex.core.preferences.PreferencesManager;
|
import mineplex.core.preferences.PreferencesManager;
|
||||||
import mineplex.core.projectile.ProjectileManager;
|
import mineplex.core.projectile.ProjectileManager;
|
||||||
|
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
|
import org.bukkit.Location;
|
||||||
|
import org.bukkit.Material;
|
||||||
|
import org.bukkit.Sound;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.EventHandler;
|
||||||
|
import org.bukkit.event.entity.PlayerDeathEvent;
|
||||||
|
import org.bukkit.event.player.PlayerJoinEvent;
|
||||||
|
import org.bukkit.event.player.PlayerMoveEvent;
|
||||||
|
import org.bukkit.event.player.PlayerQuitEvent;
|
||||||
|
import org.bukkit.event.player.PlayerToggleSneakEvent;
|
||||||
|
import org.bukkit.plugin.java.JavaPlugin;
|
||||||
|
|
||||||
public class GadgetManager extends MiniPlugin
|
public class GadgetManager extends MiniPlugin
|
||||||
{
|
{
|
||||||
private CoreClientManager _clientManager;
|
private CoreClientManager _clientManager;
|
||||||
@ -128,6 +165,7 @@ public class GadgetManager extends MiniPlugin
|
|||||||
addGadget(new MorphWither(this));
|
addGadget(new MorphWither(this));
|
||||||
addGadget(new MorphBunny(this));
|
addGadget(new MorphBunny(this));
|
||||||
addGadget(new MorphSlime(this, _achievementManager));
|
addGadget(new MorphSlime(this, _achievementManager));
|
||||||
|
addGadget(new MorphTitan(this));
|
||||||
|
|
||||||
// Particles
|
// Particles
|
||||||
addGadget(new ParticleFoot(this));
|
addGadget(new ParticleFoot(this));
|
||||||
@ -140,6 +178,8 @@ public class GadgetManager extends MiniPlugin
|
|||||||
addGadget(new ParticleFairy(this));
|
addGadget(new ParticleFairy(this));
|
||||||
addGadget(new ParticleLegend(this));
|
addGadget(new ParticleLegend(this));
|
||||||
addGadget(new ParticleBlizzard(this));
|
addGadget(new ParticleBlizzard(this));
|
||||||
|
addGadget(new ParticleTitan(this));
|
||||||
|
//addGadget(new ParticleKronos(this));
|
||||||
|
|
||||||
// Music
|
// Music
|
||||||
addGadget(new MusicGadget(this, "13 Disc", new String[] {""}, -2, 2256, 178000));
|
addGadget(new MusicGadget(this, "13 Disc", new String[] {""}, -2, 2256, 178000));
|
||||||
|
@ -16,6 +16,7 @@ import mineplex.core.common.util.UtilFirework;
|
|||||||
import mineplex.core.common.util.UtilPlayer;
|
import mineplex.core.common.util.UtilPlayer;
|
||||||
import mineplex.core.gadget.GadgetManager;
|
import mineplex.core.gadget.GadgetManager;
|
||||||
import mineplex.core.gadget.types.ItemGadget;
|
import mineplex.core.gadget.types.ItemGadget;
|
||||||
|
import mineplex.core.recharge.Recharge;
|
||||||
|
|
||||||
public class ItemFirework extends ItemGadget
|
public class ItemFirework extends ItemGadget
|
||||||
{
|
{
|
||||||
@ -29,7 +30,7 @@ public class ItemFirework extends ItemGadget
|
|||||||
},
|
},
|
||||||
-1,
|
-1,
|
||||||
Material.FIREWORK, (byte)0,
|
Material.FIREWORK, (byte)0,
|
||||||
100, new Ammo("Fireworks", "50 Fireworks", Material.FIREWORK, (byte)0, new String[] { C.cWhite + "50 Fireworks for you to launch!" }, 500, 50));
|
250, new Ammo("Fireworks", "50 Fireworks", Material.FIREWORK, (byte)0, new String[] { C.cWhite + "50 Fireworks for you to launch!" }, 500, 50));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -116,7 +116,7 @@ public class ItemGemBomb extends ItemGadget
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Use Stock/Gems
|
//Use Stock/Gems
|
||||||
Manager.getInventoryManager().addItemToInventory(player, getGadgetType().name(), GetName(), -1);
|
Manager.getInventoryManager().addItemToInventory(player, GetName(), -1);
|
||||||
Manager.getDonationManager().RewardGems(null, GetName(), event.getPlayer().getName(), event.getPlayer().getUniqueId(), -2000);
|
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())));
|
player.getInventory().setItem(Manager.getActiveItemSlot(), ItemStackFactory.Instance.CreateStack(GetDisplayMaterial(), GetDisplayData(), 1, F.item(GetName())));
|
||||||
|
@ -0,0 +1,35 @@
|
|||||||
|
package mineplex.core.gadget.gadgets;
|
||||||
|
|
||||||
|
import org.bukkit.Material;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
|
import mineplex.core.common.util.C;
|
||||||
|
import mineplex.core.gadget.GadgetManager;
|
||||||
|
import mineplex.core.gadget.types.MorphGadget;
|
||||||
|
|
||||||
|
public class MorphTitan extends MorphGadget
|
||||||
|
{
|
||||||
|
public MorphTitan(GadgetManager manager)
|
||||||
|
{
|
||||||
|
super(manager, "Titanic Morph", new String[]
|
||||||
|
{
|
||||||
|
C.cWhite + "Coming Soon...",
|
||||||
|
" ",
|
||||||
|
C.cRed + "Unlocked with Titan Rank",
|
||||||
|
},
|
||||||
|
-1,
|
||||||
|
Material.REDSTONE_BLOCK, (byte)0);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void EnableCustom(Player player)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void DisableCustom(Player player)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
@ -4,36 +4,36 @@ import java.util.ArrayList;
|
|||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
|
|
||||||
import org.bukkit.GameMode;
|
|
||||||
import org.bukkit.Material;
|
|
||||||
import org.bukkit.Sound;
|
|
||||||
import org.bukkit.entity.Player;
|
|
||||||
import org.bukkit.entity.WitherSkull;
|
|
||||||
import org.bukkit.event.EventHandler;
|
|
||||||
import org.bukkit.event.entity.EntityExplodeEvent;
|
|
||||||
import org.bukkit.event.player.PlayerInteractEvent;
|
|
||||||
import org.bukkit.event.player.PlayerJoinEvent;
|
|
||||||
import org.bukkit.util.Vector;
|
|
||||||
|
|
||||||
import mineplex.core.common.Rank;
|
import mineplex.core.common.Rank;
|
||||||
import mineplex.core.common.util.C;
|
import mineplex.core.common.util.C;
|
||||||
import mineplex.core.common.util.UtilAction;
|
import mineplex.core.common.util.UtilAction;
|
||||||
import mineplex.core.common.util.UtilAlg;
|
import mineplex.core.common.util.UtilAlg;
|
||||||
import mineplex.core.common.util.UtilEnt;
|
import mineplex.core.common.util.UtilEnt;
|
||||||
import mineplex.core.common.util.UtilEvent;
|
import mineplex.core.common.util.UtilEvent;
|
||||||
import mineplex.core.common.util.UtilParticle;
|
|
||||||
import mineplex.core.common.util.UtilPlayer;
|
|
||||||
import mineplex.core.common.util.UtilServer;
|
|
||||||
import mineplex.core.common.util.UtilEvent.ActionType;
|
import mineplex.core.common.util.UtilEvent.ActionType;
|
||||||
|
import mineplex.core.common.util.UtilParticle;
|
||||||
import mineplex.core.common.util.UtilParticle.ParticleType;
|
import mineplex.core.common.util.UtilParticle.ParticleType;
|
||||||
import mineplex.core.common.util.UtilParticle.ViewDist;
|
import mineplex.core.common.util.UtilParticle.ViewDist;
|
||||||
|
import mineplex.core.common.util.UtilPlayer;
|
||||||
|
import mineplex.core.common.util.UtilServer;
|
||||||
import mineplex.core.disguise.disguises.DisguiseBase;
|
import mineplex.core.disguise.disguises.DisguiseBase;
|
||||||
import mineplex.core.disguise.disguises.DisguiseWither;
|
import mineplex.core.disguise.disguises.DisguiseWither;
|
||||||
|
import mineplex.core.gadget.GadgetManager;
|
||||||
|
import mineplex.core.gadget.types.MorphGadget;
|
||||||
import mineplex.core.recharge.Recharge;
|
import mineplex.core.recharge.Recharge;
|
||||||
import mineplex.core.updater.UpdateType;
|
import mineplex.core.updater.UpdateType;
|
||||||
import mineplex.core.updater.event.UpdateEvent;
|
import mineplex.core.updater.event.UpdateEvent;
|
||||||
import mineplex.core.gadget.GadgetManager;
|
|
||||||
import mineplex.core.gadget.types.MorphGadget;
|
import org.bukkit.Material;
|
||||||
|
import org.bukkit.Sound;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.entity.WitherSkull;
|
||||||
|
import org.bukkit.event.EventHandler;
|
||||||
|
import org.bukkit.event.EventPriority;
|
||||||
|
import org.bukkit.event.entity.EntityExplodeEvent;
|
||||||
|
import org.bukkit.event.player.PlayerInteractEvent;
|
||||||
|
import org.bukkit.event.player.PlayerJoinEvent;
|
||||||
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
public class MorphWither extends MorphGadget
|
public class MorphWither extends MorphGadget
|
||||||
{
|
{
|
||||||
@ -107,7 +107,7 @@ public class MorphWither extends MorphGadget
|
|||||||
player.getWorld().playSound(player.getLocation(), Sound.WITHER_SHOOT, 0.5f, 1f);
|
player.getWorld().playSound(player.getLocation(), Sound.WITHER_SHOOT, 0.5f, 1f);
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler(priority = EventPriority.LOWEST)
|
||||||
public void explode(EntityExplodeEvent event)
|
public void explode(EntityExplodeEvent event)
|
||||||
{
|
{
|
||||||
if (!_skulls.contains(event.getEntity()))
|
if (!_skulls.contains(event.getEntity()))
|
||||||
@ -115,6 +115,8 @@ public class MorphWither extends MorphGadget
|
|||||||
|
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
|
|
||||||
|
event.getEntity().remove();
|
||||||
|
|
||||||
WitherSkull skull = (WitherSkull)event.getEntity();
|
WitherSkull skull = (WitherSkull)event.getEntity();
|
||||||
|
|
||||||
UtilParticle.PlayParticle(ParticleType.LARGE_EXPLODE, skull.getLocation(), 0, 0, 0, 0, 1,
|
UtilParticle.PlayParticle(ParticleType.LARGE_EXPLODE, skull.getLocation(), 0, 0, 0, 0, 1,
|
||||||
|
@ -0,0 +1,87 @@
|
|||||||
|
package mineplex.core.gadget.gadgets;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
|
||||||
|
import mineplex.core.common.Rank;
|
||||||
|
import mineplex.core.common.util.C;
|
||||||
|
import mineplex.core.common.util.F;
|
||||||
|
import mineplex.core.common.util.UtilPlayer;
|
||||||
|
import mineplex.core.gadget.GadgetManager;
|
||||||
|
import mineplex.core.gadget.types.ParticleGadget;
|
||||||
|
import mineplex.core.updater.UpdateType;
|
||||||
|
import mineplex.core.updater.event.UpdateEvent;
|
||||||
|
|
||||||
|
import org.bukkit.Material;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.EventHandler;
|
||||||
|
import org.bukkit.event.player.PlayerJoinEvent;
|
||||||
|
import org.bukkit.event.player.PlayerQuitEvent;
|
||||||
|
|
||||||
|
public class ParticleKronos extends ParticleGadget
|
||||||
|
{
|
||||||
|
private HashMap<Player, ParticleKronosData> _glass = new HashMap<Player, ParticleKronosData>();
|
||||||
|
|
||||||
|
public ParticleKronos(GadgetManager manager)
|
||||||
|
{
|
||||||
|
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.cRed + "???"
|
||||||
|
//When purchasable: C.cRed + "Unlocked with Titan Rank"
|
||||||
|
},
|
||||||
|
-2,
|
||||||
|
Material.EYE_OF_ENDER, (byte)0);
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void playParticle(UpdateEvent event)
|
||||||
|
{
|
||||||
|
if (event.getType() != UpdateType.TICK)
|
||||||
|
return;
|
||||||
|
|
||||||
|
for (Player player : GetActive())
|
||||||
|
{
|
||||||
|
if (!shouldDisplay(player))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
//Create
|
||||||
|
if (!_glass.containsKey(player))
|
||||||
|
_glass.put(player, new ParticleKronosData(player));
|
||||||
|
|
||||||
|
_glass.get(player).update(Manager.isMoving(player));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void titanOwner(PlayerJoinEvent event)
|
||||||
|
{
|
||||||
|
/*Until it becomes purchasable*/if (Manager.getClientManager().Get(event.getPlayer()).GetRank().equals(Rank.TITAN))
|
||||||
|
//if (Manager.getClientManager().Get(event.getPlayer()).GetRank().has(Rank.TITAN))
|
||||||
|
{
|
||||||
|
Manager.getDonationManager().Get(event.getPlayer().getName()).AddUnknownSalesPackagesOwned(GetName());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void DisableCustom(Player player)
|
||||||
|
{
|
||||||
|
if (_active.remove(player))
|
||||||
|
UtilPlayer.message(player, F.main("Gadget", "You unsummoned " + F.elem(GetName()) + "."));
|
||||||
|
|
||||||
|
clean(player);
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void quit(PlayerQuitEvent event)
|
||||||
|
{
|
||||||
|
clean(event.getPlayer());
|
||||||
|
}
|
||||||
|
|
||||||
|
private void clean(Player player)
|
||||||
|
{
|
||||||
|
_glass.remove(player);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,112 @@
|
|||||||
|
package mineplex.core.gadget.gadgets;
|
||||||
|
|
||||||
|
import mineplex.core.common.util.UtilParticle;
|
||||||
|
import mineplex.core.common.util.UtilParticle.ParticleType;
|
||||||
|
import mineplex.core.common.util.UtilParticle.ViewDist;
|
||||||
|
import mineplex.core.common.util.UtilServer;
|
||||||
|
|
||||||
|
import org.bukkit.Location;
|
||||||
|
import org.bukkit.Sound;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
|
public class ParticleKronosData
|
||||||
|
{
|
||||||
|
private static class Sin
|
||||||
|
{
|
||||||
|
static final float[] table = new float[16384];
|
||||||
|
|
||||||
|
static
|
||||||
|
{
|
||||||
|
for (int i = 0; i < 16384; i++)
|
||||||
|
{
|
||||||
|
table[i] = ((float)Math.sin((i + 0.5F) / 16384.0F * 6.283186F));
|
||||||
|
}
|
||||||
|
for (int i = 0; i < 360; i += 90)
|
||||||
|
{
|
||||||
|
table[((int)(i * 45.511112F) & 0x3FFF)] = ((float)Math.sin(i * 0.01745329F));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private int _step;
|
||||||
|
private Player _player;
|
||||||
|
|
||||||
|
public ParticleKronosData(Player player)
|
||||||
|
{
|
||||||
|
_player = player;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void update(boolean moving)
|
||||||
|
{
|
||||||
|
if (moving)
|
||||||
|
UtilParticle.PlayParticle(ParticleType.ENCHANTMENT_TABLE, _player.getLocation().add(0, 1f, 0), 0.2f, 0.2f, 0.2f, 0, 1,
|
||||||
|
ViewDist.NORMAL, UtilServer.getPlayers());
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Vector v = new Vector();
|
||||||
|
Location loc = _player.getLocation().clone();
|
||||||
|
for (int i = 0; i < 8; i++)
|
||||||
|
{
|
||||||
|
_step += 1;
|
||||||
|
|
||||||
|
float f1 = 3.141593F / 120 * _step;
|
||||||
|
float f2 = sinFloat(f1 * 2.718282F * 8 / 120) * 1F;
|
||||||
|
float f3 = f2 * 3.141593F * f1;
|
||||||
|
|
||||||
|
v.setX(1F * f2 * -cosFloat(f3));
|
||||||
|
v.setZ(1F * f2 * -sinFloat(f3));
|
||||||
|
v.setY(0.6F * f2 + 0.6F + 2.0F);
|
||||||
|
|
||||||
|
rotateVector(v, 0, 0, 0);
|
||||||
|
|
||||||
|
UtilParticle.PlayParticle(ParticleType.ENCHANTMENT_TABLE, loc.add(v), 0, 0, 0, 0, 1,
|
||||||
|
ViewDist.NORMAL, UtilServer.getPlayers());
|
||||||
|
|
||||||
|
loc.subtract(v);
|
||||||
|
}
|
||||||
|
|
||||||
|
//Sound
|
||||||
|
_player.getWorld().playSound(_player.getLocation(), Sound.CAT_HISS, 0.2f, 1f);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void rotateVector(Vector vector, double x, double y, double z)
|
||||||
|
{
|
||||||
|
double cos;
|
||||||
|
double sin;
|
||||||
|
double new1;
|
||||||
|
double new2;
|
||||||
|
|
||||||
|
//x-axis
|
||||||
|
cos = Math.cos(x);
|
||||||
|
sin = Math.sin(x);
|
||||||
|
new1 = vector.getY() * cos - vector.getZ() * sin;
|
||||||
|
new2 = vector.getY() * sin + vector.getZ() * cos;
|
||||||
|
vector.setY(new1).setZ(new2);
|
||||||
|
|
||||||
|
//y-axis
|
||||||
|
cos = Math.cos(y);
|
||||||
|
sin = Math.sin(y);
|
||||||
|
new1 = vector.getX() * cos - vector.getZ() * sin;
|
||||||
|
new2 = vector.getX() * sin + vector.getZ() * cos;
|
||||||
|
vector.setX(new1).setZ(new2);
|
||||||
|
|
||||||
|
//z-axis
|
||||||
|
cos = Math.cos(z);
|
||||||
|
sin = Math.sin(z);
|
||||||
|
new1 = vector.getX() * cos - vector.getY() * sin;
|
||||||
|
new2 = vector.getX() * sin + vector.getY() * cos;
|
||||||
|
vector.setX(new1).setY(new2);
|
||||||
|
}
|
||||||
|
|
||||||
|
private float sinFloat(float f)
|
||||||
|
{
|
||||||
|
return Sin.table[((int)(f * 2607.5945F) & 0x3FFF)];
|
||||||
|
}
|
||||||
|
|
||||||
|
private float cosFloat(float f)
|
||||||
|
{
|
||||||
|
return Sin.table[((int)((f + 1.570796F) * 2607.5945F) & 0x3FFF)];
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,22 @@
|
|||||||
|
package mineplex.core.gadget.gadgets;
|
||||||
|
|
||||||
|
import org.bukkit.Material;
|
||||||
|
|
||||||
|
import mineplex.core.common.util.C;
|
||||||
|
import mineplex.core.gadget.types.ParticleGadget;
|
||||||
|
import mineplex.core.gadget.GadgetManager;
|
||||||
|
|
||||||
|
public class ParticleTitan extends ParticleGadget
|
||||||
|
{
|
||||||
|
public ParticleTitan(GadgetManager manager)
|
||||||
|
{
|
||||||
|
super(manager, "Titanic Particle", new String[]
|
||||||
|
{
|
||||||
|
C.cWhite + "Coming Soon...",
|
||||||
|
" ",
|
||||||
|
C.cRed + "Unlocked with Titan Rank",
|
||||||
|
},
|
||||||
|
-1,
|
||||||
|
Material.REDSTONE_BLOCK, (byte)0);
|
||||||
|
}
|
||||||
|
}
|
@ -159,7 +159,7 @@ public abstract class ItemGadget extends Gadget
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Manager.getInventoryManager().addItemToInventory(player, getGadgetType().name(), GetName(), -1);
|
Manager.getInventoryManager().addItemToInventory(player, GetName(), -1);
|
||||||
|
|
||||||
player.getInventory().setItem(Manager.getActiveItemSlot(), ItemStackFactory.Instance.CreateStack(GetDisplayMaterial(), GetDisplayData(), 1, F.item(Manager.getInventoryManager().Get(player).getItemCount(GetName()) + " " + GetName())));
|
player.getInventory().setItem(Manager.getActiveItemSlot(), ItemStackFactory.Instance.CreateStack(GetDisplayMaterial(), GetDisplayData(), 1, F.item(Manager.getInventoryManager().Get(player).getItemCount(GetName()) + " " + GetName())));
|
||||||
|
|
||||||
|
@ -16,7 +16,6 @@ import mineplex.core.account.CoreClientManager;
|
|||||||
import mineplex.core.common.util.Callback;
|
import mineplex.core.common.util.Callback;
|
||||||
import mineplex.core.common.util.NautHashMap;
|
import mineplex.core.common.util.NautHashMap;
|
||||||
import mineplex.core.inventory.command.GiveItemCommand;
|
import mineplex.core.inventory.command.GiveItemCommand;
|
||||||
import mineplex.core.inventory.data.Category;
|
|
||||||
import mineplex.core.inventory.data.InventoryRepository;
|
import mineplex.core.inventory.data.InventoryRepository;
|
||||||
import mineplex.core.inventory.data.Item;
|
import mineplex.core.inventory.data.Item;
|
||||||
import mineplex.core.updater.UpdateType;
|
import mineplex.core.updater.UpdateType;
|
||||||
@ -30,9 +29,9 @@ public class InventoryManager extends MiniDbClientPlugin<ClientInventory>
|
|||||||
private InventoryRepository _repository;
|
private InventoryRepository _repository;
|
||||||
|
|
||||||
private NautHashMap<String, Item> _items = new NautHashMap<String, Item>();
|
private NautHashMap<String, Item> _items = new NautHashMap<String, Item>();
|
||||||
private NautHashMap<String, Category> _categories = new NautHashMap<String, Category>();
|
private NautHashMap<Integer, String> _itemIdNameMap = new NautHashMap<Integer, String>();
|
||||||
|
|
||||||
private NautHashMap<Player, NautHashMap<String, NautHashMap<String, Integer>>> _inventoryQueue = new NautHashMap<Player, NautHashMap<String, NautHashMap<String, Integer>>>();
|
private NautHashMap<Player, NautHashMap<String, Integer>> _inventoryQueue = new NautHashMap<Player, NautHashMap<String, Integer>>();
|
||||||
|
|
||||||
public InventoryManager(JavaPlugin plugin, CoreClientManager clientManager)
|
public InventoryManager(JavaPlugin plugin, CoreClientManager clientManager)
|
||||||
{
|
{
|
||||||
@ -45,7 +44,6 @@ public class InventoryManager extends MiniDbClientPlugin<ClientInventory>
|
|||||||
public void run()
|
public void run()
|
||||||
{
|
{
|
||||||
updateItems();
|
updateItems();
|
||||||
updateCategories();
|
|
||||||
}
|
}
|
||||||
}, 20L);
|
}, 20L);
|
||||||
}
|
}
|
||||||
@ -59,24 +57,12 @@ public class InventoryManager extends MiniDbClientPlugin<ClientInventory>
|
|||||||
for (Item item : items)
|
for (Item item : items)
|
||||||
{
|
{
|
||||||
_items.put(item.Name, item);
|
_items.put(item.Name, item);
|
||||||
|
_itemIdNameMap.put(item.Id, item.Name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateCategories()
|
public void addItemToInventory(final Player player, final String item, final int count)
|
||||||
{
|
|
||||||
List<Category> categories = _repository.retrieveCategories();
|
|
||||||
|
|
||||||
synchronized (_inventoryLock)
|
|
||||||
{
|
|
||||||
for (Category category : categories)
|
|
||||||
{
|
|
||||||
_categories.put(category.Name, category);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void addItemToInventory(final Player player, String category, final String item, final int count)
|
|
||||||
{
|
{
|
||||||
if (_items.containsKey(item))
|
if (_items.containsKey(item))
|
||||||
{
|
{
|
||||||
@ -84,20 +70,17 @@ public class InventoryManager extends MiniDbClientPlugin<ClientInventory>
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!_inventoryQueue.containsKey(player))
|
if (!_inventoryQueue.containsKey(player))
|
||||||
_inventoryQueue.put(player, new NautHashMap<String, NautHashMap<String, Integer>>());
|
_inventoryQueue.put(player, new NautHashMap<String, Integer>());
|
||||||
|
|
||||||
if (!_inventoryQueue.get(player).containsKey(category))
|
|
||||||
_inventoryQueue.get(player).put(category, new NautHashMap<String, Integer>());
|
|
||||||
|
|
||||||
int totalAmount = count;
|
int totalAmount = count;
|
||||||
|
|
||||||
if (_inventoryQueue.get(player).get(category).containsKey(item))
|
if (_inventoryQueue.get(player).containsKey(item))
|
||||||
totalAmount += _inventoryQueue.get(player).get(category).get(item);
|
totalAmount += _inventoryQueue.get(player).get(item);
|
||||||
|
|
||||||
_inventoryQueue.get(player).get(category).put(item, totalAmount);
|
_inventoryQueue.get(player).put(item, totalAmount);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addItemToInventory(final Callback<Boolean> callback, final Player player, String category, final String item, final int count)
|
public void addItemToInventory(final Callback<Boolean> callback, final Player player, final String item, final int count)
|
||||||
{
|
{
|
||||||
addItemToInventoryForOffline(new Callback<Boolean>()
|
addItemToInventoryForOffline(new Callback<Boolean>()
|
||||||
{
|
{
|
||||||
@ -116,16 +99,7 @@ public class InventoryManager extends MiniDbClientPlugin<ClientInventory>
|
|||||||
if (callback != null)
|
if (callback != null)
|
||||||
callback.run(success);
|
callback.run(success);
|
||||||
}
|
}
|
||||||
}, player.getUniqueId(), category, item, count);
|
}, player.getUniqueId(), item, count);
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean validCategory(String category)
|
|
||||||
{
|
|
||||||
synchronized (_inventoryLock)
|
|
||||||
{
|
|
||||||
return _categories.containsKey(category);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean validItem(String item)
|
public boolean validItem(String item)
|
||||||
@ -151,28 +125,17 @@ public class InventoryManager extends MiniDbClientPlugin<ClientInventory>
|
|||||||
return item;
|
return item;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addItemToInventoryForOffline(final Callback<Boolean> callback, final UUID uuid, final String category, final String item, final int count)
|
public void addItemToInventoryForOffline(final Callback<Boolean> callback, final UUID uuid, final String item, final int count)
|
||||||
{
|
{
|
||||||
Bukkit.getServer().getScheduler().runTaskAsynchronously(getPlugin(), new Runnable()
|
Bukkit.getServer().getScheduler().runTaskAsynchronously(getPlugin(), new Runnable()
|
||||||
{
|
{
|
||||||
public void run()
|
public void run()
|
||||||
{
|
{
|
||||||
synchronized (_inventoryLock)
|
|
||||||
{
|
|
||||||
if (!_categories.containsKey(category))
|
|
||||||
{
|
|
||||||
_repository.addCategory(category);
|
|
||||||
System.out.println("InventoryManager Adding Category : " + category);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
updateCategories();
|
|
||||||
|
|
||||||
synchronized (_inventoryLock)
|
synchronized (_inventoryLock)
|
||||||
{
|
{
|
||||||
if (!_items.containsKey(item))
|
if (!_items.containsKey(item))
|
||||||
{
|
{
|
||||||
_repository.addItem(item, _categories.get(category).Id);
|
_repository.addItem(item);
|
||||||
System.out.println("InventoryManager Adding Item : " + item);
|
System.out.println("InventoryManager Adding Item : " + item);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -206,11 +169,9 @@ public class InventoryManager extends MiniDbClientPlugin<ClientInventory>
|
|||||||
|
|
||||||
for (final Player player : _inventoryQueue.keySet())
|
for (final Player player : _inventoryQueue.keySet())
|
||||||
{
|
{
|
||||||
for (final String category : _inventoryQueue.get(player).keySet())
|
for (final String item : _inventoryQueue.get(player).keySet())
|
||||||
{
|
{
|
||||||
for (final String item : _inventoryQueue.get(player).get(category).keySet())
|
final int count = _inventoryQueue.get(player).get(item);
|
||||||
{
|
|
||||||
final int count = _inventoryQueue.get(player).get(category).get(item);
|
|
||||||
|
|
||||||
addItemToInventoryForOffline(new Callback<Boolean>()
|
addItemToInventoryForOffline(new Callback<Boolean>()
|
||||||
{
|
{
|
||||||
@ -226,8 +187,7 @@ public class InventoryManager extends MiniDbClientPlugin<ClientInventory>
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, player.getUniqueId(), category, item, count);
|
}, player.getUniqueId(), item, count);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//Clean
|
//Clean
|
||||||
@ -254,12 +214,12 @@ public class InventoryManager extends MiniDbClientPlugin<ClientInventory>
|
|||||||
@Override
|
@Override
|
||||||
public void processLoginResultSet(String playerName, int accountId, ResultSet resultSet) throws SQLException
|
public void processLoginResultSet(String playerName, int accountId, ResultSet resultSet) throws SQLException
|
||||||
{
|
{
|
||||||
Set(playerName, _repository.loadClientInformation(resultSet));
|
Set(playerName, _repository.loadClientInformation(resultSet, _itemIdNameMap));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getQuery(int accountId, String uuid, String name)
|
public String getQuery(int accountId, String uuid, String name)
|
||||||
{
|
{
|
||||||
return "SELECT items.name, ic.name as category, count FROM accountInventory AS ai INNER JOIN items ON items.id = ai.itemId INNER JOIN itemCategories AS ic ON ic.id = items.categoryId WHERE ai.accountId = '" + accountId + "';";
|
return "SELECT ai.itemId, count FROM accountInventory AS ai WHERE ai.accountId = '" + accountId + "';";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4,19 +4,14 @@ import java.util.UUID;
|
|||||||
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import mineplex.core.account.CoreClient;
|
|
||||||
import mineplex.core.command.CommandBase;
|
import mineplex.core.command.CommandBase;
|
||||||
import mineplex.core.common.Rank;
|
import mineplex.core.common.Rank;
|
||||||
import mineplex.core.common.util.Callback;
|
import mineplex.core.common.util.Callback;
|
||||||
import mineplex.core.common.util.F;
|
import mineplex.core.common.util.F;
|
||||||
import mineplex.core.common.util.UUIDFetcher;
|
|
||||||
import mineplex.core.common.util.UtilPlayer;
|
import mineplex.core.common.util.UtilPlayer;
|
||||||
import mineplex.core.inventory.InventoryManager;
|
import mineplex.core.inventory.InventoryManager;
|
||||||
import mineplex.core.inventory.data.Item;
|
import mineplex.core.inventory.data.Item;
|
||||||
|
|
||||||
/**
|
|
||||||
* Created by Shaun on 10/26/2014.
|
|
||||||
*/
|
|
||||||
public class GiveItemCommand extends CommandBase<InventoryManager>
|
public class GiveItemCommand extends CommandBase<InventoryManager>
|
||||||
{
|
{
|
||||||
public GiveItemCommand(InventoryManager plugin)
|
public GiveItemCommand(InventoryManager plugin)
|
||||||
@ -54,7 +49,7 @@ public class GiveItemCommand extends CommandBase<InventoryManager>
|
|||||||
}
|
}
|
||||||
else if (player != null)
|
else if (player != null)
|
||||||
{
|
{
|
||||||
Plugin.addItemToInventory(player, item.Category, item.Name, amount);
|
Plugin.addItemToInventory(player, item.Name, amount);
|
||||||
UtilPlayer.message(caller, F.main("Item", "You gave " + F.elem(amount + " " + itemName) + " to player " + F.name(playerName)));
|
UtilPlayer.message(caller, F.main("Item", "You gave " + F.elem(amount + " " + itemName) + " to player " + F.name(playerName)));
|
||||||
UtilPlayer.message(player, F.main("Item", F.name(caller.getName()) + " gave you " + F.elem(amount + " " + itemName)));
|
UtilPlayer.message(player, F.main("Item", F.name(caller.getName()) + " gave you " + F.elem(amount + " " + itemName)));
|
||||||
}
|
}
|
||||||
@ -74,7 +69,7 @@ public class GiveItemCommand extends CommandBase<InventoryManager>
|
|||||||
{
|
{
|
||||||
UtilPlayer.message(caller, F.main("Item", "You gave " + F.elem(amount + " " + itemName) + " to offline player " + F.name(playerName)));
|
UtilPlayer.message(caller, F.main("Item", "You gave " + F.elem(amount + " " + itemName) + " to offline player " + F.name(playerName)));
|
||||||
}
|
}
|
||||||
}, uuid, item.Category, item.Name, amount);
|
}, uuid, item.Name, amount);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -7,6 +7,7 @@ import java.util.List;
|
|||||||
|
|
||||||
import org.bukkit.plugin.java.JavaPlugin;
|
import org.bukkit.plugin.java.JavaPlugin;
|
||||||
|
|
||||||
|
import mineplex.core.common.util.NautHashMap;
|
||||||
import mineplex.core.database.DBPool;
|
import mineplex.core.database.DBPool;
|
||||||
import mineplex.core.database.RepositoryBase;
|
import mineplex.core.database.RepositoryBase;
|
||||||
import mineplex.core.database.ResultSetCallable;
|
import mineplex.core.database.ResultSetCallable;
|
||||||
@ -17,15 +18,11 @@ import mineplex.core.inventory.ClientItem;
|
|||||||
|
|
||||||
public class InventoryRepository extends RepositoryBase
|
public class InventoryRepository extends RepositoryBase
|
||||||
{
|
{
|
||||||
private static String CREATE_INVENTORY_TABLE = "CREATE TABLE IF NOT EXISTS items (id INT NOT NULL AUTO_INCREMENT, name VARCHAR(100), categoryId INT, rarity INT, PRIMARY KEY (id), FOREIGN KEY (categoryId) REFERENCES itemCategories(id), UNIQUE INDEX uniqueNameCategoryIndex (name, categoryId));";
|
private static String CREATE_INVENTORY_TABLE = "CREATE TABLE IF NOT EXISTS items (id INT NOT NULL AUTO_INCREMENT, name VARCHAR(100), rarity INT, PRIMARY KEY (id), INDEX mameIndex (name));";
|
||||||
private static String CREATE_INVENTORY_CATEGORY_TABLE = "CREATE TABLE IF NOT EXISTS itemCategories (id INT NOT NULL AUTO_INCREMENT, name VARCHAR(100), PRIMARY KEY (id), UNIQUE INDEX nameIndex (name));";
|
|
||||||
private static String CREATE_INVENTORY_RELATION_TABLE = "CREATE TABLE IF NOT EXISTS accountInventory (id INT NOT NULL AUTO_INCREMENT, accountId INT NOT NULL, itemId INT NOT NULL, count INT NOT NULL, PRIMARY KEY (id), FOREIGN KEY (accountId) REFERENCES accounts(id), FOREIGN KEY (itemId) REFERENCES items(id), UNIQUE INDEX accountItemIndex (accountId, itemId));";
|
private static String CREATE_INVENTORY_RELATION_TABLE = "CREATE TABLE IF NOT EXISTS accountInventory (id INT NOT NULL AUTO_INCREMENT, accountId INT NOT NULL, itemId INT NOT NULL, count INT NOT NULL, PRIMARY KEY (id), FOREIGN KEY (accountId) REFERENCES accounts(id), FOREIGN KEY (itemId) REFERENCES items(id), UNIQUE INDEX accountItemIndex (accountId, itemId));";
|
||||||
|
|
||||||
private static String INSERT_ITEM = "INSERT INTO items (name, categoryId) VALUES (?, ?);";
|
private static String INSERT_ITEM = "INSERT INTO items (name) VALUES (?);";
|
||||||
private static String RETRIEVE_ITEMS = "SELECT items.id, items.name, itemCategories.name FROM items INNER JOIN itemCategories ON itemCategories.id = items.categoryId;";
|
private static String RETRIEVE_ITEMS = "SELECT items.id, items.name FROM items;";
|
||||||
|
|
||||||
private static String INSERT_CATEGORY = "INSERT INTO itemCategories (name) VALUES (?);";
|
|
||||||
private static String RETRIEVE_CATEGORIES = "SELECT id, name FROM itemCategories;";
|
|
||||||
|
|
||||||
private static String INSERT_CLIENT_INVENTORY = "INSERT INTO accountInventory (accountId, itemId, count) VALUES (?, ?, ?) ON DUPLICATE KEY UPDATE count=count + VALUES(count);";
|
private static String INSERT_CLIENT_INVENTORY = "INSERT INTO accountInventory (accountId, itemId, count) VALUES (?, ?, ?) ON DUPLICATE KEY UPDATE count=count + VALUES(count);";
|
||||||
private static String UPDATE_CLIENT_INVENTORY = "UPDATE accountInventory SET count = count + ? WHERE accountId = ? AND itemId = ?;";
|
private static String UPDATE_CLIENT_INVENTORY = "UPDATE accountInventory SET count = count + ? WHERE accountId = ? AND itemId = ?;";
|
||||||
@ -39,7 +36,6 @@ public class InventoryRepository extends RepositoryBase
|
|||||||
protected void initialize()
|
protected void initialize()
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
executeUpdate(CREATE_INVENTORY_CATEGORY_TABLE);
|
|
||||||
executeUpdate(CREATE_INVENTORY_TABLE);
|
executeUpdate(CREATE_INVENTORY_TABLE);
|
||||||
executeUpdate(CREATE_INVENTORY_RELATION_TABLE);
|
executeUpdate(CREATE_INVENTORY_RELATION_TABLE);
|
||||||
*/
|
*/
|
||||||
@ -50,32 +46,9 @@ public class InventoryRepository extends RepositoryBase
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<Category> retrieveCategories()
|
public void addItem(String name)
|
||||||
{
|
{
|
||||||
final List<Category> categories = new ArrayList<Category>();
|
executeUpdate(INSERT_ITEM, new ColumnVarChar("name", 100, name));
|
||||||
|
|
||||||
executeQuery(RETRIEVE_CATEGORIES, new ResultSetCallable()
|
|
||||||
{
|
|
||||||
public void processResultSet(ResultSet resultSet) throws SQLException
|
|
||||||
{
|
|
||||||
while (resultSet.next())
|
|
||||||
{
|
|
||||||
categories.add(new Category(resultSet.getInt(1), resultSet.getString(2)));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
return categories;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void addItem(String name, int categoryId)
|
|
||||||
{
|
|
||||||
executeUpdate(INSERT_ITEM, new ColumnVarChar("name", 100, name), new ColumnInt("categoryId", categoryId));
|
|
||||||
}
|
|
||||||
|
|
||||||
public void addCategory(String name)
|
|
||||||
{
|
|
||||||
executeUpdate(INSERT_CATEGORY, new ColumnVarChar("name", 100, name));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<Item> retrieveItems()
|
public List<Item> retrieveItems()
|
||||||
@ -88,7 +61,7 @@ public class InventoryRepository extends RepositoryBase
|
|||||||
{
|
{
|
||||||
while (resultSet.next())
|
while (resultSet.next())
|
||||||
{
|
{
|
||||||
items.add(new Item(resultSet.getInt(1), resultSet.getString(2), resultSet.getString(3)));
|
items.add(new Item(resultSet.getInt(1), resultSet.getString(2)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -108,13 +81,13 @@ public class InventoryRepository extends RepositoryBase
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ClientInventory loadClientInformation(ResultSet resultSet) throws SQLException
|
public ClientInventory loadClientInformation(ResultSet resultSet, NautHashMap<Integer, String> itemIdMap) throws SQLException
|
||||||
{
|
{
|
||||||
final ClientInventory clientInventory = new ClientInventory();
|
final ClientInventory clientInventory = new ClientInventory();
|
||||||
|
|
||||||
while (resultSet.next())
|
while (resultSet.next())
|
||||||
{
|
{
|
||||||
clientInventory.addItem(new ClientItem(new Item(resultSet.getString(1), resultSet.getString(2)), resultSet.getInt(3)));
|
clientInventory.addItem(new ClientItem(new Item(resultSet.getInt(1), itemIdMap.get(resultSet.getInt(1))), resultSet.getInt(2)));
|
||||||
}
|
}
|
||||||
|
|
||||||
return clientInventory;
|
return clientInventory;
|
||||||
|
@ -4,17 +4,11 @@ public class Item
|
|||||||
{
|
{
|
||||||
public int Id;
|
public int Id;
|
||||||
public String Name;
|
public String Name;
|
||||||
public String Category;
|
|
||||||
|
|
||||||
public Item(String name, String category)
|
|
||||||
{
|
|
||||||
this(-1, name, category);
|
|
||||||
}
|
|
||||||
|
|
||||||
public Item(int id, String name, String category)
|
public Item(int id, String name)
|
||||||
{
|
{
|
||||||
Id = id;
|
Id = id;
|
||||||
Name = name;
|
Name = name;
|
||||||
Category = category;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3,6 +3,25 @@ package mineplex.core.mount;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import mineplex.core.MiniPlugin;
|
||||||
|
import mineplex.core.account.CoreClientManager;
|
||||||
|
import mineplex.core.blockrestore.BlockRestore;
|
||||||
|
import mineplex.core.common.util.F;
|
||||||
|
import mineplex.core.common.util.NautHashMap;
|
||||||
|
import mineplex.core.common.util.UtilPlayer;
|
||||||
|
import mineplex.core.common.util.UtilServer;
|
||||||
|
import mineplex.core.disguise.DisguiseManager;
|
||||||
|
import mineplex.core.donation.DonationManager;
|
||||||
|
import mineplex.core.mount.types.MountCart;
|
||||||
|
import mineplex.core.mount.types.MountDragon;
|
||||||
|
import mineplex.core.mount.types.MountFrost;
|
||||||
|
import mineplex.core.mount.types.MountMule;
|
||||||
|
import mineplex.core.mount.types.MountSlime;
|
||||||
|
import mineplex.core.mount.types.MountSpider;
|
||||||
|
import mineplex.core.mount.types.MountTitan;
|
||||||
|
import mineplex.core.mount.types.MountUndead;
|
||||||
|
import mineplex.core.mount.types.MountZombie;
|
||||||
|
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.entity.Entity;
|
import org.bukkit.entity.Entity;
|
||||||
import org.bukkit.entity.Horse;
|
import org.bukkit.entity.Horse;
|
||||||
@ -14,17 +33,6 @@ import org.bukkit.event.player.PlayerInteractEntityEvent;
|
|||||||
import org.bukkit.event.player.PlayerQuitEvent;
|
import org.bukkit.event.player.PlayerQuitEvent;
|
||||||
import org.bukkit.plugin.java.JavaPlugin;
|
import org.bukkit.plugin.java.JavaPlugin;
|
||||||
|
|
||||||
import mineplex.core.MiniPlugin;
|
|
||||||
import mineplex.core.account.CoreClientManager;
|
|
||||||
import mineplex.core.blockrestore.BlockRestore;
|
|
||||||
import mineplex.core.common.util.F;
|
|
||||||
import mineplex.core.common.util.NautHashMap;
|
|
||||||
import mineplex.core.common.util.UtilPlayer;
|
|
||||||
import mineplex.core.common.util.UtilServer;
|
|
||||||
import mineplex.core.disguise.DisguiseManager;
|
|
||||||
import mineplex.core.donation.DonationManager;
|
|
||||||
import mineplex.core.mount.types.*;
|
|
||||||
|
|
||||||
public class MountManager extends MiniPlugin
|
public class MountManager extends MiniPlugin
|
||||||
{
|
{
|
||||||
private CoreClientManager _clientManager;
|
private CoreClientManager _clientManager;
|
||||||
@ -57,6 +65,9 @@ public class MountManager extends MiniPlugin
|
|||||||
_types.add(new MountDragon(this));
|
_types.add(new MountDragon(this));
|
||||||
_types.add(new MountSlime(this));
|
_types.add(new MountSlime(this));
|
||||||
_types.add(new MountCart(this));
|
_types.add(new MountCart(this));
|
||||||
|
_types.add(new MountSpider(this));
|
||||||
|
_types.add(new MountZombie(this));
|
||||||
|
_types.add(new MountTitan(this));
|
||||||
//_types.add(new MountSheep(this));
|
//_types.add(new MountSheep(this));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -168,5 +179,15 @@ public class MountManager extends MiniPlugin
|
|||||||
return _disguiseManager;
|
return _disguiseManager;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isMount(Entity ent)
|
||||||
|
{
|
||||||
|
for (Mount<?> mount : _playerActiveMountMap.values())
|
||||||
|
{
|
||||||
|
if (mount.GetActive().values().contains(ent))
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,21 +1,8 @@
|
|||||||
package mineplex.core.mount.types;
|
package mineplex.core.mount.types;
|
||||||
|
|
||||||
import org.bukkit.ChatColor;
|
|
||||||
import org.bukkit.EntityEffect;
|
|
||||||
import org.bukkit.Material;
|
|
||||||
import org.bukkit.Sound;
|
|
||||||
import org.bukkit.entity.Minecart;
|
|
||||||
import org.bukkit.entity.Player;
|
|
||||||
import org.bukkit.event.EventHandler;
|
|
||||||
import org.bukkit.event.entity.EntityDamageEvent;
|
|
||||||
import org.bukkit.event.entity.EntityTargetEvent;
|
|
||||||
import org.bukkit.event.player.PlayerInteractEntityEvent;
|
|
||||||
import org.bukkit.event.vehicle.VehicleDamageEvent;
|
|
||||||
|
|
||||||
import mineplex.core.common.util.F;
|
import mineplex.core.common.util.F;
|
||||||
import mineplex.core.common.util.UtilAction;
|
import mineplex.core.common.util.UtilAction;
|
||||||
import mineplex.core.common.util.UtilAlg;
|
import mineplex.core.common.util.UtilAlg;
|
||||||
import mineplex.core.common.util.UtilEnt;
|
|
||||||
import mineplex.core.common.util.UtilMath;
|
import mineplex.core.common.util.UtilMath;
|
||||||
import mineplex.core.common.util.UtilPlayer;
|
import mineplex.core.common.util.UtilPlayer;
|
||||||
import mineplex.core.mount.Mount;
|
import mineplex.core.mount.Mount;
|
||||||
@ -24,6 +11,17 @@ import mineplex.core.recharge.Recharge;
|
|||||||
import mineplex.core.updater.UpdateType;
|
import mineplex.core.updater.UpdateType;
|
||||||
import mineplex.core.updater.event.UpdateEvent;
|
import mineplex.core.updater.event.UpdateEvent;
|
||||||
|
|
||||||
|
import org.bukkit.ChatColor;
|
||||||
|
import org.bukkit.Material;
|
||||||
|
import org.bukkit.Sound;
|
||||||
|
import org.bukkit.craftbukkit.v1_7_R4.entity.CraftMinecart;
|
||||||
|
import org.bukkit.entity.Minecart;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.EventHandler;
|
||||||
|
import org.bukkit.event.entity.EntityTargetEvent;
|
||||||
|
import org.bukkit.event.player.PlayerInteractEntityEvent;
|
||||||
|
import org.bukkit.event.vehicle.VehicleDamageEvent;
|
||||||
|
|
||||||
public class MountCart extends Mount<Minecart>
|
public class MountCart extends Mount<Minecart>
|
||||||
{
|
{
|
||||||
public MountCart(MountManager manager)
|
public MountCart(MountManager manager)
|
||||||
@ -112,13 +110,18 @@ public class MountCart extends Mount<Minecart>
|
|||||||
if (cart.getPassenger() == null)
|
if (cart.getPassenger() == null)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (!UtilEnt.isGrounded(cart))
|
if (!((CraftMinecart) cart).getHandle().onGround)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
// if (!UtilEnt.isGrounded(cart))
|
||||||
|
// continue;
|
||||||
|
|
||||||
if (!(cart.getPassenger() instanceof Player))
|
if (!(cart.getPassenger() instanceof Player))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
UtilAction.velocity(cart, cart.getPassenger().getLocation().getDirection(), 1.4, true, 0, 0, 1, false);
|
Player player = (Player) cart.getPassenger();
|
||||||
|
|
||||||
|
UtilAction.velocity(cart, UtilAlg.getTrajectory2d(player.getEyeLocation(), UtilPlayer.getTargetLocation(player, 5)), 1.4, true, 0, 0, 1, false);
|
||||||
|
|
||||||
if (Math.random() > 0.8)
|
if (Math.random() > 0.8)
|
||||||
cart.getWorld().playSound(cart.getLocation(), Sound.MINECART_BASE, 0.05f, 2f);
|
cart.getWorld().playSound(cart.getLocation(), Sound.MINECART_BASE, 0.05f, 2f);
|
||||||
|
@ -0,0 +1,233 @@
|
|||||||
|
package mineplex.core.mount.types;
|
||||||
|
|
||||||
|
import java.lang.reflect.Field;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Map.Entry;
|
||||||
|
|
||||||
|
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.UtilEnt;
|
||||||
|
import mineplex.core.common.util.UtilMath;
|
||||||
|
import mineplex.core.common.util.UtilPlayer;
|
||||||
|
import mineplex.core.disguise.disguises.DisguiseSpider;
|
||||||
|
import mineplex.core.mount.HorseMount;
|
||||||
|
import mineplex.core.mount.MountManager;
|
||||||
|
import mineplex.core.recharge.Recharge;
|
||||||
|
import mineplex.core.updater.UpdateType;
|
||||||
|
import mineplex.core.updater.event.UpdateEvent;
|
||||||
|
import net.minecraft.server.v1_7_R4.EntityLiving;
|
||||||
|
|
||||||
|
import org.bukkit.Material;
|
||||||
|
import org.bukkit.Sound;
|
||||||
|
import org.bukkit.block.Block;
|
||||||
|
import org.bukkit.craftbukkit.v1_7_R4.entity.CraftPlayer;
|
||||||
|
import org.bukkit.entity.Horse;
|
||||||
|
import org.bukkit.entity.Horse.Color;
|
||||||
|
import org.bukkit.entity.Horse.Style;
|
||||||
|
import org.bukkit.entity.Horse.Variant;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.EventHandler;
|
||||||
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
|
public class MountSpider extends HorseMount
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* @author Mysticate
|
||||||
|
*/
|
||||||
|
|
||||||
|
public MountSpider(MountManager manager)
|
||||||
|
{
|
||||||
|
super(manager, "Spider Mount", new String[]
|
||||||
|
{
|
||||||
|
C.cWhite + "Why ride a horse when you can",
|
||||||
|
C.cWhite + "ride a cute and cuddly spider!",
|
||||||
|
C.cBlack,
|
||||||
|
C.cYellow + "Look Up" + C.cGray + " to use " + C.cGreen + "Wall Climb",
|
||||||
|
C.cYellow + "Jump" + C.cGray + " to use " + C.cGreen + "Leap",
|
||||||
|
C.cBlack,
|
||||||
|
C.cPurple + "Only available during " + C.Line + "Halloween 2015",
|
||||||
|
C.cPurple + "Purchase at " + C.Line + "www.mineplex.com/shop"
|
||||||
|
}, Material.WEB, (byte) 0, -1, Color.BLACK, Style.NONE, Variant.HORSE, 2.0, Material.AIR);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void EnableCustom(Player player)
|
||||||
|
{
|
||||||
|
player.leaveVehicle();
|
||||||
|
player.eject();
|
||||||
|
|
||||||
|
//Remove other mounts
|
||||||
|
Manager.DeregisterAll(player);
|
||||||
|
|
||||||
|
Horse horse = player.getWorld().spawn(player.getLocation(), Horse.class);
|
||||||
|
horse.setAdult();
|
||||||
|
horse.setAgeLock(true);
|
||||||
|
horse.setColor(_color);
|
||||||
|
horse.setStyle(_style);
|
||||||
|
horse.setVariant(_variant);
|
||||||
|
horse.setOwner(player);
|
||||||
|
horse.setMaxDomestication(1);
|
||||||
|
horse.setJumpStrength(_jump);
|
||||||
|
horse.setMaxHealth(20);
|
||||||
|
horse.setHealth(horse.getMaxHealth());
|
||||||
|
horse.getInventory().setSaddle(new ItemStack(Material.SADDLE));
|
||||||
|
|
||||||
|
if (horse.getVariant() == Variant.MULE)
|
||||||
|
horse.setCarryingChest(true);
|
||||||
|
|
||||||
|
if (_armor != null)
|
||||||
|
horse.getInventory().setArmor(new ItemStack(_armor));
|
||||||
|
|
||||||
|
horse.setCustomName(player.getName() + "'s " + GetName());
|
||||||
|
|
||||||
|
//Inform
|
||||||
|
UtilPlayer.message(player, F.main("Mount", "You spawned " + F.elem(GetName()) + "."));
|
||||||
|
|
||||||
|
//Store
|
||||||
|
_active.put(player, horse);
|
||||||
|
|
||||||
|
DisguiseSpider spider = new DisguiseSpider(horse);
|
||||||
|
spider.setName(player.getName() + "'s Spider Mount");
|
||||||
|
Manager.getDisguiseManager().disguise(spider);
|
||||||
|
|
||||||
|
UtilEnt.silence(horse, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void sounds(UpdateEvent event)
|
||||||
|
{
|
||||||
|
if (event.getType() != UpdateType.FASTEST)
|
||||||
|
return;
|
||||||
|
|
||||||
|
ArrayList<Horse> used = new ArrayList<Horse>();
|
||||||
|
for (Player player : GetActive().keySet())
|
||||||
|
{
|
||||||
|
Horse horse = GetActive().get(player);
|
||||||
|
|
||||||
|
used.add(horse);
|
||||||
|
|
||||||
|
if (!Recharge.Instance.use(player, "Spider Mount Sounds", (1000 * UtilMath.r(3)) + 500, false, false))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
//Moving
|
||||||
|
if (horse.getVelocity().length() != 0 && UtilEnt.isGrounded(horse))
|
||||||
|
{
|
||||||
|
horse.getWorld().playSound(horse.getLocation(), Sound.SPIDER_WALK, .4F, 1.0F);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void wallClimb(UpdateEvent event)
|
||||||
|
{
|
||||||
|
if (event.getType() != UpdateType.TICK)
|
||||||
|
return;
|
||||||
|
|
||||||
|
for (Entry<Player, Horse> horse : GetActive().entrySet())
|
||||||
|
{
|
||||||
|
if (horse.getValue().getPassenger() != horse.getKey())
|
||||||
|
continue;
|
||||||
|
|
||||||
|
//If player is looking up
|
||||||
|
if (horse.getKey().getEyeLocation().getPitch() > -45)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
for (Block block : UtilBlock.getSurrounding(horse.getValue().getLocation().getBlock(), true))
|
||||||
|
{
|
||||||
|
if (UtilBlock.airFoliage(block) || block.isLiquid())
|
||||||
|
continue;
|
||||||
|
|
||||||
|
UtilAction.velocity(horse.getValue(), new Vector(horse.getValue().getVelocity().getX(), 0.2, horse.getValue().getVelocity().getZ()));
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// @EventHandler(priority = EventPriority.LOW)
|
||||||
|
// public void doubleJump(PlayerToggleFlightEvent event)
|
||||||
|
// {
|
||||||
|
// Player player = event.getPlayer();
|
||||||
|
//
|
||||||
|
// if (player.getGameMode() == GameMode.CREATIVE)
|
||||||
|
// return;
|
||||||
|
//
|
||||||
|
// if (!GetActive().containsKey(player))
|
||||||
|
// return;
|
||||||
|
//
|
||||||
|
// if (GetActive().get(player).getPassenger() != event.getPlayer())
|
||||||
|
// return;
|
||||||
|
//
|
||||||
|
// //Chicken Cancel
|
||||||
|
// DisguiseBase disguise = Manager.getDisguiseManager().getDisguise(player);
|
||||||
|
// if (disguise != null && ((disguise instanceof DisguiseChicken && !((DisguiseChicken)disguise).isBaby()) || disguise instanceof DisguiseBat || disguise instanceof DisguiseEnderman || disguise instanceof DisguiseWither))
|
||||||
|
// return;
|
||||||
|
//
|
||||||
|
// Horse horse = GetActive().get(event.getPlayer());
|
||||||
|
//
|
||||||
|
// if (!UtilEnt.isGrounded(horse))
|
||||||
|
// return;
|
||||||
|
//
|
||||||
|
// event.setCancelled(true);
|
||||||
|
// player.setFlying(false);
|
||||||
|
//
|
||||||
|
// //Disable Flight
|
||||||
|
// player.setAllowFlight(false);
|
||||||
|
//
|
||||||
|
// //Velocity
|
||||||
|
// UtilAction.velocity(horse, 1.4, 0.38, 1, true);
|
||||||
|
//
|
||||||
|
// //Sound
|
||||||
|
// player.playSound(horse.getLocation(), Sound.SPIDER_IDLE, .4F, 1.0F);
|
||||||
|
// }
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void jump(UpdateEvent event)
|
||||||
|
{
|
||||||
|
if (event.getType() != UpdateType.TICK)
|
||||||
|
return;
|
||||||
|
|
||||||
|
for (Player player : GetActive().keySet())
|
||||||
|
{
|
||||||
|
final Horse horse = GetActive().get(player);
|
||||||
|
|
||||||
|
if (horse.getPassenger() != player)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (!UtilEnt.isGrounded(horse))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (!Recharge.Instance.use(player, "Spider Mount Jump", 100, false, false))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
Field jump = EntityLiving.class.getDeclaredField("bc");
|
||||||
|
final boolean accessable = jump.isAccessible();
|
||||||
|
|
||||||
|
jump.setAccessible(true);
|
||||||
|
boolean isJumping = jump.getBoolean(((CraftPlayer) player).getHandle());
|
||||||
|
|
||||||
|
jump.setAccessible(accessable);
|
||||||
|
|
||||||
|
if (!isJumping)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
//Not jumping anymore
|
||||||
|
((CraftPlayer) player).getHandle().f(false);
|
||||||
|
|
||||||
|
//Velocity
|
||||||
|
UtilAction.velocity(horse, 1.4, 0.38, .8, true);
|
||||||
|
|
||||||
|
//Sound
|
||||||
|
player.playSound(horse.getLocation(), Sound.SPIDER_IDLE, .4F, 1.0F);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
ex.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,27 @@
|
|||||||
|
package mineplex.core.mount.types;
|
||||||
|
|
||||||
|
import org.bukkit.Material;
|
||||||
|
import org.bukkit.entity.Horse.Color;
|
||||||
|
import org.bukkit.entity.Horse.Style;
|
||||||
|
import org.bukkit.entity.Horse.Variant;
|
||||||
|
|
||||||
|
import mineplex.core.common.util.C;
|
||||||
|
import mineplex.core.mount.HorseMount;
|
||||||
|
import mineplex.core.mount.MountManager;
|
||||||
|
|
||||||
|
public class MountTitan extends HorseMount
|
||||||
|
{
|
||||||
|
public MountTitan(MountManager manager)
|
||||||
|
{
|
||||||
|
super(manager, "Titanic Mount", new String[]
|
||||||
|
{
|
||||||
|
C.cWhite + "Coming Soon...",
|
||||||
|
" ",
|
||||||
|
C.cRed + "Unlocked with Titan Rank",
|
||||||
|
},
|
||||||
|
Material.REDSTONE_BLOCK,
|
||||||
|
(byte)0,
|
||||||
|
-1,
|
||||||
|
Color.BLACK, Style.BLACK_DOTS, Variant.UNDEAD_HORSE, 0.8, null);
|
||||||
|
}
|
||||||
|
}
|
@ -1,23 +1,22 @@
|
|||||||
package mineplex.core.mount.types;
|
package mineplex.core.mount.types;
|
||||||
|
|
||||||
|
import mineplex.core.common.util.C;
|
||||||
|
import mineplex.core.common.util.UtilParticle;
|
||||||
|
import mineplex.core.common.util.UtilParticle.ParticleType;
|
||||||
|
import mineplex.core.common.util.UtilParticle.ViewDist;
|
||||||
|
import mineplex.core.common.util.UtilServer;
|
||||||
|
import mineplex.core.mount.HorseMount;
|
||||||
|
import mineplex.core.mount.MountManager;
|
||||||
|
import mineplex.core.updater.UpdateType;
|
||||||
|
import mineplex.core.updater.event.UpdateEvent;
|
||||||
|
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.entity.Horse;
|
import org.bukkit.entity.Horse;
|
||||||
import org.bukkit.entity.Horse.Color;
|
import org.bukkit.entity.Horse.Color;
|
||||||
import org.bukkit.entity.Horse.Style;
|
import org.bukkit.entity.Horse.Style;
|
||||||
import org.bukkit.entity.Horse.Variant;
|
import org.bukkit.entity.Horse.Variant;
|
||||||
import org.bukkit.entity.Player;
|
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
|
|
||||||
import mineplex.core.common.util.C;
|
|
||||||
import mineplex.core.common.util.UtilParticle;
|
|
||||||
import mineplex.core.common.util.UtilServer;
|
|
||||||
import mineplex.core.common.util.UtilParticle.ParticleType;
|
|
||||||
import mineplex.core.common.util.UtilParticle.ViewDist;
|
|
||||||
import mineplex.core.mount.HorseMount;
|
|
||||||
import mineplex.core.mount.MountManager;
|
|
||||||
import mineplex.core.updater.UpdateType;
|
|
||||||
import mineplex.core.updater.event.UpdateEvent;
|
|
||||||
|
|
||||||
public class MountUndead extends HorseMount
|
public class MountUndead extends HorseMount
|
||||||
{
|
{
|
||||||
public MountUndead(MountManager manager)
|
public MountUndead(MountManager manager)
|
||||||
|
@ -0,0 +1,30 @@
|
|||||||
|
package mineplex.core.mount.types;
|
||||||
|
|
||||||
|
import org.bukkit.Material;
|
||||||
|
import org.bukkit.entity.Horse.Color;
|
||||||
|
import org.bukkit.entity.Horse.Style;
|
||||||
|
import org.bukkit.entity.Horse.Variant;
|
||||||
|
|
||||||
|
import mineplex.core.common.util.C;
|
||||||
|
import mineplex.core.mount.HorseMount;
|
||||||
|
import mineplex.core.mount.MountManager;
|
||||||
|
|
||||||
|
public class MountZombie extends HorseMount
|
||||||
|
{
|
||||||
|
public MountZombie(MountManager manager)
|
||||||
|
{
|
||||||
|
super(manager, "Decrepit Warhorse", new String[]
|
||||||
|
{
|
||||||
|
C.cWhite + "Once a fierce warhorse, this",
|
||||||
|
C.cWhite + "undead beast will send fear",
|
||||||
|
C.cWhite + "into the hearts of your enemies.",
|
||||||
|
" ",
|
||||||
|
C.cYellow + "Earned by defeating the Pumpkin King",
|
||||||
|
C.cYellow + "in the 2015 Halloween Horror Event.",
|
||||||
|
},
|
||||||
|
Material.ROTTEN_FLESH,
|
||||||
|
(byte)0,
|
||||||
|
-1,
|
||||||
|
Color.BLACK, Style.BLACK_DOTS, Variant.UNDEAD_HORSE, 0.8, null);
|
||||||
|
}
|
||||||
|
}
|
@ -17,7 +17,7 @@ import mineplex.core.updater.event.UpdateEvent;
|
|||||||
|
|
||||||
public class NotificationManager extends MiniPlugin
|
public class NotificationManager extends MiniPlugin
|
||||||
{
|
{
|
||||||
private boolean _enabled = true;
|
private boolean _enabled = false;
|
||||||
|
|
||||||
private CoreClientManager _clientManager;
|
private CoreClientManager _clientManager;
|
||||||
|
|
||||||
@ -45,8 +45,9 @@ public class NotificationManager extends MiniPlugin
|
|||||||
// if (event.getType() == UpdateType.MIN_08)
|
// if (event.getType() == UpdateType.MIN_08)
|
||||||
// hugeSale();
|
// hugeSale();
|
||||||
|
|
||||||
if (event.getType() == UpdateType.MIN_16)
|
// if (event.getType() == UpdateType.MIN_16)
|
||||||
sale();
|
// sale();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void sale()
|
private void sale()
|
||||||
@ -60,18 +61,18 @@ public class NotificationManager extends MiniPlugin
|
|||||||
|
|
||||||
if (rank == Rank.ALL)
|
if (rank == Rank.ALL)
|
||||||
{
|
{
|
||||||
UtilPlayer.message(player, C.cWhite + "50% Off Sale! " + " Purchase " + C.cAqua + C.Bold + "Ultra Rank" + C.cWhite + " for $15");
|
UtilPlayer.message(player, C.cWhite + " 50% Off Sale! " + " Purchase " + C.cAqua + C.Bold + "Ultra Rank" + C.cWhite + " for $15");
|
||||||
}
|
}
|
||||||
else if (rank == Rank.ULTRA)
|
else if (rank == Rank.ULTRA)
|
||||||
{
|
{
|
||||||
UtilPlayer.message(player, C.cWhite + "50% Off Sale! " + " Upgrade to " + C.cPurple + C.Bold + "Hero Rank" + C.cWhite + " for $15!");
|
UtilPlayer.message(player, C.cWhite + " 50% Off Sale! " + " Upgrade to " + C.cPurple + C.Bold + "Hero Rank" + C.cWhite + " for $15!");
|
||||||
}
|
}
|
||||||
else if (rank == Rank.HERO)
|
else if (rank == Rank.HERO)
|
||||||
{
|
{
|
||||||
UtilPlayer.message(player, C.cWhite + "50% Off Sale! " + "Upgrade to " + C.cGreen + C.Bold + "Legend Rank" + C.cWhite + " for $15!");
|
UtilPlayer.message(player, C.cWhite + " 50% Off Sale! " + "Upgrade to " + C.cGreen + C.Bold + "Legend Rank" + C.cWhite + " for $15!");
|
||||||
}
|
}
|
||||||
|
|
||||||
UtilPlayer.message(player, C.cWhite + " Visit " + F.link("www.mineplex.com/shop") + " for 50% Off Ranks!");
|
UtilPlayer.message(player, C.cWhite + " Visit " + F.link("www.mineplex.com/shop") + C.cWhite + " for 50% Off Ranks!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -34,6 +34,9 @@ public class PetRepository extends RepositoryBase
|
|||||||
{
|
{
|
||||||
public void run()
|
public void run()
|
||||||
{
|
{
|
||||||
|
if (token.PetId == 0 || token.AccountId == 0)
|
||||||
|
return;
|
||||||
|
|
||||||
executeInsert("INSERT INTO accountPets(petName, petId, accountId) VALUES (?, ?, ?);", null, new ColumnVarChar("petName", 32, token.PetName)
|
executeInsert("INSERT INTO accountPets(petName, petId, accountId) VALUES (?, ?, ?);", null, new ColumnVarChar("petName", 32, token.PetName)
|
||||||
, new ColumnInt("petId", token.PetId)
|
, new ColumnInt("petId", token.PetId)
|
||||||
, new ColumnInt("accountId", token.AccountId));
|
, new ColumnInt("accountId", token.AccountId));
|
||||||
@ -49,6 +52,9 @@ public class PetRepository extends RepositoryBase
|
|||||||
{
|
{
|
||||||
public void run()
|
public void run()
|
||||||
{
|
{
|
||||||
|
if (token.PetId == 0 || token.AccountId == 0)
|
||||||
|
return;
|
||||||
|
|
||||||
executeUpdate("DELETE FROM accountPets WHERE petId = ? AND accountId = ?;"
|
executeUpdate("DELETE FROM accountPets WHERE petId = ? AND accountId = ?;"
|
||||||
, new ColumnInt("petId", token.PetId)
|
, new ColumnInt("petId", token.PetId)
|
||||||
, new ColumnInt("accountId", token.AccountId));
|
, new ColumnInt("accountId", token.AccountId));
|
||||||
@ -69,6 +75,9 @@ public class PetRepository extends RepositoryBase
|
|||||||
{
|
{
|
||||||
public void run()
|
public void run()
|
||||||
{
|
{
|
||||||
|
if (token.PetId == 0 || token.AccountId == 0)
|
||||||
|
return;
|
||||||
|
|
||||||
int rowsChanged = executeUpdate("UPDATE accountPets SET petName = ? WHERE petId = ? AND accountId = ?;", new ColumnVarChar("petName", 32, token.PetName)
|
int rowsChanged = executeUpdate("UPDATE accountPets SET petName = ? WHERE petId = ? AND accountId = ?;", new ColumnVarChar("petName", 32, token.PetName)
|
||||||
, new ColumnInt("petId", token.PetId)
|
, new ColumnInt("petId", token.PetId)
|
||||||
, new ColumnInt("accountId", token.AccountId));
|
, new ColumnInt("accountId", token.AccountId));
|
||||||
|
@ -35,8 +35,8 @@ public class PollRepository extends RepositoryBase
|
|||||||
@Override
|
@Override
|
||||||
protected void initialize()
|
protected void initialize()
|
||||||
{
|
{
|
||||||
executeUpdate(CREATE_POLL_TABLE);
|
//executeUpdate(CREATE_POLL_TABLE);
|
||||||
executeUpdate(CREATE_RELATION_TABLE);
|
//executeUpdate(CREATE_RELATION_TABLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -165,7 +165,22 @@ public class PreferencesPage extends ShopPageBase<PreferencesManager, Preference
|
|||||||
protected void toggleHubInvisibility(org.bukkit.entity.Player player)
|
protected void toggleHubInvisibility(org.bukkit.entity.Player player)
|
||||||
{
|
{
|
||||||
getPlugin().Get(player).Invisibility = !getPlugin().Get(player).Invisibility;
|
getPlugin().Get(player).Invisibility = !getPlugin().Get(player).Invisibility;
|
||||||
|
|
||||||
|
//Dont save for Mod/SnrMod - prevents them just being invis 24/7
|
||||||
|
if (getPlugin().Get(player).Invisibility)
|
||||||
|
{
|
||||||
|
if (getClient().GetRank().has(Rank.ADMIN) ||
|
||||||
|
getClient().GetRank() == Rank.YOUTUBE ||
|
||||||
|
getClient().GetRank() == Rank.YOUTUBE_SMALL ||
|
||||||
|
getClient().GetRank() == Rank.TWITCH)
|
||||||
|
{
|
||||||
_hubInvisibilityToggled = !_hubInvisibilityToggled;
|
_hubInvisibilityToggled = !_hubInvisibilityToggled;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
player.setFlying(false);
|
||||||
|
player.setAllowFlight(false);
|
||||||
|
|
||||||
buildPage();
|
buildPage();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -255,12 +270,6 @@ public class PreferencesPage extends ShopPageBase<PreferencesManager, Preference
|
|||||||
|
|
||||||
buildPreference(40, Material.RED_ROSE, "Show Pending Friend Requests", userPreferences.PendingFriendRequests, _togglePendingFriendRequests);
|
buildPreference(40, Material.RED_ROSE, "Show Pending Friend Requests", userPreferences.PendingFriendRequests, _togglePendingFriendRequests);
|
||||||
|
|
||||||
if (getClientManager().Get(getPlayer()).GetRank() == Rank.YOUTUBE || getClientManager().Get(getPlayer()).GetRank() == Rank.TWITCH)
|
|
||||||
{
|
|
||||||
buildPreference(38, Material.NETHER_STAR, "Hub Invisibility", userPreferences.Invisibility, _toggleHubInvisibility);
|
|
||||||
buildPreference(42, Material.SLIME_BALL, "Hub Forcefield", userPreferences.HubForcefield, _toggleHubForcefield);
|
|
||||||
buildPreference(44, Material.SADDLE, "Hub Ignore Velocity", userPreferences.IgnoreVelocity, _toggleHubIgnoreVelocity);
|
|
||||||
}
|
|
||||||
if (getClientManager().Get(getPlayer()).GetRank().has(Rank.ADMIN) || getClientManager().Get(getPlayer()).GetRank() == Rank.JNR_DEV)
|
if (getClientManager().Get(getPlayer()).GetRank().has(Rank.ADMIN) || getClientManager().Get(getPlayer()).GetRank() == Rank.JNR_DEV)
|
||||||
{
|
{
|
||||||
buildPreference(36, Material.NETHER_STAR, "Hub Invisibility", userPreferences.Invisibility, _toggleHubInvisibility);
|
buildPreference(36, Material.NETHER_STAR, "Hub Invisibility", userPreferences.Invisibility, _toggleHubInvisibility);
|
||||||
@ -270,8 +279,15 @@ public class PreferencesPage extends ShopPageBase<PreferencesManager, Preference
|
|||||||
}
|
}
|
||||||
else if (getClientManager().Get(getPlayer()).GetRank().has(Rank.MODERATOR))
|
else if (getClientManager().Get(getPlayer()).GetRank().has(Rank.MODERATOR))
|
||||||
{
|
{
|
||||||
buildPreference(38, Material.PAPER, "Mac Reports", userPreferences.ShowMacReports, _toggleMacReports);
|
buildPreference(38, Material.NETHER_STAR, "Hub Invisibility", userPreferences.Invisibility, _toggleHubInvisibility);
|
||||||
buildPreference(42, Material.SADDLE, "Hub Ignore Velocity", userPreferences.IgnoreVelocity, _toggleHubIgnoreVelocity);
|
buildPreference(42, Material.PAPER, "Mac Reports", userPreferences.ShowMacReports, _toggleMacReports);
|
||||||
|
buildPreference(44, Material.SADDLE, "Hub Ignore Velocity", userPreferences.IgnoreVelocity, _toggleHubIgnoreVelocity);
|
||||||
|
}
|
||||||
|
else if (getClientManager().Get(getPlayer()).GetRank() == Rank.YOUTUBE || getClientManager().Get(getPlayer()).GetRank() == Rank.TWITCH)
|
||||||
|
{
|
||||||
|
buildPreference(38, Material.NETHER_STAR, "Hub Invisibility & Flight", userPreferences.Invisibility, _toggleHubInvisibility);
|
||||||
|
buildPreference(42, Material.SLIME_BALL, "Hub Forcefield", userPreferences.HubForcefield, _toggleHubForcefield);
|
||||||
|
buildPreference(44, Material.SADDLE, "Hub Ignore Velocity", userPreferences.IgnoreVelocity, _toggleHubIgnoreVelocity);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -47,9 +47,11 @@ This will be used to determine if staff are handling
|
|||||||
@Override
|
@Override
|
||||||
protected void initialize()
|
protected void initialize()
|
||||||
{
|
{
|
||||||
|
/*
|
||||||
executeUpdate(CREATE_TICKET_TABLE);
|
executeUpdate(CREATE_TICKET_TABLE);
|
||||||
executeUpdate(CREATE_HANDLER_TABLE);
|
executeUpdate(CREATE_HANDLER_TABLE);
|
||||||
executeUpdate(CREATE_REPORTERS_TABLE);
|
executeUpdate(CREATE_REPORTERS_TABLE);
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -57,7 +57,7 @@ public class InventoryReward extends Reward
|
|||||||
amountToGive = _minAmount;
|
amountToGive = _minAmount;
|
||||||
}
|
}
|
||||||
|
|
||||||
_inventoryManager.addItemToInventory(player, "Item", _packageName, amountToGive);
|
_inventoryManager.addItemToInventory(player, _packageName, amountToGive);
|
||||||
|
|
||||||
return new RewardData(getRarity().getColor() + amountToGive + " " + _name, _itemStack, getRarity());
|
return new RewardData(getRarity().getColor() + amountToGive + " " + _name, _itemStack, getRarity());
|
||||||
}
|
}
|
||||||
|
@ -13,6 +13,7 @@ import mineplex.core.pet.repository.token.PetToken;
|
|||||||
import mineplex.core.reward.RewardData;
|
import mineplex.core.reward.RewardData;
|
||||||
import mineplex.core.reward.RewardManager;
|
import mineplex.core.reward.RewardManager;
|
||||||
import mineplex.core.reward.RewardRarity;
|
import mineplex.core.reward.RewardRarity;
|
||||||
|
import mineplex.playerCache.PlayerCache;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by shaun on 14-09-18.
|
* Created by shaun on 14-09-18.
|
||||||
@ -36,6 +37,12 @@ public class PetReward extends UnknownPackageReward
|
|||||||
protected RewardData giveRewardCustom(Player player)
|
protected RewardData giveRewardCustom(Player player)
|
||||||
{
|
{
|
||||||
PetChangeToken token = new PetChangeToken();
|
PetChangeToken token = new PetChangeToken();
|
||||||
|
|
||||||
|
if (_inventoryManager.getClientManager().Get(player) != null)
|
||||||
|
token.AccountId = _inventoryManager.getClientManager().Get(player).getAccountId();
|
||||||
|
else
|
||||||
|
token.AccountId = PlayerCache.getInstance().getPlayer(player.getUniqueId()).getAccountId();
|
||||||
|
|
||||||
token.Name = player.getName();
|
token.Name = player.getName();
|
||||||
token.PetType = _petEntity.toString();
|
token.PetType = _petEntity.toString();
|
||||||
token.PetName = getPackageName();
|
token.PetName = getPackageName();
|
||||||
@ -48,7 +55,7 @@ public class PetReward extends UnknownPackageReward
|
|||||||
|
|
||||||
_petManager.Get(player).GetPets().put(_petEntity, token.PetName);
|
_petManager.Get(player).GetPets().put(_petEntity, token.PetName);
|
||||||
|
|
||||||
_inventoryManager.addItemToInventory(player, "Pet", _petEntity.toString(), 1);
|
_inventoryManager.addItemToInventory(player, _petEntity.toString(), 1);
|
||||||
|
|
||||||
return super.giveRewardCustom(player);
|
return super.giveRewardCustom(player);
|
||||||
}
|
}
|
||||||
|
@ -160,6 +160,8 @@ public class StatsManager extends MiniDbClientPlugin<PlayerStats>
|
|||||||
if (player.isOnline())
|
if (player.isOnline())
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
int uploadKey = PlayerCache.getInstance().getPlayer(player.getUniqueId()).getAccountId();
|
int uploadKey = PlayerCache.getInstance().getPlayer(player.getUniqueId()).getAccountId();
|
||||||
|
|
||||||
uploadQueue.put(uploadKey, new NautHashMap<Integer, Long>());
|
uploadQueue.put(uploadKey, new NautHashMap<Integer, Long>());
|
||||||
@ -173,6 +175,11 @@ public class StatsManager extends MiniDbClientPlugin<PlayerStats>
|
|||||||
|
|
||||||
statIterator.remove();
|
statIterator.remove();
|
||||||
}
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
//System.out.println("[StatsManager] AccountId was not set for " + player.getName());
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_repository.saveStats(uploadQueue);
|
_repository.saveStats(uploadQueue);
|
||||||
|
@ -0,0 +1,47 @@
|
|||||||
|
package mineplex.core.titangiveaway;
|
||||||
|
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
|
import org.bukkit.Sound;
|
||||||
|
import org.bukkit.World;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.plugin.java.JavaPlugin;
|
||||||
|
|
||||||
|
import mineplex.core.common.util.C;
|
||||||
|
import mineplex.core.common.util.UtilServer;
|
||||||
|
import mineplex.core.common.util.UtilTextMiddle;
|
||||||
|
import mineplex.core.common.util.UtilTime;
|
||||||
|
import mineplex.serverdata.commands.CommandCallback;
|
||||||
|
import mineplex.serverdata.commands.ServerCommand;
|
||||||
|
|
||||||
|
public class GiveawayMessageHandler implements CommandCallback
|
||||||
|
{
|
||||||
|
private JavaPlugin _plugin;
|
||||||
|
|
||||||
|
public GiveawayMessageHandler(JavaPlugin plugin)
|
||||||
|
{
|
||||||
|
_plugin = plugin;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void run(ServerCommand command)
|
||||||
|
{
|
||||||
|
if (command instanceof TitanGiveawayMessage)
|
||||||
|
{
|
||||||
|
TitanGiveawayMessage message = ((TitanGiveawayMessage) command);
|
||||||
|
String playerName = message.getPlayerName();
|
||||||
|
int count = message.getTitanCount();
|
||||||
|
String countString = count + UtilTime.getDayOfMonthSuffix(count);
|
||||||
|
String chatMessage = C.cRed + playerName + C.cWhite + " has become the " + C.cRed + countString + " Titan ";
|
||||||
|
UtilTextMiddle.display(C.cDRed + C.Bold + "TITAN", chatMessage, 20, 80, 20, UtilServer.getPlayers());
|
||||||
|
World world = UtilServer.getPlayers().length > 0 ? UtilServer.getPlayers()[0].getWorld() : Bukkit.getWorlds().get(0);
|
||||||
|
LightFlicker lightFlicker = new LightFlicker(world);
|
||||||
|
lightFlicker.runTaskTimer(_plugin, 1, 1);
|
||||||
|
|
||||||
|
for (Player player : UtilServer.getPlayers())
|
||||||
|
{
|
||||||
|
player.sendMessage(chatMessage);
|
||||||
|
player.playSound(player.getEyeLocation(), Sound.AMBIENCE_CAVE, 1, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,52 @@
|
|||||||
|
package mineplex.core.titangiveaway;
|
||||||
|
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
|
import org.bukkit.Sound;
|
||||||
|
import org.bukkit.World;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.scheduler.BukkitRunnable;
|
||||||
|
|
||||||
|
public class LightFlicker extends BukkitRunnable
|
||||||
|
{
|
||||||
|
private static int MAX_TICKS = 100;
|
||||||
|
|
||||||
|
private World _world;
|
||||||
|
private Random _random;
|
||||||
|
private int _ticks;
|
||||||
|
private long _previousTime;
|
||||||
|
|
||||||
|
public LightFlicker(World world)
|
||||||
|
{
|
||||||
|
_world = world;
|
||||||
|
_random = new Random();
|
||||||
|
_ticks = 0;
|
||||||
|
_previousTime = world.getTime();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void run()
|
||||||
|
{
|
||||||
|
if (_ticks >= MAX_TICKS)
|
||||||
|
{
|
||||||
|
_world.setTime(_previousTime);
|
||||||
|
cancel();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_ticks % 5 == 0)
|
||||||
|
{
|
||||||
|
long time = (long) (24000 * _random.nextDouble());
|
||||||
|
_world.setTime(time);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_ticks % 10 == 0)
|
||||||
|
{
|
||||||
|
for (Player player : _world.getPlayers())
|
||||||
|
{
|
||||||
|
player.playSound(player.getEyeLocation(), Sound.AMBIENCE_THUNDER, 1, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
_ticks++;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,65 @@
|
|||||||
|
package mineplex.core.titangiveaway;
|
||||||
|
|
||||||
|
import mineplex.core.common.util.UtilFirework;
|
||||||
|
import mineplex.core.common.util.UtilMath;
|
||||||
|
import mineplex.core.common.util.UtilServer;
|
||||||
|
import mineplex.core.common.util.UtilTime;
|
||||||
|
import mineplex.core.updater.UpdateType;
|
||||||
|
import mineplex.core.updater.event.UpdateEvent;
|
||||||
|
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
|
import org.bukkit.Color;
|
||||||
|
import org.bukkit.FireworkEffect.Type;
|
||||||
|
import org.bukkit.Location;
|
||||||
|
import org.bukkit.Sound;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.EventHandler;
|
||||||
|
import org.bukkit.event.EventPriority;
|
||||||
|
import org.bukkit.event.HandlerList;
|
||||||
|
import org.bukkit.event.Listener;
|
||||||
|
|
||||||
|
public class TitanGiveawayAnimation implements Listener
|
||||||
|
{
|
||||||
|
private Location _location;
|
||||||
|
private Long _duration, _startTime, _worldTime;
|
||||||
|
|
||||||
|
public TitanGiveawayAnimation(TitanGiveawayManager manager, Location start, Long duration)
|
||||||
|
{
|
||||||
|
_location = start.clone();
|
||||||
|
_duration = duration;
|
||||||
|
_startTime = System.currentTimeMillis();
|
||||||
|
// _worldTime = start.getWorld().getTime();
|
||||||
|
Bukkit.getPluginManager().registerEvents(this, manager.getPlugin());
|
||||||
|
}
|
||||||
|
|
||||||
|
public TitanGiveawayAnimation(TitanGiveawayManager manager, Location start)
|
||||||
|
{
|
||||||
|
this(manager, start, 11111L);
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler(priority = EventPriority.MONITOR)
|
||||||
|
public void tick(UpdateEvent event)
|
||||||
|
{
|
||||||
|
if (event.getType() != UpdateType.TICK)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (UtilTime.elapsed(_startTime, _duration))
|
||||||
|
{
|
||||||
|
remove();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// _location.getWorld().setTime(UtilMath.random.nextLong());
|
||||||
|
for (Player player : UtilServer.getPlayers())
|
||||||
|
{
|
||||||
|
player.playSound(_location, Sound.ORB_PICKUP, 5, 5);
|
||||||
|
UtilFirework.packetPlayFirework(player, _location, Type.BURST, Color.RED, true, false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void remove()
|
||||||
|
{
|
||||||
|
// _location.getWorld().setTime(_worldTime);
|
||||||
|
HandlerList.unregisterAll(this);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,127 @@
|
|||||||
|
package mineplex.core.titangiveaway;
|
||||||
|
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
|
import org.bukkit.Location;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.EventHandler;
|
||||||
|
import org.bukkit.event.player.PlayerCommandPreprocessEvent;
|
||||||
|
import org.bukkit.plugin.java.JavaPlugin;
|
||||||
|
|
||||||
|
import mineplex.core.MiniPlugin;
|
||||||
|
import mineplex.core.account.CoreClientManager;
|
||||||
|
import mineplex.core.common.Rank;
|
||||||
|
import mineplex.core.common.util.Callback;
|
||||||
|
import mineplex.core.status.ServerStatusManager;
|
||||||
|
import mineplex.serverdata.Region;
|
||||||
|
import mineplex.serverdata.commands.ServerCommandManager;
|
||||||
|
|
||||||
|
public class TitanGiveawayManager extends MiniPlugin
|
||||||
|
{
|
||||||
|
private static final double RANK_FIND_CHANCE = 0.001;
|
||||||
|
// private static final double RANK_FIND_CHANCE = 1;
|
||||||
|
|
||||||
|
private TitanGiveawayRepository _repository;
|
||||||
|
private CoreClientManager _clientManager;
|
||||||
|
private ServerStatusManager _statusManager;
|
||||||
|
private Random _random;
|
||||||
|
|
||||||
|
public TitanGiveawayManager(JavaPlugin plugin, CoreClientManager clientManager, ServerStatusManager statusManager)
|
||||||
|
{
|
||||||
|
super("Titan Giveaway", plugin);
|
||||||
|
|
||||||
|
_repository = new TitanGiveawayRepository(plugin);
|
||||||
|
_clientManager = clientManager;
|
||||||
|
_statusManager = statusManager;
|
||||||
|
_random = new Random();
|
||||||
|
|
||||||
|
ServerCommandManager.getInstance().registerCommandType("TitanGiveawayMessage", TitanGiveawayMessage.class, new GiveawayMessageHandler(plugin));
|
||||||
|
}
|
||||||
|
|
||||||
|
public void openPumpkin(final Player player, final Runnable onSuccess)
|
||||||
|
{
|
||||||
|
double rand = _random.nextDouble();
|
||||||
|
if (!hasTitan(player) && rand < RANK_FIND_CHANCE)
|
||||||
|
{
|
||||||
|
final int accountId = _clientManager.getAccountId(player);
|
||||||
|
final Region region = getRegion();
|
||||||
|
final String serverName = getServerName();
|
||||||
|
|
||||||
|
// Need to check database that we can give away a rank
|
||||||
|
runAsync(new Runnable()
|
||||||
|
{
|
||||||
|
@Override
|
||||||
|
public void run()
|
||||||
|
{
|
||||||
|
final boolean pass = _repository.canGiveaway(region);
|
||||||
|
|
||||||
|
if (pass && _repository.addTitan(accountId, region, serverName))
|
||||||
|
{
|
||||||
|
runSync(new Runnable()
|
||||||
|
{
|
||||||
|
@Override
|
||||||
|
public void run()
|
||||||
|
{
|
||||||
|
giveRank(new Callback<Rank>()
|
||||||
|
{
|
||||||
|
@Override
|
||||||
|
public void run(Rank rank)
|
||||||
|
{
|
||||||
|
if (rank == Rank.TITAN)
|
||||||
|
{
|
||||||
|
TitanGiveawayMessage message = new TitanGiveawayMessage(player.getName(), _repository.getTitanCount() + 1);
|
||||||
|
message.publish();
|
||||||
|
if (onSuccess != null) onSuccess.run();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, Rank.TITAN, player);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Confirm that the player doesn't already have TITAN rank
|
||||||
|
*/
|
||||||
|
private boolean hasTitan(Player player)
|
||||||
|
{
|
||||||
|
return _clientManager.hasRank(player, Rank.TITAN);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Region getRegion()
|
||||||
|
{
|
||||||
|
return _statusManager.getRegion();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getServerName()
|
||||||
|
{
|
||||||
|
return _statusManager.getCurrentServerName();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void giveRank(Callback<Rank> callback, Rank rank, Player player)
|
||||||
|
{
|
||||||
|
_clientManager.Get(player).SetRank(rank);
|
||||||
|
_clientManager.getRepository().saveRank(callback, player.getName(), player.getUniqueId(), rank, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
// @EventHandler
|
||||||
|
// public void onCommand(final PlayerCommandPreprocessEvent event)
|
||||||
|
// {
|
||||||
|
// if (event.getMessage().contains("pumpkin"))
|
||||||
|
// {
|
||||||
|
// openPumpkin(event.getPlayer(), new Runnable()
|
||||||
|
// {
|
||||||
|
// @Override
|
||||||
|
// public void run()
|
||||||
|
// {
|
||||||
|
// Location location = event.getPlayer().getLocation().add(1, 0.5, 1);
|
||||||
|
// new TitanGiveawayAnimation(TitanGiveawayManager.this, location, 3000L);
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
// event.setCancelled(true);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
}
|
@ -0,0 +1,32 @@
|
|||||||
|
package mineplex.core.titangiveaway;
|
||||||
|
|
||||||
|
import mineplex.serverdata.commands.ServerCommand;
|
||||||
|
|
||||||
|
public class TitanGiveawayMessage extends ServerCommand
|
||||||
|
{
|
||||||
|
private String _playerName;
|
||||||
|
private int _titanCount;
|
||||||
|
|
||||||
|
public TitanGiveawayMessage(String playerName, int titanCount)
|
||||||
|
{
|
||||||
|
_playerName = playerName;
|
||||||
|
_titanCount = titanCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPlayerName()
|
||||||
|
{
|
||||||
|
return _playerName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getTitanCount()
|
||||||
|
{
|
||||||
|
return _titanCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void run()
|
||||||
|
{
|
||||||
|
// Handled in Command Callback
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,70 @@
|
|||||||
|
package mineplex.core.titangiveaway;
|
||||||
|
|
||||||
|
import java.sql.CallableStatement;
|
||||||
|
import java.sql.Connection;
|
||||||
|
import java.sql.Types;
|
||||||
|
|
||||||
|
import org.bukkit.plugin.java.JavaPlugin;
|
||||||
|
|
||||||
|
import mineplex.core.database.DBPool;
|
||||||
|
import mineplex.core.database.RepositoryBase;
|
||||||
|
import mineplex.core.database.column.ColumnInt;
|
||||||
|
import mineplex.core.database.column.ColumnVarChar;
|
||||||
|
import mineplex.serverdata.Region;
|
||||||
|
|
||||||
|
public class TitanGiveawayRepository extends RepositoryBase
|
||||||
|
{
|
||||||
|
private static final String ADD_TITAN = "INSERT INTO titanGiveaway (accountId, region, serverName) VALUES (?, ?, ?)";
|
||||||
|
|
||||||
|
private int _titanCount;
|
||||||
|
|
||||||
|
public TitanGiveawayRepository(JavaPlugin plugin)
|
||||||
|
{
|
||||||
|
super(plugin, DBPool.ACCOUNT);
|
||||||
|
_titanCount = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void initialize()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void update()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean addTitan(int accountId, Region region, String serverName)
|
||||||
|
{
|
||||||
|
return 1 == executeUpdate(ADD_TITAN, new ColumnInt("accountId", accountId), new ColumnVarChar("region", 10, region.name()), new ColumnVarChar("serverName", 64, serverName));
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean canGiveaway(Region region)
|
||||||
|
{
|
||||||
|
try (Connection connection = getConnection();
|
||||||
|
CallableStatement callableStatement = connection.prepareCall("{call check_titanGiveaway(?, ?, ?)}"))
|
||||||
|
{
|
||||||
|
callableStatement.setString(1, region.name());
|
||||||
|
callableStatement.registerOutParameter(2, Types.BOOLEAN);
|
||||||
|
callableStatement.registerOutParameter(3, Types.INTEGER);
|
||||||
|
callableStatement.executeUpdate();
|
||||||
|
|
||||||
|
boolean pass = callableStatement.getBoolean(2);
|
||||||
|
int titanCount = callableStatement.getInt(3);
|
||||||
|
|
||||||
|
_titanCount = titanCount;
|
||||||
|
return pass;
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getTitanCount()
|
||||||
|
{
|
||||||
|
return _titanCount;
|
||||||
|
}
|
||||||
|
}
|
@ -132,7 +132,7 @@ public class TreasureLocation implements Listener
|
|||||||
int itemCount = _inventoryManager.Get(player).getItemCount(treasureType.getItemName());
|
int itemCount = _inventoryManager.Get(player).getItemCount(treasureType.getItemName());
|
||||||
if (itemCount > 0)
|
if (itemCount > 0)
|
||||||
{
|
{
|
||||||
_inventoryManager.addItemToInventory(player, "Item", treasureType.getItemName(), -1);
|
_inventoryManager.addItemToInventory(player, treasureType.getItemName(), -1);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
@ -49,7 +49,7 @@ public class BuyChestButton implements IButton
|
|||||||
{
|
{
|
||||||
public void run()
|
public void run()
|
||||||
{
|
{
|
||||||
_inventoryManager.addItemToInventory(player, "Item", _chestName, 1);
|
_inventoryManager.addItemToInventory(player, _chestName, 1);
|
||||||
_page.refresh();
|
_page.refresh();
|
||||||
}
|
}
|
||||||
}, _page, new ChestPackage(_chestName, _chestMat, _chestCost), CurrencyType.Coins, player));
|
}, _page, new ChestPackage(_chestName, _chestMat, _chestCost), CurrencyType.Coins, player));
|
||||||
|
@ -47,6 +47,7 @@ import mineplex.core.stats.StatsManager;
|
|||||||
import mineplex.core.status.ServerStatusManager;
|
import mineplex.core.status.ServerStatusManager;
|
||||||
import mineplex.core.task.TaskManager;
|
import mineplex.core.task.TaskManager;
|
||||||
import mineplex.core.teleport.Teleport;
|
import mineplex.core.teleport.Teleport;
|
||||||
|
import mineplex.core.titangiveaway.TitanGiveawayManager;
|
||||||
import mineplex.core.updater.FileUpdater;
|
import mineplex.core.updater.FileUpdater;
|
||||||
import mineplex.core.updater.Updater;
|
import mineplex.core.updater.Updater;
|
||||||
import mineplex.core.velocity.VelocityFix;
|
import mineplex.core.velocity.VelocityFix;
|
||||||
@ -111,6 +112,7 @@ public class Hub extends JavaPlugin implements IRelation
|
|||||||
|
|
||||||
//Main Modules
|
//Main Modules
|
||||||
ServerStatusManager serverStatusManager = new ServerStatusManager(this, clientManager, new LagMeter(this, clientManager));
|
ServerStatusManager serverStatusManager = new ServerStatusManager(this, clientManager, new LagMeter(this, clientManager));
|
||||||
|
new TitanGiveawayManager(this, clientManager, serverStatusManager);
|
||||||
|
|
||||||
Portal portal = new Portal(this, clientManager, serverStatusManager.getCurrentServerName());
|
Portal portal = new Portal(this, clientManager, serverStatusManager.getCurrentServerName());
|
||||||
|
|
||||||
|
@ -3,6 +3,78 @@ package mineplex.hub;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
|
||||||
|
import mineplex.core.MiniClientPlugin;
|
||||||
|
import mineplex.core.account.CoreClient;
|
||||||
|
import mineplex.core.account.CoreClientManager;
|
||||||
|
import mineplex.core.achievement.AchievementManager;
|
||||||
|
import mineplex.core.aprilfools.AprilFoolsManager;
|
||||||
|
import mineplex.core.benefit.BenefitManager;
|
||||||
|
import mineplex.core.blockrestore.BlockRestore;
|
||||||
|
import mineplex.core.bonuses.BonusManager;
|
||||||
|
import mineplex.core.botspam.BotSpamManager;
|
||||||
|
import mineplex.core.common.Rank;
|
||||||
|
import mineplex.core.common.util.C;
|
||||||
|
import mineplex.core.common.util.F;
|
||||||
|
import mineplex.core.common.util.UtilAction;
|
||||||
|
import mineplex.core.common.util.UtilAlg;
|
||||||
|
import mineplex.core.common.util.UtilInv;
|
||||||
|
import mineplex.core.common.util.UtilMath;
|
||||||
|
import mineplex.core.common.util.UtilPlayer;
|
||||||
|
import mineplex.core.common.util.UtilServer;
|
||||||
|
import mineplex.core.common.util.UtilTime;
|
||||||
|
import mineplex.core.common.util.UtilWorld;
|
||||||
|
import mineplex.core.cosmetic.CosmeticManager;
|
||||||
|
import mineplex.core.disguise.DisguiseManager;
|
||||||
|
import mineplex.core.disguise.disguises.DisguiseSlime;
|
||||||
|
import mineplex.core.donation.DonationManager;
|
||||||
|
import mineplex.core.gadget.GadgetManager;
|
||||||
|
import mineplex.core.gadget.event.GadgetActivateEvent;
|
||||||
|
import mineplex.core.gadget.event.GadgetCollideEntityEvent;
|
||||||
|
import mineplex.core.hologram.HologramManager;
|
||||||
|
import mineplex.core.inventory.InventoryManager;
|
||||||
|
import mineplex.core.message.PrivateMessageEvent;
|
||||||
|
import mineplex.core.mount.MountManager;
|
||||||
|
import mineplex.core.mount.event.MountActivateEvent;
|
||||||
|
import mineplex.core.notifier.NotificationManager;
|
||||||
|
import mineplex.core.npc.NpcManager;
|
||||||
|
import mineplex.core.packethandler.PacketHandler;
|
||||||
|
import mineplex.core.party.Party;
|
||||||
|
import mineplex.core.party.PartyManager;
|
||||||
|
import mineplex.core.personalServer.PersonalServerManager;
|
||||||
|
import mineplex.core.pet.PetManager;
|
||||||
|
import mineplex.core.poll.PollManager;
|
||||||
|
import mineplex.core.portal.Portal;
|
||||||
|
import mineplex.core.preferences.PreferencesManager;
|
||||||
|
import mineplex.core.projectile.ProjectileManager;
|
||||||
|
import mineplex.core.punish.Punish;
|
||||||
|
import mineplex.core.stats.StatsManager;
|
||||||
|
import mineplex.core.task.TaskManager;
|
||||||
|
import mineplex.core.treasure.TreasureManager;
|
||||||
|
import mineplex.core.updater.UpdateType;
|
||||||
|
import mineplex.core.updater.event.UpdateEvent;
|
||||||
|
import mineplex.hub.commands.DisguiseCommand;
|
||||||
|
import mineplex.hub.commands.ForcefieldRadius;
|
||||||
|
import mineplex.hub.commands.GadgetToggle;
|
||||||
|
import mineplex.hub.commands.GameModeCommand;
|
||||||
|
import mineplex.hub.commands.NewsCommand;
|
||||||
|
import mineplex.hub.modules.ForcefieldManager;
|
||||||
|
import mineplex.hub.modules.HubVisibilityManager;
|
||||||
|
import mineplex.hub.modules.JumpManager;
|
||||||
|
import mineplex.hub.modules.KothManager;
|
||||||
|
import mineplex.hub.modules.NewsManager;
|
||||||
|
import mineplex.hub.modules.ParkourManager;
|
||||||
|
import mineplex.hub.modules.SoccerManager;
|
||||||
|
import mineplex.hub.modules.TextManager;
|
||||||
|
import mineplex.hub.modules.WorldManager;
|
||||||
|
import mineplex.hub.profile.gui.GUIProfile;
|
||||||
|
import mineplex.hub.tutorial.TutorialManager;
|
||||||
|
import mineplex.minecraft.game.classcombat.Skill.event.SkillTriggerEvent;
|
||||||
|
import mineplex.minecraft.game.classcombat.item.event.ItemTriggerEvent;
|
||||||
|
import mineplex.minecraft.game.core.combat.DeathMessageType;
|
||||||
|
import mineplex.minecraft.game.core.combat.event.CombatDeathEvent;
|
||||||
|
import mineplex.minecraft.game.core.condition.ConditionManager;
|
||||||
|
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.GameMode;
|
import org.bukkit.GameMode;
|
||||||
@ -34,89 +106,15 @@ import org.bukkit.event.player.PlayerVelocityEvent;
|
|||||||
import org.bukkit.event.server.ServerListPingEvent;
|
import org.bukkit.event.server.ServerListPingEvent;
|
||||||
import org.bukkit.event.world.ChunkLoadEvent;
|
import org.bukkit.event.world.ChunkLoadEvent;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
import org.bukkit.inventory.meta.BookMeta;
|
|
||||||
import org.bukkit.plugin.java.JavaPlugin;
|
import org.bukkit.plugin.java.JavaPlugin;
|
||||||
import org.bukkit.scoreboard.DisplaySlot;
|
import org.bukkit.scoreboard.DisplaySlot;
|
||||||
import org.bukkit.scoreboard.Objective;
|
import org.bukkit.scoreboard.Objective;
|
||||||
import org.bukkit.scoreboard.Scoreboard;
|
import org.bukkit.scoreboard.Scoreboard;
|
||||||
|
|
||||||
import mineplex.core.MiniClientPlugin;
|
|
||||||
import mineplex.core.account.CoreClient;
|
|
||||||
import mineplex.core.account.CoreClientManager;
|
|
||||||
import mineplex.core.achievement.AchievementManager;
|
|
||||||
import mineplex.core.aprilfools.AprilFoolsManager;
|
|
||||||
import mineplex.core.benefit.BenefitManager;
|
|
||||||
import mineplex.core.blockrestore.BlockRestore;
|
|
||||||
import mineplex.core.botspam.BotSpamManager;
|
|
||||||
import mineplex.core.common.Rank;
|
|
||||||
import mineplex.core.common.util.C;
|
|
||||||
import mineplex.core.common.util.F;
|
|
||||||
import mineplex.core.common.util.UtilAction;
|
|
||||||
import mineplex.core.common.util.UtilAlg;
|
|
||||||
import mineplex.core.common.util.UtilInv;
|
|
||||||
import mineplex.core.common.util.UtilMath;
|
|
||||||
import mineplex.core.common.util.UtilPlayer;
|
|
||||||
import mineplex.core.common.util.UtilServer;
|
|
||||||
import mineplex.core.common.util.UtilTime;
|
|
||||||
import mineplex.core.common.util.UtilWorld;
|
|
||||||
import mineplex.core.cosmetic.CosmeticManager;
|
|
||||||
import mineplex.core.disguise.DisguiseManager;
|
|
||||||
import mineplex.core.disguise.disguises.DisguiseSlime;
|
|
||||||
import mineplex.core.donation.DonationManager;
|
|
||||||
import mineplex.core.gadget.GadgetManager;
|
|
||||||
import mineplex.core.gadget.event.GadgetActivateEvent;
|
|
||||||
import mineplex.core.gadget.event.GadgetCollideEntityEvent;
|
|
||||||
import mineplex.core.hologram.HologramManager;
|
|
||||||
import mineplex.core.inventory.InventoryManager;
|
|
||||||
import mineplex.core.message.PrivateMessageEvent;
|
|
||||||
import mineplex.core.mount.MountManager;
|
|
||||||
import mineplex.core.mount.event.MountActivateEvent;
|
|
||||||
import mineplex.core.notifier.NotificationManager;
|
|
||||||
import mineplex.core.npc.NpcManager;
|
|
||||||
import mineplex.core.packethandler.PacketHandler;
|
|
||||||
import mineplex.core.party.Party;
|
|
||||||
import mineplex.core.party.PartyManager;
|
|
||||||
import mineplex.core.personalServer.PersonalServerManager;
|
|
||||||
import mineplex.core.pet.PetManager;
|
|
||||||
import mineplex.core.portal.Portal;
|
|
||||||
import mineplex.core.preferences.PreferencesManager;
|
|
||||||
import mineplex.core.projectile.ProjectileManager;
|
|
||||||
import mineplex.core.punish.Punish;
|
|
||||||
import mineplex.core.reward.RewardManager;
|
|
||||||
import mineplex.core.stats.StatsManager;
|
|
||||||
import mineplex.core.task.TaskManager;
|
|
||||||
import mineplex.core.treasure.TreasureManager;
|
|
||||||
import mineplex.core.updater.UpdateType;
|
|
||||||
import mineplex.core.updater.event.UpdateEvent;
|
|
||||||
import mineplex.core.bonuses.BonusManager;
|
|
||||||
import mineplex.hub.commands.DisguiseCommand;
|
|
||||||
import mineplex.hub.commands.ForcefieldRadius;
|
|
||||||
import mineplex.hub.commands.GadgetToggle;
|
|
||||||
import mineplex.hub.commands.GameModeCommand;
|
|
||||||
import mineplex.hub.commands.NewsCommand;
|
|
||||||
import mineplex.hub.modules.ForcefieldManager;
|
|
||||||
import mineplex.hub.modules.HubVisibilityManager;
|
|
||||||
import mineplex.hub.modules.JumpManager;
|
|
||||||
import mineplex.hub.modules.KothManager;
|
|
||||||
import mineplex.hub.modules.NewsManager;
|
|
||||||
import mineplex.hub.modules.ParkourManager;
|
|
||||||
import mineplex.hub.modules.SoccerManager;
|
|
||||||
import mineplex.hub.modules.TextManager;
|
|
||||||
import mineplex.hub.modules.WorldManager;
|
|
||||||
import mineplex.core.poll.PollManager;
|
|
||||||
import mineplex.hub.profile.gui.GUIProfile;
|
|
||||||
import mineplex.hub.tutorial.TutorialManager;
|
|
||||||
import mineplex.minecraft.game.classcombat.Skill.event.SkillTriggerEvent;
|
|
||||||
import mineplex.minecraft.game.classcombat.item.event.ItemTriggerEvent;
|
|
||||||
import mineplex.minecraft.game.core.combat.DeathMessageType;
|
|
||||||
import mineplex.minecraft.game.core.combat.event.CombatDeathEvent;
|
|
||||||
import mineplex.minecraft.game.core.condition.ConditionManager;
|
|
||||||
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
|
|
||||||
|
|
||||||
public class HubManager extends MiniClientPlugin<HubClient>
|
public class HubManager extends MiniClientPlugin<HubClient>
|
||||||
{
|
{
|
||||||
// ☃❅ Snowman!
|
// ☃❅ Snowman!
|
||||||
public HubType Type = HubType.Normal;
|
public HubType Type = HubType.Halloween;
|
||||||
|
|
||||||
private BlockRestore _blockRestore;
|
private BlockRestore _blockRestore;
|
||||||
private CoreClientManager _clientManager;
|
private CoreClientManager _clientManager;
|
||||||
@ -142,6 +140,7 @@ public class HubManager extends MiniClientPlugin<HubClient>
|
|||||||
private PetManager _petManager;
|
private PetManager _petManager;
|
||||||
private PacketHandler _packetHandler;
|
private PacketHandler _packetHandler;
|
||||||
private PersonalServerManager _personalServerManager;
|
private PersonalServerManager _personalServerManager;
|
||||||
|
// private HalloweenSpookinessManager _halloweenManager;
|
||||||
|
|
||||||
private Location _spawn;
|
private Location _spawn;
|
||||||
private int _scoreboardTick = 0;
|
private int _scoreboardTick = 0;
|
||||||
@ -220,6 +219,7 @@ public class HubManager extends MiniClientPlugin<HubClient>
|
|||||||
|
|
||||||
new BonusManager(plugin, clientManager, donationManager, pollManager , npcManager, hologramManager, statsManager, _inventoryManager, petManager);
|
new BonusManager(plugin, clientManager, donationManager, pollManager , npcManager, hologramManager, statsManager, _inventoryManager, petManager);
|
||||||
|
|
||||||
|
// _halloweenManager = new HalloweenSpookinessManager(this);
|
||||||
|
|
||||||
// NotificationManager notificationManager = new NotificationManager(plugin, clientManager, donationManager);
|
// NotificationManager notificationManager = new NotificationManager(plugin, clientManager, donationManager);
|
||||||
// new MailManager(_plugin, notificationManager);
|
// new MailManager(_plugin, notificationManager);
|
||||||
@ -843,6 +843,11 @@ public class HubManager extends MiniClientPlugin<HubClient>
|
|||||||
return _visibilityManager;
|
return _visibilityManager;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// public HalloweenSpookinessManager getHalloweenManager()
|
||||||
|
// {
|
||||||
|
// return _halloweenManager;
|
||||||
|
// }
|
||||||
|
|
||||||
@EventHandler(priority = EventPriority.MONITOR)
|
@EventHandler(priority = EventPriority.MONITOR)
|
||||||
public void gadgetCollide(GadgetCollideEntityEvent event)
|
public void gadgetCollide(GadgetCollideEntityEvent event)
|
||||||
{
|
{
|
||||||
|
@ -0,0 +1,233 @@
|
|||||||
|
package mineplex.hub.modules;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashSet;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
|
import mineplex.core.MiniPlugin;
|
||||||
|
import mineplex.core.common.util.UtilAlg;
|
||||||
|
import mineplex.core.common.util.UtilEnt;
|
||||||
|
import mineplex.core.common.util.UtilMath;
|
||||||
|
import mineplex.core.common.util.UtilPlayer;
|
||||||
|
import mineplex.core.common.util.UtilServer;
|
||||||
|
import mineplex.core.common.util.UtilTime;
|
||||||
|
import mineplex.core.disguise.disguises.DisguiseArmorStand;
|
||||||
|
import mineplex.core.itemstack.ItemBuilder;
|
||||||
|
import mineplex.core.itemstack.ItemStackFactory;
|
||||||
|
import mineplex.core.updater.UpdateType;
|
||||||
|
import mineplex.core.updater.event.UpdateEvent;
|
||||||
|
import mineplex.hub.HubManager;
|
||||||
|
import mineplex.hub.HubType;
|
||||||
|
|
||||||
|
import org.bukkit.Color;
|
||||||
|
import org.bukkit.Location;
|
||||||
|
import org.bukkit.Material;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.entity.Skeleton;
|
||||||
|
import org.bukkit.event.EventHandler;
|
||||||
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
|
public class HalloweenSpookinessManager extends MiniPlugin
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* This class doesn't work (yet.) I haven't had time to debug it due to the halloween update
|
||||||
|
* releasing in.. one hour..?
|
||||||
|
* Maybe release later this week or in future halloweens.
|
||||||
|
* @author Mysticate
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
protected class CreepyDudeData
|
||||||
|
{
|
||||||
|
public final Location Location;
|
||||||
|
public final Skeleton Skeleton;
|
||||||
|
public final DisguiseArmorStand Disguise;
|
||||||
|
|
||||||
|
public CreepyDudeData(Location loc, Skeleton skel, DisguiseArmorStand stand)
|
||||||
|
{
|
||||||
|
Location = loc;
|
||||||
|
Skeleton = skel;
|
||||||
|
Disguise = stand;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void resetStare()
|
||||||
|
{
|
||||||
|
Disguise.setHeadPosition(new Vector(UtilAlg.GetPitch(Location.getDirection()), UtilAlg.GetYaw(Location.getDirection()), 0));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private HubManager _manager;
|
||||||
|
private final boolean _enabled;
|
||||||
|
|
||||||
|
private Set<CreepyDudeData> _creepyDudes = new HashSet<CreepyDudeData>();
|
||||||
|
|
||||||
|
private Player _target;
|
||||||
|
private long _targetTime = System.currentTimeMillis();
|
||||||
|
private long _lastTarget = System.currentTimeMillis();
|
||||||
|
|
||||||
|
public HalloweenSpookinessManager(HubManager manager)
|
||||||
|
{
|
||||||
|
super("Halloween Manager", manager.getPlugin());
|
||||||
|
|
||||||
|
_manager = manager;
|
||||||
|
_enabled = manager.Type == HubType.Halloween;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void enable()
|
||||||
|
{
|
||||||
|
if (!_enabled)
|
||||||
|
return;
|
||||||
|
|
||||||
|
Location creepyDudeLoc = new Location(_manager.GetSpawn().getWorld(), 9.5, 72.0, -8.5, 70, 46);
|
||||||
|
Location creepyLittleDude1Loc = new Location(_manager.GetSpawn().getWorld(), 10.25, 72.0, -7.75, 70, 46);
|
||||||
|
Location creepyLittleDude2Loc = new Location(_manager.GetSpawn().getWorld(), 8.75, 72.0, -9.25, 70, 46);
|
||||||
|
|
||||||
|
Skeleton creepyDude = spawnCreepyDude(creepyDudeLoc);
|
||||||
|
Skeleton creepyLittleDude1 = spawnCreepyDude(creepyLittleDude1Loc);
|
||||||
|
Skeleton creepyLittleDude2 = spawnCreepyDude(creepyLittleDude2Loc);
|
||||||
|
|
||||||
|
DisguiseArmorStand creepyDudeDisguise = disguiseCreepyDude(creepyDude, creepyDudeLoc, false);
|
||||||
|
DisguiseArmorStand creepyLittleDude1Disguise = disguiseCreepyDude(creepyLittleDude1, creepyLittleDude1Loc, true);
|
||||||
|
DisguiseArmorStand creepyLittleDude2Disguise = disguiseCreepyDude(creepyLittleDude2, creepyLittleDude2Loc, true);
|
||||||
|
|
||||||
|
_creepyDudes.add(new CreepyDudeData(creepyDudeLoc, creepyDude, creepyDudeDisguise));
|
||||||
|
_creepyDudes.add(new CreepyDudeData(creepyLittleDude1Loc, creepyLittleDude1, creepyLittleDude1Disguise));
|
||||||
|
_creepyDudes.add(new CreepyDudeData(creepyLittleDude2Loc, creepyLittleDude2, creepyLittleDude2Disguise));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void disable()
|
||||||
|
{
|
||||||
|
if (!_enabled)
|
||||||
|
return;
|
||||||
|
|
||||||
|
for (CreepyDudeData data : _creepyDudes)
|
||||||
|
{
|
||||||
|
data.Skeleton.remove();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private Skeleton spawnCreepyDude(Location loc)
|
||||||
|
{
|
||||||
|
Skeleton skeleton = loc.getWorld().spawn(loc, Skeleton.class);
|
||||||
|
|
||||||
|
UtilEnt.silence(skeleton, true);
|
||||||
|
UtilEnt.Vegetate(skeleton);
|
||||||
|
UtilEnt.ghost(skeleton, true, false);
|
||||||
|
|
||||||
|
skeleton.getEquipment().setItemInHand(ItemStackFactory.Instance.CreateStack(0));
|
||||||
|
skeleton.getEquipment().setHelmet(ItemStackFactory.Instance.CreateStack(Material.SKULL_ITEM));
|
||||||
|
skeleton.getEquipment().setChestplate(new ItemBuilder(Material.LEATHER_CHESTPLATE).setUnbreakable(true).setColor(Color.BLACK).build());
|
||||||
|
skeleton.getEquipment().setLeggings(new ItemBuilder(Material.LEATHER_LEGGINGS).setUnbreakable(true).setColor(Color.BLACK).build());
|
||||||
|
skeleton.getEquipment().setHelmet(new ItemBuilder(Material.LEATHER_BOOTS).setUnbreakable(true).setColor(Color.BLACK).build());
|
||||||
|
|
||||||
|
return skeleton;
|
||||||
|
}
|
||||||
|
|
||||||
|
private DisguiseArmorStand disguiseCreepyDude(Skeleton creepyDude, Location loc, boolean small)
|
||||||
|
{
|
||||||
|
DisguiseArmorStand disguise = new DisguiseArmorStand(creepyDude);
|
||||||
|
disguise.setHeadPosition(new Vector(UtilAlg.GetPitch(loc.getDirection()), UtilAlg.GetYaw(loc.getDirection()), 0));
|
||||||
|
|
||||||
|
disguise.setCustomNameVisible(false);
|
||||||
|
disguise.setInvisible(true);
|
||||||
|
disguise.setRemoveBase();
|
||||||
|
|
||||||
|
if (small)
|
||||||
|
disguise.setSmall();
|
||||||
|
|
||||||
|
_manager.GetDisguise().disguise(disguise);
|
||||||
|
return disguise;
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void creepSmallChildOut(UpdateEvent event)
|
||||||
|
{
|
||||||
|
if (!_enabled)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (event.getType() != UpdateType.TICK)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (_target == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
//Follow for 2 seconds
|
||||||
|
if (!_target.isOnline() || _manager.getPreferences().Get(_target).Invisibility || UtilTime.elapsed(_targetTime, 2000))
|
||||||
|
{
|
||||||
|
resetFollowing();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (CreepyDudeData data : _creepyDudes)
|
||||||
|
{
|
||||||
|
Vector vec = UtilAlg.getTrajectory(data.Skeleton.getEyeLocation(), _target.getEyeLocation());
|
||||||
|
data.Disguise.setHeadPosition(new Vector(UtilAlg.GetPitch(vec), UtilAlg.GetYaw(vec), 0));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void targetSmallChild(UpdateEvent event)
|
||||||
|
{
|
||||||
|
if (!_enabled)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (event.getType() != UpdateType.FAST)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (_target != null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (!UtilTime.elapsed(_lastTarget, 1000 * 60 + UtilMath.r(30) * 1000))
|
||||||
|
return;
|
||||||
|
|
||||||
|
Player target = findTarget();
|
||||||
|
if (target == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
_target = target;
|
||||||
|
_targetTime = System.currentTimeMillis();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void resetFollowing()
|
||||||
|
{
|
||||||
|
_target = null;
|
||||||
|
_lastTarget = System.currentTimeMillis();
|
||||||
|
|
||||||
|
for (CreepyDudeData data : _creepyDudes)
|
||||||
|
{
|
||||||
|
data.resetStare();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private Player findTarget()
|
||||||
|
{
|
||||||
|
ArrayList<Location> dudeLocations = new ArrayList<Location>();
|
||||||
|
for (CreepyDudeData data : _creepyDudes)
|
||||||
|
{
|
||||||
|
dudeLocations.add(data.Location);
|
||||||
|
}
|
||||||
|
|
||||||
|
Location average = UtilAlg.getAverageLocation(dudeLocations);
|
||||||
|
ArrayList<Player> best = new ArrayList<Player>();
|
||||||
|
|
||||||
|
for (Player player : UtilServer.getPlayers())
|
||||||
|
{
|
||||||
|
if (!UtilPlayer.is1_8(player))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (_manager.getPreferences().Get(player).Invisibility)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (UtilMath.offset(player.getLocation(), average) <= 7)
|
||||||
|
best.add(player);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (best.isEmpty())
|
||||||
|
return null;
|
||||||
|
|
||||||
|
return UtilAlg.Random(best);
|
||||||
|
}
|
||||||
|
}
|
@ -40,6 +40,11 @@ public class JumpManager extends MiniPlugin
|
|||||||
if (player.getGameMode() == GameMode.CREATIVE)
|
if (player.getGameMode() == GameMode.CREATIVE)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (Manager.getPreferences().Get(player).Invisibility)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
//Chicken Cancel
|
//Chicken Cancel
|
||||||
DisguiseBase disguise = Manager.GetDisguise().getDisguise(player);
|
DisguiseBase disguise = Manager.GetDisguise().getDisguise(player);
|
||||||
if (disguise != null &&
|
if (disguise != null &&
|
||||||
@ -70,6 +75,12 @@ public class JumpManager extends MiniPlugin
|
|||||||
if (player.getGameMode() == GameMode.CREATIVE)
|
if (player.getGameMode() == GameMode.CREATIVE)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
if (Manager.getPreferences().Get(player).Invisibility)
|
||||||
|
{
|
||||||
|
player.setAllowFlight(true);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if (Manager.GetParkour().isParkourMode(player))
|
if (Manager.GetParkour().isParkourMode(player))
|
||||||
{
|
{
|
||||||
player.setAllowFlight(false);
|
player.setAllowFlight(false);
|
||||||
|
@ -3,14 +3,6 @@ package mineplex.hub.modules;
|
|||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
|
||||||
import org.bukkit.ChatColor;
|
|
||||||
import org.bukkit.entity.Creature;
|
|
||||||
import org.bukkit.entity.Player;
|
|
||||||
import org.bukkit.entity.Wither;
|
|
||||||
import org.bukkit.event.EventHandler;
|
|
||||||
import org.bukkit.event.player.PlayerJoinEvent;
|
|
||||||
|
|
||||||
import mineplex.core.MiniPlugin;
|
import mineplex.core.MiniPlugin;
|
||||||
import mineplex.core.common.Rank;
|
import mineplex.core.common.Rank;
|
||||||
import mineplex.core.common.util.C;
|
import mineplex.core.common.util.C;
|
||||||
@ -18,9 +10,9 @@ import mineplex.core.common.util.Callback;
|
|||||||
import mineplex.core.common.util.F;
|
import mineplex.core.common.util.F;
|
||||||
import mineplex.core.common.util.UtilPlayer;
|
import mineplex.core.common.util.UtilPlayer;
|
||||||
import mineplex.core.common.util.UtilServer;
|
import mineplex.core.common.util.UtilServer;
|
||||||
|
import mineplex.core.common.util.UtilTextMiddle;
|
||||||
import mineplex.core.common.util.UtilTextTop;
|
import mineplex.core.common.util.UtilTextTop;
|
||||||
import mineplex.core.common.util.UtilTime;
|
import mineplex.core.common.util.UtilTime;
|
||||||
import mineplex.core.common.util.UtilTextMiddle;
|
|
||||||
import mineplex.core.gadget.gadgets.MorphWither;
|
import mineplex.core.gadget.gadgets.MorphWither;
|
||||||
import mineplex.core.gadget.types.Gadget;
|
import mineplex.core.gadget.types.Gadget;
|
||||||
import mineplex.core.gadget.types.GadgetType;
|
import mineplex.core.gadget.types.GadgetType;
|
||||||
@ -30,6 +22,15 @@ import mineplex.core.updater.UpdateType;
|
|||||||
import mineplex.core.updater.event.UpdateEvent;
|
import mineplex.core.updater.event.UpdateEvent;
|
||||||
import mineplex.hub.HubManager;
|
import mineplex.hub.HubManager;
|
||||||
import mineplex.hub.HubRepository;
|
import mineplex.hub.HubRepository;
|
||||||
|
import mineplex.hub.HubType;
|
||||||
|
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
|
import org.bukkit.ChatColor;
|
||||||
|
import org.bukkit.entity.Creature;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.entity.Wither;
|
||||||
|
import org.bukkit.event.EventHandler;
|
||||||
|
import org.bukkit.event.player.PlayerJoinEvent;
|
||||||
|
|
||||||
public class NewsManager extends MiniPlugin
|
public class NewsManager extends MiniPlugin
|
||||||
{
|
{
|
||||||
@ -39,7 +40,7 @@ public class NewsManager extends MiniPlugin
|
|||||||
private int _newsIndex = 0;
|
private int _newsIndex = 0;
|
||||||
private long _newsTime = System.currentTimeMillis();
|
private long _newsTime = System.currentTimeMillis();
|
||||||
|
|
||||||
private int _mineplexIndex = 0;
|
private int _animationIndex = 0;
|
||||||
|
|
||||||
private HubRepository _repository = new HubRepository();
|
private HubRepository _repository = new HubRepository();
|
||||||
|
|
||||||
@ -228,13 +229,149 @@ public class NewsManager extends MiniPlugin
|
|||||||
RefreshNews();
|
RefreshNews();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void joinNewsOverlay(final PlayerJoinEvent event)
|
||||||
|
{
|
||||||
|
for (int i=0 ; i<_news.length ; i++)
|
||||||
|
{
|
||||||
|
final int count = i;
|
||||||
|
|
||||||
|
UtilServer.getServer().getScheduler().runTaskLater(Manager.getPlugin(), new Runnable()
|
||||||
|
{
|
||||||
|
@Override
|
||||||
|
public void run()
|
||||||
|
{
|
||||||
|
UtilTextMiddle.display(C.cGold + C.Bold + "MINEPLEX" + ChatColor.RESET, _news[_news.length - 1 - count] + ChatColor.RESET, (count == 0) ? 20 : 0, 60, 20, event.getPlayer());
|
||||||
|
}
|
||||||
|
}, 60 * i + (i != 0 ? 20 : 0));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void DragonBarUpdate(UpdateEvent event)
|
public void DragonBarUpdate(UpdateEvent event)
|
||||||
{
|
{
|
||||||
if (event.getType() != UpdateType.FASTEST)
|
if (event.getType() != UpdateType.FASTEST)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
_mineplexIndex = (_mineplexIndex + 1)%6;
|
String text = "";
|
||||||
|
double healthPercent = 1;
|
||||||
|
|
||||||
|
if (Manager.Type == HubType.Halloween)
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* @author Mysticate
|
||||||
|
* Myst's sexy ass animation :>
|
||||||
|
*/
|
||||||
|
|
||||||
|
_animationIndex = (_animationIndex + 1) % 147;
|
||||||
|
|
||||||
|
if (_animationIndex == 0) text = C.cGoldB + " ";
|
||||||
|
if (_animationIndex == 1) text = C.cGoldB + " H";
|
||||||
|
if (_animationIndex == 2) text = C.cGoldB + " HA";
|
||||||
|
if (_animationIndex == 3) text = C.cGoldB + " HAP";
|
||||||
|
if (_animationIndex == 4) text = C.cGoldB + " HAPP";
|
||||||
|
if (_animationIndex == 5) text = C.cGoldB + " HAPPY";
|
||||||
|
if (_animationIndex == 6) text = C.cGoldB + " HAPPY ";
|
||||||
|
if (_animationIndex == 7) text = C.cGoldB + " HAPPY H";
|
||||||
|
if (_animationIndex == 8) text = C.cGoldB + " HAPPY HA";
|
||||||
|
if (_animationIndex == 9) text = C.cGoldB + " HAPPY HAL";
|
||||||
|
if (_animationIndex == 10) text = C.cGoldB + " HAPPY HALL";
|
||||||
|
if (_animationIndex == 11) text = C.cGoldB + " HAPPY HALLO";
|
||||||
|
if (_animationIndex == 12) text = C.cGoldB + " HAPPY HALLOW";
|
||||||
|
if (_animationIndex == 13) text = C.cGoldB + " HAPPY HALLOWE";
|
||||||
|
if (_animationIndex == 14) text = C.cGoldB + " HAPPY HALLOWEE";
|
||||||
|
if (_animationIndex == 15) text = C.cGoldB + " HAPPY HALLOWEEN";
|
||||||
|
if (_animationIndex == 16) text = C.cGoldB + " HAPPY HALLOWEEN ";
|
||||||
|
if (_animationIndex == 17) text = C.cGoldB + " HAPPY HALLOWEEN ";
|
||||||
|
if (_animationIndex == 18) text = C.cGoldB + " HAPPY HALLOWEEN ";
|
||||||
|
if (_animationIndex == 19) text = C.cGoldB + " HAPPY HALLOWEEN ";
|
||||||
|
if (_animationIndex == 20) text = C.cGoldB + " HAPPY HALLOWEEN ";
|
||||||
|
if (_animationIndex == 20) text = C.cGoldB + " HAPPY HALLOWEEN ";
|
||||||
|
if (_animationIndex == 21 || _animationIndex == 22) text = C.cGoldB + " HAPPY HALLOWEEN ";
|
||||||
|
|
||||||
|
if (_animationIndex > 22 && _animationIndex <= 42)
|
||||||
|
{
|
||||||
|
if (_animationIndex % 3 == 0) text = C.cWhiteB + "2015" + C.cGoldB + " HAPPY HALLOWEEN " + C.cWhiteB + "2015";
|
||||||
|
else if (_animationIndex % 3 == 1) text = C.cWhiteB + "2015" + C.cRedB + " HAPPY HALLOWEEN " + C.cWhiteB + "2015";
|
||||||
|
else text = C.cWhiteB + "2015" + C.cYellowB + " HAPPY HALLOWEEN " + C.cWhiteB + "2015";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_animationIndex == 43 || _animationIndex == 44) text = C.cGoldB + " HAPPY HALLOWEEN ";
|
||||||
|
if (_animationIndex == 45) text = C.cGoldB + " HAPPY HALLOWEEN ";
|
||||||
|
if (_animationIndex == 46) text = C.cGoldB + " HAPPY HALLOWEEN ";
|
||||||
|
if (_animationIndex == 47) text = C.cGoldB + " HAPPY HALLOWEEN ";
|
||||||
|
if (_animationIndex == 48) text = C.cGoldB + " HAPPY HALLOWEEN ";
|
||||||
|
if (_animationIndex == 49) text = C.cGoldB + " HAPPY HALLOWEEN ";
|
||||||
|
if (_animationIndex == 50) text = C.cGoldB + " HAPPY HALLOWEEN ";
|
||||||
|
if (_animationIndex == 51) text = C.cGoldB + "HAPPY HALLOWEEN ";
|
||||||
|
if (_animationIndex == 52) text = C.cGoldB + "APPY HALLOWEEN ";
|
||||||
|
if (_animationIndex == 53) text = C.cGoldB + "PPY HALLOWEEN ";
|
||||||
|
if (_animationIndex == 54) text = C.cGoldB + "PY HALLOWEEN ";
|
||||||
|
if (_animationIndex == 55) text = C.cGoldB + "Y HALLOWEEN ";
|
||||||
|
if (_animationIndex == 56) text = C.cGoldB + " HALLOWEEN ";
|
||||||
|
if (_animationIndex == 57) text = C.cGoldB + "HALLOWEEN ";
|
||||||
|
if (_animationIndex == 58) text = C.cGoldB + "ALLOWEEN ";
|
||||||
|
if (_animationIndex == 59) text = C.cGoldB + "LLOWEEN ";
|
||||||
|
if (_animationIndex == 60) text = C.cGoldB + "LOWEEN ";
|
||||||
|
if (_animationIndex == 61) text = C.cGoldB + "OWEEN ";
|
||||||
|
if (_animationIndex == 62) text = C.cGoldB + "WEEN ";
|
||||||
|
if (_animationIndex == 63) text = C.cGoldB + "EEN ";
|
||||||
|
if (_animationIndex == 64) text = C.cGoldB + "EN ";
|
||||||
|
if (_animationIndex == 65) text = C.cGoldB + "N ";
|
||||||
|
if (_animationIndex == 66) text = C.cGoldB + " ";
|
||||||
|
|
||||||
|
if (_animationIndex == 66) text = C.cGoldB + " S";
|
||||||
|
if (_animationIndex == 67) text = C.cGoldB + " SP";
|
||||||
|
if (_animationIndex == 68) text = C.cGoldB + " SPO";
|
||||||
|
if (_animationIndex == 69) text = C.cGoldB + " SPOO";
|
||||||
|
if (_animationIndex == 70) text = C.cGoldB + " SPOOK";
|
||||||
|
if (_animationIndex == 71) text = C.cGoldB + " SPOOKY";
|
||||||
|
if (_animationIndex == 72) text = C.cGoldB + " SPOOKY ";
|
||||||
|
if (_animationIndex == 73) text = C.cGoldB + " SPOOKY S";
|
||||||
|
if (_animationIndex == 74) text = C.cGoldB + " SPOOKY SA";
|
||||||
|
if (_animationIndex == 75) text = C.cGoldB + " SPOOKY SAL";
|
||||||
|
if (_animationIndex == 76) text = C.cGoldB + " SPOOKY SALE";
|
||||||
|
if (_animationIndex == 77) text = C.cGoldB + " SPOOKY SALE ";
|
||||||
|
if (_animationIndex == 78) text = C.cGoldB + " SPOOKY SALE ";
|
||||||
|
if (_animationIndex == 79) text = C.cGoldB + " SPOOKY SALE ";
|
||||||
|
if (_animationIndex == 80) text = C.cGoldB + " SPOOKY SALE ";
|
||||||
|
if (_animationIndex == 81) text = C.cGoldB + " SPOOKY SALE ";
|
||||||
|
if (_animationIndex == 82) text = C.cGoldB + " SPOOKY SALE ";
|
||||||
|
if (_animationIndex == 83) text = C.cGoldB + " SPOOKY SALE ";
|
||||||
|
if (_animationIndex == 84 || _animationIndex == 85) text = C.cGoldB + " SPOOKY SALE ";
|
||||||
|
|
||||||
|
if (_animationIndex > 84 && _animationIndex <= 124)
|
||||||
|
{
|
||||||
|
if (_animationIndex % 2 == 0) text = C.cWhiteB + "50% OFF" + C.cGoldB + " SPOOKY SALE " + C.cWhiteB + "50% OFF";
|
||||||
|
else if (_animationIndex % 2 == 1) text = C.cWhiteB + "50% OFF" + C.cRedB + " SPOOKY SALE " + C.cWhiteB + "50% OFF";
|
||||||
|
else text = C.cWhiteB + "50% OFF" + C.cYellowB + " SPOOKY SALE " + C.cWhiteB + "50% OFF";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_animationIndex == 125 || _animationIndex == 126) text = C.cGoldB + " SPOOKY SALE ";
|
||||||
|
if (_animationIndex == 127) text = C.cGoldB + " SPOOKY SALE ";
|
||||||
|
if (_animationIndex == 128) text = C.cGoldB + " SPOOKY SALE ";
|
||||||
|
if (_animationIndex == 129) text = C.cGoldB + " SPOOKY SALE ";
|
||||||
|
if (_animationIndex == 130) text = C.cGoldB + " SPOOKY SALE ";
|
||||||
|
if (_animationIndex == 131) text = C.cGoldB + " SPOOKY SALE ";
|
||||||
|
if (_animationIndex == 132) text = C.cGoldB + " SPOOKY SALE ";
|
||||||
|
if (_animationIndex == 133) text = C.cGoldB + " SPOOKY SALE ";
|
||||||
|
if (_animationIndex == 134) text = C.cGoldB + " SPOOKY SALE ";
|
||||||
|
if (_animationIndex == 135) text = C.cGoldB + "SPOOKY SALE ";
|
||||||
|
if (_animationIndex == 136) text = C.cGoldB + "POOKY SALE ";
|
||||||
|
if (_animationIndex == 137) text = C.cGoldB + "OOKY SALE ";
|
||||||
|
if (_animationIndex == 138) text = C.cGoldB + "OKY SALE ";
|
||||||
|
if (_animationIndex == 139) text = C.cGoldB + "KY SALE ";
|
||||||
|
if (_animationIndex == 140) text = C.cGoldB + "Y SALE ";
|
||||||
|
if (_animationIndex == 141) text = C.cGoldB + " SALE ";
|
||||||
|
if (_animationIndex == 142) text = C.cGoldB + "SALE ";
|
||||||
|
if (_animationIndex == 143) text = C.cGoldB + "ALE ";
|
||||||
|
if (_animationIndex == 144) text = C.cGoldB + "LE ";
|
||||||
|
if (_animationIndex == 145) text = C.cGoldB + "E ";
|
||||||
|
if (_animationIndex == 146) text = C.cGoldB + " ";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
//News Change
|
//News Change
|
||||||
if (UtilTime.elapsed(_newsTime, 4500))
|
if (UtilTime.elapsed(_newsTime, 4500))
|
||||||
@ -248,10 +385,13 @@ public class NewsManager extends MiniPlugin
|
|||||||
_newsIndex = 0;
|
_newsIndex = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
double healthPercent = (double)_newsIndex/(double)(_news.length-1);
|
healthPercent = (double)_newsIndex/(double)(_news.length-1);
|
||||||
String text = _news[_newsIndex];
|
text = _news[_newsIndex];
|
||||||
|
}
|
||||||
|
|
||||||
UtilTextTop.display(text, UtilServer.getPlayers());
|
UtilTextTop.display(text, UtilServer.getPlayers());
|
||||||
|
|
||||||
|
//Fix Entity Names
|
||||||
for (Creature pet : Manager.getPetManager().getPets())
|
for (Creature pet : Manager.getPetManager().getPets())
|
||||||
{
|
{
|
||||||
if (pet instanceof Wither)
|
if (pet instanceof Wither)
|
||||||
@ -277,22 +417,4 @@ public class NewsManager extends MiniPlugin
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
|
||||||
public void joinNewsOverlay(final PlayerJoinEvent event)
|
|
||||||
{
|
|
||||||
for (int i=0 ; i<_news.length ; i++)
|
|
||||||
{
|
|
||||||
final int count = i;
|
|
||||||
|
|
||||||
UtilServer.getServer().getScheduler().runTaskLater(Manager.getPlugin(), new Runnable()
|
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public void run()
|
|
||||||
{
|
|
||||||
UtilTextMiddle.display(C.cGold + C.Bold + "MINEPLEX" + ChatColor.RESET, _news[_news.length - 1 - count] + ChatColor.RESET, (count == 0) ? 20 : 0, 60, 20, event.getPlayer());
|
|
||||||
}
|
|
||||||
}, 60 * i + (i != 0 ? 20 : 0));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
@ -30,32 +30,6 @@ public class QueueRepository
|
|||||||
|
|
||||||
public void initialize()
|
public void initialize()
|
||||||
{
|
{
|
||||||
PreparedStatement preparedStatement = null;
|
|
||||||
|
|
||||||
try (Connection connection = DBPool.QUEUE.getConnection())
|
|
||||||
{
|
|
||||||
// Create table
|
|
||||||
preparedStatement = connection.prepareStatement(CREATE_ELO_QUEUE_TABLE);
|
|
||||||
preparedStatement.execute();
|
|
||||||
}
|
|
||||||
catch (Exception exception)
|
|
||||||
{
|
|
||||||
exception.printStackTrace();
|
|
||||||
}
|
|
||||||
finally
|
|
||||||
{
|
|
||||||
if (preparedStatement != null)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
preparedStatement.close();
|
|
||||||
}
|
|
||||||
catch (SQLException e)
|
|
||||||
{
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void deleteQueueRecord(PlayerMatchStatus matchStatus)
|
public void deleteQueueRecord(PlayerMatchStatus matchStatus)
|
||||||
|
@ -61,7 +61,7 @@ public class ServerGameMenu extends ShopPageBase<ServerManager, QuickShop>
|
|||||||
ChatColor.RESET + "Join " + ChatColor.GREEN + getPlugin().getGroupTagPlayerCount("BR") + ChatColor.RESET + " other players!",
|
ChatColor.RESET + "Join " + ChatColor.GREEN + getPlugin().getGroupTagPlayerCount("BR") + ChatColor.RESET + " other players!",
|
||||||
}));
|
}));
|
||||||
|
|
||||||
setItem(2, ItemStackFactory.Instance.CreateStack(Material.IRON_SWORD.getId(), (byte)0, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Survival Games " + C.cGray + "Solo/Team Survival", new String[]
|
setItem(2, ItemStackFactory.Instance.CreateStack(Material.DIAMOND_SWORD.getId(), (byte)0, 1, ChatColor.RESET + C.Bold + ChatColor.YELLOW + "Survival Games " + C.cGray + "Solo/Team Survival", new String[]
|
||||||
{
|
{
|
||||||
ChatColor.RESET + "",
|
ChatColor.RESET + "",
|
||||||
ChatColor.RESET + "Search for chests to find loot and ",
|
ChatColor.RESET + "Search for chests to find loot and ",
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
package mineplex.mapparser;
|
package mineplex.mapparser;
|
||||||
|
|
||||||
|
import java.io.BufferedWriter;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
import java.io.FileWriter;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
@ -29,6 +31,7 @@ import org.bukkit.event.block.BlockIgniteEvent;
|
|||||||
import org.bukkit.event.block.BlockIgniteEvent.IgniteCause;
|
import org.bukkit.event.block.BlockIgniteEvent.IgniteCause;
|
||||||
import org.bukkit.event.block.BlockSpreadEvent;
|
import org.bukkit.event.block.BlockSpreadEvent;
|
||||||
import org.bukkit.event.block.LeavesDecayEvent;
|
import org.bukkit.event.block.LeavesDecayEvent;
|
||||||
|
import org.bukkit.event.block.SignChangeEvent;
|
||||||
import org.bukkit.event.entity.EntitySpawnEvent;
|
import org.bukkit.event.entity.EntitySpawnEvent;
|
||||||
import org.bukkit.event.player.AsyncPlayerChatEvent;
|
import org.bukkit.event.player.AsyncPlayerChatEvent;
|
||||||
import org.bukkit.event.player.PlayerCommandPreprocessEvent;
|
import org.bukkit.event.player.PlayerCommandPreprocessEvent;
|
||||||
@ -50,6 +53,8 @@ import mineplex.core.common.util.UtilEvent.ActionType;
|
|||||||
import mineplex.core.common.util.UtilGear;
|
import mineplex.core.common.util.UtilGear;
|
||||||
import mineplex.core.common.util.UtilPlayer;
|
import mineplex.core.common.util.UtilPlayer;
|
||||||
import mineplex.core.common.util.UtilServer;
|
import mineplex.core.common.util.UtilServer;
|
||||||
|
import mineplex.core.common.util.UtilTime;
|
||||||
|
import mineplex.core.common.util.UtilWorld;
|
||||||
import mineplex.mapparser.command.*;
|
import mineplex.mapparser.command.*;
|
||||||
|
|
||||||
public class MapParser extends JavaPlugin implements Listener
|
public class MapParser extends JavaPlugin implements Listener
|
||||||
@ -466,13 +471,13 @@ public class MapParser extends JavaPlugin implements Listener
|
|||||||
|
|
||||||
public void ResetInventory(Player player)
|
public void ResetInventory(Player player)
|
||||||
{
|
{
|
||||||
// UtilInv.Clear(player);
|
// UtilInv.Clear(player);
|
||||||
//
|
//
|
||||||
// player.getInventory().addItem(new ItemStack(Material.STONE_SWORD));
|
// player.getInventory().addItem(new ItemStack(Material.STONE_SWORD));
|
||||||
// player.getInventory().addItem(new ItemStack(Material.STONE_SPADE));
|
// player.getInventory().addItem(new ItemStack(Material.STONE_SPADE));
|
||||||
// player.getInventory().addItem(new ItemStack(Material.STONE_PICKAXE));
|
// player.getInventory().addItem(new ItemStack(Material.STONE_PICKAXE));
|
||||||
// player.getInventory().addItem(new ItemStack(Material.STONE_AXE));
|
// player.getInventory().addItem(new ItemStack(Material.STONE_AXE));
|
||||||
// player.getInventory().addItem(new ItemStack(Material.WOOD_AXE));
|
// player.getInventory().addItem(new ItemStack(Material.WOOD_AXE));
|
||||||
}
|
}
|
||||||
|
|
||||||
public WorldManager getWorldManager()
|
public WorldManager getWorldManager()
|
||||||
@ -746,4 +751,35 @@ public class MapParser extends JavaPlugin implements Listener
|
|||||||
|
|
||||||
event.getPlayer().setVelocity(vel);
|
event.getPlayer().setVelocity(vel);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void signChangeLog(SignChangeEvent event)
|
||||||
|
{
|
||||||
|
if (GetData(event.getPlayer().getWorld().getName()).HasAccess(event.getPlayer()))
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
File file = new File(event.getPlayer().getWorld().getName() + "/" + "sign_log.txt");
|
||||||
|
|
||||||
|
if (!file.exists())
|
||||||
|
file.createNewFile();
|
||||||
|
|
||||||
|
FileWriter fw = new FileWriter(file.getAbsoluteFile(), true);
|
||||||
|
BufferedWriter bw = new BufferedWriter(fw);
|
||||||
|
|
||||||
|
bw.write("\n\n");
|
||||||
|
bw.write("\n" + "Date: " + UtilTime.now());
|
||||||
|
bw.write("\n" + "Player: " + event.getPlayer().getName());
|
||||||
|
bw.write("\n" + "Location: " + UtilWorld.locToStrClean(event.getBlock().getLocation()));
|
||||||
|
for (int i=0 ; i<event.getLines().length ; i++)
|
||||||
|
bw.write("\n" + "Line " + i + ": " + event.getLines()[i]);
|
||||||
|
|
||||||
|
bw.close();
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -403,7 +403,7 @@ public class SkillPage extends ShopPageBase<ClassShopManager, ClassCombatShop>
|
|||||||
|
|
||||||
private boolean isSkillLocked(ISkill skill)
|
private boolean isSkillLocked(ISkill skill)
|
||||||
{
|
{
|
||||||
if (skill.IsFree() || getClientManager().Get(getPlayer().getName()).GetRank().has(Rank.ULTRA) || getDonationManager().Get(getPlayer().getName()).OwnsUnknownPackage("Champions ULTRA") || getDonationManager().Get(getPlayer().getName()).OwnsUnknownPackage("Champions " + skill.GetName()))
|
if (skill.IsFree() || getDonationManager().Get(getPlayer().getName()).OwnsUnknownPackage("Champions " + skill.GetName()))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@ -411,7 +411,7 @@ public class SkillPage extends ShopPageBase<ClassShopManager, ClassCombatShop>
|
|||||||
|
|
||||||
private boolean isItemLocked(Item item)
|
private boolean isItemLocked(Item item)
|
||||||
{
|
{
|
||||||
if (item.isFree() || getClientManager().Get(getPlayer().getName()).GetRank().has(Rank.ULTRA) || getDonationManager().Get(getPlayer().getName()).OwnsUnknownPackage("Champions ULTRA") || getDonationManager().Get(getPlayer().getName()).OwnsUnknownPackage("Champions " + item.GetName()))
|
if (item.isFree() || getDonationManager().Get(getPlayer().getName()).OwnsUnknownPackage("Champions " + item.GetName()))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
@ -31,15 +31,13 @@ import mineplex.serverdata.data.ServerGroup;
|
|||||||
import mineplex.serverdata.servers.DedicatedServerSorter;
|
import mineplex.serverdata.servers.DedicatedServerSorter;
|
||||||
import mineplex.serverdata.servers.ServerManager;
|
import mineplex.serverdata.servers.ServerManager;
|
||||||
import mineplex.serverdata.servers.ServerRepository;
|
import mineplex.serverdata.servers.ServerRepository;
|
||||||
import mineplex.serverprocesses.GenericRunnable;
|
|
||||||
import mineplex.serverprocesses.ProcessManager;
|
|
||||||
import mineplex.serverprocesses.ProcessRunner;
|
|
||||||
|
|
||||||
public class ServerMonitor
|
public class ServerMonitor
|
||||||
{
|
{
|
||||||
private static ServerRepository _repository = null;
|
private static ServerRepository _repository = null;
|
||||||
private static StatusHistoryRepository _historyRepository = null;
|
private static StatusHistoryRepository _historyRepository = null;
|
||||||
private static int _count = 0;
|
private static int _count = 0;
|
||||||
|
private static HashSet<ProcessRunner> _processes = new HashSet<ProcessRunner>();
|
||||||
private static HashMap<String, Boolean> _badServers = new HashMap<String, Boolean>();
|
private static HashMap<String, Boolean> _badServers = new HashMap<String, Boolean>();
|
||||||
private static Collection<MinecraftServer> _serverStatuses = null;
|
private static Collection<MinecraftServer> _serverStatuses = null;
|
||||||
private static Collection<ServerGroup> _serverGroups = null;
|
private static Collection<ServerGroup> _serverGroups = null;
|
||||||
@ -60,6 +58,18 @@ public class ServerMonitor
|
|||||||
|
|
||||||
public static void main (String args[])
|
public static void main (String args[])
|
||||||
{
|
{
|
||||||
|
/*
|
||||||
|
MinecraftPingReply data = null;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
data = new MinecraftPing().getPing(new MinecraftPingOptions().setHostname("127.0.0.1").setPort(25565));
|
||||||
|
}
|
||||||
|
catch (IOException e2)
|
||||||
|
{
|
||||||
|
e2.printStackTrace();
|
||||||
|
}
|
||||||
|
System.out.println(data.getDescription() + " " + data.getPlayers().getOnline());
|
||||||
|
*/
|
||||||
_region = !new File("eu.dat").exists() ? Region.US : Region.EU;
|
_region = !new File("eu.dat").exists() ? Region.US : Region.EU;
|
||||||
_debug = new File("debug.dat").exists();
|
_debug = new File("debug.dat").exists();
|
||||||
_repository = ServerManager.getServerRepository(_region); // Fetches and connects to server repo
|
_repository = ServerManager.getServerRepository(_region); // Fetches and connects to server repo
|
||||||
@ -173,12 +183,19 @@ public class ServerMonitor
|
|||||||
|
|
||||||
log("Using " + usedCpuPercent + "% of available CPU (" + availableCPU + " Free) and " + usedRamPercent + "% of available RAM (" + availableRAM / 1000 + "GB Free)");
|
log("Using " + usedCpuPercent + "% of available CPU (" + availableCPU + " Free) and " + usedRamPercent + "% of available RAM (" + availableRAM / 1000 + "GB Free)");
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
_historyRepository.saveDedicatedServerStats(_dedicatedServers);
|
_historyRepository.saveDedicatedServerStats(_dedicatedServers);
|
||||||
log("Saved Dedicated Server Stats.");
|
log("Saved Dedicated Server Stats.");
|
||||||
_historyRepository.saveServerGroupStats((int)totalCPU, (int)totalRAM, _serverGroupMap.values());
|
_historyRepository.saveServerGroupStats((int)totalCPU, (int)totalRAM, _serverGroupMap.values());
|
||||||
log("Saved ServerGroup Stats.");
|
log("Saved ServerGroup Stats.");
|
||||||
_historyRepository.saveNetworkStats(usedCpuPercent, usedRamPercent, availableCPU, availableRAM, _region);
|
_historyRepository.saveNetworkStats(usedCpuPercent, usedRamPercent, availableCPU, availableRAM, _region);
|
||||||
log("Saved Network Stats.");
|
log("Saved Network Stats.");
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
ex.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
if (_count == 0)
|
if (_count == 0)
|
||||||
{
|
{
|
||||||
@ -291,7 +308,64 @@ public class ServerMonitor
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ProcessManager.getInstance().updateProcesses();
|
int processWaits = 0;
|
||||||
|
|
||||||
|
while (_processes.size() > 0)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
for (Iterator<ProcessRunner> iterator = _processes.iterator(); iterator.hasNext();)
|
||||||
|
{
|
||||||
|
ProcessRunner pr = iterator.next();
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
pr.join(100);
|
||||||
|
}
|
||||||
|
catch (InterruptedException e)
|
||||||
|
{
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (pr.isDone())
|
||||||
|
iterator.remove();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
ex.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_processes.size() > 0)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
log("Sleeping while processes run...");
|
||||||
|
Thread.sleep(6000);
|
||||||
|
}
|
||||||
|
catch (InterruptedException e)
|
||||||
|
{
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (processWaits >= 5)
|
||||||
|
{
|
||||||
|
log("Killing stale processes.");
|
||||||
|
|
||||||
|
for (Iterator<ProcessRunner> iterator = _processes.iterator(); iterator.hasNext();)
|
||||||
|
{
|
||||||
|
iterator.next().abort();
|
||||||
|
iterator.remove();
|
||||||
|
}
|
||||||
|
|
||||||
|
_processes.clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
processWaits++;
|
||||||
|
}
|
||||||
|
|
||||||
|
processWaits = 0;
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@ -308,7 +382,7 @@ public class ServerMonitor
|
|||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
log("Error doing something : " + ex.getMessage());
|
log("Error doing something : " + ex.getMessage());
|
||||||
|
ex.printStackTrace();
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Thread.sleep(1000);
|
Thread.sleep(1000);
|
||||||
@ -548,9 +622,7 @@ public class ServerMonitor
|
|||||||
|
|
||||||
|
|
||||||
if (!pr.isDone())
|
if (!pr.isDone())
|
||||||
{
|
_processes.add(pr);
|
||||||
ProcessManager.getInstance().addProcess(pr);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static boolean isServerOffline(DedicatedServer serverData)
|
private static boolean isServerOffline(DedicatedServer serverData)
|
||||||
@ -750,9 +822,7 @@ public class ServerMonitor
|
|||||||
serverSpace.incrementServerCount(serverGroup);
|
serverSpace.incrementServerCount(serverGroup);
|
||||||
|
|
||||||
if (!pr.isDone())
|
if (!pr.isDone())
|
||||||
{
|
_processes.add(pr);
|
||||||
ProcessManager.getInstance().addProcess(pr);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static boolean ignoreServer(String serverGroupName)
|
private static boolean ignoreServer(String serverGroupName)
|
||||||
|
@ -31,7 +31,7 @@ public class PasswordRepository extends RepositoryBase
|
|||||||
@Override
|
@Override
|
||||||
protected void initialize()
|
protected void initialize()
|
||||||
{
|
{
|
||||||
executeUpdate(CREATE_SERVER_PASSWORD_TABLE);
|
//executeUpdate(CREATE_SERVER_PASSWORD_TABLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -40,12 +40,6 @@ public class ItemCommand extends CommandBase<SalesPackageManager>
|
|||||||
final String itemName = tempName;
|
final String itemName = tempName;
|
||||||
final int amount = amountSpecified;
|
final int amount = amountSpecified;
|
||||||
|
|
||||||
if (!Plugin.getInventoryManager().validCategory(category))
|
|
||||||
{
|
|
||||||
caller.sendMessage(F.main(Plugin.getName(), "You have entered an invalid Category."));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!Plugin.getInventoryManager().validItem(itemName))
|
if (!Plugin.getInventoryManager().validItem(itemName))
|
||||||
{
|
{
|
||||||
caller.sendMessage(F.main(Plugin.getName(), "You have entered an invalid Item."));
|
caller.sendMessage(F.main(Plugin.getName(), "You have entered an invalid Item."));
|
||||||
@ -76,7 +70,7 @@ public class ItemCommand extends CommandBase<SalesPackageManager>
|
|||||||
UtilPlayer.message(caller, F.main(Plugin.getName(), "ERROR processing " + playerName + " " + amount + " " + itemName + "."));
|
UtilPlayer.message(caller, F.main(Plugin.getName(), "ERROR processing " + playerName + " " + amount + " " + itemName + "."));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, uuid, category, itemName, amount);
|
}, uuid, itemName, amount);
|
||||||
}
|
}
|
||||||
}, playerName, client.getAccountId(), (amount == 1 ? itemName : itemName + " " + amount), false, 0, false);
|
}, playerName, client.getAccountId(), (amount == 1 ? itemName : itemName + " " + amount), false, 0, false);
|
||||||
}
|
}
|
||||||
|
@ -26,6 +26,7 @@ import org.bukkit.event.block.BlockFadeEvent;
|
|||||||
import org.bukkit.event.block.BlockSpreadEvent;
|
import org.bukkit.event.block.BlockSpreadEvent;
|
||||||
import org.bukkit.event.block.LeavesDecayEvent;
|
import org.bukkit.event.block.LeavesDecayEvent;
|
||||||
import org.bukkit.event.entity.CreatureSpawnEvent;
|
import org.bukkit.event.entity.CreatureSpawnEvent;
|
||||||
|
import org.bukkit.event.entity.EntityExplodeEvent;
|
||||||
import org.bukkit.event.inventory.InventoryType;
|
import org.bukkit.event.inventory.InventoryType;
|
||||||
import org.bukkit.event.player.PlayerCommandPreprocessEvent;
|
import org.bukkit.event.player.PlayerCommandPreprocessEvent;
|
||||||
import org.bukkit.event.player.PlayerJoinEvent;
|
import org.bukkit.event.player.PlayerJoinEvent;
|
||||||
@ -63,6 +64,7 @@ import mineplex.core.donation.DonationManager;
|
|||||||
import mineplex.core.elo.EloManager;
|
import mineplex.core.elo.EloManager;
|
||||||
import mineplex.core.energy.Energy;
|
import mineplex.core.energy.Energy;
|
||||||
import mineplex.core.explosion.Explosion;
|
import mineplex.core.explosion.Explosion;
|
||||||
|
import mineplex.core.explosion.ExplosionEvent;
|
||||||
import mineplex.core.gadget.gadgets.OutfitTeam;
|
import mineplex.core.gadget.gadgets.OutfitTeam;
|
||||||
import mineplex.core.gadget.types.Gadget;
|
import mineplex.core.gadget.types.Gadget;
|
||||||
import mineplex.core.gadget.types.GadgetType;
|
import mineplex.core.gadget.types.GadgetType;
|
||||||
@ -93,6 +95,7 @@ import mineplex.core.status.ServerStatusManager;
|
|||||||
import mineplex.core.task.TaskManager;
|
import mineplex.core.task.TaskManager;
|
||||||
import mineplex.core.teleport.Teleport;
|
import mineplex.core.teleport.Teleport;
|
||||||
import mineplex.core.timing.TimingManager;
|
import mineplex.core.timing.TimingManager;
|
||||||
|
import mineplex.core.titangiveaway.TitanGiveawayManager;
|
||||||
import mineplex.core.updater.event.UpdateEvent;
|
import mineplex.core.updater.event.UpdateEvent;
|
||||||
import mineplex.minecraft.game.classcombat.Class.ClassManager;
|
import mineplex.minecraft.game.classcombat.Class.ClassManager;
|
||||||
import mineplex.minecraft.game.classcombat.Condition.SkillConditionManager;
|
import mineplex.minecraft.game.classcombat.Condition.SkillConditionManager;
|
||||||
@ -135,6 +138,7 @@ import nautilus.game.arcade.managers.GameSpectatorManager;
|
|||||||
import nautilus.game.arcade.managers.GameStatManager;
|
import nautilus.game.arcade.managers.GameStatManager;
|
||||||
import nautilus.game.arcade.managers.GameTournamentManager;
|
import nautilus.game.arcade.managers.GameTournamentManager;
|
||||||
import nautilus.game.arcade.managers.GameWorldManager;
|
import nautilus.game.arcade.managers.GameWorldManager;
|
||||||
|
import nautilus.game.arcade.managers.HolidayManager;
|
||||||
import nautilus.game.arcade.managers.IdleManager;
|
import nautilus.game.arcade.managers.IdleManager;
|
||||||
import nautilus.game.arcade.managers.MiscManager;
|
import nautilus.game.arcade.managers.MiscManager;
|
||||||
import nautilus.game.arcade.shop.ArcadeShop;
|
import nautilus.game.arcade.shop.ArcadeShop;
|
||||||
@ -295,7 +299,8 @@ public class ArcadeManager extends MiniPlugin implements IRelation
|
|||||||
new MiscManager(this);
|
new MiscManager(this);
|
||||||
_hologramManager = hologramManager;
|
_hologramManager = hologramManager;
|
||||||
_idleManager = new IdleManager(this);
|
_idleManager = new IdleManager(this);
|
||||||
//new HolidayManager(this);
|
TitanGiveawayManager titanGiveaway = new TitanGiveawayManager(getPlugin(), clientManager, serverStatusManager);
|
||||||
|
new HolidayManager(this, titanGiveaway);
|
||||||
|
|
||||||
// Game Addons
|
// Game Addons
|
||||||
new CompassAddon(plugin, this);
|
new CompassAddon(plugin, this);
|
||||||
@ -1560,4 +1565,43 @@ public class ArcadeManager extends MiniPlugin implements IRelation
|
|||||||
{
|
{
|
||||||
_requiredRank = rank;
|
_requiredRank = rank;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@EventHandler(priority=EventPriority.LOWEST)
|
||||||
|
public void explosionCancel(EntityExplodeEvent event)
|
||||||
|
{
|
||||||
|
if (GetGame() == null || !GetGame().InProgress())
|
||||||
|
{
|
||||||
|
event.blockList().clear();
|
||||||
|
event.setCancelled(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler(priority = EventPriority.LOWEST)
|
||||||
|
public void explosionCancel(ExplosionEvent event)
|
||||||
|
{
|
||||||
|
if (GetGame() == null || !GetGame().InProgress())
|
||||||
|
{
|
||||||
|
event.GetBlocks().clear();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void spawnDebug(PlayerCommandPreprocessEvent event)
|
||||||
|
{
|
||||||
|
if (event.getPlayer().isOp() && event.getMessage().contains("setmax"))
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
int i = Integer.parseInt(event.getMessage().split(" ")[1]);
|
||||||
|
|
||||||
|
_serverConfig.MaxPlayers = i;
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
event.setCancelled(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -4,7 +4,42 @@ import java.util.AbstractMap;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Map.Entry;
|
import java.util.Map.Entry;
|
||||||
|
|
||||||
|
import mineplex.core.common.util.C;
|
||||||
|
import mineplex.core.common.util.F;
|
||||||
|
import mineplex.core.common.util.NautHashMap;
|
||||||
|
import mineplex.core.common.util.UtilAction;
|
||||||
|
import mineplex.core.common.util.UtilAlg;
|
||||||
|
import mineplex.core.common.util.UtilEvent;
|
||||||
|
import mineplex.core.common.util.UtilEvent.ActionType;
|
||||||
|
import mineplex.core.common.util.UtilGear;
|
||||||
|
import mineplex.core.common.util.UtilInv;
|
||||||
|
import mineplex.core.common.util.UtilMath;
|
||||||
|
import mineplex.core.common.util.UtilParticle;
|
||||||
|
import mineplex.core.common.util.UtilParticle.ParticleType;
|
||||||
|
import mineplex.core.common.util.UtilParticle.ViewDist;
|
||||||
|
import mineplex.core.common.util.UtilPlayer;
|
||||||
|
import mineplex.core.common.util.UtilServer;
|
||||||
|
import mineplex.core.common.util.UtilTextBottom;
|
||||||
|
import mineplex.core.common.util.UtilTextMiddle;
|
||||||
|
import mineplex.core.common.util.UtilTime;
|
||||||
|
import mineplex.core.explosion.ExplosionEvent;
|
||||||
|
import mineplex.core.itemstack.ItemStackFactory;
|
||||||
|
import mineplex.core.recharge.Recharge;
|
||||||
|
import mineplex.core.updater.UpdateType;
|
||||||
|
import mineplex.core.updater.event.UpdateEvent;
|
||||||
|
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
|
||||||
|
import nautilus.game.arcade.ArcadeManager;
|
||||||
|
import nautilus.game.arcade.GameType;
|
||||||
|
import nautilus.game.arcade.events.GameStateChangeEvent;
|
||||||
|
import nautilus.game.arcade.events.PlayerPrepareTeleportEvent;
|
||||||
|
import nautilus.game.arcade.game.SoloGame;
|
||||||
|
import nautilus.game.arcade.game.games.build.gui.MobShop;
|
||||||
|
import nautilus.game.arcade.game.games.build.gui.OptionsShop;
|
||||||
|
import nautilus.game.arcade.game.games.build.kits.KitBuilder;
|
||||||
|
import nautilus.game.arcade.kit.Kit;
|
||||||
|
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
|
import org.bukkit.Effect;
|
||||||
import org.bukkit.GameMode;
|
import org.bukkit.GameMode;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
@ -13,6 +48,7 @@ import org.bukkit.block.Block;
|
|||||||
import org.bukkit.entity.Boat;
|
import org.bukkit.entity.Boat;
|
||||||
import org.bukkit.entity.Entity;
|
import org.bukkit.entity.Entity;
|
||||||
import org.bukkit.entity.EntityType;
|
import org.bukkit.entity.EntityType;
|
||||||
|
import org.bukkit.entity.FallingBlock;
|
||||||
import org.bukkit.entity.Hanging;
|
import org.bukkit.entity.Hanging;
|
||||||
import org.bukkit.entity.Item;
|
import org.bukkit.entity.Item;
|
||||||
import org.bukkit.entity.ItemFrame;
|
import org.bukkit.entity.ItemFrame;
|
||||||
@ -41,6 +77,7 @@ import org.bukkit.event.block.BlockPistonRetractEvent;
|
|||||||
import org.bukkit.event.block.BlockPlaceEvent;
|
import org.bukkit.event.block.BlockPlaceEvent;
|
||||||
import org.bukkit.event.entity.CreatureSpawnEvent;
|
import org.bukkit.event.entity.CreatureSpawnEvent;
|
||||||
import org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason;
|
import org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason;
|
||||||
|
import org.bukkit.event.entity.EntityChangeBlockEvent;
|
||||||
import org.bukkit.event.entity.EntityCombustEvent;
|
import org.bukkit.event.entity.EntityCombustEvent;
|
||||||
import org.bukkit.event.entity.EntityDamageByEntityEvent;
|
import org.bukkit.event.entity.EntityDamageByEntityEvent;
|
||||||
import org.bukkit.event.entity.EntityDamageEvent;
|
import org.bukkit.event.entity.EntityDamageEvent;
|
||||||
@ -63,42 +100,6 @@ import org.bukkit.event.vehicle.VehicleCreateEvent;
|
|||||||
import org.bukkit.event.vehicle.VehicleDamageEvent;
|
import org.bukkit.event.vehicle.VehicleDamageEvent;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
import mineplex.core.common.Rank;
|
|
||||||
import mineplex.core.common.util.C;
|
|
||||||
import mineplex.core.common.util.F;
|
|
||||||
import mineplex.core.common.util.NautHashMap;
|
|
||||||
import mineplex.core.common.util.UtilAction;
|
|
||||||
import mineplex.core.common.util.UtilAlg;
|
|
||||||
import mineplex.core.common.util.UtilEvent;
|
|
||||||
import mineplex.core.common.util.UtilEvent.ActionType;
|
|
||||||
import mineplex.core.common.util.UtilParticle.ParticleType;
|
|
||||||
import mineplex.core.common.util.UtilParticle.ViewDist;
|
|
||||||
import mineplex.core.common.util.UtilGear;
|
|
||||||
import mineplex.core.common.util.UtilInv;
|
|
||||||
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.UtilTextBottom;
|
|
||||||
import mineplex.core.common.util.UtilTime;
|
|
||||||
import mineplex.core.common.util.UtilTextMiddle;
|
|
||||||
import mineplex.core.explosion.ExplosionEvent;
|
|
||||||
import mineplex.core.itemstack.ItemStackFactory;
|
|
||||||
import mineplex.core.recharge.Recharge;
|
|
||||||
import mineplex.core.updater.UpdateType;
|
|
||||||
import mineplex.core.updater.event.UpdateEvent;
|
|
||||||
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
|
|
||||||
import nautilus.game.arcade.ArcadeManager;
|
|
||||||
import nautilus.game.arcade.GameType;
|
|
||||||
import nautilus.game.arcade.events.GameStateChangeEvent;
|
|
||||||
import nautilus.game.arcade.events.PlayerPrepareTeleportEvent;
|
|
||||||
import nautilus.game.arcade.game.SoloGame;
|
|
||||||
import nautilus.game.arcade.game.Game.GameState;
|
|
||||||
import nautilus.game.arcade.game.games.build.gui.MobShop;
|
|
||||||
import nautilus.game.arcade.game.games.build.gui.OptionsShop;
|
|
||||||
import nautilus.game.arcade.game.games.build.kits.KitBuilder;
|
|
||||||
import nautilus.game.arcade.kit.Kit;
|
|
||||||
|
|
||||||
public class Build extends SoloGame
|
public class Build extends SoloGame
|
||||||
{
|
{
|
||||||
private NautHashMap<Player, BuildData> _data = new NautHashMap<Player, BuildData>();
|
private NautHashMap<Player, BuildData> _data = new NautHashMap<Player, BuildData>();
|
||||||
@ -933,6 +934,30 @@ public class Build extends SoloGame
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void blockForm(EntityChangeBlockEvent event)
|
||||||
|
{
|
||||||
|
if (!(event.getEntity() instanceof FallingBlock))
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (!event.getBlock().isLiquid())
|
||||||
|
return;
|
||||||
|
|
||||||
|
for (BuildData data : _data.values())
|
||||||
|
{
|
||||||
|
if (!data.inBuildArea(event.getBlock()))
|
||||||
|
{
|
||||||
|
event.setCancelled(true);
|
||||||
|
|
||||||
|
event.getEntity().remove();
|
||||||
|
|
||||||
|
//Effect
|
||||||
|
event.getBlock().getWorld().playEffect(event.getBlock().getLocation(), Effect.STEP_SOUND, ((FallingBlock) event.getEntity()).getBlockId());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void entityCombust(EntityCombustEvent event)
|
public void entityCombust(EntityCombustEvent event)
|
||||||
{
|
{
|
||||||
|
@ -308,6 +308,17 @@ public class BuildData
|
|||||||
if (mat == Material.LAVA_BUCKET) mat = Material.LAVA;
|
if (mat == Material.LAVA_BUCKET) mat = Material.LAVA;
|
||||||
else if (mat == Material.WATER_BUCKET) mat = Material.WATER;
|
else if (mat == Material.WATER_BUCKET) mat = Material.WATER;
|
||||||
|
|
||||||
|
//Set everything to air first to prevent the forming of obby.
|
||||||
|
if (mat == Material.LAVA || mat == Material.WATER)
|
||||||
|
{
|
||||||
|
int y = Math.min(CornerA.getBlockY(), CornerB.getBlockY()) - 1;
|
||||||
|
for (int x= Math.min(CornerA.getBlockX(), CornerB.getBlockX()) ; x <= Math.max(CornerA.getBlockX(), CornerB.getBlockX()) ; x++)
|
||||||
|
for (int z= Math.min(CornerA.getBlockZ(), CornerB.getBlockZ()) ; z <= Math.max(CornerA.getBlockZ(), CornerB.getBlockZ()) ; z++)
|
||||||
|
{
|
||||||
|
MapUtil.QuickChangeBlockAt(Player.getWorld(), x, y, z, Material.AIR, data);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
int y = Math.min(CornerA.getBlockY(), CornerB.getBlockY()) - 1;
|
int y = Math.min(CornerA.getBlockY(), CornerB.getBlockY()) - 1;
|
||||||
for (int x= Math.min(CornerA.getBlockX(), CornerB.getBlockX()) ; x <= Math.max(CornerA.getBlockX(), CornerB.getBlockX()) ; x++)
|
for (int x= Math.min(CornerA.getBlockX(), CornerB.getBlockX()) ; x <= Math.max(CornerA.getBlockX(), CornerB.getBlockX()) ; x++)
|
||||||
for (int z= Math.min(CornerA.getBlockZ(), CornerB.getBlockZ()) ; z <= Math.max(CornerA.getBlockZ(), CornerB.getBlockZ()) ; z++)
|
for (int z= Math.min(CornerA.getBlockZ(), CornerB.getBlockZ()) ; z <= Math.max(CornerA.getBlockZ(), CornerB.getBlockZ()) ; z++)
|
||||||
|
@ -32,7 +32,7 @@ public class GroundPage extends ShopPageBase<ArcadeManager, OptionsShop>
|
|||||||
new GroundData(Material.STAINED_CLAY, (byte) 0), new GroundData(Material.STAINED_CLAY, (byte) 15),
|
new GroundData(Material.STAINED_CLAY, (byte) 0), new GroundData(Material.STAINED_CLAY, (byte) 15),
|
||||||
new GroundData(Material.STAINED_CLAY, (byte) 4), new GroundData(Material.STAINED_CLAY, (byte) 3),
|
new GroundData(Material.STAINED_CLAY, (byte) 4), new GroundData(Material.STAINED_CLAY, (byte) 3),
|
||||||
new GroundData(Material.STAINED_CLAY, (byte) 5), new GroundData(Material.STAINED_CLAY, (byte) 6),
|
new GroundData(Material.STAINED_CLAY, (byte) 5), new GroundData(Material.STAINED_CLAY, (byte) 6),
|
||||||
new GroundData(Material.QUARTZ_BLOCK), new GroundData(Material.ICE), new GroundData(Material.IRON_BLOCK),
|
new GroundData(Material.QUARTZ_BLOCK), new GroundData(Material.PACKED_ICE), new GroundData(Material.IRON_BLOCK),
|
||||||
new GroundData(Material.GOLD_BLOCK), new GroundData(Material.DIAMOND_BLOCK)};
|
new GroundData(Material.GOLD_BLOCK), new GroundData(Material.DIAMOND_BLOCK)};
|
||||||
|
|
||||||
private Build _game;
|
private Build _game;
|
||||||
|
@ -25,7 +25,6 @@ import mineplex.core.recharge.Recharge;
|
|||||||
import mineplex.core.updater.UpdateType;
|
import mineplex.core.updater.UpdateType;
|
||||||
import mineplex.core.updater.event.UpdateEvent;
|
import mineplex.core.updater.event.UpdateEvent;
|
||||||
import mineplex.minecraft.game.core.combat.CombatComponent;
|
import mineplex.minecraft.game.core.combat.CombatComponent;
|
||||||
import mineplex.minecraft.game.core.combat.DeathMessageType;
|
|
||||||
import mineplex.minecraft.game.core.combat.CombatManager.AttackReason;
|
import mineplex.minecraft.game.core.combat.CombatManager.AttackReason;
|
||||||
import mineplex.minecraft.game.core.combat.DeathMessageType;
|
import mineplex.minecraft.game.core.combat.DeathMessageType;
|
||||||
import mineplex.minecraft.game.core.combat.event.CombatDeathEvent;
|
import mineplex.minecraft.game.core.combat.event.CombatDeathEvent;
|
||||||
@ -74,6 +73,7 @@ import org.bukkit.event.entity.EntityCombustEvent;
|
|||||||
import org.bukkit.event.entity.PlayerDeathEvent;
|
import org.bukkit.event.entity.PlayerDeathEvent;
|
||||||
import org.bukkit.event.player.PlayerInteractEvent;
|
import org.bukkit.event.player.PlayerInteractEvent;
|
||||||
import org.bukkit.event.player.PlayerItemHeldEvent;
|
import org.bukkit.event.player.PlayerItemHeldEvent;
|
||||||
|
import org.bukkit.event.player.PlayerQuitEvent;
|
||||||
import org.bukkit.util.Vector;
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
public class Evolution extends SoloGame
|
public class Evolution extends SoloGame
|
||||||
@ -223,6 +223,12 @@ public class Evolution extends SoloGame
|
|||||||
upgradeKit(event.GetPlayer(), false);
|
upgradeKit(event.GetPlayer(), false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void removeToken(PlayerQuitEvent event)
|
||||||
|
{
|
||||||
|
_tokens.remove(event.getPlayer().getName());
|
||||||
|
}
|
||||||
|
|
||||||
// //Double Kit
|
// //Double Kit
|
||||||
// @EventHandler(priority = EventPriority.MONITOR)
|
// @EventHandler(priority = EventPriority.MONITOR)
|
||||||
// public void storeTokens(GameStateChangeEvent event)
|
// public void storeTokens(GameStateChangeEvent event)
|
||||||
@ -369,9 +375,12 @@ public class Evolution extends SoloGame
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler(priority = EventPriority.MONITOR)
|
||||||
public void onDamage(CustomDamageEvent event)
|
public void onDamage(CustomDamageEvent event)
|
||||||
{
|
{
|
||||||
|
if (event.IsCancelled())
|
||||||
|
return;
|
||||||
|
|
||||||
if (!IsLive())
|
if (!IsLive())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -747,7 +756,11 @@ public class Evolution extends SoloGame
|
|||||||
|
|
||||||
for (int i = 0 ; i < tokens.size() ; i++)
|
for (int i = 0 ; i < tokens.size() ; i++)
|
||||||
{
|
{
|
||||||
players.add(tokens.get(i).Player);
|
Player cur = tokens.get(i).Player;
|
||||||
|
if (!cur.isOnline())
|
||||||
|
continue;
|
||||||
|
|
||||||
|
players.add(cur);
|
||||||
}
|
}
|
||||||
|
|
||||||
//Award Gems
|
//Award Gems
|
||||||
|
@ -61,7 +61,7 @@ public class KitHealth extends Kit
|
|||||||
if (!Manager.GetGame().IsLive())
|
if (!Manager.GetGame().IsLive())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Player killer = UtilPlayer.searchExact(event.GetLog().GetPlayer().GetName());
|
Player killer = UtilPlayer.searchExact(event.GetLog().GetKiller().GetName());
|
||||||
if (killer == null || !killer.isOnline())
|
if (killer == null || !killer.isOnline())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -74,6 +74,6 @@ public class KitHealth extends Kit
|
|||||||
if (!HasKit(killer))
|
if (!HasKit(killer))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
killer.setHealth(killer.getMaxHealth());
|
UtilPlayer.health(killer, 9999);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package nautilus.game.arcade.game.games.evolution.mobs;
|
package nautilus.game.arcade.game.games.evolution.mobs;
|
||||||
|
|
||||||
import mineplex.core.common.util.C;
|
import mineplex.core.common.util.C;
|
||||||
|
import mineplex.core.common.util.UtilBlock;
|
||||||
import mineplex.core.common.util.UtilEvent;
|
import mineplex.core.common.util.UtilEvent;
|
||||||
import mineplex.core.common.util.UtilEvent.ActionType;
|
import mineplex.core.common.util.UtilEvent.ActionType;
|
||||||
import mineplex.core.common.util.UtilGear;
|
import mineplex.core.common.util.UtilGear;
|
||||||
@ -66,6 +67,9 @@ public class KitChicken extends EvoKit
|
|||||||
if (!UtilEvent.isAction(event, ActionType.R))
|
if (!UtilEvent.isAction(event, ActionType.R))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (UtilBlock.usable(event.getClickedBlock()))
|
||||||
|
return;
|
||||||
|
|
||||||
if (!Manager.GetGame().IsLive())
|
if (!Manager.GetGame().IsLive())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -59,6 +59,9 @@ public class PerkBounceEVO extends Perk
|
|||||||
if (UtilBlock.usable(event.getClickedBlock()))
|
if (UtilBlock.usable(event.getClickedBlock()))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (UtilBlock.usable(event.getClickedBlock()))
|
||||||
|
return;
|
||||||
|
|
||||||
if (!UtilInv.IsItem(event.getItem(), Material.SLIME_BALL, (byte) 0))
|
if (!UtilInv.IsItem(event.getItem(), Material.SLIME_BALL, (byte) 0))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -66,15 +66,15 @@ public class PerkDoubleJumpEVO extends Perk
|
|||||||
if (player.getGameMode() == GameMode.CREATIVE)
|
if (player.getGameMode() == GameMode.CREATIVE)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
event.setCancelled(true);
|
||||||
|
player.setFlying(false);
|
||||||
|
|
||||||
EvolutionAbilityUseEvent useEvent = new EvolutionAbilityUseEvent(player, GetName(), 0);
|
EvolutionAbilityUseEvent useEvent = new EvolutionAbilityUseEvent(player, GetName(), 0);
|
||||||
Bukkit.getServer().getPluginManager().callEvent(useEvent);
|
Bukkit.getServer().getPluginManager().callEvent(useEvent);
|
||||||
|
|
||||||
if (useEvent.isCancelled())
|
if (useEvent.isCancelled())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
event.setCancelled(true);
|
|
||||||
player.setFlying(false);
|
|
||||||
|
|
||||||
//Disable Flight
|
//Disable Flight
|
||||||
player.setAllowFlight(false);
|
player.setAllowFlight(false);
|
||||||
|
|
||||||
|
@ -5,6 +5,7 @@ import java.util.Map.Entry;
|
|||||||
|
|
||||||
import mineplex.core.common.util.C;
|
import mineplex.core.common.util.C;
|
||||||
import mineplex.core.common.util.NautHashMap;
|
import mineplex.core.common.util.NautHashMap;
|
||||||
|
import mineplex.core.common.util.UtilBlock;
|
||||||
import mineplex.core.common.util.UtilEvent;
|
import mineplex.core.common.util.UtilEvent;
|
||||||
import mineplex.core.common.util.UtilPlayer;
|
import mineplex.core.common.util.UtilPlayer;
|
||||||
import mineplex.core.common.util.UtilTime;
|
import mineplex.core.common.util.UtilTime;
|
||||||
@ -49,6 +50,9 @@ public class PerkFlamingSwordEVO extends Perk
|
|||||||
if (!UtilEvent.isAction(event, ActionType.R))
|
if (!UtilEvent.isAction(event, ActionType.R))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (UtilBlock.usable(event.getClickedBlock()))
|
||||||
|
return;
|
||||||
|
|
||||||
if (!Manager.GetGame().IsLive())
|
if (!Manager.GetGame().IsLive())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -71,6 +71,9 @@ public class PerkSiesmicSlamEVO extends Perk
|
|||||||
if (!UtilEvent.isAction(event, ActionType.R))
|
if (!UtilEvent.isAction(event, ActionType.R))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (UtilBlock.usable(event.getClickedBlock()))
|
||||||
|
return;
|
||||||
|
|
||||||
if (!UtilInv.IsItem(event.getItem(), Material.IRON_INGOT, (byte) 0))
|
if (!UtilInv.IsItem(event.getItem(), Material.IRON_INGOT, (byte) 0))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -2,6 +2,7 @@ package nautilus.game.arcade.game.games.evolution.mobs.perks;
|
|||||||
|
|
||||||
import mineplex.core.common.util.F;
|
import mineplex.core.common.util.F;
|
||||||
import mineplex.core.common.util.UtilAction;
|
import mineplex.core.common.util.UtilAction;
|
||||||
|
import mineplex.core.common.util.UtilBlock;
|
||||||
import mineplex.core.common.util.UtilEnt;
|
import mineplex.core.common.util.UtilEnt;
|
||||||
import mineplex.core.common.util.UtilEvent;
|
import mineplex.core.common.util.UtilEvent;
|
||||||
import mineplex.core.common.util.UtilEvent.ActionType;
|
import mineplex.core.common.util.UtilEvent.ActionType;
|
||||||
@ -55,6 +56,9 @@ public class PerkSulphurBombEVO extends Perk implements IThrown
|
|||||||
if (!UtilEvent.isAction(event, ActionType.R))
|
if (!UtilEvent.isAction(event, ActionType.R))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (UtilBlock.usable(event.getClickedBlock()))
|
||||||
|
return;
|
||||||
|
|
||||||
if (!UtilInv.IsItem(event.getItem(), Material.SULPHUR, (byte) 0))
|
if (!UtilInv.IsItem(event.getItem(), Material.SULPHUR, (byte) 0))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package nautilus.game.arcade.game.games.evolution.mobs.perks;
|
package nautilus.game.arcade.game.games.evolution.mobs.perks;
|
||||||
|
|
||||||
import mineplex.core.common.util.UtilAction;
|
import mineplex.core.common.util.UtilAction;
|
||||||
|
import mineplex.core.common.util.UtilBlock;
|
||||||
import mineplex.core.common.util.UtilEvent;
|
import mineplex.core.common.util.UtilEvent;
|
||||||
import mineplex.core.common.util.UtilEvent.ActionType;
|
import mineplex.core.common.util.UtilEvent.ActionType;
|
||||||
import mineplex.core.common.util.UtilInv;
|
import mineplex.core.common.util.UtilInv;
|
||||||
@ -39,6 +40,9 @@ public class PerkWebEVO extends Perk implements IThrown
|
|||||||
if (!UtilEvent.isAction(event, ActionType.R))
|
if (!UtilEvent.isAction(event, ActionType.R))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (UtilBlock.usable(event.getClickedBlock()))
|
||||||
|
return;
|
||||||
|
|
||||||
if (!Manager.GetGame().IsLive())
|
if (!Manager.GetGame().IsLive())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -109,8 +113,12 @@ public class PerkWebEVO extends Perk implements IThrown
|
|||||||
public void Web(ProjectileUser data)
|
public void Web(ProjectileUser data)
|
||||||
{
|
{
|
||||||
Location loc = data.GetThrown().getLocation();
|
Location loc = data.GetThrown().getLocation();
|
||||||
|
|
||||||
data.GetThrown().remove();
|
data.GetThrown().remove();
|
||||||
|
|
||||||
|
if (loc.getBlock().getType() != Material.AIR)
|
||||||
|
return;
|
||||||
|
|
||||||
Manager.GetBlockRestore().Add(loc.getBlock(), 30, (byte)0, 4000);
|
Manager.GetBlockRestore().Add(loc.getBlock(), 30, (byte)0, 4000);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -29,6 +29,9 @@ public class NoAbilityTracker extends StatTracker<Evolution>
|
|||||||
@EventHandler(priority = EventPriority.MONITOR)
|
@EventHandler(priority = EventPriority.MONITOR)
|
||||||
public void onEvolutionAbility(EvolutionAbilityUseEvent event)
|
public void onEvolutionAbility(EvolutionAbilityUseEvent event)
|
||||||
{
|
{
|
||||||
|
if (event.isCancelled())
|
||||||
|
return;
|
||||||
|
|
||||||
if (!getGame().IsLive())
|
if (!getGame().IsLive())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -23,7 +23,6 @@ import org.bukkit.event.entity.ItemSpawnEvent;
|
|||||||
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
|
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
|
||||||
import org.bukkit.event.player.PlayerCommandPreprocessEvent;
|
import org.bukkit.event.player.PlayerCommandPreprocessEvent;
|
||||||
|
|
||||||
import mineplex.core.common.CurrencyType;
|
|
||||||
import mineplex.core.common.util.C;
|
import mineplex.core.common.util.C;
|
||||||
import mineplex.core.common.util.F;
|
import mineplex.core.common.util.F;
|
||||||
import mineplex.core.common.util.UtilBlock;
|
import mineplex.core.common.util.UtilBlock;
|
||||||
@ -402,12 +401,20 @@ public class Halloween extends SoloGame
|
|||||||
{
|
{
|
||||||
for (Player player : GetPlayers(false))
|
for (Player player : GetPlayers(false))
|
||||||
{
|
{
|
||||||
Manager.GetDonation().PurchaseUnknownSalesPackage(null, player.getName(), Manager.GetClients().Get(player).getAccountId(), "Pumpling", CurrencyType.Gems, 0, true);
|
|
||||||
Manager.GetGame().AddGems(player, 30, "Killing the Pumpkin King", false, false);
|
Manager.GetGame().AddGems(player, 30, "Killing the Pumpkin King", false, false);
|
||||||
Manager.GetGame().AddGems(player, 10, "Participation", false, false);
|
Manager.GetGame().AddGems(player, 10, "Participation", false, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
SetCustomWinLine("You earned Pumpling Pet!");
|
if (Manager.IsRewardItems())
|
||||||
|
{
|
||||||
|
SetCustomWinLine("You earned the Decrepit Warhorse Mount!");
|
||||||
|
|
||||||
|
for (Player player : GetPlayers(false))
|
||||||
|
{
|
||||||
|
Manager.GetDonation().PurchaseUnknownSalesPackage(null, player.getName(), Manager.GetClients().Get(player).getAccountId(), "Decrepit Warhorse", false, 0, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
AnnounceEnd(this.GetTeamList().get(0));
|
AnnounceEnd(this.GetTeamList().get(0));
|
||||||
|
|
||||||
SetState(GameState.End);
|
SetState(GameState.End);
|
||||||
@ -431,6 +438,9 @@ public class Halloween extends SoloGame
|
|||||||
@EventHandler(priority = EventPriority.LOWEST)
|
@EventHandler(priority = EventPriority.LOWEST)
|
||||||
public void Explosion(EntityExplodeEvent event)
|
public void Explosion(EntityExplodeEvent event)
|
||||||
{
|
{
|
||||||
|
if (!IsLive())
|
||||||
|
return;
|
||||||
|
|
||||||
if (event.getEntity() instanceof Fireball)
|
if (event.getEntity() instanceof Fireball)
|
||||||
{
|
{
|
||||||
event.blockList().clear();
|
event.blockList().clear();
|
||||||
@ -514,7 +524,7 @@ public class Halloween extends SoloGame
|
|||||||
//Rounds
|
//Rounds
|
||||||
Scoreboard.WriteBlank();
|
Scoreboard.WriteBlank();
|
||||||
Scoreboard.Write(C.cYellow + "Wave");
|
Scoreboard.Write(C.cYellow + "Wave");
|
||||||
Scoreboard.Write((_wave+1) + " of 6");
|
Scoreboard.Write(Math.min(6, _wave+1) + " of 6");
|
||||||
|
|
||||||
Scoreboard.WriteBlank();
|
Scoreboard.WriteBlank();
|
||||||
Scoreboard.Write(C.cYellow + "Monsters");
|
Scoreboard.Write(C.cYellow + "Monsters");
|
||||||
|
@ -1,13 +1,7 @@
|
|||||||
package nautilus.game.arcade.game.games.halloween.kits;
|
package nautilus.game.arcade.game.games.halloween.kits;
|
||||||
|
|
||||||
import org.bukkit.Material;
|
|
||||||
import org.bukkit.entity.EntityType;
|
|
||||||
import org.bukkit.entity.LivingEntity;
|
|
||||||
import org.bukkit.entity.Player;
|
|
||||||
import org.bukkit.event.EventHandler;
|
|
||||||
import org.bukkit.inventory.ItemStack;
|
|
||||||
|
|
||||||
import mineplex.core.common.util.C;
|
import mineplex.core.common.util.C;
|
||||||
|
import mineplex.core.common.util.F;
|
||||||
import mineplex.core.common.util.UtilMath;
|
import mineplex.core.common.util.UtilMath;
|
||||||
import mineplex.core.itemstack.ItemStackFactory;
|
import mineplex.core.itemstack.ItemStackFactory;
|
||||||
import mineplex.core.updater.UpdateType;
|
import mineplex.core.updater.UpdateType;
|
||||||
@ -16,7 +10,16 @@ import nautilus.game.arcade.ArcadeManager;
|
|||||||
import nautilus.game.arcade.kit.AbbreviatedKit;
|
import nautilus.game.arcade.kit.AbbreviatedKit;
|
||||||
import nautilus.game.arcade.kit.KitAvailability;
|
import nautilus.game.arcade.kit.KitAvailability;
|
||||||
import nautilus.game.arcade.kit.Perk;
|
import nautilus.game.arcade.kit.Perk;
|
||||||
import nautilus.game.arcade.kit.perks.*;
|
import nautilus.game.arcade.kit.perks.PerkBlizzardFinn;
|
||||||
|
import nautilus.game.arcade.kit.perks.PerkFlameSlam;
|
||||||
|
import nautilus.game.arcade.kit.perks.PerkFletcher;
|
||||||
|
|
||||||
|
import org.bukkit.Material;
|
||||||
|
import org.bukkit.entity.EntityType;
|
||||||
|
import org.bukkit.entity.LivingEntity;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.EventHandler;
|
||||||
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
public class KitFinn extends AbbreviatedKit
|
public class KitFinn extends AbbreviatedKit
|
||||||
{
|
{
|
||||||
@ -46,9 +49,9 @@ public class KitFinn extends AbbreviatedKit
|
|||||||
@Override
|
@Override
|
||||||
public void GiveItems(Player player)
|
public void GiveItems(Player player)
|
||||||
{
|
{
|
||||||
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.GOLD_AXE, (byte)0, 1, "Flaming Axe"));
|
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.GOLD_AXE, (byte)0, 1, F.item("Flaming Axe")));
|
||||||
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.DIAMOND_SWORD, (byte)0, 1, "Icy Sword"));
|
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.DIAMOND_SWORD, (byte)0, 1, F.item("Icy Sword")));
|
||||||
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.BOW, (byte)0, 1, "Bow"));
|
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.BOW, (byte)0, 1, F.item("Bow")));
|
||||||
|
|
||||||
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.MUSHROOM_SOUP));
|
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.MUSHROOM_SOUP));
|
||||||
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.MUSHROOM_SOUP));
|
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.MUSHROOM_SOUP));
|
||||||
|
@ -1,13 +1,7 @@
|
|||||||
package nautilus.game.arcade.game.games.halloween.kits;
|
package nautilus.game.arcade.game.games.halloween.kits;
|
||||||
|
|
||||||
import org.bukkit.Material;
|
|
||||||
import org.bukkit.entity.EntityType;
|
|
||||||
import org.bukkit.entity.LivingEntity;
|
|
||||||
import org.bukkit.entity.Player;
|
|
||||||
import org.bukkit.event.EventHandler;
|
|
||||||
import org.bukkit.inventory.ItemStack;
|
|
||||||
|
|
||||||
import mineplex.core.common.util.C;
|
import mineplex.core.common.util.C;
|
||||||
|
import mineplex.core.common.util.F;
|
||||||
import mineplex.core.common.util.UtilMath;
|
import mineplex.core.common.util.UtilMath;
|
||||||
import mineplex.core.common.util.UtilPlayer;
|
import mineplex.core.common.util.UtilPlayer;
|
||||||
import mineplex.core.itemstack.ItemStackFactory;
|
import mineplex.core.itemstack.ItemStackFactory;
|
||||||
@ -17,7 +11,16 @@ import nautilus.game.arcade.ArcadeManager;
|
|||||||
import nautilus.game.arcade.kit.AbbreviatedKit;
|
import nautilus.game.arcade.kit.AbbreviatedKit;
|
||||||
import nautilus.game.arcade.kit.KitAvailability;
|
import nautilus.game.arcade.kit.KitAvailability;
|
||||||
import nautilus.game.arcade.kit.Perk;
|
import nautilus.game.arcade.kit.Perk;
|
||||||
import nautilus.game.arcade.kit.perks.*;
|
import nautilus.game.arcade.kit.perks.PerkBarrage;
|
||||||
|
import nautilus.game.arcade.kit.perks.PerkFletcher;
|
||||||
|
import nautilus.game.arcade.kit.perks.PerkQuickshotRobinHood;
|
||||||
|
|
||||||
|
import org.bukkit.Material;
|
||||||
|
import org.bukkit.entity.EntityType;
|
||||||
|
import org.bukkit.entity.LivingEntity;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.EventHandler;
|
||||||
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
public class KitRobinHood extends AbbreviatedKit
|
public class KitRobinHood extends AbbreviatedKit
|
||||||
{
|
{
|
||||||
@ -46,8 +49,8 @@ public class KitRobinHood extends AbbreviatedKit
|
|||||||
@Override
|
@Override
|
||||||
public void GiveItems(Player player)
|
public void GiveItems(Player player)
|
||||||
{
|
{
|
||||||
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.IRON_SWORD, (byte)0, 1, "Sword"));
|
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.IRON_SWORD, (byte)0, 1, F.item("Sword")));
|
||||||
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.BOW, (byte)0, 1, "Bow"));
|
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.BOW, (byte)0, 1, F.item("Bow")));
|
||||||
|
|
||||||
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.MUSHROOM_SOUP));
|
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.MUSHROOM_SOUP));
|
||||||
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.MUSHROOM_SOUP));
|
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.MUSHROOM_SOUP));
|
||||||
|
@ -1,5 +1,20 @@
|
|||||||
package nautilus.game.arcade.game.games.halloween.kits;
|
package nautilus.game.arcade.game.games.halloween.kits;
|
||||||
|
|
||||||
|
import mineplex.core.common.util.C;
|
||||||
|
import mineplex.core.common.util.F;
|
||||||
|
import mineplex.core.common.util.UtilMath;
|
||||||
|
import mineplex.core.itemstack.ItemStackFactory;
|
||||||
|
import mineplex.core.updater.UpdateType;
|
||||||
|
import mineplex.core.updater.event.UpdateEvent;
|
||||||
|
import nautilus.game.arcade.ArcadeManager;
|
||||||
|
import nautilus.game.arcade.kit.AbbreviatedKit;
|
||||||
|
import nautilus.game.arcade.kit.KitAvailability;
|
||||||
|
import nautilus.game.arcade.kit.Perk;
|
||||||
|
import nautilus.game.arcade.kit.perks.PerkFletcher;
|
||||||
|
import nautilus.game.arcade.kit.perks.PerkHammerThrow;
|
||||||
|
import nautilus.game.arcade.kit.perks.PerkKnockbackAttack;
|
||||||
|
import nautilus.game.arcade.kit.perks.PerkSeismicHammer;
|
||||||
|
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.entity.EntityType;
|
import org.bukkit.entity.EntityType;
|
||||||
import org.bukkit.entity.LivingEntity;
|
import org.bukkit.entity.LivingEntity;
|
||||||
@ -7,19 +22,6 @@ import org.bukkit.entity.Player;
|
|||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
import mineplex.core.common.util.C;
|
|
||||||
import mineplex.core.common.util.UtilMath;
|
|
||||||
import mineplex.core.itemstack.ItemStackFactory;
|
|
||||||
import mineplex.core.updater.UpdateType;
|
|
||||||
import mineplex.core.updater.event.UpdateEvent;
|
|
||||||
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
|
|
||||||
import nautilus.game.arcade.ArcadeManager;
|
|
||||||
import nautilus.game.arcade.kit.AbbreviatedKit;
|
|
||||||
import nautilus.game.arcade.kit.KitAvailability;
|
|
||||||
import nautilus.game.arcade.kit.Perk;
|
|
||||||
import nautilus.game.arcade.kit.SmashKit;
|
|
||||||
import nautilus.game.arcade.kit.perks.*;
|
|
||||||
|
|
||||||
public class KitThor extends AbbreviatedKit
|
public class KitThor extends AbbreviatedKit
|
||||||
{
|
{
|
||||||
public KitThor(ArcadeManager manager)
|
public KitThor(ArcadeManager manager)
|
||||||
@ -48,9 +50,9 @@ public class KitThor extends AbbreviatedKit
|
|||||||
@Override
|
@Override
|
||||||
public void GiveItems(Player player)
|
public void GiveItems(Player player)
|
||||||
{
|
{
|
||||||
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.IRON_AXE, (byte)0, 1, "Seismic Hammer"));
|
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.IRON_AXE, (byte)0, 1, F.item("Seismic Hammer")));
|
||||||
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.DIAMOND_AXE, (byte)0, 1, "Thor Hammer"));
|
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.DIAMOND_AXE, (byte)0, 1, F.item("Thor Hammer")));
|
||||||
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.BOW, (byte)0, 1, "Bow"));
|
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.BOW, (byte)0, 1, F.item("Bow")));
|
||||||
|
|
||||||
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.MUSHROOM_SOUP));
|
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.MUSHROOM_SOUP));
|
||||||
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.MUSHROOM_SOUP));
|
player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.MUSHROOM_SOUP));
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user