Fix merge-related errors
Fix, polish, and re-implement Elo code.
This commit is contained in:
parent
91e550bdcc
commit
59001bdef6
@ -56,12 +56,12 @@ public class MotdManager implements Listener, Runnable
|
||||
//String motdLine = "§f§l◄ §c§lMaintenance§f§l ►";
|
||||
//String motdLine = "§f§l◄ §a§lCarl the Creeper§f§l ►";
|
||||
// String motdLine = " §2§l§n M O N S T E R M A Z E B E T A §f";
|
||||
String motdLine = " §f❄ §2§lMerry Christmas §f❄ §2§lElf Presents §f❄";
|
||||
String motdLine = " §f> §4§lCLANS BETA §f- §c§lOpen to Everyone §f<";
|
||||
// String motdLine = " §f❄ §2§lServer Maintenance §f❄ §2§lBe Back Soon §f❄";
|
||||
//String motdLine = " §d§lRank Sale §a§l40% Off");
|
||||
//String motdLine = " §f§l◄§c§lMAINTENANCE§f§l►");
|
||||
|
||||
updateMainMotd(" §c§m §f§m §c§m §f§m §2§l§m[ §r §c§lMineplex§r §f§lGames§r §2§l§m ]§f§m §c§m §f§m §c§m §r", motdLine);
|
||||
updateMainMotd(" §f§m §8§l§m[ §r §9§lMineplex§r §f§lGames§r §8§l§m ]§f§m §r", motdLine);
|
||||
System.out.println("Updated Bungee MOTD");
|
||||
}
|
||||
}
|
||||
|
@ -3,9 +3,9 @@ package mineplex.core.common.block.schematic;
|
||||
import org.bukkit.DyeColor;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.Block;
|
||||
|
||||
import mineplex.core.common.block.DataLocationMap;
|
||||
import mineplex.core.common.util.UtilBlock;
|
||||
|
||||
public class Schematic
|
||||
{
|
||||
@ -24,7 +24,7 @@ public class Schematic
|
||||
_blockData = blockData;
|
||||
}
|
||||
|
||||
public DataLocationMap paste(Location originLocation)
|
||||
public DataLocationMap paste(Location originLocation, boolean ignoreAir)
|
||||
{
|
||||
DataLocationMap locationMap = new DataLocationMap();
|
||||
|
||||
@ -43,31 +43,46 @@ public class Schematic
|
||||
// not sure why but the math.abs is my simple fix
|
||||
int materialId = Math.abs(_blocks[index]);
|
||||
|
||||
Material material = Material.getMaterial(materialId);
|
||||
if (material == null)
|
||||
if (ignoreAir && materialId == 0) // Air
|
||||
{
|
||||
System.err.println("Schematic: Could not find Material [id: " + materialId + " data: " + _blockData[index] + "]");
|
||||
continue;
|
||||
}
|
||||
else if (material == Material.GOLD_PLATE)
|
||||
else if (materialId == 147) // Gold Plate
|
||||
{
|
||||
// Check for data wool at location below the gold plate
|
||||
if (addDataWool(locationMap, originLocation, x, y - 1, z))
|
||||
if (addDataWool(locationMap, true, originLocation, x, y - 1, z))
|
||||
continue;
|
||||
}
|
||||
else if (material == Material.WOOL)
|
||||
else if (materialId == 148) // Iron Plate
|
||||
{
|
||||
// Check for data wool at location below the gold plate
|
||||
if (addDataWool(locationMap, false, originLocation, x, y - 1, z))
|
||||
continue;
|
||||
}
|
||||
else if (materialId == Material.SPONGE.getId())
|
||||
{
|
||||
if (addSpongeLocation(locationMap, originLocation, x, y + 1, z))
|
||||
continue;
|
||||
}
|
||||
else if (materialId == 35)
|
||||
{
|
||||
// Check if this is a dataloc so we can skip setting the block
|
||||
int aboveIndex = getIndex(x, y + 1, z);
|
||||
if (hasIndex(aboveIndex))
|
||||
{
|
||||
if (Math.abs(_blocks[aboveIndex]) == Material.GOLD_PLATE.getId())
|
||||
if (Math.abs(_blocks[aboveIndex]) == Material.GOLD_PLATE.getId() || Math.abs(_blocks[aboveIndex]) == Material.IRON_PLATE.getId())
|
||||
continue;
|
||||
}
|
||||
int belowIndex = getIndex(x, y - 1, z);
|
||||
if (hasIndex(belowIndex))
|
||||
{
|
||||
if(Math.abs(_blocks[belowIndex]) == Material.SPONGE.getId())
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
Block block = originLocation.getWorld().getBlockAt(startX + x, startY + y, startZ + z);
|
||||
block.setTypeIdAndData(materialId, _blockData[index], false);
|
||||
|
||||
UtilBlock.setQuick(originLocation.getWorld(), startX + x, startY + y, startZ + z, materialId, _blockData[index]);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -80,7 +95,7 @@ public class Schematic
|
||||
*
|
||||
* @return true if a location was added to the DataLocationMap
|
||||
*/
|
||||
private boolean addDataWool(DataLocationMap map, Location origin, int x, int y, int z)
|
||||
private boolean addDataWool(DataLocationMap map, boolean gold, Location origin, int x, int y, int z)
|
||||
{
|
||||
int index = getIndex(x, y, z);
|
||||
if (hasIndex(index))
|
||||
@ -92,7 +107,34 @@ public class Schematic
|
||||
DyeColor color = DyeColor.getByWoolData(data);
|
||||
if (color != null)
|
||||
{
|
||||
map.addLocation(color, origin.clone().add(x + 0.5, y + 0.5, z + 0.5));
|
||||
if (gold)
|
||||
{
|
||||
map.addGoldLocation(color, origin.clone().add(x, y, z));
|
||||
}
|
||||
else
|
||||
{
|
||||
map.addIronLocation(color, origin.clone().add(x, y, z));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private boolean addSpongeLocation(DataLocationMap map, Location origin, int x, int y, int z)
|
||||
{
|
||||
int index = getIndex(x, y, z);
|
||||
if (hasIndex(index))
|
||||
{
|
||||
int materialId = Math.abs(_blocks[index]);
|
||||
if (materialId == 35) // WOOL
|
||||
{
|
||||
byte data = _blockData[index];
|
||||
DyeColor color = DyeColor.getByWoolData(data);
|
||||
if (color != null)
|
||||
{
|
||||
map.addSpongeLocation(color, origin.clone().add(x, y - 1, z));
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -19,7 +19,6 @@ import net.minecraft.server.v1_8_R3.NBTTagString;
|
||||
|
||||
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+BawcvDk2Xpkt5UimvqZ5BceYLIfCt4KbShYipgLXLfYUZrntjPemd3SxthjxUuA07i44UxRdiC8uqy1twLT/HUS28gpk68lA/id9tKFwu1CUzshgcmvQPt3ghtNViNziR/2t7D/+5D31Vzmhf6n7Pnpdirt/5frMi2BKMMs7pLa0EF8CrrDU7QCwPav+EZVGFvVZbxSkCDq+n3IQ3PUWSCzy6KPxpdOlUjD0pAfLoiNj0P8u4+puQtID76r/St8ExchYl2dodUImu1ZETWeFUClF3ZGat62evx8uRQEI2W4dsVwj40VUfjaAuvyDzuouaKTrCzJXLQZZjR1B8URvuK61fGX0nhW607mEi6DE+nxP2ZoBrROEX4e37Ap6+TQn9Q8tKDPdcxtwSOpPO4Qkncjn/mGtP9lZU/DQ=");
|
||||
@ -33,6 +32,9 @@ public class SkinData
|
||||
public final static SkinData LOVESTRUCK = new SkinData("eyJ0aW1lc3RhbXAiOjE0NTUxMTAyNDMyNjUsInByb2ZpbGVJZCI6ImE5ZDBjMDcyYmYxOTQwYTFhMTkzNjhkMDlkNTAwMjZlIiwicHJvZmlsZU5hbWUiOiJTcGlyaXR1c1NhbmN0dXMiLCJzaWduYXR1cmVSZXF1aXJlZCI6dHJ1ZSwidGV4dHVyZXMiOnsiU0tJTiI6eyJ1cmwiOiJodHRwOi8vdGV4dHVyZXMubWluZWNyYWZ0Lm5ldC90ZXh0dXJlLzczMTY5YWQwZTUyYjM1N2NiZGYxZDU0NGVkNGNmOWJmOTI4YmI0ZWNlMDhlY2YyY2M0YmYyYTlmMjJhODI4MmQifX19", "LL4RiSKQoTZamRQ4QG6izpvhgFu5gAqW4eZxcWAihk7GkhyxifpJpBTOzKrj5hH9fCUfYkkijVWUYTEcVSVRWhocp2HXW59TbKfxOeMvHU5vTMwgpwm6PnUfwuTsRPSLC7WMnEreI3cjOxPVmXbTniOSd+o8j4oOIgwFS+VLPiYLh5Jl16i5I/9ekafl3/x41NISKWl62geqO2jPWehlk+r3soiRJsxaKw20T61GSNLu19iA96Rz2T2tUHB4opm8hbLgoiNL2g1affTjq3cZPLHH4JWF3vPhqLB5uw6xb55vFLM/PP0YiEMIi7YZOfRGeaPp7uXbXgHeew+7PG9UDVMfqbwANQY4ndECijZoei54+xX3MDXkMhQsc5S+FLnGH6e4d008v81eEOyzJUPkKbGxLCBgTUb1s4IHwomCr30twPlo1IuFBOY1qeVvZUfAfPJsREuj5q/oCAoYFgupmb3ClWECnwwaH/T4wdHjfSBHoZQdLzcgDOAl0b5EXxWmYBECqk/WA4TrYIDVGdwkqjI0RkPLUoxTj6135KO+F7P7PwhU9WBGeW8hHq918DBL0fjQVHjrzvolTqwmw6nySSePnPOxFX/iwtHWzpBa9V6kUNNN+V7OGTgRr0H/yUxB+oq1F8UBqyqT4YpqxXCSD36derF/Xt5IdpTbEbGBpm0=");
|
||||
public final static SkinData SECRET_PACKAGE = new SkinData("eyJ0aW1lc3RhbXAiOjE0NTUxMTAzNzE3OTIsInByb2ZpbGVJZCI6ImE5ZDBjMDcyYmYxOTQwYTFhMTkzNjhkMDlkNTAwMjZlIiwicHJvZmlsZU5hbWUiOiJTcGlyaXR1c1NhbmN0dXMiLCJzaWduYXR1cmVSZXF1aXJlZCI6dHJ1ZSwidGV4dHVyZXMiOnsiU0tJTiI6eyJ1cmwiOiJodHRwOi8vdGV4dHVyZXMubWluZWNyYWZ0Lm5ldC90ZXh0dXJlL2QyNWI5YTRjOWRhOThkZTliZmIwZDNjOWI1M2MzMjJhMjgxN2IyMTMxOTQzY2E1YWM2NTBjZThmMzEzZjdhIn19fQ==", "Wb5T0Zhp1RVt78V/i8dYrwZCNT0xZIRe3LvL0bngH498f8Jrl43KHgTi4f299zE9giVynkTogGhJ8inq/xqFCRctl7Nn9L3LVu78uQwt+fs+o+kw/Qc+lggFSjEIc+fc13AZndpec0Df46Kh/OGD7NXbtbLb6TE/0dU2RwQlvZrZ/QHYJb8OJ6aUcnHvAZim8NUtG/nlZtSClepHVSuKdNnfzoF9rFVFA/x4jTr6mZYPZ33YgQd2oTAPk+qE3iN+0InjZQNs2YLoKFmFrgzn+tGvNApC0siF0HEZGQCFIwJOtnBsasGoxujIrln/ZdOil+5ac4VWInXr8lKgY0Q3Ocy8/0cJl+E/XqB+ztG29zhB8B1zdHBfJr+MgeSIqBCPx4SCtY6r7gnMlQYG+uVx5NP3S5aJW/cEfDyXmpCykIcBPzeErnKC0SiAqXkCVNjWJpX6qRWvWMXqS69w6ht6qHvEY2GxlZUb5AP+JgFlsl3hJDms6EPvM4zNL0Ko4oWIBzwYRQXiemrP9TGgyo0aL1RcQ0JgBFO2hSo37PK0YL3tUPgteJXzm21wu0TiZLkLCWSgMUfYfvVnhTa+xzod0xvfujpN6Y1DUTdcf8WS8TRYw2JigSkWrRW0fXPBCtTtQN5jiwM5/HrTpNLzg03J6SpfZ+rr8Rhq0S/8beQOMas=");
|
||||
|
||||
public final static SkinData CHISS = new SkinData("eyJ0aW1lc3RhbXAiOjE0NTk1NDI5NjgyNDEsInByb2ZpbGVJZCI6IjFkMmJmZTYxN2ViZDQ0NWRiYTdkODM1NGEwZmZkMWVhIiwicHJvZmlsZU5hbWUiOiJDaGlzcyIsInNpZ25hdHVyZVJlcXVpcmVkIjp0cnVlLCJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvOTg3MmNkMzRjY2IzMTIxYjRjNmEzOGFjM2JmOGVkM2UwMzk3YmQ2YTg4NDI4YjdhZmM2ZTUyNTI4NTVhMzQzIiwibWV0YWRhdGEiOnsibW9kZWwiOiJzbGltIn19fX0=", "hNTLRA2acZYx2dM90lnJN8FMK/ceD3+AxKNdD5FrXzxGtYL4C1Jr/vbTE0UosmwFP3wScNEW/fuDOjeZRjZHMJdvgDZMlMK/5KDhOY6sj/RS9RckztsgummSyjH/hdDn7TWWfhZLMbiia/K0VReI9eq2yD6zGQpvMlz5hB/5SX5YHWXvCah3TL4UzYSlSVDlwY/Q3sVuIZUr8m/LIXJwniJKLGo6tUgtiJd9eseOsbBpVjzCUtLD8A9WBe2/eODgmLfqEvXESIoDRG8vL2nPSXWma/YolYHIl32/i+ZxVD7dRRaXQFYSiLI24EtzX1pPhMjyaTLazP9abH43J6J31w02pKM7N/xTa62020L/YfRRKGT5lygEDb1NMoSpAjszPxah+Ra2/L+yUWEI8cMES6I4mIJ00tclPjWK01xhIn3tqg+y2gqsGHwPhu/7vmF5NirNfKFw0qciKNBfbCAF7ae+mkUKjmAPuvBUBqQb7BOcpNVWsCo/XvzmiZZYsf5P4Uwz8LqUK4uH6V/5dg7lY2Xg3+IUylsrDqLGFDI8iy/NdjIQMbuRadh4IDO6DcmxBri2Ax4JNBPBTnRezge8uq37MZcft/IXQgFWKB9RtidVEACaTOkRj27k+Ojnkki+j44k0wZB47hiXFUHMCHl3a0SVdQe15ZbVsQj/HAvAS0=");
|
||||
public final static SkinData DEFEK7 = new SkinData("eyJ0aW1lc3RhbXAiOjE0NTk1NDI3ODkwNTksInByb2ZpbGVJZCI6Ijg5ZDQ2M2Y3MjNlYzQ3MGE4MjQ0NDU3ZjBjOGQ4NjFjIiwicHJvZmlsZU5hbWUiOiJkZWZlazciLCJzaWduYXR1cmVSZXF1aXJlZCI6dHJ1ZSwidGV4dHVyZXMiOnsiU0tJTiI6eyJ1cmwiOiJodHRwOi8vdGV4dHVyZXMubWluZWNyYWZ0Lm5ldC90ZXh0dXJlL2JmYWNjOWM4ZjhlY2E1OWU0NTE4MTUxZmE4OGFiMDZjOTFmNjM3OTE2NzJmMTRlNGYzODY3YTI2OTVlN2NmYmYifSwiQ0FQRSI6eyJ1cmwiOiJodHRwOi8vdGV4dHVyZXMubWluZWNyYWZ0Lm5ldC90ZXh0dXJlLzIyYjljNWVhNzYzYzg2ZmM1Y2FlYTMzZDgyYjBmYTY1YTdjMjI4ZmQzMjFiYTU0NzY2ZWE5NWEzZDBiOTc5MyJ9fX0=", "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;
|
||||
|
||||
public SkinData(String value, String signature)
|
||||
|
@ -88,7 +88,7 @@ public class ProfileLoader
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
; // Failed to load skin
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2,11 +2,14 @@ package mineplex.core.common.util;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
import java.util.Set;
|
||||
import java.util.TreeSet;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.block.Block;
|
||||
@ -168,6 +171,34 @@ public class UtilAlg
|
||||
return element;
|
||||
}
|
||||
|
||||
public static List<Block> getBox(Block cornerA, Block cornerB)
|
||||
{
|
||||
if (cornerA == null || cornerB == null || (cornerA.getWorld() != cornerB.getWorld()))
|
||||
return Collections.emptyList();
|
||||
|
||||
ArrayList<Block> list = new ArrayList<>();
|
||||
|
||||
int minX = Math.min(cornerA.getX(), cornerB.getX());
|
||||
int minY = Math.min(cornerA.getY(), cornerB.getY());
|
||||
int minZ = Math.min(cornerA.getZ(), cornerB.getZ());
|
||||
int maxX = Math.max(cornerA.getX(), cornerB.getX());
|
||||
int maxY = Math.max(cornerA.getY(), cornerB.getY());
|
||||
int maxZ = Math.max(cornerA.getZ(), cornerB.getZ());
|
||||
|
||||
for (int x = minX; x <= maxX; x++)
|
||||
{
|
||||
for (int y = minY; y <= maxY; y++)
|
||||
{
|
||||
for (int z = minZ; z <= maxZ; z++)
|
||||
{
|
||||
list.add(cornerA.getWorld().getBlockAt(x, y, z));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
public static boolean inBoundingBox(Location loc, Location cornerA, Location cornerB)
|
||||
{
|
||||
if (loc.getX() <= Math.min(cornerA.getX(), cornerB.getX())) return false;
|
||||
@ -582,4 +613,13 @@ public class UtilAlg
|
||||
|
||||
return new Location(location.getWorld(), x, location.getY(), z, location.getYaw(), location.getPitch());
|
||||
}
|
||||
|
||||
public static Location getRandomLocation(Location center, int radius)
|
||||
{
|
||||
Random r = new Random();
|
||||
int x = r.nextInt(radius * 2) - radius;
|
||||
int y = r.nextInt(radius * 2) - radius;
|
||||
int z = r.nextInt(radius * 2) - radius;
|
||||
return center.clone().add(x, y, z);
|
||||
}
|
||||
}
|
||||
|
@ -3,6 +3,7 @@ package mineplex.core.common.util;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Queue;
|
||||
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
@ -30,6 +31,7 @@ import org.bukkit.material.Bed;
|
||||
import net.minecraft.server.v1_8_R3.BlockPosition;
|
||||
import net.minecraft.server.v1_8_R3.Blocks;
|
||||
import net.minecraft.server.v1_8_R3.EnumDirection;
|
||||
import net.minecraft.server.v1_8_R3.IBlockData;
|
||||
import net.minecraft.server.v1_8_R3.Item;
|
||||
import net.minecraft.server.v1_8_R3.MathHelper;
|
||||
import net.minecraft.server.v1_8_R3.MinecraftKey;
|
||||
@ -1463,4 +1465,19 @@ public class UtilBlock
|
||||
|
||||
return state.update(false, false);
|
||||
}
|
||||
|
||||
public static void setQuick(World world, int x, int y, int z, int type, byte data)
|
||||
{
|
||||
int cx = x >> 4;
|
||||
int cz = z >> 4;
|
||||
if (!world.isChunkLoaded(cx, cz))
|
||||
{
|
||||
world.loadChunk(cx, cz, true);
|
||||
}
|
||||
|
||||
net.minecraft.server.v1_8_R3.Chunk chunk = ((CraftWorld) world).getHandle().getChunkAt(x >> 4, z >> 4);
|
||||
BlockPosition pos = new BlockPosition(x, y, z);
|
||||
IBlockData ibd = net.minecraft.server.v1_8_R3.Block.getById(type).fromLegacyData(data);
|
||||
chunk.a(pos, ibd);
|
||||
}
|
||||
}
|
||||
|
@ -5,24 +5,6 @@ import java.util.HashMap;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.server.v1_8_R3.AxisAlignedBB;
|
||||
import net.minecraft.server.v1_8_R3.EntityBat;
|
||||
import net.minecraft.server.v1_8_R3.EntityCreature;
|
||||
import net.minecraft.server.v1_8_R3.EntityEnderDragon;
|
||||
import net.minecraft.server.v1_8_R3.EntityHuman;
|
||||
import net.minecraft.server.v1_8_R3.EntityInsentient;
|
||||
import net.minecraft.server.v1_8_R3.EntityLiving;
|
||||
import net.minecraft.server.v1_8_R3.EntityTrackerEntry;
|
||||
import net.minecraft.server.v1_8_R3.NavigationAbstract;
|
||||
import net.minecraft.server.v1_8_R3.PacketPlayOutEntity;
|
||||
import net.minecraft.server.v1_8_R3.PacketPlayOutEntityHeadRotation;
|
||||
import net.minecraft.server.v1_8_R3.PathfinderGoal;
|
||||
import net.minecraft.server.v1_8_R3.PathfinderGoalLookAtPlayer;
|
||||
import net.minecraft.server.v1_8_R3.PathfinderGoalMoveTowardsRestriction;
|
||||
import net.minecraft.server.v1_8_R3.PathfinderGoalRandomLookaround;
|
||||
import net.minecraft.server.v1_8_R3.PathfinderGoalSelector;
|
||||
import net.minecraft.server.v1_8_R3.WorldServer;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
@ -40,8 +22,29 @@ import org.bukkit.entity.EntityType;
|
||||
import org.bukkit.entity.Giant;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.EntityEquipment;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.metadata.FixedMetadataValue;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.minecraft.server.v1_8_R3.AxisAlignedBB;
|
||||
import net.minecraft.server.v1_8_R3.EntityBat;
|
||||
import net.minecraft.server.v1_8_R3.EntityCreature;
|
||||
import net.minecraft.server.v1_8_R3.EntityEnderDragon;
|
||||
import net.minecraft.server.v1_8_R3.EntityHuman;
|
||||
import net.minecraft.server.v1_8_R3.EntityInsentient;
|
||||
import net.minecraft.server.v1_8_R3.EntityLiving;
|
||||
import net.minecraft.server.v1_8_R3.EntityTrackerEntry;
|
||||
import net.minecraft.server.v1_8_R3.NavigationAbstract;
|
||||
import net.minecraft.server.v1_8_R3.PacketPlayOutEntity;
|
||||
import net.minecraft.server.v1_8_R3.PacketPlayOutEntityHeadRotation;
|
||||
import net.minecraft.server.v1_8_R3.PathfinderGoal;
|
||||
import net.minecraft.server.v1_8_R3.PathfinderGoalLookAtPlayer;
|
||||
import net.minecraft.server.v1_8_R3.PathfinderGoalMoveTowardsRestriction;
|
||||
import net.minecraft.server.v1_8_R3.PathfinderGoalRandomLookaround;
|
||||
import net.minecraft.server.v1_8_R3.PathfinderGoalSelector;
|
||||
import net.minecraft.server.v1_8_R3.WorldServer;
|
||||
|
||||
public class UtilEnt
|
||||
{
|
||||
|
||||
@ -255,6 +258,34 @@ public class UtilEnt
|
||||
}
|
||||
}
|
||||
|
||||
public static void Rotate(LivingEntity entity, float yaw, float pitch)
|
||||
{
|
||||
EntityLiving handle = ((CraftLivingEntity) entity).getHandle();
|
||||
|
||||
while (yaw < -180.0F) yaw += 360.0F;
|
||||
while (yaw >= 180.0F) yaw -= 360.0F;
|
||||
|
||||
handle.yaw = yaw;
|
||||
handle.aK = yaw;
|
||||
handle.aI = yaw;
|
||||
handle.aL = yaw;
|
||||
handle.pitch = pitch;
|
||||
}
|
||||
|
||||
public static void LookAt(LivingEntity entity, Location location)
|
||||
{
|
||||
if (!(entity.getWorld().equals(location.getWorld())))
|
||||
return;
|
||||
|
||||
Vector dir = entity.getEyeLocation().toVector().subtract(location.toVector()).normalize();
|
||||
Location loc = entity.getEyeLocation().clone();
|
||||
|
||||
loc.setYaw(180 - (float) Math.toDegrees(Math.atan2(dir.getX(), dir.getZ())));
|
||||
loc.setPitch(90 - (float) Math.toDegrees(Math.acos(dir.getY())));
|
||||
|
||||
Rotate(entity, loc.getYaw(), loc.getPitch());
|
||||
}
|
||||
|
||||
public static void populate()
|
||||
{
|
||||
if (creatureMap.isEmpty())
|
||||
@ -825,4 +856,27 @@ public class UtilEnt
|
||||
{
|
||||
return ent.getLocation().getBlock().getTypeId() == 8 || ent.getLocation().getBlock().getTypeId() == 9;
|
||||
}
|
||||
|
||||
public static void SetMetadata(Entity entity, String key, Object value)
|
||||
{
|
||||
entity.setMetadata(key, new FixedMetadataValue(UtilServer.getPlugin(), value));
|
||||
}
|
||||
|
||||
// Nicer than doing entity.getMetadata(key).get(0);
|
||||
public static Object GetMetadata(Entity entity, String key)
|
||||
{
|
||||
if (!entity.hasMetadata(key))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
return entity.getMetadata(key).get(0);
|
||||
}
|
||||
|
||||
public static void SetItemInHand(LivingEntity entity, ItemStack item)
|
||||
{
|
||||
EntityEquipment equipment = entity.getEquipment();
|
||||
equipment.setItemInHand(item);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -74,10 +74,10 @@ public class UtilFirework
|
||||
|
||||
public static void packetPlayFirework(Player player, Location loc, Type type, Color color, boolean flicker, boolean trail)
|
||||
{
|
||||
Firework firework = (Firework) loc.getWorld().spawn(loc, Firework.class);
|
||||
Firework firework = loc.getWorld().spawn(loc, Firework.class);
|
||||
FireworkEffect effect = FireworkEffect.builder().flicker(flicker).withColor(color).with(type).trail(trail).build();
|
||||
|
||||
FireworkMeta data = (FireworkMeta) firework.getFireworkMeta();
|
||||
FireworkMeta data = firework.getFireworkMeta();
|
||||
data.clearEffects();
|
||||
data.setPower(1);
|
||||
data.addEffect(effect);
|
||||
@ -98,4 +98,14 @@ public class UtilFirework
|
||||
UtilPlayer.sendPacket(viewing, packet);
|
||||
}
|
||||
}
|
||||
|
||||
public static void spawnRandomFirework(Location location)
|
||||
{
|
||||
playFirework(location,
|
||||
Type.values()[UtilMath.r(Type.values().length)],
|
||||
Color.fromRGB(UtilMath.r(256), UtilMath.r(256), UtilMath.r(256)),
|
||||
UtilMath.random.nextBoolean(),
|
||||
UtilMath.random.nextBoolean()
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -437,4 +437,20 @@ public class UtilInv
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public static void give(Player player, Material material)
|
||||
{
|
||||
give(player, material, 1);
|
||||
}
|
||||
|
||||
public static void give(Player player, Material material, int amount)
|
||||
{
|
||||
give(player, material, amount, (byte) 0);
|
||||
}
|
||||
|
||||
public static void give(Player shooter, Material material, int amount, byte data)
|
||||
{
|
||||
shooter.getInventory().addItem(new ItemStack(material, amount, data));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -22,6 +22,8 @@ import org.bukkit.scheduler.BukkitRunnable;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
|
||||
import mineplex.core.common.events.PlayerRecieveBroadcastEvent;
|
||||
|
||||
public class UtilServer
|
||||
{
|
||||
// Quite hacky. would be nice if we could have a "MineplexPlugin" interface
|
||||
@ -68,8 +70,11 @@ public class UtilServer
|
||||
public static void broadcast(String message)
|
||||
{
|
||||
for (Player cur : getPlayers())
|
||||
{
|
||||
if (!UtilServer.CallEvent(new PlayerRecieveBroadcastEvent(cur, message)).isCancelled())
|
||||
UtilPlayer.message(cur, message);
|
||||
}
|
||||
}
|
||||
|
||||
public static void broadcast(LinkedList<String> messages)
|
||||
{
|
||||
@ -209,4 +214,9 @@ public class UtilServer
|
||||
|
||||
return _serverName;
|
||||
}
|
||||
|
||||
public static Collection<Player> GetPlayers()
|
||||
{
|
||||
return Lists.newArrayList(getPlayers());
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,8 @@
|
||||
package mineplex.core;
|
||||
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.Executors;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.event.HandlerList;
|
||||
import org.bukkit.event.Listener;
|
||||
|
@ -375,6 +375,7 @@ public class CoreClientManager extends MiniPlugin
|
||||
|
||||
runAsync(new Runnable()
|
||||
{
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
client.setAccountId(_repository.login(_loginProcessors, uuid, client.GetPlayerName()));
|
||||
|
@ -60,17 +60,11 @@ public class AccountRepository extends MinecraftRepository
|
||||
public int login(final List<ILoginProcessor> loginProcessors, final UUID uuid, final String name)
|
||||
{
|
||||
// First we try to grab the account id from cache - this saves an extra trip to database
|
||||
int accountId = -1;
|
||||
int accountId = PlayerCache.getInstance().getAccountId(uuid);
|
||||
|
||||
try (Connection connection = getConnection(); Statement statement = connection.createStatement())
|
||||
{
|
||||
int cachedId = PlayerCache.getInstance().getAccountId(uuid);
|
||||
if (cachedId > 0)
|
||||
{
|
||||
accountId = cachedId;
|
||||
System.out.println("Loaded Account ID From Cache [" + name + " - " + accountId + "]");
|
||||
}
|
||||
else
|
||||
if (accountId <= 0)
|
||||
{
|
||||
// Player was not found in cache, we need to grab the account id from database
|
||||
statement.execute("SELECT id FROM accounts WHERE accounts.uuid = '" + uuid + "' LIMIT 1;");
|
||||
@ -100,6 +94,10 @@ public class AccountRepository extends MinecraftRepository
|
||||
accountId = tempList.get(0);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
System.out.println(name + " Loaded Account ID From Cache [" + name + " - " + accountId + "]");
|
||||
}
|
||||
|
||||
final int finalId = accountId;
|
||||
final String uuidString = uuid.toString();
|
||||
|
@ -33,6 +33,7 @@ import mineplex.core.donation.GiveDonorData;
|
||||
import mineplex.core.facebook.FacebookManager;
|
||||
import mineplex.core.hologram.Hologram;
|
||||
import mineplex.core.hologram.HologramManager;
|
||||
import mineplex.core.inventory.ClientItem;
|
||||
import mineplex.core.inventory.InventoryManager;
|
||||
import mineplex.core.npc.Npc;
|
||||
import mineplex.core.npc.NpcManager;
|
||||
@ -474,6 +475,7 @@ public class BonusManager extends MiniClientPlugin<BonusClientData> implements I
|
||||
{
|
||||
if (timeTillRankBonus(player) > 0)
|
||||
result.run(false);
|
||||
|
||||
getRepository().attemptRankBonus(player, new Callback<Boolean>()
|
||||
{
|
||||
@Override
|
||||
@ -734,31 +736,35 @@ public class BonusManager extends MiniClientPlugin<BonusClientData> implements I
|
||||
|
||||
if (oldChests > 0)
|
||||
{
|
||||
_inventoryManager.addItemToInventory(player, TreasureType.OLD.getItemName(), oldChests);
|
||||
//_inventoryManager.addItemToInventory(player, TreasureType.OLD.getItemName(), oldChests);
|
||||
UtilPlayer.message(player, F.main("Carl", "Rewarded " + F.elem(oldChests + " Old Chests")));
|
||||
_inventoryManager.Get(player).addItem(new ClientItem(_inventoryManager.getItem(TreasureType.OLD.getItemName()), mythicalChests));
|
||||
}
|
||||
|
||||
if (ancientChests > 0)
|
||||
{
|
||||
UtilPlayer.message(player, F.main("Carl", "Rewarded " + F.elem(ancientChests + " Ancient Chests")));
|
||||
_inventoryManager.addItemToInventory(player, TreasureType.ANCIENT.getItemName(), ancientChests);
|
||||
//_inventoryManager.addItemToInventory(player, TreasureType.ANCIENT.getItemName(), ancientChests);
|
||||
_inventoryManager.Get(player).addItem(new ClientItem(_inventoryManager.getItem(TreasureType.ANCIENT.getItemName()), mythicalChests));
|
||||
}
|
||||
|
||||
if (mythicalChests > 0)
|
||||
{
|
||||
UtilPlayer.message(player, F.main("Carl", "Rewarded " + F.elem(mythicalChests + " Mythical Chests")));
|
||||
_inventoryManager.addItemToInventory(player, TreasureType.MYTHICAL.getItemName(), mythicalChests);
|
||||
//_inventoryManager.addItemToInventory(player, TreasureType.MYTHICAL.getItemName(), mythicalChests);
|
||||
_inventoryManager.Get(player).addItem(new ClientItem(_inventoryManager.getItem(TreasureType.MYTHICAL.getItemName()), mythicalChests));
|
||||
}
|
||||
|
||||
if (gems > 0)
|
||||
{
|
||||
UtilPlayer.message(player, F.main("Carl", "Rewarded " + F.elem(gems + " Gems")));
|
||||
_gemQueue.add(new GiveDonorData(null, player.getName(), "Treasure", player.getUniqueId(), coreClient.getAccountId(), gems));
|
||||
//_gemQueue.add(new GiveDonorData(null, player.getName(), "Treasure", player.getUniqueId(), coreClient.getAccountId(), gems));
|
||||
}
|
||||
|
||||
if (gold > 0)
|
||||
{
|
||||
UtilPlayer.message(player, F.main("Carl", "Rewarded " + F.elem(gold + " Gold")));
|
||||
/*
|
||||
_donationManager.rewardGold(new Callback<Boolean>()
|
||||
{
|
||||
@Override
|
||||
@ -773,12 +779,13 @@ public class BonusManager extends MiniClientPlugin<BonusClientData> implements I
|
||||
}
|
||||
}
|
||||
}, "Earned", player.getName(), coreClient.getAccountId(), gold, true);
|
||||
*/
|
||||
}
|
||||
|
||||
if (coins > 0)
|
||||
{
|
||||
UtilPlayer.message(player, F.main("Carl", "Rewarded " + F.elem(coins + " Treasure Shards")));
|
||||
_coinQueue.add(new GiveDonorData(null, player.getName(), "Treasure", player.getUniqueId(), coreClient.getAccountId(), coins));
|
||||
//_coinQueue.add(new GiveDonorData(null, player.getName(), "Treasure", player.getUniqueId(), coreClient.getAccountId(), coins));
|
||||
}
|
||||
|
||||
if (tickets > 0)
|
||||
|
@ -259,42 +259,48 @@ public class BonusRepository extends MinecraftRepository
|
||||
|
||||
public void attemptRankBonus(final Player player, final Callback<Boolean> result)
|
||||
{
|
||||
if (!Recharge.Instance.usable(player, "AttemptRankBonus")) {
|
||||
if (!Recharge.Instance.usable(player, "AttemptRankBonus"))
|
||||
{
|
||||
result.run(false);
|
||||
return;
|
||||
}
|
||||
|
||||
final int accountId = _manager.getClientManager().Get(player).getAccountId();
|
||||
final int coins = _manager.getRankBonusAmount(player).getCoins();
|
||||
final int gems = _manager.getRankBonusAmount(player).getGems();
|
||||
final int mythicalChestChange = _manager.getRankBonusAmount(player).getMythicalChests();
|
||||
|
||||
if (!_manager.getRankBonusAmount(player).isGreaterThanZero()) {
|
||||
if (!_manager.getRankBonusAmount(player).isGreaterThanZero())
|
||||
{
|
||||
result.run(false);
|
||||
return;
|
||||
}
|
||||
|
||||
final JavaPlugin plug = _manager.getPlugin();
|
||||
|
||||
Bukkit.getScheduler().runTaskAsynchronously(plug, new Runnable() {
|
||||
|
||||
Bukkit.getScheduler().runTaskAsynchronously(plug, new Runnable()
|
||||
{
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
|
||||
try (Connection connection = getConnection();
|
||||
CallableStatement callableStatement = connection.prepareCall("{call check_rank(?, ?, ?, ?, ?)}")) {
|
||||
CallableStatement callableStatement = connection.prepareCall("{call rankBonus(?, ?, ?, ?, ?, ?)}"))
|
||||
{
|
||||
callableStatement.setInt(1, accountId);
|
||||
callableStatement.setInt(2, coins);
|
||||
callableStatement.setInt(3, 0);
|
||||
callableStatement.registerOutParameter(4, java.sql.Types.BOOLEAN);
|
||||
callableStatement.registerOutParameter(5, java.sql.Types.DATE);
|
||||
callableStatement.setInt(3, gems);
|
||||
callableStatement.setInt(4, mythicalChestChange);
|
||||
callableStatement.registerOutParameter(5, java.sql.Types.BOOLEAN);
|
||||
callableStatement.registerOutParameter(6, java.sql.Types.DATE);
|
||||
|
||||
callableStatement.executeUpdate();
|
||||
|
||||
final boolean pass = callableStatement.getBoolean(4);
|
||||
final boolean pass = callableStatement.getBoolean(5);
|
||||
|
||||
final Date date = callableStatement.getDate(5);
|
||||
|
||||
Bukkit.getScheduler().runTask(plug, new Runnable() {
|
||||
final Date date = callableStatement.getDate(6);
|
||||
|
||||
Bukkit.getScheduler().runTask(plug, new Runnable()
|
||||
{
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
@ -311,9 +317,12 @@ public class BonusRepository extends MinecraftRepository
|
||||
}
|
||||
}
|
||||
});
|
||||
} catch (Exception e) {
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Recharge.Instance.use(player, "AttemptRankBonus", 1000 * 30, false, false);
|
||||
e.printStackTrace();
|
||||
System.out.println("Error : " + e.getMessage());
|
||||
result.run(false);
|
||||
}
|
||||
}
|
||||
|
@ -58,6 +58,7 @@ public class Chat extends MiniPlugin
|
||||
private CoreClientManager _clientManager;
|
||||
private PreferencesManager _preferences;
|
||||
private AchievementManager _achievements;
|
||||
private IncognitoManager _incognitoManager;
|
||||
|
||||
private String[] _hackusations = {"hack", "hax", "hacker", "hacking", "cheat", "cheater", "cheating", "forcefield", "flyhack", "flyhacking", "autoclick", "aimbot"};
|
||||
private String _filterUrl = "https://chat.mineplex.com:8003/content/item/moderate";
|
||||
@ -74,10 +75,11 @@ public class Chat extends MiniPlugin
|
||||
|
||||
private HashMap<UUID, MessageData> _playerLastMessage = new HashMap<UUID, MessageData>();
|
||||
|
||||
public Chat(JavaPlugin plugin, CoreClientManager clientManager, PreferencesManager preferences, AchievementManager achievements, String serverName)
|
||||
public Chat(JavaPlugin plugin, IncognitoManager incognitoManager, CoreClientManager clientManager, PreferencesManager preferences, AchievementManager achievements, String serverName)
|
||||
{
|
||||
super("Chat", plugin);
|
||||
|
||||
_incognitoManager = incognitoManager;
|
||||
_clientManager = clientManager;
|
||||
_serverName = serverName;
|
||||
_preferences = preferences;
|
||||
@ -308,7 +310,7 @@ public class Chat extends MiniPlugin
|
||||
|
||||
Player sender = event.getPlayer();
|
||||
|
||||
if (IncognitoManager.Instance.Get(sender).Status)
|
||||
if (_incognitoManager != null && _incognitoManager.Get(sender).Status)
|
||||
{
|
||||
UtilPlayer.message(sender, C.cYellow + "You can not chat while incognito.");
|
||||
event.setCancelled(true);
|
||||
|
@ -2,8 +2,6 @@ package mineplex.core.elo;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.UUID;
|
||||
|
||||
import mineplex.core.MiniDbClientPlugin;
|
||||
@ -32,7 +30,7 @@ public class EloManager extends MiniDbClientPlugin<EloClientData>
|
||||
|
||||
public int getElo(UUID uuid, String gameType)
|
||||
{
|
||||
int elo = 1400;
|
||||
int elo = 1000;
|
||||
|
||||
synchronized (_playerEloLock)
|
||||
{
|
||||
@ -48,61 +46,6 @@ public class EloManager extends MiniDbClientPlugin<EloClientData>
|
||||
return elo;
|
||||
}
|
||||
|
||||
//get a player's Division
|
||||
public String getPlayerDivision(UUID uuid, String gameType)
|
||||
{
|
||||
//get playerElo for gameType (need to store this to check it against other Elo's)
|
||||
int playerElo = getElo(uuid, gameType);
|
||||
//this list will be filled with ELO's from other players (but only for the same game type
|
||||
ArrayList<Integer> allElos = new ArrayList<Integer>();
|
||||
|
||||
for(int i = 0; i < _playerElos.size(); i++)
|
||||
{
|
||||
//we're only concerned with this Game Type
|
||||
if(_playerElos.containsKey(gameType))
|
||||
{
|
||||
//add elo's to the list
|
||||
allElos.add(_playerElos.get(uuid.toString()).get(gameType));
|
||||
}
|
||||
}
|
||||
//sort list of Elos (needed for percentile calculations)
|
||||
Collections.sort(allElos);
|
||||
|
||||
//Calculate how much going up one spot is worth
|
||||
double individualValue = (100/allElos.size());
|
||||
|
||||
/* lastIndexOf gets the last instance of player's Elo
|
||||
* Consequently, it should be easier for rank to go up than down
|
||||
* and everyone at the same Elo should be in the same division
|
||||
*/
|
||||
double percentile = allElos.lastIndexOf(playerElo) * individualValue;
|
||||
|
||||
|
||||
return CalculateDivision(playerElo, percentile);
|
||||
}
|
||||
|
||||
public String CalculateDivision(int playerElo, double divPercent)
|
||||
{
|
||||
if (playerElo >= 3500 && divPercent > 99) return "Diamond";
|
||||
if (playerElo >= 3500) return "Emerald 3";
|
||||
if (playerElo < 3500 && playerElo >= 3300) return "Emerald 2";
|
||||
if (playerElo < 3300 && playerElo >= 3100) return "Emerald 1";
|
||||
if (playerElo < 3100 && playerElo >= 2900) return "Lapis 3";
|
||||
if (playerElo < 2900 && playerElo >= 2700) return "Lapis 2";
|
||||
if (playerElo < 2700 && playerElo >= 2500) return "Lapis 1";
|
||||
if (playerElo < 2500 && playerElo >= 2300) return "Gold 3";
|
||||
if (playerElo < 2300 && playerElo >= 2100) return "Gold 2";
|
||||
if (playerElo < 2100 && playerElo >= 1900) return "Gold 1";
|
||||
if (playerElo < 1900 && playerElo >= 1700) return "Iron 3";
|
||||
if (playerElo < 1700 && playerElo >= 1500) return "Iron 2";
|
||||
if (playerElo < 1500 && playerElo >= 1300) return "Iron 1";
|
||||
if (playerElo < 1300 && playerElo >= 800) return "Coal 3";
|
||||
if (playerElo < 800 && playerElo >= 600) return "Coal 2";
|
||||
if (playerElo < 600 && playerElo >= 400) return "Coal 1";
|
||||
|
||||
return "Result not found";
|
||||
}
|
||||
|
||||
public EloTeam getNewRatings(EloTeam teamA, EloTeam teamB, GameResult result)
|
||||
{
|
||||
EloTeam newTeam = new EloTeam();
|
||||
|
@ -5,22 +5,8 @@ public class EloPlayer
|
||||
public String UniqueId;
|
||||
public int Rating;
|
||||
|
||||
//String to hold division player is currently in
|
||||
private String _division;
|
||||
|
||||
public void printInfo()
|
||||
{
|
||||
System.out.println(UniqueId + "'s elo is " + Rating);
|
||||
}
|
||||
|
||||
public void setDivision(String newDivision)
|
||||
{
|
||||
_division = newDivision;
|
||||
}
|
||||
|
||||
public String getDivision()
|
||||
{
|
||||
return _division;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -3,8 +3,6 @@ package mineplex.core.game;
|
||||
import org.bukkit.DyeColor;
|
||||
import org.bukkit.Material;
|
||||
|
||||
import mineplex.core.elo.EloSettings;
|
||||
|
||||
public enum GameDisplay
|
||||
{
|
||||
//Mini
|
||||
@ -91,8 +89,6 @@ public enum GameDisplay
|
||||
private int _gameId; // Unique identifying id for this gamemode (used for statistics)
|
||||
public int getGameId() { return _gameId; }
|
||||
|
||||
private EloSettings EloSetting = new EloSettings(0);
|
||||
|
||||
GameDisplay(String name, Material mat, byte data, GameCategory gameCategory, int gameId)
|
||||
{
|
||||
this(name, name, mat, data, gameCategory, gameId);
|
||||
|
@ -17,6 +17,7 @@ import com.google.common.base.Function;
|
||||
|
||||
import mineplex.core.MiniDbClientPlugin;
|
||||
import mineplex.core.account.CoreClientManager;
|
||||
import mineplex.core.common.Rank;
|
||||
import mineplex.core.common.util.C;
|
||||
import mineplex.core.common.util.UtilPlayer;
|
||||
import mineplex.core.common.util.UtilServer;
|
||||
@ -90,30 +91,45 @@ public class IncognitoManager extends MiniDbClientPlugin<IncognitoClient>
|
||||
@EventHandler(priority = EventPriority.HIGHEST)
|
||||
public void Join(PlayerJoinEvent event)
|
||||
{
|
||||
Player player = event.getPlayer();
|
||||
|
||||
if (Get(event.getPlayer()).Status && !_clientManager.hasRank(event.getPlayer(), Rank.HELPER))
|
||||
{
|
||||
Get(event.getPlayer()).Status = false;
|
||||
runAsync(() -> _repository.setStatus(_clientManager.getAccountId(player), false));
|
||||
return;
|
||||
}
|
||||
|
||||
if (Get(event.getPlayer()).Status)
|
||||
{
|
||||
event.setJoinMessage(null);
|
||||
informIncognito(event.getPlayer());
|
||||
informIncognito(player);
|
||||
}
|
||||
|
||||
IncognitoHidePlayerEvent customEvent = UtilServer.CallEvent(new IncognitoHidePlayerEvent(event.getPlayer()));
|
||||
IncognitoHidePlayerEvent customEvent = null;
|
||||
|
||||
UtilServer.getPlayersCollection().forEach(player -> {
|
||||
if (!customEvent.isCancelled() && Get(event.getPlayer()).Status && !_clientManager.hasRank(player, _clientManager.Get(event.getPlayer()).GetRank()))
|
||||
if (Get(event.getPlayer()).Status)
|
||||
{
|
||||
player.hidePlayer(event.getPlayer());
|
||||
customEvent = UtilServer.CallEvent(new IncognitoHidePlayerEvent(player));
|
||||
}
|
||||
|
||||
if (Get(player).Status)
|
||||
for (Player other : UtilServer.getPlayers())
|
||||
{
|
||||
IncognitoHidePlayerEvent customEvent2 = UtilServer.CallEvent(new IncognitoHidePlayerEvent(player));
|
||||
if (customEvent != null && !customEvent.isCancelled() && !_clientManager.hasRank(other, _clientManager.Get(player).GetRank()))
|
||||
{
|
||||
other.hidePlayer(player);
|
||||
}
|
||||
|
||||
if (!customEvent2.isCancelled() && !_clientManager.hasRank(event.getPlayer(), _clientManager.Get(player).GetRank()))
|
||||
if (Get(other).Status)
|
||||
{
|
||||
event.getPlayer().hidePlayer(player);
|
||||
IncognitoHidePlayerEvent customEvent2 = UtilServer.CallEvent(new IncognitoHidePlayerEvent(other));
|
||||
|
||||
if (!customEvent2.isCancelled() && !_clientManager.hasRank(player, _clientManager.Get(other).GetRank()))
|
||||
{
|
||||
player.hidePlayer(other);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGHEST)
|
||||
|
@ -0,0 +1,47 @@
|
||||
package mineplex.core.incognito.events;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.Event;
|
||||
import org.bukkit.event.HandlerList;
|
||||
|
||||
/**
|
||||
* Called when an Incognito player is getting hidden from all other players.
|
||||
*/
|
||||
public class IncognitoHidePlayerEvent extends Event
|
||||
{
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
|
||||
private Player _player;
|
||||
private boolean _cancelled;
|
||||
|
||||
public IncognitoHidePlayerEvent(Player player)
|
||||
{
|
||||
_player = player;
|
||||
}
|
||||
|
||||
public Player getPlayer()
|
||||
{
|
||||
return _player;
|
||||
}
|
||||
|
||||
public void setCancelled(boolean cancelled)
|
||||
{
|
||||
_cancelled = cancelled;
|
||||
}
|
||||
|
||||
public boolean isCancelled()
|
||||
{
|
||||
return _cancelled;
|
||||
}
|
||||
|
||||
public HandlerList getHandlers()
|
||||
{
|
||||
return handlers;
|
||||
}
|
||||
|
||||
public static HandlerList getHandlerList()
|
||||
{
|
||||
return handlers;
|
||||
}
|
||||
|
||||
}
|
@ -27,7 +27,12 @@ import mineplex.core.friend.data.FriendData;
|
||||
import mineplex.core.friend.data.FriendStatus;
|
||||
import mineplex.core.ignore.IgnoreManager;
|
||||
import mineplex.core.incognito.IncognitoManager;
|
||||
import mineplex.core.message.commands.*;
|
||||
import mineplex.core.message.commands.AdminCommand;
|
||||
import mineplex.core.message.commands.AnnounceCommand;
|
||||
import mineplex.core.message.commands.MessageAdminCommand;
|
||||
import mineplex.core.message.commands.MessageCommand;
|
||||
import mineplex.core.message.commands.ResendAdminCommand;
|
||||
import mineplex.core.message.commands.ResendCommand;
|
||||
import mineplex.core.message.redis.AnnouncementHandler;
|
||||
import mineplex.core.message.redis.MessageHandler;
|
||||
import mineplex.core.message.redis.RedisMessage;
|
||||
@ -45,6 +50,8 @@ public class MessageManager extends MiniClientPlugin<ClientMessage>
|
||||
private CoreClientManager _clientManager;
|
||||
private FriendManager _friendsManager;
|
||||
private IgnoreManager _ignoreManager;
|
||||
private IncognitoManager _incognitoManager;
|
||||
|
||||
private HashMap<UUID, BukkitRunnable> _messageTimeouts = new HashMap<UUID, BukkitRunnable>();
|
||||
private PreferencesManager _preferences;
|
||||
private Punish _punish;
|
||||
@ -52,11 +59,12 @@ public class MessageManager extends MiniClientPlugin<ClientMessage>
|
||||
private ArrayList<String> _randomMessage;
|
||||
private String _serverName;
|
||||
|
||||
public MessageManager(JavaPlugin plugin, CoreClientManager clientManager, PreferencesManager preferences,
|
||||
public MessageManager(JavaPlugin plugin, IncognitoManager incognitoManager, CoreClientManager clientManager, PreferencesManager preferences,
|
||||
IgnoreManager ignoreManager, Punish punish, FriendManager friendManager, Chat chat)
|
||||
{
|
||||
super("Message", plugin);
|
||||
|
||||
_incognitoManager = incognitoManager;
|
||||
_clientManager = clientManager;
|
||||
_preferences = preferences;
|
||||
_ignoreManager = ignoreManager;
|
||||
@ -86,7 +94,7 @@ public class MessageManager extends MiniClientPlugin<ClientMessage>
|
||||
addCommand(new AnnounceCommand(this));
|
||||
//addCommand(new GlobalCommand(this));
|
||||
|
||||
addCommand(new AdminCommand(this));
|
||||
addCommand(new AdminCommand(this, _incognitoManager));
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -466,7 +474,6 @@ public class MessageManager extends MiniClientPlugin<ClientMessage>
|
||||
|
||||
if (!adminMessage)
|
||||
{
|
||||
|
||||
for (FriendStatus friendInfo : friends.getFriends())
|
||||
{
|
||||
|
||||
@ -524,7 +531,7 @@ public class MessageManager extends MiniClientPlugin<ClientMessage>
|
||||
// If this is a message inside the server
|
||||
if (to != null)
|
||||
{
|
||||
if (IncognitoManager.Instance.Get(to).Status)
|
||||
if (_incognitoManager.Get(to).Status)
|
||||
{
|
||||
UtilPlayer.message(sender, F.main("Online Player Search", F.elem("0") + " matches for [" + F.elem(target) + "]."));
|
||||
return;
|
||||
@ -549,23 +556,30 @@ public class MessageManager extends MiniClientPlugin<ClientMessage>
|
||||
// If this is a admin message, or the sender isn't muted/ignoring the target
|
||||
if (adminMessage || canSenderMessageThem(sender, playerTarget))
|
||||
{
|
||||
runAsync(new Runnable()
|
||||
{
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
// TODO Newgarbo wrote this stuff inefficiently and for sake of time and thousands of players i'm going to just comment this out
|
||||
/*
|
||||
if (IncognitoManager.Instance.getRepository().GetStatus(playerTarget))
|
||||
{
|
||||
UtilPlayer.message(sender, F.main("Online Player Search", F.elem("0") + " matches for [" + F.elem(target) + "]."));
|
||||
return;
|
||||
}
|
||||
*/
|
||||
|
||||
runSync(new Runnable()
|
||||
{
|
||||
public void run()
|
||||
{
|
||||
// Construct the command to send to redis
|
||||
RedisMessage globalMessage = new RedisMessage(_serverName,
|
||||
|
||||
sender.getName(),
|
||||
|
||||
adminMessage ? null : friend.ServerName,
|
||||
|
||||
playerTarget,
|
||||
|
||||
message,
|
||||
|
||||
// Include the sender's rank if this is a admin message. So we can format the receivers chat.
|
||||
adminMessage ? F.rank(_clientManager.Get(sender).GetRank()) : null);
|
||||
|
||||
@ -595,6 +609,11 @@ public class MessageManager extends MiniClientPlugin<ClientMessage>
|
||||
// Time to send the message!
|
||||
globalMessage.publish();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -9,14 +9,18 @@ import mineplex.core.common.util.C;
|
||||
import mineplex.core.common.util.F;
|
||||
import mineplex.core.common.util.UtilPlayer;
|
||||
import mineplex.core.common.util.UtilServer;
|
||||
import mineplex.core.incognito.IncognitoManager;
|
||||
import mineplex.core.message.MessageManager;
|
||||
import mineplex.core.visibility.VisibilityManager;
|
||||
|
||||
public class AdminCommand extends CommandBase<MessageManager>
|
||||
{
|
||||
public AdminCommand(MessageManager plugin)
|
||||
private IncognitoManager _incognitoManager;
|
||||
|
||||
public AdminCommand(MessageManager plugin, IncognitoManager incognitoManager)
|
||||
{
|
||||
super(plugin, Rank.ALL, "a","admin");
|
||||
|
||||
_incognitoManager = incognitoManager;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -51,6 +55,11 @@ public class AdminCommand extends CommandBase<MessageManager>
|
||||
{
|
||||
if (Plugin.GetClientManager().Get(to).GetRank().has(Rank.HELPER))
|
||||
{
|
||||
if (_incognitoManager.Get(to).Status)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!to.equals(caller))
|
||||
UtilPlayer.message(to, F.rank(Plugin.GetClientManager().Get(caller).GetRank()) + " " + caller.getName() + " " + C.cPurple + message);
|
||||
|
||||
|
@ -478,6 +478,17 @@ public class NpcManager extends MiniPlugin
|
||||
}
|
||||
}
|
||||
|
||||
public void addFakeNpc(Npc npc)
|
||||
{
|
||||
_npcs.add(npc);
|
||||
}
|
||||
|
||||
public void removeFakeNpc(Npc npc)
|
||||
{
|
||||
_npcs.remove(npc);
|
||||
npc.getEntity().remove();
|
||||
}
|
||||
|
||||
public void loadNpcs() throws SQLException
|
||||
{
|
||||
String serverType = getServerName();
|
||||
|
@ -60,13 +60,11 @@ public class ResourcePackManager extends MiniPlugin implements CommandCallback
|
||||
if (entry.getLeft() == version || entry.getLeft() == MinecraftVersion.ALL)
|
||||
{
|
||||
player.setResourcePack(entry.getRight());
|
||||
player.sendMessage("A: " + entry.getRight());
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
player.setResourcePack(_resourcePackUrls[0].getRight());
|
||||
player.sendMessage("B: " + _resourcePackUrls[0].getRight());
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
|
@ -53,9 +53,13 @@ public enum UpdateType
|
||||
*/
|
||||
SLOWEST(32000),
|
||||
/**
|
||||
* ONce every 30 seconds
|
||||
* Once every 30 seconds
|
||||
*/
|
||||
SEC_30(30000),
|
||||
/**
|
||||
* Once every 20 seconds
|
||||
*/
|
||||
SEC_20(20000),
|
||||
/**
|
||||
* Once every 16 seconds
|
||||
*/
|
||||
|
@ -3,7 +3,7 @@ package mineplex.game.clans.core.repository.tokens;
|
||||
public class SimpleClanToken
|
||||
{
|
||||
|
||||
private String _clanName;
|
||||
private String _clanName = "";
|
||||
public String getClanName() { return _clanName; }
|
||||
|
||||
private String _clanRole;
|
||||
@ -22,4 +22,6 @@ public class SimpleClanToken
|
||||
_homeServer = homeServer;
|
||||
_clanId = clanId;
|
||||
}
|
||||
|
||||
public SimpleClanToken() { }
|
||||
}
|
||||
|
@ -7,16 +7,20 @@ import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
import mineplex.core.CustomTagFix;
|
||||
import mineplex.core.FoodDupeFix;
|
||||
import mineplex.core.PacketsInteractionFix;
|
||||
import mineplex.core.account.CoreClientManager;
|
||||
import mineplex.core.achievement.AchievementManager;
|
||||
import mineplex.core.antihack.AntiHack;
|
||||
import mineplex.core.blockrestore.BlockRestore;
|
||||
import mineplex.core.chat.Chat;
|
||||
import mineplex.core.command.CommandCenter;
|
||||
import mineplex.core.common.MinecraftVersion;
|
||||
import mineplex.core.common.Pair;
|
||||
import mineplex.core.common.events.ServerShutdownEvent;
|
||||
import mineplex.core.delayedtask.DelayedTask;
|
||||
import mineplex.core.donation.DonationManager;
|
||||
import mineplex.core.explosion.Explosion;
|
||||
import mineplex.core.fallingblock.FallingBlocks;
|
||||
import mineplex.core.friend.FriendManager;
|
||||
import mineplex.core.give.Give;
|
||||
import mineplex.core.hologram.HologramManager;
|
||||
@ -41,7 +45,6 @@ import mineplex.core.teleport.Teleport;
|
||||
import mineplex.core.updater.FileUpdater;
|
||||
import mineplex.core.updater.Updater;
|
||||
import mineplex.core.visibility.VisibilityManager;
|
||||
import mineplex.game.clans.analytics.Profiler;
|
||||
import mineplex.game.clans.clans.ClansManager;
|
||||
import mineplex.game.clans.clans.ban.ClansBanManager;
|
||||
import mineplex.game.clans.items.GearManager;
|
||||
@ -66,9 +69,6 @@ public class Clans extends JavaPlugin
|
||||
@Override
|
||||
public void onEnable()
|
||||
{
|
||||
// Initialize Profiler
|
||||
new Profiler();
|
||||
|
||||
// Configs
|
||||
getConfig().addDefault(WEB_CONFIG, "http://accounts.mineplex.com/");
|
||||
getConfig().set(WEB_CONFIG, getConfig().getString(WEB_CONFIG));
|
||||
@ -93,6 +93,8 @@ public class Clans extends JavaPlugin
|
||||
|
||||
_donationManager = new DonationManager(this, _clientManager, webServerAddress);
|
||||
|
||||
new FallingBlocks(this);
|
||||
|
||||
new ServerConfiguration(this, _clientManager);
|
||||
|
||||
PreferencesManager preferenceManager = new PreferencesManager(this, _clientManager, _donationManager);
|
||||
@ -107,7 +109,7 @@ public class Clans extends JavaPlugin
|
||||
Portal portal = new Portal(this, _clientManager, serverStatusManager.getCurrentServerName());
|
||||
new FileUpdater(this, portal, serverStatusManager.getCurrentServerName(), serverStatusManager.getRegion());
|
||||
|
||||
new ClansBanManager(this, _clientManager, _donationManager);
|
||||
// ClansBanManager clansBans = new ClansBanManager(this, _clientManager, _donationManager);
|
||||
|
||||
PacketHandler packetHandler = new PacketHandler(this);
|
||||
Punish punish = new Punish(this, webServerAddress, _clientManager);
|
||||
@ -122,23 +124,26 @@ public class Clans extends JavaPlugin
|
||||
|
||||
StatsManager statsManager = new StatsManager(this, _clientManager);
|
||||
AchievementManager achievementManager = new AchievementManager(statsManager, _clientManager, _donationManager);
|
||||
Chat chat = new Chat(this, _clientManager, preferenceManager, achievementManager, serverStatusManager.getCurrentServerName());
|
||||
new MessageManager(this, _clientManager, preferenceManager, ignoreManager, punish, new FriendManager(this, _clientManager, preferenceManager, portal), chat);
|
||||
Chat chat = new Chat(this, incognito, _clientManager, preferenceManager, achievementManager, serverStatusManager.getCurrentServerName());
|
||||
new MessageManager(this, incognito, _clientManager, preferenceManager, ignoreManager, punish, new FriendManager(this, _clientManager, preferenceManager, portal), chat);
|
||||
|
||||
new MemoryFix(this);
|
||||
new FoodDupeFix(this);
|
||||
new Explosion(this, blockRestore);
|
||||
new FriendManager(this, _clientManager, preferenceManager, portal);
|
||||
new InventoryManager(this, _clientManager);
|
||||
ResourcePackManager resourcePackManager = new ResourcePackManager(this, portal);
|
||||
resourcePackManager.setResourcePack("http://garblox.com/b:ResClans.zip", "http://garblox.com/b:ResClans19.zip", true);
|
||||
resourcePackManager.setResourcePack(new Pair[]
|
||||
{
|
||||
Pair.create(MinecraftVersion.Version1_8, "http://phinary.ca/ResClans.zip"),
|
||||
Pair.create(MinecraftVersion.Version1_9, "http://phinary.ca/ResClans19.zip")
|
||||
}, true);
|
||||
|
||||
// Enable custom-gear related managers
|
||||
new CustomTagFix(this, packetHandler);
|
||||
GearManager customGear = new GearManager(this, packetHandler, _clientManager, _donationManager);
|
||||
|
||||
HologramManager hologram = new HologramManager(this, packetHandler);
|
||||
_clansManager = new ClansManager(this, serverStatusManager.getCurrentServerName(), packetHandler, punish, _clientManager, _donationManager, preferenceManager, blockRestore, teleport, chat, customGear, hologram, webServerAddress);
|
||||
_clansManager = new ClansManager(this, /*clansBans,*/ serverStatusManager.getCurrentServerName(), packetHandler, punish, _clientManager, _donationManager, preferenceManager, blockRestore, statsManager, teleport, chat, customGear, hologram, webServerAddress);
|
||||
new Recipes(this);
|
||||
new Farming(this);
|
||||
new BuildingShop(_clansManager, _clientManager, _donationManager);
|
||||
|
@ -61,7 +61,7 @@ public class ClanEnergyTracker extends MiniPlugin
|
||||
|
||||
Triple<Long, Long, String[]> energyBounds = _updateMap.get(type);
|
||||
|
||||
if (energyBounds != null && energyRemaining > energyBounds.getLeft() && energyRemaining < energyBounds.getMiddle())
|
||||
if (energyBounds != null && energyRemaining > energyBounds.getLeft().longValue() && energyRemaining < energyBounds.getMiddle().longValue())
|
||||
{
|
||||
_clans.middleTextClan(clan, energyBounds.getRight()[0], energyBounds.getRight()[1], 20, 200, 80);
|
||||
_clans.sendTipToClan(clan, TipType.ENERGY);
|
||||
|
@ -245,7 +245,7 @@ public class ClansAdmin
|
||||
{
|
||||
public void run()
|
||||
{
|
||||
if (nameExists)
|
||||
if (nameExists.booleanValue())
|
||||
UtilPlayer.message(caller, F.main("Clans Admin", "Clan name cannot be a Player name."));
|
||||
else
|
||||
{
|
||||
|
@ -16,6 +16,7 @@ import mineplex.core.common.util.UtilBlock;
|
||||
import mineplex.core.common.util.UtilServer;
|
||||
import mineplex.core.common.util.UtilWorld;
|
||||
import mineplex.game.clans.clans.event.ClanCreatedEvent;
|
||||
import mineplex.game.clans.clans.event.ClanCreationCompleteEvent;
|
||||
import mineplex.game.clans.clans.event.ClanDeleteEvent;
|
||||
import mineplex.game.clans.clans.event.ClanJoinEvent;
|
||||
import mineplex.game.clans.clans.event.ClanLeaveEvent;
|
||||
@ -195,6 +196,9 @@ public class ClansDataAccessLayer
|
||||
}
|
||||
|
||||
if (callback != null) callback.run(clanInfo);
|
||||
|
||||
ClanCreationCompleteEvent event = new ClanCreationCompleteEvent(token, Bukkit.getPlayer(creator));
|
||||
UtilServer.getServer().getPluginManager().callEvent(event);
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -781,8 +785,14 @@ public class ClansDataAccessLayer
|
||||
// Memory
|
||||
claim.Safe = !claim.Safe;
|
||||
|
||||
// Save
|
||||
runAsync(new Runnable()
|
||||
{
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
_repository.updateTerritoryClaim(claim.Chunk, claim.Safe);
|
||||
}
|
||||
});
|
||||
|
||||
// Log
|
||||
_manager.log("Safe Zone at [" + claim.Chunk + "] set to [" + claim.Safe + "] by [" + player + "].");
|
||||
@ -803,7 +813,28 @@ public class ClansDataAccessLayer
|
||||
|
||||
public void clanExists(String clanName, Callback<Boolean> callback)
|
||||
{
|
||||
_repository.clanExists(clanName, callback);
|
||||
runAsync(new Runnable()
|
||||
{
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
_repository.clanExists(clanName, new Callback<Boolean>()
|
||||
{
|
||||
@Override
|
||||
public void run(Boolean data)
|
||||
{
|
||||
runSync(new Runnable()
|
||||
{
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
if (callback != null) callback.run(data);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public ClanRepository getRepository()
|
||||
|
@ -57,6 +57,7 @@ import mineplex.core.explosion.Explosion;
|
||||
import mineplex.core.hologram.Hologram;
|
||||
import mineplex.core.hologram.HologramManager;
|
||||
import mineplex.core.incognito.IncognitoManager;
|
||||
import mineplex.core.incognito.events.IncognitoHidePlayerEvent;
|
||||
import mineplex.core.incognito.events.IncognitoStatusChangeEvent;
|
||||
import mineplex.core.movement.Movement;
|
||||
import mineplex.core.npc.NpcManager;
|
||||
@ -93,7 +94,6 @@ import mineplex.game.clans.clans.nether.NetherManager;
|
||||
import mineplex.game.clans.clans.observer.ObserverManager;
|
||||
import mineplex.game.clans.clans.playtime.Playtime;
|
||||
import mineplex.game.clans.clans.potato.PotatoManager;
|
||||
import mineplex.game.clans.clans.pvptimer.PvpTimer;
|
||||
import mineplex.game.clans.clans.redis.ClanDeleteCommandHandler;
|
||||
import mineplex.game.clans.clans.redis.ClanLoadCommandHandler;
|
||||
import mineplex.game.clans.clans.regions.ClansRegions;
|
||||
@ -170,12 +170,15 @@ public class ClansManager extends MiniClientPlugin<ClientClan>implements IRelati
|
||||
private DonationManager _donationManager;
|
||||
private NetherManager _netherManager;
|
||||
private DamageManager _damageManager;
|
||||
private SiegeManager _siegeManager;
|
||||
private IncognitoManager _incognitoManager;
|
||||
|
||||
private ClansBlacklist _blacklist;
|
||||
|
||||
private Playtime _playTracker;
|
||||
|
||||
private mineplex.game.clans.legacytutorial.TutorialManager _tutorialManager;
|
||||
private TutorialManager _tutorial;
|
||||
private mineplex.game.clans.legacytutorial.TutorialManager _legacyTutorial;
|
||||
|
||||
private ClassManager _classManager;
|
||||
|
||||
@ -196,7 +199,7 @@ public class ClansManager extends MiniClientPlugin<ClientClan>implements IRelati
|
||||
private WarPointEvasion _warPointEvasion;
|
||||
private ObserverManager _observerManager;
|
||||
private Punish _punish;
|
||||
private PvpTimer _pvpTimer;
|
||||
private TaskManager _taskManager;
|
||||
|
||||
private int _inviteExpire = 2;
|
||||
private int _nameMin = 3;
|
||||
@ -218,18 +221,22 @@ public class ClansManager extends MiniClientPlugin<ClientClan>implements IRelati
|
||||
|
||||
public String UserDataDir = UtilServer.getServer().getWorlds().get(0).getWorldFolder().getPath() + File.separator + ".." + File.separator + "CLANS_USER_DATA" + File.separator;
|
||||
|
||||
/*private ClansBanManager _clansBans;*/
|
||||
|
||||
public ClanTips ClanTips;
|
||||
|
||||
// Spawn area
|
||||
|
||||
public ClansManager(JavaPlugin plugin, String serverName, PacketHandler packetHandler, Punish punish, CoreClientManager clientManager, DonationManager donationManager, PreferencesManager preferencesManager, BlockRestore blockRestore, Teleport teleport, Chat chat, GearManager gearManager, HologramManager hologramManager, String webServerAddress)
|
||||
public ClansManager(JavaPlugin plugin/*, ClansBanManager clansBans*/, String serverName, PacketHandler packetHandler, Punish punish, CoreClientManager clientManager, DonationManager donationManager, PreferencesManager preferencesManager, BlockRestore blockRestore, StatsManager statsManager, Teleport teleport, Chat chat, GearManager gearManager, HologramManager hologramManager, String webServerAddress)
|
||||
{
|
||||
super("Clans Manager", plugin);
|
||||
|
||||
_instance = this;
|
||||
|
||||
/*_clansBans = clansBans;*/
|
||||
_punish = punish;
|
||||
|
||||
_incognitoManager = new IncognitoManager(plugin, clientManager, packetHandler);
|
||||
_serverName = serverName;
|
||||
_clientManager = clientManager;
|
||||
_combatManager = new CombatManager(plugin);
|
||||
@ -258,7 +265,7 @@ public class ClansManager extends MiniClientPlugin<ClientClan>implements IRelati
|
||||
|
||||
_worldEvent = new WorldEventManager(plugin, this, _damageManager, _lootManager, blockRestore, _clanRegions, null);
|
||||
|
||||
TaskManager taskManager = new TaskManager(plugin, _clientManager, webServerAddress);
|
||||
_taskManager = new TaskManager(plugin, _clientManager, webServerAddress);
|
||||
|
||||
ClanTips = new ClanTips(plugin, this, preferencesManager);
|
||||
|
||||
@ -269,7 +276,8 @@ public class ClansManager extends MiniClientPlugin<ClientClan>implements IRelati
|
||||
_clanDisplay = new ClansDisplay(plugin, this);
|
||||
_clanGame = new ClansGame(plugin, this);
|
||||
_clanUtility = new ClansUtility(this);
|
||||
_itemMapManager = new ItemMapManager(this, _worldEvent);
|
||||
_tutorial = new TutorialManager(plugin, clientManager, donationManager, chat, hologramManager, _npcManager, _taskManager);
|
||||
_itemMapManager = new ItemMapManager(this, _tutorial, _worldEvent);
|
||||
new TntGeneratorManager(plugin, this);
|
||||
new SupplyDropManager(plugin, this);
|
||||
|
||||
@ -299,7 +307,7 @@ public class ClansManager extends MiniClientPlugin<ClientClan>implements IRelati
|
||||
new ClanEnergyTracker(plugin, this);
|
||||
// new StuckManager(this);
|
||||
|
||||
new ClansBetaManager(this, taskManager);
|
||||
new ClansBetaManager(this, _taskManager);
|
||||
|
||||
new PotatoManager(plugin, this);
|
||||
|
||||
@ -325,7 +333,6 @@ public class ClansManager extends MiniClientPlugin<ClientClan>implements IRelati
|
||||
ServerCommandManager.getInstance().registerCommandType(ClanDeleteCommand.class, new ClanDeleteCommandHandler());
|
||||
ServerCommandManager.getInstance().registerCommandType(ClanLoadCommand.class, new ClanLoadCommandHandler());
|
||||
|
||||
StatsManager statsManager = new StatsManager(plugin, _clientManager);
|
||||
AchievementManager achievementManager = new AchievementManager(statsManager, _clientManager, donationManager);
|
||||
ClassShopManager shopManager = new ClassShopManager(plugin, _classManager, skillManager, itemFactory, achievementManager, _clientManager);
|
||||
_classShop = new ClassCombatShop(shopManager, _clientManager, donationManager, true, "Class Shop");
|
||||
@ -333,12 +340,10 @@ public class ClansManager extends MiniClientPlugin<ClientClan>implements IRelati
|
||||
new ClanEnergyManager(plugin, this, clientManager, donationManager);
|
||||
|
||||
_playTracker = new Playtime(this, statsManager);
|
||||
_pvpTimer = new PvpTimer(this, statsManager);
|
||||
|
||||
_tutorialManager = new mineplex.game.clans.legacytutorial.TutorialManager(plugin, _playTracker, _goldManager, taskManager, donationManager, preferencesManager, this, packetHandler);
|
||||
TutorialManager tutorial = new TutorialManager(plugin, clientManager, donationManager, chat);
|
||||
_legacyTutorial = new mineplex.game.clans.legacytutorial.TutorialManager(plugin, _playTracker, _goldManager, _taskManager, donationManager, preferencesManager, this, packetHandler);
|
||||
|
||||
_scoreboard = new ClansScoreboardManager(plugin, this, _warManager, _worldEvent, tutorial, clientManager, donationManager);
|
||||
_scoreboard = new ClansScoreboardManager(plugin, this, _warManager, _worldEvent, _tutorial, clientManager, donationManager);
|
||||
_clanDataAccess = new ClansDataAccessLayer(this, _scoreboard);
|
||||
|
||||
for (ClanToken token : _clanDataAccess.getRepository().retrieveClans())
|
||||
@ -357,30 +362,27 @@ public class ClansManager extends MiniClientPlugin<ClientClan>implements IRelati
|
||||
|
||||
List<Location> jumpOffHolograms = Arrays.asList(
|
||||
// West Spawn
|
||||
new Location(Spawn.getSpawnWorld(), -295.5, 204, 36.5),
|
||||
new Location(Spawn.getSpawnWorld(), -295.5, 204, -26.5),
|
||||
new Location(Spawn.getSpawnWorld(), -331.5, 204, 6.5),
|
||||
new Location(Spawn.getSpawnWorld(), -266.5, 204, 6.5),
|
||||
new Location(Spawn.getSpawnWorld(), 8, 200, 359),
|
||||
new Location(Spawn.getSpawnWorld(), 34, 200, 390),
|
||||
new Location(Spawn.getSpawnWorld(), 8, 200, 418),
|
||||
new Location(Spawn.getSpawnWorld(), -25, 200, 390),
|
||||
|
||||
// East Spawn
|
||||
new Location(Spawn.getSpawnWorld(), 304.5, 207, -26.5),
|
||||
new Location(Spawn.getSpawnWorld(), 332.5, 207, 6.5),
|
||||
new Location(Spawn.getSpawnWorld(), 304.5, 207, 36.5),
|
||||
new Location(Spawn.getSpawnWorld(), 268.5, 207, 6.5)
|
||||
new Location(Spawn.getSpawnWorld(), 34, 200, -393),
|
||||
new Location(Spawn.getSpawnWorld(), 8, 200, -365),
|
||||
new Location(Spawn.getSpawnWorld(), -25, 200, -393),
|
||||
new Location(Spawn.getSpawnWorld(), 8, 200, -424)
|
||||
);
|
||||
|
||||
List<Location> welcomeHolograms = Arrays.asList(
|
||||
// West Spawn
|
||||
new Location(Spawn.getSpawnWorld(), -304.5, 204, 6.5),
|
||||
new Location(Spawn.getSpawnWorld(), -295.5, 204, 15.5),
|
||||
new Location(Spawn.getSpawnWorld(), -286.5, 204, 6.5),
|
||||
new Location(Spawn.getSpawnWorld(), -295.5, 204, -2.5),
|
||||
|
||||
// East Spawn
|
||||
new Location(Spawn.getSpawnWorld(), 295.5, 207, 6.5),
|
||||
new Location(Spawn.getSpawnWorld(), 304.5, 207, -2.5),
|
||||
new Location(Spawn.getSpawnWorld(), 313.5, 207, 6.5),
|
||||
new Location(Spawn.getSpawnWorld(), 304.5, 207, 15.5)
|
||||
new Location(Spawn.getSpawnWorld(), 17, 200, 390),
|
||||
new Location(Spawn.getSpawnWorld(), 8, 200, 399),
|
||||
new Location(Spawn.getSpawnWorld(), 0, 200, 390),
|
||||
new Location(Spawn.getSpawnWorld(), 8, 200, 381),
|
||||
new Location(Spawn.getSpawnWorld(), 8, 200, -384),
|
||||
new Location(Spawn.getSpawnWorld(), 0, 200, -393),
|
||||
new Location(Spawn.getSpawnWorld(), 8, 200, -402),
|
||||
new Location(Spawn.getSpawnWorld(), 17, 200, -393)
|
||||
);
|
||||
|
||||
for (Location location : jumpOffHolograms)
|
||||
@ -403,7 +405,7 @@ public class ClansManager extends MiniClientPlugin<ClientClan>implements IRelati
|
||||
|
||||
Bukkit.getMessenger().registerOutgoingPluginChannel(plugin, "Replay|Restrict");
|
||||
|
||||
new SiegeManager(this);
|
||||
_siegeManager = new SiegeManager(this);
|
||||
// _netherManager = new NetherManager(this);
|
||||
}
|
||||
|
||||
@ -438,9 +440,14 @@ public class ClansManager extends MiniClientPlugin<ClientClan>implements IRelati
|
||||
return _disguiseManager;
|
||||
}
|
||||
|
||||
public mineplex.game.clans.legacytutorial.TutorialManager getTutorials()
|
||||
public mineplex.game.clans.legacytutorial.TutorialManager getLegacyTutorial()
|
||||
{
|
||||
return _tutorialManager;
|
||||
return _legacyTutorial;
|
||||
}
|
||||
|
||||
public TutorialManager getTutorial()
|
||||
{
|
||||
return _tutorial;
|
||||
}
|
||||
|
||||
public NpcManager getNPCManager()
|
||||
@ -587,51 +594,100 @@ public class ClansManager extends MiniClientPlugin<ClientClan>implements IRelati
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.LOWEST)
|
||||
@EventHandler(priority = EventPriority.HIGHEST)
|
||||
public void Join(PlayerJoinEvent event)
|
||||
{
|
||||
if (IncognitoManager.Instance.Get(event.getPlayer()).Status)
|
||||
{
|
||||
event.setJoinMessage(null);
|
||||
|
||||
/*if (_clansBans.willBeKicked(event.getPlayer()))
|
||||
{
|
||||
return;
|
||||
}*/
|
||||
|
||||
if (_incognitoManager.Get(event.getPlayer()).Status)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (event.getJoinMessage() != null)
|
||||
/*_clansBans.runAfterLoad(event.getPlayer().getName(), () -> {
|
||||
if (_clansBans.Get(event.getPlayer().getName()).isBanned())
|
||||
{
|
||||
event.setJoinMessage(null);
|
||||
UtilServer.broadcast(F.sys("Join", event.getPlayer().getName()));
|
||||
}
|
||||
return;
|
||||
}*/
|
||||
|
||||
for (Player other : UtilServer.getPlayers())
|
||||
{
|
||||
if (_tutorial.inTutorial(other))
|
||||
{
|
||||
// Don't display join message if player in tutorial.
|
||||
continue;
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.LOWEST)
|
||||
other.sendMessage(F.sys("Join", event.getPlayer().getName()));
|
||||
}
|
||||
/*});*/
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGHEST)
|
||||
public void Quit(PlayerQuitEvent event)
|
||||
{
|
||||
if (IncognitoManager.Instance.Get(event.getPlayer()).Status)
|
||||
{
|
||||
event.setQuitMessage(null);
|
||||
|
||||
if (_incognitoManager.Get(event.getPlayer()).Status)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (event.getQuitMessage() != null)
|
||||
/*if (_clansBans.willBeKicked(event.getPlayer()))
|
||||
{
|
||||
event.setQuitMessage(null);
|
||||
UtilServer.broadcast(F.sys("Quit", event.getPlayer().getName()));
|
||||
return;
|
||||
}*/
|
||||
|
||||
for (Player other : UtilServer.getPlayers())
|
||||
{
|
||||
if (_tutorial.inTutorial(other))
|
||||
{
|
||||
// Don't display quit message if player in tutorial.
|
||||
continue;
|
||||
}
|
||||
|
||||
other.sendMessage(F.sys("Quit", event.getPlayer().getName()));
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.LOWEST)
|
||||
@EventHandler(priority = EventPriority.HIGHEST)
|
||||
public void Kick(PlayerKickEvent event)
|
||||
{
|
||||
if (IncognitoManager.Instance.Get(event.getPlayer()).Status)
|
||||
if (_incognitoManager.Get(event.getPlayer()).Status)
|
||||
{
|
||||
event.setLeaveMessage(null);
|
||||
return;
|
||||
}
|
||||
|
||||
/*if (_clansBans.willBeKicked(event.getPlayer()))
|
||||
{
|
||||
return;
|
||||
}*/
|
||||
|
||||
if (event.getReason().contains("You are banned from Clans"))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (event.getLeaveMessage() != null)
|
||||
{
|
||||
event.setLeaveMessage(null);
|
||||
UtilServer.broadcast(F.sys("Quit", event.getPlayer().getName()));
|
||||
|
||||
for (Player other : UtilServer.getPlayers())
|
||||
{
|
||||
if (_tutorial.inTutorial(other))
|
||||
{
|
||||
// Don't display leave message if player in tutorial.
|
||||
continue;
|
||||
}
|
||||
|
||||
other.sendMessage(F.sys("Leave", event.getPlayer().getName()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -672,7 +728,7 @@ public class ClansManager extends MiniClientPlugin<ClientClan>implements IRelati
|
||||
clanInfo.playerOnline(player);
|
||||
}
|
||||
|
||||
if (_clientManager.hasRank(player, Rank.DEVELOPER) || player.getUniqueId().toString().equals("d8646a35-33a8-43c6-9e7c-2e871a6b86c9"))
|
||||
if (_clientManager.hasRank(player, Rank.DEVELOPER))
|
||||
{
|
||||
player.setOp(true);
|
||||
}
|
||||
@ -799,8 +855,13 @@ public class ClansManager extends MiniClientPlugin<ClientClan>implements IRelati
|
||||
|
||||
List<Player> recipients = new ArrayList<>();
|
||||
|
||||
for (Player other : UtilServer.getPlayers())
|
||||
String message = event.getMessage();//_chat.getFilteredMessage(event.getPlayer(), event.getMessage());
|
||||
|
||||
for (Player other : event.getRecipients())
|
||||
{
|
||||
if (_tutorial.inTutorial(other))
|
||||
continue;
|
||||
|
||||
ClanInfo otherClan = _clanUtility.getClanByPlayer(other);
|
||||
|
||||
if (otherClan == null)
|
||||
@ -809,14 +870,12 @@ public class ClansManager extends MiniClientPlugin<ClientClan>implements IRelati
|
||||
}
|
||||
else
|
||||
{
|
||||
String message = _chat.getFilteredMessage(event.getPlayer(), event.getMessage());
|
||||
ClanRelation rel = _clanUtility.rel(clan, otherClan);
|
||||
|
||||
other.sendMessage(rank + rel.getColor(true) + clan.getName() + " " + rel.getColor(false) + event.getPlayer().getName() + " " + C.cWhite + message);
|
||||
}
|
||||
}
|
||||
|
||||
recipients.forEach(p -> p.sendMessage(String.format(rank + C.cGold + clan.getName() + " " + C.cYellow + "%s " + C.cWhite + "%s", event.getPlayer().getName(), event.getMessage())));
|
||||
recipients.forEach(p -> p.sendMessage(String.format(rank + C.cGold + clan.getName() + " " + C.cYellow + "%s " + C.cWhite + "%s", event.getPlayer().getName(), message)));
|
||||
|
||||
recipients.clear();
|
||||
}
|
||||
@ -1142,22 +1201,36 @@ public class ClansManager extends MiniClientPlugin<ClientClan>implements IRelati
|
||||
@EventHandler(priority = EventPriority.HIGHEST)
|
||||
public void onJoin(PlayerLoginEvent event)
|
||||
{
|
||||
if (true)
|
||||
Rank rank = _clientManager.Get(event.getPlayer()).GetRank();
|
||||
|
||||
if (rank.has(Rank.HELPER))
|
||||
{
|
||||
event.allow();
|
||||
event.setResult(PlayerLoginEvent.Result.ALLOWED);
|
||||
return;
|
||||
}
|
||||
|
||||
Rank rank = _clientManager.Get(event.getPlayer()).GetRank();
|
||||
if (!event.getPlayer().isOp() && !event.getPlayer().isWhitelisted() && !rank.has(Rank.LEGEND))
|
||||
int online = 0;
|
||||
|
||||
for (Player player : UtilServer.getPlayers())
|
||||
{
|
||||
event.disallow(PlayerLoginEvent.Result.KICK_OTHER, "Clans is currently in Legend+ only Alpha!");
|
||||
// event.setKickMessage("This server is whitelisted!");
|
||||
event.setKickMessage("Clans is currently in Legend+ only Alpha!");
|
||||
if (_clientManager.hasRank(player, Rank.HELPER))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
else if (UtilServer.getPlayers().length >= UtilServer.getServer().getMaxPlayers() && !rank.has(Rank.ADMIN) && !event.getPlayer().isWhitelisted() && !event.getPlayer().isOp())
|
||||
|
||||
online++;
|
||||
}
|
||||
|
||||
if (online >= UtilServer.getServer().getMaxPlayers() && !rank.has(Rank.ADMIN) && !event.getPlayer().isWhitelisted() && !event.getPlayer().isOp())
|
||||
{
|
||||
event.disallow(PlayerLoginEvent.Result.KICK_OTHER, "Clans Alpha is full! Try again soon");
|
||||
event.setKickMessage("Clans Alpha is full! Try again soon");
|
||||
event.disallow(PlayerLoginEvent.Result.KICK_OTHER, "Clans Beta is full! Try again soon");
|
||||
event.setKickMessage("Clans Beta is full! Try again soon");
|
||||
}
|
||||
else
|
||||
{
|
||||
event.allow();
|
||||
event.setResult(PlayerLoginEvent.Result.ALLOWED);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1228,6 +1301,14 @@ public class ClansManager extends MiniClientPlugin<ClientClan>implements IRelati
|
||||
@EventHandler(priority = EventPriority.HIGH)
|
||||
public void handleClansDeath(PlayerDeathEvent event)
|
||||
{
|
||||
event.setDeathMessage(null);
|
||||
|
||||
for(Player player : UtilServer.getPlayers())
|
||||
{
|
||||
if(!_tutorial.inTutorial(player))
|
||||
player.sendMessage(event.getDeathMessage());
|
||||
}
|
||||
|
||||
PlayerClan playerClan;
|
||||
PlayerClan killerClan = null;
|
||||
|
||||
@ -1289,20 +1370,28 @@ public class ClansManager extends MiniClientPlugin<ClientClan>implements IRelati
|
||||
UtilPlayer.message(player, F.main("Clans", message));
|
||||
}
|
||||
|
||||
public boolean masterBypass(Player player)
|
||||
{
|
||||
return player.getName().equals("NewGarbo");
|
||||
}
|
||||
|
||||
public DamageManager getDamageManager()
|
||||
{
|
||||
return _damageManager;
|
||||
}
|
||||
|
||||
public PvpTimer getPvpTimer() { return _pvpTimer; }
|
||||
public boolean hasTimer(Player player)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public ClansBlacklist getBlacklist()
|
||||
{
|
||||
return _blacklist;
|
||||
}
|
||||
|
||||
public SiegeManager getSiegeManager()
|
||||
{
|
||||
return _siegeManager;
|
||||
}
|
||||
|
||||
public IncognitoManager getIncognitoManager()
|
||||
{
|
||||
return _incognitoManager;
|
||||
}
|
||||
}
|
||||
|
@ -557,7 +557,7 @@ public class ClansUtility
|
||||
|
||||
public boolean isBorderlands(Location loc)
|
||||
{
|
||||
return Math.abs(loc.getBlockX()) > ClansManager.CLAIMABLE_RADIUS || Math.abs(loc.getBlockZ()) > ClansManager.CLAIMABLE_RADIUS;
|
||||
return (Math.abs(loc.getBlockX()) > ClansManager.CLAIMABLE_RADIUS || Math.abs(loc.getBlockZ()) > ClansManager.CLAIMABLE_RADIUS) && loc.getWorld().getName().equalsIgnoreCase("world");
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1,5 +1,8 @@
|
||||
package mineplex.game.clans.clans.ban;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@ -10,8 +13,6 @@ import org.bukkit.Bukkit;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.player.AsyncPlayerPreLoginEvent;
|
||||
import org.bukkit.event.player.AsyncPlayerPreLoginEvent.Result;
|
||||
import org.bukkit.event.player.PlayerKickEvent;
|
||||
import org.bukkit.event.player.PlayerQuitEvent;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
@ -20,25 +21,32 @@ import com.google.common.collect.Lists;
|
||||
|
||||
import mineplex.core.MiniPlugin;
|
||||
import mineplex.core.account.CoreClientManager;
|
||||
import mineplex.core.account.ILoginProcessor;
|
||||
import mineplex.core.common.DefaultHashMap;
|
||||
import mineplex.core.common.Pair;
|
||||
import mineplex.core.common.util.C;
|
||||
import mineplex.core.common.util.Callback;
|
||||
import mineplex.core.common.util.UtilPlayer;
|
||||
import mineplex.core.common.util.UtilTime;
|
||||
import mineplex.core.common.util.UtilTime.TimeUnit;
|
||||
import mineplex.core.donation.DonationManager;
|
||||
import mineplex.core.updater.UpdateType;
|
||||
import mineplex.core.updater.event.UpdateEvent;
|
||||
import mineplex.game.clans.clans.ClansManager;
|
||||
import mineplex.game.clans.clans.ban.commands.ClansBanCommand;
|
||||
import mineplex.game.clans.clans.ban.ui.ClansBanShop;
|
||||
|
||||
public class ClansBanManager extends MiniPlugin
|
||||
public class ClansBanManager extends MiniPlugin implements ILoginProcessor
|
||||
{
|
||||
private CoreClientManager _clientManager;
|
||||
private ClansBanRepository _repository;
|
||||
private Map<String, ClansBanClient> _clients;
|
||||
private Map<String, Pair<String, String>> _cache;
|
||||
private DefaultHashMap<String, List<Runnable>> _runAfterLoad;
|
||||
private ClansBanShop _shop;
|
||||
|
||||
private Map<String, String> _toKick = new HashMap<>();
|
||||
|
||||
private Object _lock = new Object();
|
||||
|
||||
public ClansBanManager(JavaPlugin plugin, CoreClientManager clientManager, DonationManager donationManager)
|
||||
@ -51,8 +59,10 @@ public class ClansBanManager extends MiniPlugin
|
||||
|
||||
_clients = new HashMap<>();
|
||||
_cache = new HashMap<>();
|
||||
|
||||
_runAfterLoad = new DefaultHashMap<>(name -> new ArrayList<>());
|
||||
_shop = new ClansBanShop(this, clientManager, donationManager);
|
||||
|
||||
clientManager.addStoredProcedureLoginProcessor(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -64,6 +74,20 @@ public class ClansBanManager extends MiniPlugin
|
||||
@EventHandler
|
||||
public void clearOldClients(UpdateEvent event)
|
||||
{
|
||||
if (event.getType().equals(UpdateType.SEC))
|
||||
{
|
||||
_toKick.forEach((name, reason) -> {
|
||||
Player player = UtilPlayer.searchExact(name);
|
||||
|
||||
if (player == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
player.kickPlayer(reason);
|
||||
});
|
||||
}
|
||||
|
||||
if (!event.getType().equals(UpdateType.MIN_01))
|
||||
{
|
||||
return;
|
||||
@ -96,26 +120,6 @@ public class ClansBanManager extends MiniPlugin
|
||||
return _repository;
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onPlayerJoin(AsyncPlayerPreLoginEvent event)
|
||||
{
|
||||
LoadClient(event.getName(), client -> {
|
||||
if (client.isBanned())
|
||||
{
|
||||
String time = UtilTime.convertString(client.getLongestBan().getTimeLeft(), 0, TimeUnit.FIT);
|
||||
|
||||
if (client.getLongestBan().isPermanent())
|
||||
time = "Permanent";
|
||||
|
||||
String reason = C.cRedB + "You are banned from Clans for " + time +
|
||||
"\n" + C.cWhite + client.getLongestBan().getReason();
|
||||
|
||||
event.disallow(Result.KICK_BANNED, reason);
|
||||
event.setKickMessage(reason);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.LOWEST)
|
||||
public void onPlayerQuit(PlayerQuitEvent event)
|
||||
{
|
||||
@ -229,4 +233,50 @@ public class ClansBanManager extends MiniPlugin
|
||||
|
||||
LoadClient(name, callback);
|
||||
}
|
||||
|
||||
public boolean willBeKicked(Player player)
|
||||
{
|
||||
return _toKick.containsKey(player.getName());
|
||||
}
|
||||
|
||||
public void processLoginResultSet(String playerName, int accountId, ResultSet resultSet) throws SQLException
|
||||
{
|
||||
_repository.loadBans(playerName, client -> {
|
||||
if (client.isBanned())
|
||||
{
|
||||
String time = UtilTime.convertString(client.getLongestBan().getTimeLeft(), 0, TimeUnit.FIT);
|
||||
|
||||
if (client.getLongestBan().isPermanent())
|
||||
time = "Permanent";
|
||||
|
||||
String reason = C.cRedB + "You are banned from Clans for " + time +
|
||||
"\n" + C.cWhite + client.getLongestBan().getReason();
|
||||
|
||||
_toKick.put(playerName, reason);
|
||||
|
||||
ClansManager.getInstance().runSyncLater(() -> {
|
||||
if (Bukkit.getPlayer(playerName) != null)
|
||||
{
|
||||
Bukkit.getPlayer(playerName).kickPlayer(_toKick.remove(playerName));
|
||||
}
|
||||
else
|
||||
{
|
||||
_runAfterLoad.get(playerName).forEach(Runnable::run);
|
||||
_runAfterLoad.get(playerName).clear();
|
||||
}
|
||||
}, 5L);
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public String getQuery(int accountId, String uuid, String name)
|
||||
{
|
||||
return "SELECT * FROM clanBans WHERE uuid = '" + uuid + "';";
|
||||
}
|
||||
|
||||
public void runAfterLoad(String playerName, Runnable run)
|
||||
{
|
||||
_runAfterLoad.get(playerName).add(run);
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
package mineplex.game.clans.clans.ban;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.Timestamp;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@ -47,15 +48,36 @@ public class ClansBanRepository extends MinecraftRepository
|
||||
|
||||
public void loadBans(final String name, final Callback<ClansBanClient> callback)
|
||||
{
|
||||
System.out.println(">> Attempting to load Clans Bans for \"" + name + "\"");
|
||||
loadClientByName(name, client -> {
|
||||
System.out.println("> Successfully loaded CoreClient");
|
||||
|
||||
String uuid = UUIDFetcher.getUUIDOf(client.GetPlayerName()).toString();
|
||||
|
||||
executeQuery(GET_ALL_BANS, resultSet -> {
|
||||
System.out.println("> Successfully executed query, result set object: " + resultSet);
|
||||
final List<ClansBan> list = new ArrayList<ClansBan>();
|
||||
|
||||
while (resultSet.next())
|
||||
{
|
||||
int id = resultSet.getInt(1);
|
||||
String ruuid = resultSet.getString(2);
|
||||
String admin = resultSet.getString(3);
|
||||
String reason = resultSet.getString(4);
|
||||
Timestamp banTime = resultSet.getTimestamp(5);
|
||||
Timestamp unbanTime = resultSet.getTimestamp(6);
|
||||
boolean permanent = resultSet.getBoolean(7);
|
||||
boolean removed = resultSet.getBoolean(8);
|
||||
|
||||
list.add(new ClansBan(id, UUID.fromString(ruuid), admin, reason, banTime, unbanTime, permanent, removed));
|
||||
}
|
||||
|
||||
callback.run(new ClansBanClient(uuid, list));
|
||||
|
||||
}, new ColumnVarChar("uuid", 36, uuid));
|
||||
});
|
||||
}
|
||||
|
||||
public void loadBans(final String name, final String uuid, final ResultSet resultSet, final Callback<ClansBanClient> callback)
|
||||
{
|
||||
try
|
||||
{
|
||||
final List<ClansBan> list = new ArrayList<ClansBan>();
|
||||
|
||||
while (resultSet.next())
|
||||
@ -78,8 +100,11 @@ public class ClansBanRepository extends MinecraftRepository
|
||||
|
||||
System.out.println("> Successfully handled result");
|
||||
System.out.println(">> FINISH");
|
||||
}, new ColumnVarChar("uuid", 36, uuid));
|
||||
});
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
exception.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
private void loadClientByName(String name, Callback<CoreClient> client)
|
||||
|
@ -37,6 +37,7 @@ import mineplex.game.clans.clans.ClansManager;
|
||||
import mineplex.game.clans.clans.ClientClan;
|
||||
import mineplex.game.clans.clans.event.ClanJoinEvent;
|
||||
import mineplex.game.clans.clans.event.ClansCommandExecutedEvent;
|
||||
import mineplex.game.clans.clans.event.ClansCommandPreExecutedEvent;
|
||||
import mineplex.game.clans.core.repository.ClanTerritory;
|
||||
import mineplex.game.clans.spawn.Spawn;
|
||||
import net.minecraft.server.v1_8_R3.EnumDirection;
|
||||
@ -54,6 +55,9 @@ public class ClansCommand extends CommandBase<ClansManager>
|
||||
@Override
|
||||
public void Execute(Player caller, String[] args)
|
||||
{
|
||||
if (UtilServer.CallEvent(new ClansCommandPreExecutedEvent(caller, args)).isCancelled())
|
||||
return;
|
||||
|
||||
if (args == null || args.length == 0)
|
||||
{
|
||||
_clansManager.getClanShop().attemptShopOpen(caller);
|
||||
@ -105,10 +109,6 @@ public class ClansCommand extends CommandBase<ClansManager>
|
||||
|
||||
else if (args[0].equalsIgnoreCase("unclaim") || args[0].equalsIgnoreCase("uc"))
|
||||
unclaim(caller, args);
|
||||
|
||||
else if (args[0].equalsIgnoreCase("map") || args[0].equalsIgnoreCase("m"))
|
||||
map(caller, args);
|
||||
|
||||
else if (args[0].equalsIgnoreCase("home") || args[0].equalsIgnoreCase("h"))
|
||||
home(caller, args);
|
||||
|
||||
@ -138,7 +138,7 @@ public class ClansCommand extends CommandBase<ClansManager>
|
||||
|
||||
private void forceJoin(Player caller, String[] args)
|
||||
{
|
||||
if (!Plugin.getClientManager().hasRank(caller, Rank.ADMIN) && !caller.getUniqueId().toString().equals("d8646a35-33a8-43c6-9e7c-2e871a6b86c9") /* My UUID (NewGarbo) */)
|
||||
if (!Plugin.getClientManager().hasRank(caller, Rank.ADMIN))
|
||||
{
|
||||
UtilPlayer.message(caller, F.main("Clans", "This requires ADMIN+ permission."));
|
||||
return;
|
||||
@ -219,7 +219,6 @@ public class ClansCommand extends CommandBase<ClansManager>
|
||||
UtilPlayer.message(caller, F.help("/c create <clan>", "Create new Clan", Rank.ALL));
|
||||
UtilPlayer.message(caller, F.help("/c join <clan>", "Join a Clan", Rank.ALL));
|
||||
UtilPlayer.message(caller, F.help("/c leave <clan>", "Leave your Clan", Rank.ALL));
|
||||
UtilPlayer.message(caller, F.help("/c map <toggle>", "View Clan Map", Rank.ALL));
|
||||
UtilPlayer.message(caller, F.help("/cc (Message)", "Clan Chat (Toggle)", Rank.ALL));
|
||||
|
||||
UtilPlayer.message(caller, F.help("/c stuck", "Teleports you to the nearest Wilderness location", Rank.ALL));
|
||||
@ -358,7 +357,7 @@ public class ClansCommand extends CommandBase<ClansManager>
|
||||
}
|
||||
|
||||
Player target = UtilPlayer.searchOnline(caller, args[1], true);
|
||||
if (target == null || IncognitoManager.Instance.Get(target).Status) return;
|
||||
if (target == null || _clansManager.getIncognitoManager().Get(target).Status) return;
|
||||
|
||||
Plugin.getClanUtility().invite(caller, clan, target);
|
||||
}
|
||||
|
@ -0,0 +1,58 @@
|
||||
package mineplex.game.clans.clans.event;
|
||||
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.Event;
|
||||
import org.bukkit.event.HandlerList;
|
||||
|
||||
/**
|
||||
* Called before an iron door is opened by right clicking.
|
||||
*
|
||||
* (Custom mechanic in Clans)
|
||||
*/
|
||||
public class IronDoorOpenEvent extends Event
|
||||
{
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
|
||||
private Player _player;
|
||||
private Block _block;
|
||||
|
||||
private boolean _cancelled;
|
||||
|
||||
public IronDoorOpenEvent(Player player, Block block)
|
||||
{
|
||||
_player = player;
|
||||
_block = block;
|
||||
}
|
||||
|
||||
public Player getPlayer()
|
||||
{
|
||||
return _player;
|
||||
}
|
||||
|
||||
public Block getBlock()
|
||||
{
|
||||
return _block;
|
||||
}
|
||||
|
||||
public void setCancelled(boolean cancelled)
|
||||
{
|
||||
_cancelled = cancelled;
|
||||
}
|
||||
|
||||
public boolean isCancelled()
|
||||
{
|
||||
return _cancelled;
|
||||
}
|
||||
|
||||
public HandlerList getHandlers()
|
||||
{
|
||||
return handlers;
|
||||
}
|
||||
|
||||
public static HandlerList getHandlerList()
|
||||
{
|
||||
return handlers;
|
||||
}
|
||||
|
||||
}
|
@ -22,6 +22,7 @@ public class PlayerEnterTerritoryEvent extends Event
|
||||
_lastTerritory = lastTerritory;
|
||||
_newTerritory = newTerritory;
|
||||
_safe = safe;
|
||||
_sendMessage = sendMessage;
|
||||
}
|
||||
|
||||
public Player getPlayer()
|
||||
|
@ -1,5 +1,7 @@
|
||||
package mineplex.game.clans.clans.gui.button;
|
||||
|
||||
import mineplex.core.common.util.UtilServer;
|
||||
import mineplex.game.clans.clans.gui.events.ClansButtonClickEvent;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.inventory.ClickType;
|
||||
|
||||
@ -13,8 +15,10 @@ public class ClanAddAllyButton implements IButton
|
||||
@Override
|
||||
public void onClick(Player player, ClickType clickType)
|
||||
{
|
||||
player.closeInventory();
|
||||
if (UtilServer.CallEvent(new ClansButtonClickEvent(player, ClansButtonClickEvent.ButtonType.AddAlly)).isCancelled())
|
||||
return;
|
||||
|
||||
player.closeInventory();
|
||||
JsonMessage message = new JsonMessage(C.cRed + C.Bold + "Click here to add an Ally").click(ClickEvent.SUGGEST_COMMAND, "/c ally ");
|
||||
message.sendToPlayer(player);
|
||||
}
|
||||
|
@ -1,5 +1,7 @@
|
||||
package mineplex.game.clans.clans.gui.button;
|
||||
|
||||
import mineplex.core.common.util.UtilServer;
|
||||
import mineplex.game.clans.clans.gui.events.ClansButtonClickEvent;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.inventory.ClickType;
|
||||
|
||||
@ -13,6 +15,9 @@ public class ClanAddTrustedButton implements IButton
|
||||
@Override
|
||||
public void onClick(Player player, ClickType clickType)
|
||||
{
|
||||
if (UtilServer.CallEvent(new ClansButtonClickEvent(player, ClansButtonClickEvent.ButtonType.AddTrusted)).isCancelled())
|
||||
return;
|
||||
|
||||
player.closeInventory();
|
||||
|
||||
JsonMessage message = new JsonMessage(C.cRed + C.Bold + "Click here to trust a clan").click(ClickEvent.SUGGEST_COMMAND, "/c trust ");
|
||||
|
@ -1,5 +1,7 @@
|
||||
package mineplex.game.clans.clans.gui.button;
|
||||
|
||||
import mineplex.core.common.util.UtilServer;
|
||||
import mineplex.game.clans.clans.gui.events.ClansButtonClickEvent;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.inventory.ClickType;
|
||||
|
||||
@ -13,6 +15,8 @@ public class ClanAddWarButton implements IButton
|
||||
@Override
|
||||
public void onClick(Player player, ClickType clickType)
|
||||
{
|
||||
if (UtilServer.CallEvent(new ClansButtonClickEvent(player, ClansButtonClickEvent.ButtonType.AddWar)).isCancelled())
|
||||
return;
|
||||
player.closeInventory();
|
||||
|
||||
JsonMessage message = new JsonMessage(C.cRed + C.Bold + "Click here to war a clan").click(ClickEvent.SUGGEST_COMMAND, "/war ");
|
||||
|
@ -1,5 +1,7 @@
|
||||
package mineplex.game.clans.clans.gui.button;
|
||||
|
||||
import mineplex.core.common.util.UtilServer;
|
||||
import mineplex.game.clans.clans.gui.events.ClansButtonClickEvent;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.inventory.ClickType;
|
||||
|
||||
@ -18,9 +20,6 @@ public class ClanCreateButton implements IButton
|
||||
@Override
|
||||
public void onClick(Player player, ClickType clickType)
|
||||
{
|
||||
player.closeInventory();
|
||||
|
||||
JsonMessage message = new JsonMessage(C.cRed + C.Bold + "Click here to create a clan").click(ClickEvent.SUGGEST_COMMAND, "/c create ");
|
||||
message.sendToPlayer(player);
|
||||
UtilServer.CallEvent(new ClansButtonClickEvent(player, ClansButtonClickEvent.ButtonType.Create));
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,7 @@
|
||||
package mineplex.game.clans.clans.gui.button;
|
||||
|
||||
import mineplex.core.common.util.UtilServer;
|
||||
import mineplex.game.clans.clans.gui.events.ClansButtonClickEvent;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.inventory.ClickType;
|
||||
|
||||
@ -18,6 +20,8 @@ public class ClanDisbandButton extends ClanButton
|
||||
@Override
|
||||
public void onClick(Player player, ClickType clickType)
|
||||
{
|
||||
if (UtilServer.CallEvent(new ClansButtonClickEvent(player, ClansButtonClickEvent.ButtonType.Disband)).isCancelled())
|
||||
return;
|
||||
getPlayer().closeInventory();
|
||||
getClansManager().getClanUtility().delete(getPlayer());
|
||||
}
|
||||
|
@ -1,5 +1,7 @@
|
||||
package mineplex.game.clans.clans.gui.button;
|
||||
|
||||
import mineplex.core.common.util.UtilServer;
|
||||
import mineplex.game.clans.clans.gui.events.ClansButtonClickEvent;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.inventory.ClickType;
|
||||
|
||||
@ -18,6 +20,6 @@ public class ClanEnergyButton extends ClanButton
|
||||
@Override
|
||||
public void onClick(Player player, ClickType clickType)
|
||||
{
|
||||
|
||||
UtilServer.CallEvent(new ClansButtonClickEvent(player, ClansButtonClickEvent.ButtonType.Energy));
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,7 @@
|
||||
package mineplex.game.clans.clans.gui.button;
|
||||
|
||||
import mineplex.core.common.util.UtilServer;
|
||||
import mineplex.game.clans.clans.gui.events.ClansButtonClickEvent;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.inventory.ClickType;
|
||||
|
||||
@ -23,6 +25,8 @@ public class ClanInviteButton extends ClanButton
|
||||
@Override
|
||||
public void onClick(Player player, ClickType clickType)
|
||||
{
|
||||
if (UtilServer.CallEvent(new ClansButtonClickEvent(player, ClansButtonClickEvent.ButtonType.Invite)).isCancelled())
|
||||
return;
|
||||
getShop().openPageForPlayer(getPlayer(), new ClanInvitePage(getClansManager(), getShop(), getClansManager().getClientManager(), _donationManager, player));
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,7 @@
|
||||
package mineplex.game.clans.clans.gui.button;
|
||||
|
||||
import mineplex.core.common.util.UtilServer;
|
||||
import mineplex.game.clans.clans.gui.events.ClansButtonClickEvent;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.inventory.ClickType;
|
||||
|
||||
@ -21,6 +23,8 @@ public class ClanJoinButton implements IButton
|
||||
@Override
|
||||
public void onClick(Player player, ClickType clickType)
|
||||
{
|
||||
if (UtilServer.CallEvent(new ClansButtonClickEvent(player, ClansButtonClickEvent.ButtonType.Join)).isCancelled())
|
||||
return;
|
||||
player.closeInventory();
|
||||
_clansManager.getClanUtility().join(player, _clanInfo);
|
||||
}
|
||||
|
@ -1,5 +1,7 @@
|
||||
package mineplex.game.clans.clans.gui.button;
|
||||
|
||||
import mineplex.core.common.util.UtilServer;
|
||||
import mineplex.game.clans.clans.gui.events.ClansButtonClickEvent;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.inventory.ClickType;
|
||||
|
||||
@ -18,7 +20,22 @@ public class ClanLeaveButton extends ClanButton
|
||||
@Override
|
||||
public void onClick(Player player, ClickType clickType)
|
||||
{
|
||||
if(clickType.equals(ClickType.SHIFT_RIGHT)) //disband
|
||||
{
|
||||
if (UtilServer.CallEvent(new ClansButtonClickEvent(player, ClansButtonClickEvent.ButtonType.Disband)).isCancelled())
|
||||
return;
|
||||
|
||||
getPlayer().closeInventory();
|
||||
getClansManager().getClanUtility().delete(getPlayer());
|
||||
|
||||
}else if(clickType.equals(ClickType.SHIFT_LEFT)) //leave
|
||||
{
|
||||
if (UtilServer.CallEvent(new ClansButtonClickEvent(player, ClansButtonClickEvent.ButtonType.Leave)).isCancelled())
|
||||
return;
|
||||
|
||||
getPlayer().closeInventory();
|
||||
getClansManager().getClanUtility().leave(getPlayer());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,7 @@
|
||||
package mineplex.game.clans.clans.gui.button;
|
||||
|
||||
import mineplex.core.common.util.UtilServer;
|
||||
import mineplex.game.clans.clans.gui.events.ClansButtonClickEvent;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.inventory.ClickType;
|
||||
|
||||
@ -24,6 +26,8 @@ public class ClanMemeberButton extends ClanButton
|
||||
@Override
|
||||
public void onClick(Player player, ClickType clickType)
|
||||
{
|
||||
if (UtilServer.CallEvent(new ClansButtonClickEvent(player, ClansButtonClickEvent.ButtonType.Member)).isCancelled())
|
||||
return;
|
||||
if (clickType == ClickType.LEFT)
|
||||
{
|
||||
// Promote
|
||||
|
@ -1,5 +1,7 @@
|
||||
package mineplex.game.clans.clans.gui.button;
|
||||
|
||||
import mineplex.core.common.util.UtilServer;
|
||||
import mineplex.game.clans.clans.gui.events.ClansButtonClickEvent;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Chunk;
|
||||
import org.bukkit.entity.Player;
|
||||
@ -23,6 +25,8 @@ public class ClanTerritoryButton extends ClanButton
|
||||
@Override
|
||||
public void onClick(Player player, ClickType clickType)
|
||||
{
|
||||
if (UtilServer.CallEvent(new ClansButtonClickEvent(player, ClansButtonClickEvent.ButtonType.Territory)).isCancelled())
|
||||
return;
|
||||
// if (_clansManager.getNetherManager().isInNether(player))
|
||||
// {
|
||||
// _clansManager.message(player, "You are not allowed to do anything with Territory while in " + F.clansNether("The Nether") + ".");
|
||||
|
@ -1,5 +1,7 @@
|
||||
package mineplex.game.clans.clans.gui.button;
|
||||
|
||||
import mineplex.core.common.util.UtilServer;
|
||||
import mineplex.game.clans.clans.gui.events.ClansButtonClickEvent;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.inventory.ClickType;
|
||||
|
||||
@ -13,6 +15,8 @@ public class ClanWhoButton implements IButton
|
||||
@Override
|
||||
public void onClick(Player player, ClickType clickType)
|
||||
{
|
||||
if (UtilServer.CallEvent(new ClansButtonClickEvent(player, ClansButtonClickEvent.ButtonType.Who)).isCancelled())
|
||||
return;
|
||||
player.closeInventory();
|
||||
|
||||
JsonMessage message = new JsonMessage(C.cRed + C.Bold + "Click here to lookup a clan").click(ClickEvent.SUGGEST_COMMAND, "/c who ");
|
||||
|
@ -52,7 +52,7 @@ public class ClanMainPage extends ClanPageBase
|
||||
public void buildNoClan()
|
||||
{
|
||||
// Clan Create
|
||||
ShopItem clanCreate = new ShopItem(Material.BOOK_AND_QUILL, "Create Clan", new String[] {}, 1, false, false);
|
||||
ShopItem clanCreate = new ShopItem(Material.BOOK_AND_QUILL, "Create Clan", new String[] {C.cGray + "To create a clan type", C.cRed + "/c create <ClanName>"}, 1, false, false);
|
||||
addButton(21, clanCreate, new ClanCreateButton());
|
||||
|
||||
// Clan Join
|
||||
|
@ -10,10 +10,10 @@ import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import mineplex.game.clans.tutorial.TutorialManager;
|
||||
import mineplex.game.clans.tutorial.map.TutorialMapManager;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Chunk;
|
||||
@ -34,6 +34,7 @@ import org.bukkit.event.player.PlayerInteractEvent;
|
||||
import org.bukkit.event.player.PlayerItemHeldEvent;
|
||||
import org.bukkit.event.player.PlayerJoinEvent;
|
||||
import org.bukkit.event.player.PlayerQuitEvent;
|
||||
import org.bukkit.event.player.PlayerTeleportEvent;
|
||||
import org.bukkit.inventory.Inventory;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.map.MapRenderer;
|
||||
@ -55,11 +56,11 @@ import mineplex.core.common.util.UtilTime;
|
||||
import mineplex.core.common.util.UtilTime.TimeUnit;
|
||||
import mineplex.core.itemstack.ItemBuilder;
|
||||
import mineplex.core.portal.ServerTransferEvent;
|
||||
import mineplex.core.timing.TimingManager;
|
||||
import mineplex.core.updater.UpdateType;
|
||||
import mineplex.core.updater.event.UpdateEvent;
|
||||
import mineplex.game.clans.clans.ClansManager;
|
||||
import mineplex.game.clans.clans.ClansUtility;
|
||||
import mineplex.game.clans.clans.map.events.PlayerGetMapEvent;
|
||||
import mineplex.game.clans.clans.worldevent.WorldEventManager;
|
||||
import net.minecraft.server.v1_8_R3.Block;
|
||||
import net.minecraft.server.v1_8_R3.BlockPosition;
|
||||
@ -83,13 +84,15 @@ public class ItemMapManager extends MiniPlugin
|
||||
private ArrayList<Entry<Integer, Integer>> _scanList = new ArrayList<Entry<Integer, Integer>>();
|
||||
private World _world;
|
||||
private WorldEventManager _eventManager;
|
||||
private TutorialManager _tutorial;
|
||||
|
||||
public ItemMapManager(ClansManager clansManager, WorldEventManager eventManager)
|
||||
public ItemMapManager(ClansManager clansManager, TutorialManager tutorial, WorldEventManager eventManager)
|
||||
{
|
||||
super("ItemMapManager", clansManager.getPlugin());
|
||||
|
||||
_clansUtility = clansManager.getClanUtility();
|
||||
_eventManager = eventManager;
|
||||
_tutorial = tutorial;
|
||||
|
||||
_comparator = new Comparator<Entry<Integer, Integer>>()
|
||||
{
|
||||
@ -244,7 +247,7 @@ public class ItemMapManager extends MiniPlugin
|
||||
view.removeRenderer(renderer);
|
||||
}
|
||||
|
||||
view.addRenderer(new ItemMapRenderer(this, _eventManager));
|
||||
view.addRenderer(new ItemMapRenderer(this, _eventManager, _tutorial));
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
@ -616,9 +619,25 @@ public class ItemMapManager extends MiniPlugin
|
||||
info.setInfo(1, calcMapCenter(zoom, loc.getBlockX()), calcMapCenter(zoom, loc.getBlockZ()));
|
||||
_mapInfo.put(player.getName(), info);
|
||||
|
||||
if (UtilInv.getItems(player).isEmpty())
|
||||
// if (UtilInv.getItems(player).isEmpty())
|
||||
// {
|
||||
// setMap(player);
|
||||
// }
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onWorldChange(PlayerTeleportEvent event)
|
||||
{
|
||||
setMap(player);
|
||||
if (event.getFrom().getWorld() != event.getTo().getWorld() && event.getTo().getWorld().equals("world"))
|
||||
{
|
||||
runSyncLater(new Runnable()
|
||||
{
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
setMap(event.getPlayer());
|
||||
}
|
||||
}, 20);
|
||||
}
|
||||
}
|
||||
|
||||
@ -746,6 +765,9 @@ public class ItemMapManager extends MiniPlugin
|
||||
Collections.sort(_scanList, _comparator);
|
||||
}
|
||||
|
||||
if (_scanList.isEmpty())
|
||||
return;
|
||||
|
||||
Entry<Integer, Integer> entry = _scanList.remove(0);
|
||||
|
||||
int startingX = entry.getKey();
|
||||
@ -866,6 +888,10 @@ public class ItemMapManager extends MiniPlugin
|
||||
|
||||
public void setMap(Player player)
|
||||
{
|
||||
PlayerGetMapEvent event = UtilServer.CallEvent(new PlayerGetMapEvent(player));
|
||||
if (event.isCancelled())
|
||||
return;
|
||||
|
||||
for (ItemStack item : UtilInv.getItems(player))
|
||||
{
|
||||
if (item.getType() == Material.MAP && (item.getDurability() >= _mapId && item.getDurability() <= _mapId + 100))
|
||||
|
@ -1,11 +1,18 @@
|
||||
package mineplex.game.clans.clans.map;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.util.List;
|
||||
|
||||
import mineplex.core.common.util.UtilTime;
|
||||
import mineplex.core.recharge.Recharge;
|
||||
import mineplex.game.clans.clans.ClanInfo;
|
||||
import mineplex.game.clans.clans.ClansUtility;
|
||||
import mineplex.game.clans.clans.worldevent.WorldEventManager;
|
||||
import mineplex.game.clans.tutorial.TutorialManager;
|
||||
import mineplex.game.clans.tutorial.TutorialRegion;
|
||||
import mineplex.game.clans.tutorial.TutorialType;
|
||||
import mineplex.game.clans.tutorial.map.TutorialMapManager;
|
||||
import mineplex.game.clans.tutorial.tutorials.clans.ClansMainTutorial;
|
||||
import mineplex.minecraft.game.core.boss.EventState;
|
||||
import mineplex.minecraft.game.core.boss.WorldEvent;
|
||||
|
||||
@ -22,18 +29,38 @@ import org.bukkit.map.MapView;
|
||||
public class ItemMapRenderer extends MapRenderer
|
||||
{
|
||||
private ItemMapManager _manager;
|
||||
private TutorialManager _tutorial;
|
||||
private WorldEventManager _eventManager;
|
||||
|
||||
public ItemMapRenderer(ItemMapManager itemMapManager, WorldEventManager eventManager)
|
||||
public ItemMapRenderer(ItemMapManager itemMapManager, WorldEventManager eventManager, TutorialManager tutorial)
|
||||
{
|
||||
super(true);
|
||||
|
||||
_manager = itemMapManager;
|
||||
_tutorial = tutorial;
|
||||
_eventManager = eventManager;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render(MapView mapView, MapCanvas canvas, Player player)
|
||||
{
|
||||
// if (_tutorial.inTutorial(player))
|
||||
// {
|
||||
// renderTutorialMap(mapView, canvas, player);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
renderNormalMap(mapView, canvas, player);
|
||||
// }
|
||||
}
|
||||
|
||||
private void renderTutorialMap(MapView mapView, MapCanvas canvas, Player player)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
private void renderNormalMap(MapView mapView, MapCanvas canvas, Player player)
|
||||
{
|
||||
MapInfo info = _manager.getMap(player);
|
||||
|
||||
@ -194,7 +221,6 @@ public class ItemMapRenderer extends MapRenderer
|
||||
}
|
||||
|
||||
|
||||
|
||||
//Inside
|
||||
else
|
||||
{
|
||||
|
@ -13,7 +13,6 @@ import mineplex.core.task.TaskManager;
|
||||
import mineplex.game.clans.clans.ClansManager;
|
||||
import mineplex.game.clans.clans.ClansPlayerStats;
|
||||
import mineplex.game.clans.clans.playtime.command.PlayTimeCommand;
|
||||
import mineplex.game.clans.clans.playtime.command.cemde;
|
||||
|
||||
public class Playtime extends MiniClientPlugin<PlayingClient>
|
||||
{
|
||||
|
@ -42,7 +42,7 @@ public class ClansRegions extends MiniPlugin
|
||||
public final static int SPAWN_RADIUS = 3; // Radius of spawn claim area (measured in chunks)
|
||||
public final static int SHOP_RADIUS = 5; // Radius of shop claim area (measured in chunks)
|
||||
public final static int FIELDS_RADIUS = 7; // Radius of fields claim area (measured in chunks)
|
||||
public final static int BORDERLANDS_RADIUS = 50; // Radius of borderlands claim area (measured in chunks)
|
||||
public final static int BORDERLANDS_RADIUS = 85; // Radius of borderlands claim area (measured in chunks)
|
||||
public static final int BORDER_RADIUS = 1319;
|
||||
|
||||
private ClansManager _manager;
|
||||
@ -69,7 +69,7 @@ public class ClansRegions extends MiniPlugin
|
||||
claimArea("Spawn", SPAWN_RADIUS, 0, false, true, new Location[] { Spawn.getNorthSpawn(), Spawn.getSouthSpawn() });
|
||||
|
||||
claimArea("Shops", 2, 0, true, false, new Location[]{Spawn.getWestTownCenter(), Spawn.getEastTownCenter()});
|
||||
claimArea("Shops", SHOP_RADIUS, 2, false, false, new Location[]{Spawn.getWestTownCenter(), Spawn.getEastTownCenter()});
|
||||
claimArea("Shops", SHOP_RADIUS, 3, false, false, new Location[]{Spawn.getWestTownCenter(), Spawn.getEastTownCenter()});
|
||||
|
||||
// Initialize Fields and Borderlands factions and claims
|
||||
claimArea("Fields", FIELDS_RADIUS, 0, false, true, worldCenter);
|
||||
@ -144,12 +144,8 @@ public class ClansRegions extends MiniPlugin
|
||||
{
|
||||
final ClanInfo clan = _manager.getClan(clanName);
|
||||
|
||||
// Only claim if the clan doesn't have claims. Speeds up startup time
|
||||
if (clan == null || clan.getClaimSet().size() == 0)
|
||||
if (clan == null)
|
||||
{
|
||||
if (clan != null)
|
||||
{
|
||||
_manager.getClanDataAccess().delete(clan, status -> {
|
||||
_manager.getClanDataAccess().create("ClansRegions", clanName, true, new Callback<ClanInfo>()
|
||||
{
|
||||
@Override
|
||||
@ -172,34 +168,14 @@ public class ClansRegions extends MiniPlugin
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
_manager.getClanDataAccess().create("ClansRegions", clanName, true, new Callback<ClanInfo>()
|
||||
{
|
||||
@Override
|
||||
public void run(ClanInfo data)
|
||||
{
|
||||
if (data != null)
|
||||
{
|
||||
for (Location location : locations)
|
||||
{
|
||||
claimArea(data, location, chunkRadius, claimOffset, addNegative, safe);
|
||||
log(String.format("Initialized %s faction territory and creation!", clanName));
|
||||
}
|
||||
|
||||
debugClan(clanName);
|
||||
}
|
||||
else
|
||||
{
|
||||
System.out.println("Clans Regions error!");
|
||||
System.out.println("Seek out help!");
|
||||
for (Location location : locations)
|
||||
{
|
||||
claimArea(clan, location, chunkRadius, claimOffset, addNegative, safe);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/*private void claimArea(String clanName, int chunkRadius, int claimOffset, boolean safe, Location... locations)
|
||||
|
@ -53,6 +53,7 @@ import mineplex.core.updater.UpdateType;
|
||||
import mineplex.core.updater.event.UpdateEvent;
|
||||
import mineplex.game.clans.clans.ClanInfo;
|
||||
import mineplex.game.clans.clans.event.ClansWaterPlaceEvent;
|
||||
import mineplex.game.clans.clans.event.IronDoorOpenEvent;
|
||||
import mineplex.game.clans.clans.event.PlayerClaimTerritoryEvent;
|
||||
import mineplex.game.clans.clans.siege.events.SiegeWeaponExplodeEvent;
|
||||
import mineplex.game.clans.clans.siege.outpost.build.OutpostBlock;
|
||||
@ -561,6 +562,22 @@ public class Outpost implements Listener
|
||||
_ownerClan.inform("Your Clan's Outpost has been destroyed.", null);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void doorOpen(IronDoorOpenEvent event)
|
||||
{
|
||||
if (!UtilAlg.inBoundingBox(event.getBlock().getLocation(), _startCorner.clone().subtract(.5, 0, .5), _endCorner))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (_ownerClan.isMember(event.getPlayer()))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
event.setCancelled(true);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onSiegeWeaponExplode(SiegeWeaponExplodeEvent event)
|
||||
{
|
||||
|
@ -162,15 +162,16 @@ public abstract class SiegeWeapon implements Listener
|
||||
_infoHologram = new Hologram(ClansManager.getInstance().getHologramManager(), _location.clone().add(.5, 3, .5), _name + " Health", getDisplayHealth());
|
||||
_infoHologram.start();
|
||||
|
||||
// _infoHologram.setInteraction((player, type) -> {
|
||||
// if (player.equals(_rider))
|
||||
// {
|
||||
// if (type.equals(ClickType.LEFT))
|
||||
// {
|
||||
// handleLeftClick(player);
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
_infoHologram.setInteraction((player, type) -> {
|
||||
if (type.equals(ClickType.LEFT))
|
||||
{
|
||||
handleLeftClick(player);
|
||||
}
|
||||
else if (type.equals(ClickType.RIGHT))
|
||||
{
|
||||
handleRightClick(player);
|
||||
}
|
||||
});
|
||||
|
||||
UtilServer.RegisterEvents(this);
|
||||
|
||||
|
@ -12,7 +12,7 @@ import mineplex.game.clans.clans.ClansManager;
|
||||
|
||||
public class TntGeneratorManager extends MiniPlugin
|
||||
{
|
||||
public static final int SECONDS_PER_TNT = 30;//60 * 60 * 10; // 10 Hours
|
||||
public static final int SECONDS_PER_TNT = 60 * 60 * 12; // 12 Hours
|
||||
public static final int MAX_GENERATOR_STOCK = 3;
|
||||
|
||||
private ClansManager _clansManager;
|
||||
|
@ -3,8 +3,6 @@ package mineplex.game.clans.clans.warpoints;
|
||||
import com.google.common.collect.Maps;
|
||||
import mineplex.core.MiniPlugin;
|
||||
import mineplex.core.common.util.F;
|
||||
import mineplex.core.common.util.UtilPlayer;
|
||||
import mineplex.core.common.util.UtilServer;
|
||||
import mineplex.core.common.util.UtilTime;
|
||||
import mineplex.core.updater.UpdateType;
|
||||
import mineplex.core.updater.event.UpdateEvent;
|
||||
@ -12,75 +10,102 @@ import mineplex.game.clans.clans.ClansManager;
|
||||
import mineplex.game.clans.clans.event.*;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Chunk;
|
||||
import org.bukkit.OfflinePlayer;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.UUID;
|
||||
|
||||
public class WarPointEvasion extends MiniPlugin{
|
||||
public class WarPointEvasion extends MiniPlugin
|
||||
{
|
||||
private HashMap<Chunk, Long> _chunkCooldown;
|
||||
private HashMap<UUID, Long> _playerCooldown;
|
||||
|
||||
private final long COOLDOWN_TIME = 1000 * 60 * 10;
|
||||
|
||||
public WarPointEvasion(JavaPlugin plugin) {
|
||||
public WarPointEvasion(JavaPlugin plugin)
|
||||
{
|
||||
super("WP Evasion", plugin);
|
||||
|
||||
_chunkCooldown = Maps.newHashMap();
|
||||
_playerCooldown = Maps.newHashMap();
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void updateCooldown(UpdateEvent event) {
|
||||
public void updateCooldown(UpdateEvent event)
|
||||
{
|
||||
if(!event.getType().equals(UpdateType.SEC)) return;
|
||||
|
||||
_chunkCooldown.keySet().stream().filter(chunk -> UtilTime.elapsed(_chunkCooldown.get(chunk), COOLDOWN_TIME)).forEach(chunk -> _chunkCooldown.remove(chunk));
|
||||
for (Iterator<Chunk> chunkIterator = _chunkCooldown.keySet().iterator(); chunkIterator.hasNext();)
|
||||
{
|
||||
Chunk chunk = chunkIterator.next();
|
||||
|
||||
_playerCooldown.keySet().stream().filter(player -> UtilTime.elapsed(_playerCooldown.get(player), COOLDOWN_TIME)).forEach(player -> {
|
||||
_playerCooldown.remove(player);
|
||||
if(Bukkit.getOfflinePlayer(player).isOnline()) {
|
||||
if(ClansManager.getInstance().getClan(Bukkit.getPlayer(player)) == null) {
|
||||
Bukkit.getPlayer(player).sendMessage(F.main("Clans", "You can now create a clan."));
|
||||
if (UtilTime.elapsed(_chunkCooldown.get(chunk), COOLDOWN_TIME))
|
||||
chunkIterator.remove();
|
||||
}
|
||||
|
||||
|
||||
for (Iterator<UUID> uuidIterator = _playerCooldown.keySet().iterator(); uuidIterator.hasNext();)
|
||||
{
|
||||
UUID uuid = uuidIterator.next();
|
||||
|
||||
if (UtilTime.elapsed(_playerCooldown.get(uuid), COOLDOWN_TIME))
|
||||
{
|
||||
uuidIterator.remove();
|
||||
|
||||
Player player = Bukkit.getPlayer(uuid);
|
||||
if (player.isOnline())
|
||||
{
|
||||
if(ClansManager.getInstance().getClan(player) == null)
|
||||
{
|
||||
player.sendMessage(F.main("Clans", "You can now create a clan."));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onClaim(PlayerPreClaimTerritoryEvent event) {
|
||||
public void onClaim(PlayerPreClaimTerritoryEvent event)
|
||||
{
|
||||
Chunk chunk = event.getClaimedChunk();
|
||||
if(_chunkCooldown.containsKey(chunk)) {
|
||||
|
||||
if(_chunkCooldown.containsKey(chunk))
|
||||
{
|
||||
event.setCancelled(true);
|
||||
event.getClaimer().sendMessage(F.main("Clans", "You cannot claim this chunk for another " + UtilTime.convertString(COOLDOWN_TIME - (System.currentTimeMillis() - _chunkCooldown.get(chunk)), 1, UtilTime.TimeUnit.MINUTES)));
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onunClaim(PlayerUnClaimTerritoryEvent event) {
|
||||
Chunk chunk = event.getUnClaimedChunk();
|
||||
_chunkCooldown.put(chunk, System.currentTimeMillis());
|
||||
|
||||
public void onunClaim(PlayerUnClaimTerritoryEvent event)
|
||||
{
|
||||
_chunkCooldown.put(event.getUnClaimedChunk(), System.currentTimeMillis());
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onClanDisband(ClanDisbandedEvent event) {
|
||||
public void onClanDisband(ClanDisbandedEvent event)
|
||||
{
|
||||
_playerCooldown.put(event.getDisbander().getUniqueId(), System.currentTimeMillis());
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onClanLeave(ClanLeaveEvent event) {
|
||||
public void onClanLeave(ClanLeaveEvent event)
|
||||
{
|
||||
_playerCooldown.put(event.getPlayer().getUuid(), System.currentTimeMillis());
|
||||
}
|
||||
|
||||
|
||||
@EventHandler
|
||||
public void onClanCreate(ClanCreatedEvent event) {
|
||||
public void onClanCreate(ClanCreatedEvent event)
|
||||
{
|
||||
if (event.getFounder() == null)
|
||||
return;
|
||||
|
||||
if (_playerCooldown.containsKey(event.getFounder().getUniqueId())) {
|
||||
if (_playerCooldown.containsKey(event.getFounder().getUniqueId()))
|
||||
{
|
||||
event.setCancelled(true);
|
||||
event.getFounder().sendMessage(F.main("Clans", "You cannot create a clan for another " + UtilTime.convertString(COOLDOWN_TIME - (System.currentTimeMillis() - _playerCooldown.get(event.getFounder().getUniqueId())), 1, UtilTime.TimeUnit.MINUTES)));
|
||||
}
|
||||
|
@ -6,14 +6,11 @@ import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import mineplex.core.common.util.*;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import mineplex.core.common.util.F;
|
||||
import mineplex.core.common.util.UtilServer;
|
||||
import mineplex.core.common.util.UtilTime;
|
||||
import mineplex.core.common.util.UtilWorld;
|
||||
import mineplex.core.scoreboard.ScoreboardManager;
|
||||
import mineplex.game.clans.clans.ClanInfo;
|
||||
import mineplex.game.clans.clans.ClansManager;
|
||||
@ -184,4 +181,15 @@ public class KingHill extends WorldEvent
|
||||
{
|
||||
public int TicksOnHill;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void announceStart()
|
||||
{
|
||||
for(Player player : UtilServer.getPlayers()) {
|
||||
if(_clansManager.getTutorial().inTutorial(player)) continue;
|
||||
|
||||
UtilTextMiddle.display(C.cGreen + getName(), UtilWorld.locToStrClean(getCenterLocation()), 10, 100, 40, player);
|
||||
player.sendMessage(F.main("Event", F.elem(getName()) + " has started at coordinates " + F.elem(UtilWorld.locToStrClean(getCenterLocation()))));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -4,22 +4,18 @@ import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.Set;
|
||||
|
||||
import mineplex.core.common.util.*;
|
||||
import mineplex.game.clans.clans.ClansManager;
|
||||
import org.bukkit.Effect;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.block.BlockFace;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.player.PlayerInteractEvent;
|
||||
|
||||
import mineplex.core.common.util.F;
|
||||
import mineplex.core.common.util.UtilBlock;
|
||||
import mineplex.core.common.util.UtilMath;
|
||||
import mineplex.core.common.util.UtilPlayer;
|
||||
import mineplex.core.common.util.UtilServer;
|
||||
import mineplex.core.common.util.UtilWorld;
|
||||
import mineplex.core.itemstack.ItemStackFactory;
|
||||
import mineplex.core.recharge.Recharge;
|
||||
import mineplex.core.updater.UpdateType;
|
||||
@ -509,4 +505,16 @@ public class UndeadCamp extends WorldEvent
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void announceStart()
|
||||
{
|
||||
for(Player player : UtilServer.getPlayers()) {
|
||||
if(ClansManager.getInstance().getTutorial().inTutorial(player)) continue;
|
||||
|
||||
UtilTextMiddle.display(C.cGreen + getName(), UtilWorld.locToStrClean(getCenterLocation()), 10, 100, 40, player);
|
||||
player.sendMessage(F.main("Event", F.elem(getName()) + " has started at coordinates " + F.elem(UtilWorld.locToStrClean(getCenterLocation()))));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -217,7 +217,9 @@ public class GoldManager extends MiniPlugin
|
||||
|
||||
public void deductGold(Callback<Boolean> resultCallback, Player player, int amount)
|
||||
{
|
||||
if (amount >= 0)
|
||||
if (amount == 0)
|
||||
resultCallback.run(true);
|
||||
if (amount > 0)
|
||||
_donationManager.rewardGold(resultCallback, "GoldManager", player, -amount);
|
||||
}
|
||||
|
||||
|
@ -54,6 +54,7 @@ import mineplex.core.common.util.UtilEvent;
|
||||
import mineplex.core.common.util.UtilEvent.ActionType;
|
||||
import mineplex.core.common.util.UtilGear;
|
||||
import mineplex.core.common.util.UtilInv;
|
||||
import mineplex.core.common.util.UtilItem;
|
||||
import mineplex.core.common.util.UtilMath;
|
||||
import mineplex.core.common.util.UtilPlayer;
|
||||
import mineplex.core.common.util.UtilServer;
|
||||
@ -67,6 +68,7 @@ import mineplex.core.updater.event.UpdateEvent;
|
||||
import mineplex.game.clans.clans.ClanInfo;
|
||||
import mineplex.game.clans.clans.ClansManager;
|
||||
import mineplex.game.clans.clans.event.ClansWaterPlaceEvent;
|
||||
import mineplex.game.clans.clans.event.IronDoorOpenEvent;
|
||||
import mineplex.game.clans.core.repository.ClanTerritory;
|
||||
import mineplex.minecraft.game.classcombat.Class.ClientClass;
|
||||
import mineplex.minecraft.game.classcombat.Class.IPvpClass.ClassType;
|
||||
@ -246,11 +248,6 @@ public class Gameplay extends MiniPlugin
|
||||
@EventHandler(priority = EventPriority.LOWEST)
|
||||
public void ObsidianCancel(BlockPlaceEvent event)
|
||||
{
|
||||
if (_clansManager.masterBypass(event.getPlayer()))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (event.getBlock().getType() == Material.OBSIDIAN)
|
||||
{
|
||||
UtilPlayer.message(event.getPlayer(), F.main("Game", "You cannot place " + F.item("Obsidian") + "."));
|
||||
@ -453,6 +450,13 @@ public class Gameplay extends MiniPlugin
|
||||
// Open
|
||||
else
|
||||
{
|
||||
IronDoorOpenEvent customEvent = UtilServer.CallEvent(new IronDoorOpenEvent(event.getPlayer(), block));
|
||||
|
||||
if (customEvent.isCancelled())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (block.getData() >= 8) block = block.getRelative(BlockFace.DOWN);
|
||||
|
||||
if (block.getData() < 4)
|
||||
@ -587,46 +591,50 @@ public class Gameplay extends MiniPlugin
|
||||
}
|
||||
}
|
||||
|
||||
// @EventHandler(priority = EventPriority.LOWEST)
|
||||
// public void replantTree(BlockBreakEvent event)
|
||||
// {
|
||||
// final Block block = event.getBlock();
|
||||
//
|
||||
// if (_clansManager.getClanUtility().getClaim(block.getLocation()) != null)
|
||||
// {
|
||||
// return;
|
||||
// }
|
||||
//
|
||||
// if (!UtilItem.isLog(block.getType()))
|
||||
// {
|
||||
// return;
|
||||
// }
|
||||
//
|
||||
// if (UtilItem.isLog(block.getRelative(BlockFace.DOWN).getType()))
|
||||
// {
|
||||
// return;
|
||||
// }
|
||||
//
|
||||
// if (UtilItem.isLeaf(block.getRelative(BlockFace.DOWN).getType()))
|
||||
// {
|
||||
// return;
|
||||
// }
|
||||
//
|
||||
// if (block.getRelative(BlockFace.DOWN).getType() != Material.DIRT && block.getRelative(BlockFace.DOWN).getType() != Material.GRASS)
|
||||
// {
|
||||
// return;
|
||||
// }
|
||||
//
|
||||
// final byte data = block.getData();
|
||||
//
|
||||
// UtilServer.getServer().getScheduler().scheduleSyncDelayedTask(getPlugin(), new Runnable() {
|
||||
// public void run()
|
||||
// {
|
||||
// block.setType(Material.SAPLING);
|
||||
// block.setData(data);
|
||||
// }
|
||||
// }, 20 * 5);
|
||||
// }
|
||||
@EventHandler(priority = EventPriority.LOWEST)
|
||||
public void replantTree(BlockBreakEvent event)
|
||||
{
|
||||
final Block block = event.getBlock();
|
||||
|
||||
if (_clansManager.getClanUtility().getClaim(block.getLocation()) != null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (!UtilItem.isLog(block.getType()))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (UtilItem.isLog(block.getRelative(BlockFace.DOWN).getType()))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (UtilItem.isLeaf(block.getRelative(BlockFace.DOWN).getType()))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (block.getRelative(BlockFace.DOWN).getType() != Material.DIRT && block.getRelative(BlockFace.DOWN).getType() != Material.GRASS)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
final byte data = block.getData();
|
||||
|
||||
UtilServer.getServer().getScheduler().scheduleSyncDelayedTask(getPlugin(), new Runnable() {
|
||||
public void run()
|
||||
{
|
||||
Material mat = block.getRelative(BlockFace.DOWN).getType();
|
||||
if (mat == Material.DIRT || mat == Material.GRASS)
|
||||
{
|
||||
block.setType(Material.SAPLING);
|
||||
block.setData(data);
|
||||
}
|
||||
}
|
||||
}, 20 * 10);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void killRain(WeatherChangeEvent event)
|
||||
|
@ -364,6 +364,8 @@ public class GearManager extends MiniPlugin implements IPacketHandler, Runnable
|
||||
attribute = sampleAttribute; // Select valid attribute to
|
||||
// add
|
||||
}
|
||||
|
||||
attempts++;
|
||||
}
|
||||
|
||||
container.addAttribute(attribute);
|
||||
|
@ -29,7 +29,7 @@ public class PvpItem extends ShopItem
|
||||
super(type, data, name, new String[] {
|
||||
C.cWhite + " ",
|
||||
LEFT_CLICK_BUY,
|
||||
C.cWhite + "Costs " + C.cGreen + (buyPrice == 0 ? "Free" : buyPrice + "g"),
|
||||
C.cWhite + "Costs " + C.cGreen + (buyPrice == 0 ? "Free (Tutorial)" : buyPrice + "g"),
|
||||
C.cWhite + " ",
|
||||
UtilItem.isArmor(type) || UtilItem.isTool(type) ? "" : C.cYellow + "Shift Left-Click" + C.cWhite + " to Buy " + C.cGreen + bulkCount,
|
||||
UtilItem.isArmor(type) || UtilItem.isTool(type) ? "" : C.cWhite + "Costs " + C.cGreen + (buyPrice * bulkCount) + "g", C.cWhite + " ",
|
||||
|
@ -133,6 +133,8 @@ public class ShopItemButton<T extends ShopPageBase<?, ?>> implements IButton
|
||||
GoldManager.notify(player, "You cannot afford that item! Please relog to update your gold count.");
|
||||
_page.playDenySound(player);
|
||||
}
|
||||
|
||||
_page.refresh();
|
||||
}
|
||||
}, player, cost);
|
||||
}
|
||||
|
@ -1,22 +1,16 @@
|
||||
package mineplex.game.clans.shop.energy;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Sound;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.inventory.ClickType;
|
||||
|
||||
import mineplex.core.common.CurrencyType;
|
||||
import mineplex.core.common.util.Callback;
|
||||
import mineplex.core.common.util.F;
|
||||
import mineplex.core.common.util.UtilTime;
|
||||
import mineplex.core.donation.DonationManager;
|
||||
import mineplex.core.energy.Energy;
|
||||
import mineplex.core.shop.ShopBase;
|
||||
import mineplex.core.common.util.UtilServer;
|
||||
import mineplex.core.shop.item.IButton;
|
||||
import mineplex.core.shop.page.ConfirmationPage;
|
||||
import mineplex.game.clans.clans.ClanEnergyManager;
|
||||
import mineplex.game.clans.clans.ClanInfo;
|
||||
import mineplex.game.clans.clans.ClansManager;
|
||||
import mineplex.game.clans.clans.event.PreEnergyShopBuyEvent;
|
||||
|
||||
public class EnergyShopButton implements IButton
|
||||
{
|
||||
@ -38,6 +32,11 @@ public class EnergyShopButton implements IButton
|
||||
@Override
|
||||
public void onClick(final Player player, ClickType clickType)
|
||||
{
|
||||
if (UtilServer.CallEvent(new PreEnergyShopBuyEvent(player, _energyToPurchase, _cost)).isCancelled())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
_page.getShop().openPageForPlayer(player, new ConfirmationPage<ClanEnergyManager, EnergyShop>(
|
||||
_page.getPlugin(), _page.getShop(), _page.getClientManager(), _page.getDonationManager(), new Runnable()
|
||||
{
|
||||
|
@ -281,10 +281,7 @@ public class Spawn extends MiniPlugin
|
||||
event.setRespawnLocation(getSpawnLocation());
|
||||
}
|
||||
|
||||
/**
|
||||
* Ensure player spawns into a Spawn location if it's their first time on the server.
|
||||
* @param event
|
||||
*/
|
||||
/*
|
||||
@EventHandler
|
||||
public void onPlayerFirstJoin(PlayerJoinEvent event)
|
||||
{
|
||||
@ -293,6 +290,7 @@ public class Spawn extends MiniPlugin
|
||||
teleport(event.getPlayer(), getSpawnLocation(), 2); // Teleport player to spawn after 2-tick delay to prevent on-join bug
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
/**
|
||||
* Prevent creatures from spawning inside Spawn
|
||||
@ -493,7 +491,7 @@ public class Spawn extends MiniPlugin
|
||||
return _clansManager.getCondition().HasCondition(player, ConditionType.CUSTOM, COMBAT_TAG_NAME);
|
||||
}
|
||||
|
||||
private void teleport(final Player player, final Location location, int delay)
|
||||
public void teleport(final Player player, final Location location, int delay)
|
||||
{
|
||||
Bukkit.getScheduler().scheduleSyncDelayedTask(getPlugin(), new Runnable() {
|
||||
@Override
|
||||
|
@ -58,6 +58,11 @@ public class TravelButton implements IButton
|
||||
return;
|
||||
}
|
||||
|
||||
if (_location == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (player.getLocation().distance(_location) <= 64)
|
||||
{
|
||||
return;
|
||||
|
@ -12,7 +12,6 @@ import org.bukkit.inventory.meta.ItemMeta;
|
||||
|
||||
import mineplex.core.account.CoreClientManager;
|
||||
import mineplex.core.common.util.C;
|
||||
import mineplex.core.common.util.F;
|
||||
import mineplex.core.common.util.UtilBlock;
|
||||
import mineplex.core.donation.DonationManager;
|
||||
import mineplex.core.itemstack.ItemBuilder;
|
||||
@ -23,6 +22,8 @@ import mineplex.game.clans.clans.ClanInfo;
|
||||
import mineplex.game.clans.clans.ClanRole;
|
||||
import mineplex.game.clans.clans.ClansManager;
|
||||
import mineplex.game.clans.clans.gui.ClanIcon;
|
||||
import mineplex.game.clans.clans.siege.outpost.Outpost;
|
||||
import mineplex.game.clans.shop.ClansShopItem;
|
||||
import mineplex.game.clans.spawn.Spawn;
|
||||
|
||||
public class TravelPage extends ShopPageBase<ClansManager, TravelShop>
|
||||
@ -37,7 +38,7 @@ public class TravelPage extends ShopPageBase<ClansManager, TravelShop>
|
||||
@Override
|
||||
protected void buildPage()
|
||||
{
|
||||
addTravelLocation(Spawn.getNorthSpawn(), getPlayer().getLocation().distance(Spawn.getNorthSpawn()) <= 64 ? Material.SKULL_ITEM : Material.IRON_SWORD, (getPlayer().getLocation().distance(Spawn.getNorthSpawn()) <= 64 ? C.cRedB : C.cGreenB) + "East Spawn", new String[] {
|
||||
addTravelLocation(Spawn.getNorthSpawn(), getPlayer().getLocation().distance(Spawn.getNorthSpawn()) <= 64 ? Material.SKULL_ITEM : Material.IRON_SWORD, (getPlayer().getLocation().distance(Spawn.getNorthSpawn()) <= 64 ? C.cRedB : C.cGreenB) + "North Spawn", new String[] {
|
||||
C.cWhite + "Spawns are locations where",
|
||||
C.cWhite + "you respawn after dying.",
|
||||
" ",
|
||||
@ -45,9 +46,9 @@ public class TravelPage extends ShopPageBase<ClansManager, TravelShop>
|
||||
C.cWhite + "as they are Safe Zones.",
|
||||
getPlayer().getLocation().distance(Spawn.getSouthSpawn()) <= 64 ? " " : "",
|
||||
getPlayer().getLocation().distance(Spawn.getNorthSpawn()) <= 64 ? C.cRed + "You are already here." : "",
|
||||
}, 14 + 10, getPlayer().getLocation().distance(Spawn.getNorthSpawn()) <= 64 ? (byte) 3 : (byte) 0);
|
||||
}, 4, getPlayer().getLocation().distance(Spawn.getNorthSpawn()) <= 64 ? (byte) 3 : (byte) 0);
|
||||
|
||||
addTravelLocation(Spawn.getSouthSpawn(), getPlayer().getLocation().distance(Spawn.getSouthSpawn()) <= 64 ? Material.SKULL_ITEM : Material.IRON_SWORD, (getPlayer().getLocation().distance(Spawn.getSouthSpawn()) <= 64 ? C.cRedB : C.cGreenB) + "West Spawn", new String[] {
|
||||
addTravelLocation(Spawn.getSouthSpawn(), getPlayer().getLocation().distance(Spawn.getSouthSpawn()) <= 64 ? Material.SKULL_ITEM : Material.IRON_SWORD, (getPlayer().getLocation().distance(Spawn.getSouthSpawn()) <= 64 ? C.cRedB : C.cGreenB) + "South Spawn", new String[] {
|
||||
C.cWhite + "Spawns are locations where",
|
||||
C.cWhite + "you respawn after dying.",
|
||||
" ",
|
||||
@ -55,27 +56,36 @@ public class TravelPage extends ShopPageBase<ClansManager, TravelShop>
|
||||
C.cWhite + "as they are Safe Zones.",
|
||||
getPlayer().getLocation().distance(Spawn.getSouthSpawn()) <= 64 ? " " : "",
|
||||
getPlayer().getLocation().distance(Spawn.getSouthSpawn()) <= 64 ? C.cRed + "You are already here." : "",
|
||||
}, 12 + 8, getPlayer().getLocation().distance(Spawn.getSouthSpawn()) <= 64 ? (byte) 3 : (byte) 0);
|
||||
}, 22 + 9 + 9, getPlayer().getLocation().distance(Spawn.getSouthSpawn()) <= 64 ? (byte) 3 : (byte) 0);
|
||||
|
||||
addTravelLocation(Spawn.getWestTown(), ClanIcon.CASTLE.getMaterial(), C.cDGreenB + "North Shop", new String[] {
|
||||
addTravelLocation(Spawn.getWestTown(), ClanIcon.CASTLE.getMaterial(), C.cDGreenB + "West Shop", new String[] {
|
||||
C.cWhite + "Shops are locations where you",
|
||||
C.cWhite + "can buy and sell all sorts of goods.",
|
||||
" ",
|
||||
C.cWhite + "You cannot be attacked here,",
|
||||
C.cWhite + "as they are Safe Zones.",
|
||||
}, 4, ClanIcon.CASTLE.getData());
|
||||
}, 12 + 8, ClanIcon.CASTLE.getData());
|
||||
|
||||
addTravelLocation(Spawn.getEastTown(), ClanIcon.CASTLE.getMaterial(), C.cDGreenB + "South Shop", new String[] {
|
||||
addTravelLocation(Spawn.getEastTown(), ClanIcon.CASTLE.getMaterial(), C.cDGreenB + "East Shop", new String[] {
|
||||
C.cWhite + "Shops are locations where you",
|
||||
C.cWhite + "can buy and sell all sorts of goods.",
|
||||
" ",
|
||||
C.cWhite + "You cannot be attacked here,",
|
||||
C.cWhite + "as they are Safe Zones.",
|
||||
}, 22 + 9 + 9, ClanIcon.CASTLE.getData());
|
||||
}, 14 + 10, ClanIcon.CASTLE.getData());
|
||||
|
||||
final ClanInfo clan = _plugin.getClan(getPlayer());
|
||||
Outpost outpost = _plugin.getSiegeManager().getOutpostManager().Get(clan);
|
||||
|
||||
addTravelLocation(outpost == null ? null : outpost.getCoreLocation().clone().add(0, 1, 0), ClansShopItem.OUTPOST.getMaterial(), (outpost == null ? C.cRedB : C.cDGreenB) + "Outpost", new String[] {
|
||||
C.cWhite + "Teleport to your Clan's currently",
|
||||
C.cWhite + "active Outpost.",
|
||||
" ",
|
||||
(outpost == null ? C.cRed + "Your Clan does not have an Outpost." : ""),
|
||||
}, 8, ClanIcon.CASTLE.getData());
|
||||
|
||||
|
||||
|
||||
final ClanInfo clan = getPlugin().getClan(getPlayer());
|
||||
|
||||
final ItemStack item = new ItemStack(Material.BED, 1);
|
||||
ItemMeta meta = item.getItemMeta();
|
||||
|
@ -10,7 +10,7 @@ public class FinishCommand extends CommandBase<TutorialManager>
|
||||
{
|
||||
public FinishCommand(TutorialManager plugin)
|
||||
{
|
||||
super(plugin, Rank.DEVELOPER, "finish", "end");
|
||||
super(plugin, Rank.JNR_DEV, "finish", "end");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -13,7 +13,7 @@ public class TutorialCommand extends MultiCommandBase<TutorialManager>
|
||||
{
|
||||
public TutorialCommand(TutorialManager plugin)
|
||||
{
|
||||
super(plugin, Rank.DEVELOPER, "tutorial", "tut");
|
||||
super(plugin, Rank.JNR_DEV, "tutorial", "tut");
|
||||
|
||||
AddCommand(new StartCommand(plugin));
|
||||
AddCommand(new FinishCommand(plugin));
|
||||
|
@ -1,48 +0,0 @@
|
||||
package mineplex.game.clans.tutorial.tutorials.clans.objective;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
import mineplex.core.common.objective.SingleObjective;
|
||||
import mineplex.core.updater.UpdateType;
|
||||
import mineplex.core.updater.event.UpdateEvent;
|
||||
import mineplex.game.clans.tutorial.tutorials.clans.ClansMainTutorial;
|
||||
|
||||
public class LeaveSpawnObjective extends SingleObjective<ClansMainTutorial>
|
||||
{
|
||||
public LeaveSpawnObjective(ClansMainTutorial plugin, JavaPlugin javaPlugin)
|
||||
{
|
||||
super(plugin, javaPlugin, "Leave Spawn", "Exit the tutorial spawn area");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void customStart(Player player)
|
||||
{
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void customLeave(Player player)
|
||||
{
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void customFinish(Player player)
|
||||
{
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void checkRegion(UpdateEvent event)
|
||||
{
|
||||
if (event.getType() != UpdateType.FAST)
|
||||
return;
|
||||
|
||||
for (Player player : getActivePlayers())
|
||||
{
|
||||
if (!getPlugin().isInSpawn(player))
|
||||
{
|
||||
finish(player);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -102,16 +102,16 @@ public class BlowUpWallGoal extends ObjectiveGoal<AttackEnemyObjective>
|
||||
}
|
||||
});
|
||||
|
||||
event.setCancelled(true);
|
||||
finish(shooter);
|
||||
}
|
||||
else
|
||||
{
|
||||
UtilPlayer.message(shooter, F.main("Clans", "You missed! Try to hit the enemy's front wall, that should make a nice big hole!"));
|
||||
UtilInv.give(shooter, Material.TNT);
|
||||
}
|
||||
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void customFinish(Player player)
|
||||
|
@ -143,8 +143,8 @@ public class Hub extends JavaPlugin implements IRelation
|
||||
IncognitoManager incognito = new IncognitoManager(this, clientManager, packetHandler);
|
||||
|
||||
new ServerManager(this, clientManager, donationManager, portal, partyManager, serverStatusManager, hubManager, new StackerManager(hubManager), queueManager);
|
||||
Chat chat = new Chat(this, clientManager, preferenceManager, achievementManager, serverStatusManager.getCurrentServerName());
|
||||
new MessageManager(this, clientManager, preferenceManager, ignoreManager, punish, friendManager, chat);
|
||||
Chat chat = new Chat(this, incognito, clientManager, preferenceManager, achievementManager, serverStatusManager.getCurrentServerName());
|
||||
new MessageManager(this, incognito, clientManager, preferenceManager, ignoreManager, punish, friendManager, chat);
|
||||
new MemoryFix(this);
|
||||
new FileUpdater(this, portal, serverStatusManager.getCurrentServerName(), serverStatusManager.getRegion());
|
||||
new CustomTagFix(this, packetHandler);
|
||||
|
@ -9,8 +9,6 @@ import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.Random;
|
||||
|
||||
import mineplex.core.reward.RewardManager;
|
||||
import mineplex.core.valentines.ValentinesGiftManager;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.GameMode;
|
||||
@ -74,8 +72,8 @@ import mineplex.core.gadget.GadgetManager;
|
||||
import mineplex.core.gadget.event.GadgetCollideEntityEvent;
|
||||
import mineplex.core.gadget.event.GadgetEnableEvent;
|
||||
import mineplex.core.gadget.types.GadgetType;
|
||||
import mineplex.core.giveaway.GiveawayManager;
|
||||
import mineplex.core.hologram.HologramManager;
|
||||
import mineplex.core.incognito.events.IncognitoHidePlayerEvent;
|
||||
import mineplex.core.inventory.InventoryManager;
|
||||
import mineplex.core.message.PrivateMessageEvent;
|
||||
import mineplex.core.mount.MountManager;
|
||||
@ -97,12 +95,14 @@ import mineplex.core.portal.Portal;
|
||||
import mineplex.core.preferences.PreferencesManager;
|
||||
import mineplex.core.projectile.ProjectileManager;
|
||||
import mineplex.core.punish.Punish;
|
||||
import mineplex.core.reward.RewardManager;
|
||||
import mineplex.core.stats.StatsManager;
|
||||
import mineplex.core.status.ServerStatusManager;
|
||||
import mineplex.core.task.TaskManager;
|
||||
import mineplex.core.treasure.TreasureManager;
|
||||
import mineplex.core.updater.UpdateType;
|
||||
import mineplex.core.updater.event.UpdateEvent;
|
||||
import mineplex.core.valentines.ValentinesGiftManager;
|
||||
import mineplex.hub.commands.DisguiseCommand;
|
||||
import mineplex.hub.commands.ForcefieldRadius;
|
||||
import mineplex.hub.commands.GadgetToggle;
|
||||
@ -575,6 +575,15 @@ public class HubManager extends MiniClientPlugin<HubClient>
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void Incog(IncognitoHidePlayerEvent event)
|
||||
{
|
||||
if (!_clientManager.hasRank(event.getPlayer(), Rank.ADMIN))
|
||||
{
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void PlayerChat(AsyncPlayerChatEvent event)
|
||||
{
|
||||
|
@ -1,5 +1,7 @@
|
||||
package mineplex.hub.server;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
@ -26,7 +28,7 @@ import org.bukkit.event.player.PlayerQuitEvent;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import mineplex.core.MiniPlugin;
|
||||
import mineplex.core.MiniDbClientPlugin;
|
||||
import mineplex.core.account.CoreClientManager;
|
||||
import mineplex.core.common.Rank;
|
||||
import mineplex.core.common.util.C;
|
||||
@ -48,10 +50,10 @@ import mineplex.core.shop.ShopBase;
|
||||
import mineplex.core.status.ServerStatusManager;
|
||||
import mineplex.core.updater.UpdateType;
|
||||
import mineplex.core.updater.event.UpdateEvent;
|
||||
import mineplex.game.clans.core.repository.tokens.SimpleClanToken;
|
||||
import mineplex.hub.HubManager;
|
||||
import mineplex.hub.modules.StackerManager;
|
||||
import mineplex.hub.queue.QueueManager;
|
||||
import mineplex.hub.queue.ui.QueueShop;
|
||||
import mineplex.hub.server.ui.LobbyShop;
|
||||
import mineplex.hub.server.ui.QuickShop;
|
||||
import mineplex.hub.server.ui.ServerCountSorter;
|
||||
@ -61,7 +63,7 @@ import mineplex.serverdata.Region;
|
||||
import mineplex.serverdata.data.MinecraftServer;
|
||||
import mineplex.serverdata.data.ServerGroup;
|
||||
|
||||
public class ServerManager extends MiniPlugin
|
||||
public class ServerManager extends MiniDbClientPlugin<SimpleClanToken>
|
||||
{
|
||||
private static final Long FREE_PORTAL_TIMER = 20000L;
|
||||
private static final Long BETA_PORTAL_TIMER = 120000L;
|
||||
@ -77,8 +79,6 @@ public class ServerManager extends MiniPlugin
|
||||
private PartyManager _partyManager;
|
||||
private ServerStatusManager _statusManager;
|
||||
private HubManager _hubManager;
|
||||
private StackerManager _stackerManager;
|
||||
private QueueManager _queueManager;
|
||||
|
||||
private NautHashMap<String, Long> _queueCooldowns = new NautHashMap<String, Long>();
|
||||
private NautHashMap<String, HashSet<ServerInfo>> _serverKeyInfoMap = new NautHashMap<String, HashSet<ServerInfo>>();
|
||||
@ -93,7 +93,6 @@ public class ServerManager extends MiniPlugin
|
||||
// Join Time for Free Players Timer
|
||||
private NautHashMap<String, Long> _joinTime = new NautHashMap<String, Long>();
|
||||
|
||||
private QueueShop _domShop;
|
||||
private QuickShop _quickShop;
|
||||
private LobbyShop _lobbyShop;
|
||||
|
||||
@ -103,7 +102,7 @@ public class ServerManager extends MiniPlugin
|
||||
|
||||
public ServerManager(JavaPlugin plugin, CoreClientManager clientManager, DonationManager donationManager, Portal portal, PartyManager partyManager, ServerStatusManager statusManager, HubManager hubManager, StackerManager stackerManager, QueueManager queueManager)
|
||||
{
|
||||
super("Server Manager", plugin);
|
||||
super("Server Manager", plugin, clientManager);
|
||||
|
||||
_clientManager = clientManager;
|
||||
_donationManager = donationManager;
|
||||
@ -111,8 +110,6 @@ public class ServerManager extends MiniPlugin
|
||||
_partyManager = partyManager;
|
||||
_statusManager = statusManager;
|
||||
_hubManager = hubManager;
|
||||
_stackerManager = stackerManager;
|
||||
_queueManager = queueManager;
|
||||
|
||||
plugin.getServer().getMessenger().registerOutgoingPluginChannel(plugin, "BungeeCord");
|
||||
|
||||
@ -120,7 +117,6 @@ public class ServerManager extends MiniPlugin
|
||||
|
||||
_quickShop = new QuickShop(this, clientManager, donationManager, "Quick Menu");
|
||||
_lobbyShop = new LobbyShop(this, clientManager, donationManager, "Lobby Menu");
|
||||
//_domShop = new new QueueShop(_queueManager, clientManager, donationManager, "Dominate");
|
||||
|
||||
// TODO: Find more appropriate place to initialize Clans server shop?
|
||||
_clansShop = new ClansServerShop(this, _clientManager, _donationManager);
|
||||
@ -918,4 +914,33 @@ public class ServerManager extends MiniPlugin
|
||||
{
|
||||
return _serverNpcShopMap.get("Valentines Vendetta");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getQuery(int accountId, String uuid, String name)
|
||||
{
|
||||
return "SELECT clans.name, accountClan.clanRole, clanServer.serverName, clans.id FROM accountClan INNER JOIN clans ON clans.id = accountClan.clanId INNER JOIN clanServer ON clans.serverId = clanServer.id WHERE accountClan.accountId = " + accountId + ";";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void processLoginResultSet(String playerName, int accountId, ResultSet resultSet) throws SQLException
|
||||
{
|
||||
SimpleClanToken clanToken = new SimpleClanToken();
|
||||
|
||||
while (resultSet.next())
|
||||
{
|
||||
String clanName = resultSet.getString(1);
|
||||
String clanRole = resultSet.getString(2);
|
||||
String homeServer = resultSet.getString(3);
|
||||
int clanId = resultSet.getInt(4);
|
||||
clanToken = new SimpleClanToken(clanName, clanRole, homeServer, clanId);
|
||||
}
|
||||
|
||||
Set(playerName, clanToken);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SimpleClanToken AddPlayer(String player)
|
||||
{
|
||||
return new SimpleClanToken();
|
||||
}
|
||||
}
|
||||
|
@ -52,6 +52,14 @@ public class ServerSorter implements Comparator<ServerInfo>
|
||||
}
|
||||
}
|
||||
|
||||
if (a.Name.contains("Clans") && b.Name.contains("Clans"))
|
||||
{
|
||||
if (Integer.parseInt(a.Name.split("-")[1]) < Integer.parseInt(b.Name.split("-")[1]))
|
||||
return -1;
|
||||
else if (Integer.parseInt(a.Name.split("-")[1]) > Integer.parseInt(b.Name.split("-")[1]))
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (a.MaxPlayers - a.CurrentPlayers < _requiredSlots && b.MaxPlayers - b.CurrentPlayers >= _requiredSlots)
|
||||
return -1;
|
||||
|
||||
|
@ -272,9 +272,9 @@ public class ServerGameMenu extends ShopPageBase<ServerManager, QuickShop>
|
||||
C.Reset + "the games you want, when you want.",
|
||||
}).setHideInfo(true).build(), new SelectPLAYERButton(this));
|
||||
|
||||
addButton(40, new ItemBuilder(Material.IRON_DOOR).setTitle(C.cYellowB + "Mineplex Clans " + C.cGray + "Champions Teams").addLore(new String[]
|
||||
addButton(40, new ItemBuilder(Material.IRON_DOOR).setTitle(C.cYellowB + "Mineplex Clans " + C.cGray + "Factions PvP").addLore(new String[]
|
||||
{
|
||||
(_extraValue ? C.cAquaB : C.cWhiteB) + "ALPHA RELEASE",
|
||||
(_extraValue ? C.cAquaB : C.cWhiteB) + "BETA RELEASE",
|
||||
C.Reset + "",
|
||||
C.Reset + "Equip custom skills and builds",
|
||||
C.Reset + "and join your clan to destroy",
|
||||
|
@ -4,7 +4,6 @@ import org.bukkit.Sound;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import mineplex.core.account.CoreClientManager;
|
||||
import mineplex.core.common.util.C;
|
||||
import mineplex.core.common.util.F;
|
||||
import mineplex.core.donation.DonationManager;
|
||||
import mineplex.core.party.Party;
|
||||
|
@ -1,6 +1,8 @@
|
||||
package mineplex.hub.server.ui.clans;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Comparator;
|
||||
import java.util.TreeSet;
|
||||
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Material;
|
||||
@ -10,6 +12,7 @@ import org.bukkit.event.inventory.ClickType;
|
||||
import mineplex.core.account.CoreClientManager;
|
||||
import mineplex.core.common.util.C;
|
||||
import mineplex.core.common.util.Callback;
|
||||
import mineplex.core.common.util.UtilAlg;
|
||||
import mineplex.core.donation.DonationManager;
|
||||
import mineplex.core.shop.item.DisplayButton;
|
||||
import mineplex.core.shop.item.IButton;
|
||||
@ -24,18 +27,10 @@ import mineplex.serverdata.data.DataRepository;
|
||||
|
||||
public class ClansServerPage extends ShopPageBase<ServerManager, ClansServerShop>
|
||||
{
|
||||
|
||||
//private DataRepository<PlayerServerInfo> _repository; // Stores the name of the last Clans server a player was on
|
||||
private ClanRepository _repository;
|
||||
private int _accountId;
|
||||
|
||||
public ClansServerPage(ServerManager plugin, ClansServerShop shop, CoreClientManager clientManager,
|
||||
DonationManager donationManager, Player player, ClanRepository repository)
|
||||
DonationManager donationManager, Player player)
|
||||
{
|
||||
super(plugin, shop, clientManager, donationManager, "Clans Alpha", player, 27);
|
||||
|
||||
_repository = repository;
|
||||
_accountId = clientManager.getAccountId(player);
|
||||
super(plugin, shop, clientManager, donationManager, "Clans Beta", player, 54);
|
||||
|
||||
buildPage();
|
||||
}
|
||||
@ -43,22 +38,15 @@ public class ClansServerPage extends ShopPageBase<ServerManager, ClansServerShop
|
||||
@Override
|
||||
protected void buildPage()
|
||||
{
|
||||
_repository.retrievePlayersClan(_accountId, new Callback<SimpleClanToken>()
|
||||
if (!getPlugin().Get(_player).getClanName().isEmpty())
|
||||
{
|
||||
@Override
|
||||
public void run(SimpleClanToken data)
|
||||
{
|
||||
if (data != null)
|
||||
{
|
||||
buildClanPage(data);
|
||||
buildClanPage(getPlugin().Get(_player));
|
||||
}
|
||||
else
|
||||
{
|
||||
buildNoClanPage();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void buildClanPage(SimpleClanToken clan)
|
||||
{
|
||||
@ -72,7 +60,14 @@ public class ClansServerPage extends ShopPageBase<ServerManager, ClansServerShop
|
||||
|
||||
private void buildNoClanPage()
|
||||
{
|
||||
Collection<ServerInfo> servers = getPlugin().getServerList("Clans");
|
||||
Collection<ServerInfo> servers = UtilAlg.sortSet(getPlugin().getServerList("Clans"), new Comparator<ServerInfo>()
|
||||
{
|
||||
@Override
|
||||
public int compare(ServerInfo o1, ServerInfo o2)
|
||||
{
|
||||
return o1.Name.compareTo(o2.Name);
|
||||
}
|
||||
});
|
||||
|
||||
int currentSlot = 9;
|
||||
for (ServerInfo server : servers)
|
||||
|
@ -2,29 +2,23 @@ package mineplex.hub.server.ui.clans;
|
||||
|
||||
import org.bukkit.Sound;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.block.Action;
|
||||
import org.bukkit.event.player.PlayerInteractEvent;
|
||||
|
||||
import mineplex.core.account.CoreClientManager;
|
||||
import mineplex.core.common.util.C;
|
||||
import mineplex.core.common.util.F;
|
||||
import mineplex.core.donation.DonationManager;
|
||||
import mineplex.core.party.Party;
|
||||
import mineplex.core.shop.ShopBase;
|
||||
import mineplex.core.shop.page.ShopPageBase;
|
||||
import mineplex.game.clans.core.repository.ClanRepository;
|
||||
import mineplex.game.clans.core.repository.tokens.SimpleClanToken;
|
||||
import mineplex.hub.server.ServerManager;
|
||||
|
||||
public class ClansServerShop extends ShopBase<ServerManager>
|
||||
{
|
||||
|
||||
private ClanRepository _repository;
|
||||
|
||||
public ClansServerShop(ServerManager plugin, CoreClientManager clientManager, DonationManager donationManager)
|
||||
{
|
||||
super(plugin, clientManager, donationManager, "Clans Alpha");
|
||||
super(plugin, clientManager, donationManager, "Clans Beta");
|
||||
|
||||
_repository = new ClanRepository(plugin.getPlugin(), plugin.getStatusManager().getCurrentServerName());
|
||||
}
|
||||
@ -32,7 +26,7 @@ public class ClansServerShop extends ShopBase<ServerManager>
|
||||
@Override
|
||||
protected ShopPageBase<ServerManager, ? extends ShopBase<ServerManager>> buildPagesFor(Player player)
|
||||
{
|
||||
return new ClansServerPage(getPlugin(), this, getClientManager(), getDonationManager(), player, _repository);
|
||||
return new ClansServerPage(getPlugin(), this, getClientManager(), getDonationManager(), player);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -70,6 +70,7 @@ public class BlockToss extends SkillCharge implements IThrown
|
||||
Material.STONE_BUTTON,
|
||||
Material.WOOD_BUTTON,
|
||||
Material.LEVER,
|
||||
Material.BARRIER,
|
||||
};
|
||||
|
||||
public BlockToss(SkillFactory skills, String name, ClassType classType, SkillType skillType, int cost, int levels)
|
||||
|
@ -268,7 +268,7 @@ public abstract class WorldEvent implements Listener, ScoreboardElement
|
||||
{
|
||||
UtilTextMiddle.display(C.cGreen + getName(), UtilWorld.locToStrClean(getCenterLocation()), 10, 100, 40);
|
||||
|
||||
Bukkit.broadcastMessage(F.main("Event", F.elem(getName()) + " has started at coordinates " + F.elem(UtilWorld.locToStrClean(getCenterLocation()))));
|
||||
UtilServer.broadcast(F.main("Event", F.elem(getName()) + " has started at coordinates " + F.elem(UtilWorld.locToStrClean(getCenterLocation()))));
|
||||
}
|
||||
|
||||
public void clearCreatures()
|
||||
|
@ -379,7 +379,7 @@ public class ConditionEffect implements Listener
|
||||
|
||||
Manager.getDamagerManager().NewDamageEvent(ent, condition.GetSource(), null,
|
||||
DamageCause.CUSTOM, 0.1, false, true, false,
|
||||
condition.GetSource().getName(), "Poison");
|
||||
condition.GetSource() != null ? condition.GetSource().getName() : "The Mighty Defek7", "Poison");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -24,13 +24,14 @@ public final class DBPool
|
||||
BasicDataSource source = new BasicDataSource();
|
||||
source.addConnectionProperty("autoReconnect", "true");
|
||||
source.addConnectionProperty("allowMultiQueries", "true");
|
||||
source.addConnectionProperty("zeroDateTimeBehavior", "convertToNull");
|
||||
source.setDefaultTransactionIsolation(Connection.TRANSACTION_READ_COMMITTED);
|
||||
source.setDriverClassName("com.mysql.jdbc.Driver");
|
||||
source.setUrl(url);
|
||||
source.setUsername(username);
|
||||
source.setPassword(password);
|
||||
source.setMaxTotal(3);
|
||||
source.setMaxIdle(3);
|
||||
source.setMaxTotal(4);
|
||||
source.setMaxIdle(4);
|
||||
source.setTimeBetweenEvictionRunsMillis(180 * 1000);
|
||||
source.setSoftMinEvictableIdleTimeMillis(180 * 1000);
|
||||
|
||||
|
@ -2,6 +2,12 @@ package mineplex.staffServer;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.craftbukkit.v1_8_R3.CraftServer;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
import com.mojang.authlib.GameProfile;
|
||||
|
||||
import mineplex.core.account.CoreClientManager;
|
||||
import mineplex.core.achievement.AchievementManager;
|
||||
import mineplex.core.antihack.AntiHack;
|
||||
@ -9,6 +15,7 @@ import mineplex.core.chat.Chat;
|
||||
import mineplex.core.command.CommandCenter;
|
||||
import mineplex.core.creature.Creature;
|
||||
import mineplex.core.donation.DonationManager;
|
||||
import mineplex.core.incognito.IncognitoManager;
|
||||
import mineplex.core.inventory.InventoryManager;
|
||||
import mineplex.core.memory.MemoryFix;
|
||||
import mineplex.core.monitor.LagMeter;
|
||||
@ -26,12 +33,6 @@ import mineplex.staffServer.customerSupport.CustomerSupport;
|
||||
import mineplex.staffServer.salespackage.SalesPackageManager;
|
||||
import net.minecraft.server.v1_8_R3.MinecraftServer;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.craftbukkit.v1_8_R3.CraftServer;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
import com.mojang.authlib.GameProfile;
|
||||
|
||||
public class StaffServer extends JavaPlugin
|
||||
{
|
||||
private String WEB_CONFIG = "webServer";
|
||||
@ -60,7 +61,7 @@ public class StaffServer extends JavaPlugin
|
||||
preferenceManager.GiveItem = false;
|
||||
|
||||
Portal portal = new Portal(this, clientManager, serverStatusManager.getCurrentServerName());
|
||||
new Chat(this, clientManager, preferenceManager, new AchievementManager(new StatsManager(this, clientManager), clientManager, donationManager), serverStatusManager.getCurrentServerName());
|
||||
new Chat(this, null, clientManager, preferenceManager, new AchievementManager(new StatsManager(this, clientManager), clientManager, donationManager), serverStatusManager.getCurrentServerName());
|
||||
new MemoryFix(this);
|
||||
new FileUpdater(this, portal, serverStatusManager.getCurrentServerName(), serverStatusManager.getRegion());
|
||||
AntiHack.Initialize(this, punish, portal, preferenceManager, clientManager);
|
||||
|
@ -1,6 +1,10 @@
|
||||
package mineplex.staffServer.customerSupport;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
|
||||
import mineplex.core.MiniPlugin;
|
||||
import mineplex.core.account.CoreClient;
|
||||
@ -13,6 +17,7 @@ import mineplex.core.donation.DonationManager;
|
||||
import mineplex.core.donation.Donor;
|
||||
import mineplex.core.donation.repository.token.CoinTransactionToken;
|
||||
import mineplex.core.donation.repository.token.TransactionToken;
|
||||
import mineplex.serverdata.database.ResultSetCallable;
|
||||
import mineplex.staffServer.salespackage.SalesPackageManager;
|
||||
|
||||
import org.bukkit.GameMode;
|
||||
@ -27,13 +32,15 @@ import org.bukkit.event.player.PlayerJoinEvent;
|
||||
import org.bukkit.event.player.PlayerQuitEvent;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
public class CustomerSupport extends MiniPlugin
|
||||
public class CustomerSupport extends MiniPlugin implements ResultSetCallable
|
||||
{
|
||||
private CoreClientManager _clientManager;
|
||||
private DonationManager _donationManager;
|
||||
private SalesPackageManager _salesPackageManager;
|
||||
private CustomerSupportRepository _repository;
|
||||
|
||||
private NautHashMap<Player, HashSet<String>> _agentCacheMap = new NautHashMap<Player, HashSet<String>>();
|
||||
private NautHashMap<Integer, List<String>> _accountBonusLog = new NautHashMap<>();
|
||||
|
||||
public CustomerSupport(JavaPlugin plugin, CoreClientManager clientManager, DonationManager donationManager, SalesPackageManager salesPackageManager)
|
||||
{
|
||||
@ -42,6 +49,7 @@ public class CustomerSupport extends MiniPlugin
|
||||
_clientManager = clientManager;
|
||||
_donationManager = donationManager;
|
||||
_salesPackageManager = salesPackageManager;
|
||||
_repository = new CustomerSupportRepository(getPlugin());
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
@ -94,7 +102,18 @@ public class CustomerSupport extends MiniPlugin
|
||||
{
|
||||
CoreClient client = _clientManager.Get(playerName);
|
||||
Donor donor = _donationManager.Get(playerName);
|
||||
CustomerSupport instance = this;
|
||||
|
||||
runAsync(new Runnable()
|
||||
{
|
||||
public void run()
|
||||
{
|
||||
_repository.loadBonusLogForAccountId(client.getAccountId(), instance);
|
||||
|
||||
runSync(new Runnable()
|
||||
{
|
||||
public void run()
|
||||
{
|
||||
caller.sendMessage(C.cDGreen + C.Strike + "=============================================");
|
||||
caller.sendMessage(C.cBlue + "Name : " + C.cYellow + playerName);
|
||||
caller.sendMessage(C.cBlue + "Rank : " + C.cYellow + (client.GetRank() == null ? C.cRed + "Error rank null!" : (client.GetRank().Name.isEmpty() ? "Regular" : client.GetRank().Name)));
|
||||
@ -182,10 +201,25 @@ public class CustomerSupport extends MiniPlugin
|
||||
caller.sendMessage(C.cBlue + "Mythical Chests Received : " + C.cYellow + mythicalChestsReceived);
|
||||
caller.sendMessage(C.cBlue + "Winter Chests Received : " + C.cYellow + winterChestsReceived);
|
||||
caller.sendMessage(C.cBlue + "Valentines Gifts Received : " + C.cYellow + valentinesGiftsReceived);
|
||||
caller.sendMessage(C.cBlue + "Monthly Bonus Log (Last 6 entries):");
|
||||
|
||||
if (_accountBonusLog.containsKey(client.getAccountId()))
|
||||
{
|
||||
for (String logEntry : _accountBonusLog.get(client.getAccountId()))
|
||||
{
|
||||
caller.sendMessage(C.cYellow + logEntry);
|
||||
}
|
||||
}
|
||||
|
||||
caller.sendMessage(C.cDGreen + C.Strike + "=============================================");
|
||||
_salesPackageManager.displaySalesPackages(caller, playerName);
|
||||
caller.sendMessage(C.cDGreen + C.Strike + "=============================================");
|
||||
|
||||
_accountBonusLog.remove(client.getAccountId());
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
@ -215,4 +249,20 @@ public class CustomerSupport extends MiniPlugin
|
||||
|
||||
event.setCancelled(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void processResultSet(ResultSet resultSet) throws SQLException
|
||||
{
|
||||
List<String> log = new ArrayList<String>();
|
||||
int accountId = 0;
|
||||
|
||||
while (resultSet.next() && log.size() < 6)
|
||||
{
|
||||
accountId = resultSet.getInt(1);
|
||||
log.add("Received " + resultSet.getInt(3) + " " + resultSet.getString(2) + " on " + resultSet.getDate(4));
|
||||
}
|
||||
|
||||
if (accountId != 0)
|
||||
_accountBonusLog.put(accountId, log);
|
||||
}
|
||||
}
|
||||
|
@ -34,8 +34,8 @@ public class checkCommand extends CommandBase<CustomerSupport>
|
||||
{
|
||||
public void run()
|
||||
{
|
||||
Plugin.addAgentMapping(caller, name);
|
||||
Plugin.showPlayerInfo(caller, name);
|
||||
Plugin.addAgentMapping(caller, name);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -134,8 +134,8 @@ public class Arcade extends JavaPlugin
|
||||
StatsManager statsManager = new StatsManager(this, _clientManager);
|
||||
AchievementManager achievementManager = new AchievementManager(statsManager, _clientManager, _donationManager);
|
||||
FriendManager friendManager = new FriendManager(this, _clientManager, preferenceManager, portal);
|
||||
Chat chat = new Chat(this, _clientManager, preferenceManager, achievementManager, serverStatusManager.getCurrentServerName());
|
||||
new MessageManager(this, _clientManager, preferenceManager, ignoreManager, punish, friendManager, chat);
|
||||
Chat chat = new Chat(this, incognito, _clientManager, preferenceManager, achievementManager, serverStatusManager.getCurrentServerName());
|
||||
new MessageManager(this, incognito, _clientManager, preferenceManager, ignoreManager, punish, friendManager, chat);
|
||||
|
||||
BlockRestore blockRestore = new BlockRestore(this);
|
||||
|
||||
@ -157,7 +157,7 @@ public class Arcade extends JavaPlugin
|
||||
|
||||
//Arcade Manager
|
||||
PollManager pollManager = new PollManager(this, _clientManager, _donationManager);
|
||||
_gameManager = new ArcadeManager(this, serverStatusManager, ReadServerConfig(), _clientManager, _donationManager, _damageManager, statsManager, achievementManager, disguiseManager, creature, teleport, new Blood(this), chat, portal, preferenceManager, inventoryManager, packetHandler, cosmeticManager, projectileManager, petManager, hologramManager, webServerAddress, pollManager, npcmanager, customDataManager, punish);
|
||||
_gameManager = new ArcadeManager(this, serverStatusManager, ReadServerConfig(), _clientManager, _donationManager, _damageManager, statsManager, incognito, achievementManager, disguiseManager, creature, teleport, new Blood(this), chat, portal, preferenceManager, inventoryManager, packetHandler, cosmeticManager, projectileManager, petManager, hologramManager, webServerAddress, pollManager, npcmanager, customDataManager, punish);
|
||||
|
||||
new MemoryFix(this);
|
||||
new CustomTagFix(this, packetHandler);
|
||||
|
@ -34,6 +34,8 @@ import mineplex.core.facebook.FacebookManager;
|
||||
import mineplex.core.gadget.types.Gadget;
|
||||
import mineplex.core.gadget.types.GadgetType;
|
||||
import mineplex.core.hologram.HologramManager;
|
||||
import mineplex.core.incognito.IncognitoManager;
|
||||
import mineplex.core.incognito.events.IncognitoStatusChangeEvent;
|
||||
import mineplex.core.inventory.InventoryManager;
|
||||
import mineplex.core.itemstack.ItemStackFactory;
|
||||
import mineplex.core.movement.Movement;
|
||||
@ -86,7 +88,6 @@ import nautilus.game.arcade.game.GameTeam;
|
||||
import nautilus.game.arcade.game.games.event.EventModule;
|
||||
import nautilus.game.arcade.game.games.uhc.UHC;
|
||||
import nautilus.game.arcade.managers.GameAchievementManager;
|
||||
import nautilus.game.arcade.managers.chat.GameChatManager;
|
||||
import nautilus.game.arcade.managers.GameCreationManager;
|
||||
import nautilus.game.arcade.managers.GameFlagManager;
|
||||
import nautilus.game.arcade.managers.GameGemManager;
|
||||
@ -100,9 +101,9 @@ import nautilus.game.arcade.managers.GameStatManager;
|
||||
import nautilus.game.arcade.managers.GameTestingManager;
|
||||
import nautilus.game.arcade.managers.GameTournamentManager;
|
||||
import nautilus.game.arcade.managers.GameWorldManager;
|
||||
import nautilus.game.arcade.managers.HolidayManager;
|
||||
import nautilus.game.arcade.managers.IdleManager;
|
||||
import nautilus.game.arcade.managers.MiscManager;
|
||||
import nautilus.game.arcade.managers.chat.GameChatManager;
|
||||
import nautilus.game.arcade.player.ArcadePlayer;
|
||||
import nautilus.game.arcade.shop.ArcadeShop;
|
||||
import net.minecraft.server.v1_8_R3.EntityLiving;
|
||||
@ -191,6 +192,8 @@ public class ArcadeManager extends MiniPlugin implements IRelation
|
||||
private CustomDataManager _customDataManager;
|
||||
private Punish _punishmentManager;
|
||||
|
||||
private IncognitoManager _incognitoManager;
|
||||
|
||||
private TaskManager _taskManager;
|
||||
private PacketHandler _packetHandler;
|
||||
|
||||
@ -211,7 +214,7 @@ public class ArcadeManager extends MiniPlugin implements IRelation
|
||||
|
||||
public ArcadeManager(Arcade plugin, ServerStatusManager serverStatusManager, GameServerConfig serverConfig,
|
||||
CoreClientManager clientManager, DonationManager donationManager, DamageManager damageManager,
|
||||
StatsManager statsManager, AchievementManager achievementManager, DisguiseManager disguiseManager, Creature creature, Teleport teleport, Blood blood, Chat chat,
|
||||
StatsManager statsManager, IncognitoManager incognitoManager, AchievementManager achievementManager, DisguiseManager disguiseManager, Creature creature, Teleport teleport, Blood blood, Chat chat,
|
||||
Portal portal, PreferencesManager preferences, InventoryManager inventoryManager, PacketHandler packetHandler,
|
||||
CosmeticManager cosmeticManager, ProjectileManager projectileManager, PetManager petManager, HologramManager hologramManager, String webAddress, PollManager pollManager,
|
||||
NpcManager npcManager, CustomDataManager customDataManager, Punish punish)
|
||||
@ -223,6 +226,8 @@ public class ArcadeManager extends MiniPlugin implements IRelation
|
||||
// Modules
|
||||
_blockRestore = new BlockRestore(plugin);
|
||||
|
||||
_incognitoManager = incognitoManager;
|
||||
|
||||
_blood = blood;
|
||||
_preferencesManager = preferences;
|
||||
|
||||
@ -610,6 +615,41 @@ public class ArcadeManager extends MiniPlugin implements IRelation
|
||||
return true;
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void StaffIncognito(IncognitoStatusChangeEvent event)
|
||||
{
|
||||
if (event.getNewState() && _game != null && _game.IsPlaying(event.getPlayer()) && _game.IsLive())
|
||||
{
|
||||
addSpectator(event.getPlayer(), true);
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
|
||||
if (event.getNewState())
|
||||
{
|
||||
UtilServer.broadcast(F.sys("Quit", event.getPlayer().getName()));
|
||||
|
||||
if (_game == null || _game.GetState() != GameState.Live)
|
||||
{
|
||||
_specList.add(event.getPlayer());
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
UtilServer.broadcast(F.sys("Join", event.getPlayer().getName()));
|
||||
|
||||
if (_game != null && isSpectator(event.getPlayer()))
|
||||
{
|
||||
if (_game.GetState() != GameState.Live)
|
||||
{
|
||||
_specList.remove(event.getPlayer());
|
||||
}
|
||||
|
||||
event.show(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void MessageMOTD(ServerListPingEvent event)
|
||||
{
|
||||
@ -674,6 +714,15 @@ public class ArcadeManager extends MiniPlugin implements IRelation
|
||||
{
|
||||
String name = event.getPlayer().getName();
|
||||
|
||||
if (_incognitoManager.Get(event.getPlayer()).Status)
|
||||
{
|
||||
event.setJoinMessage(null);
|
||||
return;
|
||||
}
|
||||
|
||||
if (event.getJoinMessage() == null)
|
||||
return;
|
||||
|
||||
if (_game != null && _game.AnnounceJoinQuit)
|
||||
event.setJoinMessage(F.sys("Join", GetColor(event.getPlayer()) + name));
|
||||
|
||||
@ -684,8 +733,17 @@ public class ArcadeManager extends MiniPlugin implements IRelation
|
||||
@EventHandler
|
||||
public void MessageQuit(PlayerQuitEvent event)
|
||||
{
|
||||
if (_incognitoManager.Get(event.getPlayer()).Status)
|
||||
{
|
||||
event.setQuitMessage(null);
|
||||
return;
|
||||
}
|
||||
|
||||
String name = event.getPlayer().getName();
|
||||
|
||||
if (event.getQuitMessage() == null)
|
||||
return;
|
||||
|
||||
if (_game == null || _game.AnnounceJoinQuit)
|
||||
event.setQuitMessage(F.sys("Quit", GetColor(event.getPlayer()) + name));
|
||||
else
|
||||
@ -1084,6 +1142,11 @@ public class ArcadeManager extends MiniPlugin implements IRelation
|
||||
|
||||
public boolean IsObserver(Player player)
|
||||
{
|
||||
if (_incognitoManager.Get(player).Status)
|
||||
{
|
||||
_specList.add(player);
|
||||
}
|
||||
|
||||
return _specList.contains(player);
|
||||
}
|
||||
|
||||
|
@ -264,5 +264,4 @@ public enum GameType
|
||||
{
|
||||
return _display.getKitGameName();
|
||||
}
|
||||
|
||||
}
|
@ -55,7 +55,6 @@ import mineplex.core.common.util.UtilTabTitle;
|
||||
import mineplex.core.common.util.UtilTextMiddle;
|
||||
import mineplex.core.common.util.UtilTime;
|
||||
import mineplex.core.disguise.disguises.DisguisePlayer;
|
||||
import mineplex.core.elo.EloSettings;
|
||||
import mineplex.core.itemstack.ItemBuilder;
|
||||
import mineplex.core.packethandler.IPacketHandler;
|
||||
import mineplex.core.packethandler.PacketInfo;
|
||||
@ -162,106 +161,101 @@ public abstract class Game implements Listener
|
||||
protected String[] _help;
|
||||
|
||||
// Gameplay Flags
|
||||
public long GameTimeout = 1200000;
|
||||
|
||||
//Note: If any descriptions are inaccurate, feel free to let me know and/or fix them. Thanks. ~Joe Prezioso
|
||||
public GameOption<Long> GameTimeout = new GameOption<Long>((long)1200000.0, "Game Timeout", "Allotted time for game mode");
|
||||
public boolean Damage = true;
|
||||
public boolean DamagePvP = true;
|
||||
public boolean DamagePvE = true;
|
||||
public boolean DamageEvP = true;
|
||||
public boolean DamageSelf = true;
|
||||
public boolean DamageFall = true;
|
||||
public boolean DamageTeamSelf = false;
|
||||
public boolean DamageTeamOther = true;
|
||||
|
||||
public GameOption<Boolean> Damage = new GameOption<Boolean>(true, "Damage", "Does damage matter in this game mode?");
|
||||
public GameOption<Boolean> DamagePvP = new GameOption<Boolean>(true, "Damage PVP", "Players allowed to damage other players?");
|
||||
public GameOption<Boolean> DamagePvE = new GameOption<Boolean>(true, "Damage PVE", "Players allowed to damage monsters?");
|
||||
public GameOption<Boolean> DamageEvP = new GameOption<Boolean>(true, "Damage EVP", "Monsters allowed to damage players?");
|
||||
public GameOption<Boolean> DamageSelf = new GameOption<Boolean>(true, "Damage Self", "Players allowed to harm themselves?");
|
||||
public GameOption<Boolean> DamageFall = new GameOption<Boolean>(true, "Damage Fall", "Can players be harmed by falling?");
|
||||
public GameOption<Boolean> DamageTeamSelf = new GameOption<Boolean>(false, "Damage Team, Self", "Can players damage teammates?");
|
||||
public GameOption<Boolean> DamageTeamOther = new GameOption<Boolean>(true, "Damage Team, Other", "Can players damage opposing team's players?");
|
||||
public boolean BlockBreak = false;
|
||||
public boolean BlockBreakCreative = false;
|
||||
public HashSet<Integer> BlockBreakAllow = new HashSet<Integer>();
|
||||
public HashSet<Integer> BlockBreakDeny = new HashSet<Integer>();
|
||||
|
||||
public GameOption<Boolean> BlockBreak = new GameOption<Boolean>(false, "Block Break", "Can players break blocks?");
|
||||
//Really not sure about the description for this one...
|
||||
public GameOption<Boolean> BlockBreakCreative = new GameOption<Boolean>(false, "Block Break, Creative", "Can players break blocks in creative mode?");
|
||||
public GameOption<HashSet<Integer>> BlockBreakAllow = new GameOption<HashSet<Integer>>(new HashSet<Integer>(), "Block Break Allow", "Set of blocks players can break");
|
||||
public GameOption<HashSet<Integer>> BlockBreakDeny = new GameOption<HashSet<Integer>>(new HashSet<Integer>(), "Block Break Deny", "Set of blocks players can't break");
|
||||
public boolean BlockPlace = false;
|
||||
public boolean BlockPlaceCreative = false;
|
||||
public HashSet<Integer> BlockPlaceAllow = new HashSet<Integer>();
|
||||
public HashSet<Integer> BlockPlaceDeny = new HashSet<Integer>();
|
||||
|
||||
public GameOption<Boolean> BlockPlace = new GameOption<Boolean>(false, "Block Place", "Can players place blocks?");
|
||||
public GameOption<Boolean> BlockPlaceCreative = new GameOption<Boolean>(false, "Block Place, Creative", "Can players place blocks in creative mode?");
|
||||
public GameOption<HashSet<Integer>> BlockPlaceAllow = new GameOption<HashSet<Integer>>(new HashSet<Integer>(), "Block Place Allow", "Set of blocks players can place");
|
||||
public GameOption<HashSet<Integer>> BlockPlaceDeny = new GameOption<HashSet<Integer>>(new HashSet<Integer>(), "Block Place Deny", "Set of blocks players cannot place");
|
||||
public boolean ItemPickup = false;
|
||||
public HashSet<Integer> ItemPickupAllow = new HashSet<Integer>();
|
||||
public HashSet<Integer> ItemPickupDeny = new HashSet<Integer>();
|
||||
|
||||
public GameOption<Boolean> ItemPickup = new GameOption<Boolean>(false, "Item Pickup", "Are there items to pickup?");
|
||||
public GameOption<HashSet<Integer>> ItemPickupAllow = new GameOption<HashSet<Integer>>(new HashSet<Integer>(), "Item Pickup, Allow", "Items players can pick up");
|
||||
public GameOption<HashSet<Integer>> ItemPickupDeny = new GameOption<HashSet<Integer>>(new HashSet<Integer>(), "Item Pickup, Deny", "Items players cannot pick up");
|
||||
public boolean ItemDrop = false;
|
||||
public HashSet<Integer> ItemDropAllow = new HashSet<Integer>();
|
||||
public HashSet<Integer> ItemDropDeny = new HashSet<Integer>();
|
||||
|
||||
public GameOption<Boolean> ItemDrop = new GameOption<Boolean>(false, "Item Drop", "Can items drop?");
|
||||
public GameOption<HashSet<Integer>> ItemDropAllow = new GameOption<HashSet<Integer>>(new HashSet<Integer>(), "Item Drop Allow", "Set of items that can drop");
|
||||
public GameOption<HashSet<Integer>> ItemDropDeny = new GameOption<HashSet<Integer>>(new HashSet<Integer>(), "Item Drop Deny", "Set of items that cannot drop");
|
||||
public boolean InventoryOpenBlock = false;
|
||||
public boolean InventoryOpenChest = false;
|
||||
public boolean InventoryClick = false;
|
||||
|
||||
public GameOption<Boolean> InventoryOpenBlock = new GameOption<Boolean>(false, "Inventory Open Block", "Can players open inventory from a block?");
|
||||
public GameOption<Boolean> InventoryOpenChest = new GameOption<Boolean>(false, "Inventory Open Chest", "Can players open inventory from a chest?");
|
||||
public GameOption<Boolean> InventoryClick = new GameOption<Boolean>(false, "Inventory Click", "Can players click on their inventory?");
|
||||
public boolean PrivateBlocks = false;
|
||||
|
||||
public GameOption<Boolean> PrivateBlocks = new GameOption<Boolean>(false, "Private Blocks", "Can private blocks exist?");
|
||||
public boolean DeathOut = true;
|
||||
public boolean DeathDropItems = false;
|
||||
public boolean DeathMessages = true;
|
||||
public boolean AutomaticRespawn = true;
|
||||
|
||||
public GameOption<Boolean> DeathOut = new GameOption<Boolean>(true, "Death Out", "Are players out of the game upon death?");
|
||||
public GameOption<Boolean> DeathDropItems = new GameOption<Boolean>(false, "Death Drop Items", "Do players drop items upon death?");
|
||||
public GameOption<Boolean> DeathMessages = new GameOption<Boolean>(true, "Death Messages", "Display message upon death?");
|
||||
public GameOption<Boolean> AutomaticRespawn = new GameOption<Boolean>(true, "Automatic Respawn", "Do players automatically respawn on death?");
|
||||
public double DeathSpectateSecs = 0;
|
||||
public boolean DeathTeleport = true;
|
||||
|
||||
public GameOption<Double> DeathSpectateSecs = new GameOption<Double>(0.0, "Death Spectate Secs", "How many seconds players may spectate match while dead");
|
||||
public GameOption<Boolean> DeathTeleport = new GameOption<Boolean>(true, "Death Teleport", "Do players teleport upon death?");
|
||||
public boolean QuitOut = true;
|
||||
public boolean QuitDropItems = false;
|
||||
|
||||
public GameOption<Boolean> QuitOut = new GameOption<Boolean>(true, "Quit Out", "Are players allowed to quit?");
|
||||
public GameOption<Boolean> QuitDropItems = new GameOption<Boolean>(false, "Quit Drop Items", "Do players drop items if they quit?");
|
||||
public boolean IdleKickz = true;
|
||||
|
||||
public GameOption<Boolean> IdleKickz = new GameOption<Boolean>(true, "Idle Kickz", "Are idle players kicked?");
|
||||
public boolean CreatureAllow = false;
|
||||
public boolean CreatureAllowOverride = false;
|
||||
|
||||
public GameOption<Boolean> CreatureAllow = new GameOption<Boolean>(false, "Creature Allow", "Allow creatures to spawn?");
|
||||
public GameOption<Boolean> CreatureAllowOverride = new GameOption<Boolean>(false, "Creature Allow Override", "Can creatures spawn where they normally wouldn't?");
|
||||
public int WorldTimeSet = 12000;
|
||||
public boolean WorldWeatherEnabled = false;
|
||||
public int WorldWaterDamage = 0;
|
||||
public boolean WorldBoundaryKill = true;
|
||||
public boolean WorldBlockBurn = false;
|
||||
public boolean WorldBlockGrow = false;
|
||||
public boolean WorldFireSpread = false;
|
||||
public boolean WorldLeavesDecay = false;
|
||||
public boolean WorldSoilTrample = false;
|
||||
public boolean WorldBoneMeal = false;
|
||||
|
||||
//Still not quite sure what the descriptions for 'World Block Burn' and 'World Water Damage' should be
|
||||
public GameOption<Integer> WorldTimeSet = new GameOption<Integer>(12000, "World Time Set", "Set time in the world");
|
||||
public GameOption<Boolean> WorldWeatherEnabled = new GameOption<Boolean>(false, "Weather Enabled", "Is there weather in this game world?");
|
||||
public GameOption<Integer> WorldWaterDamage = new GameOption<Integer>(0, "Water Damage", "Can water hurt players?");
|
||||
public GameOption<Boolean> WorldBoundaryKill = new GameOption<Boolean>(true, "Boundary Kill", "Do players die when leaving the game's boundaries?");
|
||||
public GameOption<Boolean> WorldBlockBurn = new GameOption<Boolean>(false, "Block Burn", "Can world blocks burn?");
|
||||
public GameOption<Boolean> WorldBlockGrow = new GameOption<Boolean>(false, "Block Grow", "Do world blocks grow?");
|
||||
public GameOption<Boolean> WorldFireSpread = new GameOption<Boolean>(false, "Fire Spread", "Does fire spread to world blocks?");
|
||||
public GameOption<Boolean> WorldLeavesDecay = new GameOption<Boolean>(false, "Leaves Decay", "Do leaves decay?");
|
||||
public GameOption<Boolean> WorldSoilTrample = new GameOption<Boolean>(false, "Soil Trample", "Can soil be trampled?");
|
||||
public GameOption<Boolean> WorldBoneMeal = new GameOption<Boolean>(false, "Bone Meal", "Allow using bone meal?");
|
||||
public int HungerSet = -1;
|
||||
public int HealthSet = -1;
|
||||
|
||||
public GameOption<Integer> HungerSet = new GameOption<Integer>(-1, "Hunger Set", "Default hunger for players");
|
||||
public GameOption<Integer> HealthSet = new GameOption<Integer>(-1, "Health Set", "Default Health for players");
|
||||
public boolean PrepareFreeze = true;
|
||||
|
||||
public GameOption<Boolean> PrepareFreeze = new GameOption<Boolean>(true, "Prepare Freeze", "Freeze game while preparations are made?");
|
||||
private double _itemMergeRadius = 0;
|
||||
|
||||
private GameOption<Double> _itemMergeRadius = new GameOption<Double>(0.0, "Item Merge Radius", "Distance at which items merge");
|
||||
public boolean AnnounceStay = true;
|
||||
public boolean AnnounceJoinQuit = true;
|
||||
public boolean AnnounceSilence = true;
|
||||
|
||||
//really not sure what the descriptions should be for announcements ~JP
|
||||
public GameOption<Boolean> AnnounceStay = new GameOption<Boolean>(true, "Announce Stay", "Send message to announce player is staying?");
|
||||
public GameOption<Boolean> AnnounceJoinQuit = new GameOption<Boolean>(true, "Announce Join Quit", "Send message to announce player has quit?");
|
||||
public GameOption<Boolean> AnnounceSilence = new GameOption<Boolean>(true, "Announce Silence", "Silence all announcements?");
|
||||
public boolean DisplayLobbySide = true;
|
||||
|
||||
public GameOption<Boolean> DisplayLobbySide = new GameOption<Boolean>(true, "Display Lobby Side", "Show which side players are on in lobby?");
|
||||
public GameState KitRegisterState = GameState.Live;
|
||||
|
||||
public GameOption<GameState> KitRegisterState = new GameOption<GameState>(GameState.Live, "Kit Register State", "State of registered kits");
|
||||
public boolean JoinInProgress = false;
|
||||
|
||||
public GameOption<Boolean> JoinInProgress = new GameOption<Boolean>(false, "Join In Progress", "Allow players to join a game in progress?");
|
||||
public int TickPerTeleport = 1;
|
||||
|
||||
public GameOption<Integer> TickPerTeleport = new GameOption<Integer>(1, "Tick Per Teleport", "Number of ticks between teleports");
|
||||
public int FillTeamsInOrderToCount = -1;
|
||||
|
||||
public GameOption<Integer> FillTeamsInOrderToCount = new GameOption<Integer>(-1, "Fill Teams In Order To Count", "Number to fill teams to in order to count players");
|
||||
public boolean SpawnNearAllies = false;
|
||||
public boolean SpawnNearEnemies = false;
|
||||
|
||||
public GameOption<Boolean> SpawnNearAllies = new GameOption<Boolean>(false, "Spawn Near Allies", "Allow players to spawn near their allies?");
|
||||
public GameOption<Boolean> SpawnNearEnemies = new GameOption<Boolean>(false, "Spawn Near Enemies", "Allow players to spawn near their enemies?");
|
||||
public boolean StrictAntiHack = false;
|
||||
|
||||
public GameOption<Boolean> StrictAntiHack = new GameOption<Boolean>(false, "Strict Anti-Hack", "Turn on Strict Anti-Hack?");
|
||||
public boolean DisableKillCommand = true;
|
||||
|
||||
public GameOption<Boolean> DisableKillCommand = new GameOption<Boolean>(true, "Disable Kill Command", "Turn off kill command");
|
||||
public boolean GadgetsDisabled = true;
|
||||
|
||||
public GameOption<Boolean> GadgetsDisabled = new GameOption<Boolean>(true, "Gadgets Disabled", "Disable gadgets?");
|
||||
public boolean TeleportsDisqualify = true;
|
||||
|
||||
public GameOption<Boolean> TeleportsDisqualify = new GameOption<Boolean>(true, "Teleports Disqualify", "Teleporting disqualifies player?");
|
||||
|
||||
public GameOption<Boolean> DontAllowOverfill = new GameOption<Boolean>(false, "Don't Allow Overfill", "Don't let players overfill teams?");
|
||||
public boolean DontAllowOverfill = false;
|
||||
|
||||
// Addons
|
||||
public boolean CompassEnabled = false;
|
||||
@ -316,11 +310,8 @@ public abstract class Game implements Listener
|
||||
public String Winner = "Nobody";
|
||||
public GameTeam WinnerTeam = null;
|
||||
|
||||
//EloSetting - experimental (0 = disabled, 1 = background, 2 = full)
|
||||
public EloSettings EloSetting = new EloSettings(0);
|
||||
|
||||
public boolean EloRanking = false;
|
||||
public int EloStart = 1400;
|
||||
public int EloStart = 1000;
|
||||
|
||||
public boolean CanAddStats = true;
|
||||
public boolean CanGiveLoot = true;
|
||||
@ -716,11 +707,11 @@ public abstract class Game implements Listener
|
||||
|
||||
public GameTeam ChooseTeam(Player player)
|
||||
{
|
||||
if (FillTeamsInOrderToCount.getOption() != -1)
|
||||
if (FillTeamsInOrderToCount != -1)
|
||||
{
|
||||
for (int i = 0; i < _teamList.size(); i++)
|
||||
{
|
||||
if (_teamList.get(i).GetSize() < FillTeamsInOrderToCount.getOption())
|
||||
if (_teamList.get(i).GetSize() < FillTeamsInOrderToCount)
|
||||
{
|
||||
return _teamList.get(i);
|
||||
}
|
||||
@ -743,7 +734,7 @@ public abstract class Game implements Listener
|
||||
|
||||
public double GetKillsGems(Player killer, Player killed, boolean assist)
|
||||
{
|
||||
if (DeathOut.getOption())
|
||||
if (DeathOut)
|
||||
{
|
||||
if (!assist)
|
||||
{
|
||||
@ -1058,10 +1049,10 @@ public abstract class Game implements Listener
|
||||
|
||||
public DeathMessageType GetDeathMessageType()
|
||||
{
|
||||
if (!DeathMessages.getOption())
|
||||
if (!DeathMessages)
|
||||
return DeathMessageType.None;
|
||||
|
||||
if (this.DeathOut.getOption())
|
||||
if (this.DeathOut)
|
||||
return DeathMessageType.Detailed;
|
||||
|
||||
return DeathMessageType.Simple;
|
||||
@ -1131,7 +1122,7 @@ public abstract class Game implements Listener
|
||||
for (Player player : UtilServer.getPlayers())
|
||||
AnnounceGame(player);
|
||||
|
||||
if (AnnounceSilence.getOption())
|
||||
if (AnnounceSilence)
|
||||
Manager.GetChat().Silence(PrepareTime, false);
|
||||
}
|
||||
|
||||
@ -1216,7 +1207,7 @@ public abstract class Game implements Listener
|
||||
|
||||
UtilTextMiddle.display(winnerText, subColor + "won the game", 20, 120, 20);
|
||||
|
||||
if (AnnounceSilence.getOption())
|
||||
if (AnnounceSilence)
|
||||
Manager.GetChat().Silence(5000, false);
|
||||
}
|
||||
|
||||
@ -1273,166 +1264,10 @@ public abstract class Game implements Listener
|
||||
|
||||
UtilTextMiddle.display(winnerText, subColor + "won the game", 20, 120, 20);
|
||||
|
||||
adjustPlayerElo(places);
|
||||
|
||||
if (AnnounceSilence.getOption())
|
||||
if (AnnounceSilence)
|
||||
Manager.GetChat().Silence(5000, false);
|
||||
}
|
||||
|
||||
public int calculateEloMultiplier(int currentElo, int averageElo)
|
||||
{
|
||||
|
||||
int eloDifference = averageElo - currentElo;
|
||||
|
||||
if (Math.abs(eloDifference) <= 50)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
if (eloDifference >= 200)
|
||||
{
|
||||
return 3;
|
||||
}
|
||||
if (eloDifference >= 100)
|
||||
{
|
||||
return 2;
|
||||
}
|
||||
if (eloDifference > 50)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
if (eloDifference <= -200)
|
||||
{
|
||||
return -3;
|
||||
}
|
||||
if (eloDifference <= -100)
|
||||
{
|
||||
return -2;
|
||||
}
|
||||
if (eloDifference < -50)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
public void adjustPlayerElo(List<Player> places)
|
||||
{
|
||||
int averageElo = 0;
|
||||
for (Player player : UtilServer.getPlayers())
|
||||
{
|
||||
averageElo += Manager.getEloManager().getElo(player.getUniqueId(), GetName());
|
||||
}
|
||||
//average Elo of all players
|
||||
averageElo = averageElo/places.size();
|
||||
|
||||
for (Player player : UtilServer.getPlayers())
|
||||
{
|
||||
int currentElo = Manager.getEloManager().getElo(player.getUniqueId(), GetName());
|
||||
int lossMultiplier = 1;
|
||||
int sizeModifier = 3;
|
||||
int eloMultiplier = calculateEloMultiplier(currentElo, averageElo);
|
||||
|
||||
//nobody won, add 10 points to all players
|
||||
//Profitable enough see the match through to the end, but not enough for a stale-mate to be a more desirable outcome than 3rd place
|
||||
if (places == null || places.isEmpty())
|
||||
{
|
||||
int newElo = currentElo + 10;
|
||||
Manager.getEloManager().saveElo(player.getUniqueId(), GetName(), newElo);
|
||||
}
|
||||
//Top 3 players get 25, 20, and 15 points, respectively
|
||||
else
|
||||
{
|
||||
if (places.size() >= 1)
|
||||
{
|
||||
if (player.getUniqueId() == places.get(0).getUniqueId())
|
||||
{
|
||||
int newElo = currentElo + 25 + (5 * eloMultiplier);
|
||||
Manager.getEloManager().saveElo(player.getUniqueId(), GetName(), newElo);
|
||||
}
|
||||
}
|
||||
if (places.size() >= 5)
|
||||
{
|
||||
if (player.getUniqueId() == places.get(1).getUniqueId())
|
||||
{
|
||||
int newElo = currentElo + 20 + (5 * eloMultiplier);
|
||||
Manager.getEloManager().saveElo(player.getUniqueId(), GetName(), newElo);
|
||||
}
|
||||
}
|
||||
if (places.size() >= 6)
|
||||
{
|
||||
if (player.getUniqueId() == places.get(2).getUniqueId())
|
||||
{
|
||||
if (eloMultiplier < -2)
|
||||
{
|
||||
eloMultiplier = -2;
|
||||
}
|
||||
|
||||
int newElo = currentElo + 15 + (5 * eloMultiplier);
|
||||
Manager.getEloManager().saveElo(player.getUniqueId(), GetName(), newElo);
|
||||
}
|
||||
|
||||
}
|
||||
if (places.size() > 6 && places.size() <= 7)
|
||||
{
|
||||
if (player.getUniqueId() == places.get(5).getUniqueId())
|
||||
{
|
||||
if(eloMultiplier > 1)
|
||||
{
|
||||
eloMultiplier = 0;
|
||||
}
|
||||
|
||||
int newElo = currentElo - 5 + (5 * eloMultiplier);
|
||||
Manager.getEloManager().saveElo(player.getUniqueId(), GetName(), newElo);
|
||||
}
|
||||
}
|
||||
if (places.size() == 7)
|
||||
{
|
||||
if (player.getUniqueId() == places.get(6).getUniqueId())
|
||||
{
|
||||
if(eloMultiplier > 2)
|
||||
{
|
||||
eloMultiplier = 2;
|
||||
}
|
||||
|
||||
int newElo = currentElo - 10 + (5 * eloMultiplier);
|
||||
Manager.getEloManager().saveElo(player.getUniqueId(), GetName(), newElo);
|
||||
}
|
||||
}
|
||||
if (places.size() >= 8)
|
||||
{
|
||||
//for games with 8+ players, this if statement is just going to run 3 times to check 3 different places
|
||||
while(lossMultiplier != 0)
|
||||
{
|
||||
if (player.getUniqueId() == places.get(places.size() - sizeModifier).getUniqueId())
|
||||
{
|
||||
if(eloMultiplier > lossMultiplier)
|
||||
{
|
||||
eloMultiplier = lossMultiplier;
|
||||
}
|
||||
|
||||
int newElo = currentElo - (5 * lossMultiplier) + (5 * eloMultiplier);
|
||||
Manager.getEloManager().saveElo(player.getUniqueId(), GetName(), newElo);
|
||||
|
||||
if(sizeModifier >= 1)
|
||||
{
|
||||
lossMultiplier++;
|
||||
sizeModifier--;
|
||||
}
|
||||
else
|
||||
{
|
||||
lossMultiplier = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public void Announce(String message)
|
||||
{
|
||||
if (message == null)
|
||||
@ -1650,7 +1485,7 @@ public abstract class Game implements Listener
|
||||
@EventHandler
|
||||
public void classCombatCreatureAllow(ClassCombatCreatureAllowSpawnEvent event)
|
||||
{
|
||||
CreatureAllowOverride.setOption(event.getAllowed());
|
||||
CreatureAllowOverride = event.getAllowed();
|
||||
}
|
||||
|
||||
public boolean isInsideMap(Player player)
|
||||
@ -1671,17 +1506,17 @@ public abstract class Game implements Listener
|
||||
|
||||
public void setItemMergeRadius(double mergeRadius)
|
||||
{
|
||||
_itemMergeRadius.setOption(mergeRadius);
|
||||
_itemMergeRadius = mergeRadius;
|
||||
|
||||
if (WorldData.World != null)
|
||||
{
|
||||
((CraftWorld) WorldData.World).getHandle().spigotConfig.itemMerge = _itemMergeRadius.getOption();
|
||||
((CraftWorld) WorldData.World).getHandle().spigotConfig.itemMerge = _itemMergeRadius;
|
||||
}
|
||||
}
|
||||
|
||||
public double getItemMergeRadius()
|
||||
{
|
||||
return _itemMergeRadius.getOption();
|
||||
return _itemMergeRadius;
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
@ -1690,7 +1525,7 @@ public abstract class Game implements Listener
|
||||
if (event.getWorld().getName().equals(WorldData.GetFolder()))
|
||||
{
|
||||
System.out.println("Setting item merge radius for game to " + _itemMergeRadius);
|
||||
((CraftWorld) event.getWorld()).getHandle().spigotConfig.itemMerge = _itemMergeRadius.getOption();
|
||||
((CraftWorld) event.getWorld()).getHandle().spigotConfig.itemMerge = _itemMergeRadius;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -132,7 +132,7 @@ public class GameTeam
|
||||
public Location GetSpawn()
|
||||
{
|
||||
//Keep allies together
|
||||
if (!Host.IsLive() && Host.SpawnNearAllies.getOption())
|
||||
if (!Host.IsLive() && Host.SpawnNearAllies)
|
||||
{
|
||||
//Find Location Nearest Ally
|
||||
Location loc = UtilAlg.getLocationNearPlayers(_spawns, GetPlayers(true), Host.GetPlayers(true));
|
||||
@ -142,7 +142,7 @@ public class GameTeam
|
||||
//No allies existed spawned yet
|
||||
|
||||
//Spawn near enemies (used for SG)
|
||||
if (Host.SpawnNearEnemies.getOption())
|
||||
if (Host.SpawnNearEnemies)
|
||||
{
|
||||
loc = UtilAlg.getLocationNearPlayers(_spawns, Host.GetPlayers(true), Host.GetPlayers(true));
|
||||
if (loc != null)
|
||||
@ -159,7 +159,7 @@ public class GameTeam
|
||||
else
|
||||
{
|
||||
//Spawn near players
|
||||
if (Host.SpawnNearEnemies.getOption())
|
||||
if (Host.SpawnNearEnemies)
|
||||
{
|
||||
Location loc = UtilAlg.getLocationNearPlayers(_spawns, Host.GetPlayers(true), Host.GetPlayers(true));
|
||||
if (loc != null)
|
||||
|
@ -76,7 +76,7 @@ public abstract class TeamGame extends Game
|
||||
if (player.getWorld().getName().equalsIgnoreCase("world"))
|
||||
return;
|
||||
|
||||
if (!QuitOut.getOption())
|
||||
if (!QuitOut)
|
||||
{
|
||||
//Store
|
||||
_rejoinTime.put(player.getName(), System.currentTimeMillis());
|
||||
@ -97,7 +97,7 @@ public abstract class TeamGame extends Game
|
||||
@EventHandler(priority = EventPriority.LOWEST)
|
||||
public void PlayerLoginAllow(PlayerLoginEvent event)
|
||||
{
|
||||
if (!InProgress() || QuitOut.getOption())
|
||||
if (!InProgress() || QuitOut)
|
||||
return;
|
||||
|
||||
//Rejoined
|
||||
@ -135,7 +135,7 @@ public abstract class TeamGame extends Game
|
||||
@EventHandler
|
||||
public void playerRejoinGame(PlayerJoinEvent event)
|
||||
{
|
||||
if (!InProgress() || QuitOut.getOption())
|
||||
if (!InProgress() || QuitOut)
|
||||
return;
|
||||
|
||||
Player player = event.getPlayer();
|
||||
@ -150,7 +150,7 @@ public abstract class TeamGame extends Game
|
||||
@EventHandler
|
||||
public void PlayerRejoinExpire(UpdateEvent event)
|
||||
{
|
||||
if (event.getType() != UpdateType.SEC || QuitOut.getOption())
|
||||
if (event.getType() != UpdateType.SEC || QuitOut)
|
||||
return;
|
||||
|
||||
Iterator<String> rejoinIterator = _rejoinTime.keySet().iterator();
|
||||
@ -177,7 +177,7 @@ public abstract class TeamGame extends Game
|
||||
@EventHandler
|
||||
public void RejoinCommand(PlayerCommandPreprocessEvent event)
|
||||
{
|
||||
if (!QuitOut.getOption() && event.getPlayer().isOp() && event.getMessage().startsWith("/allowrejoin"))
|
||||
if (!QuitOut && event.getPlayer().isOp() && event.getMessage().startsWith("/allowrejoin"))
|
||||
{
|
||||
String[] toks = event.getMessage().split(" ");
|
||||
|
||||
@ -206,7 +206,7 @@ public abstract class TeamGame extends Game
|
||||
if (team.GetPlayers(true).size() > 0)
|
||||
teamsAlive.add(team);
|
||||
|
||||
if (!QuitOut.getOption())
|
||||
if (!QuitOut)
|
||||
{
|
||||
//Offline Player Team
|
||||
for (GameTeam team : RejoinTeam.values())
|
||||
|
@ -35,9 +35,9 @@ public class BaconBrawl extends SoloGame
|
||||
"Last pig in the arena wins!"
|
||||
});
|
||||
|
||||
DamageTeamSelf.setOption(true);
|
||||
HungerSet.setOption(20);
|
||||
PrepareFreeze.setOption(false);
|
||||
DamageTeamSelf = true;
|
||||
HungerSet = 20;
|
||||
PrepareFreeze = false;
|
||||
|
||||
registerChatStats(
|
||||
Kills,
|
||||
|
@ -54,13 +54,13 @@ public class KitMamaPig extends Kit
|
||||
disguise.setCustomNameVisible(false);
|
||||
Manager.GetDisguise().disguise(disguise);
|
||||
|
||||
Manager.GetGame().CreatureAllowOverride.setOption(true);
|
||||
Manager.GetGame().CreatureAllowOverride = true;
|
||||
final Pig pig = player.getWorld().spawn(player.getEyeLocation(), Pig.class);
|
||||
pig.setBaby();
|
||||
pig.setAgeLock(true);
|
||||
pig.setCustomName(C.cYellow + player.getName());
|
||||
pig.setCustomNameVisible(false);
|
||||
Manager.GetGame().CreatureAllowOverride.setOption(false);
|
||||
Manager.GetGame().CreatureAllowOverride = false;
|
||||
|
||||
player.setPassenger(pig);
|
||||
|
||||
|
@ -39,27 +39,27 @@ public class Barbarians extends SoloGame
|
||||
"Last player alive wins!"
|
||||
});
|
||||
|
||||
this.DamageTeamSelf.setOption(true);
|
||||
this.DamageTeamSelf = true;
|
||||
this.CompassEnabled = true;
|
||||
|
||||
this.BlockBreakAllow.getOption().add(5);
|
||||
this.BlockBreakAllow.getOption().add(17);
|
||||
this.BlockBreakAllow.getOption().add(18);
|
||||
this.BlockBreakAllow.getOption().add(20);
|
||||
this.BlockBreakAllow.getOption().add(30);
|
||||
this.BlockBreakAllow.getOption().add(47);
|
||||
this.BlockBreakAllow.getOption().add(53);
|
||||
this.BlockBreakAllow.getOption().add(54);
|
||||
this.BlockBreakAllow.getOption().add(58);
|
||||
this.BlockBreakAllow.getOption().add(64);
|
||||
this.BlockBreakAllow.getOption().add(83);
|
||||
this.BlockBreakAllow.getOption().add(85);
|
||||
this.BlockBreakAllow.getOption().add(96);
|
||||
this.BlockBreakAllow.getOption().add(125);
|
||||
this.BlockBreakAllow.getOption().add(126);
|
||||
this.BlockBreakAllow.getOption().add(134);
|
||||
this.BlockBreakAllow.getOption().add(135);
|
||||
this.BlockBreakAllow.getOption().add(136);
|
||||
this.BlockBreakAllow.add(5);
|
||||
this.BlockBreakAllow.add(17);
|
||||
this.BlockBreakAllow.add(18);
|
||||
this.BlockBreakAllow.add(20);
|
||||
this.BlockBreakAllow.add(30);
|
||||
this.BlockBreakAllow.add(47);
|
||||
this.BlockBreakAllow.add(53);
|
||||
this.BlockBreakAllow.add(54);
|
||||
this.BlockBreakAllow.add(58);
|
||||
this.BlockBreakAllow.add(64);
|
||||
this.BlockBreakAllow.add(83);
|
||||
this.BlockBreakAllow.add(85);
|
||||
this.BlockBreakAllow.add(96);
|
||||
this.BlockBreakAllow.add(125);
|
||||
this.BlockBreakAllow.add(126);
|
||||
this.BlockBreakAllow.add(134);
|
||||
this.BlockBreakAllow.add(135);
|
||||
this.BlockBreakAllow.add(136);
|
||||
|
||||
registerStatTrackers(
|
||||
new BlockBreakStatTracker(this, true)
|
||||
|
@ -55,9 +55,9 @@ public class BossBattles extends TeamGame
|
||||
"Fight some bosses"
|
||||
});
|
||||
|
||||
HungerSet.setOption(20);
|
||||
CreatureAllowOverride.setOption(true);
|
||||
PrepareFreeze.setOption(false);
|
||||
HungerSet = 20;
|
||||
CreatureAllowOverride = true;
|
||||
PrepareFreeze = false;
|
||||
|
||||
// registerChatStats(Kills);
|
||||
// Game giving constant errors when loading.
|
||||
|
@ -104,13 +104,13 @@ public class Ball
|
||||
_ball.remove();
|
||||
|
||||
//Spawn
|
||||
_host.CreatureAllowOverride.setOption(true);
|
||||
_host.CreatureAllowOverride = true;
|
||||
_ball = _ballSpawn.getWorld().spawn(_ballSpawn, Slime.class);
|
||||
_ball.setSize(2);
|
||||
|
||||
UtilEnt.Vegetate(_ball);
|
||||
UtilEnt.ghost(_ball, false, false);
|
||||
_host.CreatureAllowOverride.setOption(false);
|
||||
_host.CreatureAllowOverride = false;
|
||||
|
||||
_lastParticle = _ball.getLocation();
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user