Merge remote-tracking branch 'refs/remotes/origin/develop' into bugfix/mopple-sprint
This commit is contained in:
commit
69bd4006d4
@ -8,18 +8,27 @@ import com.google.gson.Gson;
|
||||
public class ApiEndpoint
|
||||
{
|
||||
private static final String API_HOST = "10.33.53.12";
|
||||
// private static final String API_HOST = "localhost";
|
||||
// private static final int API_PORT = 3000;
|
||||
private static final int API_PORT = 7979;
|
||||
|
||||
private Gson _gson;
|
||||
private ApiWebCall _webCall;
|
||||
|
||||
public ApiEndpoint(String path, Gson gson)
|
||||
{
|
||||
String url = "http://" + API_HOST + ":" + API_PORT + path;
|
||||
_webCall = new ApiWebCall(url, gson);
|
||||
_gson = gson;
|
||||
}
|
||||
|
||||
protected ApiWebCall getWebCall()
|
||||
{
|
||||
return _webCall;
|
||||
}
|
||||
|
||||
public Gson getGson()
|
||||
{
|
||||
return _gson;
|
||||
}
|
||||
}
|
||||
|
@ -5,8 +5,10 @@ import java.util.Date;
|
||||
/**
|
||||
* @author Shaun Bennett
|
||||
*/
|
||||
public class ApiResponse
|
||||
public class ApiResponse implements HttpStatusCode
|
||||
{
|
||||
// These do not have _ prefix because of gson. Please do not add underscores!
|
||||
private int statusCode;
|
||||
private boolean success;
|
||||
private String error;
|
||||
|
||||
@ -33,4 +35,16 @@ public class ApiResponse
|
||||
", error='" + error + '\'' +
|
||||
'}';
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getStatusCode()
|
||||
{
|
||||
return statusCode;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setStatusCode(int statusCode)
|
||||
{
|
||||
this.statusCode = statusCode;
|
||||
}
|
||||
}
|
||||
|
@ -92,6 +92,11 @@ public class ApiWebCall
|
||||
private <T> T parseResponse(CloseableHttpResponse response, Type type) throws IOException
|
||||
{
|
||||
HttpEntity entity = response.getEntity();
|
||||
return _gson.fromJson(new InputStreamReader(entity.getContent()), type);
|
||||
T parsed = _gson.fromJson(new InputStreamReader(entity.getContent()), type);
|
||||
if (parsed instanceof HttpStatusCode && response.getStatusLine() != null)
|
||||
{
|
||||
((HttpStatusCode) parsed).setStatusCode(response.getStatusLine().getStatusCode());
|
||||
}
|
||||
return parsed;
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,12 @@
|
||||
package mineplex.core.common.api;
|
||||
|
||||
/**
|
||||
* Interface used to also grab status code from ApiWebCall
|
||||
* @author Shaun Bennett
|
||||
*/
|
||||
public interface HttpStatusCode
|
||||
{
|
||||
public int getStatusCode();
|
||||
|
||||
public void setStatusCode(int statusCode);
|
||||
}
|
@ -21,19 +21,25 @@ public class SkinData
|
||||
{
|
||||
private static long _nameCount = -99999999999999L;
|
||||
|
||||
public final static SkinData MOOSHROOM = new SkinData("eyJ0aW1lc3RhbXAiOjE0NDk4NzI0OTU0MTcsInByb2ZpbGVJZCI6ImE5ZDBjMDcyYmYxOTQwYTFhMTkzNjhkMDlkNTAwMjZlIiwicHJvZmlsZU5hbWUiOiJTcGlyaXR1c1NhbmN0dXMiLCJzaWduYXR1cmVSZXF1aXJlZCI6dHJ1ZSwidGV4dHVyZXMiOnsiU0tJTiI6eyJ1cmwiOiJodHRwOi8vdGV4dHVyZXMubWluZWNyYWZ0Lm5ldC90ZXh0dXJlLzIxOWJlYTU0Y2FkN2Q1OGFiNWRhNDA2YjBhOTJhYjNhODI0MjI1MjY2Nzc3ZTUzNGI3ZGI2YzM3MmRkZmY3ZiJ9fX0=","UoSif81+UyvkcaanU8KAMYBpw9mefAmWehE2liDUFvk+y0X/9NovsxTYVpIDCltTSpLW3sNgamvbj4Ybs+s6DbudPiEkvh0ER7Bv2v29UJw7RzIdr6/1g548X12zcnh5iPGz/P75uNRnSfTFQx0ed8P/GNkPIjWpDuJFxEj6KcPzrCAGMx+BVw1VwryBIYf9cCDHky8z0bxR89rjiIvPTBFI6MRhqI3vgpEBTySHDS+Ki0Hwl5oa3PwS6+jgYx/4RSfFsb+BawcvDk2Xpkt5UimvqZ5BceYLIfCt4KbShYipgLXLfYUZrntjPemd3SxthjxUuA07i44UxRd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cZQ0aXGMtvX/ZYTXJfMi6FYbIHY/qEEDnWhDX5y+SPpaJaZByPsvzi+qbfcFGnJ6nqi9ccyZYnYpnI2IVBM/yO/VRXWHxfqvJ0VVvv5KsGmVbko2Jxo0SDCxUL2UTH2+eol53FxhkkC+m2geC14k1zsZQLHDF3BgAG9+kFJ4UEoYRKF2Gy1FxeDCJtjYNdrYR8fdaUKRMcpBgEs+ZGe2U9EVVS/ZcBCjB7S+1Ne2bPzPFzTQPuBoMgggo1xbxBmQ5NyhYo4gwgj/xjSLIhb+5h7ioN1URfSRcfYdVv6RRO9l/u9l09jEom8y/jGRviefpEr+/e9iAl5Dd/6nzQgosBQja3NSfqYZmyuet2eI9zu61CObDTpR6yaCbNgBe/lWofRfULdpJpgjb4UNTBom3q82FcCiOe02OekGPw4+YlilhICBhajF5JzN8FKAdqI1osDcX3KuJgikYIW3voNaOP5YN3GXgilJNdou20KFC8ICq68HglgX7/0rLrWKIEoswnINIM6HcJbQuXncVPwQhV6K34Hlt/Na60=");
|
||||
// Comments this out for now, so it doesn't load the player profile
|
||||
// A better way to do this would check for the properties when getting the skull or the skin
|
||||
// Might change on the next version
|
||||
//public final static SkinData MOOSHROOM = new SkinData("eyJ0aW1lc3RhbXAiOjE0NDk4NzI0OTU0MTcsInByb2ZpbGVJZCI6ImE5ZDBjMDcyYmYxOTQwYTFhMTkzNjhkMDlkNTAwMjZlIiwicHJvZmlsZU5hbWUiOiJTcGlyaXR1c1NhbmN0dXMiLCJzaWduYXR1cmVSZXF1aXJlZCI6dHJ1ZSwidGV4dHVyZXMiOnsiU0tJTiI6eyJ1cmwiOiJodHRwOi8vdGV4dHVyZXMubWluZWNyYWZ0Lm5ldC90ZXh0dXJlLzIxOWJlYTU0Y2FkN2Q1OGFiNWRhNDA2YjBhOTJhYjNhODI0MjI1MjY2Nzc3ZTUzNGI3ZGI2YzM3MmRkZmY3ZiJ9fX0=","UoSif81+UyvkcaanU8KAMYBpw9mefAmWehE2liDUFvk+y0X/9Nov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VyZXMubWluZWNyYWZ0Lm5ldC90ZXh0dXJlLzIyYjljNWVhNzYzYzg2ZmM1Y2FlYTMzZDgyYjBmYTY1YTdjMjI4ZmQzMjFiYTU0NzY2ZWE5NWEzZDBiOTc5MyJ9fX0=", "jBoRvkhQXz+nap8yJJIZ+4HClMItWODumeSOYjXytP3WWKHK0UMq0xC/keXsnmvo89lMRdRbknPt2ZX5Flgyjgr4Rt0KtDvpL/hG4BUsTWryUZZMKxdd6DkZXYRtTogLUfHeDYIz+cZQ0aXGMtvX/ZYTXJfMi6FYbIHY/qEEDnWhDX5y+SPpaJaZByPsvzi+qbfcFGnJ6nqi9ccyZYnYpnI2IVBM/yO/VRXWHxfqvJ0VVvv5KsGmVbko2Jxo0SDCxUL2UTH2+eol53FxhkkC+m2geC14k1zsZQLHDF3BgAG9+kFJ4UEoYRKF2Gy1FxeDCJtjYNdrYR8fdaUKRMcpBgEs+ZGe2U9EVVS/ZcBCjB7S+1Ne2bPzPFzTQPuBoMgggo1xbxBmQ5NyhYo4gwgj/xjSLIhb+5h7ioN1URfSRcfYdVv6RRO9l/u9l09jEom8y/jGRviefpEr+/e9iAl5Dd/6nzQgosBQja3NSfqYZmyuet2eI9zu61CObDTpR6yaCbNgBe/lWofRfULdpJpgjb4UNTBom3q82FcCiOe02OekGPw4+YlilhICBhajF5JzN8FKAdqI1osDcX3KuJgikYIW3voNaOP5YN3GXgilJNdou20KFC8ICq68HglgX7/0rLrWKIEoswnINIM6HcJbQuXncVPwQhV6K34Hlt/Na60=");
|
||||
|
||||
private Property _skinProperty;
|
||||
|
||||
|
@ -255,12 +255,14 @@ public class MapUtil
|
||||
|
||||
@SuppressWarnings({ "rawtypes" })
|
||||
public static boolean ClearWorldReferences(String worldName)
|
||||
{
|
||||
synchronized (RegionFileCache.class)
|
||||
{
|
||||
HashMap regionfiles = (HashMap) RegionFileCache.a;
|
||||
|
||||
try
|
||||
{
|
||||
for (Iterator<Object> iterator = regionfiles.entrySet().iterator(); iterator.hasNext();)
|
||||
for (Iterator<Object> iterator = regionfiles.entrySet().iterator(); iterator.hasNext(); )
|
||||
{
|
||||
Map.Entry e = (Map.Entry) iterator.next();
|
||||
RegionFile file = (RegionFile) e.getValue();
|
||||
@ -284,6 +286,7 @@ public class MapUtil
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
public static BlockPosition getBlockPos(int x, int y, int z)
|
||||
{
|
||||
|
@ -108,4 +108,10 @@ public class UtilFirework
|
||||
UtilMath.random.nextBoolean()
|
||||
);
|
||||
}
|
||||
|
||||
public static void playFreedomFirework(Location location)
|
||||
{
|
||||
playFirework(location, FireworkEffect.builder().withColor(Color.RED).withColor(Color.BLUE)
|
||||
.withColor(Color.WHITE).withFade(Color.RED).withFade(Color.BLUE).withFade(Color.WHITE).build());
|
||||
}
|
||||
}
|
||||
|
@ -173,7 +173,17 @@ public class UtilInv
|
||||
return getItems(player, true, true, true);
|
||||
}
|
||||
|
||||
public static ArrayList<ItemStack> getItemsUncloned(Player player)
|
||||
{
|
||||
return getItems(player, true, true, true, false);
|
||||
}
|
||||
|
||||
public static ArrayList<ItemStack> getItems(Player player, boolean getArmor, boolean getCursor, boolean getCrafting)
|
||||
{
|
||||
return getItems(player, getArmor, getCursor, getCrafting, true);
|
||||
}
|
||||
|
||||
public static ArrayList<ItemStack> getItems(Player player, boolean getArmor, boolean getCursor, boolean getCrafting, boolean clone)
|
||||
{
|
||||
ArrayList<ItemStack> items = new ArrayList<ItemStack>();
|
||||
PlayerInventory inv = player.getInventory();
|
||||
@ -182,7 +192,7 @@ public class UtilInv
|
||||
{
|
||||
if (item != null && item.getType() != Material.AIR)
|
||||
{
|
||||
items.add(item.clone());
|
||||
items.add(clone ? item.clone() : item);
|
||||
}
|
||||
}
|
||||
|
||||
@ -192,7 +202,7 @@ public class UtilInv
|
||||
{
|
||||
if (item != null && item.getType() != Material.AIR)
|
||||
{
|
||||
items.add(item.clone());
|
||||
items.add(clone ? item.clone() : item);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -202,7 +212,7 @@ public class UtilInv
|
||||
ItemStack cursorItem = player.getItemOnCursor();
|
||||
|
||||
if (cursorItem != null && cursorItem.getType() != Material.AIR)
|
||||
items.add(cursorItem.clone());
|
||||
items.add(clone ? cursorItem.clone() : cursorItem);
|
||||
}
|
||||
|
||||
if (getCrafting)
|
||||
@ -215,7 +225,7 @@ public class UtilInv
|
||||
{
|
||||
if (item != null && item.getType() != Material.AIR)
|
||||
{
|
||||
items.add(item.clone());
|
||||
items.add(clone ? item.clone() : item);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
package mineplex.core.common.util;
|
||||
|
||||
import org.bukkit.Color;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.Player;
|
||||
@ -341,5 +342,20 @@ public class UtilParticle
|
||||
PlayParticle(particle, location, offsetX, offsetY, offsetZ, speed, count, dist, UtilServer.getPlayers());
|
||||
}
|
||||
|
||||
public static void playColoredParticle(Color color, ParticleType particleType, Location location, int count, ViewDist dist, Player... players)
|
||||
{
|
||||
if (particleType != ParticleType.RED_DUST
|
||||
&& particleType != ParticleType.MOB_SPELL_AMBIENT)
|
||||
return;
|
||||
PlayParticle(particleType, location, color.getRed() / 255F, color.getGreen() / 255F, color.getBlue() / 255F, 1f, count, dist, players);
|
||||
}
|
||||
|
||||
public static void playColoredParticleToAll(Color color, ParticleType particleType, Location location, int count, ViewDist dist)
|
||||
{
|
||||
if (particleType != ParticleType.RED_DUST
|
||||
&& particleType != ParticleType.MOB_SPELL_AMBIENT)
|
||||
return;
|
||||
PlayParticleToAll(particleType, location, color.getRed() / 255F, color.getGreen() / 255F, color.getBlue() / 255F, 1f, count, dist);
|
||||
}
|
||||
|
||||
}
|
@ -937,4 +937,10 @@ public class UtilPlayer
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
public static void removeAllowedCommands(Player player)
|
||||
{
|
||||
if (ALLOWED_COMMANDS.containsKey(player.getUniqueId()))
|
||||
ALLOWED_COMMANDS.remove(player.getUniqueId());
|
||||
}
|
||||
}
|
||||
|
@ -197,4 +197,14 @@ public class UtilServer
|
||||
{
|
||||
return Lists.newArrayList(getPlayers());
|
||||
}
|
||||
|
||||
public static boolean isTestServer()
|
||||
{
|
||||
return getPlugin().getConfig().getString("serverstatus.group").equalsIgnoreCase("Testing");
|
||||
}
|
||||
|
||||
public static boolean isHubServer()
|
||||
{
|
||||
return getPlugin().getConfig().getString("serverstatus.group").equalsIgnoreCase("Lobby");
|
||||
}
|
||||
}
|
||||
|
@ -751,4 +751,20 @@ public class UtilText
|
||||
}
|
||||
return array;
|
||||
}
|
||||
|
||||
public static String colorWords(String str, ChatColor... colors)
|
||||
{
|
||||
int c = 0, maxC = colors.length - 1;
|
||||
StringBuilder stringBuilder = new StringBuilder();
|
||||
for (String word : str.split(" "))
|
||||
{
|
||||
stringBuilder.append(colors[c]);
|
||||
stringBuilder.append(word + " ");
|
||||
if (c < maxC)
|
||||
c++;
|
||||
else
|
||||
c = 0;
|
||||
}
|
||||
return stringBuilder.toString();
|
||||
}
|
||||
}
|
@ -180,7 +180,7 @@ public class UtilTime
|
||||
{
|
||||
if (type == TimeUnit.DAYS) text = (num = UtilMath.trim(trim, time / 86400000d)) + " Day";
|
||||
else if (type == TimeUnit.HOURS) text = (num = UtilMath.trim(trim, time / 3600000d)) + " Hour";
|
||||
else if (type == TimeUnit.MINUTES) text = (num = UtilMath.trim(trim, time / 60000d)) + " Minute";
|
||||
else if (type == TimeUnit.MINUTES) text = (int) (num = (int) UtilMath.trim(trim, time / 60000d)) + " Minute";
|
||||
else if (type == TimeUnit.SECONDS) text = (int) (num = (int) UtilMath.trim(trim, time / 1000d)) + " Second";
|
||||
else text = (int) (num = (int) UtilMath.trim(trim, time)) + " Millisecond";
|
||||
}
|
||||
|
@ -0,0 +1,70 @@
|
||||
package mineplex.core.common.util.banner;
|
||||
|
||||
import org.bukkit.DyeColor;
|
||||
import org.bukkit.block.banner.Pattern;
|
||||
import org.bukkit.block.banner.PatternType;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
public enum CountryFlag
|
||||
{
|
||||
|
||||
Brazil(DyeColor.GREEN, new Pattern(DyeColor.YELLOW, PatternType.RHOMBUS_MIDDLE), new Pattern(DyeColor.BLUE, PatternType.CIRCLE_MIDDLE)),
|
||||
Usa(DyeColor.RED, new Pattern(DyeColor.WHITE, PatternType.STRIPE_SMALL), new Pattern(DyeColor.BLUE, PatternType.SQUARE_TOP_RIGHT)),
|
||||
Canada(DyeColor.WHITE, new Pattern(DyeColor.RED, PatternType.STRIPE_TOP), new Pattern(DyeColor.RED, PatternType.STRIPE_BOTTOM),
|
||||
new Pattern(DyeColor.RED, PatternType.CIRCLE_MIDDLE)),
|
||||
Uk(DyeColor.BLUE, new Pattern(DyeColor.WHITE, PatternType.STRIPE_DOWNLEFT), new Pattern(DyeColor.WHITE, PatternType.STRIPE_DOWNRIGHT),
|
||||
new Pattern(DyeColor.RED, PatternType.STRAIGHT_CROSS), new Pattern(DyeColor.RED, PatternType.CROSS)),
|
||||
Ireland(DyeColor.WHITE, new Pattern(DyeColor.LIME, PatternType.STRIPE_TOP), new Pattern(DyeColor.ORANGE, PatternType.STRIPE_BOTTOM)),
|
||||
Spain(DyeColor.YELLOW, new Pattern(DyeColor.RED, PatternType.STRIPE_LEFT), new Pattern(DyeColor.RED, PatternType.STRIPE_RIGHT)),
|
||||
Japan(DyeColor.WHITE, new Pattern(DyeColor.RED, PatternType.CIRCLE_MIDDLE)),
|
||||
South_Sudan(DyeColor.WHITE, new Pattern(DyeColor.RED, PatternType.STRIPE_LEFT), new Pattern(DyeColor.BLACK, PatternType.STRIPE_RIGHT),
|
||||
new Pattern(DyeColor.GREEN, PatternType.TRIANGLE_BOTTOM)),
|
||||
Jamaica(DyeColor.GREEN, new Pattern(DyeColor.BLACK, PatternType.TRIANGLE_TOP), new Pattern(DyeColor.BLACK, PatternType.TRIANGLES_BOTTOM),
|
||||
new Pattern(DyeColor.YELLOW, PatternType.CROSS)),
|
||||
Italy(DyeColor.WHITE, new Pattern(DyeColor.RED, PatternType.STRIPE_TOP), new Pattern(DyeColor.GREEN, PatternType.STRIPE_BOTTOM)),
|
||||
Senegal(DyeColor.YELLOW, new Pattern(DyeColor.RED, PatternType.STRIPE_TOP), new Pattern(DyeColor.GREEN, PatternType.STRIPE_BOTTOM),
|
||||
new Pattern(DyeColor.GREEN, PatternType.CIRCLE_MIDDLE)),
|
||||
France(DyeColor.WHITE, new Pattern(DyeColor.RED, PatternType.STRIPE_TOP), new Pattern(DyeColor.BLUE, PatternType.STRIPE_BOTTOM)),
|
||||
India(DyeColor.WHITE, new Pattern(DyeColor.ORANGE, PatternType.STRIPE_LEFT), new Pattern(DyeColor.GREEN, PatternType.STRIPE_RIGHT),
|
||||
new Pattern(DyeColor.BLUE, PatternType.CIRCLE_MIDDLE)),
|
||||
Belgium(DyeColor.YELLOW, new Pattern(DyeColor.BLACK, PatternType.STRIPE_BOTTOM), new Pattern(DyeColor.RED, PatternType.STRIPE_TOP)),
|
||||
England(DyeColor.WHITE, new Pattern(DyeColor.RED, PatternType.STRAIGHT_CROSS)),
|
||||
Austria(DyeColor.RED, new Pattern(DyeColor.WHITE, PatternType.STRIPE_CENTER)),
|
||||
Armenia(DyeColor.RED, new Pattern(DyeColor.BLUE, PatternType.STRIPE_CENTER), new Pattern(DyeColor.ORANGE, PatternType.STRIPE_RIGHT)),
|
||||
Argentina(DyeColor.LIGHT_BLUE, new Pattern(DyeColor.WHITE, PatternType.STRIPE_CENTER), new Pattern(DyeColor.YELLOW, PatternType.CIRCLE_MIDDLE)),
|
||||
Greece(DyeColor.LIGHT_BLUE, new Pattern(DyeColor.WHITE, PatternType.STRIPE_SMALL), new Pattern(DyeColor.LIGHT_BLUE, PatternType.SQUARE_BOTTOM_LEFT)),
|
||||
Czech_Republic(DyeColor.WHITE, new Pattern(DyeColor.RED, PatternType.HALF_VERTICAL_MIRROR), new Pattern(DyeColor.BLUE, PatternType.TRIANGLE_BOTTOM)),
|
||||
Romania(DyeColor.YELLOW, new Pattern(DyeColor.BLUE, PatternType.STRIPE_BOTTOM), new Pattern(DyeColor.RED, PatternType.STRIPE_TOP)),
|
||||
Honduras(DyeColor.WHITE, new Pattern(DyeColor.BLUE, PatternType.STRIPE_LEFT), new Pattern(DyeColor.BLUE, PatternType.STRIPE_RIGHT)),
|
||||
Algeria(DyeColor.WHITE, new Pattern(DyeColor.LIME, PatternType.HALF_HORIZONTAL_MIRROR), new Pattern(DyeColor.RED, PatternType.CIRCLE_MIDDLE)),
|
||||
Portugal(DyeColor.RED, new Pattern(DyeColor.GREEN, PatternType.STRIPE_TOP), new Pattern(DyeColor.YELLOW, PatternType.CIRCLE_MIDDLE)),
|
||||
Bahrain(DyeColor.RED, new Pattern(DyeColor.WHITE, PatternType.TRIANGLES_BOTTOM)),
|
||||
Germany(DyeColor.RED, new Pattern(DyeColor.BLACK, PatternType.STRIPE_LEFT), new Pattern(DyeColor.YELLOW, PatternType.STRIPE_RIGHT)),
|
||||
Gabon(DyeColor.YELLOW, new Pattern(DyeColor.BLUE, PatternType.STRIPE_RIGHT), new Pattern(DyeColor.LIME, PatternType.STRIPE_LEFT)),
|
||||
Scotland(DyeColor.BLUE, new Pattern(DyeColor.WHITE, PatternType.CROSS)),
|
||||
Peru(DyeColor.WHITE, new Pattern(DyeColor.RED, PatternType.STRIPE_TOP), new Pattern(DyeColor.RED, PatternType.STRIPE_BOTTOM)),
|
||||
Tanzania(DyeColor.LIME, new Pattern(DyeColor.LIGHT_BLUE, PatternType.DIAGONAL_RIGHT), new Pattern(DyeColor.BLACK, PatternType.STRIPE_DOWNLEFT)),
|
||||
Morocco(DyeColor.RED, new Pattern(DyeColor.GREEN, PatternType.CIRCLE_MIDDLE)),
|
||||
Solomon_Islands(DyeColor.GREEN, new Pattern(DyeColor.BLUE, PatternType.DIAGONAL_LEFT_MIRROR), new Pattern(DyeColor.YELLOW, PatternType.STRIPE_DOWNRIGHT)),
|
||||
Switzerland(DyeColor.RED, new Pattern(DyeColor.WHITE, PatternType.STRAIGHT_CROSS), new Pattern(DyeColor.RED, PatternType.STRIPE_BOTTOM),
|
||||
new Pattern(DyeColor.RED, PatternType.STRIPE_TOP)),
|
||||
Finland(DyeColor.BLUE, new Pattern(DyeColor.WHITE, PatternType.SQUARE_BOTTOM_LEFT), new Pattern(DyeColor.WHITE, PatternType.SQUARE_BOTTOM_RIGHT),
|
||||
new Pattern(DyeColor.WHITE, PatternType.HALF_HORIZONTAL), new Pattern(DyeColor.BLUE, PatternType.STRIPE_CENTER)),
|
||||
South_Africa(DyeColor.WHITE, new Pattern(DyeColor.BLUE, PatternType.HALF_VERTICAL_MIRROR), new Pattern(DyeColor.RED, PatternType.HALF_VERTICAL),
|
||||
new Pattern(DyeColor.GREEN, PatternType.STRIPE_CENTER), new Pattern(DyeColor.BLACK, PatternType.TRIANGLE_BOTTOM)),
|
||||
Poland(DyeColor.RED, new Pattern(DyeColor.WHITE, PatternType.HALF_VERTICAL_MIRROR));
|
||||
|
||||
private DyeColor _baseColor;
|
||||
private Pattern[] _patterns;
|
||||
|
||||
CountryFlag(DyeColor baseColor, Pattern... patterns){
|
||||
_baseColor = baseColor;
|
||||
_patterns = patterns;
|
||||
}
|
||||
|
||||
public ItemStack getBanner()
|
||||
{
|
||||
return UtilBanner.createBanner(_baseColor, _patterns);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
package mineplex.core.common.util.banner;
|
||||
|
||||
import org.bukkit.DyeColor;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.banner.Pattern;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.meta.BannerMeta;
|
||||
|
||||
public class UtilBanner
|
||||
{
|
||||
|
||||
public static ItemStack createBanner(DyeColor baseColor, Pattern... patterns)
|
||||
{
|
||||
ItemStack banner = new ItemStack(Material.BANNER);
|
||||
BannerMeta bannerMeta = (BannerMeta) banner.getItemMeta();
|
||||
bannerMeta.setBaseColor(baseColor);
|
||||
for (Pattern pattern : patterns)
|
||||
{
|
||||
bannerMeta.addPattern(pattern);
|
||||
}
|
||||
banner.setItemMeta(bannerMeta);
|
||||
return banner;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,56 @@
|
||||
package mineplex.core.common.util.particles;
|
||||
|
||||
|
||||
import mineplex.core.common.util.UtilParticle;
|
||||
import mineplex.core.common.util.UtilServer;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class ColoredParticle extends ParticleData
|
||||
{
|
||||
|
||||
private ParticleColor _color;
|
||||
|
||||
public ColoredParticle(UtilParticle.ParticleType particleType, ParticleColor color, Location location)
|
||||
{
|
||||
super(particleType, location);
|
||||
if ((particleType == UtilParticle.ParticleType.RED_DUST || particleType == UtilParticle.ParticleType.MOB_SPELL_AMBIENT)
|
||||
&& !(color instanceof DustSpellColor))
|
||||
throw new IllegalArgumentException("RED_DUST and MOB_SPELL_AMBIENT particle types require a DustSpellColor!");
|
||||
else if(particleType == UtilParticle.ParticleType.NOTE && !(color instanceof NoteColor))
|
||||
throw new IllegalArgumentException("NOTE particle type requires a NoteColor!");
|
||||
else if(particleType != UtilParticle.ParticleType.RED_DUST && particleType != UtilParticle.ParticleType.MOB_SPELL_AMBIENT
|
||||
&& particleType != UtilParticle.ParticleType.NOTE)
|
||||
throw new IllegalArgumentException("Particle Type must be RED_DUST, MOB_SPELL_AMBIENT!");
|
||||
_particleType = particleType;
|
||||
_color = color;
|
||||
_location = location;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void display(UtilParticle.ViewDist viewDist, Player... players)
|
||||
{
|
||||
float x = _color.getX();
|
||||
if (_particleType == UtilParticle.ParticleType.RED_DUST && x == 0)
|
||||
x = Float.MIN_NORMAL;
|
||||
UtilParticle.PlayParticle(_particleType, _location, x, _color.getY(), _color.getZ(), 1, 0, viewDist, players);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void display(UtilParticle.ViewDist viewDist)
|
||||
{
|
||||
display(viewDist, UtilServer.getPlayers());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void display()
|
||||
{
|
||||
display(UtilParticle.ViewDist.NORMAL);
|
||||
}
|
||||
|
||||
public void setColor(ParticleColor color)
|
||||
{
|
||||
_color = color;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,39 @@
|
||||
package mineplex.core.common.util.particles;
|
||||
|
||||
import java.awt.*;
|
||||
|
||||
public class DustSpellColor extends ParticleColor
|
||||
{
|
||||
|
||||
private int _red, _green, _blue;
|
||||
|
||||
public DustSpellColor(Color color)
|
||||
{
|
||||
_red = color.getRed();
|
||||
_green = color.getGreen();
|
||||
_blue = color.getBlue();
|
||||
}
|
||||
|
||||
public DustSpellColor(int r, int g, int b)
|
||||
{
|
||||
_red = r;
|
||||
_green = g;
|
||||
_blue = b;
|
||||
}
|
||||
|
||||
public float getX()
|
||||
{
|
||||
return (float) _red / 255f;
|
||||
}
|
||||
|
||||
public float getY()
|
||||
{
|
||||
return (float) _green / 255f;
|
||||
}
|
||||
|
||||
public float getZ()
|
||||
{
|
||||
return (float) _blue / 255f;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
package mineplex.core.common.util.particles;
|
||||
|
||||
import mineplex.core.common.util.UtilParticle;
|
||||
import org.bukkit.Location;
|
||||
|
||||
public class NormalParticle extends ParticleData
|
||||
{
|
||||
|
||||
public NormalParticle(UtilParticle.ParticleType particleType, Location location)
|
||||
{
|
||||
super(particleType, location);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,39 @@
|
||||
package mineplex.core.common.util.particles;
|
||||
|
||||
import java.awt.*;
|
||||
|
||||
public class NoteColor extends ParticleColor
|
||||
{
|
||||
|
||||
private int _red, _green, _blue;
|
||||
|
||||
public NoteColor(Color color)
|
||||
{
|
||||
_red = color.getRed();
|
||||
_green = color.getGreen();
|
||||
_blue = color.getBlue();
|
||||
}
|
||||
|
||||
public NoteColor(int r, int g, int b)
|
||||
{
|
||||
_red = r;
|
||||
_green = g;
|
||||
_blue = b;
|
||||
}
|
||||
|
||||
public float getX()
|
||||
{
|
||||
return (float) _red / 24f;
|
||||
}
|
||||
|
||||
public float getY()
|
||||
{
|
||||
return 0f;
|
||||
}
|
||||
|
||||
public float getZ()
|
||||
{
|
||||
return 0f;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
package mineplex.core.common.util.particles;
|
||||
|
||||
import java.awt.*;
|
||||
|
||||
public abstract class ParticleColor
|
||||
{
|
||||
|
||||
public abstract float getX();
|
||||
|
||||
public abstract float getY();
|
||||
|
||||
public abstract float getZ();
|
||||
|
||||
}
|
@ -0,0 +1,57 @@
|
||||
package mineplex.core.common.util.particles;
|
||||
|
||||
import mineplex.core.common.util.UtilParticle;
|
||||
import mineplex.core.common.util.UtilServer;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class ParticleData
|
||||
{
|
||||
|
||||
protected UtilParticle.ParticleType _particleType;
|
||||
protected Location _location;
|
||||
|
||||
public ParticleData(UtilParticle.ParticleType particleType, Location location)
|
||||
{
|
||||
_particleType = particleType;
|
||||
_location = location;
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays the particles for selected players
|
||||
* @param viewDist The distance of the particle view
|
||||
* @param players The players that will receive the particle
|
||||
*/
|
||||
public void display(UtilParticle.ViewDist viewDist, Player... players)
|
||||
{
|
||||
UtilParticle.PlayParticle(_particleType, _location, 0f, 0f, 0f, 0f, 1, viewDist);
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays the particles for all the players
|
||||
* @param viewDist The distance of the particle view
|
||||
*/
|
||||
public void display(UtilParticle.ViewDist viewDist)
|
||||
{
|
||||
display(viewDist, UtilServer.getPlayers());
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays the particles for all the players, with a NORMAL view distance
|
||||
*/
|
||||
public void display()
|
||||
{
|
||||
display(UtilParticle.ViewDist.NORMAL);
|
||||
}
|
||||
|
||||
public void setLocation(Location location)
|
||||
{
|
||||
_location = location;
|
||||
}
|
||||
|
||||
public Location getLocation()
|
||||
{
|
||||
return _location;
|
||||
}
|
||||
|
||||
}
|
@ -6,7 +6,6 @@ import mineplex.core.account.CoreClientManager;
|
||||
import mineplex.core.account.ILoginProcessor;
|
||||
import mineplex.core.account.event.ClientUnloadEvent;
|
||||
import mineplex.core.bonuses.animations.AnimationCarl;
|
||||
import mineplex.core.bonuses.commands.AllowCommand;
|
||||
import mineplex.core.bonuses.commands.AnimationCommand;
|
||||
import mineplex.core.bonuses.commands.GuiCommand;
|
||||
import mineplex.core.bonuses.commands.TicketCommand;
|
||||
@ -39,6 +38,7 @@ import mineplex.core.status.ServerStatusManager;
|
||||
import mineplex.core.treasure.TreasureType;
|
||||
import mineplex.core.updater.UpdateType;
|
||||
import mineplex.core.updater.event.UpdateEvent;
|
||||
import mineplex.core.youtube.YoutubeManager;
|
||||
import mineplex.database.Tables;
|
||||
import mineplex.database.tables.records.BonusRecord;
|
||||
import mineplex.serverdata.commands.ServerCommandManager;
|
||||
@ -122,7 +122,8 @@ public class BonusManager extends MiniClientPlugin<BonusClientData> implements I
|
||||
private RewardManager _rewardManager;
|
||||
private StatsManager _statsManager;
|
||||
private FacebookManager _facebookManager;
|
||||
// private BoosterManager _boosterManager;
|
||||
private YoutubeManager _youtubeManager;
|
||||
private BoosterManager _boosterManager;
|
||||
public boolean _enabled;
|
||||
private Npc _carlNpc;
|
||||
private AnimationCarl _animation;
|
||||
@ -161,7 +162,7 @@ public class BonusManager extends MiniClientPlugin<BonusClientData> implements I
|
||||
updateOffSet();
|
||||
}
|
||||
|
||||
public BonusManager(JavaPlugin plugin, CoreClientManager clientManager, ServerStatusManager statusManager, DonationManager donationManager, PollManager pollManager, NpcManager npcManager, HologramManager hologramManager, StatsManager statsManager, InventoryManager inventoryManager, PetManager petManager, FacebookManager facebookManager, GadgetManager gadgetManager)
|
||||
public BonusManager(JavaPlugin plugin, CoreClientManager clientManager, ServerStatusManager statusManager, DonationManager donationManager, PollManager pollManager, NpcManager npcManager, HologramManager hologramManager, StatsManager statsManager, InventoryManager inventoryManager, PetManager petManager, FacebookManager facebookManager, YoutubeManager youtubeManager, GadgetManager gadgetManager, BoosterManager boosterManager)
|
||||
{
|
||||
super("Bonus", plugin);
|
||||
_repository = new BonusRepository(plugin, this, donationManager);
|
||||
@ -170,12 +171,14 @@ public class BonusManager extends MiniClientPlugin<BonusClientData> implements I
|
||||
_npcManager = npcManager;
|
||||
_hologramManager = hologramManager;
|
||||
_inventoryManager = inventoryManager;
|
||||
_boosterManager = boosterManager;
|
||||
|
||||
_rewardManager = new RewardManager(_clientManager, _donationManager, _inventoryManager, petManager, statsManager, gadgetManager);
|
||||
|
||||
_pollManager = pollManager;
|
||||
_statsManager = statsManager;
|
||||
_facebookManager = facebookManager;
|
||||
_youtubeManager = youtubeManager;
|
||||
|
||||
_voteList = new ArrayList<String>();
|
||||
_voteList.add("http://vote1.mineplex.com");
|
||||
@ -414,6 +417,7 @@ public class BonusManager extends MiniClientPlugin<BonusClientData> implements I
|
||||
public static final long DAILY_STREAK_RESET_TIME = 1000 * 60 * 60 * 12;
|
||||
public static final long VOTE_STREAK_RESET_TIME = 1000 * 60 * 60 * 24;
|
||||
|
||||
|
||||
public void attemptDailyBonus(final Player player, final BonusAmount amount, final Callback<Boolean> result)
|
||||
{
|
||||
if (timeTillDailyBonus(player) > 0)
|
||||
@ -823,7 +827,7 @@ public class BonusManager extends MiniClientPlugin<BonusClientData> implements I
|
||||
if (entity.equals(_carlNpc.getEntity()))
|
||||
{
|
||||
updateDailyStreak(event.getPlayer());
|
||||
new BonusGui(_plugin, event.getPlayer(), this, _rewardManager, _facebookManager).openInventory();
|
||||
new BonusGui(_plugin, event.getPlayer(), this, _rewardManager, _facebookManager, _youtubeManager, _boosterManager).openInventory();
|
||||
}
|
||||
}
|
||||
|
||||
@ -839,7 +843,7 @@ public class BonusManager extends MiniClientPlugin<BonusClientData> implements I
|
||||
if (event.getEntity().equals(_carlNpc.getEntity()))
|
||||
{
|
||||
updateDailyStreak(player);
|
||||
new BonusGui(_plugin, player, this, _rewardManager, _facebookManager).openInventory();
|
||||
new BonusGui(_plugin, player, this, _rewardManager, _facebookManager, _youtubeManager, _boosterManager).openInventory();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -901,11 +905,12 @@ public class BonusManager extends MiniClientPlugin<BonusClientData> implements I
|
||||
int availableRewards = 0;
|
||||
|
||||
if (canVote(player)) availableRewards++;
|
||||
if (_youtubeManager.canYoutube(player)) availableRewards++;
|
||||
if (canRank(player) && _clientManager.hasRank(player, Rank.ULTRA) && isPastAugust()) availableRewards++;
|
||||
if (canDaily(player)) availableRewards++;
|
||||
if (getPollManager().getNextPoll(_pollManager.Get(player), _clientManager.Get(player).GetRank()) != null) availableRewards++;
|
||||
if (!_facebookManager.hasRedeemed(player)) availableRewards++;
|
||||
// if (_boosterManager.getTipManager().Get(player).getTips() > 0) availableRewards++;
|
||||
if (_boosterManager.getTipManager().Get(player).getTips() > 0) availableRewards++;
|
||||
|
||||
Hologram hologram;
|
||||
|
||||
@ -1052,6 +1057,11 @@ public class BonusManager extends MiniClientPlugin<BonusClientData> implements I
|
||||
return _facebookManager;
|
||||
}
|
||||
|
||||
public YoutubeManager getYoutubeManager()
|
||||
{
|
||||
return _youtubeManager;
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void Join(final PlayerJoinEvent event)
|
||||
{
|
||||
@ -1069,6 +1079,8 @@ public class BonusManager extends MiniClientPlugin<BonusClientData> implements I
|
||||
public void Quit(PlayerQuitEvent event)
|
||||
{
|
||||
_showCarl.remove(event.getPlayer().getName());
|
||||
// Removes from allow command map
|
||||
UtilPlayer.removeAllowedCommands(event.getPlayer());
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
@ -1183,4 +1195,9 @@ public class BonusManager extends MiniClientPlugin<BonusClientData> implements I
|
||||
{
|
||||
return "SELECT * FROM bonus WHERE accountId = '" + accountId + "';";
|
||||
}
|
||||
|
||||
public BoosterManager getBoosterManager()
|
||||
{
|
||||
return _boosterManager;
|
||||
}
|
||||
}
|
@ -18,7 +18,7 @@ public class GuiCommand extends CommandBase<BonusManager>
|
||||
@Override
|
||||
public void Execute(Player caller, String[] args)
|
||||
{
|
||||
new BonusGui(Plugin.getPlugin(), caller, Plugin, Plugin.getRewardManager(), Plugin.getFacebookManager()).openInventory();
|
||||
new BonusGui(Plugin.getPlugin(), caller, Plugin, Plugin.getRewardManager(), Plugin.getFacebookManager(), Plugin.getYoutubeManager(), Plugin.getBoosterManager()).openInventory();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,12 +1,12 @@
|
||||
package mineplex.core.bonuses.gui;
|
||||
|
||||
import mineplex.core.bonuses.BonusManager;
|
||||
import mineplex.core.bonuses.gui.buttons.*;
|
||||
import mineplex.core.boosters.BoosterManager;
|
||||
import mineplex.core.facebook.FacebookManager;
|
||||
import mineplex.core.gui.SimpleGui;
|
||||
import mineplex.core.reward.RewardManager;
|
||||
import mineplex.core.bonuses.BonusManager;
|
||||
|
||||
import mineplex.core.youtube.YoutubeManager;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
|
||||
@ -15,23 +15,27 @@ public class BonusGui extends SimpleGui
|
||||
|
||||
private BonusManager manager;
|
||||
|
||||
public BonusGui(Plugin plugin, Player player, BonusManager manager, RewardManager rewardManager, FacebookManager facebookManager)
|
||||
public BonusGui(Plugin plugin, Player player, BonusManager manager, RewardManager rewardManager, FacebookManager facebookManager, YoutubeManager youtubeManager, BoosterManager boosterManager)
|
||||
{
|
||||
super(plugin, player, player.getName() + "'s Bonuses", 5 * 9);
|
||||
|
||||
this.manager = manager;
|
||||
|
||||
setItem(9, new VoteButton(plugin, player, this, manager));
|
||||
setItem(10, new VoteButton(plugin, player, this, manager));
|
||||
|
||||
setItem(11, new RankBonusButton(getPlugin(), player, this, manager));
|
||||
setItem(12, new RankBonusButton(getPlugin(), player, this, manager));
|
||||
|
||||
setItem(13, new DailyBonusButton(getPlugin(), player, this, manager));
|
||||
setItem(14, new DailyBonusButton(getPlugin(), player, this, manager));
|
||||
|
||||
setItem(15, new PollButton(getPlugin(), player, manager.getPollManager(), manager.getClientManager(), this, manager));
|
||||
setItem(16, new PollButton(getPlugin(), player, manager.getPollManager(), manager.getClientManager(), this, manager));
|
||||
|
||||
setItem(17, new FacebookButton(player, facebookManager));
|
||||
setItem(19, new FacebookButton(player, facebookManager));
|
||||
|
||||
// setItem(19, new ClaimTipsButton(getPlugin(), player, this, manager, boosterManager));
|
||||
setItem(21, new YoutubeButton(player, youtubeManager));
|
||||
|
||||
setItem(23, new TwitterButton(player));
|
||||
|
||||
setItem(25, new ClaimTipsButton(getPlugin(), player, this, manager, boosterManager));
|
||||
|
||||
setItem(31, new CarlSpinButton(getPlugin(), player, manager, rewardManager));
|
||||
}
|
||||
|
@ -0,0 +1,51 @@
|
||||
package mineplex.core.bonuses.gui;
|
||||
|
||||
import mineplex.core.common.jsonchat.ClickEvent;
|
||||
import mineplex.core.common.jsonchat.JsonMessage;
|
||||
import mineplex.core.common.util.C;
|
||||
import mineplex.core.gui.GuiItem;
|
||||
import mineplex.core.itemstack.ItemBuilder;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.inventory.ClickType;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
public class TwitterButton implements GuiItem
|
||||
{
|
||||
private static final ItemStack ICON = new ItemBuilder(Material.EGG)
|
||||
.setTitle(C.cGreen + C.Bold + "Visit us on Twitter")
|
||||
.addLore(
|
||||
C.cWhite + "Check out and follow Mineplex on",
|
||||
C.cWhite + "Twitter for Giveaways, Announcements,",
|
||||
C.cWhite + "Teasers, and Tips!",
|
||||
" ",
|
||||
C.cGreen + "Click to visit us on Twitter!"
|
||||
)
|
||||
.build();
|
||||
private final Player _player;
|
||||
|
||||
public TwitterButton(Player player)
|
||||
{
|
||||
this._player = player;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setup() {}
|
||||
|
||||
@Override
|
||||
public void close() {}
|
||||
|
||||
@Override
|
||||
public void click(ClickType clickType)
|
||||
{
|
||||
_player.closeInventory();
|
||||
|
||||
new JsonMessage(C.cAquaB + "Click here to visit our Twitter page!").click(ClickEvent.OPEN_URL, "https://www.twitter.com/Mineplex").sendToPlayer(_player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getObject()
|
||||
{
|
||||
return ICON;
|
||||
}
|
||||
}
|
@ -84,10 +84,10 @@ public class ClaimTipsButton implements GuiItem, Listener
|
||||
|
||||
if (getPlayer().getOpenInventory() != null)
|
||||
{
|
||||
new TimedMessageWindow(getPlugin(), getPlayer(), ItemStackFactory.Instance.CreateStack(Material.STAINED_GLASS_PANE, DyeColor.LIME.getData(), 1, ChatColor.GREEN + "Booster Tips Collected"), "Tips Collected", 6*9, 20*3, getGui()).openInventory();
|
||||
new TimedMessageWindow(getPlugin(), getPlayer(), ItemStackFactory.Instance.CreateStack(Material.STAINED_GLASS_PANE, DyeColor.LIME.getData(), 1, ChatColor.GREEN + "Amplifier Thanks Collected"), "Thanks Collected", 6*9, 20*3, getGui()).openInventory();
|
||||
}
|
||||
|
||||
UtilPlayer.message(getPlayer(), F.main("Carl", "You collected " + F.currency(CurrencyType.TREASURE_SHARD, claimed) + " from Booster Tips!"));
|
||||
UtilPlayer.message(getPlayer(), F.main("Carl", "You collected " + F.currency(CurrencyType.TREASURE_SHARD, claimed) + " from Amplifiers!"));
|
||||
// Pending explosions are strange.. Not sure why we are using strings. Either way, lets display a rank reward effect
|
||||
_bonusManager.addPendingExplosion(getPlayer(), "RANK");
|
||||
getPlayer().playSound(getPlayer().getLocation(), Sound.NOTE_PLING, 1, 1.6f);
|
||||
@ -97,10 +97,10 @@ public class ClaimTipsButton implements GuiItem, Listener
|
||||
// No tips to claim
|
||||
if (getPlayer().getOpenInventory() != null)
|
||||
{
|
||||
new TimedMessageWindow(getPlugin(), getPlayer(), ItemStackFactory.Instance.CreateStack(Material.STAINED_GLASS_PANE, DyeColor.RED.getData(), 1, ChatColor.RED + "No Tips to Claim!"), "You have no tips to claim!", 6*9, 20*3, getGui()).openInventory();
|
||||
new TimedMessageWindow(getPlugin(), getPlayer(), ItemStackFactory.Instance.CreateStack(Material.STAINED_GLASS_PANE, DyeColor.RED.getData(), 1, ChatColor.RED + "No Thanks to Claim!"), "You have no thanks to claim!", 6*9, 20*3, getGui()).openInventory();
|
||||
}
|
||||
|
||||
UtilPlayer.message(getPlayer(), F.main("Carl", "You have no tips to claim!"));
|
||||
UtilPlayer.message(getPlayer(), F.main("Carl", "You have no rewards to claim!"));
|
||||
getPlayer().playSound(getPlayer().getLocation(), Sound.ENDERDRAGON_GROWL, 1, 10);
|
||||
}
|
||||
else
|
||||
@ -108,10 +108,10 @@ public class ClaimTipsButton implements GuiItem, Listener
|
||||
// Failed to claim
|
||||
if (getPlayer().getOpenInventory() != null)
|
||||
{
|
||||
new TimedMessageWindow(getPlugin(), getPlayer(), ItemStackFactory.Instance.CreateStack(Material.STAINED_GLASS_PANE, DyeColor.RED.getData(), 1, ChatColor.RED + "Error collecting tips. Try again later."), "Error", 6*9, 20*3, getGui()).openInventory();
|
||||
new TimedMessageWindow(getPlugin(), getPlayer(), ItemStackFactory.Instance.CreateStack(Material.STAINED_GLASS_PANE, DyeColor.RED.getData(), 1, ChatColor.RED + "Error collecting rewards. Try again later."), "Error", 6*9, 20*3, getGui()).openInventory();
|
||||
}
|
||||
|
||||
UtilPlayer.message(getPlayer(), F.main("Carl", "Error collecting tips. Try again later."));
|
||||
UtilPlayer.message(getPlayer(), F.main("Carl", "Error collecting rewards. Try again later."));
|
||||
getPlayer().playSound(getPlayer().getLocation(), Sound.ENDERDRAGON_GROWL, 1, 10);
|
||||
}
|
||||
|
||||
@ -133,9 +133,9 @@ public class ClaimTipsButton implements GuiItem, Listener
|
||||
if (isAvailable())
|
||||
{
|
||||
material = Material.EMERALD;
|
||||
itemName = C.cGreen + C.Bold + "Booster Tips";
|
||||
itemName = C.cGreen + C.Bold + "Game Amplifiers";
|
||||
lore.add(" ");
|
||||
lore.add(C.cYellow + "Your Tips");
|
||||
lore.add(C.cYellow + "Your Rewards");
|
||||
lore.add(" " + C.cWhite + getTips() + " Treasure Shards");
|
||||
lore.add(" ");
|
||||
lore.add(ChatColor.RESET + "Click to Claim!");
|
||||
@ -143,10 +143,12 @@ public class ClaimTipsButton implements GuiItem, Listener
|
||||
else
|
||||
{
|
||||
material = Material.REDSTONE_BLOCK;
|
||||
itemName = C.cRed + C.Bold + "Booster Tips";
|
||||
itemName = C.cRed + C.Bold + "Game Amplifiers";
|
||||
|
||||
lore.add(" ");
|
||||
lore.add(C.Reset + "Activate Game Boosters to receive tips");
|
||||
lore.add(C.cGray + "Use Amplifiers to earn rewards");
|
||||
lore.add(" ");
|
||||
lore.add(C.cWhite + "Get Amplifiers at " + C.cGreen + "mineplex.com/shop");
|
||||
}
|
||||
|
||||
_item = new ShopItem(material, itemName, lore.toArray(new String[0]), 1, false, false);
|
||||
|
@ -0,0 +1,82 @@
|
||||
package mineplex.core.bonuses.gui.buttons;
|
||||
|
||||
import mineplex.core.common.jsonchat.ClickEvent;
|
||||
import mineplex.core.common.jsonchat.JsonMessage;
|
||||
import mineplex.core.common.util.C;
|
||||
import mineplex.core.gui.GuiItem;
|
||||
import mineplex.core.itemstack.ItemBuilder;
|
||||
import mineplex.core.youtube.YoutubeManager;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.inventory.ClickType;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
public class YoutubeButton implements GuiItem
|
||||
{
|
||||
private static final ItemStack DISABLED_ICON = new ItemBuilder(Material.APPLE)
|
||||
.setTitle(C.cGreen + C.Bold + "Visit us on YouTube")
|
||||
.addLore(
|
||||
C.cWhite + "Come back tomorrow for your",
|
||||
C.cWhite + "Daily 250 Shard Reward!",
|
||||
" ",
|
||||
C.cWhite + "Check out the latest Video",
|
||||
C.cWhite + "on the MineplexGames Channel!",
|
||||
" ",
|
||||
C.cWhite + "Be sure and Subscribe so you",
|
||||
C.cWhite + "don't miss a video!",
|
||||
" ",
|
||||
C.cGreen + "Click to visit us on YouTube!"
|
||||
)
|
||||
.build();
|
||||
private static final ItemStack ENABLED_ICON = new ItemBuilder(Material.APPLE)
|
||||
.setTitle(C.cGreen + C.Bold + "Visit us on YouTube")
|
||||
.addLore(
|
||||
C.cYellow + "Claim your Daily 250 Shard Reward",
|
||||
C.cWhite + "by checking out the latest Video",
|
||||
C.cWhite + "on the MineplexGames Channel!",
|
||||
C.cWhite + " ",
|
||||
C.cWhite + "Be sure and Subscribe so you",
|
||||
C.cWhite + "don't miss a video!",
|
||||
" ",
|
||||
C.cGreen + "Click to visit us on YouTube!"
|
||||
)
|
||||
.build();
|
||||
private final Player _player;
|
||||
private final YoutubeManager _youtubeManager;
|
||||
|
||||
public YoutubeButton(Player player, YoutubeManager youtubeManager)
|
||||
{
|
||||
this._player = player;
|
||||
this._youtubeManager = youtubeManager;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setup() {}
|
||||
|
||||
@Override
|
||||
public void close() {}
|
||||
|
||||
@Override
|
||||
public void click(ClickType clickType)
|
||||
{
|
||||
_player.closeInventory();
|
||||
|
||||
final String message;
|
||||
if (_youtubeManager.canYoutube(_player))
|
||||
{
|
||||
message = "Click here to claim YouTube Prize!";
|
||||
_youtubeManager.attemptYoutube(_player);
|
||||
} else
|
||||
{
|
||||
message = "Click here to visit our YouTube page!";
|
||||
}
|
||||
|
||||
new JsonMessage(C.cAquaB + message).click(ClickEvent.OPEN_URL, "https://www.youtube.com/mineplexgamesofficial").sendToPlayer(_player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getObject()
|
||||
{
|
||||
return _youtubeManager.canYoutube(_player) ? ENABLED_ICON : DISABLED_ICON;
|
||||
}
|
||||
}
|
@ -1,5 +1,6 @@
|
||||
package mineplex.core.boosters;
|
||||
|
||||
import com.mojang.authlib.properties.PropertyMap;
|
||||
import mineplex.core.common.util.UtilTime;
|
||||
|
||||
import java.util.Date;
|
||||
@ -10,7 +11,7 @@ import java.util.UUID;
|
||||
*/
|
||||
public class Booster
|
||||
{
|
||||
private int _boosterId;
|
||||
private int _id;
|
||||
private String _playerName;
|
||||
private UUID _uuid;
|
||||
private int _accountId;
|
||||
@ -19,14 +20,15 @@ public class Booster
|
||||
private Date _startTime;
|
||||
private Date _endTime;
|
||||
private Date _activationTime;
|
||||
// private PropertyMap _propertyMap;
|
||||
|
||||
public Booster()
|
||||
{
|
||||
}
|
||||
|
||||
public int getBoosterId()
|
||||
public int getId()
|
||||
{
|
||||
return _boosterId;
|
||||
return _id;
|
||||
}
|
||||
|
||||
public String getPlayerName()
|
||||
@ -66,13 +68,25 @@ public class Booster
|
||||
|
||||
public boolean isActive()
|
||||
{
|
||||
return getEndTime().before(new Date());
|
||||
Date now = new Date();
|
||||
return getStartTime().before(now) && getEndTime().after(now);
|
||||
}
|
||||
|
||||
public long getTimeRemaining()
|
||||
{
|
||||
if (isActive())
|
||||
{
|
||||
return Math.max(0, getEndTime().getTime() - System.currentTimeMillis());
|
||||
}
|
||||
else if (getEndTime().after(new Date()))
|
||||
{
|
||||
return _duration * 1000L;
|
||||
}
|
||||
else
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
public String getTimeRemainingString()
|
||||
{
|
||||
@ -84,6 +98,11 @@ public class Booster
|
||||
return _multiplier;
|
||||
}
|
||||
|
||||
// public PropertyMap getPropertyMap()
|
||||
// {
|
||||
// return _propertyMap;
|
||||
// }
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o)
|
||||
{
|
||||
@ -92,23 +111,28 @@ public class Booster
|
||||
|
||||
Booster booster = (Booster) o;
|
||||
|
||||
if (_boosterId != booster._boosterId) return false;
|
||||
if (_id != booster._id) return false;
|
||||
return _accountId == booster._accountId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode()
|
||||
{
|
||||
int result = _boosterId;
|
||||
int result = _id;
|
||||
result = 31 * result + _accountId;
|
||||
return result;
|
||||
}
|
||||
|
||||
public int getIncreasePercent()
|
||||
{
|
||||
return (int) (getMultiplier() - 1) * 100;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return "Booster{" +
|
||||
"_boosterId=" + _boosterId +
|
||||
"_id=" + _id +
|
||||
", _playerName='" + _playerName + '\'' +
|
||||
", _uuid=" + _uuid +
|
||||
", _accountId=" + _accountId +
|
||||
|
@ -1,12 +0,0 @@
|
||||
package mineplex.core.boosters;
|
||||
|
||||
import mineplex.core.game.GameDisplay;
|
||||
|
||||
/**
|
||||
* @author Shaun Bennett
|
||||
*/
|
||||
public enum BoosterCategory
|
||||
{
|
||||
|
||||
|
||||
}
|
@ -1,31 +1,63 @@
|
||||
package mineplex.core.boosters;
|
||||
|
||||
import com.mojang.authlib.properties.PropertyMap;
|
||||
import mineplex.core.MiniPlugin;
|
||||
import mineplex.core.account.CoreClientManager;
|
||||
import mineplex.core.boosters.command.BoosterCommand;
|
||||
import mineplex.core.boosters.event.BoosterActivateEvent;
|
||||
import mineplex.core.boosters.event.BoosterDeactivateEvent;
|
||||
import mineplex.core.boosters.event.BoosterExpireEvent;
|
||||
import mineplex.core.boosters.event.BoosterUpdateEvent;
|
||||
import mineplex.core.boosters.gui.BoosterShop;
|
||||
import mineplex.core.boosters.redis.BoosterUpdateRepository;
|
||||
import mineplex.core.boosters.tips.BoosterTipManager;
|
||||
import mineplex.core.common.util.C;
|
||||
import mineplex.core.common.util.Callback;
|
||||
import mineplex.core.common.util.UtilGear;
|
||||
import mineplex.core.common.util.UtilInv;
|
||||
import mineplex.core.donation.DonationManager;
|
||||
import mineplex.core.inventory.InventoryManager;
|
||||
import mineplex.core.itemstack.ItemStackFactory;
|
||||
import mineplex.core.updater.UpdateType;
|
||||
import mineplex.core.updater.event.UpdateEvent;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.craftbukkit.v1_8_R3.entity.CraftPlayer;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.Event;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.player.PlayerInteractEvent;
|
||||
import org.bukkit.event.player.PlayerJoinEvent;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.URISyntaxException;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* BoosterManager handles the majority of logic for creating and getting Boosters. Every BoosterManager stores a cache
|
||||
* for all boosters across all servers. We pull all boosters from the API when the server boots up. To keep them in sync,
|
||||
* instead of consistently polling the API I have decided to go with a redis pub/sub solution to ensuring all boosters
|
||||
* across all servers are up to date. Whenever the Booster API receives a call to add or modify boosters, it will publish
|
||||
* an updated version of all boosters over redis.
|
||||
*
|
||||
* Boosters are enabled on live servers using "Booster Groups". A {@link mineplex.serverdata.data.ServerGroup} can specify
|
||||
* which BoosterGroup applies to it. If there is no BoosterGroup, then it means the server does not use boosters. To add
|
||||
* a BoosterGroup, you must add to the "boostergroups" set on redis (the same way the servergroups set works), otherwise
|
||||
* the API will return an error saying that BoosterGroup does not exist. Currently BoosterGroups are no more than a String
|
||||
* key for Boosters. In the future we may want to look into implementing BoosterGroup specific data such as default
|
||||
* booster length and multiplier.
|
||||
*
|
||||
* @author Shaun Bennett
|
||||
*/
|
||||
public class BoosterManager extends MiniPlugin
|
||||
{
|
||||
// The InventoryManager item name for boosters. This is required to activate a booster on servers
|
||||
public static final String BOOSTER_ITEM = "Game Booster";
|
||||
// Item in arcade lobbies that opens the booster gui
|
||||
public static final ItemStack INTERFACE_ITEM = ItemStackFactory.Instance.CreateStack(Material.EMERALD, (byte)0, 1, ChatColor.RESET + C.cGreen + "Game Amplifiers");
|
||||
// Slot for the booster gui item
|
||||
public static final int INTERFACE_SLOT = 7;
|
||||
|
||||
private BoosterRepository _repository;
|
||||
private CoreClientManager _clientManager;
|
||||
private DonationManager _donationManager;
|
||||
@ -33,15 +65,19 @@ public class BoosterManager extends MiniPlugin
|
||||
|
||||
private BoosterTipManager _tipManager;
|
||||
private BoosterShop _shop;
|
||||
private String _boosterGroup;
|
||||
|
||||
private boolean _giveInterfaceItem;
|
||||
|
||||
private long _cacheLastUpdated;
|
||||
private Map<String, List<Booster>> _boosterCache = new HashMap<>();
|
||||
|
||||
public BoosterManager(JavaPlugin plugin, CoreClientManager clientManager, DonationManager donationManager, InventoryManager inventoryManager)
|
||||
public BoosterManager(JavaPlugin plugin, String boosterGroup, CoreClientManager clientManager, DonationManager donationManager, InventoryManager inventoryManager)
|
||||
{
|
||||
super("Booster Manager", plugin);
|
||||
|
||||
_repository = new BoosterRepository();
|
||||
_boosterGroup = boosterGroup;
|
||||
_clientManager = clientManager;
|
||||
_donationManager = donationManager;
|
||||
_inventoryManager = inventoryManager;
|
||||
@ -51,13 +87,18 @@ public class BoosterManager extends MiniPlugin
|
||||
|
||||
try
|
||||
{
|
||||
_boosterCache = _repository.getBoosters();
|
||||
Map<String, List<Booster>> boosters = _repository.getBoosters();
|
||||
if (boosters != null) _boosterCache = boosters;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
System.out.println("Failed to load boosters on server start.");
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
_giveInterfaceItem = canActivateBoosters();
|
||||
|
||||
new BoosterUpdateRepository(plugin);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -66,6 +107,10 @@ public class BoosterManager extends MiniPlugin
|
||||
addCommand(new BoosterCommand(this));
|
||||
}
|
||||
|
||||
/**
|
||||
* Make an API call to grab all Boosters
|
||||
*/
|
||||
@Deprecated
|
||||
public void getBoostersAsync(Callback<Map<String, List<Booster>>> callback)
|
||||
{
|
||||
runAsync(() -> {
|
||||
@ -75,29 +120,7 @@ public class BoosterManager extends MiniPlugin
|
||||
Map<String, List<Booster>> boosters = _repository.getBoosters();
|
||||
long timeTaken = System.currentTimeMillis() - time;
|
||||
runSync(() -> {
|
||||
|
||||
_boosterCache.entrySet().stream()
|
||||
.filter(entry -> entry.getValue().size() > 0)
|
||||
.filter(entry -> boosters.get(entry.getKey()) == null)
|
||||
.forEach(entry -> callNextTick(new BoosterDeactivateEvent(entry.getValue().get(0))));
|
||||
|
||||
for (Map.Entry<String, List<Booster>> entry : boosters.entrySet())
|
||||
{
|
||||
List<Booster> current = _boosterCache.get(entry.getKey());
|
||||
if (current == null || current.get(0) == null)
|
||||
{
|
||||
callNextTick(new BoosterActivateEvent(entry.getValue().get(0)));
|
||||
}
|
||||
else if (!current.get(0).equals(entry.getValue().get(0)))
|
||||
{
|
||||
callNextTick(new BoosterDeactivateEvent(current.get(0)));
|
||||
callNextTick(new BoosterActivateEvent(entry.getValue().get(0)));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
_cacheLastUpdated = System.currentTimeMillis();
|
||||
_boosterCache = boosters;
|
||||
handleBoosterUpdate(boosters);
|
||||
if (callback != null) callback.run(boosters);
|
||||
});
|
||||
}
|
||||
@ -109,9 +132,153 @@ public class BoosterManager extends MiniPlugin
|
||||
});
|
||||
}
|
||||
|
||||
public Booster getActiveBoosterFromCache(String serverGroup)
|
||||
/**
|
||||
* Make an API call to grab all boosters for a specific booster group
|
||||
* @param boosterGroup
|
||||
* @param callback
|
||||
*/
|
||||
@Deprecated
|
||||
public void getBoostersAsync(String boosterGroup, Callback<List<Booster>> callback)
|
||||
{
|
||||
List<Booster> boosters = _boosterCache.get(serverGroup);
|
||||
runAsync(() -> {
|
||||
try
|
||||
{
|
||||
List<Booster> boosters = _repository.getBoosters(boosterGroup);
|
||||
if (callback != null) runSync(() -> callback.run(boosters));
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
System.err.println("Failed to grab boosters for boostergroup: " + boosterGroup);
|
||||
e.printStackTrace();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Process the new boosterMap whenever a BoosterUpdateEvent is sent. This will compare itself to the current
|
||||
* cached BoosterMap and call events when it finds a booster was activated or deactivated
|
||||
* @param boosterMap The new booster map
|
||||
*/
|
||||
private void handleBoosterUpdate(Map<String, List<Booster>> boosterMap)
|
||||
{
|
||||
_boosterCache.entrySet().stream()
|
||||
.filter(entry -> entry.getValue().size() > 0)
|
||||
.filter(entry -> boosterMap.get(entry.getKey()) == null)
|
||||
.forEach(entry -> callNextTick(new BoosterExpireEvent(entry.getKey(), entry.getValue().get(0))));
|
||||
|
||||
for (Map.Entry<String, List<Booster>> entry : boosterMap.entrySet())
|
||||
{
|
||||
List<Booster> current = _boosterCache.get(entry.getKey());
|
||||
if (entry.getValue() != null && !entry.getValue().isEmpty())
|
||||
{
|
||||
if (current == null || current.isEmpty())
|
||||
{
|
||||
// New booster was added
|
||||
callNextTick(new BoosterActivateEvent(entry.getKey(), entry.getValue().get(0)));
|
||||
} else if (!current.get(0).equals(entry.getValue().get(0)))
|
||||
{
|
||||
// First booster was deactivated, new booster replaced it
|
||||
callNextTick(new BoosterExpireEvent(entry.getKey(), current.get(0)));
|
||||
callNextTick(new BoosterActivateEvent(entry.getKey(), entry.getValue().get(0)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
_cacheLastUpdated = System.currentTimeMillis();
|
||||
_boosterCache = boosterMap;
|
||||
}
|
||||
|
||||
private void tickBoosterCache()
|
||||
{
|
||||
List<Event> events = new ArrayList<>(3);
|
||||
for (Map.Entry<String, List<Booster>> entry : _boosterCache.entrySet())
|
||||
{
|
||||
Iterator<Booster> iterator = entry.getValue().iterator();
|
||||
boolean removedOne = false;
|
||||
while (iterator.hasNext())
|
||||
{
|
||||
Booster booster = iterator.next();
|
||||
if (!booster.isActive())
|
||||
{
|
||||
iterator.remove();
|
||||
removedOne = true;
|
||||
events.add(new BoosterExpireEvent(entry.getKey(), booster));
|
||||
}
|
||||
else
|
||||
{
|
||||
if (removedOne) events.add(new BoosterActivateEvent(entry.getKey(), booster));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
events.forEach(Bukkit.getPluginManager()::callEvent);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void tickBoosters(UpdateEvent event)
|
||||
{
|
||||
if (event.getType() == UpdateType.MIN_10)
|
||||
{
|
||||
// sync with API every 10 minutes, incase pubsub fails
|
||||
getBoostersAsync(null);
|
||||
}
|
||||
else if (event.getType() == UpdateType.SEC)
|
||||
{
|
||||
tickBoosterCache();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Return all boosters for the active booster group
|
||||
* @return list of boosters, or null if there is no active booster group
|
||||
*/
|
||||
public List<Booster> getBoosters()
|
||||
{
|
||||
if (_boosterGroup == null || _boosterGroup.length() == 0)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
else
|
||||
{
|
||||
List<Booster> boosters = _boosterCache.get(_boosterGroup);
|
||||
return boosters == null ? Collections.emptyList() : boosters;
|
||||
}
|
||||
}
|
||||
|
||||
public String getBoosterGroup()
|
||||
{
|
||||
return _boosterGroup;
|
||||
}
|
||||
|
||||
public long getBoostTime()
|
||||
{
|
||||
return getBoostTime(_boosterGroup);
|
||||
}
|
||||
|
||||
public long getBoostTime(String boosterGroup)
|
||||
{
|
||||
long time = 0;
|
||||
List<Booster> boosters = _boosterCache.get(boosterGroup);
|
||||
if (boosters != null && boosters.size() > 0)
|
||||
{
|
||||
for (Booster booster : boosters)
|
||||
{
|
||||
time += booster.getTimeRemaining();
|
||||
}
|
||||
}
|
||||
|
||||
return time;
|
||||
}
|
||||
|
||||
public Booster getActiveBooster()
|
||||
{
|
||||
return getActiveBooster(_boosterGroup);
|
||||
}
|
||||
|
||||
public Booster getActiveBooster(String boosterGroup)
|
||||
{
|
||||
List<Booster> boosters = _boosterCache.get(boosterGroup);
|
||||
if (boosters != null)
|
||||
{
|
||||
for (Booster booster : boosters)
|
||||
@ -124,20 +291,9 @@ public class BoosterManager extends MiniPlugin
|
||||
return null;
|
||||
}
|
||||
|
||||
public void getBoostersAsync(String serverGroup, Callback<List<Booster>> callback)
|
||||
public void activateBooster(Player player, Callback<BoosterApiResponse> callback)
|
||||
{
|
||||
runAsync(() -> {
|
||||
try
|
||||
{
|
||||
List<Booster> boosters = _repository.getBoosters(serverGroup);
|
||||
if (callback != null) runSync(() -> callback.run(boosters));
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
System.err.println("Failed to grab boosters for servergroup: " + serverGroup);
|
||||
e.printStackTrace();
|
||||
}
|
||||
});
|
||||
activateBooster(_boosterGroup, player, callback);
|
||||
}
|
||||
|
||||
public void activateBooster(String serverGroup, Player player, Callback<BoosterApiResponse> callback)
|
||||
@ -145,6 +301,7 @@ public class BoosterManager extends MiniPlugin
|
||||
String playerName = player.getName();
|
||||
UUID uuid = player.getUniqueId();
|
||||
int accountId = _clientManager.getAccountId(player);
|
||||
// PropertyMap propertyMap = ((CraftPlayer) player).getHandle().getProfile().getProperties();
|
||||
|
||||
runAsync(() -> {
|
||||
BoosterApiResponse response = _repository.addBooster(serverGroup, playerName, uuid, accountId, 3600);
|
||||
@ -152,18 +309,28 @@ public class BoosterManager extends MiniPlugin
|
||||
});
|
||||
}
|
||||
|
||||
public void chargeBooster(Player player, Callback<Boolean> callback)
|
||||
{
|
||||
_inventoryManager.addItemToInventory(callback, player, BOOSTER_ITEM, -1);
|
||||
}
|
||||
|
||||
public void refundBooster(Player player, Callback<Boolean> callback)
|
||||
{
|
||||
_inventoryManager.addItemToInventory(callback, player, BOOSTER_ITEM, 1);
|
||||
}
|
||||
|
||||
public void openShop(Player player)
|
||||
{
|
||||
_shop.attemptShopOpen(player);
|
||||
}
|
||||
|
||||
/**
|
||||
* Booster updates are sent from {@link mineplex.core.boosters.redis.BoosterUpdateListener}
|
||||
*/
|
||||
@EventHandler
|
||||
public void updateCache(UpdateEvent event)
|
||||
public void onBoosterUpdate(BoosterUpdateEvent event)
|
||||
{
|
||||
if (event.getType() == UpdateType.SEC_30)
|
||||
{
|
||||
getBoostersAsync(null);
|
||||
}
|
||||
handleBoosterUpdate(event.getBoosterMap());
|
||||
}
|
||||
|
||||
public BoosterTipManager getTipManager()
|
||||
@ -178,7 +345,7 @@ public class BoosterManager extends MiniPlugin
|
||||
*/
|
||||
public int getAvailableBoosterCount(Player player)
|
||||
{
|
||||
return _inventoryManager.Get(player).getItemCount("Game Booster");
|
||||
return _inventoryManager.Get(player).getItemCount(BOOSTER_ITEM);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -187,18 +354,37 @@ public class BoosterManager extends MiniPlugin
|
||||
*/
|
||||
public boolean canActivateBoosters()
|
||||
{
|
||||
return true;
|
||||
return _boosterGroup != null && _boosterGroup.length() > 0;
|
||||
}
|
||||
|
||||
public static void main(String[] args) throws IOException, URISyntaxException, InterruptedException
|
||||
public void giveInterfaceItem(Player player)
|
||||
{
|
||||
BoosterRepository repository = new BoosterRepository();
|
||||
Map<String, List<Booster>> boosters = repository.getBoosters();
|
||||
boosters.entrySet().forEach((entry) -> {
|
||||
System.out.println("Booster Entry: " + entry.getKey());
|
||||
System.out.println("Booster Size: " + entry.getValue().size());
|
||||
entry.getValue().forEach(System.out::println);
|
||||
});
|
||||
if (_giveInterfaceItem && !UtilGear.isMat(player.getInventory().getItem(INTERFACE_SLOT), Material.EMERALD))
|
||||
{
|
||||
player.getInventory().setItem(INTERFACE_SLOT, INTERFACE_ITEM);
|
||||
|
||||
UtilInv.Update(player);
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onJoin(PlayerJoinEvent event)
|
||||
{
|
||||
giveInterfaceItem(event.getPlayer());
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onInteract(PlayerInteractEvent event)
|
||||
{
|
||||
if (INTERFACE_ITEM.equals(event.getPlayer().getItemInHand()))
|
||||
{
|
||||
openShop(event.getPlayer());
|
||||
}
|
||||
}
|
||||
|
||||
public Map<String, List<Booster>> getBoosterCache()
|
||||
{
|
||||
return _boosterCache;
|
||||
}
|
||||
|
||||
private void callNextTick(Event event)
|
||||
|
@ -1,8 +0,0 @@
|
||||
package mineplex.core.boosters;
|
||||
|
||||
/**
|
||||
* @author Shaun Bennett
|
||||
*/
|
||||
public class BoosterMap
|
||||
{
|
||||
}
|
@ -0,0 +1,59 @@
|
||||
package mineplex.core.boosters;
|
||||
|
||||
import mineplex.core.common.util.C;
|
||||
import mineplex.core.common.util.F;
|
||||
import mineplex.core.common.util.UtilTime;
|
||||
import mineplex.core.shop.confirmation.ConfirmationCallback;
|
||||
import mineplex.core.shop.confirmation.ConfirmationProcessor;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
/**
|
||||
* @author Shaun Bennett
|
||||
*/
|
||||
public class BoosterProcessor implements ConfirmationProcessor
|
||||
{
|
||||
private BoosterManager _boosterManager;
|
||||
private Player _player;
|
||||
|
||||
public BoosterProcessor(BoosterManager boosterManager, Player player)
|
||||
{
|
||||
_boosterManager = boosterManager;
|
||||
_player = player;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void process(ConfirmationCallback callback)
|
||||
{
|
||||
_boosterManager.chargeBooster(_player, data -> {
|
||||
if (data)
|
||||
{
|
||||
_boosterManager.activateBooster(_player, response -> {
|
||||
if (response.isSuccess())
|
||||
{
|
||||
long timeToStart = response.getStartTime().getTime() - System.currentTimeMillis();
|
||||
if (timeToStart <= 0) _player.sendMessage(F.main("Amplifier", "Game Amplifier Activated!"));
|
||||
else _player.sendMessage(F.main("Amplifier", "Game Amplifier Added. It will start in " + F.elem(UtilTime.convertString(timeToStart, 2, UtilTime.TimeUnit.FIT))));
|
||||
callback.resolve("Success!");
|
||||
}
|
||||
else
|
||||
{
|
||||
_player.sendMessage(C.cRed + "There was an error trying to enable your Game Amplifier");
|
||||
if (response.getStatusCode() == 503 && response.getError() != null && response.getError().length() > 0)
|
||||
{
|
||||
// Service Unavailable HTTP Code
|
||||
_player.sendMessage(C.cRed + "Error: " + response.getError());
|
||||
}
|
||||
|
||||
_boosterManager.refundBooster(_player, null);
|
||||
callback.reject("Failed. Try again later.");
|
||||
}
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
callback.reject("Failed charging account.");
|
||||
_player.sendMessage(F.main("Amplifier", "There was an error charging your account. Try again later!"));
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
@ -4,6 +4,7 @@ import com.google.common.reflect.TypeToken;
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.GsonBuilder;
|
||||
import com.google.gson.JsonObject;
|
||||
import com.mojang.authlib.properties.PropertyMap;
|
||||
import mineplex.core.common.api.ApiEndpoint;
|
||||
import mineplex.core.common.api.ApiFieldNamingStrategy;
|
||||
import mineplex.core.common.api.ApiResponse;
|
||||
@ -14,6 +15,8 @@ import java.util.Map;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* Boosters interaction is handled through a web API. All data is represented as JSON and then parsed using gson.
|
||||
*
|
||||
* @author Shaun Bennett
|
||||
*/
|
||||
public class BoosterRepository extends ApiEndpoint
|
||||
@ -21,6 +24,7 @@ public class BoosterRepository extends ApiEndpoint
|
||||
public BoosterRepository()
|
||||
{
|
||||
super("/booster", new GsonBuilder().setFieldNamingStrategy(new ApiFieldNamingStrategy())
|
||||
// .registerTypeAdapter(PropertyMap.class, new PropertyMap.Serializer())
|
||||
.setDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSX").create());
|
||||
}
|
||||
|
||||
@ -41,6 +45,7 @@ public class BoosterRepository extends ApiEndpoint
|
||||
body.addProperty("uuid", uuid.toString());
|
||||
body.addProperty("accountId", accountId);
|
||||
body.addProperty("duration", duration);
|
||||
// body.add("propertyMap", getGson().toJsonTree(propertyMap));
|
||||
|
||||
return getWebCall().post("/" + serverGroup, BoosterApiResponse.class, body);
|
||||
}
|
||||
|
@ -32,11 +32,11 @@ public class AddCommand extends CommandBase<BoosterManager>
|
||||
{
|
||||
if (response.isSuccess())
|
||||
{
|
||||
UtilPlayer.message(caller, F.main("Booster", "Successfully added booster to " + F.elem(serverGroup)));
|
||||
UtilPlayer.message(caller, F.main("Amplifier", "Successfully added amplifier to " + F.elem(serverGroup)));
|
||||
}
|
||||
else
|
||||
{
|
||||
UtilPlayer.message(caller, F.main("Booster", "Failed to add booster. Error: " + F.elem(response.getError())));
|
||||
UtilPlayer.message(caller, F.main("Amplifier", "Failed to add amplifier. Error: " + F.elem(response.getError())));
|
||||
}
|
||||
}
|
||||
});
|
||||
@ -49,6 +49,6 @@ public class AddCommand extends CommandBase<BoosterManager>
|
||||
|
||||
private void help(Player caller)
|
||||
{
|
||||
UtilPlayer.message(caller, F.help("booster add <servergroup>", "Add a booster to that server group", Rank.DEVELOPER));
|
||||
UtilPlayer.message(caller, F.help("amplifier add <servergroup>", "Add an amplifier to that server group", Rank.DEVELOPER));
|
||||
}
|
||||
}
|
||||
|
@ -15,14 +15,17 @@ public class BoosterCommand extends MultiCommandBase<BoosterManager>
|
||||
{
|
||||
public BoosterCommand(BoosterManager plugin)
|
||||
{
|
||||
super(plugin, Rank.DEVELOPER, "booster");
|
||||
super(plugin, Rank.DEVELOPER, "amplifier", "booster");
|
||||
|
||||
AddCommand(new AddCommand(plugin));
|
||||
AddCommand(new GuiCommand(plugin));
|
||||
AddCommand(new ReloadCommand(plugin));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void Help(Player caller, String[] args)
|
||||
{
|
||||
UtilPlayer.message(caller, F.help("booster add <servergroup>", "Add a booster to that server group", Rank.DEVELOPER));
|
||||
UtilPlayer.message(caller, F.help("amplifier add <group>", "Add an amplifier to that group", Rank.DEVELOPER));
|
||||
UtilPlayer.message(caller, F.help("amplifier gui", "Open Amplifier GUI", Rank.DEVELOPER));
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,23 @@
|
||||
package mineplex.core.boosters.command;
|
||||
|
||||
import mineplex.core.boosters.BoosterManager;
|
||||
import mineplex.core.command.CommandBase;
|
||||
import mineplex.core.common.Rank;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
/**
|
||||
* @author Shaun Bennett
|
||||
*/
|
||||
public class GuiCommand extends CommandBase<BoosterManager>
|
||||
{
|
||||
public GuiCommand(BoosterManager plugin)
|
||||
{
|
||||
super(plugin, Rank.DEVELOPER, "gui");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void Execute(Player caller, String[] args)
|
||||
{
|
||||
Plugin.openShop(caller);
|
||||
}
|
||||
}
|
@ -0,0 +1,35 @@
|
||||
package mineplex.core.boosters.command;
|
||||
|
||||
import mineplex.core.boosters.Booster;
|
||||
import mineplex.core.boosters.BoosterManager;
|
||||
import mineplex.core.command.CommandBase;
|
||||
import mineplex.core.common.Rank;
|
||||
import mineplex.core.common.util.Callback;
|
||||
import mineplex.core.common.util.F;
|
||||
import mineplex.core.common.util.UtilPlayer;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author Shaun Bennett
|
||||
*/
|
||||
public class ReloadCommand extends CommandBase<BoosterManager>
|
||||
{
|
||||
public ReloadCommand(BoosterManager plugin)
|
||||
{
|
||||
super(plugin, Rank.DEVELOPER, "reload");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void Execute(Player caller, String[] args)
|
||||
{
|
||||
Plugin.getBoostersAsync(data -> {
|
||||
if (data != null)
|
||||
{
|
||||
UtilPlayer.message(caller, F.main("Amplifier", "Amplifiers reloaded!"));
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
@ -5,17 +5,27 @@ import org.bukkit.event.Event;
|
||||
import org.bukkit.event.HandlerList;
|
||||
|
||||
/**
|
||||
* Called when a Booster is activated. This will be called regardless of which "BoosterGroup" the current server is set
|
||||
* to, so if you only want Boosters on the current BoosterGroup, you will need to verify it.
|
||||
*
|
||||
* @author Shaun Bennett
|
||||
*/
|
||||
public class BoosterActivateEvent extends Event
|
||||
{
|
||||
private String _boosterGroup;
|
||||
private Booster _booster;
|
||||
|
||||
public BoosterActivateEvent(Booster booster)
|
||||
public BoosterActivateEvent(String boosterGroup, Booster booster)
|
||||
{
|
||||
_boosterGroup = boosterGroup;
|
||||
_booster = booster;
|
||||
}
|
||||
|
||||
public String getBoosterGroup()
|
||||
{
|
||||
return _boosterGroup;
|
||||
}
|
||||
|
||||
public Booster getBooster()
|
||||
{
|
||||
return _booster;
|
||||
|
@ -5,17 +5,26 @@ import org.bukkit.event.Event;
|
||||
import org.bukkit.event.HandlerList;
|
||||
|
||||
/**
|
||||
* Called when a Booster is finished.
|
||||
*
|
||||
* @author Shaun Bennett
|
||||
*/
|
||||
public class BoosterDeactivateEvent extends Event
|
||||
public class BoosterExpireEvent extends Event
|
||||
{
|
||||
private String _boosterGroup;
|
||||
private Booster _booster;
|
||||
|
||||
public BoosterDeactivateEvent(Booster booster)
|
||||
public BoosterExpireEvent(String boosterGroup, Booster booster)
|
||||
{
|
||||
_boosterGroup = boosterGroup;
|
||||
_booster = booster;
|
||||
}
|
||||
|
||||
public String getBoosterGroup()
|
||||
{
|
||||
return _boosterGroup;
|
||||
}
|
||||
|
||||
public Booster getBooster()
|
||||
{
|
||||
return _booster;
|
@ -0,0 +1,41 @@
|
||||
package mineplex.core.boosters.event;
|
||||
|
||||
import mineplex.core.boosters.Booster;
|
||||
import org.bukkit.event.Event;
|
||||
import org.bukkit.event.HandlerList;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Called when {@link mineplex.core.boosters.redis.BoosterUpdateListener} receives updated Boosters over redis pubsub.
|
||||
*
|
||||
* @author Shaun Bennett
|
||||
*/
|
||||
public class BoosterUpdateEvent extends Event
|
||||
{
|
||||
private Map<String, List<Booster>> _boosterMap;
|
||||
|
||||
public BoosterUpdateEvent(Map<String, List<Booster>> boosterMap)
|
||||
{
|
||||
_boosterMap = boosterMap;
|
||||
}
|
||||
|
||||
public Map<String, List<Booster>> getBoosterMap()
|
||||
{
|
||||
return _boosterMap;
|
||||
}
|
||||
|
||||
private static final HandlerList _handlers = new HandlerList();
|
||||
private static HandlerList getHandlerList()
|
||||
{
|
||||
return _handlers;
|
||||
}
|
||||
|
||||
@Override
|
||||
public HandlerList getHandlers()
|
||||
{
|
||||
return getHandlerList();
|
||||
}
|
||||
|
||||
}
|
@ -4,6 +4,7 @@ import mineplex.core.boosters.BoosterApiResponse;
|
||||
import mineplex.core.boosters.BoosterManager;
|
||||
import mineplex.core.common.util.C;
|
||||
import mineplex.core.common.util.Callback;
|
||||
import mineplex.core.common.util.F;
|
||||
import mineplex.core.common.util.UtilTime;
|
||||
import mineplex.core.shop.item.IButton;
|
||||
import org.bukkit.entity.Player;
|
||||
@ -12,6 +13,7 @@ import org.bukkit.event.inventory.ClickType;
|
||||
/**
|
||||
* @author Shaun Bennett
|
||||
*/
|
||||
@Deprecated
|
||||
public class ActivateBoosterButton implements IButton
|
||||
{
|
||||
private BoosterShop _boosterShop;
|
||||
@ -27,21 +29,26 @@ public class ActivateBoosterButton implements IButton
|
||||
public void onClick(Player player, ClickType clickType)
|
||||
{
|
||||
player.closeInventory();
|
||||
_boosterManager.activateBooster("Testing", player, new Callback<BoosterApiResponse>()
|
||||
{
|
||||
@Override
|
||||
public void run(BoosterApiResponse response)
|
||||
|
||||
_boosterManager.chargeBooster(player, data -> {
|
||||
if (data)
|
||||
{
|
||||
_boosterManager.activateBooster(player, response -> {
|
||||
if (response.isSuccess())
|
||||
{
|
||||
long timeToStart = response.getStartTime().getTime() - System.currentTimeMillis();
|
||||
if (timeToStart <= 0) player.sendMessage(C.cGreen + "Booster activated and enabled now!");
|
||||
else player.sendMessage(C.cGreen + "Booster activated. Enabled in " + UtilTime.convertString(timeToStart, 2, UtilTime.TimeUnit.FIT));
|
||||
if (timeToStart <= 0) player.sendMessage(F.main("Amplifier", "Amplifier Activated!"));
|
||||
else player.sendMessage(F.main("Amplifier", "Game Amplifier Added. It will start in " + F.elem(UtilTime.convertString(timeToStart, 2, UtilTime.TimeUnit.FIT))));
|
||||
}
|
||||
else
|
||||
{
|
||||
player.sendMessage(C.cRed + "There was an error trying to enable your booster :(");
|
||||
player.sendMessage(C.cRed + "There was an error trying to enable your Amplifier :(");
|
||||
}
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
player.sendMessage(F.main("Amplifier", "There was an error charging your account. Try again later!"));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -1,25 +1,33 @@
|
||||
package mineplex.core.boosters.gui;
|
||||
|
||||
import mineplex.core.account.CoreClientManager;
|
||||
import mineplex.core.boosters.BoosterCategory;
|
||||
import mineplex.core.boosters.Booster;
|
||||
import mineplex.core.boosters.BoosterManager;
|
||||
import mineplex.core.boosters.BoosterProcessor;
|
||||
import mineplex.core.common.Pair;
|
||||
import mineplex.core.common.util.C;
|
||||
import mineplex.core.common.util.UtilTime;
|
||||
import mineplex.core.donation.DonationManager;
|
||||
import mineplex.core.shop.confirmation.ConfirmationPage;
|
||||
import mineplex.core.shop.item.ShopItem;
|
||||
import mineplex.core.shop.page.ShopPageBase;
|
||||
import org.apache.commons.lang3.tuple.Triple;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.inventory.ClickType;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author Shaun Bennett
|
||||
*/
|
||||
public class BoosterPage extends ShopPageBase<BoosterManager, BoosterShop>
|
||||
{
|
||||
public BoosterPage(BoosterManager plugin, BoosterShop shop, CoreClientManager clientManager, DonationManager donationManager, Player player, BoosterCategory category)
|
||||
public BoosterPage(BoosterManager plugin, BoosterShop shop, CoreClientManager clientManager, DonationManager donationManager, Player player)
|
||||
{
|
||||
super(plugin, shop, clientManager, donationManager, "Booster", player);
|
||||
super(plugin, shop, clientManager, donationManager, "Game Amplifiers", player, 45);
|
||||
|
||||
buildPage();
|
||||
}
|
||||
@ -29,15 +37,194 @@ public class BoosterPage extends ShopPageBase<BoosterManager, BoosterShop>
|
||||
{
|
||||
ArrayList<String> lore = new ArrayList<>();
|
||||
|
||||
int amplifierCount = getPlugin().getAvailableBoosterCount(getPlayer());
|
||||
lore.add(" ");
|
||||
lore.add(C.cWhite + "You Own: " + getPlugin().getAvailableBoosterCount(getPlayer()));
|
||||
if (getPlugin().canActivateBoosters())
|
||||
lore.add(C.cWhite + "You own " + C.cGreen + amplifierCount + C.cWhite + " Game Amplifiers");
|
||||
if (getPlugin().canActivateBoosters() && amplifierCount > 0)
|
||||
{
|
||||
List<Booster> boosters = getPlugin().getBoosters();
|
||||
|
||||
long waitTime = getPlugin().getBoostTime();
|
||||
if (waitTime == 0)
|
||||
{
|
||||
lore.add(C.cWhite + "Amplifier would activate " + C.cGreen + "now");
|
||||
lore.add(" ");
|
||||
lore.add(C.cGray + "Once this Amplifier is activated");
|
||||
lore.add(C.cGray + "or queued you are not able to");
|
||||
lore.add(C.cGray + "cancel or refund it. You will still");
|
||||
lore.add(C.cGray + "earn rewards if you are offline.");
|
||||
lore.add(" ");
|
||||
lore.add(C.cWhite + "Click to Activate Amplifier");
|
||||
}
|
||||
else
|
||||
{
|
||||
lore.add(" ");
|
||||
lore.add(C.cWhite + "Click to Activate");
|
||||
lore.add(C.cWhite + "Amplifier would activate in " + C.cGreen + UtilTime.convertColonString(waitTime, UtilTime.TimeUnit.HOURS, UtilTime.TimeUnit.SECONDS));
|
||||
if (boosters.size() - 1 == 1)
|
||||
{
|
||||
lore.add(C.cWhite + "There is " + C.cGreen + 1 + C.cWhite + " Amplifier queued");
|
||||
}
|
||||
else if (boosters.size() - 1 > 0)
|
||||
{
|
||||
lore.add(C.cWhite + "There are " + C.cGreen + (boosters.size() - 1) + C.cWhite + " Amplifiers queued");
|
||||
}
|
||||
lore.add(" ");
|
||||
lore.add(C.cGray + "Once this Amplifier is activated");
|
||||
lore.add(C.cGray + "or queued you are not able to");
|
||||
lore.add(C.cGray + "cancel or refund it. You will still");
|
||||
lore.add(C.cGray + "earn rewards if you are offline.");
|
||||
lore.add(" ");
|
||||
lore.add(C.cWhite + "Click to Queue Amplifier");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
lore.add(" ");
|
||||
lore.add(C.cGray + "Game Amplifiers allow you to");
|
||||
lore.add(C.cGray + "increase the gems and shards");
|
||||
lore.add(C.cGray + "earned in that game for 1 hour.");
|
||||
lore.add(C.cGray + "You will also earn bonus rewards");
|
||||
lore.add(C.cGray + "from players thanking you while");
|
||||
lore.add(C.cGray + "your amplifier is active.");
|
||||
lore.add(" ");
|
||||
lore.add(C.cWhite + "Get Amplifiers at " + C.cGreen + "mineplex.com/shop");
|
||||
}
|
||||
|
||||
ShopItem booster = new ShopItem(Material.SUGAR, "Game Booster", lore.toArray(new String[0]), 0, false, false);
|
||||
setItem(4, booster);
|
||||
ShopItem booster = new ShopItem(Material.SUGAR, "Game Amplifier", lore.toArray(new String[0]), 0, false, false);
|
||||
if (getPlugin().canActivateBoosters() && amplifierCount > 0)
|
||||
{
|
||||
addButton(13, booster, this::openConfirmation);
|
||||
}
|
||||
else
|
||||
{
|
||||
setItem(13, booster);
|
||||
}
|
||||
|
||||
addBoosterQueue();
|
||||
// addOtherBoosters();
|
||||
}
|
||||
|
||||
private void openConfirmation(Player player, ClickType type)
|
||||
{
|
||||
ArrayList<String> lore = new ArrayList<>();
|
||||
lore.add(" ");
|
||||
lore.add(C.cGray + "Once this Amplifier is activated");
|
||||
lore.add(C.cGray + "or queued you are not able to");
|
||||
lore.add(C.cGray + "cancel or refund it. You will still");
|
||||
lore.add(C.cGray + "earn rewards if you are offline.");
|
||||
ShopItem booster = new ShopItem(Material.SUGAR, "Game Amplifier", lore.toArray(new String[0]), 0, false, false);
|
||||
|
||||
BoosterProcessor processor = new BoosterProcessor(getPlugin(), getPlayer());
|
||||
ConfirmationPage<BoosterManager, BoosterShop> page = new ConfirmationPage<>(getPlugin(), getShop(),
|
||||
getClientManager(), getDonationManager(), getPlayer(), this, processor, booster);
|
||||
getShop().openPageForPlayer(getPlayer(), page);
|
||||
}
|
||||
|
||||
private void addBoosterQueue()
|
||||
{
|
||||
if (getPlugin().getBoosters() == null)
|
||||
return;
|
||||
|
||||
List<Booster> boosters = getPlugin().getBoosters();
|
||||
int startIndex = Math.max(0, (9 - boosters.size()) / 2);
|
||||
for (int i = 0; i < boosters.size() && i < 18; i++)
|
||||
{
|
||||
int slot = startIndex + 27 + i;
|
||||
Booster booster = boosters.get(i);
|
||||
boolean active = booster.isActive();
|
||||
int queueIndex = Math.max(1, i);
|
||||
boolean owns = getPlayer().getUniqueId().equals(booster.getUuid());
|
||||
|
||||
long timeActivatedDif = System.currentTimeMillis() - booster.getActivationTime().getTime();
|
||||
String activationTime = UtilTime.convertString(timeActivatedDif, 0, UtilTime.TimeUnit.FIT);
|
||||
|
||||
List<String> lore = new ArrayList<>();
|
||||
if (active)
|
||||
{
|
||||
lore.add(C.cWhite + "Active");
|
||||
lore.add(" ");
|
||||
String expireTime = UtilTime.convertColonString(booster.getTimeRemaining(), UtilTime.TimeUnit.MINUTES, UtilTime.TimeUnit.SECONDS);
|
||||
lore.add(C.cWhite + "Added by " + C.cGreen + booster.getPlayerName());
|
||||
lore.add(C.cWhite + "Expires in " + C.cGreen + expireTime);
|
||||
}
|
||||
else
|
||||
{
|
||||
long timeToActive = booster.getStartTime().getTime() - System.currentTimeMillis();
|
||||
String activeString = UtilTime.convertColonString(timeToActive, UtilTime.TimeUnit.HOURS, UtilTime.TimeUnit.SECONDS);
|
||||
|
||||
lore.add(" ");
|
||||
lore.add(C.cWhite + "Added by " + C.cGreen + booster.getPlayerName());
|
||||
lore.add(C.cWhite + "Starts in " + C.cGreen + activeString);
|
||||
// lore.add(C.cWhite + "Position " + C.cGreen + queueIndex + C.cWhite + " in queue");
|
||||
}
|
||||
|
||||
lore.add(" ");
|
||||
lore.add(C.cGray + "Added " + activationTime + " ago");
|
||||
|
||||
ShopItem shopItem = new ShopItem(booster.isActive() ? Material.EMERALD_BLOCK : Material.REDSTONE_BLOCK,
|
||||
"Game Amplifier", lore.toArray(new String[0]), queueIndex, !active, false);
|
||||
setItem(slot, shopItem);
|
||||
|
||||
// Add glow if the booster belongs to you
|
||||
if (owns)
|
||||
{
|
||||
addGlow(slot);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void addOtherBoosters()
|
||||
{
|
||||
Map<String, List<Booster>> boosterMap = getPlugin().getBoosterCache();
|
||||
List<Triple<Integer, String, Booster>> tripleList = new ArrayList<>();
|
||||
for (Map.Entry<String, List<Booster>> entry : boosterMap.entrySet())
|
||||
{
|
||||
String boosterGroup = entry.getKey();
|
||||
// dont display boosters for the current booster group
|
||||
if (boosterGroup.equals(getPlugin().getBoosterGroup()))
|
||||
continue;
|
||||
|
||||
List<Booster> boosters = entry.getValue();
|
||||
for (int i = 0; i < boosters.size(); i++)
|
||||
{
|
||||
Booster booster = boosters.get(i);
|
||||
if (booster.getUuid().equals(getPlayer().getUniqueId()))
|
||||
{
|
||||
tripleList.add(Triple.of(i, boosterGroup, booster));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int startIndex = Math.max(0, (9 - tripleList.size()) / 2);
|
||||
for (int i = 0; i < 9 && i < tripleList.size(); i++)
|
||||
{
|
||||
Triple<Integer, String, Booster> triple = tripleList.get(i);
|
||||
int deliveryAmount = Math.max(1, triple.getLeft());
|
||||
String boosterGroup = triple.getMiddle();
|
||||
Booster booster = triple.getRight();
|
||||
long timeActivatedDif = System.currentTimeMillis() - booster.getActivationTime().getTime();
|
||||
String activationTime = UtilTime.convertString(timeActivatedDif, 2, UtilTime.TimeUnit.FIT);
|
||||
|
||||
List<String> lore = new ArrayList<String>();
|
||||
lore.add(" ");
|
||||
lore.add(C.cWhite + "Server: " + C.cGreen + boosterGroup);
|
||||
if (booster.isActive())
|
||||
{
|
||||
lore.add(C.cWhite + "Expires in " + C.cGreen + UtilTime.convertColonString(booster.getTimeRemaining(), UtilTime.TimeUnit.MINUTES, UtilTime.TimeUnit.SECONDS));
|
||||
}
|
||||
else
|
||||
{
|
||||
long timeToActive = booster.getStartTime().getTime() - System.currentTimeMillis();
|
||||
lore.add(C.cWhite + "Starts in " + C.cGreen + UtilTime.convertColonString(timeToActive, UtilTime.TimeUnit.HOURS, UtilTime.TimeUnit.SECONDS));
|
||||
}
|
||||
|
||||
lore.add(" ");
|
||||
lore.add(C.cGray + "Added " + activationTime + " ago");
|
||||
|
||||
ShopItem shopItem = new ShopItem(Material.GOLD_BLOCK,
|
||||
"Game Amplifier", lore.toArray(new String[0]), 1, false, false);
|
||||
setItem(startIndex + i + 27, shopItem);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -5,7 +5,10 @@ import mineplex.core.boosters.BoosterManager;
|
||||
import mineplex.core.donation.DonationManager;
|
||||
import mineplex.core.shop.ShopBase;
|
||||
import mineplex.core.shop.page.ShopPageBase;
|
||||
import mineplex.core.updater.UpdateType;
|
||||
import mineplex.core.updater.event.UpdateEvent;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
|
||||
/**
|
||||
* @author Shaun Bennett
|
||||
@ -14,12 +17,21 @@ public class BoosterShop extends ShopBase<BoosterManager>
|
||||
{
|
||||
public BoosterShop(BoosterManager plugin, CoreClientManager clientManager, DonationManager donationManager)
|
||||
{
|
||||
super(plugin, clientManager, donationManager, "Boosters");
|
||||
super(plugin, clientManager, donationManager, "Game Amplifiers");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ShopPageBase<BoosterManager, ? extends ShopBase<BoosterManager>> buildPagesFor(Player player)
|
||||
{
|
||||
return new MenuPage(getPlugin(), this, getClientManager(), getDonationManager(), player);
|
||||
return new BoosterPage(getPlugin(), this, getClientManager(), getDonationManager(), player);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void update(UpdateEvent event)
|
||||
{
|
||||
if (event.getType() != UpdateType.SEC)
|
||||
return;
|
||||
|
||||
getPlayerPageMap().values().stream().filter(value -> value instanceof BoosterPage).forEach(ShopPageBase::refresh);
|
||||
}
|
||||
}
|
||||
|
@ -1,37 +0,0 @@
|
||||
package mineplex.core.boosters.gui;
|
||||
|
||||
import mineplex.core.account.CoreClientManager;
|
||||
import mineplex.core.boosters.Booster;
|
||||
import mineplex.core.boosters.BoosterManager;
|
||||
import mineplex.core.common.util.C;
|
||||
import mineplex.core.common.util.Callback;
|
||||
import mineplex.core.common.util.UtilSkull;
|
||||
import mineplex.core.common.util.UtilTime;
|
||||
import mineplex.core.donation.DonationManager;
|
||||
import mineplex.core.shop.item.ShopItem;
|
||||
import mineplex.core.shop.page.ShopPageBase;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Shaun Bennett
|
||||
*/
|
||||
public class MenuPage extends ShopPageBase<BoosterManager,BoosterShop>
|
||||
{
|
||||
public MenuPage(BoosterManager plugin, BoosterShop shop, CoreClientManager clientManager, DonationManager donationManager, Player player)
|
||||
{
|
||||
super(plugin, shop, clientManager, donationManager, "Boosters", player);
|
||||
|
||||
buildPage();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void buildPage()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,44 @@
|
||||
package mineplex.core.boosters.redis;
|
||||
|
||||
import com.google.common.reflect.TypeToken;
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.GsonBuilder;
|
||||
import mineplex.core.boosters.Booster;
|
||||
import mineplex.core.boosters.event.BoosterUpdateEvent;
|
||||
import mineplex.core.common.api.ApiFieldNamingStrategy;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
import redis.clients.jedis.JedisPubSub;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author Shaun Bennett
|
||||
*/
|
||||
public class BoosterUpdateListener extends JedisPubSub
|
||||
{
|
||||
private Gson _gson = new GsonBuilder().setFieldNamingStrategy(new ApiFieldNamingStrategy())
|
||||
.setDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSX").create();
|
||||
private JavaPlugin _plugin;
|
||||
|
||||
public BoosterUpdateListener(JavaPlugin plugin)
|
||||
{
|
||||
_plugin = plugin;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMessage(String channel, String message)
|
||||
{
|
||||
try
|
||||
{
|
||||
Map<String, List<Booster>> boosterMap = _gson.fromJson(message, new TypeToken<Map<String, List<Booster>>>() {}.getType());
|
||||
_plugin.getServer().getScheduler().runTask(_plugin, () -> Bukkit.getPluginManager().callEvent(new BoosterUpdateEvent(boosterMap)));
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
System.out.println("Failed to load booster update");
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,39 @@
|
||||
package mineplex.core.boosters.redis;
|
||||
|
||||
import mineplex.serverdata.Region;
|
||||
import mineplex.serverdata.redis.RedisRepository;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
import redis.clients.jedis.Jedis;
|
||||
|
||||
/**
|
||||
* @author Shaun Bennett
|
||||
*/
|
||||
public class BoosterUpdateRepository extends RedisRepository
|
||||
{
|
||||
private JavaPlugin _plugin;
|
||||
|
||||
public BoosterUpdateRepository(JavaPlugin plugin)
|
||||
{
|
||||
super(Region.ALL);
|
||||
|
||||
_plugin = plugin;
|
||||
init();
|
||||
}
|
||||
|
||||
private void init()
|
||||
{
|
||||
Thread thread = new Thread("Booster Subscriber")
|
||||
{
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
try (Jedis jedis = getResource(false))
|
||||
{
|
||||
jedis.subscribe(new BoosterUpdateListener(_plugin), "minecraft.boosters");
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
thread.start();
|
||||
}
|
||||
}
|
@ -17,15 +17,15 @@ import java.sql.SQLException;
|
||||
*/
|
||||
public class BoosterTipManager extends MiniDbClientPlugin<PlayerTipData>
|
||||
{
|
||||
public static final int TIP_FOR_SPONSOR = 30;
|
||||
public static final int TIP_FOR_TIPPER = 10;
|
||||
public static final int TIP_FOR_SPONSOR = 5;
|
||||
public static final int TIP_FOR_TIPPER = 5;
|
||||
|
||||
private BoosterTipRepository _repository;
|
||||
private DonationManager _donationManager;
|
||||
|
||||
public BoosterTipManager(JavaPlugin plugin, CoreClientManager clientManager, DonationManager donationManager)
|
||||
{
|
||||
super("Booster Tips", plugin, clientManager);
|
||||
super("Amplifier Thanks", plugin, clientManager);
|
||||
|
||||
_donationManager = donationManager;
|
||||
_repository = new BoosterTipRepository(plugin);
|
||||
@ -33,7 +33,7 @@ public class BoosterTipManager extends MiniDbClientPlugin<PlayerTipData>
|
||||
|
||||
public void addTip(Player player, Booster booster, Callback<TipAddResult> callback)
|
||||
{
|
||||
if (!Recharge.Instance.use(player, "Booster Tip", 1000 * 60 * 10, true, false))
|
||||
if (!Recharge.Instance.use(player, "Amplifier Thanks", 1000 * 60 * 10, true, false))
|
||||
{
|
||||
callback.run(TipAddResult.ON_COOLDOWN);
|
||||
return;
|
||||
@ -57,7 +57,7 @@ public class BoosterTipManager extends MiniDbClientPlugin<PlayerTipData>
|
||||
|
||||
runAsync(() -> {
|
||||
TipAddResult result;
|
||||
if (_repository.addTip(accountId, booster.getAccountId(), booster.getBoosterId(), TIP_FOR_SPONSOR))
|
||||
if (_repository.addTip(accountId, booster.getAccountId(), booster.getId(), TIP_FOR_SPONSOR))
|
||||
{
|
||||
_donationManager.rewardCoinsUntilSuccess(null, "Tips", player.getName(), accountId, TIP_FOR_TIPPER);
|
||||
result = TipAddResult.SUCCESS;
|
||||
|
@ -5,9 +5,9 @@ package mineplex.core.boosters.tips;
|
||||
*/
|
||||
public enum TipAddResult
|
||||
{
|
||||
ALREADY_TIPPED_BOOSTER("You have already tipped!"),
|
||||
ALREADY_TIPPED_BOOSTER("You have already thanked this Amplifier!"),
|
||||
INVALID_ACCOUNT_ID("Uh oh, something went wrong. Try relogging"),
|
||||
CANNOT_TIP_SELF("You can't tip yourself, silly!"),
|
||||
CANNOT_TIP_SELF("You can't thank yourself, silly!"),
|
||||
ON_COOLDOWN(null),
|
||||
SUCCESS(null);
|
||||
|
||||
|
@ -12,6 +12,7 @@ import mineplex.core.hologram.HologramManager;
|
||||
import mineplex.core.stats.StatsManager;
|
||||
import mineplex.core.updater.UpdateType;
|
||||
import mineplex.core.updater.event.UpdateEvent;
|
||||
import mineplex.serverdata.Region;
|
||||
import mineplex.serverdata.redis.counter.Counter;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
@ -24,6 +25,8 @@ import org.bukkit.event.player.PlayerCommandPreprocessEvent;
|
||||
import org.bukkit.event.player.PlayerInteractAtEntityEvent;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
/**
|
||||
* @author Shaun Bennett
|
||||
*/
|
||||
@ -47,8 +50,10 @@ public class FountainManager extends MiniPlugin
|
||||
_brawlShopProvider = shopProvider;
|
||||
|
||||
World world = Bukkit.getWorlds().get(0);//-43.5, 66, -38.5
|
||||
|
||||
int goal = !new File("eu.dat").exists() ? 300000000 : 5000000;
|
||||
_gemFountain = new Fountain(new Location(world, -32.5, 72, -23.5), new Location(world, -43.5, 67, -38.5),
|
||||
C.cGreen + "Gem Fountain", "GemFountain_01", 10000000, this, clientManager, donationManager, _hologramManager, _statsManager);
|
||||
C.cGreen + "Gem Fountain", "GemFountain_01", goal, this, clientManager, donationManager, _hologramManager, _statsManager);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -20,7 +20,7 @@ public class GemFountainSalesPackage extends SalesPackageBase
|
||||
}
|
||||
|
||||
@Override
|
||||
public void Sold(Player player, CurrencyType currencyType)
|
||||
public void sold(Player player, CurrencyType currencyType)
|
||||
{
|
||||
|
||||
}
|
||||
|
@ -178,7 +178,7 @@ public class CosmeticManager extends MiniPlugin
|
||||
|
||||
public void disableItemsForGame()
|
||||
{
|
||||
_gadgetManager.DisableAll();
|
||||
_gadgetManager.disableAll();
|
||||
_mountManager.DisableAll();
|
||||
_petManager.DisableAll();
|
||||
}
|
||||
@ -205,7 +205,7 @@ public class CosmeticManager extends MiniPlugin
|
||||
|
||||
public void disableTeamArmor()
|
||||
{
|
||||
for (Gadget gadget : getGadgetManager().getGadgets(GadgetType.Costume))
|
||||
for (Gadget gadget : getGadgetManager().getGadgets(GadgetType.COSTUME))
|
||||
{
|
||||
if (gadget instanceof OutfitTeam)
|
||||
{
|
||||
|
@ -52,17 +52,4 @@ public class CosmeticShop extends ShopBase<CosmeticManager> implements PluginMes
|
||||
{
|
||||
new GadgetPage(getPlugin(), this, getClientManager(), getDonationManager(), "Gadgets", event.getPlayer()).purchaseGadget(event.getPlayer(), event.getGadget());
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void updatePages(UpdateEvent event)
|
||||
{
|
||||
if (event.getType() != UpdateType.SEC)
|
||||
return;
|
||||
|
||||
for (ShopPageBase<CosmeticManager, ? extends ShopBase<CosmeticManager>> shop : getPlayerPageMap().values())
|
||||
{
|
||||
if (shop instanceof BoosterPage)
|
||||
((BoosterPage) shop).updatePage();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -29,7 +29,7 @@ public class MountButton implements IButton
|
||||
{
|
||||
public void run()
|
||||
{
|
||||
_page.getPlugin().getInventoryManager().addItemToInventory(null, player, _mount.GetName(), 1);
|
||||
_page.getPlugin().getInventoryManager().addItemToInventory(null, player, _mount.getName(), 1);
|
||||
_page.refresh();
|
||||
}
|
||||
}, _page, _mount, CurrencyType.TREASURE_SHARD, player));
|
||||
|
@ -1,4 +1,4 @@
|
||||
package mineplex.core.cosmetic.ui.button;
|
||||
package mineplex.core.cosmetic.ui.button.activate;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.inventory.ClickType;
|
@ -1,4 +1,4 @@
|
||||
package mineplex.core.cosmetic.ui.button;
|
||||
package mineplex.core.cosmetic.ui.button.activate;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.inventory.ClickType;
|
||||
@ -23,7 +23,7 @@ public class ActivateMountButton implements IButton
|
||||
public void onClick(Player player, ClickType clickType)
|
||||
{
|
||||
_page.playAcceptSound(player);
|
||||
_mount.Enable(player);
|
||||
_mount.enable(player);
|
||||
_page.getShop().openPageForPlayer(player, new Menu(_page.getPlugin(), _page.getShop(), _page.getClientManager(), _page.getDonationManager(), player));
|
||||
}
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
package mineplex.core.cosmetic.ui.button;
|
||||
package mineplex.core.cosmetic.ui.button.activate;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.inventory.ClickType;
|
@ -1,4 +1,4 @@
|
||||
package mineplex.core.cosmetic.ui.button;
|
||||
package mineplex.core.cosmetic.ui.button.deactivate;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.inventory.ClickType;
|
@ -1,4 +1,4 @@
|
||||
package mineplex.core.cosmetic.ui.button;
|
||||
package mineplex.core.cosmetic.ui.button.deactivate;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.inventory.ClickType;
|
||||
@ -21,7 +21,7 @@ public class DeactivateMountButton implements IButton
|
||||
public void onClick(Player player, ClickType clickType)
|
||||
{
|
||||
_page.playAcceptSound(player);
|
||||
_mount.Disable(player);
|
||||
_mount.disable(player);
|
||||
_page.refresh();
|
||||
}
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
package mineplex.core.cosmetic.ui.button;
|
||||
package mineplex.core.cosmetic.ui.button.deactivate;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.inventory.ClickType;
|
@ -1,4 +1,4 @@
|
||||
package mineplex.core.cosmetic.ui.button;
|
||||
package mineplex.core.cosmetic.ui.button.open;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
|
@ -0,0 +1,22 @@
|
||||
package mineplex.core.cosmetic.ui.button.open;
|
||||
|
||||
import mineplex.core.cosmetic.ui.page.BalloonsPage;
|
||||
import mineplex.core.cosmetic.ui.page.Menu;
|
||||
import mineplex.core.gadget.types.Gadget;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class OpenBalloons extends OpenPageButton
|
||||
{
|
||||
|
||||
public OpenBalloons(Menu menu, Gadget active)
|
||||
{
|
||||
super(menu, active);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void leftClick(Player player)
|
||||
{
|
||||
getMenu().getShop().openPageForPlayer(player, new BalloonsPage(getMenu().getPlugin(), getMenu().getShop(), getMenu().getClientManager(), getMenu().getDonationManager(), "Win Effects", player));
|
||||
}
|
||||
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
package mineplex.core.cosmetic.ui.button;
|
||||
package mineplex.core.cosmetic.ui.button.open;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
|
@ -1,4 +1,4 @@
|
||||
package mineplex.core.cosmetic.ui.button;
|
||||
package mineplex.core.cosmetic.ui.button.open;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
|
@ -1,4 +1,4 @@
|
||||
package mineplex.core.cosmetic.ui.button;
|
||||
package mineplex.core.cosmetic.ui.button.open;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
|
@ -1,4 +1,4 @@
|
||||
package mineplex.core.cosmetic.ui.button;
|
||||
package mineplex.core.cosmetic.ui.button.open;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
|
@ -1,8 +1,8 @@
|
||||
package mineplex.core.cosmetic.ui.button;
|
||||
package mineplex.core.cosmetic.ui.button.open;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import mineplex.core.cosmetic.ui.page.GameModifierPage;
|
||||
import mineplex.core.cosmetic.ui.page.gamemodifiers.GameModifierPage;
|
||||
import mineplex.core.cosmetic.ui.page.Menu;
|
||||
import mineplex.core.gadget.types.Gadget;
|
||||
|
@ -1,4 +1,4 @@
|
||||
package mineplex.core.cosmetic.ui.button;
|
||||
package mineplex.core.cosmetic.ui.button.open;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
|
@ -1,4 +1,4 @@
|
||||
package mineplex.core.cosmetic.ui.button;
|
||||
package mineplex.core.cosmetic.ui.button.open;
|
||||
|
||||
import mineplex.core.cosmetic.ui.page.Menu;
|
||||
import mineplex.core.cosmetic.ui.page.MorphPage;
|
@ -1,4 +1,4 @@
|
||||
package mineplex.core.cosmetic.ui.button;
|
||||
package mineplex.core.cosmetic.ui.button.open;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.inventory.ClickType;
|
||||
@ -29,7 +29,7 @@ public class OpenMounts implements IButton
|
||||
if (_active != null)
|
||||
{
|
||||
_menu.playAcceptSound(player);
|
||||
_active.Disable(player);
|
||||
_active.disable(player);
|
||||
_menu.refresh();
|
||||
}
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
package mineplex.core.cosmetic.ui.button;
|
||||
package mineplex.core.cosmetic.ui.button.open;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
|
@ -1,4 +1,4 @@
|
||||
package mineplex.core.cosmetic.ui.button;
|
||||
package mineplex.core.cosmetic.ui.button.open;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.inventory.ClickType;
|
||||
@ -28,7 +28,7 @@ public abstract class OpenPageButton implements IButton
|
||||
if (_active != null)
|
||||
{
|
||||
_menu.playAcceptSound(player);
|
||||
_active.Disable(player);
|
||||
_active.disable(player);
|
||||
_menu.refresh();
|
||||
}
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
package mineplex.core.cosmetic.ui.button;
|
||||
package mineplex.core.cosmetic.ui.button.open;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
|
@ -1,4 +1,4 @@
|
||||
package mineplex.core.cosmetic.ui.button;
|
||||
package mineplex.core.cosmetic.ui.button.open;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.inventory.ClickType;
|
@ -1,4 +1,4 @@
|
||||
package mineplex.core.cosmetic.ui.button;
|
||||
package mineplex.core.cosmetic.ui.button.open;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
|
@ -28,11 +28,11 @@ public class ArrowTrailPage extends GadgetPage
|
||||
{
|
||||
int slot = 19;
|
||||
|
||||
for (Gadget gadget : getPlugin().getGadgetManager().getGadgets(GadgetType.ArrowTrail))
|
||||
for (Gadget gadget : getPlugin().getGadgetManager().getGadgets(GadgetType.ARROW_TRAIL))
|
||||
{
|
||||
addGadget(gadget, slot);
|
||||
|
||||
if (getPlugin().getGadgetManager().getActive(getPlayer(), GadgetType.ArrowTrail) == gadget)
|
||||
if (getPlugin().getGadgetManager().getActive(getPlayer(), GadgetType.ARROW_TRAIL) == gadget)
|
||||
addGlow(slot);
|
||||
|
||||
slot++;
|
||||
|
@ -0,0 +1,53 @@
|
||||
package mineplex.core.cosmetic.ui.page;
|
||||
|
||||
import mineplex.core.account.CoreClientManager;
|
||||
import mineplex.core.common.util.C;
|
||||
import mineplex.core.cosmetic.CosmeticManager;
|
||||
import mineplex.core.cosmetic.ui.CosmeticShop;
|
||||
import mineplex.core.donation.DonationManager;
|
||||
import mineplex.core.gadget.types.Gadget;
|
||||
import mineplex.core.gadget.types.GadgetType;
|
||||
import mineplex.core.shop.item.IButton;
|
||||
import mineplex.core.shop.item.ShopItem;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.inventory.ClickType;
|
||||
|
||||
public class BalloonsPage extends GadgetPage
|
||||
{
|
||||
|
||||
public BalloonsPage(CosmeticManager plugin, CosmeticShop shop, CoreClientManager clientManager, DonationManager donationManager, String name, Player player)
|
||||
{
|
||||
super(plugin, shop, clientManager, donationManager, name, player);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void buildPage()
|
||||
{
|
||||
int slot = 19;
|
||||
|
||||
for (Gadget gadget : getPlugin().getGadgetManager().getGadgets(GadgetType.BALLOON))
|
||||
{
|
||||
addGadget(gadget, slot);
|
||||
|
||||
if (getPlugin().getGadgetManager().getActive(getPlayer(), GadgetType.BALLOON) == gadget)
|
||||
addGlow(slot);
|
||||
|
||||
slot++;
|
||||
|
||||
if (slot == 26)
|
||||
slot = 28;
|
||||
if(slot == 35)
|
||||
slot = 37;
|
||||
}
|
||||
|
||||
addButton(4, new ShopItem(Material.BED, C.cGray + " \u21FD Go Back", new String[]{}, 1, false), new IButton()
|
||||
{
|
||||
public void onClick(Player player, ClickType clickType)
|
||||
{
|
||||
getShop().openPageForPlayer(getPlayer(), new Menu(getPlugin(), getShop(), getClientManager(), getDonationManager(), player));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
@ -1,45 +0,0 @@
|
||||
package mineplex.core.cosmetic.ui.page;
|
||||
|
||||
import mineplex.core.account.CoreClientManager;
|
||||
import mineplex.core.cosmetic.CosmeticManager;
|
||||
import mineplex.core.cosmetic.ui.CosmeticShop;
|
||||
import mineplex.core.donation.DonationManager;
|
||||
import mineplex.core.shop.item.ShopItem;
|
||||
import mineplex.core.shop.page.ShopPageBase;
|
||||
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 java.util.ArrayList;
|
||||
|
||||
/**
|
||||
* @author Shaun Bennett
|
||||
*/
|
||||
public class BoosterPage extends ShopPageBase<CosmeticManager, CosmeticShop>
|
||||
{
|
||||
public BoosterPage(CosmeticManager plugin, CosmeticShop shop, CoreClientManager clientManager, DonationManager donationManager, Player player)
|
||||
{
|
||||
super(plugin, shop, clientManager, donationManager, "Game Boosters", player, 9);
|
||||
|
||||
buildPage();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void buildPage()
|
||||
{
|
||||
ArrayList<String> lore = new ArrayList<>();
|
||||
|
||||
lore.add(" ");
|
||||
lore.add("You Own: " + _plugin.getBoosterManager().getAvailableBoosterCount(getPlayer()));
|
||||
|
||||
ShopItem booster = new ShopItem(Material.SUGAR, "Game Booster", lore.toArray(new String[0]), 0, false, false);
|
||||
setItem(4, booster);
|
||||
}
|
||||
|
||||
public void updatePage()
|
||||
{
|
||||
refresh();
|
||||
}
|
||||
}
|
@ -36,9 +36,9 @@ public class CostumePage extends GadgetPage
|
||||
{
|
||||
int slot;
|
||||
|
||||
for (Gadget gadget : getPlugin().getGadgetManager().getGadgets(GadgetType.Costume))
|
||||
for (Gadget gadget : getPlugin().getGadgetManager().getGadgets(GadgetType.COSTUME))
|
||||
{
|
||||
if (gadget.GetCost(CurrencyType.TREASURE_SHARD) == -1)
|
||||
if (gadget.getCost(CurrencyType.TREASURE_SHARD) == -1)
|
||||
continue;
|
||||
|
||||
OutfitGadget outfitGadget = ((OutfitGadget) gadget);
|
||||
@ -51,16 +51,16 @@ public class CostumePage extends GadgetPage
|
||||
|
||||
slot = offset + 1 + 18; //1 buffer to left, 18 = 2 lines down
|
||||
|
||||
if (outfitGadget.GetSlot() == OutfitGadget.ArmorSlot.Chest)
|
||||
if (outfitGadget.getSlot() == OutfitGadget.ArmorSlot.Chest)
|
||||
slot += 9;
|
||||
else if (outfitGadget.GetSlot() == OutfitGadget.ArmorSlot.Legs)
|
||||
else if (outfitGadget.getSlot() == OutfitGadget.ArmorSlot.Legs)
|
||||
slot += 18;
|
||||
else if (outfitGadget.GetSlot() == OutfitGadget.ArmorSlot.Boots)
|
||||
else if (outfitGadget.getSlot() == OutfitGadget.ArmorSlot.Boots)
|
||||
slot += 27;
|
||||
|
||||
addGadget(gadget, slot);
|
||||
|
||||
if (gadget.IsActive(getPlayer()))
|
||||
if (gadget.isActive(getPlayer()))
|
||||
addGlow(slot);
|
||||
}
|
||||
|
||||
@ -69,12 +69,12 @@ public class CostumePage extends GadgetPage
|
||||
public void onClick(Player player, ClickType clickType)
|
||||
{
|
||||
boolean gadgetDisabled = false;
|
||||
for (Gadget gadget : getPlugin().getGadgetManager().getGadgets(GadgetType.Costume))
|
||||
for (Gadget gadget : getPlugin().getGadgetManager().getGadgets(GadgetType.COSTUME))
|
||||
{
|
||||
if (gadget.IsActive(player))
|
||||
if (gadget.isActive(player))
|
||||
{
|
||||
gadgetDisabled = true;
|
||||
gadget.Disable(player);
|
||||
gadget.disable(player);
|
||||
}
|
||||
}
|
||||
|
||||
@ -99,7 +99,7 @@ public class CostumePage extends GadgetPage
|
||||
{
|
||||
if (gadget instanceof ItemGadget)
|
||||
{
|
||||
if (getPlugin().getInventoryManager().Get(player).getItemCount(gadget.GetName()) <= 0)
|
||||
if (getPlugin().getInventoryManager().Get(player).getItemCount(gadget.getName()) <= 0)
|
||||
{
|
||||
purchaseGadget(player, gadget);
|
||||
return;
|
||||
@ -107,7 +107,7 @@ public class CostumePage extends GadgetPage
|
||||
}
|
||||
|
||||
playAcceptSound(player);
|
||||
gadget.Enable(player);
|
||||
gadget.enable(player);
|
||||
|
||||
buildPage();
|
||||
}
|
||||
|
@ -28,11 +28,11 @@ public class DeathEffectPage extends GadgetPage
|
||||
{
|
||||
int slot = 19;
|
||||
|
||||
for (Gadget gadget : getPlugin().getGadgetManager().getGadgets(GadgetType.Death))
|
||||
for (Gadget gadget : getPlugin().getGadgetManager().getGadgets(GadgetType.DEATH))
|
||||
{
|
||||
addGadget(gadget, slot);
|
||||
|
||||
if (getPlugin().getGadgetManager().getActive(getPlayer(), GadgetType.Death) == gadget)
|
||||
if (getPlugin().getGadgetManager().getActive(getPlayer(), GadgetType.DEATH) == gadget)
|
||||
addGlow(slot);
|
||||
|
||||
slot++;
|
||||
|
@ -28,11 +28,11 @@ public class DoubleJumpPage extends GadgetPage
|
||||
{
|
||||
int slot = 19;
|
||||
|
||||
for (Gadget gadget : getPlugin().getGadgetManager().getGadgets(GadgetType.DoubleJump))
|
||||
for (Gadget gadget : getPlugin().getGadgetManager().getGadgets(GadgetType.DOUBLE_JUMP))
|
||||
{
|
||||
addGadget(gadget, slot);
|
||||
|
||||
if (getPlugin().getGadgetManager().getActive(getPlayer(), GadgetType.DoubleJump) == gadget)
|
||||
if (getPlugin().getGadgetManager().getActive(getPlayer(), GadgetType.DOUBLE_JUMP) == gadget)
|
||||
addGlow(slot);
|
||||
|
||||
slot++;
|
||||
|
@ -4,10 +4,12 @@ import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import mineplex.core.common.util.banner.CountryFlag;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.inventory.ClickType;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.meta.BannerMeta;
|
||||
import org.bukkit.inventory.meta.ItemMeta;
|
||||
|
||||
import mineplex.core.account.CoreClientManager;
|
||||
@ -17,8 +19,8 @@ import mineplex.core.common.util.F;
|
||||
import mineplex.core.common.util.UtilPlayer;
|
||||
import mineplex.core.cosmetic.CosmeticManager;
|
||||
import mineplex.core.cosmetic.ui.CosmeticShop;
|
||||
import mineplex.core.cosmetic.ui.button.ActivateGadgetButton;
|
||||
import mineplex.core.cosmetic.ui.button.DeactivateGadgetButton;
|
||||
import mineplex.core.cosmetic.ui.button.activate.ActivateGadgetButton;
|
||||
import mineplex.core.cosmetic.ui.button.deactivate.DeactivateGadgetButton;
|
||||
import mineplex.core.cosmetic.ui.button.GadgetButton;
|
||||
import mineplex.core.donation.DonationManager;
|
||||
import mineplex.core.gadget.gadgets.morph.MorphBlock;
|
||||
@ -44,14 +46,14 @@ public class GadgetPage extends ShopPageBase<CosmeticManager, CosmeticShop>
|
||||
{
|
||||
int slot = 19;
|
||||
|
||||
for (Gadget gadget : getPlugin().getGadgetManager().getGadgets(GadgetType.Item))
|
||||
for (Gadget gadget : getPlugin().getGadgetManager().getGadgets(GadgetType.ITEM))
|
||||
{
|
||||
if (gadget.GetCost(CurrencyType.TREASURE_SHARD) == -3)
|
||||
if (gadget.getCost(CurrencyType.TREASURE_SHARD) == -3)
|
||||
continue;
|
||||
|
||||
addGadget(gadget, slot);
|
||||
|
||||
if (getPlugin().getInventoryManager().Get(getPlayer()).getItemCount(gadget.GetDisplayName()) > 0)
|
||||
if (getPlugin().getInventoryManager().Get(getPlayer()).getItemCount(gadget.getDisplayName()) > 0)
|
||||
addGlow(slot);
|
||||
|
||||
slot++;
|
||||
@ -80,7 +82,7 @@ public class GadgetPage extends ShopPageBase<CosmeticManager, CosmeticShop>
|
||||
List<String> itemLore = new ArrayList<String>();
|
||||
|
||||
itemLore.add(C.cBlack);
|
||||
itemLore.addAll(Arrays.asList(gadget.GetDescription()));
|
||||
itemLore.addAll(Arrays.asList(gadget.getDescription()));
|
||||
|
||||
if (gadget.getSet() != null)
|
||||
{
|
||||
@ -89,7 +91,7 @@ public class GadgetPage extends ShopPageBase<CosmeticManager, CosmeticShop>
|
||||
|
||||
//Elements
|
||||
for (Gadget cur : gadget.getSet().getGadgets())
|
||||
itemLore.add(" "+ (cur.ownsGadget(getPlayer()) ? C.cDGreen : C.cDRed) + "▪ " + (cur.IsActive(getPlayer()) ? C.cGreen : C.cGray) + cur.GetName());
|
||||
itemLore.add(" "+ (cur.ownsGadget(getPlayer()) ? C.cDGreen : C.cDRed) + "▪ " + (cur.isActive(getPlayer()) ? C.cGreen : C.cGray) + cur.getName());
|
||||
|
||||
itemLore.add(C.cBlack);
|
||||
|
||||
@ -101,59 +103,64 @@ public class GadgetPage extends ShopPageBase<CosmeticManager, CosmeticShop>
|
||||
|
||||
if (!gadget.ownsGadget(getPlayer()))
|
||||
{
|
||||
if (gadget.GetCost(CurrencyType.TREASURE_SHARD) == -1)
|
||||
if (gadget.getCost(CurrencyType.TREASURE_SHARD) == -1)
|
||||
{
|
||||
//Nothing
|
||||
}
|
||||
//Chest Unlocks
|
||||
else if (gadget.GetCost(CurrencyType.TREASURE_SHARD) == -2 || gadget.GetCost(CurrencyType.TREASURE_SHARD) > 0)
|
||||
else if (gadget.getCost(CurrencyType.TREASURE_SHARD) == -2 || gadget.getCost(CurrencyType.TREASURE_SHARD) > 0)
|
||||
{
|
||||
itemLore.add(C.cBlack);
|
||||
itemLore.add(C.cBlue + "Found in Treasure Chests");
|
||||
}
|
||||
else if (gadget.GetCost(CurrencyType.TREASURE_SHARD) == -3)
|
||||
else if (gadget.getCost(CurrencyType.TREASURE_SHARD) == -3)
|
||||
{
|
||||
itemLore.add(C.cBlack);
|
||||
itemLore.add(C.cBlue + "Found in Winter Holiday Treasure");
|
||||
}
|
||||
else if (gadget.GetCost(CurrencyType.TREASURE_SHARD) == -4)
|
||||
else if (gadget.getCost(CurrencyType.TREASURE_SHARD) == -4)
|
||||
{
|
||||
itemLore.add(C.cBlack);
|
||||
itemLore.add(C.cBlue + "Found in Halloween Pumpkin Treasure");
|
||||
}
|
||||
else if (gadget.GetCost(CurrencyType.TREASURE_SHARD) == -5)
|
||||
else if (gadget.getCost(CurrencyType.TREASURE_SHARD) == -5)
|
||||
{
|
||||
itemLore.add(C.cBlack);
|
||||
itemLore.add(C.cBlue + "Found in Easter Holiday Treasure");
|
||||
}
|
||||
else if (gadget.GetCost(CurrencyType.TREASURE_SHARD) == -6)
|
||||
else if (gadget.getCost(CurrencyType.TREASURE_SHARD) == -6)
|
||||
{
|
||||
itemLore.add(C.cBlack);
|
||||
itemLore.add(C.cBlue + "Found in Valentines Gifts");
|
||||
}
|
||||
else if (gadget.GetCost(CurrencyType.TREASURE_SHARD) == -7)
|
||||
else if (gadget.getCost(CurrencyType.TREASURE_SHARD) == -7)
|
||||
{
|
||||
itemLore.add(C.cBlack);
|
||||
itemLore.add(C.cBlue + "Purchased from shop.mineplex.com");
|
||||
}
|
||||
else if (gadget.getCost(CurrencyType.TREASURE_SHARD) == -8)
|
||||
{
|
||||
itemLore.add(C.cBlack);
|
||||
itemLore.add(C.cBlue + "Found in Freedom Chests");
|
||||
}
|
||||
|
||||
//Rank Unlocks
|
||||
else if (gadget.GetCost(CurrencyType.TREASURE_SHARD) == -10)
|
||||
else if (gadget.getCost(CurrencyType.TREASURE_SHARD) == -10)
|
||||
{
|
||||
itemLore.add(C.cBlack);
|
||||
itemLore.add(C.cAqua + "Unlocked with Ultra Rank");
|
||||
}
|
||||
else if (gadget.GetCost(CurrencyType.TREASURE_SHARD) == -11)
|
||||
else if (gadget.getCost(CurrencyType.TREASURE_SHARD) == -11)
|
||||
{
|
||||
itemLore.add(C.cBlack);
|
||||
itemLore.add(C.cPurple + "Unlocked with Hero Rank");
|
||||
}
|
||||
else if (gadget.GetCost(CurrencyType.TREASURE_SHARD) == -12)
|
||||
else if (gadget.getCost(CurrencyType.TREASURE_SHARD) == -12)
|
||||
{
|
||||
itemLore.add(C.cBlack);
|
||||
itemLore.add(C.cGreen + "Unlocked with Legend Rank");
|
||||
}
|
||||
else if (gadget.GetCost(CurrencyType.TREASURE_SHARD) == -13)
|
||||
else if (gadget.getCost(CurrencyType.TREASURE_SHARD) == -13)
|
||||
{
|
||||
itemLore.add(C.cBlack);
|
||||
itemLore.add(C.cRed + "Unlocked with Titan Rank");
|
||||
@ -166,15 +173,15 @@ public class GadgetPage extends ShopPageBase<CosmeticManager, CosmeticShop>
|
||||
ItemGadget itemGadget = (ItemGadget)gadget;
|
||||
|
||||
itemLore.add(C.cBlack);
|
||||
itemLore.add(C.cWhite + "You own " + C.cGreen + getPlugin().getInventoryManager().Get(getPlayer()).getItemCount(gadget.GetName()));
|
||||
itemLore.add(C.cWhite + "You own " + C.cGreen + getPlugin().getInventoryManager().Get(getPlayer()).getItemCount(gadget.getName()));
|
||||
|
||||
// boolean canAffordAmmo = true;
|
||||
// if (itemGadget.getAmmo().GetCost(CurrencyType.Coins) > 0)
|
||||
// if (itemGadget.getAmmo().getCost(CurrencyType.Coins) > 0)
|
||||
// {
|
||||
// itemLore.add(C.cBlack);
|
||||
// itemLore.add(C.cWhite + ((ItemGadget)gadget).getAmmo().GetDisplayName() + " for " + C.cYellow + ((ItemGadget)gadget).getAmmo().GetCost(CurrencyType.Coins) + " Coins");
|
||||
// itemLore.add(C.cWhite + ((ItemGadget)gadget).getAmmo().getDisplayName() + " for " + C.cYellow + ((ItemGadget)gadget).getAmmo().getCost(CurrencyType.Coins) + " Coins");
|
||||
//
|
||||
// if (getDonationManager().Get(getPlayer().getName()).GetBalance(CurrencyType.Coins) >= itemGadget.getAmmo().GetCost(CurrencyType.Coins))
|
||||
// if (getDonationManager().Get(getPlayer().getName()).GetBalance(CurrencyType.Coins) >= itemGadget.getAmmo().getCost(CurrencyType.Coins))
|
||||
// {
|
||||
// itemLore.add(C.cGreen + "Right-Click To Purchase");
|
||||
// }
|
||||
@ -190,11 +197,11 @@ public class GadgetPage extends ShopPageBase<CosmeticManager, CosmeticShop>
|
||||
itemLore.add(C.cBlack);
|
||||
itemLore.add(C.cGreen + "Left-Click to Enable");
|
||||
|
||||
addButton(slot, new ShopItem(gadget.GetDisplayMaterial(), gadget.GetDisplayData(), gadget.GetName(), itemLore.toArray(new String[itemLore.size()]), 1, false, false).hideInfo(), new ActivateGadgetButton(gadget, this));
|
||||
addButton(slot, new ShopItem(gadget.getDisplayMaterial(), gadget.getDisplayData(), gadget.getName(), itemLore.toArray(new String[itemLore.size()]), 1, false, false).hideInfo(), new ActivateGadgetButton(gadget, this));
|
||||
}
|
||||
else
|
||||
{
|
||||
addButton(slot, new ShopItem(gadget.GetDisplayMaterial(), gadget.GetDisplayData(), gadget.GetName(), itemLore.toArray(new String[itemLore.size()]), 1, true, false).hideInfo(), new ActivateGadgetButton(gadget, this));
|
||||
addButton(slot, new ShopItem(gadget.getDisplayMaterial(), gadget.getDisplayData(), gadget.getName(), itemLore.toArray(new String[itemLore.size()]), 1, true, false).hideInfo(), new ActivateGadgetButton(gadget, this));
|
||||
}
|
||||
|
||||
return;
|
||||
@ -205,11 +212,11 @@ public class GadgetPage extends ShopPageBase<CosmeticManager, CosmeticShop>
|
||||
ItemStack item = ((HatGadget)gadget).getHelmetItem();
|
||||
|
||||
ItemMeta im = item.getItemMeta();
|
||||
im.setDisplayName(C.cGreen + C.Bold + gadget.GetName());
|
||||
im.setDisplayName(C.cGreen + C.Bold + gadget.getName());
|
||||
|
||||
if (gadget.ownsGadget(getPlayer()))
|
||||
{
|
||||
if (gadget.GetActive().contains(getPlayer()))
|
||||
if (gadget.getActive().contains(getPlayer()))
|
||||
{
|
||||
itemLore.add(C.cBlack);
|
||||
itemLore.add(C.cGreen + "Click to Disable");
|
||||
@ -230,29 +237,35 @@ public class GadgetPage extends ShopPageBase<CosmeticManager, CosmeticShop>
|
||||
}
|
||||
else
|
||||
{
|
||||
if (gadget.GetCost(CurrencyType.TREASURE_SHARD) > 0)
|
||||
if (gadget.getCost(CurrencyType.TREASURE_SHARD) > 0)
|
||||
{
|
||||
itemLore.add(C.cBlack);
|
||||
itemLore.add(C.cWhiteB + "Cost: " + C.cAqua + gadget.GetCost(CurrencyType.TREASURE_SHARD) + " Treasure Shards");
|
||||
itemLore.add(C.cWhiteB + "Cost: " + C.cAqua + gadget.getCost(CurrencyType.TREASURE_SHARD) + " Treasure Shards");
|
||||
}
|
||||
|
||||
if (gadget.GetCost(CurrencyType.TREASURE_SHARD) > 0 && getDonationManager().Get(getPlayer().getName()).GetBalance(CurrencyType.TREASURE_SHARD) >= gadget.GetCost(CurrencyType.TREASURE_SHARD))
|
||||
if (gadget.getCost(CurrencyType.TREASURE_SHARD) > 0 && getDonationManager().Get(getPlayer().getName()).GetBalance(CurrencyType.TREASURE_SHARD) >= gadget.getCost(CurrencyType.TREASURE_SHARD))
|
||||
{
|
||||
itemLore.add(C.cBlack);
|
||||
itemLore.add(C.cWhiteB + "Cost: " + C.cAqua + gadget.getCost(CurrencyType.TREASURE_SHARD) + " Treasure Shards");
|
||||
}
|
||||
|
||||
if (gadget.getCost(CurrencyType.TREASURE_SHARD) > 0 && getDonationManager().Get(getPlayer().getName()).GetBalance(CurrencyType.TREASURE_SHARD) >= gadget.getCost(CurrencyType.TREASURE_SHARD))
|
||||
{
|
||||
itemLore.add(C.cBlack);
|
||||
itemLore.add(C.cGreen + "Click to Purchase");
|
||||
|
||||
addButton(slot, new ShopItem(Material.INK_SACK, (byte) 8, gadget.GetName(), itemLore.toArray(new String[itemLore.size()]), 1, true, false).hideInfo(), new GadgetButton(gadget, this));
|
||||
addButton(slot, new ShopItem(Material.INK_SACK, (byte) 8, gadget.getName(), itemLore.toArray(new String[itemLore.size()]), 1, true, false).hideInfo(), new GadgetButton(gadget, this));
|
||||
}
|
||||
else if (gadget.GetCost(CurrencyType.TREASURE_SHARD) > 0)
|
||||
else if (gadget.getCost(CurrencyType.TREASURE_SHARD) > 0)
|
||||
{
|
||||
itemLore.add(C.cBlack);
|
||||
itemLore.add(C.cRed + "Not enough Treasure Shards.");
|
||||
|
||||
setItem(slot, new ShopItem(Material.INK_SACK, (byte)8, gadget.GetName(), itemLore.toArray(new String[itemLore.size()]), 1, true, false).hideInfo());
|
||||
setItem(slot, new ShopItem(Material.INK_SACK, (byte)8, gadget.getName(), itemLore.toArray(new String[itemLore.size()]), 1, true, false).hideInfo());
|
||||
}
|
||||
else
|
||||
{
|
||||
setItem(slot, new ShopItem(Material.INK_SACK, (byte)8, gadget.GetName(), itemLore.toArray(new String[itemLore.size()]), 1, true, false).hideInfo());
|
||||
setItem(slot, new ShopItem(Material.INK_SACK, (byte)8, gadget.getName(), itemLore.toArray(new String[itemLore.size()]), 1, true, false).hideInfo());
|
||||
}
|
||||
}
|
||||
|
||||
@ -262,46 +275,81 @@ public class GadgetPage extends ShopPageBase<CosmeticManager, CosmeticShop>
|
||||
//Standard
|
||||
if (gadget.ownsGadget(getPlayer()))
|
||||
{
|
||||
if (gadget.GetActive().contains(getPlayer()))
|
||||
ItemStack gadgetItemStack = new ItemStack(gadget.getDisplayMaterial(), 1, gadget.getDisplayData());
|
||||
ItemMeta meta = gadgetItemStack.getItemMeta();
|
||||
meta.setDisplayName(C.cGreen + C.Bold + gadget.getName());
|
||||
if (gadget.getActive().contains(getPlayer()))
|
||||
{
|
||||
itemLore.add(C.cBlack);
|
||||
itemLore.add(C.cGreen + "Click to Disable");
|
||||
|
||||
addButton(slot, new ShopItem(gadget.GetDisplayMaterial(), gadget.GetDisplayData(), gadget.GetName(), itemLore.toArray(new String[itemLore.size()]), 1, false, false).hideInfo(), new DeactivateGadgetButton(gadget, this));
|
||||
meta.setLore(itemLore);
|
||||
gadgetItemStack.setItemMeta(meta);
|
||||
|
||||
if (gadget.getGadgetType() == GadgetType.ARROW_TRAIL || gadget.getGadgetType() == GadgetType.DEATH
|
||||
|| gadget.getGadgetType() == GadgetType.PARTICLE || gadget.getGadgetType() == GadgetType.DOUBLE_JUMP)
|
||||
{
|
||||
if (gadget.getCost(CurrencyType.TREASURE_SHARD) == -8)
|
||||
{
|
||||
gadgetItemStack = CountryFlag.Usa.getBanner();
|
||||
BannerMeta bannerMeta = (BannerMeta) gadgetItemStack.getItemMeta();
|
||||
bannerMeta.setDisplayName(C.cGreen + C.Bold + gadget.getName());
|
||||
bannerMeta.setLore(meta.getLore());
|
||||
gadgetItemStack.setItemMeta(bannerMeta);
|
||||
}
|
||||
}
|
||||
|
||||
addButton(slot, new ShopItem(gadgetItemStack, false, false).hideInfo(), new DeactivateGadgetButton(gadget, this));
|
||||
}
|
||||
else
|
||||
{
|
||||
itemLore.add(C.cBlack);
|
||||
itemLore.add(C.cGreen + "Click to Enable");
|
||||
|
||||
addButton(slot, new ShopItem(gadget.GetDisplayMaterial(), gadget.GetDisplayData(), gadget.GetName(), itemLore.toArray(new String[itemLore.size()]), 1, false, false).hideInfo(), new ActivateGadgetButton(gadget, this));
|
||||
meta.setLore(itemLore);
|
||||
gadgetItemStack.setItemMeta(meta);
|
||||
|
||||
if (gadget.getGadgetType() == GadgetType.ARROW_TRAIL || gadget.getGadgetType() == GadgetType.DEATH
|
||||
|| gadget.getGadgetType() == GadgetType.PARTICLE || gadget.getGadgetType() == GadgetType.DOUBLE_JUMP)
|
||||
{
|
||||
if (gadget.getCost(CurrencyType.TREASURE_SHARD) == -8)
|
||||
{
|
||||
gadgetItemStack = CountryFlag.Usa.getBanner();
|
||||
BannerMeta bannerMeta = (BannerMeta) gadgetItemStack.getItemMeta();
|
||||
bannerMeta.setDisplayName(C.cGreen + C.Bold + gadget.getName());
|
||||
bannerMeta.setLore(meta.getLore());
|
||||
gadgetItemStack.setItemMeta(bannerMeta);
|
||||
}
|
||||
}
|
||||
|
||||
addButton(slot, new ShopItem(gadgetItemStack, false, false).hideInfo(), new ActivateGadgetButton(gadget, this));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (gadget.GetCost(CurrencyType.TREASURE_SHARD) > 0)
|
||||
if (gadget.getCost(CurrencyType.TREASURE_SHARD) > 0)
|
||||
{
|
||||
itemLore.add(C.cBlack);
|
||||
itemLore.add(C.cWhiteB + "Cost: " + C.cAqua + gadget.GetCost(CurrencyType.TREASURE_SHARD) + " Treasure Shards");
|
||||
itemLore.add(C.cWhiteB + "Cost: " + C.cAqua + gadget.getCost(CurrencyType.TREASURE_SHARD) + " Treasure Shards");
|
||||
}
|
||||
|
||||
if (gadget.GetCost(CurrencyType.TREASURE_SHARD) > 0 && getDonationManager().Get(getPlayer().getName()).GetBalance(CurrencyType.TREASURE_SHARD) >= gadget.GetCost(CurrencyType.TREASURE_SHARD))
|
||||
if (gadget.getCost(CurrencyType.TREASURE_SHARD) > 0 && getDonationManager().Get(getPlayer().getName()).GetBalance(CurrencyType.TREASURE_SHARD) >= gadget.getCost(CurrencyType.TREASURE_SHARD))
|
||||
{
|
||||
itemLore.add(C.cBlack);
|
||||
itemLore.add(C.cGreen + "Click to Purchase");
|
||||
|
||||
addButton(slot, new ShopItem(Material.INK_SACK, (byte) 8, gadget.GetName(), itemLore.toArray(new String[itemLore.size()]), 1, true, false).hideInfo(), new GadgetButton(gadget, this));
|
||||
addButton(slot, new ShopItem(Material.INK_SACK, (byte) 8, gadget.getName(), itemLore.toArray(new String[itemLore.size()]), 1, true, false).hideInfo(), new GadgetButton(gadget, this));
|
||||
}
|
||||
else if (gadget.GetCost(CurrencyType.TREASURE_SHARD) > 0)
|
||||
else if (gadget.getCost(CurrencyType.TREASURE_SHARD) > 0)
|
||||
{
|
||||
itemLore.add(C.cBlack);
|
||||
itemLore.add(C.cRed + "Not enough Treasure Shards.");
|
||||
|
||||
setItem(slot, new ShopItem(Material.INK_SACK, (byte)8, gadget.GetName(), itemLore.toArray(new String[itemLore.size()]), 1, true, false).hideInfo());
|
||||
setItem(slot, new ShopItem(Material.INK_SACK, (byte)8, gadget.getName(), itemLore.toArray(new String[itemLore.size()]), 1, true, false).hideInfo());
|
||||
}
|
||||
else
|
||||
{
|
||||
setItem(slot, new ShopItem(Material.INK_SACK, (byte)8, gadget.GetName(), itemLore.toArray(new String[itemLore.size()]), 1, true, false).hideInfo());
|
||||
setItem(slot, new ShopItem(Material.INK_SACK, (byte)8, gadget.getName(), itemLore.toArray(new String[itemLore.size()]), 1, true, false).hideInfo());
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -313,7 +361,7 @@ public class GadgetPage extends ShopPageBase<CosmeticManager, CosmeticShop>
|
||||
{
|
||||
ItemGadget itemGadget = (ItemGadget)gadget;
|
||||
|
||||
if (itemGadget.getAmmo().GetCost(CurrencyType.TREASURE_SHARD) < 0)
|
||||
if (itemGadget.getAmmo().getCost(CurrencyType.TREASURE_SHARD) < 0)
|
||||
return;
|
||||
}
|
||||
|
||||
@ -326,7 +374,7 @@ public class GadgetPage extends ShopPageBase<CosmeticManager, CosmeticShop>
|
||||
{
|
||||
public void run()
|
||||
{
|
||||
getPlugin().getInventoryManager().addItemToInventory(getPlayer(), 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();
|
||||
}
|
||||
}, this, (gadget instanceof ItemGadget ? ((ItemGadget) gadget).getAmmo() : gadget), CurrencyType.TREASURE_SHARD, getPlayer()));
|
||||
@ -336,7 +384,7 @@ public class GadgetPage extends ShopPageBase<CosmeticManager, CosmeticShop>
|
||||
{
|
||||
// if (gadget instanceof ItemGadget)
|
||||
// {
|
||||
// if (getPlugin().getInventoryManager().Get(player).getItemCount(gadget.GetName()) <= 0)
|
||||
// if (getPlugin().getInventoryManager().Get(player).getItemCount(gadget.getName()) <= 0)
|
||||
// {
|
||||
// purchaseGadget(player, gadget);
|
||||
// return;
|
||||
@ -344,9 +392,9 @@ public class GadgetPage extends ShopPageBase<CosmeticManager, CosmeticShop>
|
||||
// }
|
||||
|
||||
playAcceptSound(player);
|
||||
gadget.Enable(player);
|
||||
gadget.enable(player);
|
||||
|
||||
getShop().openPageForPlayer(getPlayer(), new Menu(getPlugin(), getShop(), getClientManager(), getDonationManager(), player));
|
||||
refresh();
|
||||
}
|
||||
|
||||
public void handleRightClick(Player player, Gadget gadget)
|
||||
@ -360,7 +408,7 @@ public class GadgetPage extends ShopPageBase<CosmeticManager, CosmeticShop>
|
||||
public void deactivateGadget(Player player, Gadget gadget)
|
||||
{
|
||||
playAcceptSound(player);
|
||||
gadget.Disable(player);
|
||||
gadget.disable(player);
|
||||
refresh();
|
||||
}
|
||||
}
|
@ -31,13 +31,13 @@ public class HatPage extends GadgetPage
|
||||
{
|
||||
int slot = 19;
|
||||
|
||||
List<Gadget> list = getPlugin().getGadgetManager().getGadgets(GadgetType.Hat);
|
||||
List<Gadget> list = getPlugin().getGadgetManager().getGadgets(GadgetType.HAT);
|
||||
if(list != null)
|
||||
for (Gadget gadget : list)
|
||||
{
|
||||
addGadget(gadget, slot);
|
||||
|
||||
if (getPlugin().getGadgetManager().getActive(getPlayer(), GadgetType.Hat) == gadget)
|
||||
if (getPlugin().getGadgetManager().getActive(getPlayer(), GadgetType.HAT) == gadget)
|
||||
addGlow(slot);
|
||||
|
||||
slot++;
|
||||
|
@ -4,6 +4,7 @@ import java.util.ArrayList;
|
||||
import java.util.EnumMap;
|
||||
import java.util.List;
|
||||
|
||||
import mineplex.core.cosmetic.ui.button.open.*;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.Creature;
|
||||
import org.bukkit.entity.EntityType;
|
||||
@ -18,19 +19,6 @@ import mineplex.core.common.util.NautHashMap;
|
||||
import mineplex.core.common.util.UtilText;
|
||||
import mineplex.core.cosmetic.CosmeticManager;
|
||||
import mineplex.core.cosmetic.ui.CosmeticShop;
|
||||
import mineplex.core.cosmetic.ui.button.OpenArrowTrails;
|
||||
import mineplex.core.cosmetic.ui.button.OpenCostumes;
|
||||
import mineplex.core.cosmetic.ui.button.OpenDeathAnimations;
|
||||
import mineplex.core.cosmetic.ui.button.OpenDoubleJump;
|
||||
import mineplex.core.cosmetic.ui.button.OpenGadgets;
|
||||
import mineplex.core.cosmetic.ui.button.OpenGameModifiers;
|
||||
import mineplex.core.cosmetic.ui.button.OpenHats;
|
||||
import mineplex.core.cosmetic.ui.button.OpenMorphs;
|
||||
import mineplex.core.cosmetic.ui.button.OpenMounts;
|
||||
import mineplex.core.cosmetic.ui.button.OpenMusic;
|
||||
import mineplex.core.cosmetic.ui.button.OpenParticles;
|
||||
import mineplex.core.cosmetic.ui.button.OpenPets;
|
||||
import mineplex.core.cosmetic.ui.button.OpenWinEffect;
|
||||
import mineplex.core.donation.DonationManager;
|
||||
import mineplex.core.gadget.types.Gadget;
|
||||
import mineplex.core.gadget.types.GadgetType;
|
||||
@ -79,7 +67,6 @@ public class Menu extends ShopPageBase<CosmeticManager, CosmeticShop>
|
||||
int tauntSlot = 49;//slots[11];
|
||||
int winEffectSlot = 51;
|
||||
int gameModifierSlot = 53;
|
||||
int boosterSlot = 52;// TODO
|
||||
|
||||
EnumMap<GadgetType, Integer> ownedCount = new EnumMap<GadgetType, Integer>(GadgetType.class);
|
||||
EnumMap<GadgetType, Integer> maxCount = new EnumMap<GadgetType, Integer>(GadgetType.class);
|
||||
@ -113,7 +100,7 @@ public class Menu extends ShopPageBase<CosmeticManager, CosmeticShop>
|
||||
Mount<?> mountActive = getPlugin().getMountManager().getActive(getPlayer());
|
||||
for (Mount<?> mount : getPlugin().getMountManager().getMounts())
|
||||
{
|
||||
if (getDonationManager().Get(getPlayer()).OwnsUnknownPackage(mount.GetName()) || mount.HasMount(getPlayer()))
|
||||
if (getDonationManager().Get(getPlayer()).OwnsUnknownPackage(mount.getName()) || mount.hasMount(getPlayer()))
|
||||
{
|
||||
mountOwned++;
|
||||
}
|
||||
@ -135,37 +122,37 @@ public class Menu extends ShopPageBase<CosmeticManager, CosmeticShop>
|
||||
}
|
||||
Creature petActive = getPlugin().getPetManager().GetPet(getPlayer());
|
||||
|
||||
GadgetType type = GadgetType.Particle;
|
||||
GadgetType type = GadgetType.PARTICLE;
|
||||
String[] lore = getLore(ownedCount.get(type), maxCount.get(type), "Show everyone how cool you are with swirly particles that follow you when you walk!", "Visible Everywhere", enabled.get(type));
|
||||
addButton(particleSlot, new ShopItem(Material.NETHER_STAR, "Particle Effects", lore, 1, false), new OpenParticles(this, enabled.get(type)));
|
||||
if (enabled.containsKey(type)) addGlow(particleSlot);
|
||||
|
||||
type = GadgetType.ArrowTrail;
|
||||
type = GadgetType.ARROW_TRAIL;
|
||||
lore = getLore(ownedCount.get(type), maxCount.get(type), "Your arrows will now leave particle trails as they soar through the air.", "Visible in Games", enabled.get(type));
|
||||
addButton(arrowSlot, new ShopItem(Material.ARROW, "Arrow Effects", lore, 1, false), new OpenArrowTrails(this, enabled.get(type)));
|
||||
if (enabled.containsKey(type)) addGlow(arrowSlot);
|
||||
|
||||
type = GadgetType.DoubleJump;
|
||||
type = GadgetType.DOUBLE_JUMP;
|
||||
lore = getLore(ownedCount.get(type), maxCount.get(type), "Demonstrate your parkour prowess with sweet particles when you double jump.", "Visible Everywhere", enabled.get(type));
|
||||
addButton(jumpSlot, new ShopItem(Material.GOLD_BOOTS, "Double Jump Effects", lore, 1, false), new OpenDoubleJump(this, enabled.get(type)));
|
||||
if (enabled.containsKey(type)) addGlow(jumpSlot);
|
||||
|
||||
type = GadgetType.Death;
|
||||
type = GadgetType.DEATH;
|
||||
lore = getLore(ownedCount.get(type), maxCount.get(type), "Your death will now be mourned with a wonderful particle tribute.", "Visible in Games", enabled.get(type));
|
||||
addButton(deathSlot, new ShopItem(Material.SKULL_ITEM, "Death Animations", lore, 1, false), new OpenDeathAnimations(this, enabled.get(type)));
|
||||
if (enabled.containsKey(type)) addGlow(deathSlot);
|
||||
|
||||
type = GadgetType.Item;
|
||||
type = GadgetType.ITEM;
|
||||
lore = getLore(ownedCount.get(type), maxCount.get(type), "All sorts of zany contraptions to use on your friends and foes.", "Usable in Lobbies", enabled.get(type));
|
||||
addButton(gadgetSlot, new ShopItem(Material.MELON_BLOCK, "Gadgets", lore, 1, false), new OpenGadgets(this, enabled.get(type)));
|
||||
if (enabled.containsKey(type)) addGlow(gadgetSlot);
|
||||
|
||||
type = GadgetType.Morph;
|
||||
type = GadgetType.MORPH;
|
||||
lore = getLore(ownedCount.get(type), maxCount.get(type), "Have you ever wanted to be a tiger? Well, you can't be a tiger! That's silly! But you can be many other things!", "Usable in Lobbies", enabled.get(type));
|
||||
addButton(morphSlot, new ShopItem(Material.LEATHER, "Morphs", lore, 1, false), new OpenMorphs(this, enabled.get(type)));
|
||||
if (enabled.containsKey(type)) addGlow(morphSlot);
|
||||
|
||||
lore = getLore(mountOwned, mountMax, "Why walk when you can ride? Summon fancy mounts to help you move in style.", "Usable in Lobbies", mountActive == null ? null : mountActive.GetName());
|
||||
lore = getLore(mountOwned, mountMax, "Why walk when you can ride? Summon fancy mounts to help you move in style.", "Usable in Lobbies", mountActive == null ? null : mountActive.getName());
|
||||
addButton(mountSlot, new ShopItem(Material.IRON_BARDING, "Mounts", lore, 1, false), new OpenMounts(this, mountActive));
|
||||
if (mountActive != null) addGlow(mountSlot);
|
||||
|
||||
@ -173,18 +160,18 @@ public class Menu extends ShopPageBase<CosmeticManager, CosmeticShop>
|
||||
addButton(petSlot, new ShopItem(Material.BONE, "Pets", lore, 1, false), new OpenPets(this));
|
||||
if (petActive != null) addGlow(petSlot);
|
||||
|
||||
type = GadgetType.Hat;
|
||||
type = GadgetType.HAT;
|
||||
lore = getLore(ownedCount.get(type), maxCount.get(type), "Hats are in this year. Wear them on your head to impress the ladies.", "Usable in Lobbies", enabled.get(type));
|
||||
addButton(hatSlot, new ShopItem(Material.GOLD_HELMET, "Hats", lore, 1, false), new OpenHats(this, enabled.get(type)));
|
||||
if (enabled.containsKey(type)) addGlow(hatSlot);
|
||||
|
||||
type = GadgetType.Costume;
|
||||
type = GadgetType.COSTUME;
|
||||
// Fixes more than 8 costumes being counted, even without the WindUp
|
||||
lore = getLore((ownedCount.get(type) > 8) ? 8 : ownedCount.get(type), /*maxCount.get(type)*/ 8, "Sometimes going out calls for special clothes! Gain bonus effects for matching outfit.", "Usable in Lobbies", enabled.get(type));
|
||||
addButton(costumeSlot, new ShopItem(Material.DIAMOND_CHESTPLATE, "Costumes", lore, 1, false), new OpenCostumes(this, enabled.get(type)));
|
||||
if (enabled.containsKey(type)) addGlow(costumeSlot);
|
||||
|
||||
type = GadgetType.MusicDisc;
|
||||
type = GadgetType.MUSIC_DISC;
|
||||
lore = getLore(ownedCount.get(type), maxCount.get(type), "I JUST WANT TO DANCE WITH YOU!", "Usable in Lobbies", enabled.get(type));
|
||||
addButton(musicSlot, new ShopItem(Material.GREEN_RECORD, "Music", lore, 1, false), new OpenMusic(this, enabled.get(type)));
|
||||
if (enabled.containsKey(type)) addGlow(musicSlot);
|
||||
@ -198,25 +185,21 @@ public class Menu extends ShopPageBase<CosmeticManager, CosmeticShop>
|
||||
}
|
||||
});
|
||||
|
||||
type = GadgetType.WinEffect;
|
||||
lore = getLore(ownedCount.get(type), maxCount.get(type), "Winning a game with your friends all good and dandy, but then being able to also show off awsome effects is even more fun!", "Usable in Lobbies", enabled.get(type));
|
||||
type = GadgetType.WIN_EFFECT;
|
||||
lore = getLore(ownedCount.get(type), maxCount.get(type), "Winning a game with your friends all good and dandy, but then being able to also show off awesome effects is even more fun!", "Usable in Lobbies", enabled.get(type));
|
||||
addButton(winEffectSlot, new ShopItem(Material.CAKE, "Win Effects", lore, 1, false), new OpenWinEffect(this, enabled.get(type)));
|
||||
if (enabled.containsKey(type)) addGlow(winEffectSlot);
|
||||
|
||||
|
||||
type = GadgetType.GameModifier;
|
||||
type = GadgetType.GAME_MODIFIER;
|
||||
lore = getLore(ownedCount.get(type), maxCount.get(type), "Cosmetic effects which changes appearances of objects in game", "Visible in Games", enabled.get(type));
|
||||
addButton(gameModifierSlot, new ShopItem(Material.TORCH, "Game Modifiers", lore, 1, false), new OpenGameModifiers(this, enabled.get(type)));
|
||||
if (enabled.containsKey(type)) addGlow(gameModifierSlot);
|
||||
|
||||
// addButton(boosterSlot, new ShopItem(Material.EMERALD, "Game Boosters",
|
||||
// new String[]{C.Bold + "", C.cDGreen + C.Italics + "Coming soon!"}, 1, false),
|
||||
// (player, clickType) -> openBoosters(player));
|
||||
}
|
||||
|
||||
private String[] getLore(int ownedCount, int maxCount, String info, String visibility, Gadget enabled)
|
||||
{
|
||||
return getLore(ownedCount, maxCount, info, visibility, enabled == null ? null : enabled.GetName());
|
||||
return getLore(ownedCount, maxCount, info, visibility, enabled == null ? null : enabled.getName());
|
||||
}
|
||||
|
||||
private String[] getLore(int ownedCount, int maxCount,String info, String visibility, String enabled)
|
||||
@ -259,9 +242,4 @@ public class Menu extends ShopPageBase<CosmeticManager, CosmeticShop>
|
||||
{
|
||||
getShop().openPageForPlayer(player, new MusicPage(getPlugin(), getShop(), getClientManager(), getDonationManager(), "Music", player));
|
||||
}
|
||||
|
||||
public void openBoosters(Player player)
|
||||
{
|
||||
getShop().openPageForPlayer(player, new BoosterPage(getPlugin(), getShop(), getClientManager(), getDonationManager(), player));
|
||||
}
|
||||
}
|
||||
|
@ -26,11 +26,11 @@ public class MorphPage extends GadgetPage
|
||||
{
|
||||
int slot = 19;
|
||||
|
||||
for (Gadget gadget : getPlugin().getGadgetManager().getGadgets(GadgetType.Morph))
|
||||
for (Gadget gadget : getPlugin().getGadgetManager().getGadgets(GadgetType.MORPH))
|
||||
{
|
||||
addGadget(gadget, slot);
|
||||
|
||||
if (getPlugin().getGadgetManager().getActive(getPlayer(), GadgetType.Morph) == gadget)
|
||||
if (getPlugin().getGadgetManager().getActive(getPlayer(), GadgetType.MORPH) == gadget)
|
||||
addGlow(slot);
|
||||
|
||||
slot++;
|
||||
|
@ -13,8 +13,8 @@ import mineplex.core.common.CurrencyType;
|
||||
import mineplex.core.common.util.C;
|
||||
import mineplex.core.cosmetic.CosmeticManager;
|
||||
import mineplex.core.cosmetic.ui.CosmeticShop;
|
||||
import mineplex.core.cosmetic.ui.button.ActivateMountButton;
|
||||
import mineplex.core.cosmetic.ui.button.DeactivateMountButton;
|
||||
import mineplex.core.cosmetic.ui.button.activate.ActivateMountButton;
|
||||
import mineplex.core.cosmetic.ui.button.deactivate.DeactivateMountButton;
|
||||
import mineplex.core.cosmetic.ui.button.MountButton;
|
||||
import mineplex.core.donation.DonationManager;
|
||||
import mineplex.core.mount.Mount;
|
||||
@ -58,105 +58,110 @@ public class MountPage extends ShopPageBase<CosmeticManager, CosmeticShop>
|
||||
List<String> itemLore = new ArrayList<String>();
|
||||
|
||||
itemLore.add(C.cBlack);
|
||||
itemLore.addAll(Arrays.asList(mount.GetDescription()));
|
||||
itemLore.addAll(Arrays.asList(mount.getDescription()));
|
||||
|
||||
if (!getDonationManager().Get(getPlayer().getName()).OwnsUnknownPackage(mount.GetName()))
|
||||
if (!getDonationManager().Get(getPlayer().getName()).OwnsUnknownPackage(mount.getName()))
|
||||
{
|
||||
if (mount.GetCost(CurrencyType.TREASURE_SHARD) == -1)
|
||||
if (mount.getCost(CurrencyType.TREASURE_SHARD) == -1)
|
||||
{
|
||||
//Nothing
|
||||
}
|
||||
//Chest Unlocks
|
||||
else if (mount.GetCost(CurrencyType.TREASURE_SHARD) == -2 || mount.GetCost(CurrencyType.TREASURE_SHARD) > 0)
|
||||
else if (mount.getCost(CurrencyType.TREASURE_SHARD) == -2 || mount.getCost(CurrencyType.TREASURE_SHARD) > 0)
|
||||
{
|
||||
itemLore.add(C.cBlack);
|
||||
itemLore.add(C.cBlue + "Found in Treasure Chests");
|
||||
}
|
||||
else if (mount.GetCost(CurrencyType.TREASURE_SHARD) == -3)
|
||||
else if (mount.getCost(CurrencyType.TREASURE_SHARD) == -3)
|
||||
{
|
||||
itemLore.add(C.cBlack);
|
||||
itemLore.add(C.cBlue + "Found in Winter Holiday Treasure");
|
||||
}
|
||||
else if (mount.GetCost(CurrencyType.TREASURE_SHARD) == -4)
|
||||
else if (mount.getCost(CurrencyType.TREASURE_SHARD) == -4)
|
||||
{
|
||||
itemLore.add(C.cBlack);
|
||||
itemLore.add(C.cBlue + "Found in Halloween Pumpkin Treasure");
|
||||
}
|
||||
else if (mount.GetCost(CurrencyType.TREASURE_SHARD) == -5)
|
||||
else if (mount.getCost(CurrencyType.TREASURE_SHARD) == -5)
|
||||
{
|
||||
itemLore.add(C.cBlack);
|
||||
itemLore.add(C.cBlue + "Found in Easter Holiday Treasure");
|
||||
}
|
||||
else if (mount.GetCost(CurrencyType.TREASURE_SHARD) == -6)
|
||||
else if (mount.getCost(CurrencyType.TREASURE_SHARD) == -6)
|
||||
{
|
||||
itemLore.add(C.cBlack);
|
||||
itemLore.add(C.cBlue + "Found in Valentines Holiday Treasure");
|
||||
}
|
||||
else if (mount.getCost(CurrencyType.TREASURE_SHARD) == -7)
|
||||
{
|
||||
itemLore.add(C.cBlack);
|
||||
itemLore.add(C.cBlue + "Found in Freedom Chests");
|
||||
}
|
||||
//Rank Unlocks
|
||||
else if (mount.GetCost(CurrencyType.TREASURE_SHARD) == -10)
|
||||
else if (mount.getCost(CurrencyType.TREASURE_SHARD) == -10)
|
||||
{
|
||||
itemLore.add(C.cBlack);
|
||||
itemLore.add(C.cAqua + "Unlocked with Ultra Rank");
|
||||
}
|
||||
else if (mount.GetCost(CurrencyType.TREASURE_SHARD) == -11)
|
||||
else if (mount.getCost(CurrencyType.TREASURE_SHARD) == -11)
|
||||
{
|
||||
itemLore.add(C.cBlack);
|
||||
itemLore.add(C.cPurple + "Unlocked with Hero Rank");
|
||||
}
|
||||
else if (mount.GetCost(CurrencyType.TREASURE_SHARD) == -12)
|
||||
else if (mount.getCost(CurrencyType.TREASURE_SHARD) == -12)
|
||||
{
|
||||
itemLore.add(C.cBlack);
|
||||
itemLore.add(C.cGreen + "Unlocked with Legend Rank");
|
||||
}
|
||||
else if (mount.GetCost(CurrencyType.TREASURE_SHARD) == -13)
|
||||
else if (mount.getCost(CurrencyType.TREASURE_SHARD) == -13)
|
||||
{
|
||||
itemLore.add(C.cBlack);
|
||||
itemLore.add(C.cRed + "Unlocked with Titan Rank");
|
||||
}
|
||||
}
|
||||
|
||||
if (getDonationManager().Get(getPlayer().getName()).OwnsUnknownPackage(mount.GetName()))
|
||||
if (getDonationManager().Get(getPlayer().getName()).OwnsUnknownPackage(mount.getName()))
|
||||
{
|
||||
if (mount.GetActive().containsKey(getPlayer()))
|
||||
if (mount.getActive().containsKey(getPlayer()))
|
||||
{
|
||||
itemLore.add(C.cBlack);
|
||||
itemLore.add(C.cGreen + "Click to Disable");
|
||||
|
||||
addButton(slot, new ShopItem(mount.GetDisplayMaterial(), mount.GetDisplayData(), mount.GetName(), itemLore.toArray(new String[itemLore.size()]), 1, false, false), new DeactivateMountButton(mount, this));
|
||||
addButton(slot, new ShopItem(mount.getDisplayMaterial(), mount.getDisplayData(), mount.getName(), itemLore.toArray(new String[itemLore.size()]), 1, false, false), new DeactivateMountButton(mount, this));
|
||||
}
|
||||
else
|
||||
{
|
||||
itemLore.add(C.cBlack);
|
||||
itemLore.add(C.cGreen + "Click to Enable");
|
||||
|
||||
addButton(slot, new ShopItem(mount.GetDisplayMaterial(), mount.GetDisplayData(), mount.GetName(), itemLore.toArray(new String[itemLore.size()]), 1, false, false), new ActivateMountButton(mount, this));
|
||||
addButton(slot, new ShopItem(mount.getDisplayMaterial(), mount.getDisplayData(), mount.getName(), itemLore.toArray(new String[itemLore.size()]), 1, false, false), new ActivateMountButton(mount, this));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (mount.GetCost(CurrencyType.TREASURE_SHARD) > 0)
|
||||
if (mount.getCost(CurrencyType.TREASURE_SHARD) > 0)
|
||||
{
|
||||
itemLore.add(C.cBlack);
|
||||
itemLore.add(C.cWhiteB + "Cost: " + C.cAqua + mount.GetCost(CurrencyType.TREASURE_SHARD) + " Treasure Shards");
|
||||
itemLore.add(C.cWhiteB + "Cost: " + C.cAqua + mount.getCost(CurrencyType.TREASURE_SHARD) + " Treasure Shards");
|
||||
}
|
||||
|
||||
if (mount.GetCost(CurrencyType.TREASURE_SHARD) > 0 && getDonationManager().Get(getPlayer().getName()).GetBalance(CurrencyType.TREASURE_SHARD) >= mount.GetCost(CurrencyType.TREASURE_SHARD))
|
||||
if (mount.getCost(CurrencyType.TREASURE_SHARD) > 0 && getDonationManager().Get(getPlayer().getName()).GetBalance(CurrencyType.TREASURE_SHARD) >= mount.getCost(CurrencyType.TREASURE_SHARD))
|
||||
{
|
||||
itemLore.add(C.cBlack);
|
||||
itemLore.add(C.cGreen + "Click to Purchase");
|
||||
|
||||
addButton(slot, new ShopItem(Material.INK_SACK, (byte) 7, mount.GetName(), itemLore.toArray(new String[itemLore.size()]), 1, true, false), new MountButton(mount, this));
|
||||
addButton(slot, new ShopItem(Material.INK_SACK, (byte) 8, mount.getName(), itemLore.toArray(new String[itemLore.size()]), 1, true, false), new MountButton(mount, this));
|
||||
}
|
||||
else if (mount.GetCost(CurrencyType.TREASURE_SHARD) > 0)
|
||||
else if (mount.getCost(CurrencyType.TREASURE_SHARD) > 0)
|
||||
{
|
||||
itemLore.add(C.cBlack);
|
||||
itemLore.add(C.cRed + "Not enough Treasure Shards.");
|
||||
|
||||
setItem(slot, new ShopItem(Material.INK_SACK, (byte) 7, mount.GetName(), itemLore.toArray(new String[itemLore.size()]), 1, true, false));
|
||||
setItem(slot, new ShopItem(Material.INK_SACK, (byte) 8, mount.getName(), itemLore.toArray(new String[itemLore.size()]), 1, true, false));
|
||||
}
|
||||
else
|
||||
{
|
||||
setItem(slot, new ShopItem(Material.INK_SACK, (byte) 7, mount.GetName(), itemLore.toArray(new String[itemLore.size()]), 1, true, false));
|
||||
setItem(slot, new ShopItem(Material.INK_SACK, (byte) 8, mount.getName(), itemLore.toArray(new String[itemLore.size()]), 1, true, false));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -28,7 +28,7 @@ public class MusicPage extends GadgetPage
|
||||
{
|
||||
int slot = 19;
|
||||
|
||||
for (Gadget gadget : getPlugin().getGadgetManager().getGadgets(GadgetType.MusicDisc))
|
||||
for (Gadget gadget : getPlugin().getGadgetManager().getGadgets(GadgetType.MUSIC_DISC))
|
||||
{
|
||||
addGadget(gadget, slot);
|
||||
|
||||
|
@ -26,11 +26,11 @@ public class ParticlePage extends GadgetPage
|
||||
{
|
||||
int slot = 19;
|
||||
|
||||
for (Gadget gadget : getPlugin().getGadgetManager().getGadgets(GadgetType.Particle))
|
||||
for (Gadget gadget : getPlugin().getGadgetManager().getGadgets(GadgetType.PARTICLE))
|
||||
{
|
||||
addGadget(gadget, slot);
|
||||
|
||||
if (getPlugin().getGadgetManager().getActive(getPlayer(), GadgetType.Particle) == gadget)
|
||||
if (getPlugin().getGadgetManager().getActive(getPlayer(), GadgetType.PARTICLE) == gadget)
|
||||
addGlow(slot);
|
||||
|
||||
slot++;
|
||||
|
@ -24,8 +24,8 @@ import mineplex.core.common.util.UtilPlayer;
|
||||
import mineplex.core.cosmetic.CosmeticManager;
|
||||
import mineplex.core.cosmetic.ui.CosmeticShop;
|
||||
import mineplex.core.cosmetic.ui.PetSorter;
|
||||
import mineplex.core.cosmetic.ui.button.ActivatePetButton;
|
||||
import mineplex.core.cosmetic.ui.button.DeactivatePetButton;
|
||||
import mineplex.core.cosmetic.ui.button.activate.ActivatePetButton;
|
||||
import mineplex.core.cosmetic.ui.button.deactivate.DeactivatePetButton;
|
||||
import mineplex.core.cosmetic.ui.button.PetButton;
|
||||
import mineplex.core.cosmetic.ui.button.RenamePetButton;
|
||||
import mineplex.core.donation.DonationManager;
|
||||
@ -58,54 +58,54 @@ public class PetPage extends ShopPageBase<CosmeticManager, CosmeticShop>
|
||||
List<String> itemLore = new ArrayList<String>();
|
||||
|
||||
itemLore.add(C.cBlack);
|
||||
itemLore.add(C.cGray + "Your very own " + pet.GetName() + "!");
|
||||
itemLore.add(C.cGray + "Your very own " + pet.getName() + "!");
|
||||
|
||||
//Chest Unlocks
|
||||
if (!getPlugin().getPetManager().Get(getPlayer()).GetPets().containsKey(pet.GetPetType()))
|
||||
{
|
||||
if (pet.GetCost(CurrencyType.TREASURE_SHARD) == -1)
|
||||
if (pet.getCost(CurrencyType.TREASURE_SHARD) == -1)
|
||||
{
|
||||
//Nothing
|
||||
}
|
||||
|
||||
else if (pet.GetCost(CurrencyType.TREASURE_SHARD) == -2 || pet.GetCost(CurrencyType.TREASURE_SHARD) > 0)
|
||||
else if (pet.getCost(CurrencyType.TREASURE_SHARD) == -2 || pet.getCost(CurrencyType.TREASURE_SHARD) > 0)
|
||||
{
|
||||
itemLore.add(C.cBlack);
|
||||
itemLore.add(C.cBlue + "Found in Treasure Chests");
|
||||
}
|
||||
else if (pet.GetCost(CurrencyType.TREASURE_SHARD) == -3)
|
||||
else if (pet.getCost(CurrencyType.TREASURE_SHARD) == -3)
|
||||
{
|
||||
itemLore.add(C.cBlack);
|
||||
itemLore.add(C.cBlue + "Found in Winter Holiday Treasure");
|
||||
}
|
||||
else if (pet.GetCost(CurrencyType.TREASURE_SHARD) == -4)
|
||||
else if (pet.getCost(CurrencyType.TREASURE_SHARD) == -4)
|
||||
{
|
||||
itemLore.add(C.cBlack);
|
||||
itemLore.add(C.cBlue + "Found in Halloween Pumpkin Treasure");
|
||||
}
|
||||
else if (pet.GetCost(CurrencyType.TREASURE_SHARD) == -5)
|
||||
else if (pet.getCost(CurrencyType.TREASURE_SHARD) == -5)
|
||||
{
|
||||
itemLore.add(C.cBlack);
|
||||
itemLore.add(C.cBlue + "Found in Easter Holiday Treasure");
|
||||
}
|
||||
|
||||
//Rank Unlocks
|
||||
else if (pet.GetCost(CurrencyType.TREASURE_SHARD) == -10)
|
||||
else if (pet.getCost(CurrencyType.TREASURE_SHARD) == -10)
|
||||
{
|
||||
itemLore.add(C.cBlack);
|
||||
itemLore.add(C.cAqua + "Unlocked with Ultra Rank");
|
||||
}
|
||||
else if (pet.GetCost(CurrencyType.TREASURE_SHARD) == -11)
|
||||
else if (pet.getCost(CurrencyType.TREASURE_SHARD) == -11)
|
||||
{
|
||||
itemLore.add(C.cBlack);
|
||||
itemLore.add(C.cPurple + "Unlocked with Hero Rank");
|
||||
}
|
||||
else if (pet.GetCost(CurrencyType.TREASURE_SHARD) == -12)
|
||||
else if (pet.getCost(CurrencyType.TREASURE_SHARD) == -12)
|
||||
{
|
||||
itemLore.add(C.cBlack);
|
||||
itemLore.add(C.cGreen + "Unlocked with Legend Rank");
|
||||
}
|
||||
else if (pet.GetCost(CurrencyType.TREASURE_SHARD) == -13)
|
||||
else if (pet.getCost(CurrencyType.TREASURE_SHARD) == -13)
|
||||
{
|
||||
itemLore.add(C.cBlack);
|
||||
itemLore.add(C.cRed + "Unlocked with Titan Rank");
|
||||
@ -118,7 +118,7 @@ public class PetPage extends ShopPageBase<CosmeticManager, CosmeticShop>
|
||||
String petName = getPlugin().getPetManager().Get(getPlayer()).GetPets().get(pet.GetPetType());
|
||||
if (petName == null)
|
||||
{
|
||||
petName = pet.GetName();
|
||||
petName = pet.getName();
|
||||
}
|
||||
|
||||
if (getPlugin().getPetManager().hasActivePet(getPlayer().getName()) && getPlugin().getPetManager().getActivePet(getPlayer().getName()).getType() == pet.GetPetType())
|
||||
@ -145,20 +145,20 @@ public class PetPage extends ShopPageBase<CosmeticManager, CosmeticShop>
|
||||
//Not Owned
|
||||
else
|
||||
{
|
||||
if (pet.GetCost(CurrencyType.TREASURE_SHARD) > 0)
|
||||
if (pet.getCost(CurrencyType.TREASURE_SHARD) > 0)
|
||||
{
|
||||
itemLore.add(C.cBlack);
|
||||
itemLore.add(C.cWhiteB + "Cost: " + C.cAqua + pet.GetCost(CurrencyType.TREASURE_SHARD) + " Treasure Shards");
|
||||
itemLore.add(C.cWhiteB + "Cost: " + C.cAqua + pet.getCost(CurrencyType.TREASURE_SHARD) + " Treasure Shards");
|
||||
}
|
||||
|
||||
if (pet.GetCost(CurrencyType.TREASURE_SHARD) > 0 && getDonationManager().Get(getPlayer().getName()).GetBalance(CurrencyType.TREASURE_SHARD) >= pet.GetCost(CurrencyType.TREASURE_SHARD))
|
||||
if (pet.getCost(CurrencyType.TREASURE_SHARD) > 0 && getDonationManager().Get(getPlayer().getName()).GetBalance(CurrencyType.TREASURE_SHARD) >= pet.getCost(CurrencyType.TREASURE_SHARD))
|
||||
{
|
||||
itemLore.add(C.cBlack);
|
||||
itemLore.add(C.cGreen + "Click to Purchase");
|
||||
|
||||
addButton(slot, new ShopItem(Material.INK_SACK, (byte) 8, pet.GetPetName(), itemLore.toArray(new String[itemLore.size()]), 1, true, false), new PetButton(pet, this));
|
||||
}
|
||||
else if (pet.GetCost(CurrencyType.TREASURE_SHARD) > 0)
|
||||
else if (pet.getCost(CurrencyType.TREASURE_SHARD) > 0)
|
||||
{
|
||||
itemLore.add(C.cBlack);
|
||||
itemLore.add(C.cRed + "Not enough Treasure Shards.");
|
||||
@ -185,11 +185,16 @@ public class PetPage extends ShopPageBase<CosmeticManager, CosmeticShop>
|
||||
if (!getPlugin().getPetManager().hasActivePet(getPlayer().getName()))
|
||||
{
|
||||
itemLore.add(C.cWhite + "You must have an active pet to use this!");
|
||||
getInventory().setItem(slot, new ShopItem(petExtra.GetMaterial(), (byte)0, C.cRed + petExtra.GetName(), itemLore.toArray(new String[itemLore.size()]), 1, true, false).getHandle());
|
||||
getInventory().setItem(slot, new ShopItem(petExtra.GetMaterial(), (byte)0, C.cRed + petExtra.getName(), itemLore.toArray(new String[itemLore.size()]), 1, true, false).getHandle());
|
||||
}
|
||||
else if (getPlugin().getPetManager().getActivePet(getPlayer().getName()).getType() != EntityType.WITHER)
|
||||
// Silverfish = Wither disguised
|
||||
// Villager = Elf
|
||||
// Zombie = Pumpkin
|
||||
else if (getPlugin().getPetManager().getActivePet(getPlayer().getName()).getType() != EntityType.SILVERFISH
|
||||
|| getPlugin().getPetManager().getActivePet(getPlayer().getName()).getType() != EntityType.VILLAGER
|
||||
|| getPlugin().getPetManager().getActivePet(getPlayer().getName()).getType() != EntityType.ZOMBIE)
|
||||
{
|
||||
addButton(slot, new ShopItem(petExtra.GetMaterial(), (byte) 0, "Rename " + getPlugin().getPetManager().getActivePet(getPlayer().getName()).getCustomName() + " for " + C.cYellow + petExtra.GetCost(CurrencyType.TREASURE_SHARD) + C.cGreen + " Shards", itemLore.toArray(new String[itemLore.size()]), 1, false, false), new RenamePetButton(this));
|
||||
addButton(slot, new ShopItem(petExtra.GetMaterial(), (byte) 0, "Rename " + getPlugin().getPetManager().getActivePet(getPlayer().getName()).getCustomName() + " for " + C.cYellow + petExtra.getCost(CurrencyType.TREASURE_SHARD) + C.cGreen + " Shards", itemLore.toArray(new String[itemLore.size()]), 1, false, false), new RenamePetButton(this));
|
||||
}
|
||||
|
||||
slot++;
|
||||
|
@ -92,7 +92,7 @@ public class PetTagPage extends ShopPageBase<CosmeticManager, CosmeticShop>
|
||||
return;
|
||||
}
|
||||
|
||||
PetExtra tag = new PetExtra("Rename " + _pet.GetName() + " to " + _tagName, Material.NAME_TAG, 100);
|
||||
PetExtra tag = new PetExtra("Rename " + _pet.getName() + " to " + _tagName, Material.NAME_TAG, 100);
|
||||
|
||||
_pet.setDisplayName(C.cGreen + "Purchase " + _tagName);
|
||||
|
||||
|
@ -31,13 +31,13 @@ public class TauntPage extends GadgetPage
|
||||
{
|
||||
int slot = 19;
|
||||
|
||||
List<Gadget> list = getPlugin().getGadgetManager().getGadgets(GadgetType.Taunt);
|
||||
List<Gadget> list = getPlugin().getGadgetManager().getGadgets(GadgetType.TAUNT);
|
||||
if(list != null)
|
||||
for (Gadget gadget : list)
|
||||
{
|
||||
addGadget(gadget, slot);
|
||||
|
||||
if (getPlugin().getGadgetManager().getActive(getPlayer(), GadgetType.Morph) == gadget)
|
||||
if (getPlugin().getGadgetManager().getActive(getPlayer(), GadgetType.MORPH) == gadget)
|
||||
addGlow(slot);
|
||||
|
||||
slot++;
|
||||
|
@ -28,11 +28,11 @@ public class WinEffectPage extends GadgetPage
|
||||
{
|
||||
int slot = 19;
|
||||
|
||||
for (Gadget gadget : getPlugin().getGadgetManager().getGadgets(GadgetType.WinEffect))
|
||||
for (Gadget gadget : getPlugin().getGadgetManager().getGadgets(GadgetType.WIN_EFFECT))
|
||||
{
|
||||
addGadget(gadget, slot);
|
||||
|
||||
if (getPlugin().getGadgetManager().getActive(getPlayer(), GadgetType.WinEffect) == gadget)
|
||||
if (getPlugin().getGadgetManager().getActive(getPlayer(), GadgetType.WIN_EFFECT) == gadget)
|
||||
addGlow(slot);
|
||||
|
||||
slot++;
|
||||
|
@ -1,8 +1,9 @@
|
||||
package mineplex.core.cosmetic.ui.page;
|
||||
package mineplex.core.cosmetic.ui.page.gamemodifiers;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import mineplex.core.cosmetic.ui.page.GadgetPage;
|
||||
import mineplex.core.cosmetic.ui.page.Menu;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.inventory.ClickType;
|
||||
@ -15,7 +16,7 @@ import mineplex.core.cosmetic.CosmeticManager;
|
||||
import mineplex.core.cosmetic.ui.CosmeticShop;
|
||||
import mineplex.core.donation.DonationManager;
|
||||
import mineplex.core.gadget.gadgets.gamemodifiers.GameModifierType;
|
||||
import mineplex.core.gadget.types.GadgetGameModifier;
|
||||
import mineplex.core.gadget.types.GameModifierGadget;
|
||||
import mineplex.core.shop.item.IButton;
|
||||
import mineplex.core.shop.item.ShopItem;
|
||||
|
||||
@ -37,7 +38,7 @@ public class GameModifierPage extends GadgetPage
|
||||
{
|
||||
int own = 0;
|
||||
int total = 0;
|
||||
for(GadgetGameModifier g : getPlugin().getGadgetManager().getGameModifiers(type)) {
|
||||
for(GameModifierGadget g : getPlugin().getGadgetManager().getGameModifiers(type)) {
|
||||
if(g.ownsGadget(getPlayer())) own++;
|
||||
total++;
|
||||
}
|
@ -1,5 +1,6 @@
|
||||
package mineplex.core.cosmetic.ui.page;
|
||||
package mineplex.core.cosmetic.ui.page.gamemodifiers;
|
||||
|
||||
import mineplex.core.cosmetic.ui.page.GadgetPage;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.inventory.ClickType;
|
||||
@ -11,7 +12,7 @@ import mineplex.core.cosmetic.ui.CosmeticShop;
|
||||
import mineplex.core.donation.DonationManager;
|
||||
import mineplex.core.gadget.gadgets.gamemodifiers.GameModifierType;
|
||||
import mineplex.core.gadget.gadgets.gamemodifiers.kits.KitModifierType;
|
||||
import mineplex.core.gadget.types.GadgetGameModifier;
|
||||
import mineplex.core.gadget.types.GameModifierGadget;
|
||||
import mineplex.core.shop.item.IButton;
|
||||
import mineplex.core.shop.item.ShopItem;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
@ -47,7 +48,7 @@ public class GameModifierSubPage extends GadgetPage
|
||||
{
|
||||
int own = 0;
|
||||
int total = 0;
|
||||
for (GadgetGameModifier g : getPlugin().getGadgetManager().getGameModifiers(kitModifierType))
|
||||
for (GameModifierGadget g : getPlugin().getGadgetManager().getGameModifiers(kitModifierType))
|
||||
{
|
||||
if (g.ownsGadget(getPlayer())) own++;
|
||||
total++;
|
||||
@ -83,12 +84,12 @@ public class GameModifierSubPage extends GadgetPage
|
||||
}
|
||||
else
|
||||
{
|
||||
for (GadgetGameModifier gadget : getPlugin().getGadgetManager().getGameModifiers(_type))
|
||||
for (GameModifierGadget gadget : getPlugin().getGadgetManager().getGameModifiers(_type))
|
||||
{
|
||||
|
||||
addGadget(gadget, slot);
|
||||
|
||||
if (gadget.IsActive(getPlayer()))
|
||||
if (gadget.isActive(getPlayer()))
|
||||
addGlow(slot);
|
||||
|
||||
slot++;
|
@ -1,14 +1,15 @@
|
||||
package mineplex.core.cosmetic.ui.page;
|
||||
package mineplex.core.cosmetic.ui.page.gamemodifiers;
|
||||
|
||||
import mineplex.core.account.CoreClientManager;
|
||||
import mineplex.core.common.util.C;
|
||||
import mineplex.core.cosmetic.CosmeticManager;
|
||||
import mineplex.core.cosmetic.ui.CosmeticShop;
|
||||
import mineplex.core.cosmetic.ui.page.GadgetPage;
|
||||
import mineplex.core.donation.DonationManager;
|
||||
import mineplex.core.gadget.gadgets.gamemodifiers.GameModifierType;
|
||||
import mineplex.core.gadget.gadgets.gamemodifiers.kits.KitGameModifier;
|
||||
import mineplex.core.gadget.gadgets.gamemodifiers.kits.KitModifierType;
|
||||
import mineplex.core.gadget.types.GadgetGameModifier;
|
||||
import mineplex.core.gadget.types.GameModifierGadget;
|
||||
import mineplex.core.shop.item.IButton;
|
||||
import mineplex.core.shop.item.ShopItem;
|
||||
import org.bukkit.Material;
|
||||
@ -37,7 +38,7 @@ public class KitGameModifierPage extends GadgetPage
|
||||
|
||||
int slot = 19;
|
||||
|
||||
for (GadgetGameModifier gadget : getPlugin().getGadgetManager().getGameModifiers(_kitType))
|
||||
for (GameModifierGadget gadget : getPlugin().getGadgetManager().getGameModifiers(_kitType))
|
||||
{
|
||||
if (gadget instanceof KitGameModifier)
|
||||
{
|
||||
@ -46,18 +47,14 @@ public class KitGameModifierPage extends GadgetPage
|
||||
{
|
||||
addGadget(gadget, slot);
|
||||
|
||||
if (gadget.IsActive(getPlayer()))
|
||||
if (gadget.isActive(getPlayer()))
|
||||
addGlow(slot);
|
||||
|
||||
slot++;
|
||||
|
||||
if(slot%9 == 8) slot += 2;
|
||||
}
|
||||
else
|
||||
continue;
|
||||
}
|
||||
else
|
||||
continue;
|
||||
}
|
||||
|
||||
addButton(4, new ShopItem(Material.BED, C.cGray + " \u21FD Go Back", new String[]{}, 1, false), new IButton()
|
@ -344,9 +344,9 @@ public class DisguiseManager extends MiniPlugin implements IPacketHandler
|
||||
|
||||
if (disguise.GetEntity() instanceof EntityPlayer && disguise instanceof DisguisePlayer)
|
||||
{
|
||||
if (!((EntityPlayer) disguise.GetEntity()).getName().equalsIgnoreCase(((DisguisePlayer) disguise).getName()))
|
||||
if (!(disguise.GetEntity()).getName().equalsIgnoreCase(((DisguisePlayer) disguise).getName()))
|
||||
{
|
||||
_blockedNames.add(((Player) disguise.GetEntity()).getName());
|
||||
_blockedNames.add((disguise.GetEntity()).getName());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,13 @@
|
||||
package mineplex.core.disguise.disguises;
|
||||
|
||||
import org.bukkit.entity.EntityType;
|
||||
|
||||
public class DisguiseAnimalBase extends DisguiseAnimal
|
||||
{
|
||||
|
||||
public DisguiseAnimalBase(EntityType entityType, org.bukkit.entity.Entity entity)
|
||||
{
|
||||
super(entityType, entity);
|
||||
}
|
||||
|
||||
}
|
@ -21,9 +21,11 @@ import net.minecraft.server.v1_8_R3.PacketPlayOutPlayerInfo;
|
||||
import net.minecraft.server.v1_8_R3.WorldServer;
|
||||
import net.minecraft.server.v1_8_R3.PacketPlayOutPlayerInfo.EnumPlayerInfoAction;
|
||||
import net.minecraft.server.v1_8_R3.WorldSettings;
|
||||
import org.bukkit.entity.Entity;
|
||||
|
||||
public class DisguisePlayer extends DisguiseHuman
|
||||
{
|
||||
private Entity _entity;
|
||||
private GameProfile _profile;
|
||||
private boolean _sneaking;
|
||||
private BlockFace _sleeping;
|
||||
@ -32,6 +34,7 @@ public class DisguisePlayer extends DisguiseHuman
|
||||
public DisguisePlayer(org.bukkit.entity.Entity entity)
|
||||
{
|
||||
super(entity);
|
||||
_entity = entity;
|
||||
}
|
||||
|
||||
public DisguisePlayer(org.bukkit.entity.Entity entity, GameProfile profile)
|
||||
@ -170,4 +173,9 @@ public class DisguisePlayer extends DisguiseHuman
|
||||
|
||||
sendPacket(packet);
|
||||
}
|
||||
|
||||
public org.bukkit.entity.Entity getEntity()
|
||||
{
|
||||
return _entity;
|
||||
}
|
||||
}
|
||||
|
@ -1,16 +1,27 @@
|
||||
package mineplex.core.gadget;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.*;
|
||||
import java.util.function.Predicate;
|
||||
|
||||
import mineplex.core.gadget.commands.LockCosmeticsCommand;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.Sound;
|
||||
import mineplex.core.gadget.event.GadgetEnableEvent;
|
||||
import mineplex.core.gadget.gadgets.arrowtrail.freedom.ArrowTrailFreedom;
|
||||
import mineplex.core.gadget.gadgets.death.freedom.DeathFreedom;
|
||||
import mineplex.core.gadget.gadgets.doublejump.freedom.DoubleJumpFreedom;
|
||||
import mineplex.core.gadget.gadgets.gamemodifiers.kits.KitModifier;
|
||||
import mineplex.core.gadget.gadgets.hat.*;
|
||||
import mineplex.core.gadget.gadgets.morph.*;
|
||||
import mineplex.core.gadget.gadgets.outfit.windupsuit.*;
|
||||
import mineplex.core.gadget.gadgets.particle.*;
|
||||
import mineplex.core.gadget.gadgets.particle.candycane.ParticleCandyCane;
|
||||
import mineplex.core.gadget.gadgets.particle.freedom.ParticleFreedom;
|
||||
import mineplex.core.gadget.gadgets.wineffect.*;
|
||||
import mineplex.core.gadget.persistence.UserGadgetPersistence;
|
||||
import mineplex.core.gadget.set.*;
|
||||
import mineplex.core.gadget.types.*;
|
||||
import mineplex.core.incognito.events.IncognitoHidePlayerEvent;
|
||||
import mineplex.core.incognito.events.IncognitoStatusChangeEvent;
|
||||
import org.bukkit.*;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.entity.PlayerDeathEvent;
|
||||
@ -24,7 +35,6 @@ import mineplex.core.MiniPlugin;
|
||||
import mineplex.core.account.CoreClientManager;
|
||||
import mineplex.core.achievement.AchievementManager;
|
||||
import mineplex.core.blockrestore.BlockRestore;
|
||||
import mineplex.core.common.Rank;
|
||||
import mineplex.core.common.util.NautHashMap;
|
||||
import mineplex.core.common.util.UtilEnt;
|
||||
import mineplex.core.common.util.UtilMath;
|
||||
@ -35,55 +45,44 @@ import mineplex.core.donation.DonationManager;
|
||||
import mineplex.core.gadget.commands.AmmoCommand;
|
||||
import mineplex.core.gadget.commands.UnlockCosmeticsCommand;
|
||||
import mineplex.core.gadget.event.GadgetCollideEntityEvent;
|
||||
import mineplex.core.gadget.event.GadgetEnableEvent;
|
||||
import mineplex.core.gadget.gadgets.arrowtrail.ArrowTrailBlood;
|
||||
import mineplex.core.gadget.gadgets.arrowtrail.ArrowTrailCandyCane;
|
||||
import mineplex.core.gadget.gadgets.arrowtrail.ArrowTrailConfetti;
|
||||
import mineplex.core.gadget.gadgets.arrowtrail.ArrowTrailCupid;
|
||||
import mineplex.core.gadget.gadgets.arrowtrail.ArrowTrailEmerald;
|
||||
import mineplex.core.gadget.gadgets.arrowtrail.ArrowTrailEnchant;
|
||||
import mineplex.core.gadget.gadgets.arrowtrail.ArrowTrailFrostLord;
|
||||
import mineplex.core.gadget.gadgets.arrowtrail.ArrowTrailMusic;
|
||||
import mineplex.core.gadget.gadgets.arrowtrail.ArrowTrailShadow;
|
||||
import mineplex.core.gadget.gadgets.arrowtrail.ArrowTrailStorm;
|
||||
import mineplex.core.gadget.gadgets.arrowtrail.ArrowTrailTitan;
|
||||
import mineplex.core.gadget.gadgets.death.DeathBlood;
|
||||
import mineplex.core.gadget.gadgets.death.DeathCandyCane;
|
||||
import mineplex.core.gadget.gadgets.death.DeathCupidsBrokenHeart;
|
||||
import mineplex.core.gadget.gadgets.death.DeathEmerald;
|
||||
import mineplex.core.gadget.gadgets.death.DeathEnchant;
|
||||
import mineplex.core.gadget.gadgets.death.DeathFrostLord;
|
||||
import mineplex.core.gadget.gadgets.death.DeathMusic;
|
||||
import mineplex.core.gadget.gadgets.death.DeathPinataBurst;
|
||||
import mineplex.core.gadget.gadgets.death.DeathShadow;
|
||||
import mineplex.core.gadget.gadgets.death.DeathStorm;
|
||||
import mineplex.core.gadget.gadgets.death.DeathTitan;
|
||||
import mineplex.core.gadget.gadgets.doublejump.DoubleJumpBlood;
|
||||
import mineplex.core.gadget.gadgets.doublejump.DoubleJumpCandyCane;
|
||||
import mineplex.core.gadget.gadgets.doublejump.DoubleJumpCupidsWings;
|
||||
import mineplex.core.gadget.gadgets.doublejump.DoubleJumpEmerald;
|
||||
import mineplex.core.gadget.gadgets.doublejump.DoubleJumpEnchant;
|
||||
import mineplex.core.gadget.gadgets.doublejump.DoubleJumpFirecracker;
|
||||
import mineplex.core.gadget.gadgets.doublejump.DoubleJumpFrostLord;
|
||||
import mineplex.core.gadget.gadgets.doublejump.DoubleJumpMusic;
|
||||
import mineplex.core.gadget.gadgets.doublejump.DoubleJumpShadow;
|
||||
import mineplex.core.gadget.gadgets.doublejump.DoubleJumpStorm;
|
||||
import mineplex.core.gadget.gadgets.doublejump.DoubleJumpTitan;
|
||||
import mineplex.core.gadget.gadgets.arrowtrail.vampire.ArrowTrailBlood;
|
||||
import mineplex.core.gadget.gadgets.arrowtrail.candycane.ArrowTrailCandyCane;
|
||||
import mineplex.core.gadget.gadgets.arrowtrail.party.ArrowTrailConfetti;
|
||||
import mineplex.core.gadget.gadgets.arrowtrail.cupidslove.ArrowTrailCupid;
|
||||
import mineplex.core.gadget.gadgets.arrowtrail.emerald.ArrowTrailEmerald;
|
||||
import mineplex.core.gadget.gadgets.arrowtrail.wisdom.ArrowTrailEnchant;
|
||||
import mineplex.core.gadget.gadgets.arrowtrail.frostlord.ArrowTrailFrostLord;
|
||||
import mineplex.core.gadget.gadgets.arrowtrail.music.ArrowTrailMusic;
|
||||
import mineplex.core.gadget.gadgets.arrowtrail.shadow.ArrowTrailShadow;
|
||||
import mineplex.core.gadget.gadgets.arrowtrail.howlingwinds.ArrowTrailStorm;
|
||||
import mineplex.core.gadget.gadgets.arrowtrail.titan.ArrowTrailTitan;
|
||||
import mineplex.core.gadget.gadgets.death.vampire.DeathBlood;
|
||||
import mineplex.core.gadget.gadgets.death.candycane.DeathCandyCane;
|
||||
import mineplex.core.gadget.gadgets.death.cupidslove.DeathCupidsBrokenHeart;
|
||||
import mineplex.core.gadget.gadgets.death.emerald.DeathEmerald;
|
||||
import mineplex.core.gadget.gadgets.death.wisdom.DeathEnchant;
|
||||
import mineplex.core.gadget.gadgets.death.frostlord.DeathFrostLord;
|
||||
import mineplex.core.gadget.gadgets.death.music.DeathMusic;
|
||||
import mineplex.core.gadget.gadgets.death.party.DeathPinataBurst;
|
||||
import mineplex.core.gadget.gadgets.death.shadow.DeathShadow;
|
||||
import mineplex.core.gadget.gadgets.death.howlingwinds.DeathStorm;
|
||||
import mineplex.core.gadget.gadgets.death.titan.DeathTitan;
|
||||
import mineplex.core.gadget.gadgets.doublejump.vampire.DoubleJumpBlood;
|
||||
import mineplex.core.gadget.gadgets.doublejump.candycane.DoubleJumpCandyCane;
|
||||
import mineplex.core.gadget.gadgets.doublejump.cupidslove.DoubleJumpCupidsWings;
|
||||
import mineplex.core.gadget.gadgets.doublejump.emerald.DoubleJumpEmerald;
|
||||
import mineplex.core.gadget.gadgets.doublejump.wisdom.DoubleJumpEnchant;
|
||||
import mineplex.core.gadget.gadgets.doublejump.party.DoubleJumpFirecracker;
|
||||
import mineplex.core.gadget.gadgets.doublejump.frostlord.DoubleJumpFrostLord;
|
||||
import mineplex.core.gadget.gadgets.doublejump.music.DoubleJumpMusic;
|
||||
import mineplex.core.gadget.gadgets.doublejump.shadow.DoubleJumpShadow;
|
||||
import mineplex.core.gadget.gadgets.doublejump.howlingwinds.DoubleJumpStorm;
|
||||
import mineplex.core.gadget.gadgets.doublejump.titan.DoubleJumpTitan;
|
||||
import mineplex.core.gadget.gadgets.gamemodifiers.GameModifierType;
|
||||
import mineplex.core.gadget.gadgets.gamemodifiers.kits.KitGameModifier;
|
||||
import mineplex.core.gadget.gadgets.gamemodifiers.kits.KitModifierType;
|
||||
import mineplex.core.gadget.gadgets.gamemodifiers.minestrike.GameModifierMineStrikeSkin;
|
||||
import mineplex.core.gadget.gadgets.gamemodifiers.minestrike.MineStrikeSkin;
|
||||
import mineplex.core.gadget.gadgets.hat.HatCoal;
|
||||
import mineplex.core.gadget.gadgets.hat.HatCompanionBlock;
|
||||
import mineplex.core.gadget.gadgets.hat.HatGrinch;
|
||||
import mineplex.core.gadget.gadgets.hat.HatLovestruck;
|
||||
import mineplex.core.gadget.gadgets.hat.HatPresent;
|
||||
import mineplex.core.gadget.gadgets.hat.HatRudolph;
|
||||
import mineplex.core.gadget.gadgets.hat.HatSanta;
|
||||
import mineplex.core.gadget.gadgets.hat.HatSecretPackage;
|
||||
import mineplex.core.gadget.gadgets.hat.HatSnowman;
|
||||
import mineplex.core.gadget.gadgets.hat.HatTeddyBear;
|
||||
import mineplex.core.gadget.gadgets.item.ItemBatGun;
|
||||
import mineplex.core.gadget.gadgets.item.ItemBow;
|
||||
import mineplex.core.gadget.gadgets.item.ItemCoal;
|
||||
@ -101,21 +100,6 @@ import mineplex.core.gadget.gadgets.item.ItemPaintbrush;
|
||||
import mineplex.core.gadget.gadgets.item.ItemPartyPopper;
|
||||
import mineplex.core.gadget.gadgets.item.ItemSnowball;
|
||||
import mineplex.core.gadget.gadgets.item.ItemTNT;
|
||||
import mineplex.core.gadget.gadgets.morph.MorphBat;
|
||||
import mineplex.core.gadget.gadgets.morph.MorphBlaze;
|
||||
import mineplex.core.gadget.gadgets.morph.MorphBlock;
|
||||
import mineplex.core.gadget.gadgets.morph.MorphBunny;
|
||||
import mineplex.core.gadget.gadgets.morph.MorphChicken;
|
||||
import mineplex.core.gadget.gadgets.morph.MorphCow;
|
||||
import mineplex.core.gadget.gadgets.morph.MorphCreeper;
|
||||
import mineplex.core.gadget.gadgets.morph.MorphEnderman;
|
||||
import mineplex.core.gadget.gadgets.morph.MorphPig;
|
||||
import mineplex.core.gadget.gadgets.morph.MorphPumpkinKing;
|
||||
import mineplex.core.gadget.gadgets.morph.MorphSlime;
|
||||
import mineplex.core.gadget.gadgets.morph.MorphSnowman;
|
||||
import mineplex.core.gadget.gadgets.morph.MorphTitan;
|
||||
import mineplex.core.gadget.gadgets.morph.MorphVillager;
|
||||
import mineplex.core.gadget.gadgets.morph.MorphWither;
|
||||
import mineplex.core.gadget.gadgets.outfit.OutfitTeam;
|
||||
import mineplex.core.gadget.gadgets.outfit.ravesuit.OutfitRaveSuitBoots;
|
||||
import mineplex.core.gadget.gadgets.outfit.ravesuit.OutfitRaveSuitChestplate;
|
||||
@ -125,62 +109,19 @@ import mineplex.core.gadget.gadgets.outfit.spacesuit.OutfitSpaceSuitBoots;
|
||||
import mineplex.core.gadget.gadgets.outfit.spacesuit.OutfitSpaceSuitChestplate;
|
||||
import mineplex.core.gadget.gadgets.outfit.spacesuit.OutfitSpaceSuitHelmet;
|
||||
import mineplex.core.gadget.gadgets.outfit.spacesuit.OutfitSpaceSuitLeggings;
|
||||
import mineplex.core.gadget.gadgets.outfit.windupsuit.OutfitWindUpSuitBoosterManager;
|
||||
import mineplex.core.gadget.gadgets.particle.ParticleBlood;
|
||||
import mineplex.core.gadget.gadgets.particle.ParticleCandyCane;
|
||||
import mineplex.core.gadget.gadgets.particle.ParticleCoalFumes;
|
||||
import mineplex.core.gadget.gadgets.particle.ParticleEmerald;
|
||||
import mineplex.core.gadget.gadgets.particle.ParticleEnchant;
|
||||
import mineplex.core.gadget.gadgets.particle.ParticleFairy;
|
||||
import mineplex.core.gadget.gadgets.particle.ParticleFireRings;
|
||||
import mineplex.core.gadget.gadgets.particle.ParticleFoot;
|
||||
import mineplex.core.gadget.gadgets.particle.ParticleFrostLord;
|
||||
import mineplex.core.gadget.gadgets.particle.ParticleHeart;
|
||||
import mineplex.core.gadget.gadgets.particle.ParticleLegend;
|
||||
import mineplex.core.gadget.gadgets.particle.ParticleMusic;
|
||||
import mineplex.core.gadget.gadgets.particle.ParticlePartyTime;
|
||||
import mineplex.core.gadget.gadgets.particle.ParticleRain;
|
||||
import mineplex.core.gadget.gadgets.particle.ParticleTitan;
|
||||
import mineplex.core.gadget.gadgets.particle.ParticleWingsAngel;
|
||||
import mineplex.core.gadget.gadgets.particle.ParticleWingsDemons;
|
||||
import mineplex.core.gadget.gadgets.particle.ParticleWingsInfernal;
|
||||
import mineplex.core.gadget.gadgets.particle.ParticleWingsPixie;
|
||||
import mineplex.core.gadget.gadgets.particle.ParticleYinYang;
|
||||
import mineplex.core.gadget.gadgets.wineffect.WinEffectBabyChicken;
|
||||
import mineplex.core.gadget.gadgets.wineffect.WinEffectFireworks;
|
||||
import mineplex.core.gadget.gadgets.wineffect.WinEffectFlames;
|
||||
import mineplex.core.gadget.gadgets.wineffect.WinEffectLavaTrap;
|
||||
import mineplex.core.gadget.gadgets.wineffect.WinEffectLightningStrike;
|
||||
import mineplex.core.gadget.gadgets.wineffect.WinEffectMrPunchMan;
|
||||
import mineplex.core.gadget.gadgets.wineffect.WinEffectPodium;
|
||||
import mineplex.core.gadget.gadgets.wineffect.WinEffectRiseOfTheElderGuardian;
|
||||
import mineplex.core.gadget.gadgets.wineffect.WinEffectSnowTrails;
|
||||
import mineplex.core.gadget.set.SetCandyCane;
|
||||
import mineplex.core.gadget.set.SetCupidsLove;
|
||||
import mineplex.core.gadget.set.SetEmerald;
|
||||
import mineplex.core.gadget.set.SetFrostLord;
|
||||
import mineplex.core.gadget.set.SetHowlingWinds;
|
||||
import mineplex.core.gadget.set.SetMusic;
|
||||
import mineplex.core.gadget.set.SetParty;
|
||||
import mineplex.core.gadget.set.SetShadow;
|
||||
import mineplex.core.gadget.set.SetTitan;
|
||||
import mineplex.core.gadget.set.SetVampire;
|
||||
import mineplex.core.gadget.set.SetWisdom;
|
||||
import mineplex.core.gadget.gadgets.particle.vampire.ParticleBlood;
|
||||
import mineplex.core.gadget.gadgets.particle.emerald.ParticleEmerald;
|
||||
import mineplex.core.gadget.gadgets.particle.wisdom.ParticleEnchant;
|
||||
import mineplex.core.gadget.gadgets.particle.shadow.ParticleFoot;
|
||||
import mineplex.core.gadget.gadgets.particle.frostlord.ParticleFrostLord;
|
||||
import mineplex.core.gadget.gadgets.particle.cupidslove.ParticleHeart;
|
||||
import mineplex.core.gadget.gadgets.particle.music.ParticleMusic;
|
||||
import mineplex.core.gadget.gadgets.particle.party.ParticlePartyTime;
|
||||
import mineplex.core.gadget.gadgets.particle.howlingwinds.ParticleRain;
|
||||
import mineplex.core.gadget.gadgets.particle.titan.ParticleTitan;
|
||||
import mineplex.core.gadget.set.suits.SetRaveSuit;
|
||||
import mineplex.core.gadget.set.suits.SetSpaceSuit;
|
||||
import mineplex.core.gadget.types.ArrowEffectGadget;
|
||||
import mineplex.core.gadget.types.DeathEffectGadget;
|
||||
import mineplex.core.gadget.types.DoubleJumpEffectGadget;
|
||||
import mineplex.core.gadget.types.Gadget;
|
||||
import mineplex.core.gadget.types.GadgetGameModifier;
|
||||
import mineplex.core.gadget.types.GadgetSet;
|
||||
import mineplex.core.gadget.types.GadgetType;
|
||||
import mineplex.core.gadget.types.ItemGadget;
|
||||
import mineplex.core.gadget.types.MusicGadget;
|
||||
import mineplex.core.gadget.types.OutfitGadget;
|
||||
import mineplex.core.gadget.types.OutfitGadget.ArmorSlot;
|
||||
import mineplex.core.gadget.types.ParticleGadget;
|
||||
import mineplex.core.gadget.types.WinEffectGadget;
|
||||
import mineplex.core.hologram.HologramManager;
|
||||
import mineplex.core.inventory.InventoryManager;
|
||||
import mineplex.core.mount.MountManager;
|
||||
@ -213,6 +154,8 @@ public class GadgetManager extends MiniPlugin
|
||||
|
||||
private final HashSet<GadgetSet> _sets = new HashSet<>();
|
||||
|
||||
private UserGadgetPersistence _userGadgetPersistence;
|
||||
|
||||
private boolean _hideParticles = false;
|
||||
private int _activeItemSlot = 3;
|
||||
private boolean _gadgetsEnabled = true;
|
||||
@ -236,9 +179,10 @@ public class GadgetManager extends MiniPlugin
|
||||
_packetManager = packetHandler;
|
||||
_mountManager = mountManager;
|
||||
_hologramManager = hologramManager;
|
||||
_userGadgetPersistence = new UserGadgetPersistence(this);
|
||||
_boosterManager = new OutfitWindUpSuitBoosterManager(this);
|
||||
|
||||
CreateGadgets();
|
||||
createGadgets();
|
||||
createSets();
|
||||
}
|
||||
|
||||
@ -257,13 +201,9 @@ public class GadgetManager extends MiniPlugin
|
||||
addSet(new SetCandyCane(this));
|
||||
addSet(new SetTitan(this));
|
||||
|
||||
// Removes Lovely Set (Duplicate of Cupid's Love)
|
||||
//addSet(new SetLove(this));
|
||||
|
||||
//Costumes
|
||||
addSet(new SetRaveSuit(this));
|
||||
addSet(new SetSpaceSuit(this));
|
||||
//Removes WindUp suit for now, as it's not going to be released
|
||||
//addSet(new SetWindUpSuit(this));
|
||||
addSet(new SetParty(this));
|
||||
addSet(new SetCupidsLove(this));
|
||||
@ -273,11 +213,12 @@ public class GadgetManager extends MiniPlugin
|
||||
addSet(new SetHowlingWinds(this));
|
||||
addSet(new SetVampire(this));
|
||||
addSet(new SetMusic(this));
|
||||
addSet(new SetFreedom(this));
|
||||
}
|
||||
|
||||
private void CreateGadgets()
|
||||
private void createGadgets()
|
||||
{
|
||||
_gadgets = new NautHashMap<GadgetType, List<Gadget>>();
|
||||
_gadgets = new NautHashMap<>();
|
||||
|
||||
// Items
|
||||
addGadget(new ItemEtherealPearl(this));
|
||||
@ -309,10 +250,10 @@ public class GadgetManager extends MiniPlugin
|
||||
addGadget(new OutfitSpaceSuitLeggings(this));
|
||||
addGadget(new OutfitSpaceSuitBoots(this));
|
||||
|
||||
//addGadget(new OutfitWindUpSuitHelmet(this));
|
||||
//addGadget(new OutfitWindUpSuitChestplate(this));
|
||||
//addGadget(new OutfitWindUpSuitLeggings(this));
|
||||
//addGadget(new OutfitWindUpSuitBoots(this));
|
||||
/*addGadget(new OutfitWindUpSuitHelmet(this));
|
||||
addGadget(new OutfitWindUpSuitChestplate(this));
|
||||
addGadget(new OutfitWindUpSuitLeggings(this));
|
||||
addGadget(new OutfitWindUpSuitBoots(this));*/
|
||||
|
||||
addGadget(new OutfitTeam(this, "Team Helmet", -1, ArmorSlot.Helmet, Material.LEATHER_HELMET, (byte)0));
|
||||
addGadget(new OutfitTeam(this, "Team Shirt", -1, ArmorSlot.Chest, Material.LEATHER_CHESTPLATE, (byte)0));
|
||||
@ -335,6 +276,7 @@ public class GadgetManager extends MiniPlugin
|
||||
addGadget(new MorphSlime(this, _achievementManager));
|
||||
addGadget(new MorphTitan(this));
|
||||
addGadget(new MorphSnowman(this));
|
||||
addGadget(new MorphUncleSam(this));
|
||||
|
||||
// Particles
|
||||
addGadget(new ParticleFoot(this));
|
||||
@ -357,6 +299,7 @@ public class GadgetManager extends MiniPlugin
|
||||
addGadget(new ParticleWingsInfernal(this));
|
||||
addGadget(new ParticleWingsPixie(this));
|
||||
addGadget(new ParticleYinYang(this));
|
||||
addGadget(new ParticleFreedom(this));
|
||||
|
||||
|
||||
// Arrow Trails
|
||||
@ -371,8 +314,7 @@ public class GadgetManager extends MiniPlugin
|
||||
addGadget(new ArrowTrailStorm(this));
|
||||
addGadget(new ArrowTrailBlood(this));
|
||||
addGadget(new ArrowTrailMusic(this));
|
||||
// Removes Lovely Set (Duplicate of Cupid's Love)
|
||||
//addGadget(new ArrowTrailHearts(this));
|
||||
addGadget(new ArrowTrailFreedom(this));
|
||||
|
||||
// Death Effect
|
||||
addGadget(new DeathFrostLord(this));
|
||||
@ -386,8 +328,7 @@ public class GadgetManager extends MiniPlugin
|
||||
addGadget(new DeathStorm(this));
|
||||
addGadget(new DeathBlood(this));
|
||||
addGadget(new DeathMusic(this));
|
||||
// Removes Lovely Set (Duplicate of Cupid's Love)
|
||||
//addGadget(new DeathHearts(this));
|
||||
addGadget(new DeathFreedom(this));
|
||||
|
||||
// Double Jump
|
||||
addGadget(new DoubleJumpFrostLord(this));
|
||||
@ -401,20 +342,13 @@ public class GadgetManager extends MiniPlugin
|
||||
addGadget(new DoubleJumpStorm(this));
|
||||
addGadget(new DoubleJumpBlood(this));
|
||||
addGadget(new DoubleJumpMusic(this));
|
||||
// Removes Lovely Set (Duplicate of Cupid's Love)
|
||||
//addGadget(new DoubleJumpHearts(this));
|
||||
addGadget(new DoubleJumpFreedom(this));
|
||||
|
||||
// Hat
|
||||
addGadget(new HatSanta(this));
|
||||
addGadget(new HatSnowman(this));
|
||||
addGadget(new HatPresent(this));
|
||||
addGadget(new HatCoal(this));
|
||||
addGadget(new HatRudolph(this));
|
||||
addGadget(new HatGrinch(this));
|
||||
addGadget(new HatCompanionBlock(this));
|
||||
addGadget(new HatLovestruck(this));
|
||||
addGadget(new HatSecretPackage(this));
|
||||
addGadget(new HatTeddyBear(this));
|
||||
for (HatType hatType : HatType.values())
|
||||
{
|
||||
addGadget(new HatItem(this, hatType));
|
||||
}
|
||||
|
||||
//Win Effects
|
||||
addGadget(new WinEffectPodium(this));
|
||||
@ -470,30 +404,18 @@ public class GadgetManager extends MiniPlugin
|
||||
|
||||
|
||||
// Survival Games
|
||||
// Also not being released in this update
|
||||
// Beastmaster
|
||||
//addGadget(new ChickenKitGameModifier(this));
|
||||
//addGadget(new MiniGuardianKitGameModifier(this));
|
||||
//addGadget(new PigKitGameModifier(this));
|
||||
//addGadget(new SquidKitGameModifier(this));
|
||||
|
||||
// Horseman
|
||||
//addGadget(new MuleKitGameModifier(this));
|
||||
//addGadget(new SkeletonHorseKitGameModifier(this));
|
||||
|
||||
// Necromancer
|
||||
//addGadget(new WitherSkeletonKitGameModifier(this));
|
||||
|
||||
|
||||
// Bridges
|
||||
//addGadget(new PotatoKitGameModifier(this));
|
||||
|
||||
for(GadgetType type : GadgetType.values())
|
||||
/* for (KitModifier kitModifier : KitModifier.values())
|
||||
{
|
||||
if(!_gadgets.containsKey(type))
|
||||
addGadget(new KitGameModifier(this, kitModifier));
|
||||
}*/
|
||||
|
||||
// Balloons
|
||||
//addGadget(new BabyCowBalloon(this));
|
||||
|
||||
for (GadgetType gadgetType : GadgetType.values())
|
||||
{
|
||||
_gadgets.put(type, new ArrayList<Gadget>());
|
||||
}
|
||||
if (!_gadgets.containsKey(gadgetType))
|
||||
_gadgets.put(gadgetType, new ArrayList<>());
|
||||
}
|
||||
}
|
||||
|
||||
@ -536,7 +458,7 @@ public class GadgetManager extends MiniPlugin
|
||||
private void addGadget(Gadget gadget)
|
||||
{
|
||||
if (!_gadgets.containsKey(gadget.getGadgetType()))
|
||||
_gadgets.put(gadget.getGadgetType(), new ArrayList<Gadget>());
|
||||
_gadgets.put(gadget.getGadgetType(), new ArrayList<>());
|
||||
|
||||
_gadgets.get(gadget.getGadgetType()).add(gadget);
|
||||
}
|
||||
@ -544,22 +466,11 @@ public class GadgetManager extends MiniPlugin
|
||||
@EventHandler
|
||||
public void onPlayerJoin(PlayerJoinEvent event)
|
||||
{
|
||||
// Fixes win room speed bug
|
||||
event.getPlayer().setWalkSpeed(0.2f);
|
||||
event.getPlayer().setFlySpeed(0.1f);
|
||||
// UnlockCosmetics command fixes this part
|
||||
// if (_clientManager.Get(event.getPlayer()).GetRank().has(Rank.MODERATOR))
|
||||
// {
|
||||
// for (GadgetType gadgetType : _gadgets.keySet())
|
||||
// {
|
||||
// if (gadgetType == GadgetType.Particle && _clientManager.Get(event.getPlayer()).GetRank().has(Rank.ADMIN))
|
||||
// {
|
||||
// for (Gadget gadget : _gadgets.get(gadgetType))
|
||||
// {
|
||||
// _donationManager.Get(event.getPlayer().getName()).AddUnknownSalesPackagesOwned(gadget.GetName());
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// Loads saved gadgets
|
||||
_userGadgetPersistence.load(event.getPlayer());
|
||||
}
|
||||
|
||||
public List<Gadget> getGadgets(GadgetType gadgetType)
|
||||
@ -567,14 +478,36 @@ public class GadgetManager extends MiniPlugin
|
||||
return _gadgets.get(gadgetType);
|
||||
}
|
||||
|
||||
public List<GadgetGameModifier> getGameModifiers(GameModifierType gameType)
|
||||
public List<Gadget> getAllGadgets()
|
||||
{
|
||||
List<GadgetGameModifier> list = new ArrayList<>();
|
||||
for (Gadget g : getGadgets(GadgetType.GameModifier))
|
||||
List<Gadget> gadgets = new ArrayList<>();
|
||||
for (GadgetType gadgetType : GadgetType.values())
|
||||
{
|
||||
if (g instanceof GadgetGameModifier)
|
||||
gadgets.addAll(getGadgets(gadgetType));
|
||||
}
|
||||
return gadgets;
|
||||
}
|
||||
|
||||
public Gadget getGadget(String name, GadgetType gadgetType)
|
||||
{
|
||||
GadgetGameModifier mod = (GadgetGameModifier) g;
|
||||
List<Gadget> gadgets = getGadgets(gadgetType);
|
||||
for (Gadget gadget : gadgets)
|
||||
{
|
||||
if (gadget.getName().equalsIgnoreCase(name)
|
||||
|| Arrays.asList(gadget.getAlternativePackageNames()).contains(name))
|
||||
return gadget;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public List<GameModifierGadget> getGameModifiers(GameModifierType gameType)
|
||||
{
|
||||
List<GameModifierGadget> list = new ArrayList<>();
|
||||
for (Gadget g : getGadgets(GadgetType.GAME_MODIFIER))
|
||||
{
|
||||
if (g instanceof GameModifierGadget)
|
||||
{
|
||||
GameModifierGadget mod = (GameModifierGadget) g;
|
||||
if (mod.getGameType() == gameType) list.add(mod);
|
||||
}
|
||||
}
|
||||
@ -583,18 +516,18 @@ public class GadgetManager extends MiniPlugin
|
||||
|
||||
public GameModifierMineStrikeSkin getGameModifier(MineStrikeSkin skin)
|
||||
{
|
||||
for(GadgetGameModifier g : getGameModifiers(GameModifierType.MineStrike))
|
||||
for(GameModifierGadget g : getGameModifiers(GameModifierType.MineStrike))
|
||||
{
|
||||
GameModifierMineStrikeSkin gskin = (GameModifierMineStrikeSkin) g;
|
||||
if(g.GetName().equals(skin.getSkinName())) return gskin;
|
||||
if(g.getName().equals(skin.getSkinName())) return gskin;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public List<GadgetGameModifier> getGameModifiers(KitModifierType kitType)
|
||||
public List<GameModifierGadget> getGameModifiers(KitModifierType kitType)
|
||||
{
|
||||
List<GadgetGameModifier> list = new ArrayList<>();
|
||||
for (GadgetGameModifier gadget : getGameModifiers(kitType.getGameModifierType()))
|
||||
List<GameModifierGadget> list = new ArrayList<>();
|
||||
for (GameModifierGadget gadget : getGameModifiers(kitType.getGameModifierType()))
|
||||
{
|
||||
if (gadget instanceof KitGameModifier)
|
||||
{
|
||||
@ -607,11 +540,11 @@ public class GadgetManager extends MiniPlugin
|
||||
return list;
|
||||
}
|
||||
|
||||
public GadgetGameModifier getActiveGameModifier(Player player, GameModifierType gameType, Predicate<GadgetGameModifier> selector)
|
||||
public GameModifierGadget getActiveGameModifier(Player player, GameModifierType gameType, Predicate<GameModifierGadget> selector)
|
||||
{
|
||||
for (GadgetGameModifier g : getGameModifiers(gameType))
|
||||
for (GameModifierGadget g : getGameModifiers(gameType))
|
||||
{
|
||||
if (!g.IsActive(player)) { continue; }
|
||||
if (!g.isActive(player)) { continue; }
|
||||
if (!selector.test(g)) { continue; }
|
||||
return g;
|
||||
}
|
||||
@ -619,11 +552,11 @@ public class GadgetManager extends MiniPlugin
|
||||
}
|
||||
|
||||
// Gets all the Game modifiers that are related to kits
|
||||
public KitGameModifier getActiveGameModifier(Player player, KitModifierType kitType, Predicate<GadgetGameModifier> selector)
|
||||
public KitGameModifier getActiveGameModifier(Player player, KitModifierType kitType, Predicate<GameModifierGadget> selector)
|
||||
{
|
||||
for (GadgetGameModifier g : getGameModifiers(kitType))
|
||||
for (GameModifierGadget g : getGameModifiers(kitType))
|
||||
{
|
||||
if (!g.IsActive(player)) { continue; }
|
||||
if (!g.isActive(player)) { continue; }
|
||||
if (!selector.test(g)) { continue; }
|
||||
if (!(g instanceof KitGameModifier)) { continue; }
|
||||
return (KitGameModifier) g;
|
||||
@ -631,8 +564,22 @@ public class GadgetManager extends MiniPlugin
|
||||
return null;
|
||||
}
|
||||
|
||||
public HatGadget getHatGadget(HatType type)
|
||||
{
|
||||
for (Gadget gadget : getGadgets(GadgetType.HAT))
|
||||
{
|
||||
if(gadget instanceof HatGadget)
|
||||
{
|
||||
HatGadget hatGadget = (HatGadget) gadget;
|
||||
if (type.equals(hatGadget.getHatType()))
|
||||
return hatGadget;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
// Disallows two armor gadgets in same slot.
|
||||
public void RemoveOutfit(Player player, ArmorSlot slot)
|
||||
public void removeOutfit(Player player, ArmorSlot slot)
|
||||
{
|
||||
for (GadgetType gadgetType : _gadgets.keySet())
|
||||
{
|
||||
@ -642,9 +589,9 @@ public class GadgetManager extends MiniPlugin
|
||||
{
|
||||
OutfitGadget armor = (OutfitGadget) gadget;
|
||||
|
||||
if (armor.GetSlot() == slot)
|
||||
if (armor.getSlot() == slot)
|
||||
{
|
||||
armor.RemoveArmor(player);
|
||||
armor.removeArmor(player);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -657,11 +604,22 @@ public class GadgetManager extends MiniPlugin
|
||||
if(gadgets == null) return;
|
||||
for(Gadget g : gadgets)
|
||||
{
|
||||
g.Disable(player);
|
||||
g.disable(player);
|
||||
}
|
||||
}
|
||||
|
||||
public void DisableAll()
|
||||
public void removeGadgetType(Player player, GadgetType type, Gadget enabled)
|
||||
{
|
||||
List<Gadget> gadgets = _gadgets.get(type);
|
||||
if(gadgets == null) return;
|
||||
for(Gadget g : gadgets)
|
||||
{
|
||||
if (g != enabled)
|
||||
g.disable(player);
|
||||
}
|
||||
}
|
||||
|
||||
public void disableAll()
|
||||
{
|
||||
for (GadgetType gadgetType : _gadgets.keySet())
|
||||
{
|
||||
@ -682,36 +640,47 @@ public class GadgetManager extends MiniPlugin
|
||||
if (gadget instanceof WinEffectGadget)
|
||||
continue;
|
||||
|
||||
if(gadget instanceof GadgetGameModifier)
|
||||
if(gadget instanceof GameModifierGadget)
|
||||
continue;
|
||||
|
||||
for (Player player : UtilServer.getPlayers())
|
||||
gadget.Disable(player);
|
||||
gadget.disable(player);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void DisableAll(Player player)
|
||||
public void disableAll(Player player)
|
||||
{
|
||||
for (GadgetType gadgetType : _gadgets.keySet())
|
||||
{
|
||||
for (Gadget gadget : _gadgets.get(gadgetType))
|
||||
{
|
||||
gadget.Disable(player);
|
||||
gadget.disable(player);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void DisableAll(Player player, List<String> dontDisable)
|
||||
public void disableAll(Player player, boolean callEvent)
|
||||
{
|
||||
for (GadgetType gadgetType : _gadgets.keySet())
|
||||
{
|
||||
for (Gadget gadget : _gadgets.get(gadgetType))
|
||||
{
|
||||
if (dontDisable.contains(gadget.GetName()))
|
||||
gadget.disable(player);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void disableAll(Player player, List<String> dontDisable)
|
||||
{
|
||||
for (GadgetType gadgetType : _gadgets.keySet())
|
||||
{
|
||||
for (Gadget gadget : _gadgets.get(gadgetType))
|
||||
{
|
||||
if (dontDisable.contains(gadget.getName()))
|
||||
continue;
|
||||
|
||||
gadget.Disable(player);
|
||||
gadget.disable(player);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -805,22 +774,16 @@ public class GadgetManager extends MiniPlugin
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void quit(PlayerQuitEvent event)
|
||||
public void onPlayerQuit(PlayerQuitEvent event)
|
||||
{
|
||||
DisableAll(event.getPlayer());
|
||||
saveGadgets(event.getPlayer());
|
||||
disableAll(event.getPlayer(), false);
|
||||
_lastMove.remove(event.getPlayer());
|
||||
_playerActiveGadgetMap.remove(event.getPlayer());
|
||||
event.getPlayer().setWalkSpeed(0.2f);
|
||||
event.getPlayer().setFlySpeed(0.1f);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void join(PlayerJoinEvent event)
|
||||
{
|
||||
event.getPlayer().setWalkSpeed(0.2f);
|
||||
event.getPlayer().setFlySpeed(0.1f);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void death(PlayerDeathEvent event)
|
||||
{
|
||||
@ -873,11 +836,11 @@ public class GadgetManager extends MiniPlugin
|
||||
|
||||
public void redisplayActiveItem(Player player)
|
||||
{
|
||||
for (Gadget gadget : _gadgets.get(GadgetType.Item))
|
||||
for (Gadget gadget : _gadgets.get(GadgetType.ITEM))
|
||||
{
|
||||
if (gadget instanceof ItemGadget)
|
||||
{
|
||||
if (gadget.IsActive(player))
|
||||
if (gadget.isActive(player))
|
||||
{
|
||||
((ItemGadget)gadget).ApplyItem(player, false);
|
||||
}
|
||||
@ -887,7 +850,7 @@ public class GadgetManager extends MiniPlugin
|
||||
|
||||
public boolean canPlaySongAt(Location location)
|
||||
{
|
||||
for (Gadget gadget : _gadgets.get(GadgetType.MusicDisc))
|
||||
for (Gadget gadget : _gadgets.get(GadgetType.MUSIC_DISC))
|
||||
{
|
||||
if (gadget instanceof MusicGadget)
|
||||
{
|
||||
@ -916,20 +879,13 @@ public class GadgetManager extends MiniPlugin
|
||||
if (_gadgetsEnabled != enabled)
|
||||
{
|
||||
_gadgetsEnabled = enabled;
|
||||
DisableAll();
|
||||
disableAll();
|
||||
_mountManager.DisableAll();
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void GadgetActivate(GadgetEnableEvent event)
|
||||
{
|
||||
if (!_gadgetsEnabled)
|
||||
event.setCancelled(true);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void MountActivate(MountActivateEvent event)
|
||||
public void onMountActivate(MountActivateEvent event)
|
||||
{
|
||||
if (!_gadgetsEnabled)
|
||||
event.setCancelled(true);
|
||||
@ -950,4 +906,141 @@ public class GadgetManager extends MiniPlugin
|
||||
if (event.getPlayer().getName().equalsIgnoreCase("sterling_"))
|
||||
event.getPlayer().getWorld().playSound(event.getPlayer().getLocation(), Sound.PIG_IDLE, 1f, 1f);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onGadgetEnable(GadgetEnableEvent event)
|
||||
{
|
||||
if (!_gadgetsEnabled)
|
||||
event.setCancelled(true);
|
||||
}
|
||||
|
||||
private void saveGadgets(Player player)
|
||||
{
|
||||
if (player.getGameMode() == GameMode.SPECTATOR)
|
||||
return;
|
||||
Map<String, String> cache = new HashMap<>();
|
||||
for (Gadget gadget : getAllGadgets())
|
||||
{
|
||||
GadgetType gadgetType = gadget.getGadgetType();
|
||||
if (gadget.ownsGadget(player))
|
||||
{
|
||||
switch (gadgetType)
|
||||
{
|
||||
case MUSIC_DISC:
|
||||
case ITEM:
|
||||
case MORPH:
|
||||
case BALLOON:
|
||||
break;
|
||||
case COSTUME:
|
||||
OutfitGadget outfitGadget = (OutfitGadget) gadget;
|
||||
String key = "activeCostume" + outfitGadget.getSlot().getDatabaseKey();
|
||||
if (cache.containsKey(key))
|
||||
continue;
|
||||
if (outfitGadget.isActive(player))
|
||||
cache.put(key, outfitGadget.getName());
|
||||
break;
|
||||
case GAME_MODIFIER:
|
||||
GameModifierGadget gameModifierGadget = (GameModifierGadget) gadget;
|
||||
if (gameModifierGadget.canAllowMultiple())
|
||||
{
|
||||
if (cache.containsKey(gadget.getName()))
|
||||
continue;
|
||||
cache.put(gadget.getName(), (gadget.isActive(player)) ? "enabled" : "disabled");
|
||||
} else
|
||||
{
|
||||
String dataKey = "activeModifier" + gameModifierGadget.getGameType().getName().replace(" ", "");
|
||||
if (cache.containsKey(dataKey))
|
||||
continue;
|
||||
if (gadget.isActive(player))
|
||||
cache.put(dataKey, gadget.getName());
|
||||
}
|
||||
break;
|
||||
default:
|
||||
if (cache.containsKey(gadgetType.getDatabaseKey()))
|
||||
continue;
|
||||
if (gadget.isActive(player))
|
||||
cache.put(gadgetType.getDatabaseKey(), gadget.getName());
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
cache = updateDefaultGadgets(cache);
|
||||
_userGadgetPersistence.save(player, cache);
|
||||
}
|
||||
|
||||
private Map<String, String> updateDefaultGadgets(Map<String, String> cache)
|
||||
{
|
||||
for (GadgetType gadgetType : GadgetType.values())
|
||||
{
|
||||
if (gadgetType == GadgetType.MUSIC_DISC || gadgetType == GadgetType.ITEM
|
||||
|| gadgetType == GadgetType.MORPH || gadgetType == GadgetType.BALLOON
|
||||
|| gadgetType == GadgetType.GAME_MODIFIER)
|
||||
continue;
|
||||
if (!cache.containsKey(gadgetType.getDatabaseKey()))
|
||||
{
|
||||
String key = gadgetType.getDatabaseKey();
|
||||
if (gadgetType.equals(GadgetType.COSTUME))
|
||||
{
|
||||
for (ArmorSlot armorSlot : ArmorSlot.values())
|
||||
{
|
||||
key = "activeCostume" + armorSlot.getDatabaseKey();
|
||||
if (!cache.containsKey(key))
|
||||
{
|
||||
cache.put(key, "disabled");
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
cache.put(key, "disabled");
|
||||
}
|
||||
}
|
||||
}
|
||||
return cache;
|
||||
}
|
||||
|
||||
public boolean isKitModifierActive(KitModifier kitModifier, Player player)
|
||||
{
|
||||
for (Gadget gadget : getGadgets(GadgetType.GAME_MODIFIER))
|
||||
{
|
||||
if (gadget instanceof KitGameModifier)
|
||||
{
|
||||
KitGameModifier kitGameModifier = (KitGameModifier) gadget;
|
||||
if (kitGameModifier.getKitModifier().equals(kitModifier))
|
||||
return kitGameModifier.isActive(player);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public KitModifier getActiveKitModifier(KitModifierType kitModifierType, Player player)
|
||||
{
|
||||
for (KitModifier kitModifier : KitModifier.values())
|
||||
{
|
||||
if (kitModifier.getKitModifierType().equals(kitModifierType))
|
||||
if (isKitModifierActive(kitModifier, player))
|
||||
return kitModifier;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onVanish(IncognitoStatusChangeEvent event)
|
||||
{
|
||||
if (event.getNewState())
|
||||
{
|
||||
for (Gadget gadget : getGadgets(GadgetType.PARTICLE))
|
||||
{
|
||||
if (gadget.isActive(event.getPlayer()))
|
||||
{
|
||||
gadget.disable(event.getPlayer());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public UserGadgetPersistence getUserGadgetPersistence()
|
||||
{
|
||||
return _userGadgetPersistence;
|
||||
}
|
||||
}
|
||||
|
@ -89,11 +89,11 @@ public class AmmoCommand extends CommandBase<GadgetManager>
|
||||
try
|
||||
{
|
||||
int ammo = Integer.parseInt(amount);
|
||||
_plugin.getInventoryManager().addItemToInventory(target, gadget.GetName(), ammo);
|
||||
UtilPlayer.message(caller, F.main("Ammo", "You gave " + F.elem(ammo + " Ammo") + " for the gadget " + F.skill(gadget.GetName()) + " to " + F.name(target.getName()) + "."));
|
||||
_plugin.getInventoryManager().addItemToInventory(target, gadget.getName(), ammo);
|
||||
UtilPlayer.message(caller, F.main("Ammo", "You gave " + F.elem(ammo + " Ammo") + " for the gadget " + F.skill(gadget.getName()) + " to " + F.name(target.getName()) + "."));
|
||||
if (target != null)
|
||||
{
|
||||
UtilPlayer.message(target, F.main("Ammo", F.name(caller.getName()) + " gave you " + F.elem(ammo + " Ammo") + " for the gadget " + F.skill(gadget.GetName()) + "."));
|
||||
UtilPlayer.message(target, F.main("Ammo", F.name(caller.getName()) + " gave you " + F.elem(ammo + " Ammo") + " for the gadget " + F.skill(gadget.getName()) + "."));
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
@ -104,9 +104,9 @@ public class AmmoCommand extends CommandBase<GadgetManager>
|
||||
|
||||
private Gadget getGadgetByName(String gadgetName)
|
||||
{
|
||||
for (Gadget gadget : _plugin.getGadgets(GadgetType.Item))
|
||||
for (Gadget gadget : _plugin.getGadgets(GadgetType.ITEM))
|
||||
{
|
||||
if (gadget.GetName().equalsIgnoreCase(gadgetName.replaceAll("_", " ")))
|
||||
if (gadget.getName().equalsIgnoreCase(gadgetName.replaceAll("_", " ")))
|
||||
return gadget;
|
||||
}
|
||||
return null;
|
||||
|
@ -7,6 +7,8 @@ import mineplex.core.common.util.UtilPlayer;
|
||||
import mineplex.core.gadget.GadgetManager;
|
||||
import mineplex.core.gadget.types.Gadget;
|
||||
import mineplex.core.gadget.types.GadgetType;
|
||||
import mineplex.core.mount.Mount;
|
||||
import org.bukkit.entity.EntityType;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class LockCosmeticsCommand extends CommandBase<GadgetManager>
|
||||
@ -64,7 +66,7 @@ public class LockCosmeticsCommand extends CommandBase<GadgetManager>
|
||||
}
|
||||
for (Gadget gadget : _plugin.getGadgets(gadgetType))
|
||||
{
|
||||
_plugin.getDonationManager().Get(caller.getName()).RemoveUnknownSalesPackagesOwned(gadget.GetName());
|
||||
_plugin.getDonationManager().Get(caller.getName()).RemoveUnknownSalesPackagesOwned(gadget.getName());
|
||||
}
|
||||
UtilPlayer.message(caller, F.main("Cosmetics", "Removed all the " + gadgetType.name() + " cosmetics!"));
|
||||
}
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user